var __defProp3 = Object.defineProperty; var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField3 = (obj, key, value) => { __defNormalProp3(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; (function(global2, factory) { typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["ddei-editor"] = {}, global2.Vue)); })(this, function(exports, vue) { var _a2; "use strict"; var __vite_style__ = document.createElement("style"); __vite_style__.textContent = `/**以下为菜单的样式 */ .ddei-editor-menu-dialog[data-v-1cde0d47] { width: 200px; background-color: var(--panel-background); font-size: 13px; color: var(--panel-title); display: none; position: absolute; font-weight: bolder; z-index: 999; border-radius: 4px; border: 0.3px solid var(--panel-border); box-shadow: -3px 3px 3px hsla(0, 0%, 0%, 0.25); } .ddei-editor-menu-dialog-item[data-v-1cde0d47] { height: 34px; width: 100%; display: flex; } .ddei-editor-menu-dialog-item[data-v-1cde0d47]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-editor-menu-dialog-item-icon[data-v-1cde0d47] { flex: 0 0 34px; display: flex; justify-content: center; align-items: center; } .ddei-editor-menu-dialog-item-icon .icon[data-v-1cde0d47] { width: 22px; height: 22px; margin: 0px 3px 0px 3px; } .ddei-editor-menu-dialog-item-content[data-v-1cde0d47] { flex: 1; display: flex; justify-content: start; align-items: center; } .ddei-editor-menu-dialog-item-desc[data-v-1cde0d47] { flex: 0 0 34px; } .ddei-editor-menu-dialog-item-hr[data-v-1cde0d47] { border: 0.5px solid var(--panel-border); width: 93%; margin: 1px auto; } .ddei-core-panel-topmenu[data-v-fefbc1f9] { background: var(--topmenu-background); } .ddei-core-panel-topmenu-quickbox[data-v-fefbc1f9] { background-color: var(--topmenu-header); width: 100%; height: 103px; display: flex; } .icon[data-v-ea668126] { color: var(--icon); } .ddei-core-panel-toolbox[data-v-ea668126] { user-select: none; text-align: center; display: flex; flex-flow: column; height: 100%; /**以下为收折框 */ } .ddei-core-panel-toolbox-header[data-v-ea668126] { background: var(--toolbox-header); border-bottom: 1px solid var(--toolbox-header); flex: 0 0 30px; display: flex; justify-content: center; align-items: center; padding: 0px 8px; } .ddei-core-panel-toolbox-header-morecontrol[data-v-ea668126] { display: flex; justify-content: center; align-items: center; flex: 0 1 100px; } .ddei-core-panel-toolbox-header-morecontrol .header-3[data-v-ea668126] { flex: 0 1 8px; } .ddei-core-panel-toolbox-header-morecontrol .header-4[data-v-ea668126] { font-size: 16px; flex: 0 1 70px; font-weight: bold; color: var(--toolbox-title); } .ddei-core-panel-toolbox-header-morecontrol[data-v-ea668126]:hover { background-color: var(--toolbox-hover); cursor: pointer; } .ddei-core-panel-toolbox-header .header-1[data-v-ea668126] { flex: 0 1 17px; } .ddei-core-panel-toolbox-header .header-2[data-v-ea668126] { font-size: 14px; } .ddei-core-panel-toolbox-header .header-7[data-v-ea668126] { font-size: 18px; } .ddei-core-panel-toolbox-header .header-7[data-v-ea668126]:hover { background-color: var(--toolbox-hover); cursor: pointer; } .ddei-core-panel-toolbox-header .icon1[data-v-ea668126] { font-size: 23px; } .ddei-core-panel-toolbox-header .icon2[data-v-ea668126] { font-size: 16px; } .ddei-core-panel-toolbox-searchbox[data-v-ea668126] { flex: 0 0 52px; display: flex; justify-content: center; align-items: center; background: var(--toolbox-background); } .ddei-core-panel-toolbox-searchbox-group[data-v-ea668126] { flex: 1; margin: 0 25px; height: 32px; background: var(--toolbox-header); border: 1px solid var(--toolbox-header); border-radius: 4px; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-toolbox-searchbox-group .icon[data-v-ea668126] { font-size: 24px; margin: 0 6px; } .ddei-core-panel-toolbox-searchbox-group .input[data-v-ea668126] { flex: 1 1 140px; height: 28px; width: 100%; border: transparent; outline: none; background: transparent; font-size: 16px; font-weight: 400; color: var(--toolbox-title); } .ddei-core-panel-toolbox-searchbox-group .input[data-v-ea668126]::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */ color: var(--placeholder); } .ddei-core-panel-toolbox-searchbox-group .input[data-v-ea668126]::-webkit-input-placeholder { /* WebKit browsers,webkit内核浏览器 */ color: var(--placeholder); } .ddei-core-panel-toolbox-searchbox-group .input[data-v-ea668126]:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: var(--placeholder); } .ddei-core-panel-toolbox-searchbox-group .input[data-v-ea668126]::-moz-placeholder { /* Mozilla Firefox 19+ */ color: var(--placeholder); } .ddei-core-panel-toolbox-searchbox-group .input[data-v-ea668126]:-ms-input-placeholder { /* Internet Explorer 10-11 */ color: var(--placeholder); } .ddei-core-panel-toolbox-searchbox-group .input[data-v-ea668126]::-ms-input-placeholder { /* Microsoft Edge */ color: var(--placeholder); } .ddei-core-panel-toolbox-groups[data-v-ea668126] { text-align: center; background: var(--toolbox-background, --panel-background); overflow-y: auto; display: flex; flex-flow: column; flex: 1 1 auto; } .ddei-core-panel-toolbox-groups-group[data-v-ea668126] { text-align: center; margin-bottom: 1px; } .ddei-core-panel-toolbox-groups-group-box[data-v-ea668126] { display: flex; height: 35px; background: var(--toolbox-header); user-select: none; justify-content: center; align-items: center; } .ddei-core-panel-toolbox-groups-group-box[data-v-ea668126]:hover { background-color: var(--toolbox-header); } .ddei-core-panel-toolbox-groups-group-box[data-v-ea668126]:active { background-color: var(--toolbox-header); } .ddei-core-panel-toolbox-groups-group-box .title[data-v-ea668126] { flex: 1; color: var(--toolbox-title); text-align: left; margin-left: 25px; font-size: 16px; font-weight: bold; } .ddei-core-panel-toolbox-groups-group-box .close[data-v-ea668126] { margin-right: 10px; font-size: 18px; } .ddei-core-panel-toolbox-groups-group-box .close[data-v-ea668126]:hover { color: var(--toolbox-title) hover; cursor: pointer; } .ddei-core-panel-toolbox-groups-group-itempanel[data-v-ea668126] { display: flex; flex-flow: row wrap; background: var(--toolbox-background); padding: 15px 15px 15px 15px; } .ddei-core-panel-toolbox-groups-group-itempanel-item[data-v-ea668126] { flex: 0 0 62px !important; height: 60px; margin: 15px 0px; display: flex; overflow: hidden; justify-content: center; align-items: center; flex-flow: column; } .ddei-core-panel-toolbox-groups-group-itempanel-item[data-v-ea668126]:hover { background: var(--toolbox-control-hover); outline: var(--toolbox-control-hover-outline); cursor: all-scroll; } .ddei-core-panel-toolbox-groups-group-itempanel-item .text[data-v-ea668126] { white-space: nowrap; text-align: center; font-size: 13px; font-weight: 400; color: var(--toolbox-control-title); } .ddei-core-panel-toolbox-groups-group-itempanel-item .icon[data-v-ea668126] { width: 90%; height: 90%; object-fit: contain; } .ddei-core-panel-toolbox-groups-group--expanded[data-v-ea668126] { background-color: var(--toolbox-header); } .ddei-editor-qcview[data-v-f305cac8] { height: 16px; background: var(--panel-header); border: 0.5pt solid var(--panel-border); display: flex; position: relative; } .ddei-editor-qcview-type[data-v-f305cac8] { flex: 0 0 30px; height: 14px; width: 20px; display: flex; justify-content: center; align-items: center; } .ddei-editor-qcview-type[data-v-f305cac8]:hover { background: var(--panel-hover); cursor: pointer; } .ddei-editor-qcview-type img[data-v-f305cac8] { display: block; float: left; } .ddei-editor-qcview-color[data-v-f305cac8] { flex: 1 1 15px; height: 13px; margin-left: 2px; margin-top: 1px; } .ddei-editor-qcview-color[data-v-f305cac8]:hover { outline: 0.5px solid var(--dot); box-sizing: border-box; outline-offset: 0.5px; } .ddei-editor-qcview-color--disabled[data-v-f305cac8] { background-color: var(--panel-disabled) !important; } .propertyview[data-v-156d5ed6] { flex-direction: column; background: var(--panel-background); display: flex; user-select: none; height: 100%; } .propertyview-header[data-v-156d5ed6] { background: var(--panel-header); border-bottom: 1px solid #D5D5DF; flex: 0 0 30px; display: flex; justify-content: center; align-items: center; } .propertyview-header .header-7[data-v-156d5ed6] { font-size: 18px; margin-left: 8px; margin-right: 4px; } .propertyview-header .header-7-expand[data-v-156d5ed6] { font-size: 18px; margin-left: 4px; margin-right: 4px; } .propertyview-header .ding[data-v-156d5ed6] { font-size: 20px; margin-right: 4px; } .propertyview .content[data-v-156d5ed6] { flex: 1; display: flex; } .propertyview-subgroup[data-v-156d5ed6] { flex: 1; display: flex; flex-flow: column; } .propertyview-subgroup-tabtitle[data-v-156d5ed6] { flex: 0 0 46px; display: flex; border-bottom: 1pt solid #ebebef; color: grey; } .propertyview-subgroup-tabtitle-item[data-v-156d5ed6] { flex: 1; text-align: center; font-size: 16px; font-weight: 400; color: var(--panel-title); display: flex; justify-content: center; align-items: center; } .propertyview-subgroup-tabtitle-item--selected[data-v-156d5ed6] { flex: 1; text-align: center; font-size: 16px; background-color: var(--background); font-weight: 400; color: var(--dot); border-bottom: 4px solid var(--dot); display: flex; justify-content: center; align-items: center; } .propertyview-subgroup-tabtitle-item[data-v-156d5ed6]:hover { color: var(--dot); cursor: pointer; } .propertyview-subgroup-tabpanel[data-v-156d5ed6] { text-align: center; background: var(--panel-background); overflow-y: auto; display: flex; flex-flow: column; flex: 1 1 auto; color: var(--panel-title); font-size: 15px; height: 100px; } .propertyview-subgroup-tabpanel span[data-v-156d5ed6] { color: red; } .propertyview-subgroup-tabpanel-editors-column[data-v-156d5ed6] { display: flex; flex-flow: column; margin-top: 10px; margin-bottom: 10px; } .propertyview-subgroup-tabpanel-editors-column .title[data-v-156d5ed6] { background: var(--panel-background); color: var(--panel-title); text-align: left; padding-left: 10px; margin: auto 0; margin-bottom: 5px; font-size: 15px; } .propertyview-subgroup-tabpanel-editors-column .editor[data-v-156d5ed6] { text-align: left; padding-left: 10px; } .propertyview-subgroup-tabpanel-editors-row[data-v-156d5ed6] { display: flex; margin-top: 10px; margin-bottom: 10px; } .propertyview-subgroup-tabpanel-editors-row .title[data-v-156d5ed6] { text-align: left; padding-left: 10px; flex: 0 0 100px; white-space: nowrap; /*文字不换行*/ overflow: hidden; /*超出部分隐藏*/ text-overflow: ellipsis; /*溢出部分用省略号表示*/ margin: auto 0; font-size: 15px; } .propertyview-subgroup-tabpanel-editors-row .editor[data-v-156d5ed6] { text-align: center; flex: 1; } .propertyview .empty-value[data-v-156d5ed6] { filter: opacity(50%); } .propertyview-groupview[data-v-156d5ed6] { flex: 0 0 28px; display: flex; flex-flow: column; border-left: 1px solid #E0E3E9; } .propertyview-groupview-items[data-v-156d5ed6] { flex: 1; display: flex; flex-flow: column; } .propertyview-groupview-items-item[data-v-156d5ed6] { flex: 0 0 16px; margin-top: 8px; margin-bottom: 8px; display: flex; flex-flow: column; justify-content: center; align-items: center; } .propertyview-groupview-items-item--selected[data-v-156d5ed6] { flex: 0 0 16px; margin-top: 8px; margin-bottom: 8px; display: flex; flex-flow: column; justify-content: center; align-items: center; } .propertyview-groupview-items-item--selected > svg[data-v-156d5ed6] { color: #1F72FF; } .propertyview--disabled[data-v-156d5ed6] { pointer-events: none !important; user-select: none !important; filter: opacity(70%); } .propertyview--disabled .propertyview-subgroup-tabpanel[data-v-156d5ed6] { pointer-events: none !important; user-select: none !important; filter: opacity(70%) !important; } .icon[data-v-cf0859cc] { color: var(--icon); } .ddei-core-panel-openfilesview[data-v-cf0859cc] { flex: 0 0 30.5px; background: var(--panel-background); border-top: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border); display: flex; user-select: none; align-items: center; } .ddei-core-panel-openfilesview-expandbox[data-v-cf0859cc] { flex: 0 0 28px; display: flex; justify-content: center; align-items: center; height: 100%; } .ddei-core-panel-openfilesview-expandbox[data-v-cf0859cc]:hover { background: var(--panel-hover); cursor: pointer; } .ddei-core-panel-openfilesview-expandbox .icon[data-v-cf0859cc] { font-size: 18px; } .ddei-core-panel-openfilesview .addfile[data-v-cf0859cc] { margin: 0px 10px; font-size: 24px; } .ddei-core-panel-openfilesview-movebox[data-v-cf0859cc] { flex: 0 0 25px; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-openfilesview-movebox[data-v-cf0859cc]:hover { background: var(--panel-hover); cursor: pointer; } .ddei-core-panel-openfilesview-movebox img[data-v-cf0859cc] { filter: brightness(60%); margin-top: 4px; } .ddei-core-panel-openfilesview-item[data-v-cf0859cc] { height: 100%; flex: 0 0 195px; display: flex; justify-content: center; align-items: center; background-color: var(--panel-background); border-right: 1px solid var(--panel-hover); } .ddei-core-panel-openfilesview-item .icon[data-v-cf0859cc] { font-size: 16px; flex: 0 0 42px; text-align: center; } .ddei-core-panel-openfilesview-item .close[data-v-cf0859cc] { font-size: 18px; flex: 0 0 24px; margin-left: -5px; } .ddei-core-panel-openfilesview-item .textcontent[data-v-cf0859cc] { font-size: 15px; flex: 0 0 130px; width: 130px; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-openfilesview-item .textcontent .text[data-v-cf0859cc] { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: var(--panel-title); flex: 1; font-size: 16px; font-weight: 400; } .ddei-core-panel-openfilesview-item span .dirty[data-v-cf0859cc] { color: red; width: 10px; flex: 0 0 10px; font-size: 18px; text-align: right; } .ddei-core-panel-openfilesview-item[data-v-cf0859cc]:hover { background: var(--panel-hover); } .ddei-core-panel-openfilesview-item--selected[data-v-cf0859cc] { background: var(--panel-selected); } .ddei-core-panel-openfilesview-item--selected .textcontent .text[data-v-cf0859cc] { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; flex: 1; color: var(--panel-title); } .ddei-editor-canvasview { flex: 1; overflow: hidden; position: relative; background-color: var(--panel-header); } .ddei-editor-canvasview-contentlayer { overflow: hidden; width: 100%; height: 100%; z-index: 50; position: absolute; pointer-events: none; } .ddei-core-panel-bottommenu[data-v-5ec138cc] { height: 30px; display: flex; color: var(--text); background: var(--background); justify-content: center; align-items: center; font-size: 16px; } .ddei-core-panel-eimport[data-v-9c97ea48] { height: 103px; width: 260px; flex: 0 1 260px; display: grid; grid-template-rows: 20px 57px 26px; grid-template-columns: 1fr; text-align: center; } .ddei-core-panel-eimport .content[data-v-9c97ea48] { display: flex; justify-content: center; align-items: center; padding: 0px 4px; } .ddei-core-panel-eimport .content .part[data-v-9c97ea48] { flex: 1; padding: 0px 2px; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-eimport .content .part .button-v[data-v-9c97ea48] { flex: 1; height: 50px; border-radius: 4px; display: flex; flex-direction: column; align-items: center; } .ddei-core-panel-eimport .content .part .button-v[data-v-9c97ea48]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-core-panel-eimport .content .part .button-v-selected[data-v-9c97ea48] { flex: 1; height: 50px; background-color: var(--panel-selected); border-radius: 4px; display: flex; flex-direction: column; align-items: center; } .ddei-core-panel-eimport .content .part .button-v-selected .text[data-v-9c97ea48] { color: var(--panel-title-selected); } .ddei-core-panel-eimport .content .part .button-v-disabled[data-v-9c97ea48] { flex: 1; height: 50px; cursor: not-allowed; display: flex; flex-direction: column; align-items: center; background-color: var(--panel-disabled); } .ddei-core-panel-eimport .content .part .button-v-disabled > span[data-v-9c97ea48] { color: var(--panel-title-disabled); } .ddei-core-panel-eimport .content .part .button-v-disabled .text[data-v-9c97ea48] { color: var(--panel-title-disabled); } .ddei-core-panel-eimport .content .part .text[data-v-9c97ea48] { flex: 0 0 20px; white-space: nowrap; font-size: 14px; font-weight: 400; color: var(--panel-title); } .ddei-core-panel-eimport .tail[data-v-9c97ea48] { display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 400; color: var(--panel-title); } .ddei-core-panel-fileinfo[data-v-b1753b91] { height: 103px; width: 230px; flex: 0 1 230px; display: grid; grid-template-rows: 20px 57px 26px; grid-template-columns: 1fr; text-align: center; } .ddei-core-panel-fileinfo .content[data-v-b1753b91] { display: flex; justify-content: center; align-items: center; border-right: 1px solid var(--panel-border); padding: 0px 4px; } .ddei-core-panel-fileinfo .content .part[data-v-b1753b91] { padding: 0px 2px; flex: 1; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-fileinfo .content .part .button-v[data-v-b1753b91] { flex: 1; height: 50px; display: flex; flex-direction: column; align-items: center; } .ddei-core-panel-fileinfo .content .part .button-v .text[data-v-b1753b91] { white-space: nowrap; flex: 0 0 13px; font-size: 14px; font-weight: 400; color: var(--panel-title); } .ddei-core-panel-fileinfo .content .part .button-v[data-v-b1753b91]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-core-panel-fileinfo .content .part .button-h[data-v-b1753b91] { flex: 1; display: flex; flex-direction: column; margin-top: -2px; } .ddei-core-panel-fileinfo .content .part .button-h .button[data-v-b1753b91] { flex: 1; display: flex; justify-content: center; align-items: center; border-radius: 4px; } .ddei-core-panel-fileinfo .content .part .button-h .button .icon[data-v-b1753b91] { font-size: 28px; flex: 1; } .ddei-core-panel-fileinfo .content .part .button-h .button .text[data-v-b1753b91] { white-space: nowrap; flex: 0 0 25px; font-size: 14px; font-weight: 400; color: var(--panel-title); } .ddei-core-panel-fileinfo .content .part .button-h .button[data-v-b1753b91]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-core-panel-fileinfo .tail[data-v-b1753b91] { display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 400; color: var(--panel-title); border-right: 1px solid var(--panel-border); } .ddei-core-panel-fileoperate[data-v-891d9231] { width: 150px; height: 90px; border-right: 1px solid #e0e0e0; grid-template-rows: 30px 30px 20px; grid-template-columns: 1fr; display: grid; gap: 4px; padding-right: 4px; } .ddei-core-panel-fileoperate-item[data-v-891d9231] { margin: auto; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px; } .ddei-core-panel-fileoperate-item-text[data-v-891d9231] { text-align: center; font-size: 12px; grid-column: 1/5; color: var(--panel-title); } .ddei-core-panel-fileoperate-item-box[data-v-891d9231] { width: 30px; height: 50px; color: var(--panel-title); border-radius: 4px; font-size: 12px; display: grid; grid-template-rows: 25px 25px 10px; grid-template-columns: 1fr; } .ddei-core-panel-fileoperate-item-box div[data-v-891d9231] { margin: auto; } .ddei-core-panel-fileoperate-item-box img[data-v-891d9231] { filter: brightness(45%) drop-shadow(0.2px 0px 0.2px var(--panel-title)); width: 16px; height: 16px; margin: auto; } .ddei-core-panel-fileoperate-item-box[data-v-891d9231]:hover { background-color: var(--panel-hover); border-radius: 4px; } .ddei-core-panel-fontandtext[data-v-84f4d012] { height: 103px; display: grid; grid-template-rows: 20px 57px 26px; grid-template-columns: 1fr; text-align: center; } .ddei-core-panel-fontandtext .content[data-v-84f4d012] { display: flex; flex-direction: column; padding-left: 16px; border-right: 1px solid var(--panel-border); } .ddei-core-panel-fontandtext .content .buttons[data-v-84f4d012] { flex: 1; } .ddei-core-panel-fontandtext .content .buttons > div[data-v-84f4d012] { float: left; margin-right: 10px; } .ddei-core-panel-fontandtext .content .buttons .mg16[data-v-84f4d012] { margin-right: 3px; } .ddei-core-panel-fontandtext .content .buttons .mg165[data-v-84f4d012] { margin-right: 5px; } .ddei-core-panel-fontandtext .content .buttons .mg14[data-v-84f4d012] { margin-right: 3px; margin-left: -3px; } .ddei-core-panel-fontandtext .content .buttons .mg17[data-v-84f4d012] { margin-right: 8px; } .ddei-core-panel-fontandtext .content .buttons .b1[data-v-84f4d012] { width: 152px; margin-right: 0px; } .ddei-core-panel-fontandtext .content .buttons .b2[data-v-84f4d012] { width: 64px; } .ddei-core-panel-fontandtext .content .buttons .b4[data-v-84f4d012] { margin-right: 33px; } .ddei-core-panel-fontandtext .content .buttons .b5[data-v-84f4d012] { margin-top: 1px; margin-right: 17px; } .ddei-core-panel-fontandtext .content .buttons .b6[data-v-84f4d012] { margin-top: 1px; margin-right: 15px; } .ddei-core-panel-fontandtext .tail[data-v-84f4d012] { display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 400; color: var(--panel-title); border-right: 1px solid var(--panel-border); } .ddei-core-panel-operate[data-v-fc2f1000] { height: 103px; width: 230px; flex: 0 1 230px; display: grid; grid-template-rows: 20px 57px 26px; grid-template-columns: 1fr; text-align: center; } .ddei-core-panel-operate .content[data-v-fc2f1000] { display: flex; justify-content: center; align-items: center; border-right: 1px solid var(--panel-border); padding: 0px 4px; } .ddei-core-panel-operate .content .part[data-v-fc2f1000] { padding: 0px 2px; flex: 1; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-operate .content .part .button-v[data-v-fc2f1000] { display: flex; flex-direction: column; flex: 1; height: 50px; border-radius: 4px; align-items: center; } .ddei-core-panel-operate .content .part .button-v[data-v-fc2f1000]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-core-panel-operate .content .part .button-v--selected[data-v-fc2f1000] { flex: 1; height: 50px; display: flex; flex-direction: column; background-color: var(--panel-selected); border-radius: 4px; } .ddei-core-panel-operate .content .part .button-v--selected .text[data-v-fc2f1000] { color: var(--panel-title-selected); } .ddei-core-panel-operate .content .part .button-v--disabled[data-v-fc2f1000] { flex: 1; height: 50px; display: flex; flex-direction: column; cursor: not-allowed; align-items: center; background-color: var(--panel-disabled); } .ddei-core-panel-operate .content .part .button-v--disabled .icon[data-v-fc2f1000] { filter: grayscale(1); opacity: 40%; } .ddei-core-panel-operate .content .part .button-v--disabled .text[data-v-fc2f1000] { color: var(--panel-title-disabled); } .ddei-core-panel-operate .content .part .text[data-v-fc2f1000] { font-size: 14px; white-space: nowrap; font-weight: 400; color: var(--panel-title); } .ddei-core-panel-operate .tail[data-v-fc2f1000] { display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 400; color: var(--panel-title); border-right: 1px solid var(--panel-border); } .ddei-core-panel-sort[data-v-9f739241] { height: 103px; width: 230px; flex: 0 1 230px; display: grid; grid-template-rows: 20px 57px 26px; grid-template-columns: 1fr; text-align: center; } .ddei-core-panel-sort .content[data-v-9f739241] { display: flex; justify-content: center; align-items: center; padding: 0px 4px; border-right: 1px solid var(--panel-border); } .ddei-core-panel-sort .content .part[data-v-9f739241] { flex: 1; padding: 0px 2px; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-sort .content .part .button-v[data-v-9f739241] { flex: 1; height: 50px; border-radius: 4px; } .ddei-core-panel-sort .content .part .button-v[data-v-9f739241]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-core-panel-sort .content .part .button-v--selected[data-v-9f739241] { flex: 1; height: 50px; background-color: var(--panel-selected); border-radius: 4px; } .ddei-core-panel-sort .content .part .button-v--selected .text[data-v-9f739241] { color: var(--panel-title-selected); } .ddei-core-panel-sort .content .part .button-v--disabled[data-v-9f739241] { flex: 1; height: 50px; cursor: not-allowed; background-color: var(--panel-disabled); } .ddei-core-panel-sort .content .part .button-v--disabled > span[data-v-9f739241] { color: var(--panel-title-disabled); } .ddei-core-panel-sort .content .part .button-v--disabled .icon[data-v-9f739241] { filter: grayscale(1); opacity: 40%; } .ddei-core-panel-sort .content .part .button-v--disabled .text[data-v-9f739241] { color: var(--panel-title-disabled); } .ddei-core-panel-sort .content .part .text[data-v-9f739241] { height: 20px; font-size: 14px; white-space: nowrap; font-weight: 400; color: var(--panel-title); margin-top: -3px; } .ddei-core-panel-sort .content .part .extbtn[data-v-9f739241] { font-size: 12px; vertical-align: top; } .ddei-core-panel-sort .tail[data-v-9f739241] { display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 400; color: var(--panel-title); border-right: 1px solid var(--panel-border); } .ddei-core-panel-quickstyle[data-v-109430c5] { width: 430px; height: 90px; border-right: 1px solid #e0e0e0; grid-template-rows: 20px 20px 20px 20px; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; display: grid; padding-right: 10px; } .ddei-core-panel-quickstyle-item[data-v-109430c5] { margin: auto; } .ddei-core-panel-quickstyle-item-box[data-v-109430c5] { width: 60px; height: 20px; color: black; text-align: center; border-radius: 4px; font-size: 14px; margin-top: 2px; } .ddei-core-panel-quickstyle-item-box img[data-v-109430c5] { margin-top: 3px; filter: brightness(45%) drop-shadow(0.2px 0px 0.2px #000); float: left; margin-left: 2px; } .ddei-core-panel-quickstyle-item-box div[data-v-109430c5] { float: left; margin-left: 3px; } .ddei-core-panel-quickstyle-item-box-selected[data-v-109430c5] { width: 25px; height: 25px; text-align: center; background-color: #e4e4e8; border-radius: 4px; } .ddei-core-panel-quickstyle-item-box-selected img[data-v-109430c5] { margin-top: 4px; filter: brightness(45%) drop-shadow(0.2px 0px 0.2px #000); } .ddei-core-panel-quickstyle-item-box[data-v-109430c5]:hover { background-color: #e9e9ee; border-radius: 4px; } .ddei-core-panel-quickstyle-item-box-template[data-v-109430c5] { width: 350px; height: 55px; margin-top: 4px; border-radius: 4px; padding-left: 5px; background: white; display: flex; } .ddei-core-panel-quickstyle-item-box-template-item[data-v-109430c5] { height: 34px; margin: auto; flex: 0 0 34px; color: black; border-radius: 4px; border: 1px solid black; text-align: center; padding-top: 3px; } .ddei-core-panel-quickstyle-item-box-template-item[data-v-109430c5]:hover { outline: 0.5px solid #017fff; box-sizing: border-box; outline-offset: 3px; } .ddei-core-panel-quickstyle-item-box-template-icon[data-v-109430c5] { width: 20px; grid-template-rows: 17px 17px 17px; grid-template-columns: 1fr; margin: auto; display: grid; margin-top: -2px; margin-right: 5px; } .ddei-core-panel-quickstyle-item-box-template-icon img[data-v-109430c5] { margin-top: 5px; margin-left: 8px; filter: brightness(80%) drop-shadow(0.1px 0px 0.1px #000); } .ddei-core-panel-quickstyle-item-text[data-v-109430c5] { text-align: center; font-family: "Microsoft YaHei"; font-size: 12px; color: #787878; margin-top: 8px; } .ddei-core-panel-tool[data-v-d02823f2] { height: 103px; width: 200px; flex: 0 1 200px; display: grid; grid-template-rows: 20px 57px 26px; grid-template-columns: 1fr; text-align: center; } .ddei-core-panel-tool .content[data-v-d02823f2] { display: flex; justify-content: center; align-items: center; border-right: 1px solid var(--panel-border); padding: 0px 4px; } .ddei-core-panel-tool .content .part[data-v-d02823f2] { flex: 1; display: flex; justify-content: center; align-items: center; padding: 0px 2px; } .ddei-core-panel-tool .content .part .button-v[data-v-d02823f2] { display: flex; flex-direction: column; flex: 1; height: 50px; border-radius: 4px; align-items: center; } .ddei-core-panel-tool .content .part .button-v[data-v-d02823f2]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-core-panel-tool .content .part .button-v--selected[data-v-d02823f2] { flex: 1; display: flex; flex-direction: column; height: 50px; background-color: var(--panel-selected); border-radius: 4px; align-items: center; } .ddei-core-panel-tool .content .part .button-v--selected .text[data-v-d02823f2] { color: var(--panel-title-selected); } .ddei-core-panel-tool .content .part .button-v--disabled[data-v-d02823f2] { flex: 1; height: 50px; display: flex; flex-direction: column; cursor: not-allowed; align-items: center; background-color: var(--panel-disabled); } .ddei-core-panel-tool .content .part .button-v--disabled .icon[data-v-d02823f2] { filter: grayscale(1); opacity: 40%; } .ddei-core-panel-tool .content .part .button-v--disabled .text[data-v-d02823f2] { color: var(--panel-title-disabled); } .ddei-core-panel-tool .content .part .text[data-v-d02823f2] { flex: 0 0 13px; font-size: 14px; white-space: nowrap; font-weight: 400; color: var(--panel-title); } .ddei-core-panel-tool .tail[data-v-d02823f2] { display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 400; color: var(--panel-title); border-right: 1px solid var(--panel-border); } .ddei-core-panel-bottom-shapecount[data-v-91252de3] { flex: 0 0 100px; display: block; font-size: 15px; text-align: center; } .ddei-core-panel-bottom-managelayers[data-v-e3adc5da] { flex: 0 0 30px; display: flex; align-items: center; justify-content: center; } .ddei-core-panel-bottom-managelayers .icon[data-v-e3adc5da] { font-size: 20px; } .ddei-core-panel-bottom-managelayers[data-v-e3adc5da]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-panel-bottom-play[data-v-7e2fc5b7] { flex: 0 0 35px; display: flex; align-items: center; justify-content: center; } .ddei-core-panel-bottom-suitratio[data-v-4eeb5012] { flex: 0 0 30px; display: flex; align-items: center; justify-content: center; } .ddei-core-panel-bottom-suitratio .icon[data-v-4eeb5012] { font-size: 20px; } .ddei-core-panel-bottom-suitratio[data-v-4eeb5012]:hover { background-color: var(--panel-hover); cursor: pointer; } .expbtn[data-v-f8d489b0] { width: 14px; font-size: 14px; } .icon[data-v-f8d489b0] { font-size: 20px; width: 20px; height: 20px; } .ddei-core-panel-bottom-changeratio[data-v-f8d489b0] { flex: 0 0 157px; display: flex; justify-content: center; align-items: center; font-size: 15px; } .ddei-core-panel-bottom-changeratio span[data-v-f8d489b0] { float: left; width: 36px; text-align: center; margin-left: 5px; margin-right: 5px; } .ddei-core-panel-bottom-changeratio div[data-v-f8d489b0] { float: left; padding-left: 5px; padding-right: 5px; display: flex; align-items: center; justify-content: center; } .ddei-core-panel-bottom-changeratio input[data-v-f8d489b0] { float: left; width: 100px; border-radius: 4px; } .ddei-core-panel-bottom-changeratio__combox[data-v-f8d489b0] { float: left; padding-left: 5px; padding-right: 5px; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-bottom-changeratio__combox__dialog[data-v-f8d489b0]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-panel-bottom-addpage[data-v-d059d47d] { flex: 0 0 40px; display: flex; justify-content: center; align-items: center; margin-left: 10px; } .ddei-core-panel-bottom-addpage .icon[data-v-d059d47d] { font-size: 20px; } .ddei-core-panel-bottom-pages[data-v-d059d47d] { font-size: 15px; flex: 1; display: block; text-align: center; } .ddei-core-panel-bottom-pages-movebox[data-v-d059d47d] { width: 25px; height: 27px; float: left; text-align: center; } .ddei-core-panel-bottom-pages-movebox .icon[data-v-d059d47d] { font-size: 20px; } .ddei-core-panel-bottom-pages-movebox[data-v-d059d47d]:hover { background: #ebebef; cursor: pointer; } .ddei-core-panel-bottom-pages-movebox .icon[data-v-d059d47d] { height: 27px; } .ddei-core-panel-bottom-pages-page[data-v-d059d47d] { float: left; height: 27px; border-right: 1px solid var(--panel-border); padding: 0 10px; text-align: center; } .ddei-core-panel-bottom-pages-page span[data-v-d059d47d] { height: 27px; width: 80px; padding-left: 3px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-flex; align-items: center; background: var(--panel-background); } .ddei-core-panel-bottom-pages-page span[data-v-d059d47d]:hover { color: var(--dot); cursor: pointer; background: var(--background); } .ddei-core-panel-bottom-pages-page--selected[data-v-d059d47d] { float: left; height: 27px; border-right: 1px solid var(--panel-border); padding: 0 10px; text-align: center; } .ddei-core-panel-bottom-pages-page--selected span[data-v-d059d47d] { height: 27px; width: 80px; padding-left: 3px; background: var(--panel-selected); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: var(--dot); font-weight: bold; display: inline-flex; align-items: center; } .ddei-core-panel-toolbox-simple[data-v-bd214554] { text-align: center; position: absolute; z-index: 99999; border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 5px; overflow: hidden; background-color: var(--panel-background); display: flex; justify-content: start; align-items: center; } .ddei-core-panel-toolbox-simple .item[data-v-bd214554] { width: 30px; height: 30px; border-radius: 3px; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-toolbox-simple .item > img[data-v-bd214554] { margin-top: 2px; margin-left: 2px; } .ddei-core-panel-toolbox-simple .item[data-v-bd214554]:hover { background-color: #e2dede; cursor: pointer; } .ddei-core-panel-toolbox-simple .item-icon-html[data-v-bd214554] { width: 30px; height: 30px; display: flex; justify-content: center; align-items: center; } .ddei-core-panel-toolbox-simple .item-icon-html[data-v-bd214554] > * { width: 28px !important; height: 28px !important; } .ddei-core-panel-toolbox-simple .item-selected[data-v-bd214554] { background-color: #e2dede; } .ddei-core-panel-toolbox-simple .item-block[data-v-bd214554] { width: 10px; height: 10px; } .ddei-core-panel-toolbox-simple .item-drag[data-v-bd214554] { width: 100%; height: 10px; background-color: #efefef; } .ddei-core-panel-toolbox-simple .item-drag[data-v-bd214554]:hover { background-color: var(--dot); cursor: grab; } .ddei-core-panel-toolbox-simple .item-drag-2[data-v-bd214554] { height: 100%; width: 10px; background-color: #efefef; } .ddei-core-panel-toolbox-simple .item-drag-2[data-v-bd214554]:hover { background-color: var(--dot); cursor: grab; } .ddei-core-panel-topmenu-simple[data-v-52f75ccc] { text-align: center; position: absolute; color: var(--text); z-index: 99999; border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 5px; overflow: hidden; background-color: var(--panel-background); display: flex; font-size: 14px; justify-content: start; align-items: center; } .ddei-core-panel-topmenu-simple .item[data-v-52f75ccc] { min-width: 60px; padding: 0 10px; height: 24px; border-radius: 3px; display: flex; justify-content: center; align-items: center; border-right: 0.5px solid #e2dede; border-top-right-radius: 0px; border-bottom-right-radius: 0px; } .ddei-core-panel-topmenu-simple .item > div[data-v-52f75ccc] { width: 100%; } .ddei-core-panel-topmenu-simple .item[data-v-52f75ccc]:hover { background-color: #e2dede; cursor: pointer; border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .ddei-core-panel-topmenu-simple .item-selected[data-v-52f75ccc] { background-color: #e2dede; } .ddei-core-panel-topmenu-simple .item-block[data-v-52f75ccc] { width: 10px; height: 10px; } .ddei-core-panel-topmenu-simple .item-drag[data-v-52f75ccc] { width: 100%; height: 10px; background-color: #efefef; } .ddei-core-panel-topmenu-simple .item-drag[data-v-52f75ccc]:hover { background-color: var(--dot); cursor: grab; } .ddei-core-panel-topmenu-simple .item-drag-2[data-v-52f75ccc] { height: 100%; width: 10px; background-color: #efefef; } .ddei-core-panel-topmenu-simple .item-drag-2[data-v-52f75ccc]:hover { background-color: var(--dot); cursor: grab; } .ddei-editor-quickifat-item-box[data-v-4ef00c85] { width: 22px; display: flex; text-align: center; } .ddei-editor-quickifat-item-box--disabled[data-v-4ef00c85] { pointer-events: none; filter: grayscale(1); opacity: 40%; background: var(--panel-disabled); cursor: not-allowed; } .ddei-editor-quickifat-item-box[data-v-4ef00c85]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-editor-quickifat-item-box .magtop-1[data-v-4ef00c85] { margin-top: -1px; } .ddei-editor-quickifat-item-box .magtop-2[data-v-4ef00c85] { margin-top: -2px; } .ddei-editor-quickifat-item-box .magtop-3[data-v-4ef00c85] { margin-top: -3px; } .ddei-pv-border-dash-combox[data-v-8ff63c75] { height: 28px; } .ddei-pv-border-dash-combox--disabled .textinput[data-v-8ff63c75] { background-color: var(--panel-background); height: 28px; justify-content: center; align-items: center; } .ddei-pv-border-dash-combox .textinput[data-v-8ff63c75] { width: 100%; padding-right: 5px; border: 0.5px solid var(--panel-border); border-radius: 4px; display: flex; justify-content: center; align-items: center; padding-left: 5px; height: 28px; } .ddei-pv-border-dash-combox .textinput[data-v-8ff63c75]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-border-dash-combox .textinput .div_input[data-v-8ff63c75] { flex: 1 1 calc(100% - 10px); width: calc(100% - 10px); height: 3px; } .ddei-pv-border-dash-combox .textinput div[data-v-8ff63c75] { flex: 0 0 20px; } .icon[data-v-8ff63c75] { font-size: 16px; } .ddei_pv_border_weight_combox[data-v-e7c6034b] { height: 28px; } .ddei_pv_border_weight_combox_disabled .textinput[data-v-e7c6034b] { background-color: #d2d2d2; height: 28px; justify-content: center; align-items: center; } .ddei_pv_border_weight_combox .textinput[data-v-e7c6034b] { width: 100%; padding-right: 5px; border: 0.5px solid #d2d2d2; border-radius: 4px; display: flex; justify-content: center; align-items: center; padding-left: 5px; height: 28px; } .ddei_pv_border_weight_combox .textinput[data-v-e7c6034b]:hover { border: 1px solid #017fff; box-sizing: border-box; } .ddei_pv_border_weight_combox .textinput .div_input[data-v-e7c6034b] { flex: 1 1 calc(100% - 10px); width: calc(100% - 10px); height: 3px; } .ddei_pv_border_weight_combox .textinput div[data-v-e7c6034b] { flex: 0 0 20px; } .icon[data-v-e7c6034b] { font-size: 16px; } .ddei-editor-quick-fat-item-box[data-v-b43b0371] { width: 24px; display: flex; justify-content: center; align-items: center; } .ddei-editor-quick-fat-item-box[data-v-b43b0371]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-editor-quick-fat-item-box--selected[data-v-b43b0371] { background-color: var(--panel-selected); } .ddei-editor-quick-fat-item-box--disabled[data-v-b43b0371] { background-color: var(--panel-disabled); pointer-events: none; cursor: not-allowed; filter: grayscale(1); opacity: 40%; } .ddei-editor-quick-fat-item-box .rotate-90[data-v-b43b0371] { transform: rotate(90deg); } .ddei-editor-quick-fat-item-box .ext-underline[data-v-b43b0371] { margin-top: 5.5px; font-size: 16px; } .ddei-editor-quick-fat-item-box .magtop-1[data-v-b43b0371] { margin-top: -1px; } .ddei-editor-quick-fat-item-box .magtop-2[data-v-b43b0371] { margin-top: -2px; } .ddei-editor-quick-fat-item-box .magtop-3[data-v-b43b0371] { margin-top: -3px; } .ddei-editor-quick-fat-item-box[data-v-019ae087] { width: 15px; height: 24px; overflow: hidden; display: flex; align-items: center; flex-direction: column; } .ddei-editor-quick-fat-item-box .icon[data-v-019ae087] { flex: 0 0 16px; } .ddei-editor-quick-fat-item-box .colorbar[data-v-019ae087] { width: 100%; flex: 0 0 3px; } .ddei-editor-quick-fat-item-box .colinput[data-v-019ae087] { border: none; outline: none; display: block; margin-top: 5px; } .ddei-editor-quick-fat-item-box .magtop-1[data-v-019ae087] { margin-top: -1px; } .ddei-editor-quick-fat-item-box[data-v-019ae087]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-editor-quick-fat-item-box--disabled[data-v-019ae087] { background-color: var(--panel-disabled); pointer-events: none; cursor: not-allowed; filter: grayscale(1); opacity: 40%; } /*字体选择框*/ .ddei-editor-quick-fat-item-fontfamily[data-v-ec936992] { background-color: var(--panel-background); height: 24px; display: flex; border-top-left-radius: 4px; border-bottom-left-radius: 4px; justify-content: center; align-items: center; border: 1px solid var(--panel-border); border-right: none; box-sizing: border-box; } .ddei-editor-quick-fat-item-fontfamily[data-v-ec936992]:hover { border: 0.5px solid var(--dot); box-sizing: border-box; } .ddei-editor-quick-fat-item-fontfamily--disabled[data-v-ec936992]:hover { background-color: var(--panel-disabled); cursor: not-allowed !important; } .ddei-editor-quick-fat-item-fontfamily_input[data-v-ec936992] { width: calc(100% - 20px); border: transparent; outline: none; font-size: 15px; color: var(--panel-title); background: transparent; } .ddei-editor-quick-fat-item-fontfamily_combox[data-v-ec936992] { height: 24px; display: flex; justify-content: center; align-items: center; } .ddei-editor-quick-fat-item-fontfamily_combox .iconfont-45[data-v-ec936992] { font-size: 13px; } /*字体大小设置框 */ .ddei-editor-quick-fat-item-fontsize[data-v-4fcf2a95] { background-color: var(--panel-background); height: 24px; display: flex; justify-content: center; align-items: center; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border: 1px solid var(--panel-border); } .ddei-editor-quick-fat-item-fontsize[data-v-4fcf2a95]:hover { border: 0.5px solid var(--dot); } .ddei-editor-quick-fat-item-fontsize--disabled[data-v-4fcf2a95]:hover { background-color: var(--panel-disabled); cursor: not-allowed !important; } .ddei-editor-quick-fat-item-fontsize_input[data-v-4fcf2a95] { width: calc(100% - 20px); border: transparent; outline: none; color: var(--panel-title); font-size: 15px; background: transparent; } .ddei-editor-quick-fat-item-fontsize_combox[data-v-4fcf2a95] { height: 24px; display: flex; justify-content: center; align-items: center; } .ddei-editor-quick-fat-item-fontsize_combox .iconfont-45[data-v-4fcf2a95] { font-size: 13px; } .ddei-editor-quick-fat-item-box[data-v-4fcf2a95] { width: 25px; height: 25px; text-align: center; } .ddei-editor-quick-fat-item-box--disabled[data-v-4fcf2a95] { color: var(--panel-title-disabled); filter: brightness(200%) !important; } .ddei-editor-quick-fat-item-box--disabled[data-v-4fcf2a95]:hover { background-color: var(--panel-disabled); cursor: not-allowed; } .ddei-editor-quick-fat-item-box[data-v-4fcf2a95]:hover { background-color: var(--panel-hover); border-radius: 4px; } .ddei_pv_line_point_combox[data-v-5b25a083] { height: 28px; } .ddei_pv_line_point_combox_disabled .textinput[data-v-5b25a083] { background-color: var(--panel-background); height: 28px; justify-content: center; align-items: center; } .ddei_pv_line_point_combox .textinput[data-v-5b25a083] { width: 100%; padding-right: 5px; border: 0.5px solid var(--panel-border); border-radius: 4px; display: flex; justify-content: center; align-items: center; padding-left: 5px; height: 28px; } .ddei_pv_line_point_combox .textinput[data-v-5b25a083]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei_pv_line_point_combox .textinput .div_input[data-v-5b25a083] { flex: 1 1 calc(100% - 10px); width: calc(100% - 10px); text-overflow: ellipsis; overflow: hidden; } .ddei_pv_line_point_combox .textinput div[data-v-5b25a083] { flex: 0 0 20px; } .icon[data-v-5b25a083] { font-size: 16px; } .ddei-pv-line-type-combox[data-v-739c83c3] { width: 24px; display: flex; justify-content: center; align-items: center; } .ddei-pv-line-type-combox[data-v-739c83c3]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-pv-line-type-combox--disabled[data-v-739c83c3] { pointer-events: none; background-color: var(--panel-disabled); color: var(--panel-title-disabled); cursor: not-allowed; } .ddei-editor-quick-fat-item-box[data-v-781d8566] { width: 24px; display: flex; justify-content: center; align-items: center; } .ddei-editor-quick-fat-item-box[data-v-781d8566]:hover { cursor: pointer; background-color: var(--panel-hover); } .ddei-editor-quick-fat-item-box--selected[data-v-781d8566] { background-color: var(--panel-selected); } .ddei-editor-quick-fat-item-box--disabled[data-v-781d8566] { pointer-events: none; color: var(--panel-title-selected); cursor: not-allowed; background-color: var(--panel-selected); } .ddei-editor-quick-fat-item-box .rotate-90[data-v-781d8566] { transform: rotate(90deg); } .ddei-editor-quick-fat-item-box .ext-underline[data-v-781d8566] { margin-top: 5.5px; font-size: 16px; } .ddei-editor-quick-fat-item-box .magtop-1[data-v-781d8566] { margin-top: -1px; } .ddei-editor-quick-fat-item-box .magtop-2[data-v-781d8566] { margin-top: -2px; } .ddei-editor-quick-fat-item-box .magtop-3[data-v-781d8566] { margin-top: -3px; } .ddei-editor-layout-standrad[data-v-43088579] { width: 100%; height: 100%; display: flex; flex-direction: column; } .ddei-editor-layout-standrad .top[data-v-43088579] { border: 0.5px solid var(--border); border-bottom: none; } .ddei-editor-layout-standrad .bottom[data-v-43088579] { border: 0.5px solid var(--border); border-top: none; } .ddei-editor-layout-standrad .body[data-v-43088579] { display: flex; overflow: hidden; flex: 1 1 calc(100vh - 134px); } .ddei-editor-layout-standrad .body .left[data-v-43088579] { flex: 0 1 292px; border: 1px solid var(--border); overflow: hidden; } .ddei-editor-layout-standrad .body .middle[data-v-43088579] { flex: 1 1 auto; display: flex; flex-direction: column; } .ddei-editor-layout-standrad .body .right[data-v-43088579] { flex: 0 1 292px; border: 1px solid var(--border); overflow: hidden; } .ddei-editor-layout-standrad > img { -webkit-user-drag: none; user-drag: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .ddei-editor-layout-standrad > div { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .ddei-editor-layout-simple[data-v-4920d2e1] { width: 100%; height: 100vh; display: flex; flex-direction: column; } .ddei-editor-layout-simple .top[data-v-4920d2e1] { flex: 0 1 auto; } .ddei-editor-layout-simple .middle[data-v-4920d2e1] { flex: 1 1 auto; display: flex; } .ddei-editor-layout-simple .bottom[data-v-4920d2e1] { flex: 0 1 auto; } .ddei-editor-layout-simple .bottom[data-v-4920d2e1] > * { height: 30px; border-top: 0.5px solid var(--border); } .ddei-editor-layout-simple > img { -webkit-user-drag: none; user-drag: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .ddei-editor-layout-simple > div { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .ddei-core-dialog-align[data-v-6574182d] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 180px; position: absolute; background-color: var(--panel-background); height: 180px; z-index: 999; } .ddei-core-dialog-align .content[data-v-6574182d] { width: 100%; max-height: 180px; overflow-y: auto; user-select: none; } .ddei-core-dialog-align .content .title[data-v-6574182d] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 17px; } .ddei-core-dialog-align .content .group[data-v-6574182d] { color: black; flex: 1 1 40px; width: 100%; border-top: 1px solid var(--panel-border); } .ddei-core-dialog-align .content .group .title[data-v-6574182d] { color: var(--panel-title); flex: 0 0 30px; width: 100%; display: flex; justify-content: start; align-items: center; padding-left: 10px; font-size: 15px; border: none; } .ddei-core-dialog-align .content .group .group_content[data-v-6574182d] { width: 100%; display: grid; gap: 10px; grid-template-columns: 1fr 1fr 1fr; padding: 3px 0px; } .ddei-core-dialog-align .content .group .group_content .item[data-v-6574182d] { outline: none; width: 30px; height: 25px; margin: auto; background: transparent; border-radius: 4px; display: flex; justify-content: center; align-items: center; cursor: pointer; } .ddei-core-dialog-align .content .group .group_content .itembox_disabled[data-v-6574182d] { color: var(--panel-title-disabled); text-decoration: line-through; } .ddei-core-dialog-align .content .group .group_content .itembox_disabled[data-v-6574182d]:hover { cursor: not-allowed !important; } .ddei-core-dialog-align .content .group .group_content .item[data-v-6574182d]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-align .content .group .group_content .text[data-v-6574182d] { flex: 1; text-align: center; white-space: nowrap; width: 100%; } .ddei-core-dialog-align .content .group .group_content .icon[data-v-6574182d] { font-size: 28px; } /**以下是设置缩放比例的弹出框 */ .ddei-core-dialog-changeratio[data-v-561a0908] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 180px; position: absolute; background-color: var(--panel-background); z-index: 999; } .ddei-core-dialog-changeratio .content[data-v-561a0908] { width: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; } .ddei-core-dialog-changeratio .content .title[data-v-561a0908] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 16px; border-bottom: 1px solid var(--panel-border); } .ddei-core-dialog-changeratio .content .group[data-v-561a0908] { color: var(--panel-title); flex: 1 1 40px; width: 100%; } .ddei-core-dialog-changeratio .content .group .group_content[data-v-561a0908] { width: 100%; display: flex; flex-direction: column; } .ddei-core-dialog-changeratio .content .group .group_content .item[data-v-561a0908] { flex: 0 0 30px; padding: 0 10px; display: flex; justify-content: start; align-items: center; cursor: pointer; } .ddei-core-dialog-changeratio .content .group .group_content .item > input[data-v-561a0908] { border: none; outline: none; background: var(--panel-background); color: var(--panel-title); } .ddei-core-dialog-changeratio .content .group .group_content .item_selected[data-v-561a0908] { font-weight: bold; } .ddei-core-dialog-changeratio .content .group .group_content .item[data-v-561a0908]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-choosecontrolgroup[data-v-d0e0cfd9] { display: none; overflow: hidden; width: 420px; position: absolute; height: 400px; z-index: 999; } .ddei-core-dialog-choosecontrolgroup .content[data-v-d0e0cfd9] { width: 210px; border: 1px solid var(--panel-border); background-color: var(--panel-background); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; height: 400px; overflow-y: auto; overflow-x: hidden; user-select: none; } .ddei-core-dialog-choosecontrolgroup .content .title[data-v-d0e0cfd9] { color: var(--panel-title); height: 36px; width: 100%; display: flex; justify-content: start; align-items: center; font-size: 16px; padding-left: 10px; border-bottom: 1px solid var(--panel-border); } .ddei-core-dialog-choosecontrolgroup .content .group[data-v-d0e0cfd9] { color: var(--panel-title); flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: start; align-items: center; } .ddei-core-dialog-choosecontrolgroup .content .group .item[data-v-d0e0cfd9] { flex: 0 0 36px; width: 210px; padding: 0 20px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-choosecontrolgroup .content .group .item .groupicon[data-v-d0e0cfd9] { width: 34px; font-size: 26px; } .ddei-core-dialog-choosecontrolgroup .content .group .item .groupname[data-v-d0e0cfd9] { white-space: nowrap; flex: 0 1 160px; margin: 0 10px; font-size: 16px; } .ddei-core-dialog-choosecontrolgroup .content .group .item .expand[data-v-d0e0cfd9] { font-size: 22px; } .ddei-core-dialog-choosecontrolgroup .content .group .item[data-v-d0e0cfd9]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-choosecontrolgroup .subcontent[data-v-d0e0cfd9] { display: none; position: absolute; width: 160px; border: 1px solid var(--panel-border); background-color: var(--panel-background); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; max-height: 400px; overflow-y: auto; overflow-x: hidden; user-select: none; } .ddei-core-dialog-choosecontrolgroup .subcontent .title[data-v-d0e0cfd9] { color: var(--panel-title); height: 36px; width: 100%; display: flex; justify-content: start; align-items: center; font-size: 16px; padding-left: 10px; } .ddei-core-dialog-choosecontrolgroup .subcontent .group[data-v-d0e0cfd9] { color: var(--panel-title); flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: start; align-items: center; } .ddei-core-dialog-choosecontrolgroup .subcontent .group .item[data-v-d0e0cfd9] { flex: 0 0 36px; width: 160px; padding: 0 10px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-choosecontrolgroup .subcontent .group .item > input[data-v-d0e0cfd9] { flex: 0 0 20px; width: 14px; height: 14px; } .ddei-core-dialog-choosecontrolgroup .subcontent .group .item .groupname[data-v-d0e0cfd9] { white-space: nowrap; flex: 0 1 120px; margin-left: 10px; font-size: 16px; } .ddei-core-dialog-choosecontrolgroup .subcontent .group .item[data-v-d0e0cfd9]:hover { background-color: var(--panel-hover); } /**以下为询问框的样式 */ .ddei-core-dialog-closefile[data-v-929ef917] { width: 420px; height: 165px; background: var(--panel-background); border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 12px; display: none; position: absolute; overflow: hidden; z-index: 999; top: 50%; left: 50%; transform: translate(-50%, -50%); } .ddei-core-dialog-closefile .content[data-v-929ef917] { width: 420px; height: 165px; display: flex; flex-direction: column; padding: 0 24px; } .ddei-core-dialog-closefile .content .header[data-v-929ef917] { flex: 0 0 55px; display: flex; align-items: center; font-size: 18px; font-weight: 400; color: var(--panel-title); } .ddei-core-dialog-closefile .content .header > span[data-v-929ef917] { margin: 0 2px; } .ddei-core-dialog-closefile .content .header .close[data-v-929ef917] { font-size: 22px; } .ddei-core-dialog-closefile .content .header .warn[data-v-929ef917] { font-size: 20px !important; color: #F05B13; } .ddei-core-dialog-closefile .content .msg[data-v-929ef917] { flex: 0 0 55px; display: flex; justify-content: center; align-items: center; font-size: 16px; font-weight: 400; color: var(--panel-title); } .ddei-core-dialog-closefile .content .tail[data-v-929ef917] { flex: 0 0 55px; display: flex; align-items: center; text-align: center; justify-content: end; } .ddei-core-dialog-closefile .content .button[data-v-929ef917] { flex: 0 0 70px; height: 32px; background: var(--panel-header); border: 1px solid var(--panel-border); border-radius: 6px; font-size: 16px; font-weight: 400; color: var(--panel-title); margin-left: 13px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-closefile .content .button[data-v-929ef917]:hover { color: white; background: var(--dot); cursor: pointer; } .ddei-core-dialog-closefile .content .button-main[data-v-929ef917] { color: white; background: var(--dot); } /**以下为询问框的样式 */ .ddei-core-dialog-collfile[data-v-068f2102] { width: 420px; height: 165px; background: var(--panel-background); border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 12px; display: none; position: absolute; overflow: hidden; z-index: 999; top: 50%; left: 50%; transform: translate(-50%, -50%); } .ddei-core-dialog-collfile .content[data-v-068f2102] { width: 420px; height: 165px; display: flex; flex-direction: column; padding: 0 24px; } .ddei-core-dialog-collfile .content .header[data-v-068f2102] { flex: 0 0 55px; display: flex; align-items: center; font-size: 18px; font-weight: 400; color: var(--panel-title); } .ddei-core-dialog-collfile .content .header > span[data-v-068f2102] { margin: 0 2px; } .ddei-core-dialog-collfile .content .header .close[data-v-068f2102] { font-size: 22px; } .ddei-core-dialog-collfile .content .header .warn[data-v-068f2102] { font-size: 20px !important; } .ddei-core-dialog-collfile .content .msg[data-v-068f2102] { flex: 0 0 55px; display: flex; justify-content: center; align-items: center; font-size: 16px; font-weight: 400; color: var(--panel-title); } .ddei-core-dialog-collfile .content .tail[data-v-068f2102] { flex: 0 0 55px; display: flex; align-items: center; text-align: center; justify-content: end; } .ddei-core-dialog-collfile .content .button[data-v-068f2102] { flex: 0 0 70px; height: 32px; white-space: nowrap; background: var(--panel-header); border: 1px solid var(--panel-border); border-radius: 6px; font-size: 16px; font-weight: 400; color: var(--panel-title); margin-left: 13px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-collfile .content .button[data-v-068f2102]:hover { color: white; background: var(--dot); cursor: pointer; } .ddei-core-dialog-collfile .content .button-main[data-v-068f2102] { color: white; background: var(--dot); } /**以下是选择颜色的弹出框 */ .ddei-core-dialog-linepointtype[data-v-ec516138] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 240px; position: absolute; background-color: var(--panel-background); height: 250px; z-index: 999; user-select: none; } .ddei-core-dialog-linepointtype .content[data-v-ec516138] { width: 100%; max-height: 250px; overflow-y: auto; } .ddei-core-dialog-linepointtype .content .group[data-v-ec516138] { color: var(--panel-title); width: 100%; } .ddei-core-dialog-linepointtype .content .group .title[data-v-ec516138] { color: var(--panel-title); flex: 0 0 30px; width: 100%; display: flex; justify-content: start; align-items: center; padding-left: 10px; font-size: 15px; border: none; margin-top: 5px; margin-bottom: 5px; } .ddei-core-dialog-linepointtype .content .group .group_content[data-v-ec516138] { width: 100%; padding: 0px 15px; display: grid; gap: 5px; grid-template-columns: 1fr 1fr; } .ddei-core-dialog-linepointtype .content .group .item[data-v-ec516138] { height: 30px; background: transparent; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 0.5px solid var(--panel-border); } .ddei-core-dialog-linepointtype .content .group .item .div_input[data-v-ec516138] { width: calc(100% - 10px); height: 3px; } .ddei-core-dialog-linepointtype .content .group .item[data-v-ec516138]:hover { outline: 1px solid var(--dot); } .ddei-core-dialog-linepointtype .content .group .item-selected[data-v-ec516138] { outline: 1px solid var(--dot); } .ddei-core-dialog-linepointtype .tail[data-v-ec516138] { margin-top: 5px; flex: 0 0 55px; display: flex; align-items: center; text-align: center; padding: 0 15px; justify-content: end; } .ddei-core-dialog-linepointtype .button[data-v-ec516138] { flex: 0 0 70px; height: 32px; background: var(--panel-header); border: 1px solid var(--panel-border); border-radius: 6px; font-size: 16px; font-weight: 400; color: var(--panel-title); margin-left: 13px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-linepointtype .button[data-v-ec516138]:hover { color: white; background: var(--dot); cursor: pointer; } .ddei-core-dialog-linepointtype .button-main[data-v-ec516138] { color: white; background: var(--dot); } .ddei-core-dialog-linetype[data-v-5fc9eaad] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 240px; position: absolute; background-color: var(--panel-background); height: 90px; z-index: 999; } .ddei-core-dialog-linetype .content[data-v-5fc9eaad] { width: 100%; max-height: 90px; overflow-y: auto; user-select: none; } .ddei-core-dialog-linetype .content .title[data-v-5fc9eaad] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 17px; } .ddei-core-dialog-linetype .content .group[data-v-5fc9eaad] { color: var(--panel-title); flex: 1 1 40px; width: 100%; padding: 10px; border-top: 1px solid var(--panel-border); } .ddei-core-dialog-linetype .content .group .group_content[data-v-5fc9eaad] { width: 96%; display: grid; gap: 5px; grid-template-columns: 1fr 1fr 1fr; } .ddei-core-dialog-linetype .content .group .group_content .item[data-v-5fc9eaad] { outline: none; width: 70px; height: 40px; margin: auto; background: transparent; border-radius: 4px; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 1px solid var(--panel-border); } .ddei-core-dialog-linetype .content .group .group_content .selected[data-v-5fc9eaad] { background-color: var(--panel-selected); } .ddei-core-dialog-linetype .content .group .group_content .item[data-v-5fc9eaad]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-linetype .content .group .group_content .icon[data-v-5fc9eaad] { font-size: 28px; } /**以下是编辑图层的弹出框 */ .ddei-core-dialog-managerlayers[data-v-f8156347] { width: 240px; position: absolute; background-color: var(--panel-background); height: 320px; z-index: 999; display: none; border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; user-select: none; } .ddei-core-dialog-managerlayers .content[data-v-f8156347] { width: 240px; height: 320px; display: flex; flex-direction: column; justify-content: center; } .ddei-core-dialog-managerlayers .content .title[data-v-f8156347] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 16px; border-bottom: 1px solid var(--panel-border); } .ddei-core-dialog-managerlayers .content .group[data-v-f8156347] { color: var(--panel-title); flex: 1 1 40px; } .ddei-core-dialog-managerlayers .content .group .group_content[data-v-f8156347] { width: 100%; height: 280px; display: flex; flex-direction: column; overflow-y: auto; } .ddei-core-dialog-managerlayers .content .group .group_content .item[data-v-f8156347] { width: 100%; flex: 0 0 30px; display: grid; gap: 2px; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; padding: 3px 10px; } .ddei-core-dialog-managerlayers .content .group .group_content .item > span[data-v-f8156347] { font-size: 14px; font-weight: bold; } .ddei-core-dialog-managerlayers .content .group .group_content .item .icon[data-v-f8156347] { font-size: 22px; } .ddei-core-dialog-managerlayers .content .group .group_content .item > input[data-v-f8156347] { height: 16px; margin-top: 4px; } .ddei-core-dialog-managerlayers .content .group .group_content .current[data-v-f8156347] { background-color: var(--panel-header); } .ddei-core-dialog-managerlayers .content .group .group_content .item_selected[data-v-f8156347] { font-weight: bold; } .ddei-core-dialog-managerlayers .content .group .group_content .item[data-v-f8156347]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-mergecompose[data-v-eb54102e] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 140px; position: absolute; background-color: var(--panel-background); height: 110px; z-index: 999; } .ddei-core-dialog-mergecompose .content[data-v-eb54102e] { width: 100%; max-height: 110px; overflow-y: auto; user-select: none; } .ddei-core-dialog-mergecompose .content .title[data-v-eb54102e] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 17px; border-bottom: 1px solid var(--panel-border); } .ddei-core-dialog-mergecompose .content .group[data-v-eb54102e] { color: var(--panel-title); flex: 1 1 40px; width: 100%; } .ddei-core-dialog-mergecompose .content .group .group_content[data-v-eb54102e] { width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; } .ddei-core-dialog-mergecompose .content .group .group_content .item[data-v-eb54102e] { outline: none; font-size: 16px; background: transparent; border-radius: 4px; width: 100%; flex: 0 0 36px; display: flex; justify-content: start; align-items: center; padding: 0px 10px; cursor: pointer; } .ddei-core-dialog-mergecompose .content .group .group_content .item_disabled[data-v-eb54102e] { outline: none; font-size: 16px; background: transparent; border-radius: 4px; width: 100%; flex: 0 0 36px; display: flex; justify-content: start; align-items: center; padding: 0px 10px; color: var(--panel-title-disabled); text-decoration: line-through; } .ddei-core-dialog-mergecompose .content .group .group_content .item_disabled[data-v-eb54102e]:hover { cursor: not-allowed !important; } .ddei-core-dialog-mergecompose .content .group .group_content .item[data-v-eb54102e]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-mergecompose .content .group .group_content .text[data-v-eb54102e] { flex: 1; text-align: left; padding-left: 15px; white-space: nowrap; width: 100%; } .ddei-core-dialog-mergecompose .content .group .group_content .icon[data-v-eb54102e] { font-size: 22px; } .ddei-core-dialog-changeposition[data-v-70a473a4] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 140px; position: absolute; background-color: var(--panel-background); height: 180px; z-index: 999; } .ddei-core-dialog-changeposition .content[data-v-70a473a4] { width: 100%; max-height: 180px; overflow-y: auto; user-select: none; } .ddei-core-dialog-changeposition .content .title[data-v-70a473a4] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 17px; border-bottom: 1px solid var(--panel-border); } .ddei-core-dialog-changeposition .content .group[data-v-70a473a4] { color: var(--panel-title); flex: 1 1 40px; width: 100%; } .ddei-core-dialog-changeposition .content .group .group_content[data-v-70a473a4] { width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; } .ddei-core-dialog-changeposition .content .group .group_content .item[data-v-70a473a4] { outline: none; font-size: 16px; margin: auto; background: transparent; border-radius: 4px; width: 100%; flex: 0 0 36px; display: flex; justify-content: start; align-items: center; padding: 0px 10px; cursor: pointer; } .ddei-core-dialog-changeposition .content .group .group_content .item_disabled[data-v-70a473a4] { color: var(--panel-title-disabled); text-decoration: line-through; } .ddei-core-dialog-changeposition .content .group .group_content .item_disabled[data-v-70a473a4]:hover { cursor: not-allowed !important; } .ddei-core-dialog-changeposition .content .group .group_content .item[data-v-70a473a4]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-changeposition .content .group .group_content .text[data-v-70a473a4] { flex: 1; text-align: center; white-space: nowrap; width: 100%; } .ddei-core-dialog-changeposition .content .group .group_content .icon[data-v-70a473a4] { font-size: 22px; } /**以下为询问框的样式 */ .ddei-core-dialog-publishfile[data-v-251feafa] { width: 420px; height: 165px; background: var(--panel-background); border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 12px; display: none; position: absolute; overflow: hidden; z-index: 999; top: 50%; left: 50%; transform: translate(-50%, -50%); } .ddei-core-dialog-publishfile .content[data-v-251feafa] { width: 420px; height: 165px; display: flex; flex-direction: column; padding: 0 24px; } .ddei-core-dialog-publishfile .content .header[data-v-251feafa] { flex: 0 0 55px; display: flex; align-items: center; font-size: 18px; font-weight: 400; color: var(--panel-title); } .ddei-core-dialog-publishfile .content .header > span[data-v-251feafa] { margin: 0 2px; } .ddei-core-dialog-publishfile .content .header .close[data-v-251feafa] { font-size: 22px; } .ddei-core-dialog-publishfile .content .header .warn[data-v-251feafa] { font-size: 20px !important; } .ddei-core-dialog-publishfile .content .msg[data-v-251feafa] { flex: 0 0 55px; display: flex; justify-content: center; align-items: center; font-size: 16px; font-weight: 400; color: var(--panel-title); } .ddei-core-dialog-publishfile .content .tail[data-v-251feafa] { flex: 0 0 55px; display: flex; align-items: center; text-align: center; justify-content: end; } .ddei-core-dialog-publishfile .content .button[data-v-251feafa] { flex: 0 0 70px; height: 32px; background: var(--panel-header); border: 1px solid var(--panel-border); border-radius: 6px; font-size: 16px; font-weight: 400; color: var(--panel-title); margin-left: 13px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-publishfile .content .button[data-v-251feafa]:hover { color: white; background: var(--dot); cursor: pointer; } .ddei-core-dialog-publishfile .content .button-main[data-v-251feafa] { color: white; background: var(--dot); } .ddei-core-dialog-qcview[data-v-6bab58c9] { width: 80px; position: absolute; background-color: var(--panel-background); left: 0px; display: none; bottom: 16px; height: 48px; } .ddei-core-dialog-qcview .icon[data-v-6bab58c9] { font-size: 18px; width: 18px; height: 18px; } .ddei-core-dialog-qcview .items .item[data-v-6bab58c9] { height: 24px; width: 80px; display: flex; justify-content: center; align-items: center; } .ddei-core-dialog-qcview .items .item > div[data-v-6bab58c9] { color: var(--panel-title); font-size: 13px; flex: 1; } .ddei-core-dialog-qcview .items .item[data-v-6bab58c9]:hover { background: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-setstyle[data-v-a2a1cbf5] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 440px; position: absolute; background-color: var(--panel-background); height: 230px; z-index: 999; } .ddei-core-dialog-setstyle .content[data-v-a2a1cbf5] { width: 100%; max-height: 230px; overflow-y: auto; user-select: none; } .ddei-core-dialog-setstyle .content .title[data-v-a2a1cbf5] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 17px; } .ddei-core-dialog-setstyle .content .group[data-v-a2a1cbf5] { color: var(--panel-title); flex: 1 1 40px; width: 100%; padding: 10px; border-top: 1px solid var(--panel-border); } .ddei-core-dialog-setstyle .content .group .group_content[data-v-a2a1cbf5] { width: 95%; display: grid; gap: 5px; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; } .ddei-core-dialog-setstyle .content .group .group_content .item[data-v-a2a1cbf5] { outline: none; width: 80px; height: 40px; margin: auto; background: transparent; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 1px solid var(--panel-border); } .ddei-core-dialog-setstyle .content .group .group_content .item[data-v-a2a1cbf5]:hover { filter: brightness(150%); } .ddei-core-dialog-setstyle .content .group .group_content .text[data-v-a2a1cbf5] { flex: 1; text-align: center; white-space: nowrap; width: 100%; } .ddei-core-dialog-setstyle .content .group .group_content .icon[data-v-a2a1cbf5] { font-size: 28px; } .ddei-core-dialog-changerotate[data-v-2fcc5441] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 180px; position: absolute; background-color: var(--panel-background); height: 150px; z-index: 999; } .ddei-core-dialog-changerotate .content[data-v-2fcc5441] { width: 100%; max-height: 150px; overflow-y: auto; user-select: none; } .ddei-core-dialog-changerotate .content .title[data-v-2fcc5441] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 17px; } .ddei-core-dialog-changerotate .content .group[data-v-2fcc5441] { color: var(--panel-title); flex: 1 1 40px; width: 100%; border-top: 1px solid var(--panel-border); } .ddei-core-dialog-changerotate .content .group .title[data-v-2fcc5441] { color: var(--panel-title); flex: 0 0 30px; width: 100%; display: flex; justify-content: start; align-items: center; padding-left: 10px; font-size: 15px; border: none; } .ddei-core-dialog-changerotate .content .group .group_content[data-v-2fcc5441] { width: 100%; display: grid; gap: 10px; grid-template-columns: 1fr 1fr 1fr; padding: 3px 0px; } .ddei-core-dialog-changerotate .content .group .group_content .item[data-v-2fcc5441] { outline: none; width: 30px; height: 25px; margin: auto; background: transparent; border-radius: 4px; display: flex; justify-content: center; align-items: center; cursor: pointer; } .ddei-core-dialog-changerotate .content .group .group_content .item_disabled[data-v-2fcc5441] { color: var(--panel-title-disabled); outline: none; width: 30px; height: 25px; margin: auto; background: transparent; border-radius: 4px; display: flex; justify-content: center; align-items: center; cursor: pointer; text-decoration: line-through; } .ddei-core-dialog-changerotate .content .group .group_content .item_disabled .icon[data-v-2fcc5441] { color: var(--panel-title-disabled); } .ddei-core-dialog-changerotate .content .group .group_content .item_disabled[data-v-2fcc5441]:hover { cursor: not-allowed !important; } .ddei-core-dialog-changerotate .content .group .group_content .item[data-v-2fcc5441]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-changerotate .content .group .group_content .text[data-v-2fcc5441] { flex: 1; text-align: center; white-space: nowrap; width: 100%; } .ddei-core-dialog-changerotate .content .group .group_content .icon[data-v-2fcc5441] { font-size: 28px; } /**以下是选择颜色的弹出框 */ .ddei-core-dialog-selectborderdash[data-v-143dc703] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 290px; position: absolute; background-color: var(--panel-background); height: 250px; z-index: 999; user-select: none; } .ddei-core-dialog-selectborderdash .content[data-v-143dc703] { width: 100%; max-height: 250px; overflow-y: auto; } .ddei-core-dialog-selectborderdash .content .group[data-v-143dc703] { color: var(--panel-title); width: 100%; } .ddei-core-dialog-selectborderdash .content .group .title[data-v-143dc703] { color: var(--panel-title); flex: 0 0 30px; width: 100%; display: flex; justify-content: start; align-items: center; padding-left: 10px; font-size: 15px; border: none; margin-top: 5px; margin-bottom: 5px; box-sizing: border-box; } .ddei-core-dialog-selectborderdash .content .group .group_content[data-v-143dc703] { width: 100%; padding: 0px 15px; display: grid; gap: 5px; grid-template-columns: 1fr 1fr; box-sizing: border-box; } .ddei-core-dialog-selectborderdash .content .group .item[data-v-143dc703] { height: 24px; margin: 0px 2px; margin: auto; background: transparent; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 0.5px solid var(--panel-title); } .ddei-core-dialog-selectborderdash .content .group .item .div_input[data-v-143dc703] { width: calc(100% - 10px); height: 3px; } .ddei-core-dialog-selectborderdash .content .group .item .div_input[data-v-143dc703] > * { stroke: var(--panel-title); fill: var(--panel-background); } .ddei-core-dialog-selectborderdash .content .group .item[data-v-143dc703]:hover { outline: 1px solid var(--dot); } .ddei-core-dialog-selectborderdash .content .group .item-selected[data-v-143dc703] { outline: 1px solid var(--dot); } .ddei-core-dialog-selectborderdash .tail[data-v-143dc703] { margin-top: 5px; flex: 0 0 55px; display: flex; align-items: center; text-align: center; padding: 0 15px; justify-content: end; } .ddei-core-dialog-selectborderdash .button[data-v-143dc703] { flex: 0 0 70px; height: 32px; white-space: nowrap; background: var(--panel-background); border: 1px solid var(--panel-title); border-radius: 6px; font-size: 16px; font-weight: 400; color: var(--panel-title); margin-left: 13px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-selectborderdash .button[data-v-143dc703]:hover { color: white; background: var(--dot); cursor: pointer; } .ddei-core-dialog-selectborderdash .button-main[data-v-143dc703] { color: white; border: 1px solid var(--panel-background); background: var(--dot); } /**以下是选择颜色的弹出框 */ .ddei-core-dialog-selectboderweight[data-v-b939438e] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 290px; position: absolute; background-color: var(--panel-background); height: 250px; z-index: 999; user-select: none; } .ddei-core-dialog-selectboderweight .content[data-v-b939438e] { width: 100%; max-height: 250px; overflow-y: auto; } .ddei-core-dialog-selectboderweight .content .group[data-v-b939438e] { color: var(--panel-title); width: 100%; } .ddei-core-dialog-selectboderweight .content .group .title[data-v-b939438e] { color: var(--panel-title); flex: 0 0 30px; width: 100%; display: flex; justify-content: start; align-items: center; padding-left: 10px; font-size: 15px; border: none; margin-top: 5px; margin-bottom: 5px; } .ddei-core-dialog-selectboderweight .content .group .group_content[data-v-b939438e] { width: 100%; padding: 0px 15px; display: grid; gap: 5px; grid-template-columns: 1fr 1fr; } .ddei-core-dialog-selectboderweight .content .group .item[data-v-b939438e] { height: 24px; margin: 0px 2px; margin: auto; background: transparent; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 0.5px solid var(--panel-border); } .ddei-core-dialog-selectboderweight .content .group .item .div_input[data-v-b939438e] { width: calc(100% - 10px); height: 100%; } .ddei-core-dialog-selectboderweight .content .group .item .div_input[data-v-b939438e] > * { stroke: var(--panel-title); fill: var(--panel-background); } .ddei-core-dialog-selectboderweight .content .group .item[data-v-b939438e]:hover { outline: 1px solid var(--dot); } .ddei-core-dialog-selectboderweight .content .group .item-selected[data-v-b939438e] { outline: 1px solid var(--dot); } .ddei-core-dialog-selectboderweight .tail[data-v-b939438e] { margin-top: 5px; flex: 0 0 55px; display: flex; align-items: center; text-align: center; padding: 0 15px; justify-content: end; } .ddei-core-dialog-selectboderweight .button[data-v-b939438e] { flex: 0 0 70px; height: 32px; white-space: nowrap; background: #FFFFFF; border: 1px solid var(--panel-border); border-radius: 6px; font-size: 16px; font-family: "Microsoft YaHei"; font-weight: 400; color: #040404; margin-left: 13px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-selectboderweight .button[data-v-b939438e]:hover { color: white; background: #176EFF; cursor: pointer; } .ddei-core-dialog-selectboderweight .button-main[data-v-b939438e] { color: white; background: #176EFF; } /**以下是选择颜色的弹出框 */ .ddei-core-dialog-selectcolor[data-v-cd291105] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 290px; position: absolute; background-color: var(--panel-background); height: 380px; z-index: 999; user-select: none; } .ddei-core-dialog-selectcolor .content[data-v-cd291105] { width: 100%; max-height: 380px; overflow-y: auto; } .ddei-core-dialog-selectcolor .content .group[data-v-cd291105] { color: var(--panel-title); width: 100%; } .ddei-core-dialog-selectcolor .content .group .title[data-v-cd291105] { color: var(--panel-title); flex: 0 0 30px; width: 100%; box-sizing: border-box; display: flex; justify-content: start; align-items: center; padding-left: 10px; font-size: 15px; border: none; margin-top: 5px; margin-bottom: 5px; } .ddei-core-dialog-selectcolor .content .group .color1[data-v-cd291105] { display: grid; gap: 1px; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; } .ddei-core-dialog-selectcolor .content .group .color2[data-v-cd291105] { display: grid; grid-template-rows: 20px 20px 20px 20px 20px 20px 20px; gap: 1px; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; margin: 10px 0px; } .ddei-core-dialog-selectcolor .content .group .color3[data-v-cd291105] { display: flex; justify-content: start; align-items: center; margin-top: -5px; margin-left: 10px; } .ddei-core-dialog-selectcolor .content .group .color3 > input[data-v-cd291105] { width: 80px; height: 24px; background: var(--panel-background); border: 1px solid var(--panel-title); color: var(--panel-title); } .ddei-core-dialog-selectcolor .content .group .color3 .colorinput[data-v-cd291105] { outline: none; border: none; width: 60px; height: 34px; margin-right: 5px; background: none; } .ddei-core-dialog-selectcolor .content .group .group_content[data-v-cd291105] { width: 100%; padding: 0px 15px; box-sizing: border-box; } .ddei-core-dialog-selectcolor .content .group .item[data-v-cd291105] { width: 25px; height: 20px; margin: 0px 2px; margin: auto; background: transparent; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 0.5px solid var(--panel-title); } .ddei-core-dialog-selectcolor .content .group .item[data-v-cd291105]:hover { outline: 1px solid var(--panel-hover); } .ddei-core-dialog-selectcolor .content .group .item-selected[data-v-cd291105] { outline: 1px solid var(--panel-selected); } .ddei-core-dialog-selectcolor .tail[data-v-cd291105] { margin-top: 5px; flex: 0 0 55px; display: flex; align-items: center; text-align: center; padding: 0 15px; justify-content: end; } .ddei-core-dialog-selectcolor .button[data-v-cd291105] { flex: 0 0 70px; white-space: nowrap; height: 32px; background: var(--panel-background); border: 1px solid var(--panel-title); border-radius: 6px; font-size: 16px; font-weight: 400; color: var(--panel-title); margin-left: 13px; display: flex; align-items: center; justify-content: center; } .ddei-core-dialog-selectcolor .button[data-v-cd291105]:hover { color: white; background: var(--dot); cursor: pointer; } .ddei-core-dialog-selectcolor .button-main[data-v-cd291105] { color: white; border: 1px solid var(--panel-background); background: var(--dot); } .ddei-core-dialog-selectcolor .button-small[data-v-cd291105] { height: 26px; flex: 0 0 55px; font-size: 15px; border: 1px solid var(--panel-title); color: var(--panel-title); } .ddei-core-dialog-selectcolor .button-small[data-v-cd291105]:hover { color: var(--panel-title); font-weight: bold; background: var(--panel-background); cursor: pointer; } /**以下是选择字体的弹出框 */ .ddei-core-dialog-selectfont[data-v-64fcb708] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 170px; position: absolute; background-color: var(--panel-background); height: 310px; z-index: 999; user-select: none; } .ddei-core-dialog-selectfont .content[data-v-64fcb708] { width: 100%; max-height: 310px; overflow-y: auto; } .ddei-core-dialog-selectfont .content .group[data-v-64fcb708] { color: var(--panel-title); flex: 1 1 40px; width: 100%; } .ddei-core-dialog-selectfont .content .group .group_content[data-v-64fcb708] { font-size: 14px; width: 100%; grid-template-columns: 1fr 1fr; grid-template-rows: 30px 30px 30px 30px 30px; display: grid; } .ddei-core-dialog-selectfont .content .group .group_content .item[data-v-64fcb708] { outline: none; font-size: 15px; margin: auto; background: transparent; border-radius: 4px; width: 80px; height: 30px; display: flex; justify-content: start; align-items: center; cursor: pointer; } .ddei-core-dialog-selectfont .content .group .group_content .item .text[data-v-64fcb708] { text-align: center; white-space: nowrap; display: table-cell; width: 100%; vertical-align: middle; } .ddei-core-dialog-selectfont .content .group .group_content .itembox_deleted[data-v-64fcb708] { text-decoration: line-through; } .ddei-core-dialog-selectfont .content .group .group_content .itembox_disabled[data-v-64fcb708] { color: var(--panel-title-disabled); text-decoration: line-through; } .ddei-core-dialog-selectfont .content .group .group_content .itembox_disabled[data-v-64fcb708]:hover { cursor: not-allowed !important; } .ddei-core-dialog-selectfont .content .group .group_content .itembox_underline[data-v-64fcb708] { text-decoration: underline; } .ddei-core-dialog-selectfont .content .group .group_content .item_selected[data-v-64fcb708] { font-weight: bold; background-color: var(--panel-selected); } .ddei-core-dialog-selectfont .content .group .group_content .item[data-v-64fcb708]:hover { background-color: var(--panel-hover); } /**以下是选择字号的弹出框 */ .ddei-core-dialog-selectfontsize[data-v-9fc02a16] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 170px; position: absolute; background-color: var(--panel-background); height: 310px; z-index: 999; user-select: none; } .ddei-core-dialog-selectfontsize .content[data-v-9fc02a16] { width: 100%; max-height: 310px; overflow-y: auto; } .ddei-core-dialog-selectfontsize .content .group[data-v-9fc02a16] { color: var(--panel-title); flex: 1 1 40px; width: 100%; } .ddei-core-dialog-selectfontsize .content .group .group_content[data-v-9fc02a16] { font-size: 14px; width: 100%; grid-template-columns: 1fr 1fr; grid-template-rows: 30px 30px 30px 30px 30px; display: grid; } .ddei-core-dialog-selectfontsize .content .group .group_content .itembox[data-v-9fc02a16] { outline: none; font-size: 15px; margin: auto; background: transparent; border-radius: 4px; width: 80px; height: 30px; display: flex; justify-content: start; align-items: center; cursor: pointer; } .ddei-core-dialog-selectfontsize .content .group .group_content .itembox .itembox_text[data-v-9fc02a16] { text-align: center; white-space: nowrap; display: table-cell; width: 100%; vertical-align: middle; } .ddei-core-dialog-selectfontsize .content .group .group_content .itembox_deleted[data-v-9fc02a16] { text-decoration: line-through; } .ddei-core-dialog-selectfontsize .content .group .group_content .itembox_disabled[data-v-9fc02a16] { color: var(--panel-title-disabled); text-decoration: line-through; } .ddei-core-dialog-selectfontsize .content .group .group_content .itembox_disabled[data-v-9fc02a16]:hover { cursor: not-allowed !important; } .ddei-core-dialog-selectfontsize .content .group .group_content .itembox_underline[data-v-9fc02a16] { text-decoration: underline; } .ddei-core-dialog-selectfontsize .content .group .group_content .itembox_selected[data-v-9fc02a16] { font-weight: bold; background-color: var(--panel-selected); } .ddei-core-dialog-selectfontsize .content .group .group_content .itembox[data-v-9fc02a16]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-textalign[data-v-fe33bdea] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; width: 240px; position: absolute; background-color: var(--panel-background); height: 180px; z-index: 999; } .ddei-core-dialog-textalign .content[data-v-fe33bdea] { width: 100%; max-height: 240px; overflow-y: auto; user-select: none; } .ddei-core-dialog-textalign .content .title[data-v-fe33bdea] { color: var(--panel-title); font-weight: bold; flex: 0 0 30px; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 17px; } .ddei-core-dialog-textalign .content .group[data-v-fe33bdea] { color: var(--panel-title); flex: 1 1 40px; width: 100%; padding: 10px; border-top: 1px solid var(--panel-border); } .ddei-core-dialog-textalign .content .group .group_content[data-v-fe33bdea] { width: 96%; display: grid; gap: 5px; grid-template-columns: 1fr 1fr 1fr; } .ddei-core-dialog-textalign .content .group .group_content .item[data-v-fe33bdea] { outline: none; width: 70px; height: 40px; margin: auto; background: transparent; border-radius: 4px; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 1px solid var(--panel-border); } .ddei-core-dialog-textalign .content .group .group_content .selected[data-v-fe33bdea] { background-color: var(--panel-selected); } .ddei-core-dialog-textalign .content .group .group_content .item[data-v-fe33bdea]:hover { background-color: var(--panel-hover); } .ddei-core-dialog-textalign .content .group .group_content .icon[data-v-fe33bdea] { font-size: 28px; } .ddei-core-dialog-choosecontrol[data-v-5962d4b2] { display: none; overflow: hidden; max-width: 220px; position: absolute; max-height: 220px; z-index: 999999; } .ddei-core-dialog-choosecontrol-content[data-v-5962d4b2] { max-width: 220px; border: 1px solid var(--panel-border); background-color: var(--panel-background); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; max-height: 220px; overflow-y: auto; overflow-x: hidden; user-select: none; } .ddei-core-dialog-choosecontrol-content-itempanel[data-v-5962d4b2] { display: flex; flex-flow: row wrap; background: var(--toolbox-background); padding: 5px 5px 5px 5px; } .ddei-core-dialog-choosecontrol-content-itempanel-item[data-v-5962d4b2] { flex: 0 0 50px !important; height: 45px; margin: 5px 0px; display: flex; overflow: hidden; justify-content: center; align-items: center; flex-flow: column; } .ddei-core-dialog-choosecontrol-content-itempanel-item[data-v-5962d4b2]:hover { background: var(--toolbox-control-hover); outline: var(--toolbox-control-hover-outline); cursor: all-scroll; } .ddei-core-dialog-choosecontrol-content-itempanel-item .text[data-v-5962d4b2] { white-space: nowrap; text-align: center; font-size: 0.7vw; font-weight: 400; color: var(--toolbox-control-title); } .ddei-core-dialog-choosecontrol-content-itempanel-item .icon[data-v-5962d4b2] { width: 90%; height: 90%; object-fit: contain; } .ddei-core-dialog-choosecontrol-content-itempanel-item .icon-html[data-v-5962d4b2] { width: 50px; height: 45px; object-fit: contain; display: flex; justify-content: center; align-items: center; } .ddei-core-dialog-choosecontrol-content-itempanel-item .icon-html[data-v-5962d4b2] > * { width: 28px !important; height: 28px !important; object-fit: contain; } /**以下为text属性编辑器 */ .ddei-pv-editor-text[data-v-48447048] { border-radius: 4px; border: 0.5px solid var(--panel-title); height: 28px; margin-right: 10px; padding: 0 5px; box-sizing: border-box; } .ddei-pv-editor-text--disabled[data-v-48447048] { background-color: var(--panel-disabled) !important; } .ddei-pv-editor-text--disabled[data-v-48447048]:hover { border: 1px solid var(--panel-disabled) !important; } .ddei-pv-editor-text[data-v-48447048]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-editor-text input[data-v-48447048] { height: 24px; width: 100%; border: transparent; outline: none; color:var(--panel-title); font-size: 15px; background: transparent; } .ddei-pv-base-combox[data-v-b36dc5e7] { height: 28px; padding-right: 10px; } .ddei-pv-base-combox--disabled .textinput[data-v-b36dc5e7] { background-color: var(--panel-disabled); height: 28px; } .ddei-pv-base-combox .textinput[data-v-b36dc5e7] { width: 100%; padding-right: 5px; box-sizing: border-box; border: 0.5px solid var(--panel-title); border-radius: 4px; display: flex; padding-left: 5px; height: 28px; } .ddei-pv-base-combox .textinput[data-v-b36dc5e7]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-base-combox .textinput input[data-v-b36dc5e7] { flex: 1 1 calc(100% - 10px); width: calc(100% - 10px); border: transparent; outline: none; font-size: 15px; background: transparent; margin-top: 1px; } .ddei-pv-base-combox .textinput div[data-v-b36dc5e7] { flex: 0 0 20px; } .ddei-pv-base-combox .display_img input[data-v-b36dc5e7] { display: none; } .ddei-pv-base-combox .display_img img[data-v-b36dc5e7] { width: 20px; height: 20px; } .ddei-pv-base-combox .display_img_text input[data-v-b36dc5e7] { width: calc(100% - 30px); } .ddei-pv-base-combox .display_img_text img[data-v-b36dc5e7] { float: left; width: 20px; height: 20px; } .ddei-combox-show-dialog[data-v-b36dc5e7] { font-size: 13px; background: var(--panel-background); display: none; position: absolute; z-index: 999; border-radius: 4px; } .ddei-combox-show-dialog-content[data-v-b36dc5e7] { width: 100%; height: 100%; background: var(--panel-background); padding: 10px; box-shadow: 4px 4px 4px hsl(0deg 0% 0% /0.25); display:flex; justify-content: center; align-items: center; } .icon[data-v-b36dc5e7] { font-size: 16px } /**以下为aligntype属性编辑器 */ .ddei-pv-editor-aligntype-items[data-v-135fda87] { width: 200px; height: 150px; display: grid; padding: 2%; grid-template-rows: 30% 30% 30%; grid-template-columns: 1fr 1fr 1fr; gap: 4px; } .ddei-pv-editor-aligntype-item[data-v-135fda87] { text-align: center; font-size: 16px; display: table; color: var(--panel-title); border: 0.5px solid var(--panel-title); background-color: var(--panel-background); padding: 5px; } .ddei-pv-editor-aligntype-item div[data-v-135fda87] { display: table-cell; } .ddei-pv-editor-aligntype-item[data-v-135fda87]:hover { border: 1px solid var(--dot); background: var(--panel-hover); cursor: pointer; } .ddei-pv-editor-aligntype-item--selected[data-v-135fda87] { border: 1px solid var(--dot); } .ddei-pv-border-dash-combox[data-v-2e01e102] { height: 28px; padding-right: 10px; } .ddei-pv-border-dash-combox .textinput[data-v-2e01e102] { width: 100%; padding-right: 5px; border: 0.5px solid var(--panel-title); border-radius: 4px; display: flex; justify-content: center; align-items: center; padding-left: 5px; height: 28px; box-sizing: border-box; } .ddei-pv-border-dash-combox .textinput[data-v-2e01e102]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-border-dash-combox .textinput .div_input[data-v-2e01e102] { flex: 1 1 calc(100% - 10px); width: calc(100% - 10px); height: 3px; } .ddei-pv-border-dash-combox .textinput .div_input div[data-v-2e01e102] { flex: 0 0 20px; } .ddei-pv-border-dash-combox .textinput .div_input[data-v-2e01e102] > * { stroke: var(--panel-title); fill: var(--panel-background); } .ddei-pv-border-dash-combox--disabled .textinput[data-v-2e01e102] { background-color: var(--panel-disabled); height: 28px; justify-content: center; align-items: center; } .icon[data-v-2e01e102] { font-size: 16px; } /**以下为radio属性编辑器 */ .ddei_pv_editor_bordertype[data-v-ea9f8fdd] { border-radius: 4px; margin-right: 10px; } .ddei_pv_editor_bordertype_disabled[data-v-ea9f8fdd] { background-color: rgb(210, 210, 210) !important; } .ddei_pv_editor_bordertype .itembox[data-v-ea9f8fdd] { display: flex; justify-content: start; align-items: center; height: 24px; outline: none; font-size: 15px; margin: 0; padding-top: 2px; box-sizing: border-box; background: transparent; } .ddei_pv_editor_bordertype .itembox input[data-v-ea9f8fdd] { width: 16px; height: 16px; } .ddei_pv_editor_bordertype .itembox div[data-v-ea9f8fdd] { margin-left: 15px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-row .itembox[data-v-ea9f8fdd] { float: left; margin-right: 10px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-column .itembox[data-v-ea9f8fdd] { margin-top: 10px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-row .itembox div[data-v-ea9f8fdd] { float: left; margin-left: 5px; } .ddei-pv-color-combox[data-v-22680f1e] { height: 28px; padding-right: 10px; } .ddei-pv-color-combox .textinput[data-v-22680f1e] { width: 100%; padding-right: 5px; box-sizing: border-box; border: 0.5px solid var(--panel-title); border-radius: 4px; display: flex; justify-content: center; align-items: center; padding-left: 5px; height: 28px; } .ddei-pv-color-combox .textinput[data-v-22680f1e]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-color-combox .textinput input[data-v-22680f1e] { flex: 1 1 calc(100% - 10px); width: calc(100% - 10px); border: transparent; outline: none; font-size: 15px; background: transparent; user-select: none; pointer-events: none; } .ddei-pv-color-combox .textinput div[data-v-22680f1e] { flex: 0 0 20px; } .ddei-pv-color-combox--disabled .textinput[data-v-22680f1e] { background-color: #d2d2d2; height: 28px; justify-content: center; align-items: center; } .icon[data-v-22680f1e] { font-size: 16px; } /**以下为color属性编辑器 */ .ddei-pv-editor-color[data-v-ec0fa5a7] { border-radius: 4px; height: 28px; margin-right: 10px; display: flex; } .ddei-pv-editor-color .color[data-v-ec0fa5a7] { height: 36px; width: 60%; border: transparent; outline: none; background: transparent; flex: 1; margin: -4px -4px 0px -4px; } .ddei-pv-editor-color--disabled .textinput[data-v-ec0fa5a7] { flex: 0 0 80px; margin-left: 10px; padding-left: 5px; padding-right: 5px; background-color: var(--panel-disabled); border: 0.5px solid var(--panel-disabled); border-radius: 4px; } .ddei-pv-editor-color--disabled .textinput[data-v-ec0fa5a7]:hover { border: 1px solid var(--panel-disabled) !important; box-sizing: border-box; } .ddei-pv-editor-color--disabled .color[data-v-ec0fa5a7] { height: 32px; width: 60%; border: transparent; outline: none; background-color: var(--panel-title) !important; flex: 1; margin: -4px -4px 0px -4px; } .ddei-pv-editor-color .textinput[data-v-ec0fa5a7] { flex: 0 0 80px; margin-left: 10px; padding-left: 5px; padding-right: 5px; border: 0.5px solid var(--panel-title); border-radius: 4px; } .ddei-pv-editor-color .textinput[data-v-ec0fa5a7]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-editor-color .textinput input[data-v-ec0fa5a7] { width: 100%; border: transparent; outline: none; font-size: 15px; margin: 0px 2%; background: transparent; } /**以下为combox属性编辑器 */ .ddei-combox-show-dialog-content .itemboxs[data-v-e318138d] { border-radius: 4px; margin-top: 4px; display: grid; gap: 4px; overflow: auto; color: var(--panel-title); font-size: 13px; } .ddei-combox-show-dialog-content .itemboxs .itembox[data-v-e318138d] { outline: none; font-size: 13px; margin: auto; background: transparent; border:1px solid var(--panel-title); display: flex; border-radius: 4px; } .ddei-combox-show-dialog-content .itemboxs .itembox[data-v-e318138d]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-combox-show-dialog-content .itemboxs .itembox .itembox_img[data-v-e318138d] { display: table-cell; padding-left: 5px; vertical-align: middle; } .ddei-combox-show-dialog-content .itemboxs .itembox .itembox_img img[data-v-e318138d] { text-align: center; vertical-align: middle; } .ddei-combox-show-dialog-content .itemboxs .itembox .itembox_text[data-v-e318138d] { text-align: center; display: table-cell; flex: 1; vertical-align: middle; } .ddei-combox-show-dialog-content .itemboxs .itembox .itembox_desc[data-v-e318138d] { text-align: left; display: table-cell; font-size: 11px; filter: brightness(60%); padding-top: 2px; flex: 1; white-space: nowrap; text-overflow: ellipsis; vertical-align: middle; } .ddei-combox-show-dialog-content .itembox--selected[data-v-e318138d] { background-color: var(panel-title) !important; } .ddei-combox-show-dialog-content .itembox--deleted[data-v-e318138d] { text-decoration: line-through; } .ddei-combox-show-dialog-content .itembox--disabled[data-v-e318138d] { color: rgb(210, 210, 210); text-decoration: line-through; } .ddei-combox-show-dialog-content .itembox--disabled[data-v-e318138d]:hover { cursor: not-allowed !important; } .ddei-combox-show-dialog-content .itembox--underline[data-v-e318138d] { text-decoration: underline; } .ddei-combox-show-dialog-content .itembox--bold .itembox_text[data-v-e318138d] { font-weight: bold; } /**以下为combox属性编辑器 */ .ddei-pv-editor-excheckbox[data-v-4960d25a] { margin-top: 4px; } .ddei-pv-editor-excheckbox--disabled[data-v-4960d25a] {} .ddei-combox-show-dialog-content .itemboxs[data-v-4960d25a] { border-radius: 4px; margin-top: 4px; display: grid; gap: 4px; overflow: auto; color: var(--panel-title); font-size: 13px; } .ddei-combox-show-dialog-content .itemboxs .itembox[data-v-4960d25a] { outline: none; font-size: 13px; margin: auto; background: transparent; border: 1px solid var(--panel-title); display: table; border-radius: 4px; } .ddei-combox-show-dialog-content .itemboxs .itembox[data-v-4960d25a]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-combox-show-dialog-content .itemboxs .itembox .itembox_img[data-v-4960d25a] { display: table-cell; padding-left: 5px; vertical-align: middle; } .ddei-combox-show-dialog-content .itemboxs .itembox .itembox_img img[data-v-4960d25a] { text-align: center; vertical-align: middle; } .ddei-combox-show-dialog-content .itemboxs .itembox .itembox_text[data-v-4960d25a] { text-align: center; display: table-cell; width: 100%; vertical-align: middle; } .ddei-combox-show-dialog-content .itembox--selected[data-v-4960d25a] { border: 1px solid var(--dot); overflow: hidden; position: relative; } .ddei-combox-show-dialog-content .itembox--selected[data-v-4960d25a]::before { position: absolute; content: ""; -webkit-font-smoothing: antialiased; background-color: var(--dot); -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); right: -8px; bottom: -8px; width: 15px; height: 15px; } .ddei-combox-show-dialog-content .itembox--selected[data-v-4960d25a]::after { font-size: 12px; line-height: 12px; right: -3px; bottom: -2px; position: absolute; -webkit-font-smoothing: antialiased; content: "✓"; -webkit-transform: scale(0.5); -ms-transform: scale(0.5); transform: scale(0.5); color: #fff; } .ddei-combox-show-dialog-content .itembox--deleted[data-v-4960d25a] { text-decoration: line-through; } .ddei-combox-show-dialog-content .itembox--disabled[data-v-4960d25a] { color: rgb(210, 210, 210); } .ddei-combox-show-dialog-content .itembox--disabled[data-v-4960d25a]:hover { cursor: not-allowed !important; } .ddei-combox-show-dialog-content .itembox--underline[data-v-4960d25a] { text-decoration: underline; } .ddei-combox-show-dialog-content .itembox--bold .itembox_text[data-v-4960d25a] { font-weight: bold; } /**以下为radio属性编辑器 */ .ddei-pv-editor-filltype[data-v-64114ba5] { border-radius: 4px; margin-right: 10px; } .ddei-pv-editor-filltype--disabled[data-v-64114ba5] { background-color: var(--panel-disabled) !important; } .ddei-pv-editor-filltype .itembox[data-v-64114ba5] { display: flex; justify-content: start; align-items: center; height: 24px; outline: none; font-size: 15px; margin: 0; padding-top: 2px; background: transparent; } .ddei-pv-editor-filltype .itembox input[data-v-64114ba5] { width: 16px; height: 16px; } .ddei-pv-editor-filltype .itembox div[data-v-64114ba5] { margin-left: 15px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-row .itembox[data-v-64114ba5] { float: left; margin-right: 10px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-column .itembox[data-v-64114ba5] { margin-top: 10px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-row .itembox div[data-v-64114ba5] { float: left; margin-left: 5px; } /**以下为range属性编辑器 */ .ddei-pv-editor-fontsize[data-v-b2ded6b2] { border-radius: 4px; height: 28px; margin-right: 10px; display: flex; } .ddei-pv-editor-fontsize .range[data-v-b2ded6b2] { height: 7px; width: 60%; border: transparent; outline: none; background: transparent; flex: 1; margin: auto; } .ddei-pv-editor-fontsize--disabled .range[data-v-b2ded6b2] { height: 7px; width: 60%; border: transparent; outline: none; background-color: var(--panel-disabled) !important; flex: 1; margin: auto; } .ddei-pv-editor-fontsize .textinput[data-v-b2ded6b2] { flex: 0 0 80px; margin-left: 10px; padding-left: 5px; padding-right: 5px; color:var(--panel-title); border: 0.5px solid var(--panel-title); border-radius: 4px; box-sizing: border-box; display: flex; } .ddei-pv-editor-fontsize .textinput[data-v-b2ded6b2]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-editor-fontsize--disabled .textinput[data-v-b2ded6b2] { flex: 0 0 80px; margin-left: 10px; padding-left: 5px; padding-right: 5px; background-color: var(--panel-disabled); border: 0.5px solid var(--panel-disabled); border-radius: 4px; display: flex; } .ddei-pv-editor-fontsize--disabled .textinput[data-v-b2ded6b2]:hover { border: 1px solid var(--panel-disabled) !important; } .ddei-pv-editor-fontsize .textinput input[data-v-b2ded6b2] { flex: 1 1 50px; border: transparent; outline: none; font-size: 15px; color:var(--panel-title); margin: 0px 2%; background: transparent; } /**以下为range属性编辑器 */ .ddei-pv-editor-image[data-v-d7cc496a] { border-radius: 4px; height: 28px; margin-right: 10px; } .ddei-pv-editor-image .textinput[data-v-d7cc496a] { width: 100%; height: 28px; padding-left: 5px; padding-right: 5px; border: 0.5px solid var(--panel-title); border-radius: 4px; display: flex; justify-content: center; align-items: center; } .ddei-pv-editor-image .textinput[data-v-d7cc496a]:hover { border: 1px solid var(--dot); } .ddei-pv-editor-image--disabled .textinput[data-v-d7cc496a] { width: 100%; height: 28px; padding-left: 5px; padding-right: 5px; border: 0.5px solid var(--panel-disabled); border-radius: 4px; display: flex; background-color: var(--panel-disabled); justify-content: center; align-items: center; } .ddei-pv-editor-image--disabled .textinput[data-v-d7cc496a]:hover { border: 1px solid var(--panel-disabled) !important; box-sizing: border-box; } .ddei-pv-editor-image .textinput input[data-v-d7cc496a] { flex: 1 1 calc(100% - 20px); width: calc(100% - 20px); border: transparent; outline: none; color:var(--panel-title); font-size: 16px; margin: 0px 2%; background: transparent; } .ddei-pv-editor-image .textinput .icon[data-v-d7cc496a] { flex: 0 0 20px; font-size: 16px } .ddei-pv-editor-image .textinput .icon[data-v-d7cc496a]:hover { cursor: pointer; background: var(--panel-hover); } .textinput .fileinput[data-v-d7cc496a] { display: none; } /**以下为radio属性编辑器 */ .ddei-pv-editor-radio[data-v-d06209f3] { border-radius: 4px; margin-right: 10px; } .ddei-pv-editor-radio--disabled[data-v-d06209f3] { background-color: #d2d2d2 !important; } .ddei-pv-editor-radio .itembox[data-v-d06209f3] { display: flex; justify-content: start; align-items: center; height: 24px; outline: none; font-size: 15px; margin: 0; padding-top: 2px; background: transparent; } .ddei-pv-editor-radio .itembox input[data-v-d06209f3] { width: 16px; height: 16px; } .ddei-pv-editor-radio .itembox div[data-v-d06209f3] { margin-left: 15px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-row .itembox[data-v-d06209f3] { float: left; margin-right: 10px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-row .itembox div[data-v-d06209f3] { float: left; margin-left: 5px; } .ddei-editor-pv-subgroup-view-tab-panel-editors-column .itembox[data-v-d06209f3] { margin-top: 10px; } /**以下为range属性编辑器 */ .ddei-pv-editor-range[data-v-713ecc9b] { border-radius: 4px; height: 28px; margin-right: 10px; display: flex; } .ddei-pv-editor-range .range[data-v-713ecc9b] { height: 7px; width: 60%; border: transparent; outline: none; background: transparent; flex: 1; margin: auto; } .ddei-pv-editor-range .textinput[data-v-713ecc9b] { flex: 0 0 80px; margin-left: 10px; padding: 2px 5px 0px 5px; border: 0.5px solid var(--panel-title); border-radius: 4px; } .ddei-pv-editor-range .textinput input[data-v-713ecc9b] { width: 100%; border: transparent; outline: none; font-size: 15px; margin: 0px 2%; color: var(--panel-title); background: transparent; } .ddei-pv-editor-range .textinput[data-v-713ecc9b]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-editor-range--disabled .range[data-v-713ecc9b] { height: 7px; width: 60%; border: transparent; outline: none; background-color: var(--panel-disabled) !important; flex: 1; margin: auto; } .ddei-pv-editor-range--disabled .textinput[data-v-713ecc9b] { flex: 0 0 80px; margin-left: 10px; padding-left: 5px; padding-right: 5px; background-color: var(--panel-disabled); border: 0.5px solid var(--panel-disabled); border-radius: 4px; } .ddei-pv-editor-range--disabled .textinput[data-v-713ecc9b]:hover { border: 1px solid var(--panel-disabled) !important; box-sizing: border-box; } .ddei-pv-editor-range--disabled .textinput input[data-v-713ecc9b] { width: 100%; border: transparent; outline: none; font-size: 15px; margin: 0px 2%; color: var(--panel-title); background: transparent; } /**以下为checkbox属性编辑器 */ .ddei-pv-editor-switch-excheckbox[data-v-5a394c0d] { border-radius: 4px; margin-right: 10px; box-sizing: border-box; } .ddei-pv-editor-switch-excheckbox--disabled[data-v-5a394c0d] { background-color: var(--panel-disabled) !important; } .ddei-pv-editor-switch-excheckbox .title[data-v-5a394c0d] { float: left; color:var(--panel-title); } .ddei-pv-editor-switch-excheckbox .chk_state[data-v-5a394c0d] { border: 1px solid var(--panel-title); width: 14px; height: 14px; margin-right: 10px; margin-top: 4px; float: left; box-sizing: border-box; } .ddei-pv-editor-switch-excheckbox:hover .chk_state[data-v-5a394c0d] { background: var(--dot); } .ddei-pv-editor-switch-excheckbox .chk_state_checked[data-v-5a394c0d] { border: 1px solid var(--panel-title); width: 14px; height: 14px; margin-right: 10px; margin-top: 4px; float: left; background-color: var(--dot); box-sizing: border-box; color: #fff; } .ddei-pv-editor-switch-excheckbox .chk_state_checked span[data-v-5a394c0d] { margin-top: -4.5px; margin-left: 0.5px; display: block; } /**以下为text属性编辑器 */ .ddei-pv-editor-textarea[data-v-ac742ab1] { border-radius: 4px; border: 0.5px solid var(--panel-title); height: 80px; margin-right: 10px; padding: 0 5px; display: flex; box-sizing: border-box; } .ddei-pv-editor-textarea--disabled[data-v-ac742ab1] { background-color: var(--panel-disabled) !important; } .ddei-pv-editor-textarea--disabled[data-v-ac742ab1]:hover { border: 1px solid var(--panel-disabled) !important; } .ddei-pv-editor-textarea[data-v-ac742ab1]:hover { border: 1px solid var(--dot); box-sizing: border-box; } .ddei-pv-editor-textarea textarea[data-v-ac742ab1] { flex: 1; border: transparent; outline: none; font-size: 15px; margin: 1px 0; color:var(--panel-title); width: 100%; background: transparent; } .ddei-editor[theme='ddei-core-theme-default'] { --background: white; --theme: #F5F5F5; --text: black; --dot: #176eff; --hover: #e7e7e7; --icon: #424242; --border:#D5D5DF; --placeholder: #AdAdAd; --scroll-background: var(--theme); --scroll-hover: var(--hover); --scroll-border: var(--border); --panel-header:var(--theme); --panel-background: var(--background); --panel-title: var(--text); --panel-border: var(--border); --panel-hover: var(--hover); --panel-disabled: var(--theme); --panel-selected: var(--hover); --panel-title-disabled: #AdAdAd; --panel-title-selected: var(--text); --toolbox-header:var(--theme); --toolbox-background:var(--background); --toolbox-title:var(--text); --toolbox-hover:var(--hover); --toolbox-control-hover: #EDEFFF; --toolbox-control-hover-outline: 2px solid #BED0EF; --toolbox-control-title: var(--text); --topmenu-background: var(--background); --topmenu-header: var(--theme); --canvas-rule-background: var(--background); --canvas-rule-border: #E0E3E9; --canvas-scroll-background: var(--background); --canvas-scroll-border: #E0E3E9; --canvas-grid-line: rgb(220, 220, 220); --canvas-grid-dot: rgb(121, 121, 121); --canvas-control-border: black; --canvas-control-background: white; --canvas-control-title: #252525; --canvas-mark-title: #252525; --canvas-text-selection: #97bdf2; --canvas-text-cursor: black; }.ddei-editor[theme='ddei-core-theme-black'] { --background: #212121; --theme: #2c2c2c; --text: white; --dot: #176eff; --hover: rgb(60,60,60); --icon: white; --border: #DFDFDF; --placeholder: #A1A1A1; --scroll-background: var(--theme); --scroll-hover: var(--hover); --scroll-border: white; --panel-header: var(--theme); --panel-background: var(--background); --panel-title: var(--text); --panel-border: var(--border); --panel-hover: var(--hover); --panel-disabled: var(--theme); --panel-selected: var(--hover); --panel-title-disabled: #A1A1A1; --panel-title-selected: var(--text); --toolbox-header: var(--theme); --toolbox-background: var(--background); --toolbox-title: var(--text); --toolbox-hover: var(--hover); --toolbox-control-hover: var(--dot); --toolbox-control-hover-outline: 2px solid #BED0EF; --toolbox-control-title: var(--text); --canvas-rule-background: var(--theme); --canvas-rule-border: white; --canvas-scroll-background: var(--theme); --canvas-scroll-border: white; --canvas-grid-line: rgb(121, 121, 121); --canvas-grid-dot: rgb(121, 121, 121); --canvas-control-border: white; --canvas-control-background: var(--theme); --canvas-control-title: white; --canvas-mark-title: white; --canvas-text-selection: #97bdf2; --canvas-text-cursor: white; }.iconfont { font-family: 'iconfont' !important; font-size: 24px; color: #424242; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .iconfont-small { font-size: 6px !important; }@font-face { font-family: "iconfont"; /* Project id 4428875 */ src: url('data:font/woff2;base64,d09GMgABAAAAADlAAAsAAAAAhBgAADjtAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACSWgqB2ViBrDUBNgIkA4QoC4IWAAQgBYRnB4xNG5hrZYaYxwFAtReGKMriqkRRJyinYbL//5rcGFNcOMu6jXqFBssTTMfFsmWzB5xcTiEFNmTZQcSbX5Lry7MwMZlF7XVMj02GB+HPl0VrFYVkHEAmxKssHTj/uODGvww9fUc2kx2SFE0IbI2cvQcALAAnzMKIJlMjywPfGO6fzL0tiiZvC0UR09e54Wur4CXgpdOIYp16EMA1b4kVHxHrMizwGY1ogLPpQIC5DTzRPERKuxl6zCRSI77MX55wAj8JDwknKu0wdds7PM3t39022Ma97W7UirEd1QMkerCNqtHCqIFgYAImJRwooI2NUWBgFBgYhei3Ciu/GAUW8z/O9laTXKLBk5X8t/OiqiatJK9xXLr60Ync7nf+84dISGQNESwIOuO4/xYAAegmEm3nCu73/dZycltMZm9eja8zx1RGFftjFwqKwJLQjYCh37Qe3vOZ5BSGyp23fuLWXaSylqRNVq+nMvwOvyOQtB4h0DVP23VBOmAAQP7fq1q2hKiNd5nnGOQUi0bay92NuwrvfQDU/yBIARR3BULcE8hNkFZrQTzdiORqDEjaNUBqA+Uk7YUQSkdSvEBtmCNXDuKFkKorHXPRualcuXNVuCpz3bt00fbmeexErvkDoN9Lk+u/izfLACc+wakPYvZ7Y9Ck/SuvpavB3HUY9/7/Ytv5umd7Zh1nQhKhJETZ/31+f2N7/yLDaHISSj+53R8CJJuzU1z/ZrtErsFxTUrZbn7gdP5wLUx6hF/iMuGkoDnaSHvYLOxrINqL/fAH/ujDPwuhS6Qh2X1HmxeUIX8A64JUaiHmm93qHOCOI4iDGGgVrDf6Qs6Ed1JIW6HcisvN4SkUarzcl+afi8AXKFR6HzyDN9ADX+C/C6mVFRe4ztFT74xgeB/QzxKG/+/yQK6qbk0tdX1qTtv7eeSxJ/ZcMDH1cPf08vbxteu+Bx66bG5hKe1mbWNr5+Do5Ozi6qato6tvYGgkqqdvQCCSyBQqjc5gstgcLo8vEIrEEqlMbmhkbGJqZm4hsrSytrG1s3cgEElkCpVGZzBZbI6MrJy8giJXSVlFVU1dQ1NLWItWbdp16NIgS6KgidAIjE0F4t+6238izB+DXIiAeMRAJsRCFsRBNsRDBhIgB5IhHSlwAVLhIaTBV6TDJ2TAZ2TCF2TBN2TDVciBa5AL1yEPXkA+PIcCeAmF8AqK4DUUwxsogbcohXcog/cohw+ogI+ohBtQBTehGm5BDdyGWmiGOrgD9XAXGuAeNMJ9aIIH0AyPoAUeQys8gTZ4Cu3wDDpumltOcAOWC8BZ6IZz0APnoRcuQh9cgn64DANwBQYhD4YgH4ahAEagEEahCMagGMahBCagFCahDKagHKahAmagEmahCuagGuahBhagFhahDpagHpahAVagEVahCdbOYV51AC2wAa2wCW2wBe2wDR2wA52wD7pgP3TDAeiBg9ALh6APDkM/HIEBOAqDcOwUcY0DGIITMAwnYQROwSichjE4A+NwFibgHEzCeZiCCzANF2EGLsEsXIY5uALzcBUW4BoswnVYghuwDDdhBW7BKtyGNbgD63AXNuAebMJ92IIHsA0PYQcewS48hj14AvvwFA7gGRzCcziCF3AML+EEXsEpvIYz8AYS8RaS8A6S8R5S8AFS8RHS8Aky8Bni8A1isQcx+AUR/kPgH+QfEgC+A6Ef0SRqR9B83O4de+zm+1ej6HyypPlM/0pYsGGws1/qIOQWqd5mu0HLZ4d6LpjlzdnX1X07rIKUixNQVZFE9gcDF+KGcnhjXzU7hN29vdyUeK7yDzVlG0G2ZLloW/sLcciNRI/yI5Vmr9t9rnuXBwzVtSRWeKHFb9/slj+wKcJnq7bk0PFHdOGWCAS0ET3qJEo94OMTUv2jkzpAx8Cm8dIroKo0d455DWSF5Yiuo4VboKuv+z7mEnUggB/CBRp6F2luWCjOY136w/o/BUvj4XpVrLvpwI9OMFx+J98/lrpUVHFFXvppDdplmD2Oc1koucGTk5JmYMJ7mICRCCf2g/kwCxXJFEF65LpMu60QUww9R60IvrfReIpogLX1ibKTFJUY5gkKhWqSsm05Vc51N8tBRlQNzQQ/PiolxySqTMmjc2ie6/46N6qBN1BZ4XVh5nacMyOq9kLgdah4LQryFiXXYYLxG770iFaerf17JcHLUS0tmKkTi2km5llhG2fGDKUtPaxuruEObQLCQGxm0sHC0zCsAxQ9lMVORi19Dtj3RMwr54j6ZA2IL2XcdEKZPmJoaWonyTC5ldjpbedmjKMbRYArJyTiiboKxy1LDnRVAXLR56on5tqn+5ehaembjEFAo5KVR5beO3Opo7y/t9ErnHquX/TapkqwljJHExU0yutVZZh6tYZmWQY4/Not675LgOFLETeh2OX9su4yoTWxD7jGFI7Ic4Q4p1uO1kxe9T21v9pz6FbyoB3UfWUujt+vdSvUVZkQjViaLYQm7wKZOq3zsmaZqlZEQ5Zo1FRDhAHPVfQucCkyHdUwM5GOdqUs1qZbAp7ftg3wuu+qBjM+3uhomtAtUeZ6nFLuWEiS96gtihnTDsc37x8/kNx6oNzZX+84USkjEyFyvAlAUQydevwcSvPa5+MYSh7agVLMdlF/AHx7hy3owI6TAvFZOiDpBFVha23Ex6pxR7C6uYPImKsazAltZN4Jmg3AscexXbOdY5XjztH2EW966Qhoo4Mpq4oKZbf0C0CSyKT7Vy9DsTiW4CgaJS0JXl7R1XR9BczISTtNs2ANgE8rvhmnad/UWLn0610ksEO4Mgx9xEy8qhxp6DSliOPYySEifbEe6T38zkIk54ECMl+VMuH7aVODBSTHYoCgJ5qGMy1WKJo7Kov7hwTkEeT+bU74daW2llZhbMsS7KND0Y3oPuz5JnxKUyjkN+XQH+Hy2xho3WfjeGPdh9Xp+I238ybJC/Xf7wALLtgibn1H6BEQKjCDHEzRM2poo5uh51ltxGjVgj7ilpZoFwBcFtP+qYDnTRV5W9ZBSdyQ3HeWhIFHMlIe03nLMLbVzg0ZZQOJiugdMAmUdWVcAhy8qXcIIAnXHfsllDcJ+onzihBM/ZFh/3fQ9YrwNaYI5R8pnB6TtCCuZ1AjhHHP/DytooTVbC5TwyOQSV16PktMLA8q3aRmHaWZqGrh+GnmVutoVxKdkNBlotsqdgoZSeSDNdnkvp5aXD1/de+erpdek88FUwibK5S7xd3mbiZufKfV7WHZYDh+Nld4+vs13NYGhaMOMaz0UfKWEGgNp4oeh5Ao06BpBQDlMcrkDRAI6A1kyvFBm8FtkXVlGKb6qRxUS5wRLHBOq9Xfz5qWTRtylNV14IDMJCQOSsWsg3JWB+QlNDVI3D72l9rc+XaAelDuiUXFeqHVmp6EgCr8NiNghyY0K8dSltWGFenQc2cM52J/cyfe0+cfIZcGgl32/sHwuBylsDlgUk6oBBCKGRSHWQdkhLYzs2lXDdbQxoShqWbU9rYNuxd6zPq+mb/pcrcONUDSiBkYTEgNl6oGjykEBYoW0CWSgTwK7EGtEDr9ObWJ+5RNfjFnDO+yIFAecaIom+hEHrCtSca84YupOWRzBIPJFYsqJQ3MF2MMUwpYsDnYz+m2SSpEBmC0li5B+Hxj4tYocSACn7ODCR6ZhMcKBRtoicgyTCNOF5wT4dGsjYUWuZAPc4Y2DCegKxL/PdOQ8OGYBJLApKuKFbtu0hlTvs/lCR+yVYOLyVWB/ZF2lR6TBJVcIAfH7KLDYkn2wvEuCtPvtkxpVc0aaDq0HtSpCRszMqHo6VJjG3yzu5x9IDANC0F+zcOt0qBG+VC7WUn2appKSwMl5j49c/pFp8DRtc8/7U11dREsfTWYNlg53H3x/Rqbhab8A2CLE1+NDed+QQtlUpR8QghYdc/0JCYqL/b2CrTPJNphaZp+CBeHN0mllZd6doQmCaij4CwhLIW5o+TKnng5vnx6PeHS7wSZV6Ikq0ocvWUwz6Vbz51hyEIIJcF2p01eCRcOHGA4h2zTfhaC2RBVfqA5dGJJOE2sjNPiFgnUddi3S9KK+UDmfmrPyvyodphqspDPAHYZuu/dd4lc2OM21gESYL1CWFVRL6ZgNr01SHbPduioQ5Zwmp6i0wIJbGkyWaBiFptYtjx3sBbPPCKY5Tuw2KqMkbYeDY+WTU3sF5oABRolUWOrTuYrautUNs8FDOkQVnOOzKEaDpO2cWuMcJkYZTteo9km4ao5TjhXtMa8woME1YOOi72D13fZu3snGweb023r3COjhqqKQ2gbBeLKdkJVRzWsGpX8pKUodVDxycAaOwcUvHvAyKdaAg0gXTtxVJUhDt3WqPolTiimuIqq8wxcIkIMcPQrpli1TGfh+trOKZS+3334YFltrWh668zs8d5Z1PN6bEIt1O4wZJF14NCuDllnX4+7NIDSIspXFBfcMT11pAvYj56XoxNcihdd5LiFwwWdXDtln77uXD0plT2tCyZp4WVn1V4ZMhyC9pBY6ZjNZCzENIMx3JNpZMGnYlz/ydYYOKBOfzd2xYVRmqVVtGMx33CJ5uyqNLGfswzmhBH0WbVGzZMy9k0YzWKmPJ9XrvTV9QyMaTehA7LvahMxaZFopAE7LDeGqw7INbtPcIKps/Mu49LKvk9oac7MbHj8cLesc7tKN1NlndUa54/2F/9AA6QJTZ+gquG2qSjvXV4bxzs1QXOrVMJ8EqATq8vQ6wMORASxJ+ecU3oJBrcggWoTFkH1lYX91+OrcXTFJAqdunMaHc4EnxgE3dug3KBqat2woTH6tYieoybxXU9lh8MZxEfSLhg0vjdsfL6ly0I07i/mu1WLPSvMnKbQhvJseLh7B3zZOdXq0nW3r2puVbnx9lPcgrlAX3NKpeXS1TNe/dR5eCYmzlXOm7cf3qzLNo0Kwk8kL+7hiDImcbuQM/aCRxM1ewzj2Mn4tGw6beNzQFbvPhmcFfAuFCp1r/FCVdheVOwbOLe0TvJMzNOerZd8ZYOIKixGM9PF21Mdt8uydd60rtzBZdJQ3cE8t/p1dtwliMeSMKS3YneynVpSIQ8dsHx3TZPPa414WelH/86Tgp1w07u4mIl+2iM4wNJ4KaKoc5dsTqmmvfFPhkfJZHaKE7Nisj1cJp8lX4t3w6nUcI0uulKbSaVGHHW6/kzMH8XaS28WMDnasM6a5Ze1bUI4TN0y8l0jc3rE7ZzbQjhdRlxq8d0RKVUQx9fIPLXv/a1lEA7SQ+17oOqAGdiDpdDpN9zhuKLr+cLfGczRLFOnqmVYEU6Zsi1U8BaIcvkyvrEakWFeC8d7Nskcdzev1WOgNGRrlnDcTFZNYvlGBvVu7M4KTpnMV7johKMWnJT8NvTWEtnsh+CrwtWlPZdO9uHqb9M6kJUtL1VQjxacQuI3CUudE4/OhkvuPBk3m/pNdT2VJHOM+CrkXf+5JKF5p3IyTm+nyTW6wWEvwFE0OSYq5UAcjNcFjDCHEgEdRXNSkT8M3igWjirDp17rwGcgW+qO+YGjL4pXjrylP6UgRw4hM1hYFB1uYqdxemCDTrF6LEQHnAMrm2XoPhn4uggM5hk6nWo2nTC0K0sQ3F2S5duO3G4bzT8ygvbzyE8GFv2bWNHGhCOKZg4g8RmVVMPtJyKTXMFXv/Rfl4l92bsuAf690taDsT99H3IEBLUSDXUmk1XJxZfcRg8iyU8lxr9BkjHeCN8wth/JBFJykUjh+9BkJor/BKXqC/nsy/Hd9q5jXRm5Cv5MzMO/0/apF8C+RJzOiq2UY7VG5QzB4E/YRPHvBBXHu7kxIXVMPdW+z7tt0BCT3BsLwkY0ZuMkF1KofbaVOnMiVYbTptoG8sTwV+YUMrvaHCacT7ReCKzmj0mWSGifDannHuSCRqVJiki+KKQCVwQ82pK2VDYSgAByy0k8y5uZvikao8RPRG4COcKZEtyZMvqrF0IEsN8etJgAZYkD5kK5H1bXhhTDvry/S8A4ZcCllNOo7O0mtjjnxG8Jhpykskl0rkit8ZKA2diO05V6oulq2sE+GNE7MsUuBaO0+GyAAuiKIAMzKIyS8GZfkpbMJMAnMJjD+DYDOg1tvzV7HcrLxb3SKx1adGErij4XmfqVedAS5djTFmipWQ5eP8BXoqfcK8nCv27Ud9Xx3hMzptp/nascYZni65CL0zMRbyQpgXPUPC/YeMpLEqh07h4MB0WnCIhC2z+oVLTw+cP9Tam0uYrb5VNlEuDaA8kzvI6AC5IQ9zhTcxjWwwaTSp5jYX54yN1z4Rkn7ExNXoU5E92cudb4jj/6h9jV9r2G14Qy9nbCQAThTPhFQD76HRSR3At0lnaYUs1LEFNP+dR3F84SIa5SGWDPvWD0DpM1D31DjrbBFfxCei5l02ktrFBiY2CaBO1tRf07I2nBgRJSEWX+OJpi4+ITcua5LaSoytceBlmaRXejt8HI6ALwIM75GhSM45Rm4ag1hPJv2bnCbOWFFKVnFEsnW0uM0HVB2B/jtW8E2VO7Y11ipQDovSBJB60wfX7mGTa9Rkd9uh+9ML1nXjCbTkF6seM1OoT+Zv3MuYX7S7Xz+3pyK/nyI5prHxQ15inG756vXP25KmfgqNS+txmr7nvTWhORvMMrYU1dzlrhetzzELXCOudaap220kSnGul3abAGbuGRSuJ/mYy59CRpVIN4vbtG2bMW7DdRJ0EHFzWPJWYYL65GCZezSsOpeUpdBtGRPhPQ8INUidYaqEVQA7eFwzB9gFDMHGHzQpQk6VprNY1fxzUvek33z5wbQP4IGgqSdSVwlOpovKy1MID4oQNHFL0VmRdxphZoRSViXjN3PYFi5EN47Tv7l1++CM26/m7YaW0m0L6l1258FOW1STBAvjtjLdClcrADWuCRM+b+fBq7gk1kxV51ljEjT/ZYrT0YJZjKao2jwYD4UtnDelHpUnLf4VKRcjGq8j34wwINXSrVG8aOXeGKt2RcS5eS+1MtR74xV82lFiuBkM4R+fxIapUn0y9TaMZVY+fjKlOUpceiz6L8zv6TH8eOdfnd8MldA6c+SYh+4a2+1Gv7gGTt4sm1d6JJfNx0QjsAkaFfUe3NlgmNgBhYuuNUNRtS4GWdgsSdBynKFwpF20c4BEsw6SJ0hrS4FWhjotGS1jz92/C/ztZ9jaFu7srfrzloYCVfE/xbN0ATmUy7uW0iRvqQXJ/5fZ5kZqObIUKUiecH7jcYoNk7YDaAaSN30kHC2q9OGaY0n+34fVNK82OOSLV/Zkom2Ld44tIpzCdBU9gIkP99waDMU7WFvHVo0f4SHDfWpO7Z4oIXrV25wV3RlRTXc7IkTlolQmMOUKhIDyPNnvpKR8xAFlU7U0cqvY3DYOi49unoRFfV9O5FehuLHTMv1A/MtatM3VS35qnkwcpqb+Ngd619TK1yN7utrqpFlOpWKja9BTorCz3cKoYdiCm3vVyHREmm78Es8XqLB13cVzZTr1nT7maN0EZFezkU4NoF5BpWZlado9MtlxOsh2hydkxNNw8eNkC9/oWj84YLK+f6dPohWpkymhdarx5Aencc+PQaMStgYszhdmozCfLIUkKKxXB4y+3UsIKHGnH0FS1O7E4f4T75RnQu8kyEgH15iasdz0ZNnngDSSEJNRyZUMZhnlCTNl5ZIaPK5po14Diiw/qJVWI+iSfRMPvEykyLDUKL/C87kUaYKRskZeHPpWYyw5vcnYoTzdXbDsUYtocxttr+NoAkxG2sFSHW2LgDB+j3m1NdI2a4n/SRfbY190sG0e9QmzSvYTxxf1vmSk1keUPkevSjqEoqyiY15aj3zEkPp+J+Aum3HGkHhwc1kMfpkGZ/lwr83q9sMvnnOGLS1Li9qeTH+heqQND904bIAIJnRC5fRLdbPrkrufIFGcmEvAUyjOlUkKwa57Fg6pbIyjU4e4pWUQh4NggG3jGZeQ8mS8OTZfe0TPtve3boXEMeLPhuMe5RRFF5xPhH17aqB/EhKb9eBnbf+Nrf7e+7mfldWdIz0u7WeefEX2an7UvdNwc5K26d1y2VndmTlc8En101Bl6VG1ztKiMy3AkkTwETJwPEPUT7bCF28fRUPdXZ8OQC57KyN7OJ5jdVVZGyuOXyf0c1aHmZBlZxWcNlMlVkBmmBgMX6DLCfKpoQ7fSILVPZ+JqCv8czyqRcFy/9Xp5Q3muyEkAS+n2OI732BZtPYI4O0Me39RL3b42y8ujY3ijiiajJkxv7T3u2xAtse6N7Rwe1WtjYRj2NEAxMOWqqS4X7HubuTXZM3jCQuw+mTjN92I0SD/MQQ1oPaogM5CEGSV1t9io7W6V9m3lRR4N5m93g7Lrtq5rS7uQM805Jm6TT3EdYSbJnRuCYgIAxswKKzxNnFQc8XEHOZFJQcDLpNMMpSk4mEWkjIyGJdItykuhW6IBPV9Uo46N2PcbnMnvsjnZdzk10ind0iXKNzewy6rftN+oKUY4tD54/LRgaklhtd7RJkOEa6xwV75jkBNyf8XsJjMKIXgqmrF2tQ3QAmS6+97ILScA5T33TSqKNbvPVr1EHGgw+FezteVAm4x/hv9IJ/gdu7vWiGN5TmVof8zF66X+YG1RaGhQCz+/bvNGv0DN0dKU5ERw0blxQiKBudXqU4zhsmkKr8/Zb55rg4hzPxUSZclWMdSqIsndV66dJ4xTe2yyAW2+xt1gn7liJMD/pM0qiHQyG9xqcepaEqdnKGcttvy5qWDVDJpNHYknSNb3yVdMlYMotjICSAAkk7lviomQRrT+YhuI0ug6mNaJu12yunTtgZ9c/FxIO371pNDzMT6MHAjKa44o0Iq4ghB9UgIuUQnp/CEIguJsbHhAuVJbcD1Az+gBcYFTd72VxabTbiezrYp8fDoRh1M6dmjjXnq/fNLsCJSCAGzhcBAlJwKLi1LxxA6XpkkzHAvy4uRCq6xsaUkVcNloy1vyCSifXTzQpLqV9kmxP6DpRWB4+oeDmYH+TcGaPIrhp3iHWsAtFOrGdg39E9lRhqXxzRkVJeSaqlEYRf2wcwsQ6USFbc7ajlMIOQ/iM3BRDArLPy6JWHcD5RWsJSBgviD9QAksOxFcdJY4Ct/hGS0ueRbYlYWlhKbPMtuCpr1Nvy8YIaIGKZZ+aMH7udaLNbLftvjawYdBCZ6jr8XW5zsipb6TWuYQOenzRvXysYwYxe6qoN83OYxNb90kzmnmZPcDG5JNAOp3ghnHbeTgPnnHBEa365bBcfwWKviiGJpLUa8gvxa1jeOkeTigsHEuLwMnlGDVlpEXYoAeeeVUZmBvkYdyuqi5zLI/N1bxOS/RLTPdKD6qlec1m54kkIgMuRnwtYWoDvF0iknDSgesiYkaaiqx/z9me99eQZb3SssgCXwr7Jr7hMF3MPoI7Za5kOf8Uxr5kI52hAO1pvOkkAmiDw1iWWGQC5IHeCTj5wtsYIWO9cwH5rXgZs5vbyfL10+8kOph+vo8BvIfp22/sxLtZh0bA8ck3mp0zkpzunB4MvD4rIOx5kfs68VDv9BGl4q2fA7ZSOT15nujgLI8fYsosxyzj381gte3f0vRXcFfop6Ux14PM1FRmG9JAqv4Kzkp9DQAbd00J0yt83FSPhPOvmBKS/87yEdOjpgh/VRGM3B1zMzuvcPd1V+j+bqNO40NYZmfdZXoyd3osLPNu5KQeKTc7Z2H3IHdDpVHJyI81YHb+mAgLC8k5OaEnk2uPoeGcOLkFWfOD0IyNYtRSCIgJwAhsr1gj3su8MwuffYe5FyXRvRghbz5QQTq6A8xZr/EPZeYp+NRyS6wT3xL5VHTa8VHMYNz6LZGnwigiCvWTqKj3lm+CPdKCz/huu6lnK4sWp4hvo8dET7Db7hYX1n7aTZNbgPLQ3Zb+j6Ihve0XHngPCew2RggD36oIGKcTZfkieag4HSqo5PtiYkCsE+Wje4nF3wBCYrFIHZWX7RUDA1js7gSHzBjOrW6GiIIRfaPlR3+2T2IpQQ0OFSAIfhS6iXxa2yABW0O5xKWllLZWKHNp6MxPP/uQFhDSkkw0tbTTlVsSVVoNCsmWfEhgBXau+V3yUSRBjrLYtbMiwd9n0yYLEpGTmzZLPnSKCksUy7VAJelT/m3RpQFsBIelAgmNRkv6TozyJNT5P873cIYkz61uvykWa8R+ca/OfAW98NLXziOmRk+OCJ8cNQ2fpxqZ6OpX8V1t/JYt/Rh1DKUhTqGhTgSB7f9Xkr6xhiaoNrrREWTYF8+4ZiLhzgotCSkuUpSEzeLq2aSHtRrFlfR/CIrIvtlmR3l4RFuefzr2BEA+0pUIAobEX0Q6kY9Xdo5X2e2y4vdiPiLd7Ju2CmubUFuURL/43bY3P1++tiXLPFN8bLSGuohInaHWxjfF08U5NtbZWUxOXYMpRt6mt2rS/LoTkMf7Y9S6tc3zTRqccsdK5lk36XRN1vMkY3OdGkzm3127rlCW+7Y0syvf1zcfTPUt+PZNK/DRvnKf/PPZ8h4HqRkzKSaoombOoIQEuGHDfqeVaTLHJ3/72hMUpMkY26ivxxrOlRWm5FICXFCp0a7wNIuZuhRtCnliXHBySm5jrJn3kiv6atKcXxHvZRcd93lnnItTXKxTdpxT21wc7MQpIsxsZzuXmx9NqP8jB8kNJ3+nG5LxdWeehfW3ZDm1nTozQ5/VD6LzvCYqYNvZrc2NK9i8nUEvWJ9YgMr0gEduKuN5PK6bK2ogpVJTQlzQQJRXNAgQJtXcXAmYYyAhpD58oITH/Z/CiCycxNhGnMgJ+uLLjd779Bmru3RYeu35CApbINWPg0xxy5RUW+D7wwC2roLU/fsVArys7cyZKVPaynBBRVMTBf6G/kX4pAD5W8vkj+C/f+EjdAbyh+76F6EzRiqu6QgG/gpI5lpsvCbrarEnpv8MWgw7aM0YR7QOM2bezZYmC/nTTD4yikSmRSBBwsw1bAtJfYlKX6ZqNjrt1cgv2tYPFNdckGv8ptimPqOjwTI66PNGEEM3/36aaTCKv0jNzKSqcAE1NQ5YkOHiaWJTulTqJhtw97aQk6kPkuhZqkW6qbhQHC4uEhszaIghOejuLXeXe8kHSTeplE4vgIVONKKFfCI5aOHtbuHu5Z5tiPJcjcS69Qeb0FGUtBh4K13uTVbWY+uWttmUGZvq6UUwslnaxJzyD4NyOUkw8EeDRa9Mgk1pJE29shsFm/wof/wB14oHYIB/HxpyJtKN9BgRenp0eu74+sEBgkG4EeyDjyq+m7qaUNNwl5mUWPNosAESYRCDj5YlJLyRWX/Pic75Hr1qWIsV5Zaie9KB4P0QeNYtV2fAiJMNDF2ESYImo1JQb8S4gSqQ+siSmoSL2m+839qFG1RUUAJCSEVH5xfRx6elfg0KqKbG+ZritF/TslL7v803V5PmFM3dHsqt2LIvmD/EBbEPqu19k54Y1EDiWMCizuI3DyEBa9hXkxx8fvbFCvr/LmlhhyToZODJgwsCFhzUBmqBJx6yoT4S1NTOOQkJ7BRGwJMYHLfTv7audu3JJ671/ovTZz5mA3w57/Kv3VQLNul/N1OWJ5tZMDwC0k5Mq29177Xtxx/NfQveiqfxnlxy0T+9XcCkE1/XSfm5WsJ+61VeufHCIbVrzeOvQkvyI/ldOL/B0FKvgv2/7BhrhwEhkGIm8jIl/7JNIYHRMAKWsY7J/mdPgoRQhkn0mp5s1zdmn7CyUvPHTJuZMQOc1RpseDnw38qCMCTdMMQ4uFzWxtl6t2rgw7AoZO76ODF76rLw6XVHS2pjfMacf5rNm7oc79M1XiEaZqgHluyqalvPWs6tnrH60C913OR3B483O7yjZR0Nu407cX7n4WFV3JThrfDS3PZ3jE2A1QZPXMhe3uC81ed/qYPyf22ROHNWZo7TuOX08X6q9p+PVPKdJwFm/uaijNEbM+qzikuyNq4Bb+z0gtH1s4dtayr6622sh1Efn5kg75S19elorZN5iEVZAd3hLr+/+o4DqnVMshrC3WjI1cMQ8ORN2qCTJNgfaxjmMgyP+BryeHEA2uGN94xfB/Y7JPA+fV+duSSOoehlUIyAbuVJWu68OeuU0uyLX76r9h9Xpa0EY76ZQ6iq1qleohdjceWc9pVCTrOOQClWx4NV+2Ekv93MrmJOe2VN0LHaPC53XlV7sSBoUWXyQLZbp1Zu7GjIs8kk+NIXU9jJ1BCqPOC5xhObmUHki70BlLKGs+qdePYR9GUD7RV2ZgYGEtvKOetU379czJYqd/F5/Rc8SYJyjMIGc9edO1nxLh+63OgS09X9jR5EW80S4UN84YvqBxs2enLGBXR2LJQI2FMv4AZmWzv03Lv4/4EQwYNF79/nLEngycCK3oAFAeWtgdpA4EnkMtK1c45tKfBEWK/Dv+pM1drakxDB9DAESpqAetC4zNZXI/bu6O49ujlCRqp+IPdzXDWoTU/0Mq9dI825iP5QjZK9IDGHpXst4ZgRDiTgRl7n8iYtlA/hHX4IOFN1tuCvHiRgL0CG1reAvpq+Bn3+PemNiGh/L1Aq4SVYuFJOqsPqvDUiplYEnxQkcpIl2+Voz54gkacJhDvvDKjdWAvkOJdLLDmM8ZqbT8omehN2BdTV1q0HTysSQZ3L/htrNwI34Mp+6/XFwitGVUyvj+Lmeb3lvfXq7KiG/QlFfUk8kwCoVtmevbIhK7H0UjLz7q2cmox5ycWeS44ytoaLWh9Xhb7UyP49nzsB4eeO8sfqMPCIg7UmA3keCztAcCPQGa6pOznytBgBTRogVwI21WwCA2IRpNrlFy66j3KfMOHwHFzoI73ID/8jRFbWE0gICDbedwH8ExQXXf2vuJjHW7Li6pX7d0mLC31yEgSyMALG24qseEhMiav5IYEx9lOvKATMTWqHNLQfiWNfpAU3G+wnWMM2X1X0rjHLMzm5lz9sw81VZtZGfYyAlxiCuyGt8IdHBxPrNiOo5uZGYWORi0tavsumqoIgAa80knUFEu+9v+QnQV0wcgJSQQpNYFDP168aO0c3KSEhSCxAAZ4UoxRBlPBgCgghhad2m014V0MoZrTm27eeoDjNS4FOpn0HvoxDqg8gGSGRJDvKMN7caxnj1E1RjkwUu/iFWCsTQhC9G4pIrpDkCv40wETjGASykNfku5LPQIbBZuBK5JpLBIfmeGcG2OuMx8bGjjUqtAvI8lZobavmMJGa485Ri0MvWE2fsa54kqtrspzwsaFiNQzlhI+ESLybc2Ju8F0XmN38I6uwrvPDfmF+ddYV40octQTt0ttB/QdITZr0whe5Y6BZO7NNSLz0WNuJdJ81aVKbsI3CKJx0VwIS5GQNQQR+gcgHj0EcgRtZGE+B/S69vzP/AU9/LaqCeS/rzitjjevxh/M63Thn8P0791u33Nks3A13sEPcEDZ7cIJRwZ+/5cbT3r2fZqz7+3f8bKLn3tbBTZEe6UoNXnP9c3oGBshRZLWi0bLobK19kn3ELMSgV9ZrQDbbRXhywYPr2HCABLxCG+P6jXrEo8qb34OCYQERNgTXGExPjNeNN8rnq7uIc0yYja+mRs26kFXzFzCzH4porHJuI10TvsSes+1S2sTo8572ast10etUlg57IAHHWocvTPYdm7HB42w8bcZJY8zuYwS0F9wzlZgQS674lVYc8JOn+8abOsfaOint7aEMzL+/4J2WLBxgmEZyFbg1qrAAUpMmosIgW1QvJLBXTpjG8P9LepTDh3Ahge04yjC+GfwvhTp0fk1cUM+3b5qxpdqxbrplnbeFiQga0p4lkF+eaZNVpra2DUuwVaqtyiT+5mXLKlwqlpaZP+Db8LXBtlYhsVaKYBvE74H0qfKp7AF49Hr12FNqoz4bcfAMqrq5t2TYc/NGD2F9lpOcK/vTkBe+r6MH9oXnNYzuSwx6gF5IGQNV8/U5gBqo8VQhdbgBAQE61uSNZUtF1CF9VgYj0pwEl1hn51iXhOOBjy8OnOByPGHPnhOnsA62dnTFWusQ4OzWa936rZf17zSzxKxZP4mCm833pPeq3hQjpGN2Mlj9AFIqFSUQWT0bvyFcpFCeOzy1+5mEcbkejONCEJwUah+aFGy/HWmfoLCwCo4OvlsED8KS1LZKa7swB6XeZqsIC5XCKdRpM4yUhctcgh9wPlOJom81cVhlkDbPfyqr1C4umSwjJoXk6Lyn6JU4ljZWSfmNp6aPuhukl9Clqj4qm3APmbzEz2+pfT/kskjVHtth0Fdl28UNk4Rxg9zqekOny7dvd8dZ4kZHzAiXO3Id+fIBJzJWZ6h79fLnz1evdsXCilruytu3OiTJZh1dYaUkLHH7xT7wNF7/61GOZt4pi7GJtlaMlbxdK1k7LJlprbDi9EBW7BVIQImeQ7ChuuWHpx4YsVVVeeTmelbP86jKy+P7aALVnrl5nnNUOdU3k7ZQq9gg65wxY4dsvUK7MC3WOpSpaaWwiZ42/+1A+iXWuLvEnWYmvR9DIddlQUF87oYHLcfwXz8TZbdncWfdLms2XMlrMRgZryVs2j+ZlgtNlTe/dLjEJgn45WC6dFnQJtvf7BZIwE6MgPBVhDFEMNbPlxcz5YS13lXxU4kRqlCJ3+0SYw4+r99khV8NWGZ9fIn3a0FoUQ9RBA0xRjASQus3ZhBLggyTItcqZSK35efB0LiE2z5OHNzj3XO7LyaEu73+T7fy7//Ig6lr54s1s7ffIaJ/abAkYM+d4XSqilaWVcRg1tkdVTSRx+vlCajBDw25n0wq/v9APYMRYhIBPFcCxHGny16H2zW/863XAE6Y2fadiCV4dGkDkC0tNCfiJ574LJl6zAuESfWsT0zhxfj4xfaKGLDDNNgJX2j2b9tNQcv8ssLf+Lx2wMTH34tUVgS86thvdImOBDNCMEOOjujRJdt5v6o7br0scLlcJFPu8jNKkC4hGIW3PhXv59PxCXbXJAm7R25kAq4/rUFpBixliL9igpM7wY456w1+t5lJxcEARDn7hzaUPvd2PFofEOk2lKZH9ACeENUqFZDNqodgQQ3OGta6pSxcqPlGu0bit0nNhVQUrL5K+wauWoqbdrgTT4ttpWUF5rycvCufuVP7RTsx2GEgkdzKM21dp1sNkMkp8JnfwrzTgjffZbZmpjH8/mWq9pZeBiP/udtAS7Hww/uhJozq67vqwaONLAeQEPxYDQKCX5EwFq3DtkkV7ats1sU+6jl85xmK66R9TSllAj0pU5VK1iPScVnM5rt4/tu5PiH/0yVmft8k66ey57fum5wHmv24RRdkUVNE4ffpUt/CfD2LmPWamT4oSnlYD2FU91RVwKub6uVqF5E4ZmiS9TxZFQJC0LDNCIlmKA20oU3Qu3U/ipeygTjwlJ8uLs6EukEQZmveoBkwijOKH0hLG0wynHfYMGnwUgfi40pP2us+JBktW9OQl9Yd152aplnVN9AoJIVtlzu3h6WldsZ1erB2HNFo7ioQo4kBR1LTiTn99bkjqFhnfra9tmwYEtDPexVwtOdo59AvJGlAYBg65PTdC+ix9dqWaGQ4S3vpn3P9z18Y2pXbwgjsnr/z9wNYhIXN8DpVwZIurCwtdZjM0PmE5BATybLY5LF2U1j5fkG5Y/RXv0IujmeyE1wVIx8tosjNMNRJ4WShsorQ2+KgtAtV2oTbJomCWMO2qj2j8NU/vtyz8V2y1HcS6MvGd0zao0q4Ho2fepxbYfLHkdAHJonMO+NdOr6+bGayB1l1vDPBXscNgy+Mh/kj210/8xDnUCmkIKXPeb/OfPcDjlwfSTLsMVJih8aKss5jSsOjhnX6K/TChNbDVu5D6ceLDP6Z/jMZNB1sp7kz9g2DPmkkmJno02S2OPTFCyTNNM0YJwmTdHkm8MGP8gA/OY+8cdri168UBu2SW/yU4eFL5CWkW9b98ZNy+JdSNtLaVTXy/Ls7P5ufo1YdNvEt5s97YvuIzCczLMGIW77G86c8eL0cySwvKV/6om5w+88rIZpIedKR2Usy4tUzfRz73PFVKnIvnfX2D0wazC5uKDM3HZNT3NjNacwp0gTHXUK/p3wehhSZ9i0LVuon7m/I9K2KrMio9/Wt9nobySKao8vT06KnjOm/7RL1linXGUPTIgSkfF+dn8a6N0Haj/5Yw8LAHyAc7asE48x9B4y9+eRjtgcG+ADToyCll3e8wIPlnmU8YBye3Q6rR23CE9PC7GGqWT14D0vN7EkwY93Nkfagr9YwMe4GhreulukORpzgc3N0yqzkD9LZcTPltqK3S1QKCZftGwpN64Y40UdaSNDD7Sa5ruQ73SaUrZ2w/EWu9AD3ewYj8wpSRr12D17PA+PG9e2XK4bSfIrifYC3/qj4OmVU1dfEE12OCqtFcWnHrv8UX7YTepS525iJUmuZobl41ztRC1FO7hsBH1weCjXCboxqoCrgNKFGJM1FtP5qGs2cThszBhKwf9VqTmnpToRA1DsxAuKQwLg7rrdcl0W3RLUA+VOfrET3LnR4p/VAy4Daegfk7sKIiADzCXcxlHpg62N3yYPWHEszCxabgz3BOOxdxcwS938i7O+Y8TNLLlUFBL7NkQXA0DZIPXv+7JnmD+xGuiYPDVFCqiDp/Waz9CiMwKqYyapqbW+EBNyx8RAU/vDEOyDhWtwhTjH4bJCykdu5o18z93OeFlbWKfbU02HFq41E32ermNRoAHpYnLKBwQ7/oiGoWQkYVaMbEQ7jW4K83rK+5CkWLQ20+/XR/6oG3QcmS5tkr0yE9VLWRN56WertY4o6VlP7tG3TFsxbUD5+DiTg5zpWDzK0p9Hoz5DAwE0p3pz3Ef6g6ETNrdthpq2ilDOznXtEXy0+2Cn/oP/ycWPHgvAikaHPbtECp77SlHzKUG++VQkf2RsGB4swqjCiNGxY/7OUkJj1jZGwr4+Yw0o12XUQ+dueg/nDhhgB5wz2lzEc9EuNTDpWdNjY/razMW9++eme9dW+X0e9F3p1Ux1fUDX/cmSCrq/HVD/9yOVeqBd0tSSLpOUV8SOPMVHV9U6qQ73e+9ivq5ciK8Y0RKG+HY0d1ugtVs2H/451R+jr/zlxuc9nshMReBqw/8g/eTarEU7o6sd9AfKupUR87pUvnKmXRwGV1HN0ZhjKGYxDdsRt9Ir2pshBPce+VzOmUdm9yOfe7DnLU4Ti2ZNYC3Mwcs2THs6dWeJZdziY8SPHR8bu500BB7hwOQTwCrAPczKP5iY8nDx5BeZ79MDWLf1jxgyG3xhgZ02WW0b7wUL7KIOOkwWTJh9zwpErVDw1z523VNWKblkmAxgB1VwPhBsrm9UokwPV4daRLPyUFBJPU8PhkkqrHDFKpargg7L6Y5ASIlE/ZSSuUkEe8EM/NgS/wL+1rG76N6W6MkcGNP6QqqyUj6qyegcle/p0SkBdvvyZvxpiKR3qCSptWWTkkEnBBpfOCRPWr0979xf7ApOQrf5gRl64dm2yC54PBOaM3B5zQtW0Ab0LpPounaaZkIDv+tE6msHSvlZJ4wBAakEvAanOab6iVa2My7RqnDEaHQChKej7UA7aFqpEP4cS0GshPvqu1lh0CQDEN2jxyviDrgEGglYAwwudC0Kf0bWhXvRfqgj9XnXwseLvnJ6clBo9TyuIFksBwacxgRt8Md8EXVY2lIgWhALQnpQOfQmCj0KJyDrFRUapTGgU+qxWGdoLpDqUB429CnWim+dnoPdoX1eGdhXbg+4C7nV56MFiG51g7+ss0E/+M2BFMHMT+cPqMdoY9IKiBBIpolVJIj4Z0lQj+nEolaOiK4ohlp86xlV0L1QKSSEpejdkg/ooJ2WNTa0Kmx7+VQaNNUT+NlQssyF90iFBB5S4pub8Qyl3DPEIutXxBaPhJifVjR9WLnoKSPVOmkWzI/lfu9LQz0RbhTJfVx0k5YlIykHQNTDGb9r/dA5JIJSPng7J0Vdz6lC1qEQnles6Jqh4fgE6VQeVWJIirFpqKlagwwIaMxXBvxJKZRR/HZZEJ6KNqX86RKOjAkiFomf+F4BaYL/15cUcrv93pkH2tYLgL0ZwGmb+3zPsxvZEEWryL/xHjlEWjfU2wfe4v277OxHgu///tr6NCJL3++H/bjg320+3lBxqC4JmRNh2RJqMdcRoNs7FrpjoiNNmoSNes7WOZJOuR07R58kn5Bao91p1BN3eHVGnzx1Jtw+XV3w7Ggz6dzTqNuv/DsAM3BjUE6wkCIqu7Z/aYDkOEVV4e3/gWAgkbdsflBzY0nan+/iO7xhRWCySr+NZdWgH4an9tvnOkIjbJPwXrZ68avp0dzfgmj5Znm4+Ewgo5LR6T8GnBxaLhuKK/uT9gEYFAULJ/RkSWQC3v9U5uafgvsuRalJBqmdXozOlBvfOBoJNWt88OyKEPTnha/2FLHXiS1jJJ3f7YgOtfGpemYyabNxNuTs0VYDSCHMYLvnXLbOXx8f/Z+ertNqdbu/PPr/SBFGSFVXTDdOyHdfzgzCKkzTLh6PxZDqbL5ar9Wa72z/y/c8rSrKiarphWraTyebyhaJbKleqtXqj2Wp3ur3+YDgaT6az+WK5Wm+2u/3heDpfrrf74/l6f74cnFzcPLx8/AKCQpO7AJGZQK2fCSYCi/PsuViI4ypGTfZ9nT374AvEJntImLeKj2pKdCgUIu4xurG+xHkwh2fc5bnvxoIC8fg0w8cE0XXbJCGqcSFDT+jqaBNNicT20uAEgbpNz8Jym0kYLYdbWk5PZgiE3RacC5mZM/LO0Zjo8CO6ySJrVoUDDcET9ry2EC1K+E6UEZtKE19xBeY5PBXJvLn/baXe0xZdUJOEE0rAnHnfX3/8tJLniFXJKE1GEOuXPdjLKFyiq8TGA8hS2xJnXFuOKkxcNP+CL3X2IDhLpaeQ/Syjaojj6hCuWJw7fojE4JrXZrtqoJBqoDDGykN0CwrxYlwYkqNGQqss88Q5aODYQLSeZdaajClpAbEqtjQNsmEgz1MyymnfX+T91o2E0evu9TCEg86nIMJi/GYgBWzcrwrfVs+qPB2BEHfnVK6jIIn/yvBeRs11l3UZ5XRACQ+sElPg9notE0vxs/k9cpnXoEBGqUSPrDVAi6pxm1+WdNYyCcZfrypVgxbVbK2WeLfbZDkkVFSp0WtUGFt8I3Ot2zR8Bz2rNzk43A1SuA7UK43qXNq5/tG6phCoHkfAKGMh46psvKQKRS6y31Q9k2vau/48byQyKyV39RJ8bBnKHUW1RPDUCF5R9IijhC2bE9TEFpKTEX4nc2EFRXNPnBLM992EKbFoNTI7bfe+TpH3NP5Oc+n1KaHpmj24uQXC6EBWswb1bxKagdcuF+oYAQ1cTSCXFRBJF7KorKJlzdRIpbzkqtb5594GVbB+MUGGDT7hAn/rH+9NcG5d06jznBNGctUqwxXrXkr2L7o3bAoizbSvUSfIivOID5tIPZ6wW1nV8Zfz0hbl2nuW+zZ+zANIbDKvq1yI4w0AAA==') format('woff2'), url('data:font/woff;base64,d09GRgABAAAAAEYIAAsAAAAAhBgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAARAAAAGA8TknQY21hcAAAAYgAAAO3AAAJWmRNCVNnbHlmAAAFQAAAOjoAAGzYSz7JJmhlYWQAAD98AAAALwAAADYpnBa/aGhlYQAAP6wAAAAcAAAAJAfeBAtobXR4AAA/yAAAABIAAAIoKAAAAGxvY2EAAD/cAAABFgAAARaU1XmKbWF4cAAAQPQAAAAfAAAAIAGgAQJuYW1lAABBFAAAAUAAAAJnEKM8sHBvc3QAAEJUAAADsgAABk1R4DGKeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGFhYJzAwMrAwNTJdIaBgaEfQjO+ZjBi5ACKMrAyM2AFAWmuKQwHnlk8Z2Bu+N/AwMB8h6ERKMyIoogJAGk6DJp4nOXWZY9dVRjF8f/UgeJerLi7lQKVgeLuNnV3d9cpFHcv7l6suLt7XzVpstr0TT9CWc8sEhICn4CZ/CYz9yR33zn72WsdoC3Q2g6xNtBqJQ3+jYYVfrWh5fXWbNryepuGZv+9E1v5lQ7qoq5qVC+t0mqt0Tqt14a1bNwILVe6+UrTP6/861eD37G+O9O5odPf376yHe281tZsw5Zsyxb0YzzNLGIxS1jKYIYwlBlMZyazmM0c5jKP+SxgIcMYzghGchCjGM0YxjKOCUxkEpOZwlSm0Zs+9KU/AxjIILZnB3b0Z9iZTuzCruzG7uzhT7Qne7E3+7Av+7E/B3Cg3/Fg35FDOYzDOYIjOYqjOYZjOY7j6eJrJ9CVEzmJk+lGd3rQk0ZO4VR6cRqncwZnchZncw7nch7ncwEXchEXcwmXchmXcwVXchVXcw1NdGAT3/fN6Mjm/v/bem9a08p3q71vWbv/uJf/p6+O9aPd8r/+WlZzF54b1DU8QahbeJZQ9/BUoR7h+UI9w3caNYZnDvUKTx9qCs8h6h2eSNQnPJuob3hKUb/wvKL+4clFA8IzjAaGpxkNCs81GhyecDQkPOtoaHjq0bDw/KPh4ZOARoTPBBoZPh1oVPicoNHhE4PGhM8OGhs+RWhc+Dyh8UGtOSGoNScGteakoNacHD4vaEpQ608Nav1pQa0/Paj1ZwS1/syg1pwV1Jqzg1pzTlBrzg1qzXlBrTk/qDUXBLWHC4Paw0VB7eHioPZtSVD71hzUvi0Nat+uDScJui6cKWhZOF3Q9eGcQTeEEwfdGM4edFM4hdDN4TxCt4STCd0azih0Wzit0O3h3EJ3hBMM3RnOMnRXONXQ3eF8Q/eEkw7dG848dF84/dD94RxED4QTET0YLXu9PJyE6KGoZtHD4eREj4QzFD0aTlP0WDhX0ePhhEVPhLMWPRlOXfRUOH/R0+EkRs+EMxk9G05n9FxQOfF8tHzOF8LZjV4MKj9eCuc5ejmc7OiVcMajFUFlzKtBZcxrQWXM60FlzBtBZcyb4X5AK8NNgd4KKnveDrcHeifcI+jdcKOg98Ldgt4Ptwz6INw36MNw86CPwh2EPg63Efok3Evo03BDoc/CXYU+D7cW+iLcX+jLcJOhr8Kdhr4Otxv6Jtxz6Ntw46Hvwt2Hvg+3IPoh3Ifox3Azop+CyuOfw22Jfgn3Jvo16slFv4W7FP0e1R76I9yvaFW05P/qqCcjrYl6MtK6qKclrQ83MtoQ9bS0lqD9n2e1Fh0AeJzNfQl4HMWZaFf19Dl991yaS5oZzYwuS5ZG0tjWYfmUARtfYGzAGGPAnIEEk8BCiLkSIMTO84YsG8IVILvhyMHLstmFJCYnwSEbNoshgTjcIYFwJeSFbNS8/6/uGc3IcoDs977viXF3dXVVddVf/11/FVyIgz/+C/QJroUrccdwZ3AcyYvS0GApL0btSGxgeIxkSWVgnAz2Ej7fSwbHyUCWRAxCCnmDRLHE0ODwCBmIZYgoiYW8JEoGjcfiscpAdbiKdYeHbKjswttSuTQMmcP4JiaJ9PHyirSbdOGXXlGubq7Cr7SwVFq4Ei/exHGFkTy8KyWPy/UVW91MzsnmUkVNUVI9q9zwsm7eCutuebGeHu0fV8RINBHR57ttBRoSqVtoe0l3XX3qLsNxDLmtsPiDV35wsXd0//pt6/vZhdxQGClgkVSpL59TQiQkWEZlIptv6SBih6K5OrHKS8renpIopLKJflULUUqVtnQRQSZy3Du/5b/Lx7gol+D6uCq3kPsgwK4Sz5KB6jgp870ADl7MkuGFNF4g42QIYNBNfKgCuDCjVK4MxCJiN4kXhliqWOojvbTcD7eSQWKtRCz30uogNgUtAVAlgyBgF9K546Q6RFbRjpBliZoq3iAkWoQbBAWuHcfM/xD9pRNpG267Ewd/JyQir1wTa2uLXQN/cPceIOyPJ/Q4NWnzaiId61hYIE7SJaT36GokKYcFWbVUeatEeUJe3iSrvNCikQ1hWQ57d2otqqJt/OZHvWvsnpa2oTZX9+7S3dbhtpaeG1p72u48o7WndQnl4T/4I0fIfDQpR4igDh3RqbvE0eefMmkIMKaUaghLRF6mGkcBnn/kb+bDXIFbwHFCvo9IYi9dSMq9ALuFdBygQbNUNGH8BukjA62kXIK3JSyHmSapDlfoy7L01FOya0ik+14pJBjqHz8gxBPCOX9UDFEQ7+2ikhV+RZa+luO1T//QkjdtlO0ffFrj8/dKssLv2BGiqq28dY9kOxpp/5Uqy+qv2olmO9I9bym2Ru4Pbf6+Hb42w5tf/7pFM9eG7e9vDvm48Hv+Qt7gerjN3NmAB5dyVwIuxCTovEFaaawSjw0sREwYhqk0SQlmFYgkkoU+w7QSsRcGUsWJHSelPh7GXsibJG9SkZHRQhKLZ+kIwGGwJJEco6dSIeejkluJFoQgXQne8YBO9E2RRORUhJcPD1EiCbooExJaLAswFyIR9MNOmSebsmIqnUcMqd4jnUcMqlBBNRVL5oUjeJh1VRKIRogIdcKIDFhr+UlVSXciuvcbwiHtvIPXOXv30l0spZPac38snVB5O6keF6I8z4cIDW1Vk2YoLMfjw0f3EaKYtqEQkp/o8NgVymsqQPo4KBsigB1bw0lJNKD40FFziYuYeUPQPvsq4fbuDb7Pct/h9iJdUsbPdtF9XITr4jg3x4gR6SkvRloJACoSA3AxOmolwLwG+xCiAM/r6H5R1MICH7pLSTnKjqmPQNP0uamuplx6Ffvg07yQ0EThTtVNKTugc9cheYhQxk2q+Mxw4mP8i/xOzuFauUFuKbee2wo4kQMWOlx1gYnG4m4WsKPA54FNsKkr8zBz8H4MmCxMN7DZDDJaPi/CHXkG8GLoKKlz4WjEoDxw4Sxl7IXSA97SeDlGtF9qpZ5S+IBGYh3xX1L6SwJUfD+Q4gHyL9d3TXbGu+e3Xt852dW1/Dut3d2t12e7u7Pk3vEzxsfP+Ojp44WJo3vnrCw4E8ceNRDvqpLz4x29EXKSG4263k2R3o44NOXdSEOAVtvoX9Z0Le+6vnVedwLv8I9c3JO9PtvDLt4VrMHx0xf2HrWoQC6uHLVpwimsnJOtdsX9uQIYPcJfyoWBcjiYltLgMAACGWG+DLICcHl4IAaYnWX8MngCwSGJ/A1/eTiaTkf5Ybh6q7euXzu3P9ORWX7BtR9ZnulMk/6+tUfthES6M/MTGM3q48hXI5lMxFuz6OxF8Ks9Hbd65ZzegJ8D3mymvwROvhrm6hjuOG4L0vBweWi4JBVKYjyaq6fEWLVi11NYJldPYRmbFOyGbLtenR+qRO1oYUgI7vy47hDgiFfBzftpkIBbqTSdT+Y25HsD/qu5tUJY6yMrV5I/rFxJE7M3cOiG4U1TQ37qzJUrvY0r8Y9OrFzJcb6OsIO+DJIuB7i8nOOKhV42HzhbgJxiuWRQKRITyxXE3KEc4ijMH6BpZQB4l4+mUgSS4zy+If/7yUShkCD/lsjHjfKRC/Mk5Lz4DTJx1iLdW0W+OHLqUplOfGBRS8uCY+foS7aPzl3XR6hYOXLjyn45t6TbfYDkWeV84nemw8vuwIoOLRkdmzhr4odTxw+fsMCyJz4wIegrP/CRrfPJLXPXztW0nsky6V6xac18BcfDszFtoddzJpflBmBEgH21EQHGib6krnFUIDqQzMCBgWcAI88iFxf59NRD6XI5TefBdepuygt0HjA76j0Zd25QeSupfJ7nP6+CvJI/75xWTpM7sbS3IV0mb0KpDQJPyZ2U9141LpZbgFFfTOnFQsiJyxeZnMz6dyF9A1IZ0MxGuTXAP07jPgI9RY0B9QViYwp0iKo92M24Q2U4JhXilWgcdAspGgEZAXnlwrR0qPI55CbwPpi6CpQk0YI/9mq8kMdBA2PBhkm+jGOmsTgBkiTnO3o2C+jxZCnFj03wJHSq7kymSl+8crxzzOnhvdf5zeNjulNKEbOlSCe811PFMUqIRehY0bsOSuZbxqogWB53tDfGyQFNmVonCiEN9Bf6ZcXZrzljDimyWjyxePgYKV0BTV+pO3+cx/Ovjzu69wY2Qk8pJUNjiwjwsxUrkiWvOFZMEQs+ORby3uDJeujj2NT9Cv2yaNlaSBCn1iktDoJTYDBdSx/lOrn53CJuLdA4YDJyHWSugVSVbGS1TC1rxghpJoZEI/EcAL0K+cCY67RQzA0F4pm3tuuOo2/Hrk49AyKVPxWfT02VSinamiyVvoDDBV3jKM0pev+Jw2717oY0jAfyvW+TGCXe64R+w2lxfFAimOHBL1FMYf2rEOLYLoKH9L+O33n9TvwMFIAPjq3A73M1Ok7Q3wIV93OLuSN9rC/bOH6k1RjqViWmtGQIGyWo+c2qBYgrGCxiBdAAoBhSPkFFBpUT+hggd4mU052Hf/islCjHE6K9fOVcshQwvuQtQNpAhOfpY7qTKQhdowNOPOnERE2SNFHRtDYYySmpcvfollRlONwSlrVCzhkrd5dT3g0wtLuAaG5gjZwCcHjO0VV5YLRHzM2fZ9q687+IGNbDIiG6rdfo+yz6GaDvVq54KPqeHpdQrArFOB+deqp9YKCdFtorA1PfQKjSAoPtb72HkmAJdSavrhTICVjG+0KhQn4Gr76gOTCHJ+jO83vnf/Xr8/1v05foafDtHDcXpEi5NAhcA3TWWAT4Rl4aBw22hCxEYvJhoFpEhU+sy3h6W0WS0pIrDeItUpR4YWHIkl6UCNGUhbJMum5XpTZRlB9RDYO8Nggl05JUkSJwmydZoYUCLz0tKQsVjUhDUk40DFVTDeyWxvr2F3oj9M3i0lwH8PMhbhnw9HXcCWD9nXkwpAp8jUSAKKRDpAvN1BF7j7XoE95rZjRqEtuMRMxFuyVZlnZLkizOlroqKGuZURLFwvAHbxVxttRFUPAWLO6dCMUPl3UZfhuabidDkZuDIhFyGGZqyoaGmy4HPIPQCwBeKYBXH5vPQN+u5mKAPL1EKoAoB50bhHolSnLRylAvqenn1cpQgafPeTvDDlgQOzWH2Bs2jmzaNLLRu5SclCW25t0EFkY4mzXpPCsMDxYQukZOClsvrVtXhR8Jp1LAJTXv38I2SZFjAzqu0ith7g7jTuW2Q49AuoKxANojHWLkPABYlaUZki9IeUQ0MCOGFxIhywOOREuSGAf9E8x4sNWBywHFA/MfJ3FUhLsJM/4zYIOIqHVGfSdAZYj2OwlR4JWXjVTc6mrfXnCu0zMJsy/zuumGClTXVJ3PkSXhmCPzpG9u/+bUgB2JxBy3b96A7Ubjtjv3dFkLKwvCdniBrGnygrClLSB/7/S0xCtx1c26RIGvh50WQyaOfYHiavLFYCi4KdD9eVPVM9CE31a90X8Im9qIpIXlEWyLtU58XY6+QW9itN8GM7aSWwUwKqFBjlo/KODDYBIAACQejcleghp5XKr4CF9j/PHZAcGsBYl822jhj+MN/TUjEcL7C6+lM/Jx0kDqzVRGPlYZSF/yx3RnZ+atTGfnnaqpbpRVVT4GEsdIqiptoDtChundDXUX8kDCR0HipIVyf8q7G1oZhwQ5Op2Whjoz3q3QQIZsyXS+tRFrbsQmZAUTRpgE9s5e6rGxcp0zZNZMWqZrvY54Ph8nT8CVtHojiVwuQb4PV8j7CT54A/H8T+HhASwG5kS+xku307fApiqBbsyBdl5kLK04PBAX4sjUBLAOmZFbHMZ3eZYTFAPrhFnuYrxWpM/XK8AyZlUpl4p4zwqRiECykeEIyWLSezbifYtkQ7wIFmGW571nWdJ7liddteJnibalElk6A9SK1hDFkq2UniErRLUc8Wy/mejPnYf4yIII/5BTTxD1ByFKQz8ICT8A65T/YchrD96tFMA0t83Q4aHQD3lK4RUkTceQqLgyqDxtL2yhv+JiYLuMciu4jaCdccRXBUYCHxn6e1AlEOpKxlhgumEucsKgNFMc+Dxc4QHyCsWD3s0wAo/UnFL6XtmQ4Xcv5R1SuRfFECRl0zLk0huPobL5WKpcfl0QHhMEsg3TKcx9g4lgJkjHoUa6JBuWKfMUGtgFugUkgmbTpd1+E1iNZLCZx4RJvxHMJ+mgHbjU9atRgEkraFgVbgKpzsfAYPx1T2Hg90I5XBfCRdRFmYfM9cfuj7zQ+EDv9T6fKneiRD63lN6fKp+DyY6ydzEM5mQKqvcBSvdTeh9kJx3nBv+WA937KzCyldjvlZDw1oKa8oa3lsHgK2MrmdYecbT9CMKmC9dgK/yKK8ColvhjqveprkIg2/DHx/SLd9E3+LR3Y6rMwA1mNHz/TziSP0EPvYe857GjJA2Q937E+pjGKwzDL8SyoBLUBtXoRpybcoqkmXXxPEzLNhjN87V6jbjqgryfx3D1VF/znR6FL5CrLKthKAh0911wcXZc9RG5VKDtgEc+WgFML9ODBOKdc8IsOOndOI25YFI9BlbSVwHTA+SGhnbVEizXe64RRafxcSaaAuo2wyICkDgcuNk27uwa3c4YNx9MYd0cqM9gDWwGKftjb9DuypUq8LeSWXtVb65cx296L0LhDJzLM9Nld653NPaUPZ/Bpu0uGF/SgRa26Y7y5ciwO+C6X5HXzb+D5/tD/B2t+5H4dwH6fPd6nu6iPPmSo+8O8GG37ngXAPa8kS5DGwBPE5vchY3vBoJ2tJM15SsutDgc+bIydkeIH+D5L74KXw764FMDV7cXEFZt3FLuKO7kaZypg6Q+0QGBkkZOV6rxv2ZAHGRIzSAN8m+PTcMDWQ6Oi6yYhs9jwVCx2J1ALKUSEAtcvYeaiOUxRl/ItfyqgCAnM0RkOFLLY+UeC1pIY2sz6ceXsZP0h9wc7mgm/Ur+f8PVARwTLnaAeMtHopBYSMbRUe/77miBFNDTyP6rMJhAvS5SALWLOSVBJxuGnHyBviBJ1354x2ErbWFuWZZ2Jtr5UFI1o2nau5RSW5sbHx5pyRmpdtcbEgyHWksXn3bmJaIZocsnCCWuVYmtHOJ1M54mpFUgZB5xVh2+4yPXlifEXGK0GpurGTxZ2ktpJmqGkyG+veXSSHvKomtp3LzkzNOXLLOi5qWUCK35qGIOrRISAzpYmxPLp/FglL7MdIwesJ19rg6SrFrJ0ii669hSEJvBQdB9y3nfQowy92XdQUno256RKs87cd5++Ff2Lu1Y0gFAfpPykDhz6JiOyOHbt470re7Lz0vqcxcvLGYrwNjmb5kH49kyH2apvLQDp6VjafkfFmzdfkSk45ghKE0ypfElc/XkvHxrJVvn1xsAb6NcHjR2mLE+INVeOo4rCFIc3a6kZFDmVYReoW+nNE6RfkW+qCm3zP/UVSe1lrd/8tqze+O9N0u8ZHqfGT15hIyc/OFTRhacTObrysUKsVuUjyrOqHIzFDr72k9uL7eedNWn5t8iOo5Kj6+V/cjJI1N7oFyLTaBOssEPsYU+A/DMAE6NgX7KVZljmDBVSSKi4D8CVUXgiTS/nF221Onnv1QTFF16vAhGQygkTt2hEFmxYBjkGKXFkb07Ve/h4BmLCILofUmhq2d3ZnWEbUek5wi+p2bq71VJdRyRnKTYLap3s0qy8CiRrRK+twXvJtV7NmiEecfoTp5OPQQ8HFurj70Fxt7CdISl3JqZXgimHVVmZw2oI/QSxDZ3ph+ijmYNboje1Ses6e1Ml8qNzgfvgQPZymgle06TE0IKi7yq67Jec0L0rentXdPn+x7K5O5G38NYd3YwCz/vopk+CEk3FF7QJEWv000LfR7G2sENwFjrtvVsIz3kQAE7B1G8VIehAkgYNr5y8/CEmaNboiuTitOiDFzAcG+XjCrCyalyvz+ufhgXaFLkzpD3eTYsUJ7G+4F+spVW76PKCiVpywMXytDALnV6XSVGP8tpMBqgqNJgHTtz+TLroe8mVEBkkVcB1RUPEs/oeHOSmOWcEdyTmDddCKliWsdqAYodaYZUzVcZQKrQhO7djHzLje6GmmM25PtcQ4jRP22vo/QuXRmj5PhdqFKgXET1cFuq/PdY5RcAF9C+mK/pRsGXAMoYId5zIDkc349IWF/X0ZM52+ctpUF0DKNbmBHrP+vKk7KTUL9PzlcTQG/nK59XnmSzADmMb0BWHT/G6P3AVfsBPyY4bg7ab64/DhSvUT4SFwLxGpVAFUOsr4+U4T2pcQqwZgE3PI8mCrSQeMeCv3dCNES8kB23SEHRrMs10wrvclPETnu/lw2RF0lKjplE8p6XltJCC/EShXRK8HC5TngnjD6HlgK52QpfYcfNVORTmnmL91vFtAXSIlkx2XtJDubtVPoCF2djQOnYi94tNPEGh6vF4SxFI5tvJVngX2B4l0uSkBfjDJ8RYEW6TpacpLCR8C/GUukYrbidWUn5kdh+/kZCBJ6QfYTQ0NR3eSpQ+sLxwMIU75pWGmpxXuTJRrF9TkF8WJGyne7UI7E06XwOqlCB0Plg39FHZEI2Hs9gvibgPafSA9y53FPcL7lXuLfqGg3T2EQ2l75IZrpgoLVATvBiwPf/T2szop9RU/7gBnKeaTlQ38+IBA3DjWmMTDVgShOawKz6oL+4UK3U1KZeOuxnoyUNoouUhwaZtmXQkp+Jq5koyMCIDLRx38aO4KomKiFFqWmdsIxODHRd0PYV6Q6eD/FGZJ476Lomj6EAoThifxQ0B8qbkchgpBoxoQzfkYbSMAsh3nTnRSoRyKUwGxEsHQsRwkMzkX5oiZUm5c+6CfEwgSRKHaYZClUoNUzJzEfjaGVHonlLNkxKB4lALLOzlCDCYSKJlztNA+Z2kFLTkK18JIaFY7XCFSJAfhdZ95vSRKk0sXKiFO2opNt6eyd6ewvldBw6AV+JRCrQPxM5WaiEfQbMh4EEI6QwQOQC6UiIzhggiAkGDz6E8BiqlRZT5X+Uc9G4KIoR1hGerwBWmWZHOQ6DnoSK8XKHBf0mQ4SwfgMxiqFoHsZrUDrACuMQeX6FX9g0IQ8gYprSujwbCAwoXemI/gKHMtFb4yvkZi7MfIz11VC+MvU55orG5QOyFU1a5Jk+T+6jj3IpbojxZMASpof7az1DdSMlV2U0yaRIsIpaReYN+EIiyRLF5QWB/Az+Yaor5c15RXPIhcipV8GnNiHNfVKZ2568BrvxceCLH8fENakC+Wdiaxfi+1VkG3OU79mIYucavdF+KHDLuQ2z2pzDB5tdZIbdVDfNAqsSACK8q3H9WGBbN6v6Xqym8NdeMtOAVA5tRMxqdZCTA+uy4S1aKX/VjOAkBo9h+iyncxaX5XJcEXSgOT5U0AMJlGqjnWgTtiCHK28urqmGSSVaGAr+kR89ZTnCU3wkZjrf2kNOf0p3iBFzQ08JziN79rQ++OCnP33iiW1Jk14WDofs8NQlujNO7vLigD6Xhe2Qpk5dYiYxZ+/4fWP3jdd9WefSvYB3KZBF6OWo+hK4hoHlwrQpHPSxIEF/4gfbuAV+7dQJDFu/ANetD2LyQRC1X7788psffBBTGuZ95fLLF/kidaejke9gtjeuOWPkiu88/fQ7jvYs5sBl7HYWJ/AnfpBXAcsvAhUSvdyMZQPP5OOgSGG42RDzYCNvHWbG1zBIFwpdBUurWEc24KmIH7i8FROZztlLxAaXb/CEb4b9tOFLMjDi6B1vZYY6YqFxTVZa2ue4RkurLYim7vbPSdlOW5ckOYWUoVorvI9affm3kp0KMBpXA4pySdi1HI3XHM01WYyVYoY11xUcKZEQZTnWMQSKqLDJKpfbIkT5sdUaUzE6y8lplhzpapEFGprblgDOFU7kHO/qqNPZ/3Qk2Z6fm0mEBJFcoOrUUO7WHFsnMUXnDdX7DUKdnKsYVFc9ZvuTrBQmquS9rFqiKLeokp7SautB/F30DkjFuQRXAik+xq0AO/dE7iyA9tVomZR7mQsXGAkGzqAcB4EUR0GPgobppGi+YFKUmCYO9u44KGUld/bsQlWcNT9YZWdi0SDVpi/8IBxu7dWT1WXDkdi8vBE2FKO1zRFaRtaosirIV0ot0ZB0pXJHz7gwb8NSvb8rrJotsqpZxahsat/uXhgKssNmQgmzbCus/7h7oQj5Rn+XivmqbhUjkhX2njHU48WQqDuWcLxM3fNkKSyJJ4gtMUnarG7lxd6JkSLtWryo4x9lJZc11HQ+5mREqSX8zXDISKrfNL42smGxMnT0pEKvd9IZOSy3tYcl70P13H90MmlFldqKqvxxArnqQWUfDX9AdKwwL0sfUFtMEEmJ8O1hSW8J327UeP+x9Ocwa12B1lXmwYqNCxVUC0yKoM0CvgNVLCSVcVIuAt5HyW9EwU7Jf1bkTKdLyzQSkXPx75aFuNsGH+qhuvIE6Gvi1C9AcewCFDRpp9uZkeQ/q11zcnz5exnbWBwiQujnik57iB56G5QBUrcPaj7Sv8lD+h49ou/VC1qzNc+lXwW+Fod+MbuiUa5KjTK2kdsdIr+Js+nvM00/5Mvtq3yu573m36/yc+ExkOo1OXEu/VrQ77nMQ3B8M0cuNtg7uYa0kJ8OmxILjQ9uE3GxQLSFpLY00zQ0T/g6pvFCnqknvdt9b7ru384zlZ0CL+qWJeyUecf7g2zKVLhUADtYoMJOdY0/oPv8m/+7ztEoZXDxkL1Pp8lW7RbRNlVelG4BZFcsR7pFAoPctMVbw40w+WoDTA7nNjbPp3AImJBDwqSAIaYBgykwNxBG3cYwwOx9A0QPO7y8k0Xy7FRMU7lUopEkZPBhuTb3TcDwPgOtU4TDlMe+VE8TI6ncygKIbtW0W5Wkxau3qi2yyL1PnI6/h/ymcd7j3cRiGU6C62feQ/4MnL56ticuiGWaxuc+bpQ7DOZu+wyMPgQFNqbd94Hdh0Luj3v7mEAcYjrH7On/akZ1Q90pUFGzTR/V32IzLViWLvLCTqUZ05tvU++8B5SHKTbMFrWG8bdo73Oe30u6mXd5C9lQH5zJr7ybWf7Wv867DjHPfzNuCodIN/X51YY+/1fjfN7b0Gky+L57XeMtJ9H7mF6e49q5Dq4niPNgUiwuoEgt5op8vhyEeqEjVhCr0TmomleDf/wi1LZrqvfUHlCyj25VZb1B9RaSkHnZ+PiFY2MXjI+T6x29rs2P75l6UVSsuj5Pn6qp8w10f1ugo/ehlG2C7UEa+hALwSnb46RRa2/Wzr+JSbzctXPnzQ/qNiG27mvnl9XszJ0OxldDsXfgOvY972KoKzL8+DM8k4en6furB9M3OcTMHgpLK+/KqRlBS03E/j8lbz0gZ9sAjY+x7p0iCDbbF2wzeHfz7a9ycEmiYQsFGNFuxUAFXpKAjZv1udzbOJfvZm3x79PSenc7y1vYZGXVcKxAXwdbIM3iZgaZV6GByc4IdcROkNxB4Y85ygWM8x2GOQx/Xv3e98kpiDMB/nhh8rA3bMLTbQG3cckeHxnxMr7To46+NxjT+GV1f+m59HsMz8pcdzPUmjS12SB4KO3NY1/By1euuGLUn1h6eCCkq9D9FYw1fgPRXWugxb2HokUyy9eFd5s/79TGOSPPNU4nvcyfwqlvwxw+6DNwNofPOPoz+AiX8dum15YmDjmHMQammfM10+XCOpfT8ZPE2YXfCr7rrQW8uZh8ofZR5ye33dY8hbv8TuM4xi9H6Vcbx9jl0+sI/fRRLgqclvmswszBiatbAxhpjHZL40xaqhn6/e+FREIRiBUyHTNELEHRxNO8exhurYfrXFWm7VNPaUo4rtFtGGk1daOWEOi+OpPnOe6db/Kn04fguwV/TfAQX2ZO00DbeC/9OMu72w+XwShe0I7OYmL+M3DtqPVKTTT2iv+xgvE2iFwP1/vn4/YyNm8tgVeokfJyjQ/FWaaQL/okN/Ul/04e8Fj4KkNe70dE8/7QNFGN6TcDQoPL2BWHwKFqYwdmo/nmKBGDIA79SkMUcuhQTXZrNRT6Tg2DiP0ft99+EBfwkQZQ6DKPa+IC/nrDifR5LglyuodxgLKIvs3qtBfe9OOLCIs2K0tivBpnMRkSPeC9oCupyI8iEXJuZDjyI9d9ldDNT0P7U2/tIzw5/dHTKb3u0Sd5/kchPqMQ92GMRzs3EtnnVt3fUboZKcL+ESGn/fR0nv/cf/ycD+3j6+ua9Gl6PcAsAT3r58br0WA1GDWzp5px0hTsxDdBeaEPPnK+dwmjwMvgenadWR3F6NN5xJ9vqjr6Giy1RnfWBCam6d/JrdOvvC3QzptMChgY3eTj3dX0NUaPvbj37t1psqnL1Yax0H9RLP4PQCRxVSQmEInFH0yst/uj2sTEMV6cRjo5idHJTQ3US2S/GF5Ora3C+XiQoA9wNpdFDwi6FmoLMRjTKTXbCo2kTD6kO8ouJanswlW6Cy5QLvVB+IpnsE6+iYrklWzpU93F1u2gjLcX3vyEAW5Ad+j8oCMk8Hss5lzmhQk2TCi1tVGQhFBVDLHVc9JFutia515lr0KWiCZbn/d+Ruagy9z7plLjj2vpMzCukt9ifaVVwfXVXMnP8WMBFLYGRF0Na0OTbHGMtUcsyHsA81gYgMA+g6EMOYVMwNjhguuw+739CoI4yBMFATuK2ZJjhwM405/Se5nMLTZL3Cb+WPCjaP2YWrrGe4ehLEFE9d5hcCWQ85KgG/REGgUleSu1A8uJ5gNj6QAf1WheM0NRfepA2KjFctBTpue52LAcnqXMbG+Y5kargqzSYZYBsBcGS+CK5s/zyx7bLkHegOtXIRtgBhOMa4RQXCM/YfJ1QHPODObYx7U2+gTAoMwta5b1uXqoi4ghMb0E40oY++F7KVuBiUayUKLXX7atZCnGxJCawojM+c15x3fHVp996jh8rHPZikEzM4bMXB84qh9zlq4YquX0r+3rW1tTzMe3n7062rV5HsK5OJ42B1cs7USh8h+k/+gBPzNjDB7GMunA+q3rB+pr12U6nzMBli56cgs55oF1YwM0OyXzSkTzRC2i8PKU1v4YySvxqKZF44p3QK/Vpw/SX/lr3zOxk956MCbOhnCBjDkf+KVdtxiCuV1I/DiHuG8PDOIu38E6b6822pCHlJDkE7pyngI/nPjNm1XnBd1RN29GbDhPVc9TTvU6GAo8AdfNum2j4JxE7LDtV6FWUjkPQx+gAkLav/vZynk+Urwd8Am9gWewdA1ngac+GlhDNY5KgyCe2VgqOZiLUsOxVSIQ4xB8lKh1DhroP4rGy6YrzaIBkQ8EuAxwf+fP/LG8AvwqAxp0FfFZyLNFDhZFgEEcEvAUXqotJZd9v9iAv94cl9hiNut2nK0GYBAVrkmTn0VL5isRw4iQsNPvkB7b9t4yy9EpWX5ZjkreObb2cpjE2rSXlZASOfGAO+weAA5GQ6rU3S0TO5PL2EpXyBQs8+XIMIhdFRrYDy1BKxY9xYM2XpEk72PaK+G2uPqKnIjpDxxwoQ3bPupwI5+27XTeOFyswX+U4VZmmmc04lUjF2vymBIQQ41sH9cGGTExtjB1vy9zf9YkPpIsbHomUjDZ2gTr+e8P0u77gu65ViN097wbQE16MgOoLNcBqsRjuvfHJkjO4BfE37Ec7GEenoVf0G7vQI1hkLxe0yVfD/T9AW6MO/a9aBi4xod6eGCQ4MqTWFsvjgdLdd24oYM1Mk7ilQF/8ZSuZrQjxqIq36SBnNVIOScMda3o6prs/prudE1uKVer5aFyNas52YFsLL9AD8UTWihy7HC8d3WvG9CWKirR8CyU9VBxYuVE0dHPKk0Un5gz0dvbtupJ+ExXS1eCFls1TYlplRHSubzL26/XfWQJ+hbnMC1xDPkeHgAwPFN5qYUV1Rbqy9NoClR4CLuXfApj/6RGDnaq3sDMgIH5Tg/i/G4m56ppPk+SsO2KDdxT8W5QPlRLIwdVCNDDE6xeh26fiVwTRMw9yEWTdk2HWQ06jOvrMCAjlOmdpCxiDDFIYcgeZJHfYdzYHO9nwZ5QkCAoSbzHFRwQvmASOsjOYSQZaFO1+MW9MGC4hG1HYkoWhjkGeYGOSz16FadyEdAisE85OzfMtmiUi7kYiwKVchXIZOK5WMHdjOUC0Mgd5PiOFZ2dKzq8Z0hroisBP++ZJ72XSKK8qFRa5HlPFvr6Ck9eQMqkvGzt8hIB/Ozs64wRyOhcfOSSjlEysGyAzsaTfMnGyP2vSzbark9rKMibLkMVNFBHT/C16Z8BQC64AMPNGGdSZudINfn9b/SfGD0LuJbrr3tLghghRzeJe3KST97kzzXy5ur67kSg7yossLbOz0R+QmcyPog9rUv+vf7coh5s1uYW9fjm/hRxpZ3t98fIsUF6VxM3ITfNZDcH6SMM02qxiIhVWwKsQrydgTuBJu4jyXSsSgSs7wVAl0Gc9yA7rwYDuCPs3AE830aM4DMeYjOM8dwlPBcHoDg9lW60Srkt61b3zZ3bt3rdt2qJLauXLCrD36IlN9USn5YMRbZs6THDeEyOfizXVJ4l6M6mCizhDciGQtKKIQu71DZ1l0DonUc3jMHh8sBbVh0k+ZB9zx47Mx06E2BhQBSBWuLTCrkRg0rhh7ygv18KSRb58Oxhwz95h2NSk4uWovDrQhzsKi0plZY8hfWVFciS5g6IrqPef8h4Ye9CtF4j7V3tERaY1L5o5aL2Gn/ZSr8DMzUezBNIAbaDkYXas03MPCjivB8TAlKCLQ9RDPKu+st9MJqn1q9Y3tUjldqXLP3iEYfNHVCp1RIl8sS2D5+1puAs3n7+mWWlxaXKnIt+LopfA+VKMmz5ulG0boVJ3lrWWV62/IuHT/b2Gvn8osXrtShv6Qu2jqldR3/wvBPnS3N6VKBYtVIlE3QSFH1LpaHRz4KVGw/fq2BQLZ4R8jj/Ub4T7Ios18ENcYu41TPPwSjVJjDOUAsYVuDUiMSnTSHkGHW9LIs6WmRac+A3Tq3BXa70q3D1LnEL+uPp9B+sORaxLOv3RqEgudKv//RrSSIXmurj4Vgm/LgaXf+w3e88LIgyeVwWOsqSmcwmLbnMGx3RbBR+nzCMx1OroRnLe93qhWaM1ZL0IrTiileE94ezUXa5c59t7xMNYqxaomeTJjSiLxFn0Nowt/j90VoDZ2xkme+R4Fb7NuBl3rOMhWbh+l6Jrj8or2Pd3dPrR7XY5V8D3eHOehhNLx0c53FrhD+OWmg6DkCCAZSDuMw4boHmll960vDQtks/edlJw6zTG/csyV98zxe24pdXaY4AaGcogq13Dp102Scv3TZEhrftXL7F7+bW2+6+OL9kz8Yjly4qdfzc1n+sAD8x5Ec0tzGmGuE89H6g7L5/wE78DRDdO8P/6cdCV7hB3GX3brHQ/kbCQIoHzsc4GfaVal8mHToa2vu1Zl3u+20/5SatDHHCluy9IBhWmBdEkpQPHQ/9khW+AliKaUgk5ewKWzeTDmLHZe8lUeDDlhkiLTJX91P+ipsDfHgti/Ersw2h9ZUBDGgfZlwLY3ejMYnpsD6Ns93aw0EUcnW47B8dhkerQcKGonaBXvTZhSO8pbLoLrik9Ggo4sqjJTE70Er55em+FL/A3PzoZ0uj6nwqSJq9XXeISEkmKtjJUCSqDuVSCx5auzYXVTSYt7uQXwumNnJkcS7JDGSLS1J9aU17af5h433Fl9SIrEX0RYsjmah11EhryfuPBCFn/417I8vvvjfy+VokEIvD/BqO8Wu4TRDjfPxw/ZJ3aS0CiAVq+mVq4ZZ+UNDz6fL+copsYzFBN6ZL5E4M669Va6Tdev9razc117YffVrbzR/Ek7zbBrbrvlYLV2KD8KNAsYPk7zDGqZRmXWocABmvxS5NjwOroRv3ORxwuhQEOd3VNAS//9fSm9i6AWgtVZF5ZLK0vjEDpCLbmBEtsLP38L8S0Hy8PA4yMz4cj/lcClBLwu2G5DUlblHZcxXyLOhyNgpq8jvFJnPu5Y2WtrirEhLNhMOkQgw9lSsk46KsWQ5YTC5xoeirMrXjtQ0eqChAEqT4l/vS8UI6EjdsM6oajmC3ai6hsVirbTuWY8YMuYlmjuTW+XGxTLaXC9Hpbflsyx27guCLsl3WMcmgZSSmcomdfTDONvVDBcmusP15WaCxIhLNMrE0KruRUFRPMaqBi2rxIws/O7LZXMADzSwHwGYrmUiGUJE4xqm2BixyvjJa+uz4glRuKByJ8klb8D4HdDO3eOQCzSQCY3t36Y6mRA+b/5KmpfvSoG/1Z8bS0UWL9YgmRdVfF/sS3k9KraPr7Oj+Rrp5Gvhdx8ydQcPByTzDjbteajoaO16mm22tY2eFFaI+kuKumNrGl3OAqR6Af+egUvZPTCWb+hZdzNNzcHO4wl5RPufvEu1Ewu/0r0AmJuDYVd79uPdl2RiU6gRVExTNTrbpuhN3htb2ed8HNkCZnW12lE839Y2fwdJAbpYdxk2WDd8chFaZXtZnbu23z8RvnulTs3fCmQE5YW7gst+gWFJI3BOc9LNHuVJX9qABaVuQierpbfWdx9q9uEu4YR/xJKinGebQf05zvNfw8Lk9gfG5R4FmfLf5HsmxVa5OZ+PvSmfF/3d0JumWndD/Kp11zkpm8WirY7mmY8V0uRavcSLTC7q5hdx67kTubO5i7pMc587Y3st2rOTqEfgNPhl2AOj07AbnuRQPwgLD92rV1NRisEzj7z1gD7XZLzQEdUTEvbpTTu/G+d9NeWLT83DL9C4fF3cDijpecRfb4SywQuRLu4KybOO0oin70N28T3GnrgJg70OPwD6F/L0GacFmM/uw8pyu7BMFIQzYAqXJa8AMgk3TuzXkDP5ZCgr2w/YGymn/EwJzn2Cp2qbqMGsfLy7YKco+2UnAA7kF05K/9LNPgU8xm1jCsoENk2B7VNuZxkgaJIpB2PmXVbZdIxA+1WEiydgZ3NKmGJb0299Kb8jSPjxJjPL7pBwAhh7P7KjboVzo4x8P/Th0Hi2hqJj6xQ6+Nu9b6TPsbMSmeS/Ouv992gnXQNSzoMj0EQGNlO42znvuvc472aXXILsrXXLm7pJNGX67/B3/v0Ss8DfuQcYdtenCnFYdAd+C8z51XsOU/zOmAz/RPuX/+FPuT4kzyiaZ6QrwRfIJGTRtufb1VBnsT7wxFsLes2K1Ot4JtW+wRYLg4+RfMF3/RMOnG/RcPGewDSyfw7kjfG9owAbjpWluiJaeWDf4xtHkY2Bj50ZFgNWghthLsUQcl8KkOFnWOj+G1tmm1qM6tUjrpuzaNaMNj7H529Kr0xtjqt6rJF11TmokuimVIkOp0dimJBk+kr3KIFeStncmYtk1a6FqROs8ClqKRkfxMRtlj7EEVNwUG031qm5S6dXU6EZomai6GtuYPnKYJI+FdxmJWnGlrYZ3qGOZIDHa2RkUo3Wt+KDAE/9YlLrvVyxgZnGW6ILp81P881RYQX7ibZwivPz6gQfu/jNMm6OxrF/cfz/dWntJnBf9t/CE6AQvc34tvIzf/7afr/8JH3azO8sZu/9P7AEbxSccmsLGt41+l+sBDXI1dxx3Cfcp7nPcbdzd/uxiVDGoION8LzXw4Nde6osH/+QAFAoFwgx9XEj0FzYNjEiOi8HaYqxxe7OELUIRf7Mg2ySMm1mGSsymlKBwBeFSe8St0eygyuEynksXRwpnQWbTGwKXXjxHJm5SLp+1Y/tip7D67PNPnpCIatq6RML9cw9b+cWlS9pLUk/X8sPWe88rFj8ZoqplGfzIZ2VbF2lYvlf8mZMxpES+zSW5uGxIaAkppupkQKA6gi6rpqgZmkQUXSFmsjUF4iO33k0TLZ6K6SQdkVRCcUlLWgtmVsw0w3woJIRCy+ZVlKRN1Z4eccGJH/rg0V3q6EkLZF2iqqmsWzKRLxi9vZOH/9PypR2dZEJV7pWgy7wqXzfCkzB0n5+kq4jblm+R9IydyK0Hdh4OiQb05sqoLZshW7HUiqTJsgZyRTLTlpU2BxL5dGSZntDht8zNXKlKS8Pwt0xS02bchF8OOyaEar7QAfoirqEVxYCGmfLCCNdf6plmdPWtmcGWIiyTZRs9B3zXDtl3xEcXZIdeyG3alOfz8Xj+tcjgYIS6hu7+t2jbekiU/6zrRMtpr0ctK8pbnT2d1vPtLS0rtpxY+BTbpFc4LkfWf/Izgy/kE7Ecnz/22NzrrqG5vAsN/bckwmTYwp+1vEbD4TdiC0Zi1LKIbb3QvuXEyZaW9mvRTfqpQrGm411BJ7ki26Xvn17L/AdsjSobuNrYId+Bl030/yvWlTrE4VyzTlcQGjf1GKTYFHRPuW0bJiqpCMGzA1WzpbV77tiio48Y7kmoYiIuiyE30z6wYNJbhYsC4hYl4VDpRIX+u6GcCBxXBzm+ReQlU5l6UxI1RRwREjElNBIyyRG2skoUowlplSSEZZBnHYvyBaolwnIsWmztSrRW2he0RsNyOKGpme72/nRBAH1QPF0mVkI9XVVPE0Fn4EXpdNQG/w4P/700rITj4ctkVTUuUFt0Qb0gnJCEgBfUfJOTALcd3KXcLuAGt/7tnkphmmabuUDAV/DEYDyv3Q9B8HeA+kygJrTL/iZhf7tlfDpkAfJjwAL+p65Q7+qWQmGgUGhRgPJhGlRbc1tFKmoaDTmuYSdsoHsoQNqPj2az3dlsTNY0S9PWKYbIa7ap2mEhJCmh/5lL9XDswkBhk2oB5UuGotm7446ohURRUXhLHdRsW4OkCH1tGUy2Z6MroDPRyVh2tyZPKpqmTMpaVgFTAiqDSVtQpJCM8trX1dbR/2SxXc1xeaTJURaE3pUatuv2Bncd80ilOVZ+mD4AuhiewbgIT+Oc/RSiWQwrt2n5ukHNKuSnvf0i+bbeYPs4cxtsn/IaNHoCAwgsWGUPUv4e1b0JtKU9zJzYo6BCHBhfKbC5vA1160s/E09V8sdyGJRMOuwCms8e1IL21NZTTqbnc1k2usNr3kforC/8KswFCb3GeG5kG7G6C7LKTtdhfkmh4SSZaYnFnXzMwsGUQyRJT1cmNm2vPxInNbjwGO9jsXRPZcmeJZWeTLSeTBOpdTCu9YwuyKf60nYikU8krq0iIyCGkSou6VxQewDLZlFH9Q+Ftv5MqZTpbyvUU1fnF4z2aPHB1nRfajc2kE/UdDrch22zWMl5dWsepqLmIypXBobwmN7AkTFGJOZOCg63iAqgurjwj77qtSdLylWyTj6cLJW2TvL86Y7+Y905i5JJMHMsmIfX//M/87t2zS0lyb9rytVKKTX1dLI0xtPW0Ok4N1vO8tYTeg9O7z27yKojgv29RwL+toC9XuVG2P7O+u6G5mPZgnBOplr5Xhcsh5FdLOLDjcHbci7eyFyaOA3fO4XbovTHHf1c3Xkcgybuo61PaM6goz1BC1O/MFzaTmyNPK3ZpJ26U6+Rp1Pehot90rkjoKD5jvZl3fHNP0f/suaMnwMpPNrqsKhB1DAoCN4fjejYI39ytDNxpE2XOs0mma2TQ8rqQ97qH6sQxFc07Qqjb+vKc88Fq5ZvK0nlbSkk2d7bQQTml5TnnxP9I27eVpS3cdnK+4ij0Z2Msnf658TVztf1zxZbwTxY7Bsz3J9SbnpbxqHOFZsl3L92eNjb9cPDzgDzp5+ddUNKjceH3elbwaWP79fQspk+J+wawKC72cty2jtKd04/5Dlh5M2DTwTjA5q+P9DgazHBI2zd86Dt+kDpwdhEPJayhkIYHljMubnvYd92p90NhH4jOCDuG+wJbXgamnrFdqXdIVMhb1qOcBbIGIv8dIO3ahnw00iqDAWnd9+7YADTqVd0J22SCVlNmt6DaniM8HX/7qnM9kjhnp6ZJ2IWAfCxql2SciWJYQSa26WG02/pDu/Dub6+HLkm39vrLVYUck1YllXvfFWm5wC3VLxlzAFxf67P0XLMPMcDADaky0sEIpF/lgiRPdxE84bgw93U6/GrcXYmXxHgGZyBxJCiglwxPtOvzBAiXikHpxvBjP+FUlncL9CSN1Kb9vtgts4+O+evqFLxcUH2Ppgq04/hoiorc5qj33f92dNrqJ+D77fWoxHqZviMcAR6GAz0uUYKUH6DWB9QwGnA+JuJR3kriDc76Dv+cmagEs8MxSL/qinYeuChee45xSGXTDEio/i50xTWehBOC6+TTu1DTTSP536xbwUDqtZU8HITzXN6Q1v17js+zbc1dKM+8BB05GNsk89O3Z6m+VH6LJfhetnJisFe7BLbjQ1qssu0vSz7/5ZIYhlkHPs/UuC52TjNqA/TKroIUf75AbTsNN8qk39YHB2J5RJ9JOKkusI8/xeeKiYYX49a6UhXJN0Ztvh8JrpOTzt2TNP1nN1uSCJPvBsT0XSON8KdqWh3JG09CsqaInhT8OzyitKqa1rUttugRkTOSeGulKzQLtkyRDwlYCilK1SGooUV843w9hSYSOqCbM6QrP6UzodOCxvzJwvwaZkqRor8OIyh21Pfh+5J+3mjLTuiyrKOt9D0Gsv//77TZ/tS8ULGTeiOGWG+07awS/h4tM22HdM1Y4bUuF6U5wbYyvVsh0Q28nJfW/try0V00l/Vqm1rF2q72v8dl8GCdaEZx5LgCpi/toSnVNV2yv/1c0BxD8xf+H/lQ0CLORaDBPQhlfBEuSytsoiPcu3EIHYKxhBaCqhMivw93tVixrYyordTpE5C5hU1Zqteq5FIJ4xsT3YwniM5YJL5Y+nVpk2pbU6dJqUyJk+tDBgtDxgJA37eH6KtrdGHoGBbXz6wlbaA/ZwGrQRPgjueO537MHc5t8f3iDaYxs12sq/lovNLbHIlFhs1kcaDxht3hktNuxfqcXYNzmmmPZeb3ZLzupa1WdkdaGTvMMLhTLlsnscC6iIVsgpQckeEdI/F/azk5IpB103uULzf+LzkBowt1vFCe+rJZ/1Y0s+j3WEnlEnF9r4ODfnRNZPKt3Rl0l/KEFYo7njvqnWZHaik7zA6yhlVha/jgxslo3iPj3bT6A50ee9Iuu7g5CR8/QB8B3nVCt0OwsH2+yr7Y34H8DIHvpSwiTQJHf8T1J7EmNZJYLOTogVGmSBOKsnpmOYl9HtcjGsPzvnC2O9xdD4GYU9owSvoqSyxAJVyqba+4wfq0w1Aqh9XlMonll+ktCg/UZSL1J4BxfsnckRbPMyHz/3CuZpVOWUxLulINzMo3KyMKeTvgOUP9IQvUqBKUrlo+ScGFPIP3r90nlKxNKgDNePeRtV2xZtZhNzNiFb/FyamPVkAAHicY2BkYGAA4gX9T0/G89t8ZeBmYQCBx3aZiQj6fz0LA3MjkMvBwAQSBQA/ZAp0AHicY2BkYGBu+N/AEMPCAAJAkpEBFXQBAEeQAvN4nGNhYGBgGcWjmAAGAFm2AikAAAAAAAAAnAFEAaICaAKsAz4DhAQSBHwEzAV2BfYGbAaqBvgHkAfaCGoI4AkSCZwKJgqSCvILeAwODJINEg1qDboOOA6uDxQPRA+aD74QIBB2EcYR3hIuErYTAhNSFAAU3BUkFW4VyhZUFtgXMhfMGCYYghjUGSIZuhoGGlYamhroGzgbdBvEHAocWBykHQAdXB2gHcgeEB5QHpIe+B8YHzwfqh/4IGogriEQITAhuCIqInIitCL4IxgjQCNgI4Qj5iRaJL4lOiWiJe4mRCasJyAngCfgKEYovCkaKZQp+iq8KvYruCwyLKItni4MLqgvki+8MCwwojDyMWwxpjIWMnAyvDL8MzAzZjOgNDI0mDT2NT42FDZsAAB4nGNgZGBg6GL4xsDDAAJMQMwFhAwM/8F8BgAv8gKjAHichZE9bsJAEIWfwZAElChKpDRpVikoEsn8lEipUKCnoAez5ke211ovSNQ5TY6QE+QI6Whzikh52EMDRbza2W/evpkdyQDusIeH8rvnLtnDJbOSK7jAo3CV+pOwT34WrqGJnnCd+qtwAy94E26yY8YOnn/FrIV3YQ+3+BCu4AafwlXqX8I++Vu4hgf8CNep/wo3MPGuhZtoeeHA6qnTczXbqVVo0sik7niO9WITT+2pPNE2X5lUdYPOURrpVNtjm3y76DkXqciaRA15q+PYqMyatQ5dsHQu67fbkehBaBIMYKExhWOcQ2GGHeMKIQxSREV0Z/mY7gU2iFlp/3VP6LbIqR9yhS4CdM5cI7rSwnk6TY4tX+tRdXQrbsuahDSUWs1JYrLiDzzcramE1AMsi6oMfbS5ohN/UMyQ/AHYk29XeJxtVGd34zYQ1NgkRRVbvkvvvYeJKfvic3rvvfcEJNciIojgAaBsOb0nlz8dAJT95LzwAwnsLnZnB7PsrHXap9/5/+cy1rCOACEidBGjhz4GGGIDmxhhC+dwHlfgSlyFq3ENrsV1uB434EbchJtxC27Fbbgdd+BO3IW7cQ/uxX24Hw/gQSR4CA9jGynG2MEuLuAR7OEi9vEoHsPjeAJP4ik8jWfwLJ7D83gBL+IlvIxX8Cpew+t4A2/iLbyNd/Au3sP7+AAf4iN8jE/wKT7D5/gCX+IrfA2GDDkKEA4wQQmObzCFwAwVJGpcgoKGQYM5DnGEBY7xLb7D9/gBP+In/Ixf8Ct+w+/4A3/iL/yNy/in02NCJDNm8rKrqBYsp1iXsslZNRksDYkN6R6XvGxYFemS1aQ3DR2ZpKkKUoJXtOWtSV7aU6T5MY3asCRnhgk5WXTpqGZVkW7WilcmKbhmmaAi9NuoqYTMpxHNGBfpRiaVTZvUVOVc9HNZL5IDLijdZEXRrhKey2rkt1K4WLffOHH7XeBWkWALUnpom8nJdklqQpGimZzTgCXHfGEb2t2+GHrHJhXcJLWSNSlO+jRgZ/9CWJeyoqDRpCJNTOVlP2P5dKKkZSDw2N3L9pMLqWlo6xslhQeyJqehJUNRt24ywXXZ1WQMryYWSNFYtgt5aNtnReRRpMGB4HXIBJ9UgaWz6Fl+p4kjOdYkKDdSxbXU3HBZRbavUqquayhp6p7/unz9A4sg8UlibzSy3vJX5m2J4pPSjFYMgg5MPONKSZWUG+1ttp5y4BNk0hg5O7/qaU1ngudLIdClxt2xSeajVbdFcW5172EEDmsLOJdCqv+mKLdWjzigESlmryJw+IetCirjVLfe1OOl0k6+OwOfmVsZ8jx03KQjbyksmYY8r5mpPGs9t3AF0g1X3fZXJpoXNGpv6rSM05YIXeA4dMs0cgct/04EVvKaBu58U/usSyC7QWa1GvmWx/FJpW57MvWlva9/ukp9lJ3AhZXKnJSxHyeUvqvZctVz3XuRx0oaZijZHi7BemvEZ7VUJphIWawofmdlvduOsm4ys7Asp+sZK+KcCaoKpgbLyXEaPBu309eNHRfFrA6DGVPTgfuP2AtzeAMXH7nxqHV/CWy8tx0xY1he9vyQJLSg3tK3v71uGxmuFBvHdgwrFxNoNqcwU40u1yzFp7+DqB39sGbaUFzRobeGraQctYEjfz1vzFng45Xe94JDpqrVumlQ2NHsdP4FNNf0ewAA') format('woff'), url('data:font/ttf;base64,AAEAAAALAIAAAwAwR1NVQiCLJXoAAAE4AAAAVE9TLzI8TknQAAABjAAAAGBjbWFwZE0JUwAABBQAAAlaZ2x5Zks+ySYAAA6IAABs2GhlYWQpnBa/AAAA4AAAADZoaGVhB94ECwAAALwAAAAkaG10eCgAAAAAAAHsAAACKGxvY2GU1XmKAAANcAAAARZtYXhwAaABAgAAARgAAAAgbmFtZRCjPLAAAHtgAAACZ3Bvc3RR4DGKAAB9yAAABk0AAQAAA4D/gABcBAAAAAAABAAAAQAAAAAAAAAAAAAAAAAAAIoAAQAAAAEAAKCP5clfDzz1AAsEAAAAAADjPmlhAAAAAOM+aWEAAP9/BAADgQAAAAgAAgAAAAAAAAABAAAAigD2AAwAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKADAAPgACREZMVAAObGF0bgAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAQEAAGQAAUAAAKJAswAAACPAokCzAAAAesAMgEIAAACAAUDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBmRWQAwOY45wADgP+AAAAD3ACBAAAAAQAAAAAAAAAAAAAAAAACBAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAABQAAAAMAAAAsAAAABAAAAroAAQAAAAABtAADAAEAAAAsAAMACgAAAroABAGIAAAAGAAQAAMACOY45jrmQuZF5trm4Obj5ujm6ubv5wD//wAA5jjmOuY+5kXmXebg5uPm6Obq5u/nAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABABgAGAAYACAAIAEaARoBGgEaARoBGgAAABQABgAQABEAEgAPABMADgBhAHIAiACFAIYAhwCJAGYAZwBoAHsAegB8AH0AfgB/AIAAgQCCAIMAhABpAGoAawBsACoAbQBuAG8AcABxAHMAdAB1AHYAdwB4AHkAXgBfAGAAYgBjAGQAZQAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAArADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0ACAAJAAoACwAMAA0ADwAFAAQAAwACAAEABwAAAQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAGoAAAAAAAAACMAADmOAAA5jgAAAAUAADmOgAA5joAAAAGAADmPgAA5j4AAAAQAADmPwAA5j8AAAARAADmQAAA5kAAAAASAADmQQAA5kEAAAAPAADmQgAA5kIAAAATAADmRQAA5kUAAAAOAADmXQAA5l0AAABhAADmXgAA5l4AAAByAADmXwAA5l8AAACIAADmYAAA5mAAAACFAADmYQAA5mEAAACGAADmYgAA5mIAAACHAADmYwAA5mMAAACJAADmZAAA5mQAAABmAADmZQAA5mUAAABnAADmZgAA5mYAAABoAADmZwAA5mcAAAB7AADmaAAA5mgAAAB6AADmaQAA5mkAAAB8AADmagAA5moAAAB9AADmawAA5msAAAB+AADmbAAA5mwAAAB/AADmbQAA5m0AAACAAADmbgAA5m4AAACBAADmbwAA5m8AAACCAADmcAAA5nAAAACDAADmcQAA5nEAAACEAADmcgAA5nIAAABpAADmcwAA5nMAAABqAADmdAAA5nQAAABrAADmdQAA5nUAAABsAADmdgAA5nYAAAAqAADmdwAA5ncAAABtAADmeAAA5ngAAABuAADmeQAA5nkAAABvAADmegAA5noAAABwAADmewAA5nsAAABxAADmfAAA5nwAAABzAADmfQAA5n0AAAB0AADmfgAA5n4AAAB1AADmfwAA5n8AAAB2AADmgAAA5oAAAAB3AADmgQAA5oEAAAB4AADmggAA5oIAAAB5AADmgwAA5oMAAABeAADmhAAA5oQAAABfAADmhQAA5oUAAABgAADmhgAA5oYAAABiAADmhwAA5ocAAABjAADmiAAA5ogAAABkAADmiQAA5okAAABlAADmigAA5ooAAAAVAADmiwAA5osAAAAWAADmjAAA5owAAAAXAADmjQAA5o0AAAAYAADmjgAA5o4AAAAZAADmjwAA5o8AAAAaAADmkAAA5pAAAAAbAADmkQAA5pEAAAAcAADmkgAA5pIAAAAdAADmkwAA5pMAAAAeAADmlAAA5pQAAAAfAADmlQAA5pUAAAAgAADmlgAA5pYAAAAhAADmlwAA5pcAAAAiAADmmAAA5pgAAAAjAADmmQAA5pkAAAAkAADmmgAA5poAAAAlAADmmwAA5psAAAAmAADmnAAA5pwAAAAnAADmnQAA5p0AAAAoAADmngAA5p4AAAApAADmnwAA5p8AAAAqAADmoAAA5qAAAAArAADmoQAA5qEAAAAsAADmogAA5qIAAAAtAADmowAA5qMAAAAuAADmpAAA5qQAAAAvAADmpQAA5qUAAAAwAADmpgAA5qYAAAAxAADmpwAA5qcAAAAyAADmqAAA5qgAAAAzAADmqQAA5qkAAAA0AADmqgAA5qoAAAA1AADmqwAA5qsAAAA2AADmrAAA5qwAAAA3AADmrQAA5q0AAAA4AADmrgAA5q4AAAArAADmrwAA5q8AAAA5AADmsAAA5rAAAAA6AADmsQAA5rEAAAA7AADmsgAA5rIAAAA8AADmswAA5rMAAAA9AADmtAAA5rQAAAA+AADmtQAA5rUAAAA/AADmtgAA5rYAAABAAADmtwAA5rcAAABBAADmuAAA5rgAAABCAADmuQAA5rkAAABDAADmugAA5roAAABEAADmuwAA5rsAAABFAADmvAAA5rwAAABGAADmvQAA5r0AAABHAADmvgAA5r4AAABIAADmvwAA5r8AAABJAADmwAAA5sAAAABKAADmwQAA5sEAAABLAADmwgAA5sIAAABMAADmwwAA5sMAAABNAADmxAAA5sQAAABOAADmxQAA5sUAAABPAADmxgAA5sYAAABQAADmxwAA5scAAABRAADmyAAA5sgAAABSAADmyQAA5skAAABTAADmygAA5soAAABUAADmywAA5ssAAABVAADmzAAA5swAAABWAADmzQAA5s0AAABXAADmzgAA5s4AAABYAADmzwAA5s8AAABZAADm0AAA5tAAAABaAADm0QAA5tEAAABbAADm0gAA5tIAAABcAADm0wAA5tMAAABdAADm1AAA5tQAAAAIAADm1QAA5tUAAAAJAADm1gAA5tYAAAAKAADm1wAA5tcAAAALAADm2AAA5tgAAAAMAADm2QAA5tkAAAANAADm2gAA5toAAAAPAADm4AAA5uAAAAAFAADm4wAA5uMAAAAEAADm6AAA5ugAAAADAADm6gAA5uoAAAACAADm7wAA5u8AAAABAADnAAAA5wAAAAAHAAAAAAAAAJwBRAGiAmgCrAM+A4QEEgR8BMwFdgX2BmwGqgb4B5AH2ghqCOAJEgmcCiYKkgryC3gMDgySDRINag26DjgOrg8UD0QPmg++ECAQdhHGEd4SLhK2EwITUhQAFNwVJBVuFcoWVBbYFzIXzBgmGIIY1BkiGboaBhpWGpoa6Bs4G3QbxBwKHFgcpB0AHVwdoB3IHhAeUB6SHvgfGB88H6of+CBqIK4hECEwIbgiKiJyIrQi+CMYI0AjYCOEI+YkWiS+JToloiXuJkQmrCcgJ4An4ChGKLwpGimUKfoqvCr2K7gsMiyiLZ4uDC6oL5IvvDAsMKIw8jFsMaYyFjJwMrwy/DMwM2YzoDQyNJg09jU+NhQ2bAAAAAQAAAAAA6IC2AAZACYAVwBqAAABIgYHNTQmIgYVERQWMjY9AR4BMzI+ATQuAQMiLgE0PgEyHgEUDgEBIyIOARUUFjI2NTQ2OwEyFh0BBgcGIyIHBgcOAhcWFxYzMjc2Nx4BMzI2NRE0LgETBgcGJicmNjc2NzYyNzY3FgcGAtcnSBwTGhMTGhMcSCc3XTc3XTcmPyYmP0w/JiY//kBbIzsiExoTJhpbIS8lHxMdIRIeIRslDAkJGyxNEwtFKwMQCw0TJ0INHDwxPgkGFBUYFA05EyAjAgQGAhMjIOgNExMN/asOEhIOCCAjQnGFcUL+VTFTY1MxMVNjUzEBmyM7Iw0TEw0bJi8iIQkEAQQFEA4zQB4iGSgBBigJDBMNARAnQyf+kiYGBRseGDEKDAQCAgIJIBwlAAAAAAYAAP/qA8MDFgAVABgALwA3AD8AcQAAATMXHgEyNz4BJwMuAQYHAwYeATY/AhcjAT4BNTQuASsBIgYVERQWOwEyPgE1NCYnMzIWFAYrARcjNTMyFhQGJSYvAS4CJzEmLwEmDgEWHwEGJy4CNzQuAQYHBh4BFxYXBw4BFxYzMj8CMD4BNzUBTQIoBBAQBgwKBpsFGBkFmwUJGBkFKFc5cgLdEhQgNiCqDhISDqogNiAU7IoWICAWioqKihYgIP68AQEBAQEBAwECWwoaEQMKGBwWKD8jARIaEwEBLlU3FBoICwUIChAKCGEHAgMBAetZCAoDBRkMAVYLCAgL/qoMGQoJDFi9ff6KESwZIDUgEw3+qw0THzYgGSybHywgqmofLB9DAgMCAwICAgIBSwgDFRoIFAEFCjVLKQ0TARINOWVHDgUBBgcbCg4FQwYDCAIMAAIAAP/2A58DCwAjADoAAAUiLwEHBi4CPwEnLgE+AT8CPgEWHwIeAgYPARcWDgEvATIfAScmPwEnJi8BBwYPARcWDwE3NjMC6wgH3NwIEw4HASuyBwQFDgr2bgUXGAVv9gkOBgUGsioCBxAL7AgHsSEDDJDHEAhZWAgRxpAMAyKyBwgJA3R0BAIKEQn1rQcREgwBJN8KCAgK3yQBDBESB631CREMAbsEXcURC4wdAw+0tBACHYwLEcVdBAAABgAA//MDeQMOACwAXQBtAHEAgQCFAAABFgcnLgEOAR8CFjMXFjI/ATY/AjYuAQYPASYnLgIHDgIUHgE3Nh4BFwEGLgEnJjcXFjMyPgEmLwMiLwEjIg8BIg8CBhYXFjMyPwEWFx4COwE+ATQmBwEhMjY1ETQmIyEiBhURFBYTMxUjBSEiBhURFBYzITI2NRE0JgMjNTMC8gYBFAgbFAMISgQCAQcFDQYIAQEEQggFFRoIBgEFDUllOAgPCAkPCSlLNQr+zSlLNAoGARQKDwkQCAMFSwMDAQEKBwUBDAEBBkIIBQsIChAKBgEFDUZiNwcNEhQN/ukBAA0TEw3/AA0TEy3AwAKO/wANExMNAQANExMtwMACMRYcGAoDERoKWwQCAwMDBAECBGEKGg8ECwgXFzZVLwEBCQ8RDgkBASJAKP4BASJAKBYcGAwKERIHWwMEAQQBBQEGYQsaBwYOCBcXNVQwARMaEwEBmxMNAQANExMN/wANEwEAwMATDf8ADRMTDQEADRP/AMAAAAAAAgAAAAADjgLLABQAKgAAEyEyNz4BJyYvASYiBhQfASEiBhQWBSEiBw4BFxYfARYyNjQvASEyNjQmI5UC1gYGDAsFAwSrCRsSCXT9dw0TEwLj/SoGBgwLBQMEqwkbEgl0AogNExMNAeADBRgMBgWqChMbCXQTGhOVAwUZDAYEqwkTGgp0ExoTAAYAAP9/A+YDgAASAB8ANABEAFMAYQAAASEiLgE2NxM+ATIWFxMeAQ4BIwMiBwMGFjMhMjYnAyYDIyIuAT0BND4COwEyHgEdARQOAQMiBh0BFBY7ATI2PQE0JiMBIi4BND4BMh4BFRQOAgMiDgEeAj4BNTQuAgLe/kQXJxYBDN0MJiwmC94MARYoF90CAt0BAgMBuwICAd4BtZgqRykXKzkfmClHKipGwh8rKx+YHisrHgGyPmo+Pmp9aT4jQFUuLUwjEkBaVDIXKjcBdRcoLhQBYhMVFRP+nhQuKBcBuwL+nQIEBAIBYwL8UCpGKpgfOCsYKkYqmCpGKgF8LB6YHiwsHpgeLP6EPmp9aT4+aT8uVEEjAXwzVFlAEiNMLR43KhcAAAACAAD/fwPNA4EACwAsAAAFISImNDYzITIWFAYlIicmJyY1ETQ2MhYVERQeATI+ATURNDYyFhURFgcGBwYDm/zKFRwcFQM2FRwc/k9hU1EwMR0oHUZ4jHdGHSkcATEvUVSAHSkcHCkdzi4tTE9bAbAUHR0U/lBBbUFBbUEBsBQdHRT+UFtPTC0uAAAAAAYAAAAAA10C3QA3AE8AUwBXAFsAXwAAARY2JzU2JgcjJgYXFSE1NiYHIyYGFxUGFjczESMmBhcVBhY3MxY2JzUhFQYWNzMWNic1NiYHIxEBIxEzFjYnNSEVBhY3MxEjJgYXFSE1NiYDNTMVERUjNQU1MxURFSM1Az4NEgEBEg2IDRIB/tABEg2IDRIBARINJiYNEgEBEg2IDRIBATABEg2IDRIBARINJv4yJiYNEgEBMAESDSYmDRIB/tABEndMTAH0TEwCGAESDYgNEgEBEg0mJg0SAQESDYgNEgH+0AESDYgNEgEBEg0mJg0SAQESDYgNEgEBMP7QATABEg0mJg0SAf7QARINJiYNEgFrTEz+WExMTExMAkBMTAAABAAAAAADdALrABgAIQA0AEYAACUjLgE1ETQ2MyEyFh0BFAYnJg4CBxQWBiczPgI7ATUhASIuAScmNTQ+ATMyFx4CDgIDIg4BBxQXHgI+Ay4BJyYBs9sYIyMYAbkYIhcOJ04/IgEEEua4AUBsQQ3+TQGmO2ZECAJAbkEZGTpaLQ1DZzwwUi8BAgYzTlhMMQghQysTvAEiGAG5GCIiGO0PEgMIEzJIKAwaFT1AbEDH/Vw2XjoQEUBuQAUNTG53YTkBoDBRMAwMLEcnAStIWVA5CQQAAAADAAAAAANfApgADwAeADIAACUhIiY1ETQ2MyEyFhURFAYBIgYVERQzITI2NRE0JiMBIi8BLgE+AR8BFj8BNh4BBg8BBgMc/cgcJyccAjgcJyf9rAIDBQI4AgMDAv7bFxKbCgMQGgmcAwOcChYOAQicEmgnHAGqHCcnHP5WHCcB8gMC/lYFAwIBqgID/u4OfAgZFAMIfAICfAUEEhcIew8ACAAAAAADeQLxAAgAHQAmADwAUABhAGgAdwAAJRQGKwE1MzIWAREUBisBJzMyNxE0KwEyNj0BMzYWByMXMxUXNTQmBxUUIyEiPQEzJyMiBhURFBYzITI2NwMhIgYdARc1NDYzITIWHQEzNTQmARUjIiY1ETQ2NxcjIhURFDMBFRQGKwEnASInAS4BPgIWFwEWFAYBdRINHh4NEgHbJhsDPUADAQRmDRJHGyamhT4pPRIsA/7wA10+PQ0SJhsBDxklAkD+8BslPQIBARABAj0l/pVHGyYiGT03AwMB1xIM8T4B3gwJ/VIGBQQMEBAGAq4JEtYMEj0SASX+8BslPQMBEAMSDR4BJoQ+KT2FDRL2OAMD8D4SDf7xGyYiGQJlJhoEPUEBAgIBSEgaJv4lPSUbARAZJQI9BP7xAwFTHg0SPf27CQKuBhARDAQFBv1SCRkSAAAAAAUAAAAAA1EC0QApADkAQQBRAFsAACUjIiY0NjsBMjY1ETQmIyEiBxEWOwEyFhQGKwEiJjURNDYzITIWFREUBgchIiY1ETQ2MyEyFhURFAYBFRQXITY9ATchIiY9ATQ2MyEyFh0BFAYlITU0JiMhIgYVAxBnDRISDWcBAgIB/eEDAQEDZg0SEg1mGyYmGwIfGiYmov7wGyUSDAFUDBIl/tIDARADH/6sDBIlGwEQGyUS/r8BFgIB/vABArgSGRICAQEQAQID/vADEhkSJRsBEBslJRv+8BsliCYbAQ8NEhIN/vEbJgEx8AMBAQPwqhINZhslJRtmDRI9SAECAgEAAAAEAAAAAAMYAuoAIQAxAEIATgAAJSEiJicRNDY7ATU0PgEWFxYOASYnLgEOAR0BITIWFREOAQEiBhURFBYzITI2NRE0JiMDIiY9AS4BPgIeAQYHFRQGJyYOARQeATc+ATQmAtX+VhwmASccKUp2bBsGCBcYBhFGTDABRBwnASb+OgIDAwIBqgIDAwLVDRIdIwUqPDISFxoSFgYMBwcMBgkMDCAmGwFlGycrPF8bMzYLGQsIDCMhEj0nKycb/psbJgGrAwL+mwIDAwIBZQID/uMSDQoIMjwsBiE5OA8RDRKRAQYLDQsGAQENEQ0AAAMAAAAAA2wClAAPAB8AJQAAJSEiJjURNDYzITIWFREUBgEiBhURFBYzITI2NRE0JiMFJTcFJRcDFf3cJDIyJAIjJDMy/bgNEhINAiMNEhIN/ur+yBoBHgEpGokzIwFeJDIyJP6iIzMB0xIN/qIMEhIMAV4NEuTAObC0OQADAAAAAALoAmgADwAhADAAAAEnJjQ/ATYyHwEWFA8BBiIHPgEvASYGDwEGBxUGFjczMjclIyIPAQYWOwEyNj0BNCYCozMHBxwHEwc0BwccBxQlBwMFPwQQB+YHAQEMCT8ICAEqpAoHIAYGCM0KDg4B7zQHEwccBwczBxQHHAc4BxAEPwUDB+AHCT8JDAEHNQchBg4OCgwKDgAAAAAMAAAAAAL8Ap0ADwAQABwAKAA0ADUARQBGAFIAXgBqAGsAACUhIiY1ETQ2MyEyFhURFAYjAyMiJjQ2OwEyFhQGByMiJjQ2OwEyFhQGByMiJjQ2OwEyFhQGIwchIiY1ETQ2MyEyFhURFgYjAyMiJjQ2OwEyFhQGByMiJjQ2OwEyFhQGByMiJjQ2OwEyFhQGIwLY/u8PFRUPAREPFBQPQY8HCAgHjwcHCAaPBwgIB48HBwgGjwcICAePBwcIBoj+7w8VFQ8BEA8VARUPQY8HBwcHjwcICQaPBwcHB48HCAkGjwcHBwePBwgJBnsVDwGgDxUVD/5gDxUBSggNCAgNCFYIDQgIDQhWCA0ICA0IZBUPAZ8PFRUP/mAPFAFJCA0ICAwJVggNCAgMCVYIDQgIDQgABQAAAAADAQJ4AA8AGwAcAC8AMAAAASEiBhURFBY3IRY2NREuAQcjFSM1IzUzNTMVMxUBIRUzNS4BIyEiBhURFBY3MzUjAwLj/oALEhEMAYAMEgERVlg7WVk7WP6BAWIeAREM/p4MERILHh4PAjgQC/6eDBABARAMAWILEOhSUjdSUjcBCxsbDBAQDP65CxEBGwFaAAQAAAAAAzcChQA0AEkAZgBnAAABDgEHBhYXIyIuAjURNDY7ATI3MzIeAh0BIiMHIgYPAQYWMzI2PwEFHgMHFAcVJgcGFzIWFx4BFAYHDgEiJicuATQ2Nz4BFzI2NCYrATU0JiIGHQEjIgYUFjsBFRQWMjY9ATM1AjESGAYFAwnrDhsXECokZyMSlQ0dGA8vHfAPEwQjAg0MCg0DIQFDCxYSCAMBLzAxXRsyERQUFhITLzgyERMVFxETMGkIDAsJOgsRCzoIDAwIOgsQDDoBkxIsGRczFwoTHhMBCSYrAQsSGQ4IARIReAkTDAh8AQEJExsTAQEDDwoNHRcREy84MhETFRYSEy84MhETFZcLDww7BwwLCDsLEAw6CAwLCToBAAYAAAAAAvECngAPAB8AIAAwAEwATQAAASYGBwMGFh8BFjY3EzYmLwEXHgEHAw4BLwEuATcTPgEXBzMyFhURFAYrASImNRE0Nhc1NCYiBh0BIyIGFBY7ARUUFjI2PQEzMjY0JiMHAb8OGQNbAw4N7w4YBFsDDg3l7xwdCFsHMhvyGx0IWgkyHH72HCkpHfUdKSmqCg8KWAgKCghXCg8KVwcKCgdWAnQEDg/+rA4YBD8DDg4BVA4YBGI/CDEb/qwcHQg+CDEbAVUcHAc1KR3+oR0pKR0BXx0p9VgHCgoHWAoPClcICQoHWAoOCwEAAgAAAAADwAL+AA8AHwAAKQEiJjURNDYzITIWFREUBiUhIiY1ETQ2MyEyFhURFAYCUf4oFyIiFwHYFyIiAR/+OxghIRgBxRghISIXAc4YISEY/jIXItAiFwG8FyIiF/5EFyIAAAMAAAAAA2cC9QAUACYAUwAAJSInJScmND8BJTYyFwUXFhQPAQUGAQUXFjI/ASU2JyUnJiIPAQUGASInJScmND8CPgEeAgYPAQYXBRcWMj8BJTYvAS4BPgIWHwIWFA8BBQYCABsU/uIFFBQFAR4UNhQBHgUUFAX+4hT+vgEeBAMGAwQBHgMD/uIEAwYDBP7iAwEqGxT+4gUUFAVsBhEQCgEIB2oDAwEfBAIGAwQBHwICaggJAQoQEgZtBRQUBf7iFdkSyAMUOhQDyBISyAMUOhQDyBIBCsYEAgIExgQFxgMDAwPHBP4kEsgDFDoUA0wFAgcOEQ8ESgQExwMCAgPHBARKBA8SDgcCBkwDFDoUA8gSAAAAAAYAAAAAA18C3wAWACwAPABIAFgAaAAAASImPQE0NjsBMh4BFA4BKwEiBh0BFAYFIyImNDY7ATI2PQE0PgEyHgEdARQGByMiJj0BNDY7ATIWHQEUBgMiHQEUOwEyPQE0IyUjIiY9ATQ2OwEyFh0BFAYDIgYdARQWOwEyNj0BNCYjAU4MEiYcsggOCAgOCLICAxIBM7IMEhIMsgIDCA8QDggm8dUcJycc1RsnJ/AFBdUFBQFj1RsnJxvVHCcn8QIDAwLVAgMDAgE+EgyyHCYIDhAPCAMCsgwSjhIZEgMCsggOCAgOCLIcJo8nHNUbJycb1RwnAR0F1QUF1QVHJxvVHCcnHNUbJwEcAwLVAgMDAtUCAwAAAAUAAAAAAzwC3wAfACkAMwBAAE0AACUhIiY1ESMiJjQ2OwE1NDY7ATIWHQEzMhYUBisBERQGAREUFjMhMjY1ESUzNTQmKwEiBhUTIiY9ATQ2MhYdARQGIyImPQE0NjIWHQEUBgKy/pwbJykNEhINcCYc1hsnbw0SEg0oJ/58AwIBZAIC/tveAgLWAgK2DRISGhISmw0SEhoSEiEnHAGvEhkSTBwnJxxMEhkS/lEcJgHx/lECAwMCAa89TAIDAwL+FBIM1gwSEgzWDBISDNYMEhIM1gwSAAAAAAMAAAAAA18C3wAjADMAQwAAJSEiJj0BNDYyFh0BFBYzITI2NRE0JisBIiY0NjsBMhYVERQGASEiJjURNDYzITIWFREUBgEiBhURFBYzITI2NRE0JiMDHP6dGycSGRIDAgFjAgMDAvgNEhIN+BwnJ/7I/uQcJyccARwbJyf+yQIDAwIBHAIDAwIhJxz4DRISDfgCAwMCAWMCAxIZEicb/p0cJwEdJxsBHBwnJxz+5BsnAWMDAv7kAgMDAgEcAgMAAAYAAAAAA18C3wATACgAOABIAFgAZgAAJSMiJj0BNDYyFh0BFBY7ATIWFAY3IiY9ATQmKwEiJjQ2OwEyFh0BFAYTIyImPQE0NjsBMhYdARQGAyIGHQEUFjsBMjY9ATQmIyUjIiY9ATQ2OwEyFh0BFAYDIgYdARQ7ATI9ATQmIwIkshwmEhkSAwKyDBISgg0SAwKyDBISDLIcJhJe1RsnJxvVHCcn8QIDAwLVAgMDAv6d1RwnJxzVGycn8AIDBdUFAwKwJhyyDBISDLICAxIZEo4SDLICAxIZEiYcsgwS/uMnHNUbJycb1RwnAR0DAtUCAwMC1QIDRycb1RwnJxzVGycBHAMC1QUF1QIDAAAGAAAAAANfAt8AFAA4AEoAUwBjAG0AAAEiJj0BNCYrASImNDY7ATIWHQEUBgMhIiY1ETQ2OwEyFhQGKwEiBhURFBYzITI2PQE0NjIWHQEOAScjIiY9ATQ/ATYyHwEWFA8BBiczNzYvASYPAScjIiY9ATQ2OwEyFh0BFAYnMzU0JisBIgYVArINEgMCag0SEg1rHCcTMP5VHCcnHGoNEhINagIDAwIBqwIDEhoSAScjYw0SCa4UNhMyExOvCFI5pQMDMQQDpR/WDBImHI4bJxLDmAMCjgIDAakSDY8CAxIZEicbjw0S/ngnHAHxHCcSGhIDAv4PAgMDAo4NEhINjxwmjxIMZAwJrxMTMhM2FK4JPaUEAzIDA6buEg1qHCcnHGoNEj1MAgMDAgAAAAAEAAAAAANfAt8AIABEAFQAZAAAJSMiJj0BNDY7ATIWFAYrASIdARQ7ATI9ATQ2MhYdARQGASMiJjQ2OwEyNj0BNCYrASIGHQEUBiImPQE0NjsBMhYdARQGByEiJjURNDYzITIWFREUBgEiBhURFBYzITI2NRE0JiMBudUcJyccag0SEg1qBQXVBRIZEicBSGoNEhINagIDAwLVAgMSGRInG9UcJyeq/uQcJiYcARwcJib+yAIDAwIBHAIDAwIhJxzVGycSGRIF1QUFag0SEg1qHCcBZBIZEgMC1QIDAwJqDRISDWocJycc1Rsn1SYcARwcJiYc/uQcJgFjAwL+5AIDAwIBHAIDAAACAAAAAANHAscALQBVAAAlIicmJyYnJicmNjcyOwEyFhcWFxYGDwEiFBUWFxY/AT4BFxYXHgEdARQOAiMBIw4BFxYXFhcWFzMyNj0BNCcmJyoBIwcOAScmLwEmNj8BNicmJyIjAuUHB4x2dElMEQUwJwgHgBgkAwQaCg8VHAIuRAICEQwwFzY7GSEOGyQT/jUFDhICEERCaGt+Bg8UAkZAAQIBExAzFkw1Aw0PFxwBAR8FAQE4ARJNSnR3jCdABiEYPDcWMAwOAwFELgICHRUPCxoEAyQZgRQkGxACUQIXD35raUNFEBUPgQIBBR8iFQkPNU0FGDINEAECQEYAAAAABAAAAAADPALrAA8AHwAsADkAACUhIiY1ND4BNzMeAhUUBiUiDgEVFBYzITI2NTQuASMnIi4BPgIeARUUDgEDIg4BHgI+ATU0LgEC+f4OGyc4YDjWOGA4J/6BKEMoAwIB8gIDKEMoazVXKBRKZ2E7L08vIjgaDTBCPyUeMx0nGzlfOAEBOF85GyfVJ0QoAgMDAihEJ5c6YWdLFChXNS9PLwEdJj5DMA0aOCIfMx4AAAADAAAAAANWAt8AFQAiAC8AACUiLwEOAS4CPgIeAgYHFx4BDgEBJg4CHgEyPgE0LgEBIi8BJj4CHwEWFAYDJQwJoDmNiGIfJ2eLjG0uFy6fBwMHD/6UPGQ7ATtkdmU7OmQBOQ0JfAkBERkJfQkSPAmfLhcubYyLZycfYoiNOaAGEhIKAlwBO2R2ZTs6ZHdkO/2SCX0JGREBCXwJGhIAAAAABQAAAAADXwLhAA8AHQAtAD0ATAAANyIuATY3AT4BHgIGBwEGBSIuATY3ATYyFhQHAQYBIi4BNjcBPgEeAgYHAQYBISImNRE0NjMhMhYVERQGASIGFREUMyEyNjURNCYj1AoPBwMGAlwGEBAMBAQG/aUJAQgJEAcDBwFXCRkSCP6qCv7KCRAHAwcBVwYQEAwFBQb+qQkCT/3IHCcnHAI4HCcn/awCAwUCOAIDAwIoCxESBgJvBQUEDBAQBv2TCgcKEhIGAWIJERkK/p8KAR4KEhIHAWEHBQQMEBEF/p4K/uInHAI4HCcnHP3IHCcCgAMC/cgFAwICOAIDAAAABQAAAAADGQLhABkAKQAzAEQAUAAAJSEiJicRNDY7ATU0PgEyHgEdATMyFhURFAYBIgYVERQWMyEyNjURNCYjJTM1NC4BIg4BFRMiJj0BLgE+Ah4BBgcVFAYnIg4BHgI+ATU0JgLV/lYcJgEnHCkuT15QLikcJif+OgIDAwIBqgIDAwL+vN4eMzwzHm8NEh0jBSo8MhIXGhIWBwsGAwoNDQgNICYbAWUbJysvUC4uUC8rJxv+mxsnAawDAv6bAgMDAgFlAgM9Kx40Hh40Hv57Eg0KCDI8LAYhOTgPEQ0SkQcNDgkDBQwHCQ0AAAAEAAAAAAMZAuQAGQAoADIARAAAJSEiJjURNDY7ATU0PgEyHgEdATMyFhURFAYBIhURFBYzITI2NRE0JiMlMzU0LgEiDgEVEyIvASY0NjIfATc2Mh4BDwEGAtX+VhwnJxwpLk9eUC4pHCYn/joFAwIBqgIDAwL+vN4eMzwzHkMNCUcJEhkJMngJGREBCY4IHScbAWQbJzEvUC4uUC8xJxv+nBsnAaoE/pwCAwMCAWQCAj4xHzMeHjMf/n0JSAkaEQgyeQgSGQmOCgAAAAACAAAAAAMWApYADAAZAAAlIiY0NwE2MhYUBwEGISInASY0NjIXARYUBgEJDRIJAe4JGhIJ/hIJAeENCf4SCRIaCQHuCRJqEhoJAe4JEhoJ/hIJCQHuCRoSCf4SCRoSAAADAAAAAANfAt8AGQAvADsAACUhIiY1ETQ2OwE1NDYzITIWHQEzMhYVERQGASMiBhURFDMhMjY1ETQmKwEiLwEmJwMjIiY0NjsBMhYUBgMc/cgcJyccBCccAaocJwQcJyf90CQCAwUCOAIDAwKODQk9AgFcjgwSEgyODRISISccAWMbJ5McJycc2icb/uQcJwGrAwL+nQUDAgEcAgMJPQEB/uMSGRISGRIAAAAAAQAAAAADUgJkABEAACUiLwEmND4BHwEBNh4BFAcBBgGoDQnbCBIYCsUBdQoYEgj+dQmcCdsJGREBCcUBdQkBERkJ/nUJAAAABAAAAAADPQK7AB8AMQAyAEAAAC0BIiY1EzQ2OwEyFgYrASIVAxQXBTI9ATQ2MhYVBxQGEyImPQEjIiY0NjsBMhYHFRQGJwEiLgE2NwE2Mh4BBwEGAv7+AhgjAiMY/xAQEBD/BAIEAf4EERcQASMJDBCDDA8QC44TGwERHP7zCA4GAwYBGwgWDwEH/uQHRAIjGQH+GCMcGwX+AwQBAgX/CxAQDP4ZIwGfEAuEERcPGxSNDA+g/uoJDxEFARkHEBYI/ugIAAMAAAAAA2YC5QAXADEAMgAAJSInLgEvASYvAS4BNDY3JTYeAgcDDgEDHwEeAT4BNxM2JyYHBSIGFzIfATc2HgEUByUCUggHEhoFWAED5hYbHBYCMxMpHgcJyQYkdVgBAQUDAQHLAQECBP3DAwIFAgLlXAkZEgn+ih8CBBkS5gMBWAYkLSMGygkHHikT/c0WHAEp4wUDAQIFAQI5AgIEAs0IAQFYXAkBERkJUAAFAAAAAANmAt4AcADcAN0A7AD1AAAlIyImPQE0LwEmDwEGIi8BJjQ/ATYnJicmKwEiJj0BNDY7ATI/ATYvASY0PwE2Mh8BFj8BNj0BNDY7ATIWHQEGHwEWPwE2Mh8BFhQPAQYfARYXMzIWHQEUBisBIg8BBh8BFhQPAQYiLwEmDwEGHQEOASceAR0BFDsBMj0BPgIWHwEWPwE2NC8BLgE+ATczMjY9ATQmKwEuAjY/ATY0LwEmIg8BDgEuASc1NCsBIh0BDgImLwEmIg8BBhQfAR4BDgEHIyIGHQEUFjsBHgIGDwEGFB8BFjI/AT4BJQciLgE0PgEyHgEVFA4CJyIGFBYyNjQmAiRIHCgDAwQDDhQ4EzQTEw8DAQEBAQQXHCcnHBUFAQECAw8UFDQUNxQPAwQDAygcSBwoAQUDBAMPEzgUMxQUDwMCAQIEFBwnJxwWBAEBAwMOFBQxFDgTDwMEAwMBJ5YTGAZJBQEYJigPDwQEMwICDg8HDyIVFwMDAwMUFSIQCA4PAgI0AQUBEA8pJhgBBUkGARcnKQ8OAgUCNAICDw4IECIUFgMDAwMWFSIQCA4PAgIzAQUCDw4qAVLpJkAmJkBMQCYVKDMcIC4uQC4uIyccFwQBAQICDhQUMxM4FA8DAwIBBCYcSBwoBAIEAw8UOBM0ExMPAwIBAQQEHCcnHBQEAgECAw8UFDQUNxQPAwQDAwEnHEgcKAMDAwQOFDgTNRMTDwMCAQEEBhsnmQghFRcGBgYUIhAIDg8DAzMCBQEPDygnFwEDA0cDAwEXJygQDgIFATUBAQ8OCBAiFRQGBgQVIg8HDw4CAjICBQEPDykmGAEDA0gDAwEXJygPDwIFATMCAg8PB1IiJkBMQCYmQCYcMygV2i5ALi5ALgABAAAAAANSAZ8ACwAAASEiJjQ2MyEyFhQGAzP9mg0SEg0CZg0SEgFhEhoSEhoSAAACAAAAAAMvAtEAGwA1AAAlIiYnNTQ2MhYdARYzITI2NzU0NjIWHQEOASchNy4BLwEmNDYyHwERNDYyFhURNzYyFhQPAQYBFBomAhIZEgIFAdMCBQESGRICKhv+LewMEgF5CRIaCU0SGhJZCRkSCYsJMCQaig0SEg2GBQMChg0SEg2KGyMBqAERDHkJGRIJTQFjDRISDf6SWAkSGQmKDQAABAAAAAADXwLfACMARgBWAGYAACUjIiY9ATQ2MhYdARQWOwEyNj0BNCYrASImNDY7ATIWHQEUBgEjIiY9ATQ2OwEyFh0BFAYiJj0BNCYrASIGHQEUOwEyFhQGBSEiJjURNDYzITIWFREUBgEiBhURFBYzITI2NRE0JiMDHNUbJxIZEgMC1QIDAwJqDRISDWocJyf+FmocJycc1RsnEhkSAwLVAgMFag0SEgEz/uQcJiYcARwcJib+yAIDAwIBHAIDAwIhJxxqDRISDWoCAwMC1QIDEhkSJxvVHCcBZCcb1RwnJxxqDRISDWoCAwMC1QUSGRLVJhwBHBwmJhz+5BwmAWMDAv7kAgMDAgEcAgMAAAAHAAAAAAM2AuIADQAQAB4AIQAlACkALQAAJSMiJjcTPgEeARURFAYnMxEBIyImNRE+AhYXExYGJzMLATMVIzUzFSM1MxUjAcncEBIF3AMUFg8SvpIBadwNEgEOFhME3AUSzZKSH8HBkJBgYCAaDwKCCwsEEQv9fg0SPgGr/hcSDQKCCxEEDAr9fg8aPgGr/sA+tj22PgAAAAYAAAAAA3ACwAALABsAHwAjADMANwAAJSEiJjQ2MyEyFhQGJyMiJjURNDY7ATIWFREUBiczESMHFSM1FyMiJj0BNDY7ATIWHQEUBiczNSMDUf1eDRISDQKiDRISYcENEhINwQwSEq6Dg5/BwcEMEhIMwQ0SEq+Dg0ESGRISGRKAEgwBwgwSEgz+PgwSPQGEwuDg/xIM4gwSEgziDBI9pAACAAD/+AM0AwoANQB7AAAFIyIuAj0BNC8BLgE+Axc1ND4CFxYXNTQ2Nz4BHgEdATYXHgEdATY3Nh4CFREUBw4BJRYdARQWOwEyNj8BNjURNCYOAR0BFgYiJicRNC4BBhURFAYrASImNRE0LgEGFREUBiImJxE2LgEGFREUDgEmLwEuAQ4BFwKl9R01KBYEPgwICRkkLRMOGR8RBQYPDRMxLRsREiAqBwcSIxsOChBI/n0QLyL1GikJAgMPEwwBEhkTAQsTEBIMAwwSDBMPEhoTAQEJDwsMExMFEgcYGAYICBYoNR0jBQVZECcnIBQBCcwQHxYKAQEBAxIhDBAIFCoZCAUCBDAgGAIBAgsYIRL+iRUSKTHgFBokIjAdGAQFBgF4Cg0CDgmsDBIRDQEWCQ0DDgr+6Q0SEg0BcAkOAg0K/o4NEhINAR4HCwEKB/7rChAGBggZCgcNGwwAAAAMAAAAAAOrAqUADAAXABgAJgAxAD0ASABVAGAAbAB7AIkAADciJy4CPgEeAg4BJyIHDgEeAT4BLgEnFyInLgE/AT4BHgEPAQY3Ii4BPgEeAQYHBiciDgEWFxY+ASYnJhMiLgE+AR4BBgcGJyIOARYXFj4BJicmIzcGLgE+AR4BBgcGJyIOARYXFj4BJicmASIvAS4BPgIWHwEWDgE3IicuAT8BPgEeAQ8BBsYLCx8uDRo3RTYUFjgiDgsOCQ4fIBIFGTtQCggKBQiFBxkVBAeFCaUsPgU4VkQNMSoLCg8ZCAoMECUVCA8Mvys/BDhWRA0xKgsLDxgJCwwQJRUIEAsNzCs/BjhWRA4xKgoLDxgJCg0QJRQHEAv+4Q4KXAYEBg0SEAVcCAITcwgHCwcGXgYZFgcHXQphAwYuQDslAipCQSiZCAkhHg4KHCIWEh0GBxkLvQsEDhoKvQ6xO1ZCCTVVRwkCmBIcHQgLCCAkCwf+cjtWQgk1VUcJApkSHRwJCgcgJQoIhgE7VkIKNVVHCQKYEhwdCAsIICQLB/7RC24GEhALAwgHbgoZDwEEBhgLpAsHDRkLpA4AAAIAAAAAA1oC2QAXACoAACUiJy4BJwMmPgIXBTMeAQ4BDwIGBwYnHgE2NTc+AT8BMz4BJyUmDgEVAekGBREbCPoJCB0pEwInAhQUCCEXwycFFxMgAwgHLAINCdgCBwMG/doCBAEqAQMSDwIpEykdBwj6CiotIQMnxB0RDkIEAQUE2QkNAiwBDQT5AQIEAQAAAAIAAAAAA18C3wAjADMAACUhIiY9ATQ2MhYdARQWMyEyNjURNCYrASImNDY7ATIWFREUBgEhIiY1ETQ2MyEyFhURFAYDHP6dGycSGRIDAgFjAgMDAvgNEhIN+BwnJ/7I/uQcJyccARwbJychJxz4DRISDfgCAwMCAWMCAxIZEicb/p0cJwEdJxsBHBwnJxz+5BsnAAAFAAAAAANwArAACwAXACMALwA7AAABISImNDYzITIWFAYHISImNDYzITIWFAYDISImNDYzITIWFAYnISImNDYzITIWFAYDISImNDYzITIWFAYDUf1eDRISDQKiDRISDf1eDRISDQKiDRISDf1eDRISDQKiDRISDf1eDRISDQKiDRISDf1eDRISDQKiDRISAnISGhISGhKIEhkSEhkS/u8SGRISGRKIEhoSEhoS/u8SGhISGhIAAAAABwAAAAADcAKxAAsAFwAjADAAPQBMAFwAACUhIiY0NjMhMhYUBiUjIiY0NjsBMhYUBiEjIiY0NjsBMhYUBgUiJjURNDYyFhURFAYjIiY1ETQ2MhYVERQGEyIvAS4BPgIWHwEWDgEhIi4BNj8BPgEeAgYPAQYDUf1eDRISDQKiDRIS/gW0DRISDbQNEhIB4bQNEhINtA0SEv6kDRISGhISDQ0SEhoSEnMPCYAFAwYNEBAFgAgDEv70CA8IAgWBBQ8RDQUCBYAKUBIaEhIaErYSGhISGhISGhISGhKVEgwCAg0SEg39/gwSEgwCAg0SEg39/gwSAWEMoAYRDwoDBgegChkPCRASB6AHBgMKDxEGoQsAAAAABwAAAAADcAKwAAsAFwAjADAAPQBKAFgAAAEhIiY0NjMhMhYUBgUjIiY0NjsBMhYUBiEjIiY0NjsBMhYUBgEiJjURNDYyFhURFAYjIiY1ETQ2MhYVERQGIy4CPwE+AR4BDwEGIyIvASY+ARYfARYGBwYDUf1eDRISDQKiDRIS/gW0DRISDbQNEhIB4bQNEhINtA0SEv6kDRISGhISDQ0SEhoSEg0LEgMIgAgZFAMIgAkPDwmBBwIUGgiACAMLCAJyEhoSEhoSthIaEhIaEhIaEhIaEv6UEg0CAgwSEgz9/g0SEg0CAgwSEgz9/g0SAQ4aCaEKAxAaCaEMDKEJGhADCqEKGQgGAAAABQAAAAADcAKwAAsAFwAjAC8AOwAAASEiJjQ2MyEyFhQGByEiJjQ2MyEyFhQGFyEiJjQ2MyEyFhQGByEiJjQ2MyEyFhQGFyEiJjQ2MyEyFhQGA1H9Xg0SEg0Cog0SEq3+ngwSEgwBYgwSEpT9Xg0SEg0Cog0SEq3+ngwSEgwBYgwSEpT9Xg0SEg0Cog0SEgJyEhoSEhoSiBIZEhIZEokSGhISGhKIEhkSEhkSiRIaEhIaEgAACAAAAAADcAKxAAsAFwAjAC8APABJAFgAZwAAJSEiJjQ2MyEyFhQGJSEiJjQ2MyEyFhQGJyEiJjQ2MyEyFhQGJyEiJjQ2MyEyFhQGEyImNRE0NjIWFREUBiMiJjURNDYyFhURFAYTIi8BLgE+AhYfARYOASEiLgE/AT4BHgIGDwEGA1H9Xg0SEg0Cog0SEv6G/ssNEhINATUMEhIM/ssNEhINATUMEhIM/ssNEhINATUMEhLUDRISGhISDQ0SEhoSEnMOCoAFAgYMEQ8FgAgDEv71CxIDCIAFEBANBgMFgAlQEhoSEhoSthIaEhIaErYSGhISGhK2EhoSEhoS/f8SDAICDRISDf3+DBISDAICDRISDf3+DBIBYQygBhEPCgMGB6EJGg4PGQqgBwYDCg8RBqAMAAAFAAAAAANwArAACwAXACMALwA7AAABISImNDYzITIWFAYHISImNDYzITIWFAYHISImNDYzITIWFAYHISImNDYzITIWFAYHISImNDYzITIWFAYDUf1eDRISDQKiDRISDf4/DRISDQHBDRISDf1eDRISDQKiDRISDf6fDRISDQFhDRISDf1eDRISDQKiDRISAnISGhISGhKIEhkSEhkSiRIaEhIaEogSGRISGRKJEhoSEhoSAAAFAAAAAANwArAACwAXACMALwA7AAABISImNDYzITIWFAYHISImNDYzITIWFAYXISImNDYzITIWFAYFISImNDYzITIWFAYFISImNDYzITIWFAYDUf1eDRISDQKiDRIS7v4/DRISDQHBDRIS1P1eDRISDQKiDRIS/rL+nw0SEg0BYQ0SEgE0/V4NEhINAqINEhICchIaEhIaEogSGRISGRKJEhoSEhoSiBIZEhIZEokSGhISGhIAAAAABwAAAAADYgK2AA0AEAAhACQAKAAsADAAAAEhIiY9ATQ2FwUeAQ4BJSElAyInJj0BNDYzIR4CBgcFBjcVLQEzFSM3MxUjNzMVIwNB/X4NEhoPAoILCwQR/ZIBq/5VHwoIDRINAoILEQQMCv1+BRoBq/6CPj55PT14Pj4BmBIN3BASBdwDFBYPPpL95gYJENwNEgEOFhME3ALckpIfwcGQkGAAAAAFAAAAAANwAqMACwAbAB8ALwAzAAABISImNDYzITIWFAYHIyImNRE0NjsBMhYVERQGJzM1IwMjIiYnET4BOwEyFhURFAYnMxEjA1H9Xg0SEg0Cog0SEmG9DRISDb0NEhKrgICfwQ0RAQERDcENEhKvg4IBYRIaEhIaEoASDQEADRISDf8ADRI9xP58Eg0CBg0SEg39+g0SPQHKAAAIAAAAAANwArAACwAXACMALwA8AEkAWABnAAABISImNDYzITIWFAYFISImNDYzITIWFAYHISImNDYzITIWFAYHISImNDYzITIWFAYzIiY1ETQ2MhYVERQGIyImNRE0NjIWFREUBiMuAj8BPgEeAgYPAQYHIi8BLgE+AhYfARYOAQNR/V4NEhINAqINEhL+hv7LDRISDQE1DBISDP7LDRISDQE1DBISDP7LDRISDQE1DBIS1A0SEhoSEg0NEhIaEhINCxIDCIAFEBEOBgQGgAkPDwmABgMGDREQBYAIAxICchIaEhIaErYSGhISGhK2EhoSEhoSthIaEhIaEhINAgIMEhIM/f4NEhINAgIMEhIM/f4NEgEOGgmhBwcCCxARBqELAQyhBhEQCgMHB6EKGQ8ABQAAAAADcALAAAsAGwAfAC8AMwAAJSEiJjQ2MyEyFhQGJyMiJjURNDY7ATIWFREUBiczESMDIyImPQE0NjsBMhYdARQGJzM1IwNR/V4NEhINAqINEhJhwQ0SEg3BDBISroODn8EMEhIMwQ0SEq+Dg0ESGRISGRKAEgwBwgwSEgz+PgwSPQGE/j8SDOIMEhIM4gwSPaQAAAAFAAAAAAMjAvAADAAcACAAMAA0AAAlIiY1ETQ2MhYVERQGEyEiJj0BNDYzITIWHQEUBiczNSMBISImPQE0NjMhMhYdARQGJSE1IQIADRISGhISc/8ADRISDQEADRIS7sTFAWX9+g0SEg0CBg0SEv4LAcr+Ng8SDQKjDRISDf1eDRMBkhINvQ0SEg29DRI+gP4CEg3ADRISDcEMEj6CAAAABAAAAAADcALEAAsAFwAnACsAACUhIiY0NjMhMhYUBgMhIiY0NjMhMhYUBgMjIiY1ETQ2OwEyFhURFAYnMxEjA1H9Xg0SEg0Cog0SEg39Xg0SEg0Cog0SEv7ADRISDcANEhKvhIQ8EhoSEhoSAkoSGhISGhL+NxINAUgNEhIN/rgNEj0BDAAAAAUAAAAAA3ACwAALABsAHwAvADMAAAEhIiY0NjMhMhYUBgEjIiY1ETQ2OwEyFhURFAYnMxEjBSMiJj0BNDY7ATIWHQEUBiczNSMDUf1eDRISDQKiDRIS/mbBDBISDMENEhKvg4MB48ENEhINwQwSEq6DgwKCEhkSEhkS/b8SDAHBDRISDf4/DBI9AYThEg3hDRISDeENEj6jAAAAAAUAAAAAA0AC8AAMABwAIAAwADQAACUiJjURNDYyFhURFgYDISImPQE0NjMhMhYdARQGJSE1IQEjIiY9ATQ2OwEyFh0BFAYnMzUjAyENEhIZEgESjv4/DBISDAHBDRIS/lEBhP58AaLhDRISDeENEhLOo6MPEg0Cow0SEg39Xg0TAY4SDcEMEhIMwQ0SPoP9/xIMwQ0SEg3BDBI9gwAAAAACAAAAAAMxAtEAFQAhAAAlIiYnCwEOAS4BNwE+ATIWFwEWBgcGJyEiJjQ2MyEyFhQGAxAKDwTz8wUYGAkFARAEDxIPBAEQBQkMBmj+rQ0SEg0BUw0SEjAKCAIk/dwMCQsXDAJjCAoKCP2dDBgFAssSGhISGhIAAAADAAD/vQNpAsgAFQAjAC8AACUiJicLAQ4BLgE3AT4BMhYXARYGBwYnISIuATQ+ATMhMhYUBhMhIiY0NjMhMhYUBgMQCg8E8/MFGBgJBQEQBA8SDwQBEAUJDAZs/qwIDggIDggBVAwSEpT9bAwSEgwClAwSEigKCAIk/dwMCQoYDAJjCAoKCP2dDBgFA8wJDhAPCBIaEv7KEhoSEhoSAAAABAAAAAADRQLwAAwAGQApAC0AACUiJjURNDYyFhURFAYhIiY1ETQ2MhYVERQGJSEiJj0BNDYzITIWHQEUBiUhNSEDJQ0SEhoSEv2pDRISGhISAbz+uA0SEg0BSA0SEv7JAQz+9A8SDQKjDRISDf1eDRMSDQKjDRISDf1eDRPyEg3ADRISDcANEj2EAAAFAAAAAANAAvAADAAcACAAMAA0AAA3IiY1ETQ2MhYVERQGASEiJj0BNDYzITIWHQEUBiUhNSETIyImPQE0NjsBMhYdAQ4BJzM1I98MEhIZEhICNf4/DRISDQHBDBIS/lEBhP58wuENEhIN4Q0SARHPpKQPEg0Cow0SEg39Xg0TAZISDcENEhINwQ0SPoL+ABINwA0SEg3BDBI+ggADAAAAAANgAuQAGgAkACwAACUhIicGLwEmNDcBNjIfARYUDwEGDwEzMhYUBgEXFjI/AScHBhc3Fzc2LwEmBwLe/uUNCRsUyRQUAXAUNhTJExPuAQJd4A0SEv31ywEDAWnRaQICldHbAwPJBAMdCQETyhQ2FAFwFBTLEzcT7QICXRIZEgERyQEBaNBpAwOaz9kDBMsDAwAAAAUAAAAAAuACmAAMABgAJAAxAD4AAAEiJj0BNDYyFh0BFAYlISImNDYzITIWFAYDIyImNDY7ATIWFAYTIiY9ATQ2MhYdARQGAyImNRE0NjIWFREUBgE/DBISGRISAXX+fgwSEgwBggwSEm3ADRISDcANEhJUDRISGRISzQ0SEhoSEgIKEg1QDBISDFANElASGRISGRL+DxIZEhIZEgGhEg1QDBISDFANEv5fEgwB8gwSEgz+DgwSAAAEAAAAAAOJAu8AFQAhAC4AOgAAJSImJwsBDgEuATcBPgEyFhcBFgYHBichIiY0NjMhMhYUBhMiJj0BNDYyFh0BFAY3IyImNDY7ATIWFAYCtQkQA/TzBRgXCgYBDwQPEhADARAFCQwGaP6tDRISDQFTDRISpAwSEhkSElnLDRISDcsNEhISCggCJP3cDAkKGAwCYggKCgj9ngwYBQLLEhoSEhoSAQgSDcsNEhINyw0SZhIZEhIZEgAAAwAAAAADGAK8ABEAHgAqAAABIiY0PwE2Mh8BFhQOAS8BBwYTIiY1ETQ2MhYVERQGEyEiJjQ2MyEyFhQGAXINEgmOCRoJjggSGAp4eAmBDRISGhIS7P4ODRISDQHyDRISAYUSGQmOCgqOCRkRAQl4eAn+wBINAc4MEhIM/jINEgI5EhkSEhkSAAEAAAAAA18CQgATAAAlIicBLgE+AhYXCQE2MhYUBwEGAgANCf7ABgQEDBAQBgEqASoJGhIJ/sAJwAkBQwYPEAwEBAb+0wEtCRIZCf69CQAAAgAAAAADUQLhABEAJgAAJSInASY0NwE2MhYUBwkBFhQGISYnASY0NwE+AR4CBgcJAR4BDgECEwwJ/r0JCQFDCRkSCf7TAS0JEgEQDAn+vAkJAUMGEBAMBAUG/tMBLQcDBw8hCQFACRoJAUAJEhoJ/tb+1gkaEgEIAUAJGgkBQAYFBQwQEAb+1v7WBxIRCwAAAwAAAAAC0AKyAAsAFwAlAAAlISImNDYzITIWFAYTISImNDYzITIWFAYDIy4BNxM+AR4BBwMOAQJQ/v8MEhIMAQENEhJU/v8NEhINAQEMEhLoBQ0OAmACFRoPAmECEVASGhISGhICIhIaEhIaEv3eAxUMAiIMDwQVDf3eCw4AAAADAAAAAAJlArwAEQAeACoAACUiLwEmNDYyHwE3Nh4CDwEGIyImNRE0NjIWFREUBhchIiY0NjMhMhYUBgFNDQmOCRIZCXl4CRkRAQmOCQwNEhIaEhLr/g8NEhINAfENEhKwCY4JGRIJeHgJAREZCY4JEgwBzg0SEg3+MgwSaxIZEhIZEgADAAAAAAMgAtgACwAnAEUAAAEhIiY0NjMhMhYUBiEiLgE+Ah4BFRQGIiY1NC4BDgIeATMyFhQGAy4CNTQ2MhYVFB4BPgIuASMiJjQ2Mx4CFA4BAwH9/g0SEg0CAg0SEv7yOFwrFk9tZj4SGRIpRUg0Dx09JQ0SEg0yVDESGRIpREg1Dx09JQ0SEg0xUS8vUQFhEhoSEhoSPmdtTxUqXTgMEhIMJT4cDzRIRCkSGhL+zwExVTIMEhIMJT4dDjRJRCkSGhICMlNhUzIAAAABAAAAAAMnAjkADwAAJRM+AS4BIyEiDgEWFxMWMgIe/QgDCRQM/gYMFAkDCP0MJNUBIgkXFQwMFRcJ/t4NAAAAAQAAAAACwQLfABEAACUiJwEmNDcBNjIWFAcJARYUBgKhDAn+vQkJAUMJGRIJ/tMBLQkSIQkBQAkaCQFACRIaCf7W/tYJGhIABQAAAAADdQKYABEAIwAvADwASQAAJSIvASY0PwE2Mh4BDwEXFhQGMyImND8BJyY0NjIfARYUDwEGNyEiJjQ2MyEyFhQGFyImNRE0NjIWFREUBiEiJjURNDYyFhURFAYBhw0JcwkJcwkZEQEJXV0KEuUNEgpdXQkSGQlzCgpzCWb+KA0SEg0B2A0SEl0NEREaEhL9Rw0SEhoREe4JcwkaCXMIEhkJXV0JGhISGgldXQkaEglzCRoJcwlzEhkSEhkS+RINAfINEhIN/g4NEhINAfINEhIN/g4NEgAAAAMAAAAAA4kC0QAXACMALwAAJSImJwsBDgIuATY3AT4BMhYXARYGBwYnISImNDYzITIWFAYBIyImNDY7ATIWFAYCtQkQA/TzAg4SEQoBBQEOBA8SEAMBEAUJDAZo/q0NEhINAVMNEhIBCssNEhINyw0SEjAKCAIk/dwJDAMIDxMHAmMICgoI/Z0MGAUCyxIaEhIaEgFuEhkSEhkSAAUAAP/6A1oDCQATAB0AKwA3AEUAAAUiJi8BLgE2NwE2MhcBFhQHAQ4BAwcGFB8BFjI/ASciLwEmPgEyHwEeAQ4BFwcGIi8BJjYzITIWFwcOAR4BMj4BNC8BJiIB0xUmD+wUDg4UAQsSMRIBLBER/vUPJxX9CAjrCBUH/m8RDOsLARYgDOsJBAkUYN4TNhPeBgcJAgQKBysrCAERHSEdEQkqBA8FEA/rFDY2FAEKERH+1hIxEv71DxACZf4IFQfsBwf+fwzsCyAXCuwIGBYNvN4TE94GERFUSg4iHBERHCIOSgYAAAMAAAAAAzwCmAARAB0AKgAAJSIvASY0PwE2Mh4BDwEXFhQGJSEiJjQ2MyEyFhQGBSImNRE0NjIWFREUBgHcDAmOCgqOCRkRAQl4eAkSATP+MgwSEgwBzg0SEv27DRISGRIS0wmOCRoJjggSGAp4eAkaEo4SGRISGRL5Eg0B8g0SEg3+Dg0SAAAEAAD/+gNaAwkAEwAdACsAOQAABSImLwEuATY3ATYyFwEWFAcBDgEDBwYUHwEWMj8BJyIvASY+ATIfAR4BDgETBw4BHgEyPgE0LwEmIgHTFSYP7BQODhQBCxIxEgEsERH+9Q8nFf0ICOsIFQf+cBAM6wsBFiAM6wkECRSSKwgBER0hHREJKgQPBRAP6xQ2NhQBChER/tYSMRL+9Q8PAmT+CBUH7AgI/n8M7AsgFwrsCRcWDf72Sg4iHBERHCIOSgYAAAAAAQAAAAADJwI5AA8AAAETHgEOASMhIi4BNjcTNjICHv0IAwkUDP4GDBQJAwj9DCQCK/7eCRcVDAwVFwkBIg0AAAUAAAAAA/AC0QAVACEAMgA9AFoAACUiJicLAQ4BLgE3AT4BMhYXARYGBwYnISImNDYzITIWFAYFIyIuATQ+ATsBMhYdARQOASciBhQWOwEyNj0BFyImNRE0LgErASYGBw4BLgE3PgEXMzIeARURFAYCTwkQA/TzBhYVCgMBDwQPEhADARAFCQwGbP6tDRISDQFTDRISAV41KkgqKkcrsQ0SKkdfJzc3JzUnNx4MEh4yHhYiOg0EFxgMBBRaNhcuTy4TMAoIAiT93AoGCRULAmMICgoI/Z0MGAUCyxIaEhIaEsglQExAJRINbCZAJdgtQC4uIE3bEg0BKhkqGAIlHwwMCRYMMzsBKUYq/tYNEgAABQAAAAADGAL1ABIAJAAxAD0ASQAAAQYuATY/ATYyHwEWFA4BLwEHBhMiLwEmND4BHwE3NjIWFA8BBiciJjURNDYyFhURDgEXISImNDYzITIWFAYDISImNDYzITIWFAYBjQoPBwMHcwkaCXMIEhkJXV0JZg0JcwgSGQldXQkaEglzCQ0NEhIaEgES7f4ODRISDQHyDRISDf4ODRISDQHyDRISAdsBCxETBnMJCXMJGREBCV1dCf6bCXIJGREBCV1dCRIZCXMJARIMAdgNEhIN/igNEWsSGhERGhICrREaEhIaEQAAAgAAAAADTwLhABMAJgAAJSImNDcJAS4BPgIWFwEWFAcBBiEiLgE2NwkBJj4BMhcBFhQHAQYB7Q0SCQEt/tMGBQQMEBAGAUMJCf69Cf7XCQ8HAwcBLf7TCQERGQkBQwkJ/r0JIRIaCQEqASoGEBAMBQUG/sAJGgn+wAkLERIHASoBKgkZEgj+wAkaCf7ACQAABAAAAAAC/gKIAAoAFAAeACYAACUhESE2HgEUDgEnJSEWPgE0LgEHITMhESEeAhQOASUzPgE0JicjAmT+pQFcKEgpKUgo/uEBHxgqGBgqGP7h2/7oARgnQSYmQf7+2yMvLyPbeAEnASdFUUYmAT0BFykvKRYBAScBKUJOQyg8ATJFMgIAAwAAAAADPAKYABEAHQAqAAAlIiY0PwEnJj4BMh8BFhQPAQY3ISImNDYzITIWFAYXIiY1ETQ2MhYVERQGAiQNEgl4eAkBERkJjgoKjgmC/jINEhINAc4MEhJeDBISGRIS0xIaCXh4ChgSCI4JGgmOCY4SGRISGRL5Eg0B8g0SEg3+Dg0SAAAAAAEAAAAAArkCpwAPAAABBR4BPgE1ETQuAQYHBQYUAVUBIgkXFQwMFRcJ/t4NAWL9CAMJFAwB+gwUCQMI/QwkAAABAAAAAANfAkAAEwAAJSInCQEOAS4CNjcBNjIXARYUBgNADQn+1v7WBhAQDAQEBgFACRoJAUAJEsAJAS3+0wYEBAwQDwYBQwkJ/r0JGRIAAAEAAAAAArkCpwAPAAABJS4BDgEVERQeATY3JTY0Aqv+3gkXFQwMFRcJASINAZ79CAMJFAz+BgwUCQMI/QwkAAABAAAAAALBAt8AEQAAJSImNDcJASY0NjIXARYUBwEGAV8NEgkBLf7TCRIZCQFDCQn+vQkhEhoJASoBKgkaEgn+wAkaCf7ACQAEAAAAAANfAt8AFAApADoAPQAAJSInJicmNDc2NzYyFxYXFhQHBgcGAyIHBgcGFBcWFxYyNzY3NjQnJicmAyIuATURND4BMh8BFhQPAQYTFTcCAF9STy8wMC9PUr5STy8wMC9PUl9PQ0EnJycnQUOeQ0EnJycnQUOQBw4JCBARB9UODtUIFX8hMC9PUr5STy8wMC9PUr5STy8wAoAnJ0FDnkNBJycnJ0FDnkNBJyf+MggOCQEcCQ4IBY4KIAqOBQECqlUABAAAAAADXwLfABIAIgAxAE0AACUiLwEmND8BNjIeAQ8BFx4BDgEFISImNRE0NjMhMhYVERQGASIGFREUMyEyNjURNCYjAyEiJjQ2MyEWPgE0LgEHIyImNDY7ATYeARQOAQGdDQlHCQlHCRkRAQkxMQcEBxABdv3IHCcnHAI4HCcn/awCAwUCOAIDAwLO/wAMEhIMAQAVJhUVJhUqDRISDSomQyYmQ9wJRwkZCUgIEhkJMDIGExIKuyccAjgcJycc/cgcJwKAAwL9yAUDAgI4AgP+eRIZEgEUJCokFAESGRICJEFMQSQAAAIAAAAAA2ECwgApAD4AACUiJyYnLgE3Njc+ARcWFxYXFg4BJicuAw4CHgM2Nz4BHgEHDgETIi8BLgI+Ah8BNz4BHgEPAQ4BAdxTSEYqLAcmJENEpktJMDIKAhAZFQEIQGN2bFAjEkJndWsnCRkTAgkte9kGBrEJDAMHDhEIlTwFGBcKBUcDEEUpJ0VGpkpHLi4OIiJBQlMMFQMQDTphPQoqVXFzYDkHLSwKAREZCjM3AUACRwINEhAKAgQ8lgwJChcLsgkKAAAABgAA/9cDfQMpAAsAHgAoADUAQQBPAAAFISImNDYzITIWFAYlIiYvASY0PwE2MhcBFhQPAQ4BJxYyPwEnBwYUFyUiLwEmNDYyHwEWFAYXBwYiLwEmNjMhHgEXBwYUHgEyPgE0LwEmIgNY/VAPFRUPArAPFRX+fhMjDdccHPQQLRABEBAQ8w4jIwcTB+f45wcHAXkPCtcLFh0L1woVU8oRMRLKBQYIAdcIBSgnBw8aHhoQCCcDDigVHhUVHhWHDg7XG08c9BAQ/vAQLhDzDg5PBwfm+OcHEwaEC9YLHhUL1gseFarLERHLBg4BDk1DDR4aDw8aHg1DBgAEAAAAAANfAt8AFAApADYAQgAAJSInJicmNDc2NzYyFxYXFhQHBgcGAyIHBgcGFBcWFxYyNzY3NjQnJicmAyImNRE0NjIWFREUBjchIiY0NjMhMhYUBgIAX1JPLzAwL09SvlJPLzAwL09SX09DQScnJydBQ55DQScnJydBQ08NEhIaEhKC/uINEhINAR4NEhIhMC9PUr5STy8wMC9PUr5STy8wAoAnJ0FDnkNBJycnJ0FDnkNBJyf+MRINAR4NEhIN/uINEo8SGhISGhIAAAAAAwAAAAADXwLnABIAIQAxAAAlIi4CND4DHgIVFAcGBwYDIg4BHgI+ATU0JyYnJgciJjUnND4BMh4BFRcUBiMCAEaBYjY1Y4GLgmI2MC9PUl9YkkMifK2iYScnQUNNDBIFBw4RDgkFEQ0pNWKCi4FjNQE2Y4BGX1JPLzACgGGjrHwiQ5JYTkRBJijZEQ3MCQ4JCA4IzQwTAAADAAAAAANfAt8AFAApADUAACUiJyYnJjQ3Njc2MhcWFxYUBwYHBgMiBwYHBhQXFhcWMjc2NzY0JyYnJhMhIiY0NjMhMhYUBgIAX1JPLzAwL09SvlJPLzAwL09SX09DQScnJydBQ55DQScnJydBQ0D+4g0SEg0BHg0SEiEwL09SvlJPLzAwL09SvlJPLzACgCcnQUOeQ0EnJycnQUOeQ0EnJ/7AEhoSEhoSAAAABAAAAAADPQK7AB8AMwA0AEMAAC0BIiY1EzQ2OwEyFgYrASIVAxQXBTI9ATQ2MhYVBxQGATIWHQEzNh4BFA4BJyMiJj0BNDYXATYWFAcBDgEuAjY3ATYC/v4CGCMCIxj/EBAQEP8EAgQB/gQRFxABI/7nDBCDCA4ICA4IjRMaEB0BEgsQCP7lBQ4QCwMFBgEaCEQCIxkB/hgjHBsF/gMEAQIF/wsQEAz+GSMB6BALhAEHDg8OBwEbEo4LEJ8BKAERFwj+6AYFAwsQDwQBGQgAAAMAAAAAA2AC3wAtAE0AUQAAJSMiJw4BKwEiJjURNDY7ATIWHQEzMjY3Njc+ATsBHgIVFgczMh4BFRQPAQ4BJzMyNj8BNiYnJisBIiY3NicuASsBIgYHBgcOASsBERYHMxEjAnuWPzsDEAqODRISDY4NEhsNFQQUEwg8JgYeMh8CA0YcLxsDOg9d0ZYmPAo5AgUHDBFnDRIBBgIBHRUFERoEFBUKNSEbOshRUSEVCQwSDQGrDBISDAUPDDtOJTABHTIeJUMbLxwMDOg5ST4vJegKFAgMFA1BQhQdFRBUOx8m/s8YAQFtAAADAAAAAANfAt8AIwAzAEMAACUhIiY9ATQ2MhYdARQWMyEyNjURNCYrASImNDY7ATIWFREUBichIiY1ETQ2MyEyFhURFAYBIgYVERQWMyEyNjURNCYjAxz+5BsnEhkSAwIBHAIDAwKxDRISDbEcJyfx/p0cJyccAWMbJyb+gQIDAwIBYwIDAwIhJxyxDRISDbECAwMCARwCAxIZEicb/uQcJ9YnGwFjHCcnHP6dHCYBqgMC/p0CAwMCAWMCAwAAAAADAAAAAANfAt8AIwAzAEMAAAEjIiY1ETQ2MyEyFh0BFAYiJj0BNCYjISIGFREUFjsBMhYUBgEhIiY1ETQ2MyEyFhURFAYBIgYVERQWMyEyNjURNCYjAZWxHCcnHAEcGycSGRIDAv7kAgMDArENEhIBev6dGycmHAFjHCcn/oECAwMCAWMCAwMCAT4nGwEcHCcnHLENEhINsQIDAwL+5AIDEhkS/uMnHAFjHCYnG/6dHCcBqwMC/p0CAwMCAWMCAwADAAAAAAOMAp4ADAAZAD0AADcGJjQ3ATYeAgcBBiEiJwEmND4BFwEWFAYBFSM2NzY3Njc2NzYmIgcGFyc+ATc2FzYXFhUUBwYHBgcOAQdjDRIJAe8JFxACCP4TCQHiDQn+EQgSGQkB7QkRAS2yAw4ZIBcTCgEBFR0LCwEzAQ4NGyEjGhcGCAwQEhgMBBMBExkJAe4IAhEXCf4SCQkB7gkZEQEJ/hIJGRIBri8cFyMcFBcOEQ8VCg4SBREfDBMBAhYWHxEREhASDxYOCAADAAAAAANgAt8ALQBOAFIAACUjIiYnJicuAScjFRQGKwEiJjURNDY7ATIWFzY7ATIWHwEWFRQOASsBFgcOAicyNjc2JyY2OwEyNz4BLwEuASsBIgcRMzIWFxYXHgE7ASUzESMCRQYmPAgTFAQVDRsSDY4NEhINjgoQAzs/ljtdDzoDHC8bRgMCAR4zHRQdAQIGARIOZhEMBwYDOQk8JpY+OhshNQsUFQMaEQX+mlFRITAlTjoMDwEFDRISDQGrDRIMCRVJOegMDBwvHDYyHjEdPRwVQUINFAwHFQrnJS8Y/s4mHzxSERXWAW0AAAMAAAAAA18C4AAfACgARAAAJSEiJjURNDY7ATU0NjIWHQEzNTQ2MhYdATMyFhURFAYBERQzITI2NRElITU0JisBFRQOASIuAT0BIxUUBiImPQEjIgYVAxz9yBwnJxxvEhoS3hIaEm8cJyf9pwUCOAID/b4CQgMCbwgPEA4J3hIaEm8CAyEnHAHxHCcpDBISDCkpDBISDCknHP4PHCcBiP67BQMCAUU9bwIDKQgOCQkOCCkpDRISDSkDAgAABQAAAAADPAK2ABMAJwA0AEQAVAAAASMiJjQ2OwEyNj0BNDYyFh0BFAYhIyImPQE0NjIWHQEUFjsBMhYUBhciJjURNDYyFhURFAYDIi4BNj8BPgEeAgYPAQYzIi8BLgE+AhYfAR4BDgEC+WsNEhINawIDEhkSJ/5eaxsnEhkSAwJrDRISgQ0SEhoSElYJEAcEBpIGEBEMBAUGkgmFDQmSBgUEDBEQBpIGBAcQAaMSGRIDArIMEhIMshsnJxuyDBISDLICAxIZEkcSDAEdDBISDP7jDBL+7woREgeSBgUEDBAQBpIJCZIGEBAMBAUGkgcSEQoAAAMAAAAAA4wCPgAMABkAPQAANwYmNDcBNh4CBwEGISInASY0PgEXARYUBiUVIzY3Njc2NzY3NiYiBwYXJz4BNzYXNhcWFRQHBgcGBw4BB2MNEgkB7wkXEAII/hMJAeINCf4RCBIZCQHtCREBLbIDDhkgFxMKAQEVHQsLATMBDg0bISMaFwYHDRARGA0EEwETGQkB7ggCERcJ/hIJCQHuCRkRAQn+EgkZEikvHBcjHBQXDhEPFQoOEgURHwwTAQIXFR8SEBMPEhAWDQgAAAgAAAAAA2AC3wAUACsAPwBTAGAAbQB8AIsAABMiJj0BNDY7ATIWFAYrASIGHQEOASEiJj0BNCYrASIuATQ+ATsBMhYdAQ4BASMiJj0BNDYyFh0BFDsBMhYUBiMlIyImNDY7ATI2PQE0NjIWHQEOASciLwEmNDYyHwEWFAYlIiY0PwE2MhYUDwEGASImND8BPgEeAgYPAQYjIi8BLgE+AhYfARYUBsANEiccjw0SEg2PAgMBEQJzDRIDAo4IDgkJDgiPHCcBEv4ljhwnEhoSBY8NEhINAamODRISDY8CAxIaEgEnCQwJywkSGgnLCRP9iA0SCcsJGRIIywkBkwwSCcsFERAMBAUGygnjDQnLBgUFCxEQBssJEgHvEg2OHCcSGhIDAo8MEhINjgIDCA8QDgknHI8NEf4yJxyODRISDY8FEhoSARIaEgMCjg0SEg2PHCYLCcsJGRIJywkZEwESGQnLCBIYCcsJAaASGQnLBwQEDBAQBssJCcsGEBAMBAQHywkZEgACAAAAAAMYAt8AFQAkAAAlIi4BNRE0NjMhMhYVERQOASIvAQcGNzIfARE0JiMhIgYVETc2AQcIDgknHAGqHCcJDhAH6uoH8QgHywMC/lYCA8sHIQkOCAJcHCcnHP2kCA4JBIaGBMwEcwImAgMDAv3adAMAAAgAAAAAA2EC4QAUACoAPwBTAGAAbQB8AIsAACUiJj0BNCYrASImNDY7ATIWHQEUBgMjIi4BND4BOwEyNj0BNDYyFh0BFAYTIiY9ATQ2OwEyFhQGKwEiBh0BFAYTIyImPQE0NjIWHQEUFjsBMhYUBhMiLwEmNDYyHwEWFAYhIiY0PwE2MhYUDwEGASImND8BPgEeAgYPAQYjIi8BLgE+AhYfARYUBgGODRIDAo4NEhINjhwmEjCOCA8ICA8IjgIDEhkSJt0NEiccjgwSEgyOAgMSpY4cJxIaEgMCjgwSEh8NCcsIEhkJywkS/XMNEgnLCRkSCMsJAagNEgnLBhAQDAUFBssJ9w0JywYFBQwQEAbLCRI8Eg2OAgMSGRInG44NEgGHCA4RDggDAo4NEhINjhsn/nkSDY4bJxIZEgMCjg0SAYcnG44NEhINjgIDEhkS/l4JywkZEgjLCRoSEhoJywgSGQnLCQG1EhoJywYFBQwQEAbLCQnLBhAQDAUFBssJGhIAAAAEAAAAAANdAt0AIAA2AEoASwAAJSImJy4BNj8BPgEXJjY/AT4BHgIGDwEOAScWBg8BDgEnFjI/AT4BJwcGIiY0PwEmBg8BBhQXARY2PwE2LgIPAQ4BFzc2HgIHFwFFHzkWHhUVHlkfVCkMFB9ZHlFQPBUVHlkfVCkMFB9ZFjljHE8cWBYKDS4JGhMKLRs7FVkbGwE1GzwWWRoBNk4cWBYKDR0JFxACB2cpGBYeUFEeWR8UDClUH1keFRU8UFEeWR4VDClUH1kWGFkbG1kWPBsuChMaCS4MChVYHE8cAQoNChZYHE42ARpaFjwbHQcCEBcJIAAACAAAAAADXwLfAA8AEwAkACgAOAA8AE0AUQAAJSMiJj0BNDY7ATIWHQEUBiczNSMHIyImPQE+ATsBMhYdARQGIyczNSMlIyImPQE0NjsBMhYdAQ4BJzM1IwcjIiY9ATQ2OwEeAR0BFAYjJzM1IwNA+Q0SEg35DRIS57y8rPoNEgESDPkNEhIN2ru7AmH5DRISDfkNEgES5ry8rPoNEhIN+QwSEgzau7shEg35DRISDfkNEj67+RIN+QwSEg34DRI+u48SDfgNEhIN+QwSPbv4Eg34DRIBEgz5DBI9uwAAAAAJAAAAAANjAsMALABDAE8AWwB+AI0AmgCjAKwAACUiJicmPgEWFx4BPgMuAg4CBw4CLgI3Njc2NzYWFxYXFgYHBgcGIwEiJi8BJj4CHgEfATc2HgIOAQ8BBhcGLgE+Ah4BFRYGJyIOAR4CPgE1NCYHIiYnJjYeAjMyNj0BNC4BIg4BFgYiJjUmPgEyHgEHFRYGMyImPQEmPgEyHgEHFRQGJyIGFxUGFjYnNTQmIxciJjQ2MhYUBiciBhQWMjY0JgIkRHwtCAETGggnbHRnQhIjT211ZEAHAQoPEQ0HAQsxMElMpkRDJCYHLCpGSVP+5AkQA0cEAgoQEA4DO5YIEQ0GAgsIsgbTEh0OBxgiIBMBIRcIDgcDCxAPCQ8KEh0FBAwSBQ0ICg8GDA4MBwEJDQkBDxofGw4BASFTExwBDBcbFg0BHBQHCgECEhIBCgdRCxAQFg8PCwMEBAUEBEU4MwkaEQIKLCwGOmBycVUqCjxiOggNBwIKDwlSQ0AiIw4uLkdKp0ZEKCkBQAoJsgcRDQcDCgiVOwMBCw8RDQNHAk0BEyAiGQcNHREYIVMIDxALBAYOCAoPhRURCA8EEQkQCjMHDAgIDA4JCQcPHBAQHA8yGCIcFEUNGA0NGA1FEx2FCgdECwsLC0UHChwPFw8PFw8hBAUEBAUEAAABAAAAAAMyAuYARQAAJQYuATY/AT4BFh8BHgEGDwEOASYvAS4BNj8BPgEeAgYPAQYUHwEWMj8BPgEmLwEuAQ4BDwEOAR4CNj8BNjIWFA8BDgEBy0t9Oh415SFZWSIDIhcXIu8UNDQUAhMODRP7BhERDQQGCPoNDQEMIQzwFRAQFQMQKSwpEOQkGRlIX2AjjQkZEgmLI1shAVOLlDTlIhgWIQMiWloh8BMODBMDEzQ0FPsHBgQMEhEF+gwiDAILC/EWOjsWAhAQAREQ5SRfYEcZGSSMCRIZCY0jJQAABQAAAAADhAJHACUAMwBEAFMAYQAAASInJicmLwEmPgEeARcWFxYXFjMyNzY3Njc+AR4BBwYHBgcGBwYlIi4BNj8BPgEeAQ8BBiEiLwEuAT4CFh8BHgEOASMFIicuAT8BPgEeAQ8BDgElIi8BJj4BFh8BFgYHBgIAY1ZAMxsUAQYIFxgKDxkfKzA9QVVLNiwYCgYYFwgGBBMdJDI6R/5NCQ8HAwZfCRgSAgdgCQK6DglgBgUFDREQBl8GAwcPCf3yBwYMCQY7BRgWCQQ7BA8BSxEJTQYGFRgHTQcFCwgBMjYoQSIjAgwYCwgWFSUfKhgfMyQ6HxULCAsYDAodKyQxHCMFChESBmkIARAYCmkKCmgGERAMAwYHaQcSEQp6AwUYDIELCQsXC4IICgoOeAoZDQUKeAsYBwUACQAAAAADYQLCACkAPgBHAFMAdACBAI4AmgChAAAlIicmJy4BNzY3PgEXFhcWFxYOASYnLgMOAh4DNjc+AR4BBw4BEyIvAS4CPgIfATc+AR4BDwEOAQUiJjQ2MhYUBiciDgEeAj4BNTQmByImJyY+ARYXHgE+AT0BNCYiBhUUBiImNTQ2MhYdARYGMyImPQE0NjIWHQEUBiciBh0BFBYyNj0BNCYXIi4BPgIeARUUBiciBhY2NCYB3FNIRiosByYkQ0SmS0kwMgoCEBkVAQhAY3ZsUCMSQmd1aycJGRMCCS172QYGsQkMAwcOEQiVPAUYFwoFRwMQ/okZIyMyIyMZCQ4HAw0REAoRDBMfBgIGDAwCBBITDhEYEQkNCSMyIwEkXBUeHiseHhYIDAwQDAxSCQ4GAwwRDwoRCwUEBwkERSknRUamSkcuLg4iIkFCUwwVAxANOmE9CipVcXNgOQctLAoBERkKMzcBQAJHAg0SEAoCBDyWDAkKFwuyCQpKIzIjIzIjWQoQEQ0DBw4JDBGPFxIGDAQGBgkJAxAKNAwREQwGCQkGGSMjGTQaJB4VSBUeHhVHFh6PDAhHCQwMCUcIDB4JEBEMAwcOCAwQIwkHBAgEAAAAAgAAAAADUgLSAAwAGAAAJSImNRE0NjIWFREUBgEhIiY0NjMhMhYUBgIADRISGhISASb9mg0SEg0CZg0SEi4SDQJmDRISDf2aDRIBMxIaEhIaEgAABQAAAAADNgK8ABQAKAA0AEEATgAAASImPQE0JisBIiY0NjsBMhYdARQGAyMiJjQ2OwEyNj0BNDYyFh0BFAYTISImNDYzITIWFAYFIi8BJjQ2Mh8BFhQGIyImND8BNjIeAQ8BBgG/DRIDArIMEhIMshsnEjCyDBISDLICAxIZEidQ/uMMEhIMAR0MEhIBBQ0JkgkSGQmSChOeDRIJkgkZEQEJkgkB7xINawIDEhkSJxtrDRL+VhIZEgMCaw0SEg1rGycBHBIaEhIaEkkJkgkaEgmSCRoSEhoJkggSGQmSCQAEAAAAAANkAnUAHgA0AEEASgAAJSInJicmLwEmNzY3Njc2MzIXFhcWHwEWDwEGBwYHBiUWFxYXFjI3Njc2NyYnJicmIgcGBwYFIi4BPgIeARUUDgEnIgYUFjI2NCYCAGRXPzQbEgEHBw0cM0BZZ2RXPzQbEgEHBwESGzQ/V/5/FhwsM0OSQzMsHRUWHCwzQ5JDMywcAQcfNBcMLDw6IhsvHBEYGCIYGIw3KEEiIwEODhslQyk6NyhBIiMBDg4BIyJBKDf0IyAxHSYmHTEgIyMgMR0mJh0xIIkiOjwsDBc0HxwvG48YIhgYIhgAAAQAAAAAAy8C0QARADAANAA4AAAlISImNRE0PwE2MyEyFhURFAYnMzI1ETQrARUUBisBIiY9AQcRFBY7ATU0NjMhMhYVBTM1IxMzNSMC7v4kGiYJiAgNAXYaJiZhRwMDaRINzA0SbAIBRxINARANEv7w0tIijo4wJhoBugwJiQkmG/3gGiY9AwIfBGkNEhINX2z+UwECrQwSEgytjgFNSwAGAAAAAANOAtIAGQAnADcAOwBIAFUAAAEhIiY9ATQ2OwE1NDY7ATIWHQEzMhYdARQGJSE1IyImPQEjFRQGKwEBISImNxM+ATMhMhYXExYGJSEnIRciJj0BNDYyFh0BFAYzIiY9ATQ2MhYdARQGAy79pA0SEg3XEg1wDRLXDRIS/bYCH9gMEjQSDNgCI/3aDhMCJAERDAHgDBEBJAIT/e8B4Bv+VnwNEhIaEhKlDRISGhISATkSDK4NEo8NEhINjxINrgwSPm8SDY+PDRL+SRUOAQoLDw8L/vYOFT3N+BIMawwSEgxrDBISDGsMEhIMawwSAAAAAgAAAAADGgLhABQAIQAAASIvAQcOAS4CNj8BNjIfAR4BDgEBIiY1ETQ2MhYVERQGAvkNCePjBhAQDAQEBvkJGgn5BwQHEf75DBISGRISAakJ5OMGBQQMEBEF+QkJ+QYTEgr+dxIMAoANEhIN/YAMEgAAAAAEAAAAAAMYAt8AFAA4AEgAUgAAJSImNRE0JisBIiY0NjsBMhYVERQGByEiJicRPgE7ATIWFAYrASIGFREUFjMhMjY9ATQ2MhYdAQ4BAyMiJj0BNDY7ATIWHQEUBiczNTQmKwEiBhUC+Q0SAwJqDRISDWocJxIx/lYcJgEBJhxqDRISDWoCAwMCAaoCAxIaEgEmhtYMEicbjhsnEsOYAwKOAgOKEg0BrAIDEhoSJxz+VA0SaSccAfEcJxIaEgMC/g8CAwMCjg0SEg2PHCYB8hINahwnJxxqDRI9TAIDAwIAAAMAAAAAA2QCuwAoADgAPAAANyImNRE0NjsBMh8BFjsBMhYdARQGIiY9ATQmKwEiLwEmKwEiBhURFAYpASImNxM+ATMhMhYHAw4BJSETIcQMEicbjxwTVgECuBwmEhkSAwK4HBNWAQKPAgMSAgT97BETB48EDwkB8hASBWwDEP4QAdBW/k1FEg0CFBsnE1YBJxxqDRISDWoCAxNWAgMC/ewNEhwPAUAIChoP/sEKCz0BAwAAAAMAAAAAA2YC3wAPABsAMAAAJSEiJjURNDYzITIWFREUBiUWMyEWNxEmByEmBwEiJjURJiMhIiY0NjMhMhYVERQGIwJ0/nYhLy8hAYoiLi7+QgkJAYoLCAgK/nUKCAJvDRIJCf5FDRISDQG7IS8SDCEnHAGqHCYmHP5WHCdDBQEHAagHAQEI/oASDQHxBRIaEicc/g8NEgAAAwAAAAADFwLfABMAJQAoAAAlISImJxE+ATsBMjMWHwEWFxEUBgEiBhURFBYzITI2NREjIiY9ARczJwLV/lYcJgEBJhz8AgIIBtYFAib+OwIDAwIBqgIDtg0SPW1tISccAjgcJwIG1wUI/nEbJwJ/AwL9yAIDAwIBaBINtphtAAACAAAAAANhApoAEwAfAAAlIiY0PwEnLgE+AhYfARYUDwEGNyEiJjQ2MyEyFhQGAkkNEgnj4wYFBAwQEQX5CQn5Cen9gAwSEgwCgA0SEmgSGgnj4wYQEAwEBAb5CRoJ+Qn1EhkSEhkSAAIAAAAAA2ECmgATAB8AACUiLwEmND8BPgEeAgYPARcWFAYlISImNDYzITIWFAYBtwwJ+QkJ+QUREAwEBQbj4wkSAX79gA0SEg0CgAwSEmgJ+QkaCfkGBAQMEBAG4+MJGhL1EhkSEhkSAAAAAAIAAAAAAxoC4QAVACIAACUiLwEuAT4CFh8BNz4BHgIGDwEGJyImNRE0NjIWFREUBgIADQn5BgQEDBAQBuPjBhAQDAQEBvkJEgwSEhkSEiAJ+QUREAwEBQbj4wYFBAwQEQX5CQQSDQJ/DBISDP2ADREAAAAABAAAAAADPALiAB0ALgBIAFgAACUiJy4BJyYnAyY+Ah4BFxM2Nz4BFx4BFxYOAQcGJxYXFjc+AScmJyYOAR8BFhcFIicuAjc+ATc2FhcWFxM+AR4BBwEOAQcGNyIHBgcGFhcWNzY3NiYnJgLNFBIbKgsDA/wDAgkPEA4D0RAcFCoUHCkLEAMiHRVSDRwSERYMDQ0hESQOBwYDAf6dGBUcIQMOCykbFSsUHBDRBRgXCQX+/QspGxMDCQkfDQwMFRERIAwNDRQIIQcLKhsICQIqCBAOBgEKB/41Gw0JAggLKRsjSDkOC2cbDAgICjoeIQ4HEDEbDQMEaAsOOUcjHCkLCAIJDhsBzAsJChgM/cUbKgsH1gMOIB47CggIDSAeOwoEAAAAAAMAAAAAA4wCPgAMABkAPQAANwYmNDcBNh4CBwEGISInASY0PgEXARYUBiUVIzY3Njc2NzY3NiYiBwYXJz4BNzYXNhcWFRQHBgcGBw4BB2MNEgkB7wkXEAII/hMJAeINCf4RCBIZCQHtCREBLbIDDhkgFxMKAQEVHQsLATMBDg0bISMaFwYHDRARGA0EEwETGQkB7ggCERcJ/hIJCQHuCRkRAQn+EgkZEuIvGxcjHRMYDRIPFAoOEgURIAsTAQMXFSARERIPEw8WDgcAAAMAAAAAA18C3wAiADIAQgAAJSEiJjURNDY7ATIWFAYrASIGFREUMyEyNj0BNDYyFh0BFAYTISImNRE0NjMhMhYVERQGASIGFREUFjMhMjY1ETQmIwJH/p0cJycc+A0SEg34AgMFAWMCAxIZEie6/uQbJycbARwcJyf+yAIDAwIBHAIDAwIhJxwBYxsnEhkSAwL+nQUDAvgNEhIN+BwnAR0nGwEcHCcnHP7kGycBYwMC/uQCAwMCARwCAwAAAwAA//wDtwMEABMAIQAqAAAlAS4BByYGBwEGHgI3IRY+ATQnATQ+ATIeARURFAYiJjUXIi4BNjIeAQYDrf6JBh0REB0G/oAGAhIYCAMJChYRCv4fDhgcGA4eLB40FyEBIS8hASJaAokPEQICEQ/9aAcbHQ8DAhAdIg4BvA4YDg4YDv70FR8fFcghLyEgLyIACQAAAAADXwLmABwANwBEAFAAXABpAHYAgwCSAAAlIi4BNj8BNjIWFA8BDgEeAjY/ATYyFhQPAQ4BASImND8BNi4CDwEGIiY0PwE+AR4CBg8BBiUiJj0BNDYyFh0BFAYHIyImNDY7ATIWFAYFIyImNDY7ATIWFAYHIiY9ATQ2MhYdARQGNyIvASY0PgEfARYUBiUiJjQ/ATYyHgEPAQYnIi8BLgE+AhYfARYUBgE4KkUgEB50CRkSCXQOCwsdJycPcwkaEglzFDMBTQ0SCXQUASs9F3MJGhIJcxpHSDQTExp0Cf7pDBISGRISm0cNEhINRw0SEgIsRw0SEg1HDRIS4g0SEhkSEpwMCUcIERgJRwkR/rQNEglHCRkRAQlHCb4NCUcGBQQMERAFSAkTPi5NUh10CRIZCXQOKCcdCgoPcwkSGQl0ExUBPBIZCXQXPCsCFXQJEhoJdBoTEzRHRxp0Cd4SDUcMEhIMSA0RjhIZEhIZEtYSGhISGhLVEg1HDRISDUcNEi0JRwkYEQEHRwkaEvgSGglHCBIYCkcJ+QlHBhARCwUFBkcJGhIAAAADAAAAAANDAsQAFgAkADIAACUiJwEmNDc+ARc3NjIfARYUDwEWBgcGCQE+AScmPwEnBwYnJgYDIi4BNj8BNh4CDwEGAlYNCf6GCQkzh0Z7CRkJzgkJewosMgn+pwFLIBcLAwtwonAMEDNlQgkQBwQHnwkZEQEJnwk9CQF6CRoJMiwLewkJzgkaCXtGhzIJAZf+tSllMxAMcKJwCwMLF/5YChETBp8JAREZCZ8JAAAAAAAAEgDeAAEAAAAAAAAAEwAAAAEAAAAAAAEACAATAAEAAAAAAAIABwAbAAEAAAAAAAMACAAiAAEAAAAAAAQACAAqAAEAAAAAAAUACwAyAAEAAAAAAAYACAA9AAEAAAAAAAoAKwBFAAEAAAAAAAsAEwBwAAMAAQQJAAAAJgCDAAMAAQQJAAEAEACpAAMAAQQJAAIADgC5AAMAAQQJAAMAEADHAAMAAQQJAAQAEADXAAMAAQQJAAUAFgDnAAMAAQQJAAYAEAD9AAMAAQQJAAoAVgENAAMAAQQJAAsAJgFjQ3JlYXRlZCBieSBpY29uZm9udGljb25mb250UmVndWxhcmljb25mb250aWNvbmZvbnRWZXJzaW9uIDEuMGljb25mb250R2VuZXJhdGVkIGJ5IHN2ZzJ0dGYgZnJvbSBGb250ZWxsbyBwcm9qZWN0Lmh0dHA6Ly9mb250ZWxsby5jb20AQwByAGUAYQB0AGUAZAAgAGIAeQAgAGkAYwBvAG4AZgBvAG4AdABpAGMAbwBuAGYAbwBuAHQAUgBlAGcAdQBsAGEAcgBpAGMAbwBuAGYAbwBuAHQAaQBjAG8AbgBmAG8AbgB0AFYAZQByAHMAaQBvAG4AIAAxAC4AMABpAGMAbwBuAGYAbwBuAHQARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIoBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMBFAEVARYBFwEYARkBGgEbARwBHQEeAR8BIAEhASIBIwEkASUBJgEnASgBKQEqASsBLAEtAS4BLwEwATEBMgEzATQBNQE2ATcBOAE5AToBOwE8AT0BPgE/AUABQQFCAUMBRAFFAUYBRwFIAUkBSgFLAUwBTQFOAU8BUAFRAVIBUwFUAVUBVgFXAVgBWQFaAVsBXAFdAV4BXwFgAWEBYgFjAWQBZQFmAWcBaAFpAWoBawFsAW0BbgFvAXABcQFyAXMBdAF1AXYBdwF4AXkBegF7AXwBfQF+AX8BgAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsACWFsbC1tYXRjaAdyZXBsYWNlCHNob3VjYW5nC3JlcGxhY2UtYWxsB3poaWh1YW4Gc2hhcGVzDnRleHQtdW5kZXJsaW5lEHNoYXBlLWNoYW5nZXNpemUPc2hhcGVzLWNhdGFsb2d5B2V4cGFuZDEOcHJpbnQtZGlzYWJsZWQFcHJpbnQGdW5sb2NrBmVtYWlsMQ1ib3JkZXItcGVuY2lsCmNvcHktZmlsZTEOYWRkLWZpbGUxLWljb24PYWRkLWZvbGRlci1pY29uDWFkZC1maWxlLWljb24EZmlsZQZsYXllcnMMY2FuY2VsLW1lcmdlBnJlbW92ZQthLXppeXVhbjQwOAVtZXJnZQ5lZGl0LXByb3BlcmllcwthLXppeXVhbjM5NQVwaG9uZQR1c2VyBnNlYXJjaApiYWNrZ3JvdW5kBGxvY2sGbG9ja2VkBWNsb3NlDGNvbnRyb2wtaWNvbgJvawVzaGFyZQdwdWJsaXNoB3NldHRpbmcGcmVkdWNlCGRvd25sb2FkBm1lcmdlMQRmbGlwBWFsaWduBGhhbmQJbGluay1saW5lCHNlbGVjdG9yCHBvc2l0aW9uBmFuY2hvcgdtb3ZlLXVwCW1vdmUtZG93bgpmb250LWFsaWduCG1vdmUtdG9wEHRleHQtYWxpZ24tcmlnaHQPdGV4dC1hbGlnbi1sZWZ0CG1pcnJvci1oDXNoYXBlLWFsaWduLWgLbW92ZS1ib3R0b20Sc2hhcGUtYWxpZ24tYm90dG9tDXNoYXBlLWFsaWduLXYQc2hhcGUtZXF1LWRpc3Qtdg9zaGFwZS1hbGlnbi10b3ARc2hhcGUtYWxpZ24tcmlnaHQEZm9udApmb250LWNvbG9yEHNoYXBlLWVxdS1kaXN0LWgQc2hhcGUtYWxpZ24tbGVmdAZlcmFzZXIEdGV4dAxhZGQtZm9udHNpemUDdXAyB2V4cGFuZDIHZXhwYW5kMwtmb250LWl0YWxpYwVkb3duMQ9mb250LWRlbGV0ZWxpbmUIYnRuLWRvd24JYnRuLWxlZnQxDWVxdS1ib3RoLXNpZGUPcmVkdWNlLWZvbnRzaXplBGZpbGwFbGVmdDIFZmlsbDEGYnRuLXVwCWxvY2stY2FzZQtlcXUtdXAtZG93bgdleHBhbmQ0BGJvbGQGcmlnaHQyCGJ0bi1sZWZ0B2J0bi11cDEJYnRuLXJpZ2h0CmJ0bi1yaWdodDEIYnRuLXBsYXkGcmV2ZXJ0BnJlbG9hZApmaWxsLWNvbG9yCWFkZC1sYXllcghyb3RhdGUtMAxyZWR1Y2UtbGF5ZXIGaW1wb3J0BGdvb2QLYS16aXl1YW40MDMLYS16aXl1YW40MDQOdGV4dC1zdWJ0eXBlLTEDYmFkCGNhbGVuZGFyC2NhbmNlbC1saW5rDnRleHQtc3VidHlwZS0zCnN1aXQtcmF0aW8EbWFyawthbGwtZGlzcGxheQRsaW5rBmdyb3Vwcwpyb3RhdGUtMjcwBmF0dGFjaAljbG9zZS1leWUJcm90YXRlLTkwA2FkZAxjYW5jZWwtbGluazIIb3Blbi1leWUEc2F2ZQVicnVzaAJ1cAljb3B5LWZpbGUGZm9sZGVyBXBhc3RlCG5ldy1maWxlBXJpZ2h0BGxlZnQEZG93bgNjdXQOdGV4dC1zdWJ0eXBlLTILYS16aXl1YW40MDcEd2FybgxjYW5jZWwtbGluazEEZGluZwAAAAAA') format('truetype'); } .icon { font-family: "iconfont" !important; font-size: 26px; width: 26px; height: 26px; color: #424242; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .icon-all-match:before { content: "\\e6ef"; } .icon-replace:before { content: "\\e6ea"; } .icon-shoucang:before { content: "\\e6e8"; } .icon-replace-all:before { content: "\\e6e3"; } .icon-zhihuan:before { content: "\\e6e0"; } .icon-shapes:before { content: "\\e63a"; } .icon-text-underline:before { content: "\\e700"; } .icon-shape-changesize:before { content: "\\e6d4"; } .icon-shapes-catalogy:before { content: "\\e6d5"; } .icon-expand1:before { content: "\\e6d6"; } .icon-print-disabled:before { content: "\\e6d7"; } .icon-print:before { content: "\\e6d8"; } .icon-unlock:before { content: "\\e6d9"; } .icon-email1:before { content: "\\e645"; } .icon-border-pencil:before { content: "\\e6da"; } .icon-copy-file1:before { content: "\\e63e"; } .icon-add-file1-icon:before { content: "\\e63f"; } .icon-add-folder-icon:before { content: "\\e640"; } .icon-edit-file:before { content: "\\e641"; } .icon-add-file-icon:before { content: "\\e642"; } .icon-file:before { content: "\\e638"; } .icon-layers:before { content: "\\e68a"; } .icon-cancel-merge:before { content: "\\e68b"; } .icon-remove:before { content: "\\e68c"; } .icon-a-ziyuan408:before { content: "\\e68d"; } .icon-merge:before { content: "\\e68e"; } .icon-edit-properies:before { content: "\\e68f"; } .icon-a-ziyuan395:before { content: "\\e690"; } .icon-phone:before { content: "\\e691"; } .icon-user:before { content: "\\e692"; } .icon-search:before { content: "\\e693"; } .icon-background:before { content: "\\e694"; } .icon-lock:before { content: "\\e695"; } .icon-locked:before { content: "\\e696"; } .icon-close:before { content: "\\e697"; } .icon-control-icon:before { content: "\\e698"; } .icon-ok:before { content: "\\e699"; } .icon-share:before { content: "\\e69a"; } .icon-publish:before { content: "\\e69b"; } .icon-setting:before { content: "\\e69c"; } .icon-reduce:before { content: "\\e69d"; } .icon-download:before { content: "\\e69e"; } .icon-merge1:before { content: "\\e69f"; } .icon-flip:before { content: "\\e6a0"; } .icon-align:before { content: "\\e6a1"; } .icon-hand:before { content: "\\e6a2"; } .icon-link-line:before { content: "\\e6a3"; } .icon-selector:before { content: "\\e6a4"; } .icon-position:before { content: "\\e6a5"; } .icon-anchor:before { content: "\\e6a6"; } .icon-move-up:before { content: "\\e6a7"; } .icon-move-down:before { content: "\\e6a8"; } .icon-font-align:before { content: "\\e6a9"; } .icon-move-top:before { content: "\\e6aa"; } .icon-text-align-right:before { content: "\\e6ab"; } .icon-text-align-left:before { content: "\\e6ac"; } .icon-mirror-h:before { content: "\\e6ad"; } .icon-mirror-v:before { content: "\\e6ae"; } .icon-shape-align-h:before { content: "\\e6af"; } .icon-move-bottom:before { content: "\\e6b0"; } .icon-shape-align-bottom:before { content: "\\e6b1"; } .icon-shape-align-v:before { content: "\\e6b2"; } .icon-shape-equ-dist-v:before { content: "\\e6b3"; } .icon-shape-align-top:before { content: "\\e6b4"; } .icon-shape-align-right:before { content: "\\e6b5"; } .icon-font:before { content: "\\e6b6"; } .icon-font-color:before { content: "\\e6b7"; } .icon-shape-equ-dist-h:before { content: "\\e6b8"; } .icon-shape-align-left:before { content: "\\e6b9"; } .icon-eraser:before { content: "\\e6ba"; } .icon-text:before { content: "\\e6bb"; } .icon-add-fontsize:before { content: "\\e6bc"; } .icon-up2:before { content: "\\e6bd"; } .icon-expand2:before { content: "\\e6be"; } .icon-expand3:before { content: "\\e6bf"; } .icon-font-italic:before { content: "\\e6c0"; } .icon-down1:before { content: "\\e6c1"; } .icon-font-deleteline:before { content: "\\e6c2"; } .icon-btn-down:before { content: "\\e6c3"; } .icon-btn-left1:before { content: "\\e6c4"; } .icon-equ-both-side:before { content: "\\e6c5"; } .icon-reduce-fontsize:before { content: "\\e6c6"; } .icon-fill:before { content: "\\e6c7"; } .icon-left2:before { content: "\\e6c8"; } .icon-fill1:before { content: "\\e6c9"; } .icon-btn-up:before { content: "\\e6ca"; } .icon-lock-case:before { content: "\\e6cb"; } .icon-equ-up-down:before { content: "\\e6cc"; } .icon-expand4:before { content: "\\e6cd"; } .icon-bold:before { content: "\\e6ce"; } .icon-right2:before { content: "\\e6cf"; } .icon-btn-left:before { content: "\\e6d0"; } .icon-btn-up1:before { content: "\\e6d1"; } .icon-btn-right:before { content: "\\e6d2"; } .icon-btn-right1:before { content: "\\e6d3"; } .icon-btn-play:before { content: "\\e683"; } .icon-revert:before { content: "\\e684"; } .icon-reload:before { content: "\\e685"; } .icon-fill-color:before { content: "\\e65d"; } .icon-add-layer:before { content: "\\e686"; } .icon-rotate-0:before { content: "\\e687"; } .icon-reduce-layer:before { content: "\\e688"; } .icon-import:before { content: "\\e689"; } .icon-good:before { content: "\\e664"; } .icon-a-ziyuan403:before { content: "\\e665"; } .icon-a-ziyuan404:before { content: "\\e666"; } .icon-text-subtype-1:before { content: "\\e672"; } .icon-bad:before { content: "\\e673"; } .icon-calendar:before { content: "\\e674"; } .icon-cancel-link:before { content: "\\e675"; } .icon-merge2:before { content: "\\e676"; } .icon-text-subtype-3:before { content: "\\e677"; } .icon-suit-ratio:before { content: "\\e678"; } .icon-mark:before { content: "\\e679"; } .icon-all-display:before { content: "\\e67a"; } .icon-link:before { content: "\\e67b"; } .icon-groups:before { content: "\\e65e"; } .icon-rotate-270:before { content: "\\e67c"; } .icon-attach:before { content: "\\e67d"; } .icon-close-eye:before { content: "\\e67e"; } .icon-rotate-90:before { content: "\\e67f"; } .icon-add:before { content: "\\e680"; } .icon-cancel-link2:before { content: "\\e681"; } .icon-open-eye:before { content: "\\e682"; } .icon-save:before { content: "\\e668"; } .icon-brush:before { content: "\\e667"; } .icon-up:before { content: "\\e669"; } .icon-copy-file:before { content: "\\e66a"; } .icon-folder:before { content: "\\e66b"; } .icon-paste:before { content: "\\e66c"; } .icon-new-file:before { content: "\\e66d"; } .icon-right:before { content: "\\e66e"; } .icon-left:before { content: "\\e66f"; } .icon-down:before { content: "\\e670"; } .icon-cut:before { content: "\\e671"; } .icon-text-subtype-2:before { content: "\\e660"; } .icon-a-ziyuan407:before { content: "\\e661"; } .icon-warn:before { content: "\\e662"; } .icon-cancel-link1:before { content: "\\e65f"; } .icon-ding:before { content: "\\e663"; } .ddei-editor { position: relative; width: 100%; height: 100%; overflow: hidden; display: flex; flex-direction: column; background-color: var(--background); } .ddei-editor .icon { color: var(--icon); width: 1em; height: 1em; vertical-align: -0.15em; fill: currentColor; overflow: hidden; } .ddei-editor img { -webkit-user-drag: none; user-drag: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .ddei-editor div { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .ddei-editor * { box-sizing: border-box; margin: 0; font-weight: normal; } .ddei-editor *::-webkit-scrollbar { width: 6px; height: 6px; } .ddei-editor *::-webkit-scrollbar-thumb { background-color: var(--scroll-hover); -webkit-box-shadow: inset1px1px0rgba(0, 0, 0, 0.1); } .ddei-editor *:hover::-webkit-scrollbar-thumb { background-color: var(--scroll-hover); -webkit-box-shadow: inset1px1px0rgba(0, 0, 0, 0.1); } .ddei-editor *::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-hover); -webkit-box-shadow: inset1px1px0rgba(0, 0, 0, 0.1); } .ddei-editor *::-webkit-scrollbar-track { -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0); background-color: var(--scroll-background); } .ddei-editor *::-webkit-scrollbar-track:hover { -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.4); background-color: var(--scroll-background); } .ddei-cut-img-div { width: 0.1px; height: 0.1px; display: flex; } .dialog-background-div { width: 100%; height: 100vh; opacity: 50%; z-index: 500; left: 0; top: 0; display: none; position: absolute; } /**以下是快捷样式编辑的弹出框 */ .ddei-core-dialog-quickpop[data-v-c4337de3] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; position: absolute; background-color: var(--panel-background); height: 80px; z-index: 990; user-select: none; color: var(--panel-title); } .ddei-core-dialog-quickpop .content[data-v-c4337de3] { width: 100%; max-height: 70px; overflow-y: hidden; display: flex; justify-content: start; align-items: center; font-size: 14px; } .ddei-core-dialog-quickpop .content .panel1[data-v-c4337de3] { margin-top: 20px; width: 170px; height: 70px; border-right: 1px solid var(--panel-border); } .ddei-core-dialog-quickpop .content .panel1 .panel1-content-1[data-v-c4337de3] { width: 100px; margin-left: 10px; float: left; } .ddei-core-dialog-quickpop .content .panel1 .panel1-content-2[data-v-c4337de3] { width: 50px; float: left; } .ddei-core-dialog-quickpop .content .panel1 .panel1-content-3[data-v-c4337de3] { width: 30px; padding-left: 10px; margin-top: 7px; float: left; } .ddei-core-dialog-quickpop .content .panel1 .panel1-split-3[data-v-c4337de3] { margin-left: 15px; } .ddei-core-dialog-quickpop .content .panel1 .panel1-content-4[data-v-c4337de3] { padding: 0px 5px; margin-top: 10px; float: left; border-radius: 2px; } .ddei-core-dialog-quickpop .content .panel1 .panel1-split-4[data-v-c4337de3] { margin-right: 5px; } .ddei-core-dialog-quickpop .content .panel1 .panel1-content-4[data-v-c4337de3]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel2[data-v-c4337de3] { margin-top: 10px; width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; text-align: center; border-right: 1px solid var(--panel-border); } .ddei-core-dialog-quickpop .content .panel2 .panel2-content[data-v-c4337de3] { flex: 1; border-radius: 4px; } .ddei-core-dialog-quickpop .content .panel2 .panel2-content[data-v-c4337de3]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel3[data-v-c4337de3] { margin-top: 10px; width: 150px; height: 60px; display: flex; justify-content: center; align-items: center; text-align: center; border-right: 1px solid var(--panel-border); } .ddei-core-dialog-quickpop .content .panel3 .panel3-content[data-v-c4337de3] { flex: 1; border-radius: 4px; } .ddei-core-dialog-quickpop .content .panel3 .panel3-content[data-v-c4337de3]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel3 .i1 .icon[data-v-c4337de3] { font-size: 20px; margin-top: 5px; margin-bottom: 2px; } .ddei-core-dialog-quickpop .content .panel3 .i2 .ddei-editor-quick-fat-item-box[data-v-c4337de3] { width: 22px; height: 26px; margin: 0 auto; margin-top: 4px; } .ddei-core-dialog-quickpop .content .panel3 .i2 .ddei-editor-quick-fat-item-box[data-v-c4337de3] .icon { flex: 0 0 22px !important; } .ddei-core-dialog-quickpop .content .panel3 .i3 .ddei-editor-quick-fat-item-box[data-v-c4337de3] { width: 22px; height: 28px; margin: 0 auto; margin-top: 3px; } .ddei-core-dialog-quickpop .content .panel3 .i3 .ddei-editor-quick-fat-item-box[data-v-c4337de3] .icon { flex: 0 0 24px !important; } .ddei-core-dialog-quickpop .content .panel4[data-v-c4337de3] { margin-top: 10px; padding-left: 10px; height: 60px; width: 150px; display: flex; justify-content: center; align-items: center; text-align: center; } .ddei-core-dialog-quickpop .content .panel4 .panel4-content[data-v-c4337de3] { margin-right: 10px; flex: 1; border-radius: 4px; } .ddei-core-dialog-quickpop .content .panel4 .panel4-content .icon[data-v-c4337de3] { margin-top: 2px; margin-bottom: 1px; } .ddei-core-dialog-quickpop .content .panel4 .panel4-content[data-v-c4337de3]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel5[data-v-c4337de3] { margin-top: 10px; height: 60px; padding-left: 10px; display: flex; justify-content: center; align-items: center; text-align: center; border-left: 1px solid var(--panel-border); } .ddei-core-dialog-quickpop .content .panel5 .panel5-content[data-v-c4337de3] { margin-right: 10px; flex: 1; border-radius: 4px; } .ddei-core-dialog-quickpop .content .panel5 .panel5-content .text[data-v-c4337de3] { white-space: nowrap; } .ddei-core-dialog-quickpop .content .panel5 .panel5-content .icon[data-v-c4337de3] { margin-top: 2px; margin-bottom: 1px; } .ddei-core-dialog-quickpop .content .panel5 .panel5-content[data-v-c4337de3]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel12[data-v-c4337de3] { margin-top: 20px; width: 225px; height: 70px; border-right: 1px solid var(--panel-border); } .ddei-core-dialog-quickpop .content .panel12 .panel12-content-1[data-v-c4337de3] { width: 100px; margin-left: 10px; float: left; } .ddei-core-dialog-quickpop .content .panel12 .panel12-content-2[data-v-c4337de3] { width: 50px; float: left; } .ddei-core-dialog-quickpop .content .panel12 .panel12-content-5[data-v-c4337de3] { padding-left: 5px; float: left; } .ddei-core-dialog-quickpop .content .panel12 .panel12-content-3[data-v-c4337de3] { width: 30px; padding-left: 10px; margin-top: 10px; float: left; } .ddei-core-dialog-quickpop .content .panel12 .panel12-split-3[data-v-c4337de3] { margin-left: 12px !important; } .ddei-core-dialog-quickpop .content .panel12 .panel12-content-4[data-v-c4337de3] { padding: 0px 5px; margin-left: 2px; margin-top: 12px; float: left; border-radius: 2px; } .ddei-core-dialog-quickpop .content .panel12 .panel12-split-4[data-v-c4337de3] { margin-right: 5px; } .ddei-core-dialog-quickpop .content .panel12 .panel12-content-4[data-v-c4337de3]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel6[data-v-c4337de3] { margin-top: 10px; padding-left: 10px; height: 60px; display: flex; justify-content: center; align-items: center; text-align: center; } .ddei-core-dialog-quickpop .content .panel6-content1[data-v-c4337de3] { margin-right: 10px; white-space: nowrap; flex: 1; border-radius: 4px; } .ddei-core-dialog-quickpop .content .panel6-content1 .icon[data-v-c4337de3] { margin-top: 2px; margin-bottom: 1px; } .ddei-core-dialog-quickpop .content .panel6-content[data-v-c4337de3] { margin-right: 10px; border-radius: 4px; } .ddei-core-dialog-quickpop .content .panel6-content .icon[data-v-c4337de3] { margin-top: 2px; margin-bottom: 1px; } .ddei-core-dialog-quickpop .content .panel6 .type[data-v-c4337de3] { width: 40px; padding-left: 5px; padding-right: 5px; } .ddei-core-dialog-quickpop .content .panel6 .type .ddei-pv-line-type-combox[data-v-c4337de3] { width: 22px; height: 28px; margin: 5px auto 1px auto; } .ddei-core-dialog-quickpop .content .panel6 .type .ddei-pv-line-type-combox[data-v-c4337de3] .icon { flex: 0 0 26px !important; } .ddei-core-dialog-quickpop .content .panel6 .color2[data-v-c4337de3] { padding-left: 5px; padding-right: 5px; width: 40px; } .ddei-core-dialog-quickpop .content .panel6 .color2 .ddei-editor-quick-fat-item-box[data-v-c4337de3] { width: 22px; height: 28px; margin: 5px auto 3px auto; } .ddei-core-dialog-quickpop .content .panel6 .color2 .ddei-editor-quick-fat-item-box[data-v-c4337de3] .icon { flex: 0 0 26px !important; } .ddei-core-dialog-quickpop .content .panel6 .dash[data-v-c4337de3] { width: 50px; margin-top: 8px; } .ddei-core-dialog-quickpop .content .panel6 .brush[data-v-c4337de3] { width: 50px; margin-top: 4px; } .ddei-core-dialog-quickpop .content .panel6 .brush[data-v-c4337de3]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel6 .pointtype[data-v-c4337de3] { width: 70px; margin-top: 4px; } .ddei-core-dialog-quickpop .content .panel6 .exchange[data-v-c4337de3] { flex: 0 0 20px !important; margin-top: -15px; padding: 0px 2px; } .ddei-core-dialog-quickpop .content .panel6 .exchange[data-v-c4337de3]:hover { background-color: var(--panel-hover); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel6 .exchange .icon[data-v-c4337de3] { font-size: 18px; } .ddei-core-dialog-quickpop .content .panel6-content[data-v-c4337de3]:hover { background-color: var(--panel-background); cursor: pointer; } .ddei-core-dialog-quickpop .content .panel6-content1[data-v-c4337de3]:hover { background-color: var(--panel-background); cursor: pointer; } .ddei-core-dialog-quickpop .brush-selected[data-v-c4337de3] { background-color: var(--panel-selected); } .ddei-ext-panel-search[data-v-75611720] { width: 500px; background-color: var(--panel-background); } .ddei-ext-panel-search .icon[data-v-75611720] { color: var(--icon); font-size: 18px; width: 18px; height: 18px; } .ddei-ext-panel-search-mode[data-v-75611720] { float: left; height: 32px; width: 24px; display: flex; align-items: center; justify-content: center; } .ddei-ext-panel-search-mode__expand[data-v-75611720] { height: 64px; } .ddei-ext-panel-search-mode[data-v-75611720]:hover { background: var(--panel-header); cursor: pointer; } .ddei-ext-panel-search-box[data-v-75611720] { float: left; height: 30px; width: 200px; display: flex; align-items: center; justify-content: center; background: var(--panel-header); border: 0.5px solid var(--panel-hover); } .ddei-ext-panel-search-box[data-v-75611720]:hover { background: var(--panel-header); cursor: pointer; border: 0.5px solid var(--dot); } .ddei-ext-panel-search-box-input[data-v-75611720] { flex: 1; color: var(--panel-title); height: 30px; background: none; border: none; outline: none; } .ddei-ext-panel-search-box-btn[data-v-75611720] { width: 25px; height: 25px; margin-right: 3px; display: flex; align-items: center; justify-content: center; } .ddei-ext-panel-search-box-btn[data-v-75611720]:hover { background-color: var(--dot); filter: brightness(130%); cursor: pointer; border-radius: 4px; } .ddei-ext-panel-search-box-btn__selected[data-v-75611720] { background-color: var(--dot); filter: brightness(130%); border-radius: 4px; } .ddei-ext-panel-search-result[data-v-75611720] { float: left; margin-left: 5px; height: 30px; width: 150px; display: flex; align-items: center; justify-content: start; color: var(--panel-title); font-size: 14px; } .ddei-ext-panel-search-buttons[data-v-75611720] { float: left; margin-bottom: 3px; margin-left: 5px; height: 30px; width: 110px; display: flex; align-items: center; justify-content: end; color: var(--panel-title); font-size: 14px; } .ddei-ext-panel-search-buttons-btn[data-v-75611720] { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; } .ddei-ext-panel-search-buttons-btn[data-v-75611720]:hover { background-color: var(--panel-header); cursor: pointer; } .ddei-ext-panel-search-buttons-btn__selected[data-v-75611720] { background-color: var(--panel-header); } .ddei-ext-panel-search-buttons-btn__disabled .icon[data-v-75611720] { filter: opacity(0.5); } .ddei-ext-panel-search-buttons-btn__disabled[data-v-75611720]:hover { background: none; cursor: default; } .ddei-ext-panel-search-buttons-btn .icon[data-v-75611720] { font-size: 18px; width: 18px; height: 18px; } .ddei-ext-panel-search-replace-buttons[data-v-75611720] { float: left; margin-bottom: 3px; margin-left: 5px; height: 30px; width: 110px; display: flex; align-items: center; justify-content: start; color: var(--panel-title); font-size: 14px; } .ddei-ext-panel-search-replace-buttons-btn[data-v-75611720] { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; } .ddei-ext-panel-search-replace-buttons-btn[data-v-75611720]:hover { background-color: var(--panel-header); cursor: pointer; } .ddei-ext-panel-search-replace-buttons-btn .icon[data-v-75611720] { font-size: 18px; width: 18px; height: 18px; } .ddei-ext-dialog-search[data-v-869178bc] { box-shadow: 0px 2px 24px 0px hwb(0 0% 100% / 0.25); border-radius: 6px; display: none; overflow: hidden; position: absolute; padding-top: 3px; background-color: var(--panel-background); z-index: 999; } .ddei-ext-panel-quickcontrol[data-v-dd1c62d6] { background: transparent; pointer-events: none; display: flex; justify-content: center; align-items: center; } .ddei-ext-panel-quickcontrol svg[data-v-dd1c62d6] { pointer-events: auto; fill: var(--icon); } .ddei-ext-panel-quickcontrol svg[data-v-dd1c62d6]:hover { fill: var(--dot); cursor: pointer; } .ddei-ext-panel-quickcontrol-left[data-v-dd1c62d6] { display: flex; justify-content: center; align-items: center; flex: 0 0 20px; } .ddei-ext-panel-quickcontrol-middle[data-v-dd1c62d6] { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; } .ddei-ext-panel-quickcontrol-middle-top[data-v-dd1c62d6] { flex: 0 0 20px; display: flex; justify-content: center; align-items: center; } .ddei-ext-panel-quickcontrol-middle-middle[data-v-dd1c62d6] { flex: 1; } .ddei-ext-panel-quickcontrol-middle-bottom[data-v-dd1c62d6] { display: flex; justify-content: center; align-items: center; flex: 0 0 20px; } .ddei-ext-panel-quickcontrol-right[data-v-dd1c62d6] { flex: 0 0 20px; display: flex; justify-content: center; align-items: center; } .ddei-ext-dialog-quickcontrol[data-v-737aeea8] { display: none; overflow: hidden; position: absolute; background: transparent; pointer-events: none; z-index: 999; } .ddei-ext-dialog-quickchoosecontrol[data-v-5bda071e] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: auto; position: absolute; background-color: var(--panel-background); height: 240px; width: 240px; z-index: 1999; user-select: none; color: var(--panel-title); } .ddei-ext-dialog-quickchoosecontrol-group-itempanel[data-v-5bda071e] { display: flex; flex-flow: row wrap; background: var(--toolbox-background); padding: 15px 15px 15px 15px; } .ddei-ext-dialog-quickchoosecontrol-group-itempanel-item[data-v-5bda071e] { flex: 0 0 50px !important; height: 45px; margin: 5px 0px; display: flex; overflow: hidden; justify-content: center; align-items: center; flex-flow: column; } .ddei-ext-dialog-quickchoosecontrol-group-itempanel-item[data-v-5bda071e]:hover { background: var(--toolbox-control-hover); outline: var(--toolbox-control-hover-outline); cursor: all-scroll; } .ddei-ext-dialog-quickchoosecontrol-group-itempanel-item .text[data-v-5bda071e] { white-space: nowrap; text-align: center; font-size: 0.7vw; font-weight: 400; color: var(--toolbox-control-title); } .ddei-ext-dialog-quickchoosecontrol-group-itempanel-item .icon[data-v-5bda071e] { width: 90%; height: 90%; object-fit: contain; } .ddei-ext-dialog-quickchoosecontrol-group-itempanel-item .icon-html[data-v-5bda071e] { width: 50px; height: 45px; object-fit: contain; display: flex; justify-content: center; align-items: center; } .ddei-ext-dialog-quickchoosecontrol-group-itempanel-item .icon-html[data-v-5bda071e] > * { width: 28px !important; height: 28px !important; object-fit: contain; } /**以下是快捷样式编辑的弹出框 */ .ddei-ext-dialog-tooltip[data-v-d9902947] { border: 1px solid var(--panel-border); box-shadow: 0px 2px 24px 0px hsla(0, 0%, 0%, 0.25); border-radius: 6px; display: none; overflow: hidden; position: absolute; background-color: var(--panel-background); z-index: 2999; user-select: none; color: var(--panel-title); } .ddei-ext-dialog-tooltip-row[data-v-d9902947] { min-width: 160px; min-height: 30px; display: flex; align-items: center; justify-content: center; } .ddei-ext-dialog-tooltip-row-title[data-v-d9902947] { flex: 1; padding-left: 5px; padding-right: 5px; text-align: left; font-weight: bolder; } .ddei-ext-dialog-tooltip-row-data[data-v-d9902947] { flex: 1; padding-left: 5px; padding-right: 5px; text-align: center; } @keyframes fadeIn-d9902947 { from { opacity: 0; } to { opacity: 1; } } .fade-in[data-v-d9902947] { animation: fadeIn-d9902947 0.5s ease-in-out forwards; } `; document.head.appendChild(__vite_style__); var __defProp2 = Object.defineProperty; var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField2 = (obj, key, value) => { __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; var freeGlobal = typeof global == "object" && global && global.Object === Object && global; const freeGlobal$1 = freeGlobal; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal$1 || freeSelf || Function("return this")(); const root$1 = root; var Symbol$1 = root$1.Symbol; const Symbol$2 = Symbol$1; var objectProto$d = Object.prototype; var hasOwnProperty$a = objectProto$d.hasOwnProperty; var nativeObjectToString$1 = objectProto$d.toString; var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0; function getRawTag(value) { var isOwn = hasOwnProperty$a.call(value, symToStringTag$1), tag = value[symToStringTag$1]; try { value[symToStringTag$1] = void 0; var unmasked = true; } catch (e) { } var result = nativeObjectToString$1.call(value); if (unmasked) { if (isOwn) { value[symToStringTag$1] = tag; } else { delete value[symToStringTag$1]; } } return result; } var objectProto$c = Object.prototype; var nativeObjectToString = objectProto$c.toString; function objectToString(value) { return nativeObjectToString.call(value); } var nullTag = "[object Null]", undefinedTag = "[object Undefined]"; var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0; function baseGetTag(value) { if (value == null) { return value === void 0 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); } function isObjectLike(value) { return value != null && typeof value == "object"; } var symbolTag$2 = "[object Symbol]"; function isSymbol(value) { return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$2; } function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } var isArray = Array.isArray; const isArray$1 = isArray; var INFINITY = 1 / 0; var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0; function baseToString(value) { if (typeof value == "string") { return value; } if (isArray$1(value)) { return arrayMap(value, baseToString) + ""; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ""; } var result = value + ""; return result == "0" && 1 / value == -INFINITY ? "-0" : result; } var reWhitespace = /\s/; function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) { } return index; } var reTrimStart = /^\s+/; function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; } function isObject(value) { var type = typeof value; return value != null && (type == "object" || type == "function"); } var NAN = 0 / 0; var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; var reIsBinary = /^0b[01]+$/i; var reIsOctal = /^0o[0-7]+$/i; var freeParseInt = parseInt; function toNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == "function" ? value.valueOf() : value; value = isObject(other) ? other + "" : other; } if (typeof value != "string") { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } function identity(value) { return value; } var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; function isFunction(value) { if (!isObject(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag; } var coreJsData = root$1["__core-js_shared__"]; const coreJsData$1 = coreJsData; var maskSrcKey = function() { var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || ""); return uid ? "Symbol(src)_1." + uid : ""; }(); function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } var funcProto$2 = Function.prototype; var funcToString$2 = funcProto$2.toString; function toSource(func) { if (func != null) { try { return funcToString$2.call(func); } catch (e) { } try { return func + ""; } catch (e) { } } return ""; } var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; var funcProto$1 = Function.prototype, objectProto$b = Object.prototype; var funcToString$1 = funcProto$1.toString; var hasOwnProperty$9 = objectProto$b.hasOwnProperty; var reIsNative = RegExp( "^" + funcToString$1.call(hasOwnProperty$9).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } function getValue(object, key) { return object == null ? void 0 : object[key]; } function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : void 0; } var WeakMap = getNative(root$1, "WeakMap"); const WeakMap$1 = WeakMap; var objectCreate = Object.create; var baseCreate = function() { function object() { } return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object(); object.prototype = void 0; return result; }; }(); const baseCreate$1 = baseCreate; function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } var HOT_COUNT = 800, HOT_SPAN = 16; var nativeNow = Date.now; function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(void 0, arguments); }; } function constant(value) { return function() { return value; }; } var defineProperty = function() { try { var func = getNative(Object, "defineProperty"); func({}, "", {}); return func; } catch (e) { } }(); const defineProperty$1 = defineProperty; var baseSetToString = !defineProperty$1 ? identity : function(func, string) { return defineProperty$1(func, "toString", { "configurable": true, "enumerable": false, "value": constant(string), "writable": true }); }; const baseSetToString$1 = baseSetToString; var setToString = shortOut(baseSetToString$1); const setToString$1 = setToString; function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while (fromRight ? index-- : ++index < length) { if (predicate(array[index], index, array)) { return index; } } return -1; } function baseIsNaN(value) { return value !== value; } function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } var MAX_SAFE_INTEGER$1 = 9007199254740991; var reIsUint = /^(?:0|[1-9]\d*)$/; function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER$1 : length; return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } function baseAssignValue(object, key, value) { if (key == "__proto__" && defineProperty$1) { defineProperty$1(object, key, { "configurable": true, "enumerable": true, "value": value, "writable": true }); } else { object[key] = value; } } function eq(value, other) { return value === other || value !== value && other !== other; } var objectProto$a = Object.prototype; var hasOwnProperty$8 = objectProto$a.hasOwnProperty; function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty$8.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) { baseAssignValue(object, key, value); } } function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0; if (newValue === void 0) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } var nativeMax$1 = Math.max; function overRest(func, start, transform) { start = nativeMax$1(start === void 0 ? func.length - 1 : start, 0); return function() { var args = arguments, index = -1, length = nativeMax$1(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } function baseRest(func, start) { return setToString$1(overRest(func, start, identity), func + ""); } var MAX_SAFE_INTEGER = 9007199254740991; function isLength(value) { return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { return eq(object[index], value); } return false; } function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0; customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? void 0 : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } var objectProto$9 = Object.prototype; function isPrototype(value) { var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$9; return value === proto; } function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } var argsTag$2 = "[object Arguments]"; function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag$2; } var objectProto$8 = Object.prototype; var hasOwnProperty$7 = objectProto$8.hasOwnProperty; var propertyIsEnumerable$1 = objectProto$8.propertyIsEnumerable; var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty$7.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee"); }; const isArguments$1 = isArguments; function stubFalse() { return false; } var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module; var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2; var Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0; var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0; var isBuffer = nativeIsBuffer || stubFalse; const isBuffer$1 = isBuffer; var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$2 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$1 = "[object Error]", funcTag$1 = "[object Function]", mapTag$4 = "[object Map]", numberTag$3 = "[object Number]", objectTag$3 = "[object Object]", regexpTag$2 = "[object RegExp]", setTag$4 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]"; var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]"; var typedArrayTags = {}; typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true; typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$4] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$4] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false; function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } function baseUnary(func) { return function(value) { return func(value); }; } var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module; var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; var freeProcess = moduleExports$1 && freeGlobal$1.process; var nodeUtil = function() { try { var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types; if (types) { return types; } return freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e) { } }(); const nodeUtil$1 = nodeUtil; var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray; var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; const isTypedArray$1 = isTypedArray; var objectProto$7 = Object.prototype; var hasOwnProperty$6 = objectProto$7.hasOwnProperty; function arrayLikeKeys(value, inherited) { var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty$6.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. isIndex(key, length)))) { result.push(key); } } return result; } function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } var nativeKeys = overArg(Object.keys, Object); const nativeKeys$1 = nativeKeys; var objectProto$6 = Object.prototype; var hasOwnProperty$5 = objectProto$6.hasOwnProperty; function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys$1(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty$5.call(object, key) && key != "constructor") { result.push(key); } } return result; } function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } var objectProto$5 = Object.prototype; var hasOwnProperty$4 = objectProto$5.hasOwnProperty; function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == "constructor" && (isProto || !hasOwnProperty$4.call(object, key)))) { result.push(key); } } return result; } function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } var nativeCreate = getNative(Object, "create"); const nativeCreate$1 = nativeCreate; function hashClear() { this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {}; this.size = 0; } function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; var objectProto$4 = Object.prototype; var hasOwnProperty$3 = objectProto$4.hasOwnProperty; function hashGet(key) { var data = this.__data__; if (nativeCreate$1) { var result = data[key]; return result === HASH_UNDEFINED$1 ? void 0 : result; } return hasOwnProperty$3.call(data, key) ? data[key] : void 0; } var objectProto$3 = Object.prototype; var hasOwnProperty$2 = objectProto$3.hasOwnProperty; function hashHas(key) { var data = this.__data__; return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$2.call(data, key); } var HASH_UNDEFINED = "__lodash_hash_undefined__"; function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED : value; return this; } function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } Hash.prototype.clear = hashClear; Hash.prototype["delete"] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; function listCacheClear() { this.__data__ = []; this.size = 0; } function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } var arrayProto = Array.prototype; var splice = arrayProto.splice; function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? void 0 : data[index][1]; } function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } ListCache.prototype.clear = listCacheClear; ListCache.prototype["delete"] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; var Map$1 = getNative(root$1, "Map"); const Map$2 = Map$1; function mapCacheClear() { this.size = 0; this.__data__ = { "hash": new Hash(), "map": new (Map$2 || ListCache)(), "string": new Hash() }; } function isKeyable(value) { var type = typeof value; return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; } function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; } function mapCacheDelete(key) { var result = getMapData(this, key)["delete"](key); this.size -= result ? 1 : 0; return result; } function mapCacheGet(key) { return getMapData(this, key).get(key); } function mapCacheHas(key) { return getMapData(this, key).has(key); } function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } MapCache.prototype.clear = mapCacheClear; MapCache.prototype["delete"] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; function toString(value) { return value == null ? "" : baseToString(value); } function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } var getPrototype = overArg(Object.getPrototypeOf, Object); const getPrototype$1 = getPrototype; var objectTag$2 = "[object Object]"; var funcProto = Function.prototype, objectProto$2 = Object.prototype; var funcToString = funcProto.toString; var hasOwnProperty$1 = objectProto$2.hasOwnProperty; var objectCtorString = funcToString.call(Object); function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag$2) { return false; } var proto = getPrototype$1(value); if (proto === null) { return true; } var Ctor = hasOwnProperty$1.call(proto, "constructor") && proto.constructor; return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : length + start; } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : end - start >>> 0; start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } function castSlice(array, start, end) { var length = array.length; end = end === void 0 ? length : end; return !start && end >= length ? array : baseSlice(array, start, end); } var rsAstralRange$1 = "\\ud800-\\udfff", rsComboMarksRange$1 = "\\u0300-\\u036f", reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$1 = "\\u20d0-\\u20ff", rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1, rsVarRange$1 = "\\ufe0e\\ufe0f"; var rsZWJ$1 = "\\u200d"; var reHasUnicode = RegExp("[" + rsZWJ$1 + rsAstralRange$1 + rsComboRange$1 + rsVarRange$1 + "]"); function hasUnicode(string) { return reHasUnicode.test(string); } function asciiToArray(string) { return string.split(""); } var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f"; var rsAstral = "[" + rsAstralRange + "]", rsCombo = "[" + rsComboRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ = "\\u200d"; var reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); function unicodeToArray(string) { return string.match(reUnicode) || []; } function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } function stackClear() { this.__data__ = new ListCache(); this.size = 0; } function stackDelete(key) { var data = this.__data__, result = data["delete"](key); this.size = data.size; return result; } function stackGet(key) { return this.__data__.get(key); } function stackHas(key) { return this.__data__.has(key); } var LARGE_ARRAY_SIZE = 200; function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } Stack.prototype.clear = stackClear; Stack.prototype["delete"] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; var moduleExports = freeModule && freeModule.exports === freeExports; var Buffer = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0; function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } function stubArray() { return []; } var objectProto$1 = Object.prototype; var propertyIsEnumerable = objectProto$1.propertyIsEnumerable; var nativeGetSymbols$1 = Object.getOwnPropertySymbols; var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols$1(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; const getSymbols$1 = getSymbols; function copySymbols(source, object) { return copyObject(source, getSymbols$1(source), object); } var nativeGetSymbols = Object.getOwnPropertySymbols; var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols$1(object)); object = getPrototype$1(object); } return result; }; const getSymbolsIn$1 = getSymbolsIn; function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn$1(source), object); } function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object)); } function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols$1); } function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn$1); } var DataView = getNative(root$1, "DataView"); const DataView$1 = DataView; var Promise$1 = getNative(root$1, "Promise"); const Promise$2 = Promise$1; var Set = getNative(root$1, "Set"); const Set$1 = Set; var mapTag$3 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$3 = "[object Set]", weakMapTag$1 = "[object WeakMap]"; var dataViewTag$2 = "[object DataView]"; var dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$2), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1); var getTag = baseGetTag; if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2 || Map$2 && getTag(new Map$2()) != mapTag$3 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$3 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag$2; case mapCtorString: return mapTag$3; case promiseCtorString: return promiseTag; case setCtorString: return setTag$3; case weakMapCtorString: return weakMapTag$1; } } return result; }; } const getTag$1 = getTag; var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function initCloneArray(array) { var length = array.length, result = new array.constructor(length); if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) { result.index = array.index; result.input = array.input; } return result; } var Uint8Array$1 = root$1.Uint8Array; const Uint8Array$2 = Uint8Array$1; function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array$2(result).set(new Uint8Array$2(arrayBuffer)); return result; } function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } var reFlags = /\w*$/; function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } var boolTag$1 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$2 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$2 = "[object String]", symbolTag$1 = "[object Symbol]"; var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]"; function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag$1: return cloneArrayBuffer(object); case boolTag$1: case dateTag$2: return new Ctor(+object); case dataViewTag$1: return cloneDataView(object, isDeep); case float32Tag$1: case float64Tag$1: case int8Tag$1: case int16Tag$1: case int32Tag$1: case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1: return cloneTypedArray(object, isDeep); case mapTag$2: return new Ctor(); case numberTag$2: case stringTag$2: return new Ctor(object); case regexpTag$1: return cloneRegExp(object); case setTag$2: return new Ctor(); case symbolTag$1: return cloneSymbol(object); } } function initCloneObject(object) { return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate$1(getPrototype$1(object)) : {}; } var mapTag$1 = "[object Map]"; function baseIsMap(value) { return isObjectLike(value) && getTag$1(value) == mapTag$1; } var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap; var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; const isMap$1 = isMap; var setTag$1 = "[object Set]"; function baseIsSet(value) { return isObjectLike(value) && getTag$1(value) == setTag$1; } var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet; var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; const isSet$1 = isSet; var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$2 = 4; var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag$1 = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag$1 = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag$1 = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]"; var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag$1] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag$1] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$2; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== void 0) { return result; } if (!isObject(value)) { return value; } var isArr = isArray$1(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag$1(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer$1(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || isFunc && !object) { result = isFlat || isFunc ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } stack || (stack = new Stack()); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet$1(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap$1(value)) { value.forEach(function(subValue, key2) { result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); }); } var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; var props = isArr ? void 0 : keysFunc(value); arrayEach(props || value, function(subValue, key2) { if (props) { key2 = subValue; subValue = value[key2]; } assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); }); return result; } var CLONE_SYMBOLS_FLAG$1 = 4; function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG$1); } var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } var baseFor = createBaseFor(); const baseFor$1 = baseFor; var now = function() { return root$1.Date.now(); }; const now$1 = now; var FUNC_ERROR_TEXT$1 = "Expected a function"; var nativeMax = Math.max, nativeMin = Math.min; function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != "function") { throw new TypeError(FUNC_ERROR_TEXT$1); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = "maxWait" in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = "trailing" in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = void 0; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { lastInvokeTime = time; timerId = setTimeout(timerExpired, wait); return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; } function timerExpired() { var time = now$1(); if (shouldInvoke(time)) { return trailingEdge(time); } timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = void 0; if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = void 0; return result; } function cancel() { if (timerId !== void 0) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = void 0; } function flush() { return timerId === void 0 ? result : trailingEdge(now$1()); } function debounced() { var time = now$1(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === void 0) { return leadingEdge(lastCallTime); } if (maxing) { clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === void 0) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } function assignMergeValue(object, key, value) { if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) { baseAssignValue(object, key, value); } } function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } function safeGet(object, key) { if (key === "constructor" && typeof object[key] === "function") { return; } if (key == "__proto__") { return; } return object[key]; } function toPlainObject(value) { return copyObject(value, keysIn(value)); } function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0; var isCommon = newValue === void 0; if (isCommon) { var isArr = isArray$1(srcValue), isBuff = !isArr && isBuffer$1(srcValue), isTyped = !isArr && !isBuff && isTypedArray$1(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray$1(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments$1(srcValue)) { newValue = objValue; if (isArguments$1(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack["delete"](srcValue); } assignMergeValue(object, key, newValue); } function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor$1(source, function(srcValue, key) { stack || (stack = new Stack()); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0; if (newValue === void 0) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { stack.set(srcValue, objValue); baseMerge(objValue, srcValue, void 0, customDefaultsMerge, stack); stack["delete"](srcValue); } return objValue; } var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); const mergeWith$1 = mergeWith; var defaultsDeep = baseRest(function(args) { args.push(void 0, customDefaultsMerge); return apply(mergeWith$1, void 0, args); }); const defaultsDeep$1 = defaultsDeep; var stringTag = "[object String]"; function isString(value) { return typeof value == "string" || !isArray$1(value) && isObjectLike(value) && baseGetTag(value) == stringTag; } var dateTag = "[object Date]"; function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } var nodeIsDate = nodeUtil$1 && nodeUtil$1.isDate; var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; const isDate$1 = isDate; var numberTag = "[object Number]"; function isNumber(value) { return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag; } var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); const merge$1 = merge; var FUNC_ERROR_TEXT = "Expected a function"; function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != "function") { throw new TypeError(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = "leading" in options ? !!options.leading : leading; trailing = "trailing" in options ? !!options.trailing : trailing; } return debounce(func, wait, { "leading": leading, "maxWait": wait, "trailing": trailing }); } function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index; } function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index; } function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === void 0)) { return baseTrim(string); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start, end).join(""); } /** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT */ const REVISION = "156"; function clamp(value, min, max) { return Math.max(min, Math.min(max, value)); } class Matrix3 { constructor(n11, n12, n13, n21, n22, n23, n31, n32, n33) { Matrix3.prototype.isMatrix3 = true; this.elements = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; if (n11 !== void 0) { this.set(n11, n12, n13, n21, n22, n23, n31, n32, n33); } } set(n11, n12, n13, n21, n22, n23, n31, n32, n33) { const te = this.elements; te[0] = n11; te[1] = n21; te[2] = n31; te[3] = n12; te[4] = n22; te[5] = n32; te[6] = n13; te[7] = n23; te[8] = n33; return this; } identity() { this.set( 1, 0, 0, 0, 1, 0, 0, 0, 1 ); return this; } copy(m) { const te = this.elements; const me = m.elements; te[0] = me[0]; te[1] = me[1]; te[2] = me[2]; te[3] = me[3]; te[4] = me[4]; te[5] = me[5]; te[6] = me[6]; te[7] = me[7]; te[8] = me[8]; return this; } extractBasis(xAxis, yAxis, zAxis) { xAxis.setFromMatrix3Column(this, 0); yAxis.setFromMatrix3Column(this, 1); zAxis.setFromMatrix3Column(this, 2); return this; } setFromMatrix4(m) { const me = m.elements; this.set( me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10] ); return this; } multiply(m) { return this.multiplyMatrices(this, m); } premultiply(m) { return this.multiplyMatrices(m, this); } multiplyMatrices(a, b) { const ae = a.elements; const be = b.elements; const te = this.elements; const a11 = ae[0], a12 = ae[3], a13 = ae[6]; const a21 = ae[1], a22 = ae[4], a23 = ae[7]; const a31 = ae[2], a32 = ae[5], a33 = ae[8]; const b11 = be[0], b12 = be[3], b13 = be[6]; const b21 = be[1], b22 = be[4], b23 = be[7]; const b31 = be[2], b32 = be[5], b33 = be[8]; te[0] = a11 * b11 + a12 * b21 + a13 * b31; te[3] = a11 * b12 + a12 * b22 + a13 * b32; te[6] = a11 * b13 + a12 * b23 + a13 * b33; te[1] = a21 * b11 + a22 * b21 + a23 * b31; te[4] = a21 * b12 + a22 * b22 + a23 * b32; te[7] = a21 * b13 + a22 * b23 + a23 * b33; te[2] = a31 * b11 + a32 * b21 + a33 * b31; te[5] = a31 * b12 + a32 * b22 + a33 * b32; te[8] = a31 * b13 + a32 * b23 + a33 * b33; return this; } multiplyScalar(s) { const te = this.elements; te[0] *= s; te[3] *= s; te[6] *= s; te[1] *= s; te[4] *= s; te[7] *= s; te[2] *= s; te[5] *= s; te[8] *= s; return this; } determinant() { const te = this.elements; const a = te[0], b = te[1], c = te[2], d = te[3], e = te[4], f = te[5], g = te[6], h = te[7], i2 = te[8]; return a * e * i2 - a * f * h - b * d * i2 + b * f * g + c * d * h - c * e * g; } invert() { const te = this.elements, n11 = te[0], n21 = te[1], n31 = te[2], n12 = te[3], n22 = te[4], n32 = te[5], n13 = te[6], n23 = te[7], n33 = te[8], t11 = n33 * n22 - n32 * n23, t12 = n32 * n13 - n33 * n12, t13 = n23 * n12 - n22 * n13, det = n11 * t11 + n21 * t12 + n31 * t13; if (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); const detInv = 1 / det; te[0] = t11 * detInv; te[1] = (n31 * n23 - n33 * n21) * detInv; te[2] = (n32 * n21 - n31 * n22) * detInv; te[3] = t12 * detInv; te[4] = (n33 * n11 - n31 * n13) * detInv; te[5] = (n31 * n12 - n32 * n11) * detInv; te[6] = t13 * detInv; te[7] = (n21 * n13 - n23 * n11) * detInv; te[8] = (n22 * n11 - n21 * n12) * detInv; return this; } transpose() { let tmp; const m = this.elements; tmp = m[1]; m[1] = m[3]; m[3] = tmp; tmp = m[2]; m[2] = m[6]; m[6] = tmp; tmp = m[5]; m[5] = m[7]; m[7] = tmp; return this; } getNormalMatrix(matrix4) { return this.setFromMatrix4(matrix4).invert().transpose(); } transposeIntoArray(r) { const m = this.elements; r[0] = m[0]; r[1] = m[3]; r[2] = m[6]; r[3] = m[1]; r[4] = m[4]; r[5] = m[7]; r[6] = m[2]; r[7] = m[5]; r[8] = m[8]; return this; } setUvTransform(tx, ty, sx, sy, rotation, cx, cy) { const c = Math.cos(rotation); const s = Math.sin(rotation); this.set( sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1 ); return this; } // scale(sx, sy) { this.premultiply(_m3.makeScale(sx, sy)); return this; } rotate(theta) { this.premultiply(_m3.makeRotation(-theta)); return this; } translate(tx, ty) { this.premultiply(_m3.makeTranslation(tx, ty)); return this; } // for 2D Transforms makeTranslation(x2, y2) { if (x2.isVector2) { this.set( 1, 0, x2.x, 0, 1, x2.y, 0, 0, 1 ); } else { this.set( 1, 0, x2, 0, 1, y2, 0, 0, 1 ); } return this; } makeRotation(theta) { const c = Math.cos(theta); const s = Math.sin(theta); this.set( c, -s, 0, s, c, 0, 0, 0, 1 ); return this; } makeScale(x2, y2) { this.set( x2, 0, 0, 0, y2, 0, 0, 0, 1 ); return this; } // equals(matrix2) { const te = this.elements; const me = matrix2.elements; for (let i2 = 0; i2 < 9; i2++) { if (te[i2] !== me[i2]) return false; } return true; } fromArray(array, offset = 0) { for (let i2 = 0; i2 < 9; i2++) { this.elements[i2] = array[i2 + offset]; } return this; } toArray(array = [], offset = 0) { const te = this.elements; array[offset] = te[0]; array[offset + 1] = te[1]; array[offset + 2] = te[2]; array[offset + 3] = te[3]; array[offset + 4] = te[4]; array[offset + 5] = te[5]; array[offset + 6] = te[6]; array[offset + 7] = te[7]; array[offset + 8] = te[8]; return array; } clone() { return new this.constructor().fromArray(this.elements); } } const _m3 = /* @__PURE__ */ new Matrix3(); class Quaternion { constructor(x2 = 0, y2 = 0, z = 0, w = 1) { this.isQuaternion = true; this._x = x2; this._y = y2; this._z = z; this._w = w; } static slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) { let x0 = src0[srcOffset0 + 0], y0 = src0[srcOffset0 + 1], z0 = src0[srcOffset0 + 2], w0 = src0[srcOffset0 + 3]; const x1 = src1[srcOffset1 + 0], y1 = src1[srcOffset1 + 1], z1 = src1[srcOffset1 + 2], w1 = src1[srcOffset1 + 3]; if (t === 0) { dst[dstOffset + 0] = x0; dst[dstOffset + 1] = y0; dst[dstOffset + 2] = z0; dst[dstOffset + 3] = w0; return; } if (t === 1) { dst[dstOffset + 0] = x1; dst[dstOffset + 1] = y1; dst[dstOffset + 2] = z1; dst[dstOffset + 3] = w1; return; } if (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) { let s = 1 - t; const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, dir = cos >= 0 ? 1 : -1, sqrSin = 1 - cos * cos; if (sqrSin > Number.EPSILON) { const sin = Math.sqrt(sqrSin), len = Math.atan2(sin, cos * dir); s = Math.sin(s * len) / sin; t = Math.sin(t * len) / sin; } const tDir = t * dir; x0 = x0 * s + x1 * tDir; y0 = y0 * s + y1 * tDir; z0 = z0 * s + z1 * tDir; w0 = w0 * s + w1 * tDir; if (s === 1 - t) { const f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0); x0 *= f; y0 *= f; z0 *= f; w0 *= f; } } dst[dstOffset] = x0; dst[dstOffset + 1] = y0; dst[dstOffset + 2] = z0; dst[dstOffset + 3] = w0; } static multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) { const x0 = src0[srcOffset0]; const y0 = src0[srcOffset0 + 1]; const z0 = src0[srcOffset0 + 2]; const w0 = src0[srcOffset0 + 3]; const x1 = src1[srcOffset1]; const y1 = src1[srcOffset1 + 1]; const z1 = src1[srcOffset1 + 2]; const w1 = src1[srcOffset1 + 3]; dst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1; dst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1; dst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1; dst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1; return dst; } get x() { return this._x; } set x(value) { this._x = value; this._onChangeCallback(); } get y() { return this._y; } set y(value) { this._y = value; this._onChangeCallback(); } get z() { return this._z; } set z(value) { this._z = value; this._onChangeCallback(); } get w() { return this._w; } set w(value) { this._w = value; this._onChangeCallback(); } set(x2, y2, z, w) { this._x = x2; this._y = y2; this._z = z; this._w = w; this._onChangeCallback(); return this; } clone() { return new this.constructor(this._x, this._y, this._z, this._w); } copy(quaternion) { this._x = quaternion.x; this._y = quaternion.y; this._z = quaternion.z; this._w = quaternion.w; this._onChangeCallback(); return this; } setFromEuler(euler, update) { const x2 = euler._x, y2 = euler._y, z = euler._z, order = euler._order; const cos = Math.cos; const sin = Math.sin; const c1 = cos(x2 / 2); const c2 = cos(y2 / 2); const c3 = cos(z / 2); const s1 = sin(x2 / 2); const s2 = sin(y2 / 2); const s3 = sin(z / 2); switch (order) { case "XYZ": this._x = s1 * c2 * c3 + c1 * s2 * s3; this._y = c1 * s2 * c3 - s1 * c2 * s3; this._z = c1 * c2 * s3 + s1 * s2 * c3; this._w = c1 * c2 * c3 - s1 * s2 * s3; break; case "YXZ": this._x = s1 * c2 * c3 + c1 * s2 * s3; this._y = c1 * s2 * c3 - s1 * c2 * s3; this._z = c1 * c2 * s3 - s1 * s2 * c3; this._w = c1 * c2 * c3 + s1 * s2 * s3; break; case "ZXY": this._x = s1 * c2 * c3 - c1 * s2 * s3; this._y = c1 * s2 * c3 + s1 * c2 * s3; this._z = c1 * c2 * s3 + s1 * s2 * c3; this._w = c1 * c2 * c3 - s1 * s2 * s3; break; case "ZYX": this._x = s1 * c2 * c3 - c1 * s2 * s3; this._y = c1 * s2 * c3 + s1 * c2 * s3; this._z = c1 * c2 * s3 - s1 * s2 * c3; this._w = c1 * c2 * c3 + s1 * s2 * s3; break; case "YZX": this._x = s1 * c2 * c3 + c1 * s2 * s3; this._y = c1 * s2 * c3 + s1 * c2 * s3; this._z = c1 * c2 * s3 - s1 * s2 * c3; this._w = c1 * c2 * c3 - s1 * s2 * s3; break; case "XZY": this._x = s1 * c2 * c3 - c1 * s2 * s3; this._y = c1 * s2 * c3 - s1 * c2 * s3; this._z = c1 * c2 * s3 + s1 * s2 * c3; this._w = c1 * c2 * c3 + s1 * s2 * s3; break; default: console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + order); } if (update !== false) this._onChangeCallback(); return this; } setFromAxisAngle(axis, angle2) { const halfAngle = angle2 / 2, s = Math.sin(halfAngle); this._x = axis.x * s; this._y = axis.y * s; this._z = axis.z * s; this._w = Math.cos(halfAngle); this._onChangeCallback(); return this; } setFromRotationMatrix(m) { const te = m.elements, m11 = te[0], m12 = te[4], m13 = te[8], m21 = te[1], m22 = te[5], m23 = te[9], m31 = te[2], m32 = te[6], m33 = te[10], trace = m11 + m22 + m33; if (trace > 0) { const s = 0.5 / Math.sqrt(trace + 1); this._w = 0.25 / s; this._x = (m32 - m23) * s; this._y = (m13 - m31) * s; this._z = (m21 - m12) * s; } else if (m11 > m22 && m11 > m33) { const s = 2 * Math.sqrt(1 + m11 - m22 - m33); this._w = (m32 - m23) / s; this._x = 0.25 * s; this._y = (m12 + m21) / s; this._z = (m13 + m31) / s; } else if (m22 > m33) { const s = 2 * Math.sqrt(1 + m22 - m11 - m33); this._w = (m13 - m31) / s; this._x = (m12 + m21) / s; this._y = 0.25 * s; this._z = (m23 + m32) / s; } else { const s = 2 * Math.sqrt(1 + m33 - m11 - m22); this._w = (m21 - m12) / s; this._x = (m13 + m31) / s; this._y = (m23 + m32) / s; this._z = 0.25 * s; } this._onChangeCallback(); return this; } setFromUnitVectors(vFrom, vTo) { let r = vFrom.dot(vTo) + 1; if (r < Number.EPSILON) { r = 0; if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) { this._x = -vFrom.y; this._y = vFrom.x; this._z = 0; this._w = r; } else { this._x = 0; this._y = -vFrom.z; this._z = vFrom.y; this._w = r; } } else { this._x = vFrom.y * vTo.z - vFrom.z * vTo.y; this._y = vFrom.z * vTo.x - vFrom.x * vTo.z; this._z = vFrom.x * vTo.y - vFrom.y * vTo.x; this._w = r; } return this.normalize(); } angleTo(q) { return 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1))); } rotateTowards(q, step) { const angle2 = this.angleTo(q); if (angle2 === 0) return this; const t = Math.min(1, step / angle2); this.slerp(q, t); return this; } identity() { return this.set(0, 0, 0, 1); } invert() { return this.conjugate(); } conjugate() { this._x *= -1; this._y *= -1; this._z *= -1; this._onChangeCallback(); return this; } dot(v) { return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; } lengthSq() { return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; } length() { return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w); } normalize() { let l = this.length(); if (l === 0) { this._x = 0; this._y = 0; this._z = 0; this._w = 1; } else { l = 1 / l; this._x = this._x * l; this._y = this._y * l; this._z = this._z * l; this._w = this._w * l; } this._onChangeCallback(); return this; } multiply(q) { return this.multiplyQuaternions(this, q); } premultiply(q) { return this.multiplyQuaternions(q, this); } multiplyQuaternions(a, b) { const qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; this._onChangeCallback(); return this; } slerp(qb, t) { if (t === 0) return this; if (t === 1) return this.copy(qb); const x2 = this._x, y2 = this._y, z = this._z, w = this._w; let cosHalfTheta = w * qb._w + x2 * qb._x + y2 * qb._y + z * qb._z; if (cosHalfTheta < 0) { this._w = -qb._w; this._x = -qb._x; this._y = -qb._y; this._z = -qb._z; cosHalfTheta = -cosHalfTheta; } else { this.copy(qb); } if (cosHalfTheta >= 1) { this._w = w; this._x = x2; this._y = y2; this._z = z; return this; } const sqrSinHalfTheta = 1 - cosHalfTheta * cosHalfTheta; if (sqrSinHalfTheta <= Number.EPSILON) { const s = 1 - t; this._w = s * w + t * this._w; this._x = s * x2 + t * this._x; this._y = s * y2 + t * this._y; this._z = s * z + t * this._z; this.normalize(); this._onChangeCallback(); return this; } const sinHalfTheta = Math.sqrt(sqrSinHalfTheta); const halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta); const ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta, ratioB = Math.sin(t * halfTheta) / sinHalfTheta; this._w = w * ratioA + this._w * ratioB; this._x = x2 * ratioA + this._x * ratioB; this._y = y2 * ratioA + this._y * ratioB; this._z = z * ratioA + this._z * ratioB; this._onChangeCallback(); return this; } slerpQuaternions(qa, qb, t) { return this.copy(qa).slerp(qb, t); } random() { const u1 = Math.random(); const sqrt1u1 = Math.sqrt(1 - u1); const sqrtu1 = Math.sqrt(u1); const u2 = 2 * Math.PI * Math.random(); const u3 = 2 * Math.PI * Math.random(); return this.set( sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2) ); } equals(quaternion) { return quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w; } fromArray(array, offset = 0) { this._x = array[offset]; this._y = array[offset + 1]; this._z = array[offset + 2]; this._w = array[offset + 3]; this._onChangeCallback(); return this; } toArray(array = [], offset = 0) { array[offset] = this._x; array[offset + 1] = this._y; array[offset + 2] = this._z; array[offset + 3] = this._w; return array; } fromBufferAttribute(attribute, index) { this._x = attribute.getX(index); this._y = attribute.getY(index); this._z = attribute.getZ(index); this._w = attribute.getW(index); return this; } toJSON() { return this.toArray(); } _onChange(callback) { this._onChangeCallback = callback; return this; } _onChangeCallback() { } *[Symbol.iterator]() { yield this._x; yield this._y; yield this._z; yield this._w; } } class Vector3 { constructor(x2 = 0, y2 = 0, z = 0) { Vector3.prototype.isVector3 = true; this.x = x2; this.y = y2; this.z = z; } set(x2, y2, z) { if (z === void 0) z = this.z; this.x = x2; this.y = y2; this.z = z; return this; } setScalar(scalar) { this.x = scalar; this.y = scalar; this.z = scalar; return this; } setX(x2) { this.x = x2; return this; } setY(y2) { this.y = y2; return this; } setZ(z) { this.z = z; return this; } setComponent(index, value) { switch (index) { case 0: this.x = value; break; case 1: this.y = value; break; case 2: this.z = value; break; default: throw new Error("index is out of range: " + index); } return this; } getComponent(index) { switch (index) { case 0: return this.x; case 1: return this.y; case 2: return this.z; default: throw new Error("index is out of range: " + index); } } clone() { return new this.constructor(this.x, this.y, this.z); } copy(v) { this.x = v.x; this.y = v.y; this.z = v.z; return this; } add(v) { this.x += v.x; this.y += v.y; this.z += v.z; return this; } addScalar(s) { this.x += s; this.y += s; this.z += s; return this; } addVectors(a, b) { this.x = a.x + b.x; this.y = a.y + b.y; this.z = a.z + b.z; return this; } addScaledVector(v, s) { this.x += v.x * s; this.y += v.y * s; this.z += v.z * s; return this; } sub(v) { this.x -= v.x; this.y -= v.y; this.z -= v.z; return this; } subScalar(s) { this.x -= s; this.y -= s; this.z -= s; return this; } subVectors(a, b) { this.x = a.x - b.x; this.y = a.y - b.y; this.z = a.z - b.z; return this; } multiply(v) { this.x *= v.x; this.y *= v.y; this.z *= v.z; return this; } multiplyScalar(scalar) { this.x *= scalar; this.y *= scalar; this.z *= scalar; return this; } multiplyVectors(a, b) { this.x = a.x * b.x; this.y = a.y * b.y; this.z = a.z * b.z; return this; } applyEuler(euler) { return this.applyQuaternion(_quaternion$4.setFromEuler(euler)); } applyAxisAngle(axis, angle2) { return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis, angle2)); } applyMatrix3(m) { const x2 = this.x, y2 = this.y, z = this.z; const e = m.elements; this.x = e[0] * x2 + e[3] * y2 + e[6] * z; this.y = e[1] * x2 + e[4] * y2 + e[7] * z; this.z = e[2] * x2 + e[5] * y2 + e[8] * z; return this; } applyNormalMatrix(m) { return this.applyMatrix3(m).normalize(); } applyMatrix4(m) { const x2 = this.x, y2 = this.y, z = this.z; const e = m.elements; const w = 1 / (e[3] * x2 + e[7] * y2 + e[11] * z + e[15]); this.x = (e[0] * x2 + e[4] * y2 + e[8] * z + e[12]) * w; this.y = (e[1] * x2 + e[5] * y2 + e[9] * z + e[13]) * w; this.z = (e[2] * x2 + e[6] * y2 + e[10] * z + e[14]) * w; return this; } applyQuaternion(q) { const x2 = this.x, y2 = this.y, z = this.z; const qx = q.x, qy = q.y, qz = q.z, qw = q.w; const ix = qw * x2 + qy * z - qz * y2; const iy = qw * y2 + qz * x2 - qx * z; const iz = qw * z + qx * y2 - qy * x2; const iw = -qx * x2 - qy * y2 - qz * z; this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; return this; } project(camera) { return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix); } unproject(camera) { return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld); } transformDirection(m) { const x2 = this.x, y2 = this.y, z = this.z; const e = m.elements; this.x = e[0] * x2 + e[4] * y2 + e[8] * z; this.y = e[1] * x2 + e[5] * y2 + e[9] * z; this.z = e[2] * x2 + e[6] * y2 + e[10] * z; return this.normalize(); } divide(v) { this.x /= v.x; this.y /= v.y; this.z /= v.z; return this; } divideScalar(scalar) { return this.multiplyScalar(1 / scalar); } min(v) { this.x = Math.min(this.x, v.x); this.y = Math.min(this.y, v.y); this.z = Math.min(this.z, v.z); return this; } max(v) { this.x = Math.max(this.x, v.x); this.y = Math.max(this.y, v.y); this.z = Math.max(this.z, v.z); return this; } clamp(min, max) { this.x = Math.max(min.x, Math.min(max.x, this.x)); this.y = Math.max(min.y, Math.min(max.y, this.y)); this.z = Math.max(min.z, Math.min(max.z, this.z)); return this; } clampScalar(minVal, maxVal) { this.x = Math.max(minVal, Math.min(maxVal, this.x)); this.y = Math.max(minVal, Math.min(maxVal, this.y)); this.z = Math.max(minVal, Math.min(maxVal, this.z)); return this; } clampLength(min, max) { const length = this.length(); return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length))); } floor() { this.x = Math.floor(this.x); this.y = Math.floor(this.y); this.z = Math.floor(this.z); return this; } ceil() { this.x = Math.ceil(this.x); this.y = Math.ceil(this.y); this.z = Math.ceil(this.z); return this; } round() { this.x = Math.round(this.x); this.y = Math.round(this.y); this.z = Math.round(this.z); return this; } roundToZero() { this.x = Math.trunc(this.x); this.y = Math.trunc(this.y); this.z = Math.trunc(this.z); return this; } negate() { this.x = -this.x; this.y = -this.y; this.z = -this.z; return this; } dot(v) { return this.x * v.x + this.y * v.y + this.z * v.z; } // TODO lengthSquared? lengthSq() { return this.x * this.x + this.y * this.y + this.z * this.z; } length() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); } manhattanLength() { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z); } normalize() { return this.divideScalar(this.length() || 1); } setLength(length) { return this.normalize().multiplyScalar(length); } lerp(v, alpha) { this.x += (v.x - this.x) * alpha; this.y += (v.y - this.y) * alpha; this.z += (v.z - this.z) * alpha; return this; } lerpVectors(v1, v2, alpha) { this.x = v1.x + (v2.x - v1.x) * alpha; this.y = v1.y + (v2.y - v1.y) * alpha; this.z = v1.z + (v2.z - v1.z) * alpha; return this; } cross(v) { return this.crossVectors(this, v); } crossVectors(a, b) { const ax = a.x, ay = a.y, az = a.z; const bx = b.x, by = b.y, bz = b.z; this.x = ay * bz - az * by; this.y = az * bx - ax * bz; this.z = ax * by - ay * bx; return this; } projectOnVector(v) { const denominator = v.lengthSq(); if (denominator === 0) return this.set(0, 0, 0); const scalar = v.dot(this) / denominator; return this.copy(v).multiplyScalar(scalar); } projectOnPlane(planeNormal) { _vector$b.copy(this).projectOnVector(planeNormal); return this.sub(_vector$b); } reflect(normal) { return this.sub(_vector$b.copy(normal).multiplyScalar(2 * this.dot(normal))); } angleTo(v) { const denominator = Math.sqrt(this.lengthSq() * v.lengthSq()); if (denominator === 0) return Math.PI / 2; const theta = this.dot(v) / denominator; return Math.acos(clamp(theta, -1, 1)); } distanceTo(v) { return Math.sqrt(this.distanceToSquared(v)); } distanceToSquared(v) { const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; return dx * dx + dy * dy + dz * dz; } manhattanDistanceTo(v) { return Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z); } setFromSpherical(s) { return this.setFromSphericalCoords(s.radius, s.phi, s.theta); } setFromSphericalCoords(radius, phi, theta) { const sinPhiRadius = Math.sin(phi) * radius; this.x = sinPhiRadius * Math.sin(theta); this.y = Math.cos(phi) * radius; this.z = sinPhiRadius * Math.cos(theta); return this; } setFromCylindrical(c) { return this.setFromCylindricalCoords(c.radius, c.theta, c.y); } setFromCylindricalCoords(radius, theta, y2) { this.x = radius * Math.sin(theta); this.y = y2; this.z = radius * Math.cos(theta); return this; } setFromMatrixPosition(m) { const e = m.elements; this.x = e[12]; this.y = e[13]; this.z = e[14]; return this; } setFromMatrixScale(m) { const sx = this.setFromMatrixColumn(m, 0).length(); const sy = this.setFromMatrixColumn(m, 1).length(); const sz = this.setFromMatrixColumn(m, 2).length(); this.x = sx; this.y = sy; this.z = sz; return this; } setFromMatrixColumn(m, index) { return this.fromArray(m.elements, index * 4); } setFromMatrix3Column(m, index) { return this.fromArray(m.elements, index * 3); } setFromEuler(e) { this.x = e._x; this.y = e._y; this.z = e._z; return this; } setFromColor(c) { this.x = c.r; this.y = c.g; this.z = c.b; return this; } equals(v) { return v.x === this.x && v.y === this.y && v.z === this.z; } fromArray(array, offset = 0) { this.x = array[offset]; this.y = array[offset + 1]; this.z = array[offset + 2]; return this; } toArray(array = [], offset = 0) { array[offset] = this.x; array[offset + 1] = this.y; array[offset + 2] = this.z; return array; } fromBufferAttribute(attribute, index) { this.x = attribute.getX(index); this.y = attribute.getY(index); this.z = attribute.getZ(index); return this; } random() { this.x = Math.random(); this.y = Math.random(); this.z = Math.random(); return this; } randomDirection() { const u = (Math.random() - 0.5) * 2; const t = Math.random() * Math.PI * 2; const f = Math.sqrt(1 - u ** 2); this.x = f * Math.cos(t); this.y = f * Math.sin(t); this.z = u; return this; } *[Symbol.iterator]() { yield this.x; yield this.y; yield this.z; } } const _vector$b = /* @__PURE__ */ new Vector3(); const _quaternion$4 = /* @__PURE__ */ new Quaternion(); if (typeof __THREE_DEVTOOLS__ !== "undefined") { __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: REVISION } })); } if (typeof window !== "undefined") { if (window.__THREE__) { console.warn("WARNING: Multiple instances of Three.js being imported."); } else { window.__THREE__ = REVISION; } } var DDeiEnumControlState = /* @__PURE__ */ ((DDeiEnumControlState2) => { DDeiEnumControlState2["DEFAULT"] = "default"; DDeiEnumControlState2["SELECTED"] = "selected"; DDeiEnumControlState2["CREATING"] = "creating"; return DDeiEnumControlState2; })(DDeiEnumControlState || {}); class DDeiModelArrtibuteValue { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ /** * 根据模型的当前状态,获取属性值 * 如果采用缺省值,则当前状态没有值时,会自动去获取外部缺省属性的值 * TODO 未来考虑一个模型多个状态叠加 * @param model 模型 * @param attrPath 属性路径,第一级为属性名称,略过中间的状态层级,如,定义:border.selected.width,写作:border.width * @param useDefault 是否采用缺省值,默认false不采用 * @param initValue 初始化值 * @returns 模型的值对象 */ static getAttrValueByState(model, attrPath, useDefault = false, initValue = null) { var _a3; let returnValue = null; if (model && attrPath) { let relPath = attrPath.split("."); let attrCode = relPath[0]; let detailCode = relPath.slice(1); let stateCode = (_a3 = model.state) == null ? void 0 : _a3.toString(); if (model.state == DDeiEnumControlState.DEFAULT || !stateCode) { stateCode = ""; } let overwrite = false; if (model[attrCode]) { let modelAttr = model[attrCode]; if (modelAttr) { let path = detailCode; if (stateCode) { path = [stateCode].concat(detailCode); } try { let returnJSON = DDeiUtil$1.getDataByPath(modelAttr, path); if (returnJSON.overwrite && returnJSON.overwrite == true) { overwrite = true; } returnValue = returnJSON.data; } catch (e) { } if (!overwrite && (returnValue == null || returnValue == void 0) && useDefault && stateCode.length > 0) { path = detailCode; try { let returnJSON = DDeiUtil$1.getDataByPath(modelAttr, path); if (returnJSON.overwrite && returnJSON.overwrite == true) { overwrite = true; } returnValue = returnJSON.data; } catch (e) { } } } } if (!overwrite && (returnValue == null || returnValue == void 0) && initValue && typeof initValue == "object") { try { let path = detailCode; if (stateCode) { path = [stateCode].concat(detailCode); } let returnJSON = DDeiUtil$1.getDataByPath(initValue, path); if (returnJSON.overwrite && returnJSON.overwrite == true) { overwrite = true; } returnValue = returnJSON.data; } catch (e) { } } if (!overwrite && (returnValue == null || returnValue == void 0)) { if (model.modelType != "DDeiSelector" && DDeiUtil$1.getAttrValueByConfig) { if (stateCode != "") { let attrCode2 = relPath[0]; let searchPath = attrCode2 + "." + stateCode + attrPath.substring(attrPath.indexOf(".")); let configAtrs = DDeiUtil$1.getAttrValueByConfig(model, searchPath); if (configAtrs && configAtrs.size > 0) { let returnJSON = Array.from(configAtrs.values())[0]; if (returnJSON.overwrite && returnJSON.overwrite == true) { overwrite = true; } returnValue = returnJSON.data; } } if (returnValue == null || returnValue == void 0) { let configAtrs = DDeiUtil$1.getAttrValueByConfig(model, attrPath); if (configAtrs && configAtrs.size > 0) { let returnJSON = Array.from(configAtrs.values())[0]; if (returnJSON.overwrite && returnJSON.overwrite == true) { overwrite = true; } returnValue = returnJSON.data; } } } } if (!overwrite && (returnValue == null || returnValue == void 0)) { let sysData = DDeiConfig$1.getSysDefaultData(model); if (sysData && sysData[attrCode]) { let path = detailCode; if (stateCode) { path = [stateCode].concat(detailCode); } try { let returnJSON = DDeiUtil$1.getDataByPath(sysData[attrCode], path); if (returnJSON.overwrite && returnJSON.overwrite == true) { overwrite = true; } returnValue = returnJSON.data; } catch (e) { } if (!overwrite && (returnValue == null || returnValue == void 0) && useDefault && stateCode.length > 0) { path = detailCode; try { let returnJSON = DDeiUtil$1.getDataByPath(sysData[attrCode], path); if (returnJSON.overwrite && returnJSON.overwrite == true) { overwrite = true; } returnValue = returnJSON.data; } catch (e) { } } } } } return returnValue; } // ============================ 属性 =============================== // ============================ 方法 =============================== } class DDeiColor { constructor(r, g, b, a) { __publicField2(this, "r"); __publicField2(this, "g"); __publicField2(this, "b"); __publicField2(this, "a", 1); this.r = r; this.g = g; this.b = b; this.a = a; } darken(rate) { let r = this.r; let g = this.g; let b = this.b; r -= r * rate; g -= g * rate; b -= b * rate; if (r < 0) { r = 0; } if (g < 0) { g = 0; } if (b < 0) { b = 0; } return new DDeiColor(r, g, b, this.a); } lighten(rate) { let r = this.r; let g = this.g; let b = this.b; r += r * rate; g += g * rate; b += b * rate; if (r < 0) { r = 0; } if (g < 0) { g = 0; } if (b < 0) { b = 0; } return new DDeiColor(r, g, b, this.a); } toColor() { return "rgba(" + this.r + "," + this.g + "," + this.b + "," + this.a + ")"; } } class DDeiLink { constructor(props) { __publicField2(this, "group", ""); __publicField2(this, "sm"); __publicField2(this, "dm"); __publicField2(this, "smpath"); __publicField2(this, "dmpath"); __publicField2(this, "stage"); __publicField2(this, "disabled", false); for (let i2 in props) { if (typeof props[i2] != "object" && props[i2]) { this[i2] = props[i2]; } } this.group = props.group; this.sm = props.sm; this.dm = props.dm; this.stage = props.stage; this.smpath = props.smpath; this.dmpath = props.dmpath; this.disabled = props.disabled; } /** * 得到源向量 */ getSourcePV() { return DDeiUtil$1.getDataByPathList(this.sm, this.smpath); } /** * 得到目标向量 */ getDistPV() { return DDeiUtil$1.getDataByPathList(this.dm, this.dmpath); } /** * 将模型转换为JSON */ toJSON() { let json = new Object(); for (let i2 in this) { if (typeof this[i2] != "object" && this[i2]) { json[i2] = this[i2]; } } if (this.group) { json.group = group; } if (this.sm) { json.smid = this.sm.id; } if (this.dm) { json.dmid = this.dm.id; } if (this.smpath) { json.smpath = this.smpath; } if (this.dmpath) { json.dmpath = this.dmpath; } return json; } } const __vite_glob_0_4$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLink, default: DDeiLink }, Symbol.toStringTag, { value: "Module" })); var DDeiEnumOperateType = /* @__PURE__ */ ((DDeiEnumOperateType2) => { DDeiEnumOperateType2["CREATE"] = "CREATE"; DDeiEnumOperateType2["EDIT"] = "EDIT"; DDeiEnumOperateType2["VIEW"] = "VIEW"; DDeiEnumOperateType2["DRAG"] = "DRAG"; DDeiEnumOperateType2["LINK"] = "LINK"; DDeiEnumOperateType2["DEL"] = "DEL"; DDeiEnumOperateType2["DESTROYED"] = "DESTROYED"; DDeiEnumOperateType2["SELECT"] = "SELECT"; DDeiEnumOperateType2["ROTATE"] = "ROTATE"; DDeiEnumOperateType2["SCALE"] = "SCALE"; DDeiEnumOperateType2["MIRROR"] = "MIRROR"; DDeiEnumOperateType2["COMPOSE"] = "COMPOSE"; return DDeiEnumOperateType2; })(DDeiEnumOperateType || {}); class DDeiModelLink { constructor(props) { __publicField2(this, "depModel"); __publicField2(this, "type"); __publicField2(this, "dm"); __publicField2(this, "dx"); __publicField2(this, "dy"); this.depModel = props.depModel; this.type = props.type; this.dm = props.dm; this.dx = props.dx ? props.dx : 0; this.dy = props.dy ? props.dy : 0; } /** * 将模型转换为JSON */ toJSON() { let json = new Object(); if (this.type) { json.type = this.type; } if (this.dm) { json.dmid = this.dm.id; } if (this.dx) { json.dx = this.dx; } if (this.dy) { json.dy = this.dy; } return json; } } const __vite_glob_0_5$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiModelLink, default: DDeiModelLink }, Symbol.toStringTag, { value: "Module" })); var __defProp$2 = Object.defineProperty; var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField$2 = (obj, key, value) => { __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; const expressBindValueReg = /#\{[^\{\}]*\}/; const contentSplitReg = /\+|\-|\*|\//; const isNumberReg = /^[+-]?\d*(\.\d*)?(e[+-]?\d+)?$/; const safariReg = /Safari/; const chromeReg = /Chrome/; const ytestReg = /(y+)/; const _DDeiUtil = class _DDeiUtil2 { /** * 计算文字的高度和宽度 */ static measureTextSize(ddInstance, text2, fontFamily, fontSize) { let canvas = ddInstance.render.getCanvas(); let ctx = canvas.getContext("2d"); ctx.save(); ctx.font = fontSize + "px " + fontFamily; let textArray = text2.split("\n"); let maxWidth = 0; let height = textArray.length * fontSize; textArray.forEach((t) => { let width = ctx.measureText(t).width; if (width > maxWidth) { maxWidth = width; } }); ctx.restore(); return { width: maxWidth, height }; } /** * 计算文字的高度和宽度 */ static measureText(text2, font, ctx, fontSize) { let key = text2 + "_" + font; if (!_DDeiUtil2.cacheTextCharSize.has(key)) { ctx.font = font; let rect = ctx.measureText(text2); _DDeiUtil2.cacheTextCharSize.set(key, { width: rect.width, height: rect.fontBoundingBoxAscent + rect.fontBoundingBoxDescent, dHeight: rect.fontBoundingBoxAscent }); } return _DDeiUtil2.cacheTextCharSize.get(key); } /** * 绘制圆角矩形 * @param ctx * @param x x * @param y y * @param width 宽度 * @param height 高度 * @param radius 圆角 * @param stroke 是否绘制 * @param strokeColor 绘制颜色 * @param fill 是否填充 * @param fillColor 填充颜色 */ static drawRectRound(ctx, x2, y2, width, height, radius = 0, stroke = true, strokeColor = "black", fill = true, fillColor = "white") { if ((stroke || fill) && width > 0 && height > 0) { ctx.save(); ctx.beginPath(); ctx.arc(x2 + radius, y2 + radius, radius, Math.PI, Math.PI * 3 / 2); ctx.lineTo(width - radius + x2, y2); ctx.arc(width - radius + x2, radius + y2, radius, Math.PI * 3 / 2, Math.PI * 2); ctx.lineTo(width + x2, height + y2 - radius); ctx.arc(width - radius + x2, height - radius + y2, radius, 0, Math.PI * 1 / 2); ctx.lineTo(radius + x2, height + y2); ctx.arc(radius + x2, height - radius + y2, radius, Math.PI * 1 / 2, Math.PI); ctx.closePath(); if (fill) { ctx.fillStyle = fillColor; ctx.fill(); } if (stroke) { ctx.strokeStyle = strokeColor; ctx.stroke(); } ctx.restore(); } } /** * 将一组控件按照从上到下从左到右的顺序进行排序,返回新的顺序 * @param element */ static getSortedModels(models) { let returnArray = new Array(); if (models) { let modelArray = null; if (models.set) { modelArray = Array.from(models.values()); } else { modelArray = models; } modelArray.forEach((model) => { let insert = false; for (let i2 = returnArray.length - 1; i2 > 0; i2--) { let rm = returnArray[i2]; if (rm.y <= model.y) { returnArray.splice(i2 + 1, 0, model); insert = true; break; } else if (rm.y == model.y && rm.x <= model.x) { returnArray.splice(i2 + 1, 0, model); insert = true; break; } } if (!insert) { returnArray.splice(0, 0, model); } }); } return returnArray; } /** * 获取影子图形 * @param model */ static getShadowControl(model) { let md = null; if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { md = _DDeiUtil2.cloneModel(model, true); md.id = md.id + "_shadow"; let rows = []; let cols = []; for (let i2 = 0; i2 < model.rows.length; i2++) { let rowObj = model.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let smi = rowObj[j2]; let sm = _DDeiUtil2.getShadowControl(smi); sm.pModel = md; if (!rows[sm.row]) { rows[sm.row] = []; } rows[sm.row][sm.col] = sm; if (!cols[sm.col]) { cols[sm.col] = []; } cols[sm.col][sm.row] = sm; } } md.rows = rows; md.cols = cols; md.initRender(); } else { md = _DDeiUtil2.cloneModel(model, true); md.id = md.id + "_shadow"; if ((md == null ? void 0 : md.baseModelType) == "DDeiContainer") { let newModels = /* @__PURE__ */ new Map(); md.models.forEach((smi) => { let sm = _DDeiUtil2.getShadowControl(smi); sm.id = sm.id.substring(0, sm.id.lastIndexOf("_shadow")); sm.pModel = md; newModels.set(sm.id, sm); sm.initRender(); }); md.models = newModels; } md.initRender(); } return md; } //克隆模型,只克隆关键属性 static cloneModel(sourceModel, isShadowClone = false) { var _a3, _b2, _c2; if (!sourceModel) { return; } let returnModel = clone(sourceModel); if (isShadowClone) { returnModel.clps = []; returnModel.isShadowControl = true; } if (returnModel.layoutManager) { returnModel.layoutManager = clone(sourceModel.layoutManager); returnModel.layoutManager.container = returnModel; } returnModel.pvs = []; sourceModel.pvs.forEach((pv) => { returnModel.pvs.push(clone(pv)); }); returnModel.sptStyle = cloneDeep(sourceModel.sptStyle); returnModel.textArea = []; (_a3 = sourceModel.textArea) == null ? void 0 : _a3.forEach((pv) => { returnModel.textArea.push(clone(pv)); }); returnModel.exPvs = {}; for (let i2 in sourceModel.exPvs) { returnModel.exPvs[i2] = clone(sourceModel.exPvs[i2]); } returnModel.cpv = clone(sourceModel.cpv); returnModel.bpv = clone(sourceModel.bpv); returnModel.ovs = cloneDeep(sourceModel.ovs); if (((_b2 = sourceModel.composes) == null ? void 0 : _b2.length) > 0) { let composes = []; (_c2 = sourceModel.composes) == null ? void 0 : _c2.forEach((com) => { let comp = _DDeiUtil2.cloneModel(com); comp.pModel = returnModel; composes.push(comp); }); returnModel.composes = composes; } returnModel.unicode = _DDeiUtil2.getUniqueCode(); returnModel.initPVS(); return returnModel; } /** * 返回某个点旋转后的坐标 */ static getRotatedPoint(point2, rotate2 = 0) { let vc = new Vector3(point2.x, point2.y, point2.z || point2.z == 0 ? point2.z : 1); if (rotate2) { let angle2 = (-rotate2 * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); vc.applyMatrix3(rotateMatrix); } return vc; } /** * 返回dom绝对坐标 * @param element */ static getDomAbsPosition(element, editor) { let actualLeft = element.offsetLeft; let actualTop = element.offsetTop; let current = element.offsetParent; while (current) { actualLeft += current.offsetLeft; actualTop += current.offsetTop + current.clientTop; current = current.offsetParent; } if (editor) { let editorElement = document.getElementById(editor.id); let editorPos = _DDeiUtil2.getDomAbsPosition(editorElement); actualLeft -= editorPos.left; actualTop -= editorPos.top; } return { left: actualLeft, top: actualTop }; } /** * 返回dom到editor元素之间的滚动高度 * @param element */ static getDomScroll(element, editor) { let scrollTop = 0; let scrollLeft = 0; let current = element.parentElement; let editorElement = document.getElementById(editor.id); while (current && current != editorElement) { scrollTop += current.scrollTop; scrollLeft += current.scrollLeft; current = current.parentElement; } return { left: scrollLeft, top: scrollTop }; } /** * 返回控件在dom下的绝对坐标 * @param element */ static getModelsDomAbsPosition(models) { var _a3; if ((models == null ? void 0 : models.length) > 0) { let outRect; if (models.length == 1) { let model = models[0]; if (model.rotate) { let pvs2 = model.operatePVS ? model.operatePVS : model.pvs; let zeroPvs = _DDeiUtil2.pointsToZero(pvs2, model.cpv, model.rotate); zeroPvs = _DDeiUtil2.zeroToPoints(zeroPvs, model.cpv, 0, 1, 1); outRect = DDeiAbstractShape.pvsToOutRect(zeroPvs); outRect.rotate = model.rotate; } else { outRect = DDeiAbstractShape.getOutRectByPV(models); outRect.rotate = 0; } } else { outRect = DDeiAbstractShape.getOutRectByPV(models); outRect.rotate = 0; } let stageRatio2 = (_a3 = models[0].stage) == null ? void 0 : _a3.getStageRatio(); outRect.x *= stageRatio2; outRect.x1 *= stageRatio2; outRect.y *= stageRatio2; outRect.y1 *= stageRatio2; outRect.width *= stageRatio2; outRect.height *= stageRatio2; let wpv = models[0].stage.wpv; let domEle = models[0].stage.ddInstance.render.realCanvas.parentElement; let canvasPos = _DDeiUtil2.getDomAbsPosition(domEle); outRect.left = canvasPos.left + outRect.x + wpv.x; outRect.top = canvasPos.top + outRect.y + wpv.y; outRect.cLeft = canvasPos.left; outRect.cTop = canvasPos.top; outRect.cWidth = domEle.clientWidth; outRect.cHeight = domEle.clientHeight; return outRect; } else { return null; } } static sortRendList(model) { var _a3; let rendList = []; if (((_a3 = model.composes) == null ? void 0 : _a3.length) > 0) { rendList = rendList.concat(model.composes); } rendList.push(model); rendList.sort((a, b) => { if ((a.cIndex || a.cIndex == 0) && (b.cIndex || b.cIndex == 0)) { return a.cIndex - b.cIndex; } else if ((a.cIndex || a.cIndex == 0) && !(b.cIndex || b.cIndex == 0)) { return 1; } else if (!(a.cIndex || a.cIndex == 0) && (b.cIndex || b.cIndex == 0)) { return -1; } else { return 0; } }); return rendList; } /** * 设置样式属性,自动创建不存在的层级 * @param model 模型 * @param paths 样式路径,支持传入多个 * @param value 值 */ static setStyle(model, paths, value) { if (model) { let pathArray; if (typeof paths == "string") { pathArray = [paths]; } else { pathArray = paths; } pathArray.forEach((path) => { if (path != "") { let attrPaths = path.split("."); let curObj = model; for (let i2 = 0; i2 < attrPaths.length; i2++) { if (i2 != attrPaths.length - 1) { if (!curObj[attrPaths[i2]]) { curObj[attrPaths[i2]] = {}; } curObj = curObj[attrPaths[i2]]; } else { curObj[attrPaths[i2]] = value; } } } }); } } /** * 根据Path获取JSON的数据 * 如果data路径中存在override,则强制覆盖不从上级获取 */ static getDataByPathList(data, ...paths) { if (data && paths) { for (let ix = 0; ix < paths.length; ix++) { if (paths[ix]) { let obj = paths[ix]; let pathArray = null; if (typeof obj == "string") { pathArray = paths[ix].split("."); try { let returnJSON = _DDeiUtil2.getDataByPath(data, pathArray); if ((returnJSON == null ? void 0 : returnJSON.data) || (returnJSON == null ? void 0 : returnJSON.data) == 0) { return returnJSON.data; } } catch (e) { } } else if (Array.isArray(obj)) { if (obj.length > 0) { for (let jx = 0; jx < obj.length; jx++) { pathArray = obj[jx].split("."); try { let returnJSON = _DDeiUtil2.getDataByPath(data, pathArray); if ((returnJSON == null ? void 0 : returnJSON.data) || (returnJSON == null ? void 0 : returnJSON.data) == 0) { return returnJSON.data; } } catch (e) { } } } } } } } return null; } /** * 根据配置定义,设置属性值 * @param model 模型 * @param paths 属性路径,支持传入多个 * @param value值 * @return 由构成的属性的实际路径和配置中对应的值组成的Map */ static setAttrValueByPath(model, paths, value) { if (model && paths) { let attrPaths = null; if (typeof paths == "string") { attrPaths = paths.split(","); } else { attrPaths = paths; } for (let i2 = 0; i2 < attrPaths.length; i2++) { let attCode = attrPaths[i2]; let attrCodePaths = attCode.split("."); let currentObj = model; for (let j2 = 0; j2 < attrCodePaths.length; j2++) { let code = attrCodePaths[j2]; if (j2 == attrCodePaths.length - 1) { currentObj[code] = value; } else { if (!currentObj[code]) { currentObj[code] = {}; } currentObj = currentObj[code]; } } } } } /** * 生成唯一编码 * @returns */ static getUniqueCode() { let data = (/* @__PURE__ */ new Date()).getTime(); if (window.performance && typeof window.performance.now === "function") { data += performance.now(); } let codeId = "xxxxxxxxxxxx6xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(msg) { let rand = (data + Math.random() * 16) % 16 | 0; data = Math.floor(data / 16); return (msg == "x" ? rand : rand & 3 | 8).toString(16); }); return codeId; } /** * 求两点距离 */ static getPointDistance(x0, y0, x1, y1) { return Math.sqrt((x1 - x0) ** 2 + (y1 - y0) ** 2); } /** * 创建依附快捷控件 * @param model 被依附控件 * @param text 文本 */ static createDepLinkModel(model, text2, type = null) { var _a3, _b2; if (text2 && model) { let stage2 = model.stage; let ddInstance = stage2.ddInstance; let editState = _DDeiUtil2.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: [model] }, ddInstance); if (editState == 0 || editState == 1) { let realModel = null; let posPoint = null; let posType; let isCreateRealModel = false; let isLineLM = false; if (model.baseModelType == "DDeiLine") { posType = type ? type : 3; let pi = Math.floor(model.pvs.length / 2); if (model.pvs.length % 3 == 0) { posPoint = model.pvs[pi]; } else { posPoint = { x: (model.pvs[pi - 1].x + model.pvs[pi].x) / 2, y: (model.pvs[pi - 1].y + model.pvs[pi].y) / 2 }; } model.linkModels.forEach((lm) => { if (lm.type == posType) { realModel = lm.dm; } }); if (!realModel) { isCreateRealModel = true; isLineLM = true; } } else { let modelDefine = _DDeiUtil2.getControlDefine(model); if ((_b2 = (_a3 = modelDefine == null ? void 0 : modelDefine.define) == null ? void 0 : _a3.sample) == null ? void 0 : _b2.depPos) { let depPos = modelDefine.define.sample.depPos; let essBounds = model.essBounds; let dmEssBounds = { width: 80, height: 18 }; posType = depPos.type; if (!type || posType == type) { if (depPos.type == 5) { posPoint = model.cpv; } else if (depPos.type == 6) { posPoint = { x: model.cpv.x, y: essBounds.y - dmEssBounds.height / 2 }; } else if (depPos.type == 7) { posPoint = { x: essBounds.x1 + dmEssBounds.width / 2, y: model.cpv.y }; } else if (depPos.type == 8) { posPoint = { x: model.cpv.x, y: essBounds.y1 + dmEssBounds.height / 2 }; } else if (depPos.type == 9) { posPoint = { x: essBounds.x - dmEssBounds.width / 2, y: model.cpv.y }; } isCreateRealModel = true; } } } if (isCreateRealModel) { let dataJson = { modelCode: "100200" }; let controlDefine = _DDeiUtil2.getControlDefine(dataJson); for (let i2 in controlDefine == null ? void 0 : controlDefine.define) { dataJson[i2] = cloneDeep(controlDefine.define[i2]); } dataJson["id"] = "lsm_" + stage2.idIdx++; dataJson["width"] = 80; dataJson["height"] = 28; dataJson["font"] = { size: 12 }; dataJson["text"] = text2; dataJson["textStyle"] = { paddingWeight: 0 }; if (isLineLM) { dataJson["fill"] = { type: 1, color: "white" }; } realModel = ddInstance.controlModelClasses["DDeiPolygon"].initByJSON( dataJson, { currentStage: stage2, currentDdInstance: ddInstance, currentContainer: model.pModel } ); let move1Matrix = new Matrix3( 1, 0, posPoint.x, 0, 1, posPoint.y, 0, 0, 1 ); realModel.transVectors(move1Matrix); model.layer.addModel(realModel, false); realModel.initRender(); let lineLink = new DDeiModelLink({ depModel: model, type: posType, dm: realModel, dx: 0, dy: 0 }); realModel.depModel = model; model.linkModels.set(realModel.id, lineLink); } } } } /** * 已知两点求其中间以及延长线上的第三点,有len和rate两种计算策略,如果超出按out值,返回实际长度(0),或者按照out设置的值作为长度比例 * @param x0 点1x * @param y0 点1y * @param x1 点2x * @param y1 点2y * @param mode 模式,1长度,2比例 * @param value 值 * @param out 超出策略,-1原样,其他,比例 */ static getPathPoint(x0, y0, x1, y1, mode = 1, value = 0, out = -1, distance = null) { let pointDistance = distance ? distance : _DDeiUtil2.getPointDistance(x0, y0, x1, y1); let targetLen; let rate; if (mode == 1) { targetLen = value; if (out != -1 && targetLen > pointDistance) { targetLen = pointDistance * out; } rate = targetLen / pointDistance; } else { targetLen = pointDistance * value; if (out != -1 && targetLen > pointDistance) { targetLen = pointDistance * out; } rate = targetLen / pointDistance; } let sita = parseFloat(_DDeiUtil2.getLineAngle(x0, y0, x1, y1).toFixed(4)); let point2 = new Vector3(targetLen, 0, 1); let m12 = new Matrix3(); if (sita != 0 && sita != 360) { let angle2 = (-sita * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let moveMatrix2 = new Matrix3( 1, 0, x0, 0, 1, y0, 0, 0, 1 ); m12.premultiply(moveMatrix2); point2.applyMatrix3(m12); point2.sita = sita; point2.rate = rate; point2.len = targetLen; return point2; } /** * 判断点是否在线上 */ static isPointInLine(q, p1, p2) { if (!p1 || !p2 || !q) { return false; } let x0 = q.x; let y0 = q.y; let plLength = Infinity; let x1 = p1.x; let y1 = p1.y; let x2 = p2.x; let y2 = p2.y; if (x1 == x2 && y1 == y2) { plLength = _DDeiUtil2.getPointDistance(x0, y0, x1, y1); } else { let s = (x0 - x1) * (y2 - y1) - (y0 - y1) * (x2 - x1); let d = _DDeiUtil2.getPointDistance(x0, y0, x1, y1); plLength = s / d; } if (Math.abs(plLength) <= 1) { return true; } } /** * 获取移动路径 */ static getMovePath(sAngle, eAngle, startPoint, endPoint) { let movePath = ""; switch (sAngle) { case 0: { switch (eAngle) { case 180: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:-0.25,x:-1.5,y:0.25"; } } else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:-0.5,x:-1.5,y:-0.5"; } else { movePath = "x:0.5,y:-1"; } } else { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:0.5,x:-1.5,y:0.5"; } else { movePath = "x:0.5,y:1"; } } } break; case -90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:-0.25,x:-1.25"; } } else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:-1.25,x:-1.25"; } else { movePath = "x:0.5,y:-1.25,x:0.5"; } } else { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:0.5,x:-1.25"; } else { movePath = "x:1"; } } } break; case 90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:0.25,x:-1.25,y:-0.25"; } } else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:-0.5,x:-1.25"; } else { movePath = "x:1"; } } else { if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:1.25,x:-1.25"; } else { movePath = "x:0.5,y:1.25,x:0.5"; } } } break; case 0: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { movePath = "x:0.25,y:0.25,x:-1.25,y:-0.25"; } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "x:0.25,y:-1"; } else if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:-1"; } else { movePath = "x:1.25,y:-1"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "x:0.25,y:1"; } else if (startPoint.x > endPoint.x) { movePath = "x:0.25,y:1"; } else { movePath = "x:1.25,y:1"; } } } break; } } break; case 180: { switch (eAngle) { case 0: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = ""; } else { movePath = "x:-0.25,y:-0.25,x:1.5,y:0.25"; } } else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) { movePath = "x:-0.25,y:-1"; } else { movePath = "x:-0.25,y:-0.5,x:1.5,y:-0.5"; } } else { if (startPoint.x > endPoint.x) { movePath = "x:-0.25,y:1"; } else { movePath = "x:-0.25,y:0.5,x:1.5,y:0.5"; } } } break; case -90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x < endPoint.x) { movePath = "x:-0.25,y:-0.25,x:1.25,y:0.25"; } } else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) { movePath = "x:-0.5,y:-1.25,x:-0.5"; } else { movePath = "x:-0.25,y:-1.25,x:1.25"; } } else { if (startPoint.x > endPoint.x) { movePath = "x:-1"; } else { movePath = "x:-0.25,y:0.5,x:1.25"; } } } break; case 90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x < endPoint.x) { movePath = "x:-0.25,y:0.25,x:1.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "x:-1"; } else { movePath = "x:-0.25,y:-0.5,x:1.25"; } } else { if (startPoint.x > endPoint.x) { movePath = "x:-0.5,y:1.25,x:-0.5"; } else { movePath = "x:-0.5,y:1.25,x:1.5"; } } } break; case 180: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "x:-0.25,y:-0.25,x:-1,y:0.25"; } else { movePath = "x:-0.25,y:-0.25,x:1,y:0.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "x:-0.25,y:-1"; } else if (startPoint.x > endPoint.x) { movePath = "x:-1.25,y:-1"; } else { movePath = "x:-0.25,y:-1"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "x:-0.25,y:1"; } else if (startPoint.x > endPoint.x) { movePath = "x:-1.25,y:1"; } else { movePath = "x:-0.25,y:1"; } } } break; } } break; case -90: { switch (eAngle) { case 90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) ; else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "y:-0.5,x:-1"; } else { movePath = "y:-0.5,x:1"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "y:-0.25,x:-0.5,y:1.5,x:-0.5"; } else if (startPoint.x > endPoint.x) { movePath = "y:-0.25,x:-0.5,y:1.5,x:-0.5"; } else { movePath = "y:-0.25,x:0.5,y:1.5,x:0.5"; } } } break; case 0: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x < endPoint.x) { movePath = "y:-0.5,x:1.25,y:0.5"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "y:-1"; } else { movePath = "y:-0.5,x:1.25,y:-0.5"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "y:-0.25,x:0.5,y:1.25"; } else if (startPoint.x > endPoint.x) { movePath = "y:-0.25,x:-0.5,y:1.25"; } else { movePath = "y:-0.25,x:1.25,y:1.25"; } } } break; case 180: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "y:-0.5,x:-1.25,y:0.5"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "y:-0.5,x:-1.25,y:-0.5"; } else { movePath = "y:-1"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "y:-0.25,x:-0.5,y:1.25"; } else if (startPoint.x > endPoint.x) { movePath = "y:-0.25,x:-1.25,y:1.25"; } else { movePath = "y:-0.25,x:0.5,y:1.25"; } } } break; case -90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "y:-0.25,x:-1"; } else { movePath = "y:-0.25,x:1"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "y:-0.25,x:-0.5,y:-1,x:0.5"; } else if (startPoint.x > endPoint.x) { movePath = "y:-1.25,x:-1"; } else { movePath = "y:-1.25,x:1"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "y:-0.25,x:-0.5,y:1.25,x:0.5"; } else if (startPoint.x > endPoint.x) { movePath = "y:-0.25,x:-1"; } else { movePath = "y:-0.25,x:1"; } } } break; } } break; case 90: { switch (eAngle) { case -90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) ; else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "y:0.25,x:0.5,y:-1.5,x:-0.5"; } else if (startPoint.x > endPoint.x) { movePath = "y:0.25,x:-0.5,y:-1.5,x:-0.5"; } else { movePath = "y:0.25,x:0.5,y:-1.5,x:0.5"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "y:0.5,x:-1"; } else { movePath = "y:0.5,x:1"; } } } break; case 0: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x < endPoint.x) { movePath = "y:0.5,x:1.25,y:-0.5"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "y:0.25,x:-0.5,y:-1.25"; } else { movePath = "y:0.25,x:1.25,y:-1.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "y:1"; } else { movePath = "y:0.5,x:1.25,y:0.5"; } } } break; case 180: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "y:0.5,x:-1.25,y:-0.5"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "y:0.25,x:-1.25,y:-1.25"; } else { movePath = "y:0.25,x:0.5,y:-1.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "y:0.5,x:-1.25,y:0.5"; } else { movePath = "y:1"; } } } break; case 90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) ; else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "y:0.25,x:-0.5,y:-1,x:0.5"; } else if (startPoint.x > endPoint.x) { movePath = "y:0.25,x:-1"; } else { movePath = "y:0.25,x:1"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "y:0.25,x:0.5,y:1,x:-0.5"; } else if (startPoint.x > endPoint.x) { movePath = "y:1.25,x:-1"; } else { movePath = "y:1.25,x:1"; } } } break; } } break; } return movePath; } /** * 判断两条线段是否相交 * @param l1 线段1 * @param l2 线段2 * @returns */ static isLineCross(l1, l2) { if ((l1.x1 > l1.x2 ? l1.x1 : l1.x2) < (l2.x1 < l2.x2 ? l2.x1 : l2.x2) || (l1.y1 > l1.y2 ? l1.y1 : l1.y2) < (l2.y1 < l2.y2 ? l2.y1 : l2.y2) || (l2.x1 > l2.x2 ? l2.x1 : l2.x2) < (l1.x1 < l1.x2 ? l1.x1 : l1.x2) || (l2.y1 > l2.y2 ? l2.y1 : l2.y2) < (l1.y1 < l1.y2 ? l1.y1 : l1.y2)) { return false; } if (((l1.x1 - l2.x1) * (l2.y2 - l2.y1) - (l1.y1 - l2.y1) * (l2.x2 - l2.x1)) * ((l1.x2 - l2.x1) * (l2.y2 - l2.y1) - (l1.y2 - l2.y1) * (l2.x2 - l2.x1)) > 0 || ((l2.x1 - l1.x1) * (l1.y2 - l1.y1) - (l2.y1 - l1.y1) * (l1.x2 - l1.x1)) * ((l2.x2 - l1.x1) * (l1.y2 - l1.y1) - (l2.y2 - l1.y1) * (l1.x2 - l1.x1)) > 0) { return false; } return true; } /** * 取得两条线相交的点 * @param p1 线1点1 * @param p2 线1点2 * @param p3 线2点1 * @param p4 线2点2 * @returns */ static getLineCorssPoint(p1, p2, p3, p4) { let abc = (p1.x - p3.x) * (p2.y - p3.y) - (p1.y - p3.y) * (p2.x - p3.x); let abd = (p1.x - p4.x) * (p2.y - p4.y) - (p1.y - p4.y) * (p2.x - p4.x); if (abc * abd >= 0) { return null; } let cda = (p3.x - p1.x) * (p4.y - p1.y) - (p3.y - p1.y) * (p4.x - p1.x); let cdb = cda + abc - abd; if (cda * cdb >= 0) { return null; } let t = cda / (abd - abc); let dx = t * (p2.x - p1.x), dy = t * (p2.y - p1.y); return { x: p1.x + dx, y: p1.y + dy }; } /** * 两个矩形是否相交 * @param rect1 * @param rect2 * @returns */ static isRectCross(rect1, rect2) { let maxX, maxY, minX, minY; maxX = rect1.x + rect1.width >= rect2.x + rect2.width ? rect1.x + rect1.width : rect2.x + rect2.width; maxY = rect1.y + rect1.height >= rect2.y + rect2.height ? rect1.y + rect1.height : rect2.y + rect2.height; minX = rect1.x <= rect2.x ? rect1.x : rect2.x; minY = rect1.y <= rect2.y ? rect1.y : rect2.y; if (maxX - minX <= rect1.width + rect2.width && maxY - minY <= rect1.height + rect2.height) { return true; } else { return false; } } /** * 计算线段相对于窗口的角度 */ static getLineAngle(x1, y1, x2, y2, radius = false) { x2 -= x1; y2 -= y1; let v1 = new Vector3(1, 0, 0); let v2 = new Vector3(x2, y2, 0); if (radius) { return v1.angleTo(v2); } else { let lineAngle = v1.angleTo(v2) * 180 / Math.PI; if (v1.cross(v2).z < 0) { lineAngle = -lineAngle; } return lineAngle; } } /** * 计算两条线的夹角,连续相邻折线 */ static getLinesAngle(l1x1, l1y1, l1x2, l1y2, l2x1, l2y1, l2x2, l2y2, radius = false) { let vectorZero1 = new Vector3(1, 0, 0); let vectorZero2 = new Vector3(1, 0, 0); let vectorA = new Vector3(l1x1 - l1x2, l1y1 - l1y2, 0); let vectorB = new Vector3(l2x2 - l1x2, l2y2 - l1y2, 0); let angle1 = vectorZero1.angleTo(vectorA); if (vectorZero1.cross(vectorA).z < 0) { angle1 = -angle1; } let angle2 = vectorZero2.angleTo(vectorB); if (vectorZero2.cross(vectorB).z < 0) { angle2 = -angle2; } let ar1 = angle1; let ar2 = angle2; let angleRadians = ar2 - ar1; if (!radius) { angleRadians = angleRadians * 180 / Math.PI; } return angleRadians; } /** * 根据Path获取JSON的数据 * 如果data路径中存在override,则强制覆盖不从上级获取 */ static getDataByPath(data, path) { if (!path || path.length === 0) { return { data, overwrite: (data == null ? void 0 : data.overwrite) === true }; } let currentData = data; let isOverwrite = false; for (let i2 = 0; i2 < path.length; i2++) { const p = path[i2]; if (p.includes("[")) { const [arrayName, indexStr] = p.split("["); const index = parseInt(indexStr); if (!isNaN(index) && Array.isArray(currentData[arrayName])) { currentData = currentData[arrayName][index]; } else { return { data: null, overwrite: false }; } } else { currentData = currentData[p]; } if (currentData == null) { return { data: null, overwrite: false }; } if (currentData.overwrite === true) { isOverwrite = true; } } return { data: currentData, overwrite: isOverwrite }; } /** * 获取设备像素比 */ static getPixelRatio(context) { let backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; window.remRatio = window.rem > 168 ? window.rem / 168 : 1; let ratio = (window.devicePixelRatio || 1) / backingStore; return ratio; } /** * 将任意单位的长度转换为像素 * @param number * @param unit */ static unitToPix(number, unit, dpi) { let unitWeight = 0; switch (unit) { case "mm": { unitWeight = _DDeiUtil2.mmToPx(number, dpi); break; } case "cm": { unitWeight = _DDeiUtil2.cmToPx(number, dpi); break; } case "m": { unitWeight = _DDeiUtil2.mToPx(number, dpi); break; } case "inch": { unitWeight = _DDeiUtil2.inchToPx(number, dpi); break; } case "px": { unitWeight = number; break; } } return unitWeight; } //毫米转像素 static mmToPx(mm, dpi) { return mm / 25.4 * dpi; } //厘米转像素 static cmToPx(cm, dpi) { return cm / 2.54 * dpi; } //米转像素 static mToPx(m, dpi) { return m / 0.0254 * dpi; } //英寸转像素 static inchToPx(inc, dpi) { return inc * dpi; } /** * 获取屏幕DPI */ static getDPI() { if (window.screen.deviceXDPI) { return { x: window.screen.deviceXDPI, y: window.screen.deviceYDPI }; } else { let tmpNode = document.createElement("DIV"); tmpNode.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden"; document.body.appendChild(tmpNode); let x2 = parseInt(tmpNode.offsetWidth); let y2 = parseInt(tmpNode.offsetHeight); tmpNode.parentNode.removeChild(tmpNode); return { x: x2, y: y2 }; } } // 16进制编码转rgb static hex2rgb(hex) { let hexNum = hex.substring(1); hexNum = "0x" + (hexNum.length < 6 ? repeatLetter(hexNum, 2) : hexNum); let r = hexNum >> 16; let g = hexNum >> 8 & "0xff"; let b = hexNum & "0xff"; return `rgb(${r},${g},${b})`; } static hex2ddeicolor(hex) { let hexNum = hex.substring(1); hexNum = "0x" + (hexNum.length < 6 ? repeatLetter(hexNum, 2) : hexNum); let r = hexNum >> 16; let g = hexNum >> 8 & "0xff"; let b = hexNum & "0xff"; return new DDeiColor(r, g, b, 1); } static repeatWord(word, num) { let result = ""; for (let i2 = 0; i2 < num; i2++) { result += word; } return result; } static repeatLetter(word, num) { var result = ""; for (let letter of word) { result += repeatWord(letter, num); } return result; } // rgb转16进制 static rgb2hex(color) { if (color) { if (color.toLowerCase().startsWith("rgb")) { let rgb = color.split(","); let r = parseInt(rgb[0].split("(")[1]); let g = parseInt(rgb[1]); let b = parseInt(rgb[2].split(")")[0]); let hex = "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); return hex; } else if (color.startsWith("#")) { return color; } switch (color) { case "black": return "#000000"; case "white": return "#FFFFFF"; case "red": return "#FF0000"; case "green": return "#00FF00"; case "blue": return "#0000FF"; case "grey": return "#808080"; case "yellow": return "#FFFF00"; } } return ""; } // 将颜色转换为可用颜色(rgb),其他情况原样返回 static getColor(color) { if (!color) { return null; } if (typeof color == "string" && color.startsWith("#")) { return _DDeiUtil2.hex2rgb(color); } else { return color; } } // 将颜色转换为可用颜色(rgb),其他情况原样返回 static getColorObj(color) { if (!color) { return null; } if (typeof color == "string" && color.startsWith("#")) { return _DDeiUtil2.hex2ddeicolor(color); } else { let hexColor = _DDeiUtil2.rgb2hex(color); return _DDeiUtil2.hex2ddeicolor(hexColor); } } /** * 四舍五入保留小数 * @param number 原始数字 * @param pos 小数位数 */ static round(number, pos = 0) { let n = number.toFixed(pos); return parseFloat(n); } /** * 将N个点,归0坐标 */ static pointsToZero(points, cpv, rotate2) { if ((points == null ? void 0 : points.length) > 0 && cpv) { let toZeroMatrix = new Matrix3( 1, 0, -cpv.x, 0, 1, -cpv.y, 0, 0, 1 ); if (rotate2) { let angle2 = _DDeiUtil2.preciseTimes(rotate2, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); toZeroMatrix.premultiply(rotateMatrix); } let returnPoints = []; points.forEach((pv) => { let npv = new Vector3(); for (let i2 in pv) { npv[i2] = pv[i2]; } npv.z = pv.z || pv.z === 0 ? pv.z : 1; npv.applyMatrix3(toZeroMatrix); returnPoints.push(npv); }); return returnPoints; } return []; } /** * 将N个归0点,放回坐标 */ static zeroToPoints(points, cpv, rotate2, scaleX2 = 1, scaleY2 = 1) { if ((points == null ? void 0 : points.length) > 0 && cpv) { let m12 = new Matrix3( 1, 0, 0, 0, 1, 0, 0, 0, 1 ); if (scaleX2 != 1 || scaleY2 != 1) { let scaleMatrix2 = new Matrix3( scaleX2, 0, 0, 0, scaleY2, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); } if (rotate2) { let angle2 = (-rotate2 * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let moveMatrix2 = new Matrix3( 1, 0, cpv.x, 0, 1, cpv.y, 0, 0, 1 ); m12.premultiply(moveMatrix2); let returnPoints = []; points.forEach((pv) => { let npv = new Vector3(); for (let i2 in pv) { npv[i2] = pv[i2]; } npv.z = pv.z || pv.z === 0 ? pv.z : 1; npv.applyMatrix3(m12); returnPoints.push(npv); }); return returnPoints; } return []; } /** * 根据类别获取OVS * @param ovs * @param type * @returns */ static getOVSByType(model, type) { var _a3, _b2, _c2; if (!type) { return model.ovs; } let returnOVS = []; let ovds = (_b2 = (_a3 = _DDeiUtil2.getControlDefine(model)) == null ? void 0 : _a3.define) == null ? void 0 : _b2.ovs; for (let i2 = 0; i2 < ((_c2 = model == null ? void 0 : model.ovs) == null ? void 0 : _c2.length); i2++) { let ov = model.ovs[i2]; let ovd = ovds[i2]; if (ovd.type == type) { returnOVS.push(ov); } } return returnOVS; } /** * 对坐标以及大小进行缩放,并返回新的坐标 * @param pos 原始位置 * @param ratio 缩放比率 * @returns 缩放后的坐标 */ static getRatioPosition(pos, ratio) { if (!pos) { return null; } else { let returnP = {}; if (pos.x || pos.x == 0) { returnP.x = pos.x * ratio; } if (pos.y || pos.y == 0) { returnP.y = pos.y * ratio; } if (pos.width || pos.width == 0) { returnP.width = pos.width * ratio; } if (pos.height || pos.height == 0) { returnP.height = pos.height * ratio; } return returnP; } } /** * 时间格式化 * @param date * @param fmt * @returns */ static formatDate(date, fmt) { let o = { "M+": date.getMonth() + 1, //月份 "d+": date.getDate(), //日 "h+": date.getHours(), //小时 "m+": date.getMinutes(), //分 "s+": date.getSeconds() //秒 }; if (ytestReg.test(fmt)) { fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); } for (let k in o) { if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)); } return fmt; } /** * 复制属性值,再将最终的结果返回,如果目标不存在属性,则动态创建 * @param source 源 * @param dist 目标 */ static copyJSONValue(source, dist) { let distType; if (dist) { distType = typeof dist; } let sourceType = typeof source; let type = distType && distType != "undefined" ? distType : sourceType; if (type != void 0 && type != void 0) { switch (type) { case "string": return source; case "number": return source; case "bigint": return source; case "boolean": return source; case "function": return source; case "object": { if (!dist) { dist = {}; } for (let i2 in source) { dist[i2] = _DDeiUtil2.copyJSONValue(source[i2], dist[i2]); } return dist; } } } return null; } /** * 判断是否具备某种权限 * @operate 操作 * @control 控件 * @propName 属性 * @mode 模式 */ static isAccess(operate, control, propName, mode, ddInstance) { let strkey = "AC_" + mode + "_" + operate; if (control) { if (propName) { let accessValue3 = _DDeiUtil2.getConfigValue(strkey + "_" + control.id + "_" + propName, ddInstance); if (accessValue3 || accessValue3 == false) { return accessValue3; } else { if (control.code) { accessValue3 = _DDeiUtil2.getConfigValue(strkey + "_" + control.code + "_" + propName, ddInstance); } if (accessValue3 || accessValue3 == false) { return accessValue3; } else { if (control.modelCode) { accessValue3 = _DDeiUtil2.getConfigValue(strkey + "_" + control.modelCode + "_" + propName, ddInstance); } if (accessValue3 || accessValue3 == false) { return accessValue3; } else { if (control.modelType) { accessValue3 = _DDeiUtil2.getConfigValue(strkey + "_" + control.modelType + "_" + propName, ddInstance); } if (accessValue3 || accessValue3 == false) { return accessValue3; } } } } } let accessValue2 = _DDeiUtil2.getConfigValue(strkey + "_" + control.id, ddInstance); if (accessValue2 || accessValue2 == false) { return accessValue2; } else { if (control.code) { accessValue2 = _DDeiUtil2.getConfigValue(strkey + "_" + control.code, ddInstance); } if (accessValue2 || accessValue2 == false) { return accessValue2; } else { if (control.modelCode) { accessValue2 = _DDeiUtil2.getConfigValue(strkey + "_" + control.modelCode, ddInstance); } if (accessValue2 || accessValue2 == false) { return accessValue2; } else { if (control.modelType) { accessValue2 = _DDeiUtil2.getConfigValue(strkey + "_" + control.modelType, ddInstance); } if (accessValue2 || accessValue2 == false) { return accessValue2; } } } } } let accessValue = _DDeiUtil2.getConfigValue(strkey, ddInstance); if (accessValue || accessValue == false) { return accessValue; } return true; } /** * 获取配置属性值 * @param key key */ static getConfigValue(key, ddInstance) { if (ddInstance && (ddInstance[key] || ddInstance[key] == false || ddInstance[key] == 0)) { return ddInstance[key]; } else { return DDeiConfig$1[key]; } } /** *@param num:格式化目标数字 *@param decimal:保留几位小数,默认2位 *@param split:千分位分隔符,默认为空 */ static formatNumber(num, decimal = 0, split = "") { if (num != null && num != void 0 && isFinite(num)) { let res = ""; let dotIndex = String(num).indexOf("."); if (dotIndex === -1) { if (decimal === 0) { res = String(num).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`); } else { res = String(num).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`) + "." + "0".repeat(decimal); } } else { let numStr = String((Math.round(num * Math.pow(10, decimal)) / Math.pow(10, decimal)).toFixed(decimal)); let decimals = numStr.slice(dotIndex, dotIndex + decimal + 1); res = String(numStr.slice(0, dotIndex)).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`) + decimals; } return res; } else { return num; } } /** * 是否为safari浏览器 */ static isSafari() { return safariReg.test(navigator.userAgent) && !chromeReg.test(navigator.userAgent); } /** * 获取可替换的数据值 * 主要用于得到经过业务替换值绑定后的数据 * @param model 对象 * @param keypath 属性路径,一般用.隔开 * @param format 是否需要格式化 * @param replaceSPT 是否替换特殊样式 */ static getReplacibleValue(model, keypath, format = false, replaceSPT = false, initData = null) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k; if (model) { let hasTempSpt = false; let replaceDetail = null; let originValue = (_a3 = model == null ? void 0 : model.render) == null ? void 0 : _a3.getCachedValue(keypath); if (!originValue && initData) { let rp1 = keypath.split("."); if (rp1.length > 1) { let detailCode = rp1.slice(1); let rd = _DDeiUtil2.getDataByPath(initData, detailCode); if (rd) { originValue = rd.data; } } } let returnValue = originValue; if (originValue && originValue.indexOf("#") != -1) { let busiData = _DDeiUtil2.getBusiData(model.stage.ddInstance); if (busiData) { let replaceResult = _DDeiUtil2.expressBindValue(originValue, busiData); if (replaceResult == null ? void 0 : replaceResult.data) { returnValue = replaceResult.data; replaceDetail = replaceResult.detail; } } } let hasFormatted = false; if (format) { let fmtType = (_b2 = model == null ? void 0 : model.render) == null ? void 0 : _b2.getCachedValue("fmt.type"); let formatValue = null; switch (fmtType) { case 1: { let scale = (_c2 = model == null ? void 0 : model.render) == null ? void 0 : _c2.getCachedValue("fmt.nscale"); let tmark = (_d2 = model == null ? void 0 : model.render) == null ? void 0 : _d2.getCachedValue("fmt.tmark"); formatValue = _DDeiUtil2.formatNumber(returnValue, !scale || isNaN(scale) ? 0 : scale, tmark == 1 ? "," : ""); } break; case 2: { let mrmb = (_e2 = model == null ? void 0 : model.render) == null ? void 0 : _e2.getCachedValue("fmt.mrmb"); if (mrmb == 1) { formatValue = _DDeiUtil2.toBigMoney(returnValue); } else { let scale = (_f = model == null ? void 0 : model.render) == null ? void 0 : _f.getCachedValue("fmt.nscale"); let tmark = (_g = model == null ? void 0 : model.render) == null ? void 0 : _g.getCachedValue("fmt.tmark"); let munit = (_h = model == null ? void 0 : model.render) == null ? void 0 : _h.getCachedValue("fmt.munit"); let mmark = (_i = model == null ? void 0 : model.render) == null ? void 0 : _i.getCachedValue("fmt.mmark"); formatValue = _DDeiUtil2.formatNumber(returnValue, !scale || isNaN(scale) ? 0 : scale, tmark == 1 ? "," : ""); formatValue = (mmark ? mmark : "") + formatValue + (munit ? munit : ""); } } break; case 3: { let dtype = (_j = model == null ? void 0 : model.render) == null ? void 0 : _j.getCachedValue("fmt.dtype"); let isFmt = false; let dv = null; if (isDate$1(returnValue)) { isFmt = true; dv = returnValue; } else if (isString(returnValue) || isNumber(returnValue) && ("" + returnValue).length == 13) { try { dv = new Date(parseInt(returnValue)); isFmt = true; } catch (e) { } } if (isFmt) { switch (dtype) { case 1: { formatValue = _DDeiUtil2.formatDate(dv, "yyyy-MM-dd"); } break; case 2: { formatValue = _DDeiUtil2.formatDate(dv, "hh:mm:ss"); } break; case 3: { formatValue = _DDeiUtil2.formatDate(dv, "yyyy-MM-dd hh:mm:ss"); } break; case 99: { let format2 = (_k = model == null ? void 0 : model.render) == null ? void 0 : _k.getCachedValue("fmt.format"); if (format2) { formatValue = _DDeiUtil2.formatDate(dv, format2); } } break; } } } break; } if (formatValue) { if (returnValue != formatValue && model.render && replaceSPT && model.sptStyle) { let tempSptStyleArr = _DDeiUtil2.sptStyleToArray(JSON.parse(JSON.stringify(model.sptStyle))); let tempStyle = null; for (let i2 = 0; i2 < tempSptStyleArr.length; i2++) { let v = tempSptStyleArr[i2]; if (v && JSON.stringify(v) != "{}") { tempStyle = v; break; } } if (tempStyle) { tempSptStyleArr = _DDeiUtil2.copyElementToArray(tempStyle, formatValue.length); } if ((tempSptStyleArr == null ? void 0 : tempSptStyleArr.length) > 0) { model.render.tempSptStyle = _DDeiUtil2.sptStyleArrayToObject(tempSptStyleArr); hasTempSpt = true; } else { delete model.render.tempSptStyle; } } else { delete model.render.tempSptStyle; } returnValue = formatValue; hasFormatted = true; } } if (!hasFormatted && model.render && replaceSPT && (replaceDetail == null ? void 0 : replaceDetail.length) > 0 && model.sptStyle) { let tempSptStyleArr = _DDeiUtil2.sptStyleToArray(JSON.parse(JSON.stringify(model.sptStyle))); let deltaI = 0; replaceDetail.forEach((detail) => { let sidx = detail.index; let eidx = detail.index + detail.bind.length; let tempStyle = null; for (let i2 = sidx; i2 < eidx; i2++) { let v = _DDeiUtil2.getDataByPathList(model, "sptStyle." + i2); if (v && JSON.stringify(v) != "{}") { tempStyle = v; break; } } if (tempStyle) { let insertArr = _DDeiUtil2.copyElementToArray(tempStyle, detail.value.length); tempSptStyleArr.splice(sidx + deltaI, eidx - sidx, ...insertArr); deltaI += detail.value.length - eidx + sidx; } }); if ((tempSptStyleArr == null ? void 0 : tempSptStyleArr.length) > 0) { hasTempSpt = true; model.render.tempSptStyle = _DDeiUtil2.sptStyleArrayToObject(tempSptStyleArr); } } if (!hasTempSpt) { delete model.render.tempSptStyle; } return returnValue; } return null; } /** * 把一个元素复制到一个数组中 * @param element * @param size */ static copyElementToArray(element, size) { let arr = []; if (size > 0) { for (let i2 = 0; i2 < size; i2++) { let data = cloneDeep(element); arr.push(data); } } return arr; } /** * 将sptStyle,按照key的大小转换为数组形式 * @param sptStyle */ static sptStyleToArray(sptStyle) { let max = -Infinity, min = Infinity; let arr = []; for (let i2 in sptStyle) { max = Math.max(max, parseInt(i2)); min = Math.min(min, parseInt(i2)); } if (max != -Infinity && min != Infinity) { for (let i2 = 0; i2 < min; i2++) { arr.push(null); } for (let i2 = min; i2 <= max; i2++) { arr.push(sptStyle[i2]); } } return arr; } /** * 将sptStyle,按照key的大小转换为数组形式 * @param sptStyle */ static sptStyleArrayToObject(sptStyle) { let obj = {}; for (let i2 = 0; i2 < sptStyle.length; i2++) { if (sptStyle[i2]) { obj[i2] = sptStyle[i2]; } } return obj; } /** * 用于处理绑定字段或文本的表达式替换 * @return 返回替换后的字符串,以及替换的详情信息 */ static expressBindValue(originValue, busiData, row) { if (originValue && originValue.indexOf("#{") != -1) { let t = originValue; let replaceData = ""; let replaceDetail = []; let usedCharIdx = 0; while (t && t != "") { let result = expressBindValueReg.exec(t); if (result != null && result.length > 0) { replaceData += t.substring(0, result.index); let rs = result[0].replaceAll(" ", ""); let aer = this.analysisExpress(rs.substring(2, rs.length - 1), busiData, row); replaceDetail.push({ index: result.index + usedCharIdx, bind: result[0], value: aer }); replaceData += aer; usedCharIdx += result.index + result[0].length; t = t.substr(result.index + result[0].length); } else { replaceData += t; break; } } return { data: replaceData, detail: replaceDetail }; } } /** * 处理表达式计算,格式如下: * 列表.行#费用 列表的当前行费用 * 列表.行#费用-列表.行#收入 列表当前行费用-当前行收入 * 列表.0#费用 第一行的费用字段 * 列表.数量 列表长度 * 列表.平均#费用 对列表中的费用字段求平均值 * 列表.求和#费用 对列表中的费用字段求合 * 列表.求和#收入-列表#求和#费用 列表中收入-费用 * 列表.求和#收入-100 列表中收入-100 */ static analysisExpress(expressContent, busiData, row) { expressContent = expressContent.replaceAll(" ", ""); let expressArray = expressContent.split(contentSplitReg); if (expressArray != null && expressArray.length > 0) { for (let i2 = 0; i2 < expressArray.length; i2++) { let ea = expressArray[i2]; let eaValue = this.calculExpressValue(ea, busiData, row); expressContent = expressContent.replaceAll(ea, eaValue); } } try { if (contentSplitReg.test(expressContent)) { expressContent = expressContent.replaceAll("null", "0"); let result = new Function("return " + expressContent)(); return result; } else { return expressContent.replaceAll("null", ""); } } catch (e) { console.error(e); return ""; } } //解析简单的,不带任何运算符号的表达式 static calculExpressValue(ea, busiData, row) { let rd = null; if (isNumberReg.test(ea)) { return ea; } else { if (ea.indexOf(".") == -1 && ea.indexOf("#") == -1) { rd = busiData[ea]; } else if (ea.indexOf(".") != -1) { try { let listKey = ea.split(".")[0]; let listDataExpress = ea.split(".")[1]; if (listKey && listDataExpress) { let listSubKey = listDataExpress.split("#")[0]; let listData = busiData[listKey]; if ("平均" == listSubKey || "平均值" == listSubKey) { let listSubEP = listDataExpress.split("#")[1]; if (busiData[ea + "_catch_avg"]) { rd = busiData[ea + "_catch_avg"]; } else { let countNum = 0; if (busiData[ea + "_catch_count"]) { countNum = busiData[ea + "_catch_count"]; } else { for (let i2 = 0; i2 < listData.length; i2++) { var ld = listData[i2][listSubEP]; if (ld && isNumberReg.test(ld)) { countNum += parseFloat(ld); } } busiData[ea + "_catch_count"] = countNum; } let avgNNum = countNum / listData.length; busiData[ea + "_catch_avg"] = avgNNum; rd = avgNNum; } } else if ("最大" == listSubKey || "最大值" == listSubKey) { let listSubEP = listDataExpress.split("#")[1]; let maxNum = null; if (busiData[ea + "_catch_max"]) { maxNum = busiData[ea + "_catch_max"]; } else { for (let i2 = 0; i2 < listData.length; i2++) { let ld2 = listData[i2][listSubEP]; if (ld2 && isNumberReg.test(ld2)) { if (maxNum == null) { maxNum = ld2; } else if (maxNum < ld2) { maxNum = ld2; } } } busiData[ea + "_catch_max"] = maxNum; } rd = maxNum; } else if ("最小" == listSubKey || "最小值" == listSubKey) { let listSubEP = listDataExpress.split("#")[1]; let minNum = null; if (busiData[ea + "_catch_min"]) { minNum = busiData[ea + "_catch_min"]; } else { for (let i2 = 0; i2 < listData.length; i2++) { let ld2 = listData[i2][listSubEP]; if (ld2 && isNumberReg.test(ld2)) { if (minNum == null) { minNum = ld2; } else if (minNum > ld2) { minNum = ld2; } } } busiData[ea + "_catch_min"] = minNum; } rd = minNum; } else if ("合计" == listSubKey || "求和" == listSubKey || "求合" == listSubKey) { let listSubEP = listDataExpress.split("#")[1]; let countNum = 0; if (busiData[ea + "_catch_count"]) { countNum = busiData[ea + "_catch_count"]; } else { for (let i2 = 0; i2 < listData.length; i2++) { var ld = listData[i2][listSubEP]; if (ld && isNumberReg.test(ld)) { countNum += parseFloat(ld); } } busiData[ea + "_catch_count"] = countNum; } rd = countNum; } else if ("数量" == listSubKey || "长度" == listSubKey) { rd = busiData[listKey].length; } else if ("尾行" == listSubKey) { let listSubEP = listDataExpress.split("#")[1]; let ld2 = listData[listData.length - 1][listSubEP]; if (ld2 && isNumberReg.test(ld2)) { rd = parseFloat(ld2); } else if (ld2) { rd = ld2; } } else if ("首行" == listSubKey) { let listSubEP = listDataExpress.split("#")[1]; let ld2 = listData[0][listSubEP]; if (ld2 && isNumberReg.test(ld2)) { rd = parseFloat(ld2); } else if (ld2) { rd = ld2; } } else if ("行" == listSubKey) { let listSubEP = listDataExpress.split("#")[1]; let ld2 = listData[row][listSubEP]; if (ld2 && isNumberReg.test(ld2)) { rd = parseFloat(ld2); } else if (ld2) { rd = ld2; } } else if (isNumberReg.test(listSubKey)) { let listSubEP = listDataExpress.split("#")[1]; let ld2 = listData[listSubKey][listSubEP]; if (ld2 && isNumberReg.test(ld2)) { rd = parseFloat(ld2); } else if (ld2) { rd = ld2; } } } } catch (e) { console.error(e); } } } if (rd != null && isNumberReg.test(rd)) { return rd; } else if (rd) { return rd; } return null; } /** * 对输入数据进行合并拆分等处理,主要用来处理分页打印,多页打印等功能 */ static analysisDataFromTemplate(iData, templateJSON) { let tableListConfig = {}; let pdJSON = templateJSON; for (let j2 in pdJSON.rootModels) { if (pdJSON.rootModels[j2].modelType == "PDTable") { let outDataRowStrategy = pdJSON.rootModels[j2]["outDataRowStrategy"]; if (outDataRowStrategy == 1 || outDataRowStrategy == "1") { let maxDataRow = pdJSON.rootModels[j2]["maxDataRow"]; if (maxDataRow != 0 && maxDataRow != null && maxDataRow != "") { let table2 = pdJSON.rootModels[j2]; let dataRowStart = -1; let dataRowEnd = -1; let listKey = null; for (let ri = 0; ri < table2.rows.length; ri++) { for (let rj = 0; rj < table2.rows[ri].length; rj++) { let curCell = table2.rows[ri][rj]; if (curCell.dataRow == 2 || curCell.dataRow == "2" || curCell.attrs["dataRow"] == 2 || curCell.attrs["dataRow"] == "2") { if (dataRowStart == -1) { dataRowStart = ri; } if (dataRowEnd < ri) { dataRowEnd = ri; } let expressContent = null; if (curCell.bindField || curCell.attrs.bindField) { expressContent = curCell.bindField ? curCell.bindField : curCell.attrs.bindField; } else if (curCell.text && curCell.text.indexOf("#{") != -1) { let t = curCell.text; let reg = /#\{[^\{\}]*\}/g; let result = reg.exec(t); if (result != null && result.length > 0) { let rs = result[0].replaceAll(" ", ""); expressContent = rs.substring(2, rs.length - 1); } } if (expressContent) { expressContent = expressContent.replaceAll(" ", ""); let expressArray = expressContent.split(contentSplitReg); if (expressArray != null && expressArray.length > 0) { for (let i2 = 0; i2 < expressArray.length; i2++) { let ea = expressArray[i2]; if (ea.indexOf(".") != -1) { try { listKey = ea.split(".")[0]; } catch (e) { } } } } } } } } if (listKey) { let rowNum = parseInt(maxDataRow / (dataRowEnd - dataRowStart + 1)); if (rowNum >= 1) { tableListConfig[listKey] = rowNum; } } } } } } let newIDatas = []; for (let listKey in tableListConfig) { if (iData[listKey] && tableListConfig[listKey] && tableListConfig[listKey] > 0 && iData[listKey].length > tableListConfig[listKey]) { let subArrays = this.subArrayGroup(iData[listKey], tableListConfig[listKey]); for (let si = 0; si < subArrays.length; si++) { let newIData = cloneDeep(iData); newIData[listKey] = subArrays[si]; newIDatas[newIDatas.length] = newIData; } } } if (newIDatas.length == 0) { newIDatas[0] = iData; } return newIDatas; } /** * 以templateJSON为模板,循环inputData,替换模板值后,生成新的JSON数组返回 */ static analysisBindData(inputData, templateJSON) { let processDatas = inputData.flatMap((idata) => this.analysisDataFromTemplate(idata, templateJSON)); return processDatas.map((idata) => { let pdJSON = JSON.parse(JSON.stringify(templateJSON.toJSON())); this.processWatermark(pdJSON.pdPaper, idata); for (let control of pdJSON.rootModels) { if (control.modelType === "PDTable") { this.processTableControl(control, idata); } else if (control.modelType === "PDImage") { this.processImageControl(control, idata); } else { this.processTextControl(control, idata); } } return pdJSON; }); } // 处理水印 static processWatermark(pdPaper, idata) { let watermarkReplaceData = this.processTextOrBindFieldExpress(pdPaper, idata); if (watermarkReplaceData) { pdPaper.watermarkBase64 = watermarkReplaceData; pdPaper.attrs["watermarkBase64"] = watermarkReplaceData; pdPaper.watermark = watermarkReplaceData; pdPaper.attrs["watermark"] = watermarkReplaceData; pdPaper.bindField = null; pdPaper.attrs["bindField"] = null; } } // 处理表格控件 static processTableControl(table2, idata) { } // 处理图片控件 static processImageControl(control, idata) { let replaceData = this.processTextOrBindFieldExpress(control, idata); if (replaceData) { control.base64 = replaceData; control.attrs["base64"] = replaceData; control.src = replaceData; control.attrs["src"] = replaceData; control.bindField = null; control.attrs["bindField"] = null; } } // 处理文本控件 static processTextControl(control, idata) { let replaceData = this.processTextOrBindFieldExpress(control, idata); control.text = replaceData; control.attrs["text"] = replaceData; control.bindField = null; control.attrs["bindField"] = null; control.convertToRMBY = "1"; } /** * 用于处理绑定字段或文本的表达式替换 */ static processTextOrBindFieldExpress(control, idata, row) { if (control.bindField || control.attrs.bindField) { let replaceData = ""; let expressContent = control.bindField ? control.bindField : control.attrs.bindField; replaceData = this.analysisExpress(expressContent, idata, row); if (!replaceData) { replaceData = ""; } if (control.attrs.convertToRMBY == 2 || control.attrs.convertToRMBY == "2" || control.convertToRMBY == 2 || control.convertToRMBY == "2") { replaceData = PDSetting.dealBigMoney(replaceData); } return replaceData; } else if (control.text && control.text.indexOf("#{") != -1) { let t = control.text; let replaceData = ""; while (t && t != "") { let reg = /#\{[^\{\}]*\}/g; let result = reg.exec(t); if (result != null && result.length > 0) { replaceData += t.substring(0, result.index); let rs = result[0].replaceAll(" ", ""); let aer = this.analysisExpress(rs.substring(2, rs.length - 1), idata, row); if (control.attrs.convertToRMBY == 2 || control.attrs.convertToRMBY == "2" || control.convertToRMBY == 2 || control.convertToRMBY == "2") { aer = this.dealBigMoney(aer); } replaceData += aer; t = t.substr(result.index + result[0].length); } else { replaceData += t; break; } } return replaceData; } else if (control.text) { if (control.attrs.convertToRMBY == 2 || control.attrs.convertToRMBY == "2" || control.convertToRMBY == 2 || control.convertToRMBY == "2") { return this.dealBigMoney(control.text); } else { return control.text; } } } /** * 转换为人民币大写 * @param money 数字 * @returns */ static toBigMoney(money) { let cnNums = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"); let cnIntRadice = new Array("", "拾", "佰", "仟"); let cnIntUnits = new Array("", "万", "亿", "兆"); let cnDecUnits = new Array("角", "分", "毫", "厘"); let cnInteger = "整"; let cnIntLast = "元"; let maxNum = 1e15; let integerNum; let decimalNum; let chineseStr = ""; let parts; if (money == "" || money == null || money == void 0) { return ""; } money = parseFloat(money); if (money >= maxNum) { return ""; } if (money == 0) { chineseStr = cnNums[0] + cnIntLast + cnInteger; return chineseStr; } money = money.toString(); if (money.indexOf(".") == -1) { integerNum = money; decimalNum = ""; } else { parts = money.split("."); integerNum = parts[0]; decimalNum = parts[1].substr(0, 4); } if (parseInt(integerNum, 10) > 0) { let zeroCount = 0; let IntLen = integerNum.length; for (let i2 = 0; i2 < IntLen; i2++) { let n = integerNum.substr(i2, 1); let p = IntLen - i2 - 1; let q = p / 4; let m = p % 4; if (n == "0") { zeroCount++; } else { if (zeroCount > 0) { chineseStr += cnNums[0]; } zeroCount = 0; chineseStr += cnNums[parseInt(n)] + cnIntRadice[m]; } if (m == 0 && zeroCount < 4) { chineseStr += cnIntUnits[q]; } } chineseStr += cnIntLast; } if (decimalNum != "") { let decLen = decimalNum.length; for (let i2 = 0; i2 < decLen; i2++) { let n = decimalNum.substr(i2, 1); if (n != "0") { chineseStr += cnNums[Number(n)] + cnDecUnits[i2]; } } } if (chineseStr == "") { chineseStr += cnNums[0] + cnIntLast + cnInteger; } else if (decimalNum == "") { chineseStr += cnInteger; } return chineseStr; } /** * 精准返回num1除以num2的结果 */ static preciseDiv(num1, num2) { let t1 = 0, t2 = 0, r1, r2; try { t1 = num1.toString().split(".")[1].length; } catch (e) { } try { t2 = num2.toString().split(".")[1].length; } catch (e) { } r1 = Number(num1.toString().replace(".", "")); r2 = Number(num2.toString().replace(".", "")); return r1 / r2 * Math.pow(10, t2 - t1); } /** * 精准返回num1乘以num2的结果 */ static preciseTimes(num1, num2) { let m = 0, s1 = num1.toString(), s2 = num2.toString(); try { m += s1.split(".")[1].length; } catch (e) { } try { m += s2.split(".")[1].length; } catch (e) { } return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m); } /** * 精准返回num1+num2的结果 */ static preciseAdd(num1, num2) { let r1, r2, m; try { r1 = num1.toString().split(".")[1].length; } catch (e) { r1 = 0; } try { r2 = num2.toString().split(".")[1].length; } catch (e) { r2 = 0; } m = Math.pow(10, Math.max(r1, r2)); return (num1 * m + num2 * m) / m; } /** * 精准返回num1-num2的结果 */ static preciseSub(num1, num2) { let r1, r2, m, n; try { r1 = num1.toString().split(".")[1].length; } catch (e) { r1 = 0; } try { r2 = num2.toString().split(".")[1].length; } catch (e) { r2 = 0; } m = Math.pow(10, Math.max(r1, r2)); n = r1 >= r2 ? r1 : r2; return parseFloat(((num1 * m - num2 * m) / m).toFixed(n)); } /** * 读取最近写入颜色 */ static readRecentlyChooseColors() { let colorStrs = localStorage.getItem("ddei-recently-choose-colors"); if (colorStrs) { let colors = colorStrs.split(","); _DDeiUtil2.recentlyChooseColors = colors; } } /** * 写入最近选取颜色 */ static whiteRecentlyChooseColors(newValue) { if (!_DDeiUtil2.recentlyChooseColors) { _DDeiUtil2.recentlyChooseColors = []; } if (_DDeiUtil2.recentlyChooseColors.indexOf(newValue) != -1) { _DDeiUtil2.recentlyChooseColors.splice(_DDeiUtil2.recentlyChooseColors.indexOf(newValue), 1); } _DDeiUtil2.recentlyChooseColors.splice(0, 0, newValue); if (_DDeiUtil2.recentlyChooseColors.length > 10) { _DDeiUtil2.recentlyChooseColors.splice(10, 1); } localStorage.setItem("ddei-recently-choose-colors", _DDeiUtil2.recentlyChooseColors.toString()); } static canvasToImage(canvas) { return new Promise((resolve, rejected) => { let dataURL = canvas.toDataURL("image/png"); let img = new Image(); img.src = dataURL; img.onload = function() { resolve(img); }; img.onerror = function() { rejected(img); }; }); } /** * 将当前实例的stage转换为image * @param ddInstance * @param width * @param height */ static stageScreenToImage(ddInstance, width, height) { return new Promise((resolve, rejected) => { try { let canvas = document.createElement("canvas"); let ctx = canvas.getContext("2d"); let rat1 = ddInstance.render.ratio; let rat2 = Math.max(ddInstance.pixel, _DDeiUtil2.getPixelRatio(ctx)); ddInstance.render.tempCanvas = canvas; let models = ddInstance.stage.getLayerModels(); let outRect = DDeiAbstractShape.getOutRectByPV(models); let lineOffset = models[0].render.getCachedValue("border.width"); let addWidth = 0; if (lineOffset) { addWidth = lineOffset * rat1; if (models.length > 1) { addWidth = lineOffset * 2; } } let scaleW = 1, scaleH = 1; if (outRect.width * rat1 > width * rat1) { scaleW = width / outRect.width; } if (outRect.height * rat1 > height * rat1) { scaleH = height / outRect.height; } canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat2 + ");display:block;zoom:" + 1 / rat2); if (scaleW != 1 || scaleH != 1) { canvas.setAttribute("width", width * rat1 + addWidth); canvas.setAttribute("height", height * rat1 + addWidth); ctx.translate(-outRect.x * rat1 * scaleW + addWidth / 2, -outRect.y * rat1 * scaleH + addWidth / 2); ctx.scale(scaleW, scaleH); } else { canvas.setAttribute("width", outRect.width * rat1 + addWidth); canvas.setAttribute("height", outRect.height * rat1 + addWidth); ctx.translate(-outRect.x * rat1 + addWidth / 2, -outRect.y * rat1 + addWidth / 2); } models.forEach((item) => { item.render.drawShape(); }); let base64 = canvas.toDataURL("image/png"); ddInstance.render.tempCanvas = null; resolve(base64); } catch (e) { ddInstance.render.tempCanvas = null; resolve(""); } }); } /** * 将当前实例的stage按一定大小比例剪切为多张图片 */ static async cutStageToImages(ddInstance, stage2, width, height, sx, sy, ex, ey, scaleSize = 2, bg = false, mask = false, autoScale = false) { return new Promise((resolve, rejected) => { var _a3; try { let canvas = document.createElement("canvas"); let ctx = canvas.getContext("2d"); let oldRat1 = ddInstance.render.ratio; let rat1 = scaleSize ? scaleSize : oldRat1; let stageRatio2 = stage2.getStageRatio(); ddInstance.render.tempCanvas = canvas; ddInstance.render.ratio = rat1; let editorId = _DDeiUtil2.getEditorId(ddInstance); let containerDiv = document.getElementById(editorId + "_ddei_cut_img_div"); canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;zoom:" + 1 / rat1); canvas.setAttribute("width", width * rat1); canvas.setAttribute("height", height * rat1); containerDiv.appendChild(canvas); let imagesBase64 = []; let forceBreak = false; for (let i2 = sy; (ey > i2 || Math.abs(ey - height - i2) <= 0.01) && !forceBreak; i2 = i2 + height) { for (let j2 = sx; (ex > j2 || Math.abs(ex - width - j2) <= 0.01) && !forceBreak; j2 = j2 + width) { ctx.save(); ctx.clearRect(0, 0, width * rat1, height * rat1); ctx.translate(-j2 * rat1, -i2 * rat1); for (let li = stage2.layers.length - 1; li >= 0; li--) { if (stage2.layers[li].display == 1 && stage2.layers[li].print != false) { if (bg) { stage2.layers[li].render.drawBackground(sx * rat1, sy * rat1, (ex - sx) * rat1, (ey - sy) * rat1); } } } ctx.restore(); ctx.save(); if (autoScale) { let models = stage2.getLayerModels(); let outRect = DDeiAbstractShape.getOutRectByPV(models); let scaleW = outRect.width / stageRatio2 / width; let scaleH = outRect.height / stageRatio2 / height; ctx.scale(1 / scaleW, 1 / scaleH); ctx.translate(-outRect.x * rat1 / stageRatio2, -outRect.y * rat1 / stageRatio2); forceBreak = true; } else { ctx.translate(-j2 * rat1, -i2 * rat1); } ctx.scale(1 / stageRatio2, 1 / stageRatio2); let hasPrint = true; stage2.render.selector.resetState(); for (let li = stage2.layers.length - 1; li >= 0; li--) { if (stage2.layers[li].display == 1 && stage2.layers[li].print != false) { stage2.layers[li].opPoints = []; delete stage2.layers[li].opLine; (_a3 = stage2.layers[li].shadowControls) == null ? void 0 : _a3.forEach((c) => { c.destroyed(); }); stage2.layers[li].shadowControls = []; stage2.layers[li].render.drawShape(false); hasPrint = true; } } ctx.restore(); if (mask) { ctx.save(); ctx.scale(1 / stageRatio2, 1 / stageRatio2); stage2.render.drawMark(); ctx.restore(); } if (hasPrint) { let base64 = canvas.toDataURL("image/png"); imagesBase64.push(base64); } } } ddInstance.render.ratio = oldRat1; ddInstance.render.tempCanvas = null; containerDiv.removeChild(canvas); resolve(imagesBase64); } catch (e) { ddInstance.render.tempCanvas = null; resolve(""); } }); } /** * 根据属性获取纸张大小 */ static getPaperSize(stage2, paperType, useRat = true) { let paperWidth = 0; let paperHeight = 0; let paperInit; if (stage2.ddInstance.paper && typeof stage2.ddInstance.paper == "object") { paperInit = stage2.ddInstance.paper; } if (!paperType) { paperType = DDeiModelArrtibuteValue.getAttrValueByState(stage2, "paper.type", true, paperInit); } let paperConfig = DDeiConfig$1.PAPER[paperType]; if (paperConfig) { let stageRatio2 = stage2.getStageRatio(); let ratio; if (useRat) { let rat1 = stage2.render.ddRender.ratio; ratio = rat1 * stageRatio2; } else { ratio = stageRatio2; } let xDPI = stage2.ddInstance.dpi.x; let paperDirect = DDeiModelArrtibuteValue.getAttrValueByState(stage2, "paper.direct", true, paperInit); let w = paperConfig.width; let h = paperConfig.height; let unit = paperConfig.unit; if (paperType == "自定义") { let custWidth = DDeiModelArrtibuteValue.getAttrValueByState(stage2, "paper.width", true, paperInit); if (custWidth || custWidth == 0) { w = custWidth; } let custHeight = DDeiModelArrtibuteValue.getAttrValueByState(stage2, "paper.height", true, paperInit); if (custHeight || custHeight == 0) { h = custHeight; } let custUnit = DDeiModelArrtibuteValue.getAttrValueByState(stage2, "paper.unit", true, paperInit); if (custUnit) { unit = custUnit; } } if (paperDirect == 1 || paperDirect == "1") { paperWidth = _DDeiUtil2.unitToPix(w, unit, xDPI) * ratio; paperHeight = _DDeiUtil2.unitToPix(h, unit, xDPI) * ratio; } else { paperHeight = _DDeiUtil2.unitToPix(w, unit, xDPI) * ratio; paperWidth = _DDeiUtil2.unitToPix(h, unit, xDPI) * ratio; } } return { width: paperWidth, height: paperHeight }; } static dataURLtoBlob(dataurl) { let arr = dataurl.split(","), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); while (n--) { u8arr[n] = bstr.charCodeAt(n); } return new Blob([u8arr], { type: mime }); } /** * 将页面坐标(像素)转换为标尺坐标 * @param point 转换的点 * @param stage 舞台 * @param unit 单位 */ static toRulerCoord(point2, stage2, unit) { let stageRatio2 = stage2.getStageRatio(); let xDPI = stage2.ddInstance.dpi.x; let rulerConfig = DDeiConfig$1.RULER[unit]; let unitWeight = _DDeiUtil2.unitToPix(rulerConfig.size, unit, xDPI); let marginWeight = unitWeight * stageRatio2; return { x: (point2.x - stage2.spv.x) / marginWeight * rulerConfig.size, y: (point2.y - stage2.spv.y) / marginWeight * rulerConfig.size, unit }; } /** * 将标尺坐标转换为页面坐标(像素) * @param point 转换的点 * @param stage 舞台 * @param unit 单位 */ static toPageCoord(point2, stage2, unit) { let stageRatio2 = (stage2 == null ? void 0 : stage2.ratio) ? stage2.ratio : stage2.getStageRatio(); let xDPI = stage2.dpi ? stage2.dpi : stage2.ddInstance.dpi.x; let unitWeight = _DDeiUtil2.unitToPix(1, unit, xDPI) * stageRatio2; return { x: point2.x * unitWeight + (stage2.spv ? stage2.spv.x : 0), y: point2.y * unitWeight + (stage2.spv ? stage2.spv.y : 0) }; } /** * 转换子元素的坐标 * @param container 容器 * @param stage 画布 * @param unit 单位 */ static convertChildrenJsonUnit(model, stage2, unit) { var _a3; if (model.cpv) { let cpv = _DDeiUtil2.toPageCoord({ x: model.cpv.x, y: model.cpv.y }, stage2, unit); model.cpv.x = cpv.x; model.cpv.y = cpv.y; } if (model.bpv) { let bpv2 = _DDeiUtil2.toPageCoord({ x: model.bpv.x, y: model.bpv.y }, stage2, unit); model.bpv.x = bpv2.x; model.bpv.y = bpv2.y; } if (model.hpv) { for (let k = 0; k < model.hpv.length; k++) { let hpv = _DDeiUtil2.toPageCoord({ x: model.hpv[k].x, y: model.hpv[k].y }, stage2, unit); model.hpv[k].x = hpv.x; model.hpv[k].y = hpv.y; } } if (model.exPvs) { for (let k in model.exPvs) { let pv = _DDeiUtil2.toPageCoord({ x: model.exPvs[k].x, y: model.exPvs[k].y }, stage2, unit); model.exPvs[k].x = pv.x; model.exPvs[k].y = pv.y; } } if (model.pvs) { for (let k = 0; k < model.pvs.length; k++) { let pv = _DDeiUtil2.toPageCoord({ x: model.pvs[k].x, y: model.pvs[k].y }, stage2, unit); model.pvs[k].x = pv.x; model.pvs[k].y = pv.y; } } if (((_a3 = model.composes) == null ? void 0 : _a3.length) > 0) { for (let k = 0; k < model.composes.length; k++) { _DDeiUtil2.convertChildrenJsonUnit(model.composes[k], stage2, unit); } } if (model.midList) { for (let i2 = 0; i2 < model.midList.length; i2++) { if (model.models[model.midList[i2]]) { let subModel = model.models[model.midList[i2]]; _DDeiUtil2.convertChildrenJsonUnit(subModel, stage2, unit); } } } } static addLineLink(model, smodel, point2, type) { var _a3, _b2; let pathPvs = smodel.pvs; let proPoints = DDeiAbstractShape.getProjPointDists(pathPvs, point2.x, point2.y, false, 1); let index = proPoints[0].index; let distance = _DDeiUtil2.getPointDistance(pathPvs[index].x, pathPvs[index].y, pathPvs[index + 1].x, pathPvs[index + 1].y); let sita = _DDeiUtil2.getLineAngle(pathPvs[index].x, pathPvs[index].y, pathPvs[index + 1].x, pathPvs[index + 1].y); let pointDistance = _DDeiUtil2.getPointDistance(pathPvs[index].x, pathPvs[index].y, proPoints[0].x, proPoints[0].y); let rate = pointDistance / distance; rate = rate > 1 ? rate : rate; let id = "_" + _DDeiUtil2.getUniqueCode(); let dmpath; if (type == 1) { dmpath = "startPoint"; smodel.exPvs[id] = new Vector3(model.startPoint.x, model.startPoint.y, model.startPoint.z); } else if (type == 2) { dmpath = "endPoint"; smodel.exPvs[id] = new Vector3(model.endPoint.x, model.endPoint.y, model.endPoint.z); } smodel.exPvs[id].rate = rate; smodel.exPvs[id].sita = sita; smodel.exPvs[id].index = index; smodel.exPvs[id].id = id; let link2 = new DDeiLink({ sm: smodel, dm: model, smpath: "exPvs." + id, dmpath, stage: model.stage }); (_a3 = model.stage) == null ? void 0 : _a3.addLink(link2); smodel.transVectors(new Matrix3()); smodel.updateLinkModels(); (_b2 = smodel.render) == null ? void 0 : _b2.enableRefreshShape(); } /** * 删除对象的属性 * @param obj 对象 * @param path 属性路径 */ static deletePropertyByPath(obj, path) { const parts = path.split("."); let current = obj; for (let i2 = 0; i2 < parts.length - 1; i2++) { if (current[parts[i2]] === void 0) { return; } current = current[parts[i2]]; } delete current[parts[parts.length - 1]]; } }; __publicField$2(_DDeiUtil, "getAttrValueByConfig"); __publicField$2(_DDeiUtil, "getControlDefine"); __publicField$2(_DDeiUtil, "getMenuConfig"); __publicField$2(_DDeiUtil, "getMenuControlId"); __publicField$2(_DDeiUtil, "showContextMenu"); __publicField$2(_DDeiUtil, "getSubControlJSON"); __publicField$2(_DDeiUtil, "getLineInitJSON"); __publicField$2(_DDeiUtil, "getModelInitJSON"); __publicField$2(_DDeiUtil, "getBusiData"); __publicField$2(_DDeiUtil, "getEditorText"); __publicField$2(_DDeiUtil, "getStyleValue"); __publicField$2(_DDeiUtil, "getEditorId"); __publicField$2(_DDeiUtil, "invokeCallbackFunc"); __publicField$2(_DDeiUtil, "notifyChange"); __publicField$2(_DDeiUtil, "getEditorInsByDDei"); __publicField$2(_DDeiUtil, "createControl"); __publicField$2(_DDeiUtil, "isBackActive"); __publicField$2(_DDeiUtil, "createRenderViewer", function(model, operate, tempShape, composeRender) { var _a3; if ((_a3 = model == null ? void 0 : model.stage) == null ? void 0 : _a3.ddInstance) { let editor = _DDeiUtil.getEditorInsByDDei(model.stage.ddInstance); if (editor) { editor.createRenderViewer(model, operate, tempShape, composeRender); } } }); __publicField$2(_DDeiUtil, "removeRenderViewer", function(model, operate, tempShape, composeRender) { var _a3; if ((_a3 = model == null ? void 0 : model.stage) == null ? void 0 : _a3.ddInstance) { let editor = _DDeiUtil.getEditorInsByDDei(model.stage.ddInstance); if (editor) { editor.removeRenderViewer(model, operate, tempShape, composeRender); } } }); __publicField$2(_DDeiUtil, "isModelHidden", function(model) { if (model.hidden) { return true; } else { let pModel = model.pModel; while (pModel && pModel.baseModelType != "DDeiLayer") { if (pModel.hidden) { return true; } pModel = pModel.pModel; } } return false; }); __publicField$2(_DDeiUtil, "offsetX"); __publicField$2(_DDeiUtil, "offsetY"); __publicField$2(_DDeiUtil, "screenX"); __publicField$2(_DDeiUtil, "screenY"); __publicField$2(_DDeiUtil, "p331t3", Math.pow(1 - 0.333, 3)); __publicField$2(_DDeiUtil, "p331t2", Math.pow(1 - 0.333, 2)); __publicField$2(_DDeiUtil, "p33t2", Math.pow(0.333, 2)); __publicField$2(_DDeiUtil, "p33t3", Math.pow(0.333, 3)); __publicField$2(_DDeiUtil, "p33t21t3", 3 * (1 - 0.333) * _DDeiUtil.p33t2); __publicField$2(_DDeiUtil, "p331t2t3", 3 * _DDeiUtil.p331t2 * 0.333); __publicField$2(_DDeiUtil, "p661t3", Math.pow(1 - 0.666, 3)); __publicField$2(_DDeiUtil, "p661t2", Math.pow(1 - 0.666, 2)); __publicField$2(_DDeiUtil, "p66t2", Math.pow(0.666, 2)); __publicField$2(_DDeiUtil, "p66t3", Math.pow(0.666, 3)); __publicField$2(_DDeiUtil, "p661t2t3", 3 * _DDeiUtil.p661t2 * 0.666); __publicField$2(_DDeiUtil, "p66t21t3", 3 * (1 - 0.666) * _DDeiUtil.p66t2); __publicField$2(_DDeiUtil, "cacheTextCharSize", /* @__PURE__ */ new Map()); __publicField$2(_DDeiUtil, "PI2", Math.PI * 2); __publicField$2(_DDeiUtil, "recentlyChooseColors", null); __publicField$2(_DDeiUtil, "USER_OS", ""); (() => { let userAgent = navigator.userAgent; _DDeiUtil.USER_OS = "WIN"; if (/Mac|iPod|iPhone|iPad/.test(userAgent)) { _DDeiUtil.USER_OS = "MAC"; } else if (/Linux/.test(userAgent)) { _DDeiUtil.USER_OS = "LINUX"; } })(); let DDeiUtil = _DDeiUtil; const DDeiUtil$1 = DDeiUtil; var __defProp$1 = Object.defineProperty; var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField$1 = (obj, key, value) => { __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; const _DDeiConfig = class _DDeiConfig2 { /** * 应用外部配置文件,覆写配置文件内容 * @param config */ static applyConfig(config2) { if (config2) { for (let i2 in config2) { if (i2 != "SERI_FIELDS") { _DDeiConfig2[i2] = config2[i2]; } } if (config2.SERI_FIELDS != void 0 && config2.SERI_FIELDS != null) { for (let i2 in config2.SERI_FIELDS) { _DDeiConfig2.SERI_FIELDS.set(i2, config2.SERI_FIELDS[i2]); } } } } /** * 获取系统缺省属性 * @param model 模型 */ static getSysDefaultData(model) { switch (model.modelType) { case "DDeiLayer": return _DDeiConfig2.LAYER; case "DDeiTable": return _DDeiConfig2.TABLE; case "DDeiTableCell": return _DDeiConfig2.TABLE.CELL; case "DDeiRectangle": return _DDeiConfig2.RECTANGLE; case "DDeiCircle": return _DDeiConfig2.CIRCLE; case "DDeiDiamond": return _DDeiConfig2.DIAMOND; case "DDeiSelector": return _DDeiConfig2.SELECTOR; case "DDeiPolygonContainer": return _DDeiConfig2.CONTAINER; case "DDeiStage": return _DDeiConfig2.STAGE; default: return null; } } /** * 根据配置文件的配置,将模型与渲染器绑定 * @param model 模型 */ static bindRender(model) { var _a3; let clsName = model.modelType + this.RENDER_TYPE + "Render"; if (model.modelType == "DDeiStage") { model.render = model == null ? void 0 : model.ddInstance.controlViewClasses[clsName].newInstance({ model }); } else { model.render = (_a3 = model.stage) == null ? void 0 : _a3.ddInstance.controlViewClasses[clsName].newInstance({ model }); } let modelDefine = DDeiUtil$1.getControlDefine(model); if (modelDefine == null ? void 0 : modelDefine.viewer) { model.render.viewer = modelDefine.viewer; } } }; __publicField$1(_DDeiConfig, "STORE_KEY", "DDEI"); __publicField$1(_DDeiConfig, "ROTATE_UNIT", Math.PI / 180); __publicField$1(_DDeiConfig, "RENDER_TYPE", "Canvas"); __publicField$1(_DDeiConfig, "ALLOW_CLIPBOARD"); __publicField$1(_DDeiConfig, "KEY_DOWN_STATE", /* @__PURE__ */ new Map()); __publicField$1(_DDeiConfig, "KEY_DOWN_INTERVAL", /* @__PURE__ */ new Map()); __publicField$1(_DDeiConfig, "KEY_DOWN_TIMES", /* @__PURE__ */ new Map()); __publicField$1(_DDeiConfig, "SERI_FIELDS", { "DDei": { "TOJSON": ["stage"], "SKIP": ["bus", "render", "unicode", "editMode"] }, "DDeiStage": { "TOJSON": ["layers", "links"], "SKIP": ["ddInstance", "selectedModels", "render", "unicode", "histroy", "histroyIdx", "sourceLinkCache", "distLinkCache", "tempCursorOPpoint", "tempStartOPpoint", "drawing"] }, "DDeiLayer": { "TOJSON": ["models"], "SKIP": ["ddInstance", "stage", "render", "unicode", "opPoints", "opLine", "dragInPoints", "dragOutPoints", "shadowControls", "layoutManager", "tempDisplay"] }, "DDeiContainer": { "TOJSON": ["models"], "SKIP": ["ddInstance", "__destroyed", "stage", "layer", "pModel", "render", "unicode", "hpv", "loosePVS", "x", "y", "width", "height", "layoutManager", "isShadowControl"] }, "AbstractShape": { "TOJSON": ["composes", "linkModels"], "SKIP": ["ddInstance", "depModel", "offsetY", "offsetX", "__destroyed", "stage", "layer", "pModel", "state", "render", "unicode", "loosePVS", "x", "y", "width", "height", "ruleEvals", "sample", "operatePVS", "isShadowControl"], "SKIP2": ["ddInstance", "stage", "layer", "pModel", "state", "render", "unicode", "loosePVS", "x", "y", "width", "height", "ruleEvals", "sample", "operatePVS", "isShadowControl", "pvs", "opps", "apvs", "textArea", "essBounds", "baseModelType"] }, "DDeiLine": { "SKIP": ["ddInstance", "__destroyed", "stage", "layer", "pModel", "state", "render", "unicode", "looseCanvas", "loosePVS", "x", "y", "width", "height", "startPoint", "endPoint", "cpv", "clps", "isShadowControl", "updateLooseCanvasSync", "baseModelType"] }, "DDeiTable": { "TOJSON": ["rows"], "SKIP": ["ddInstance", "stage", "layer", "pModel", "render", "unicode", "hpv", "loosePVS", "x", "y", "width", "height", "cols", "selector", "initColNum", "initRowNum", "tempDragCell", "tempDragType", "curCol", "curRow", "specilDrag", "tempUpCel", "dragChanging", "dragType", "dragCell", "isShadowControl"] }, "DDeiTableCell": { "TOJSON": ["models"], "SKIP": ["ddInstance", "stage", "layer", "pModel", "render", "unicode", "hpv", "loosePVS", "x", "y", "width", "height", "layoutManager", "id", "table", "mergedCell", "isShadowControl"] } }); __publicField$1(_DDeiConfig, "BORDER", { default: { width: 0, color: null, dash: null, round: 0 }, selected: { width: 1, color: "black", dash: null, round: 0 } }); __publicField$1(_DDeiConfig, "STAGE", { //水印 mark: { font: { family: "Microsoft YaHei", color: "grey", size: "16" } } }); __publicField$1(_DDeiConfig, "SELECTOR", { //选择器边框 border: { width: 1, color: "rgb(1,127,255)", dash: [10, 5], round: 0, selected: { width: 1, color: "rgb(1,127,255)", dash: [10, 5], round: 0 } }, //操作区域的填充样式,根据选中和未选中状态可以有所变化 OPERATE_ICON: { weight: 8, FILL: { default: "white", pass: "rgb(198,230,255)" } }, //间隔宽度,根据选中单个控件、选中多个控件,间隔宽度可以有所变化 PADDING_WEIGHT: { default: { single: 0, multiple: 0 }, selected: { single: 0, multiple: 10 } } }); __publicField$1(_DDeiConfig, "TABLE", { //选择器边框 selector: { border: { width: 2, color: "rgb(31,187,125)", dash: null, round: 0, selected: { width: 2, color: "rgb(31,187,125)", dash: null, round: 0 } }, //间隔宽度,根据选中单个控件、选中多个控件,间隔宽度可以有所变化 PADDING_WEIGHT: { default: { single: 0, multiple: 0 }, selected: { single: 0, multiple: 0 } } }, CELL: { border: { top: { width: 1, color: "black", dash: null, round: 0, disabled: false }, right: { width: 1, color: "black", dash: null, round: 0 }, bottom: { width: 1, color: "black", dash: null, round: 0, opacity: 1 }, left: { width: 1, color: "black", dash: null, round: 0, opacity: 1 }, selected: { top: { width: 1, color: "black", dash: null, round: 0 }, right: { width: 1, color: "black", dash: null, round: 0 }, bottom: { width: 1, color: "black", dash: null, round: 0 }, left: { width: 1, color: "black", dash: null, round: 0 } } } } }); __publicField$1(_DDeiConfig, "FILL", { default: { color: null }, selected: { color: "white" } }); __publicField$1(_DDeiConfig, "FONT", { default: { family: "Microsoft YaHei", color: "#000000", size: "16" }, selected: { family: "Microsoft YaHei", color: "#000000", size: "16" } }); __publicField$1(_DDeiConfig, "LAYER", { //背景的类型,0无背景,1纯色,2图片 type: 0, //背景色 bgcolor: "grey", //透明度,0完全透明~1完全不透明 opacity: 0.5 }); __publicField$1(_DDeiConfig, "RECTANGLE", { // 默认矩形边框 border: { top: { width: 1, color: "black", dash: null, round: 0, disabled: false }, right: { width: 1, color: "black", dash: null, round: 0 }, bottom: { width: 1, color: "black", dash: null, round: 0, opacity: 1 }, left: { width: 1, color: "black", dash: null, round: 0, opacity: 1 }, selected: { top: { width: 1, color: "black", dash: null, round: 0 }, right: { width: 1, color: "black", dash: null, round: 0 }, bottom: { width: 1, color: "black", dash: null, round: 0 }, left: { width: 1, color: "black", dash: null, round: 0 } } }, // 默认矩形填充 fill: { color: "red", opacity: 1, selected: { color: "white" } }, // 默认矩形填充 image: { opacity: 1 }, // 默认矩形字体 font: { //字体 family: "Microsoft YaHei", //颜色 color: "white", //大小 size: 16, selected: { family: "Microsoft YaHei", color: "#000000", size: 16 } }, // 默认矩形文本样式 textStyle: { //水平对齐,1,2,3左中右,默认1 align: 1, //垂直对齐,1,2,3上中下,默认2 valign: 2, //自动换行,0/null不换行,1换行,默认0 feed: 1, //缩小字体填充,0/null不缩小,1缩小,默认0 scale: 1, //镂空,0/null不镂空,1镂空,默认0 hollow: 0, selected: { align: 1, valign: 2, feed: 0, scale: 0, hollow: 0 } } }); __publicField$1(_DDeiConfig, "CIRCLE", { // 默认矩形边框 border: { width: 1, color: "black", dash: null, round: 0, disabled: false, opacity: 1, selected: { width: 1, color: "black", dash: null, round: 0, opacity: 1 } }, // 默认矩形填充 fill: { color: "white", opacity: 1, selected: { color: "white" } }, // 默认矩形字体 font: { //字体 family: "Microsoft YaHei", //颜色 color: "white", //大小 size: 16, selected: { family: "Microsoft YaHei", color: "#000000", size: 16 } }, // 默认矩形文本样式 textStyle: { //水平对齐,1,2,3左中右,默认1 align: 2, //垂直对齐,1,2,3上中下,默认2 valign: 2, //自动换行,0/null不换行,1换行,默认0 feed: 1, //缩小字体填充,0/null不缩小,1缩小,默认0 scale: 1, //镂空,0/null不镂空,1镂空,默认0 hollow: 0, selected: { align: 2, valign: 2, feed: 0, scale: 0, hollow: 0 } } }); __publicField$1(_DDeiConfig, "DIAMOND", { border: { top: { width: 1, color: "black", dash: null, round: 0, disabled: false }, right: { width: 1, color: "black", dash: null, round: 0 }, bottom: { width: 1, color: "black", dash: null, round: 0, opacity: 1 }, left: { width: 1, color: "black", dash: null, round: 0, opacity: 1 }, selected: { top: { width: 1, color: "black", dash: null, round: 0 }, right: { width: 1, color: "black", dash: null, round: 0 }, bottom: { width: 1, color: "black", dash: null, round: 0 }, left: { width: 1, color: "black", dash: null, round: 0 } } }, // 默认矩形填充 fill: { color: "red", opacity: 1, selected: { color: "white" } }, // 默认矩形字体 font: { //字体 family: "Microsoft YaHei", //颜色 color: "white", //大小 size: 16, selected: { family: "Microsoft YaHei", color: "#000000", size: 16 } }, // 默认矩形文本样式 textStyle: { //水平对齐,1,2,3左中右,默认1 align: 1, //垂直对齐,1,2,3上中下,默认2 valign: 2, //自动换行,0/null不换行,1换行,默认0 feed: 1, //缩小字体填充,0/null不缩小,1缩小,默认0 scale: 1, //镂空,0/null不镂空,1镂空,默认0 hollow: 0, selected: { align: 1, valign: 2, feed: 0, scale: 0, hollow: 0 } } }); __publicField$1(_DDeiConfig, "CONTAINER", { // 默认矩形边框 border: { top: { width: 1, color: "black", dash: null, round: 0 }, right: { width: 1, color: "black", dash: null, round: 0 }, bottom: { width: 1, color: "black", dash: null, round: 0 }, left: { width: 1, color: "black", dash: null, round: 0 }, selected: { top: { width: 1, color: "black", dash: null, round: 0 }, right: { width: 1, color: "black", dash: null, round: 0 }, bottom: { width: 1, color: "black", dash: null, round: 0 }, left: { width: 1, color: "black", dash: null, round: 0 } } }, // 默认填充 fill: { color: "#787878", opacity: 0, selected: { color: "#23AE78", opacity: 0 } } }); __publicField$1(_DDeiConfig, "RULER", { "mm": { size: 10, parts: [2, 5], title: "mm" }, "cm": { size: 1, parts: [2, 5], title: "cm" }, "m": { size: 0.05, parts: [2, 5], title: "m" }, "inch": { size: 1, parts: [8], title: "in" }, "px": { size: 50, parts: [5, 10], title: "px" } }); __publicField$1(_DDeiConfig, "PAPER", { "自定义": { width: 210, height: 297, unit: "mm", desc: "可以自由设置宽高" }, "Letter": { width: 216, height: 279, unit: "mm" }, "Legal": { width: 216, height: 356, unit: "mm" }, "A0": { width: 841, height: 1189, unit: "mm" }, "A1": { width: 594, height: 841, unit: "mm" }, "A2": { width: 420, height: 594, unit: "mm" }, "A3": { width: 297, height: 420, unit: "mm" }, "A4": { width: 210, height: 297, unit: "mm", desc: "常用打印纸" }, "A5": { width: 148, height: 210, unit: "mm" }, "A6": { width: 105, height: 148, unit: "mm" }, "A7": { width: 74, height: 105, unit: "mm" }, "A8": { width: 52, height: 74, unit: "mm" }, "A9": { width: 37, height: 52, unit: "mm" }, "A10": { width: 26, height: 37, unit: "mm" }, "B0": { width: 1e3, height: 1414, unit: "mm" }, "B1": { width: 700, height: 1e3, unit: "mm" }, "B2": { width: 500, height: 707, unit: "mm" }, "B3": { width: 353, height: 500, unit: "mm" }, "B4": { width: 250, height: 353, unit: "mm" }, "B5": { width: 176, height: 250, unit: "mm" }, "B6": { width: 125, height: 176, unit: "mm" }, "B7": { width: 88, height: 125, unit: "mm" }, "B8": { width: 62, height: 88, unit: "mm" }, "B9": { width: 42, height: 62, unit: "mm" }, "B10": { width: 31, height: 44, unit: "mm" }, "一寸照片": { width: 2.5, height: 3.6, unit: "cm" }, "二寸照片": { width: 3.5, height: 5.3, unit: "cm" }, "三寸照片": { width: 5.5, height: 8.4, unit: "cm" }, "五寸照片": { width: 3.5, height: 5, unit: "cm" }, "六寸照片": { width: 4, height: 6, unit: "cm" }, "七寸照片": { width: 5, height: 7, unit: "cm" }, "八寸照片": { width: 6, height: 8, unit: "cm" }, "十寸照片": { width: 8, height: 10, unit: "cm" }, "十二寸照片": { width: 10, height: 12, unit: "cm" }, "十四寸照片": { width: 12, height: 14, unit: "cm" }, "十六寸照片": { width: 12, height: 16, unit: "cm" }, "十八寸照片": { width: 12, height: 18, unit: "cm" }, "名片-横版": { width: 90, height: 55, unit: "mm" }, "名片-横版-欧式": { width: 85, height: 54, unit: "mm" }, "名片-竖版": { width: 54, height: 85, unit: "mm" }, "名片-竖版-美式": { width: 50, height: 90, unit: "mm" }, "名片-方版-1": { width: 90, height: 90, unit: "mm" }, "名片-方版-2": { width: 90, height: 95, unit: "mm" }, "海报-1": { width: 420, height: 570, unit: "mm" }, "海报-2": { width: 500, height: 700, unit: "mm" }, "海报-3": { width: 570, height: 840, unit: "mm" }, "海报-4": { width: 600, height: 900, unit: "mm" }, "二折页": { width: 285, height: 210, unit: "mm" }, "二折页-1": { width: 140, height: 105, unit: "mm" }, "二折页-2": { width: 210, height: 95, unit: "mm" }, "二折页-3": { width: 210, height: 140, unit: "mm" }, "二折页-4": { width: 285, height: 140, unit: "mm" }, "全开": { width: 889, height: 1194, paddingLeft: 102, paddingTop: 102, unit: "mm" }, "对开": { width: 570, height: 840, paddingLeft: 50, paddingTop: 100, unit: "mm" }, "4开": { width: 420, height: 570, paddingLeft: 50, paddingTop: 50, unit: "mm" }, "8开": { width: 285, height: 420, paddingLeft: 25, paddingTop: 50, unit: "mm" }, "16开": { width: 210, height: 285, paddingLeft: 25, paddingTop: 25, unit: "mm" }, "32开": { width: 142, height: 210, paddingLeft: 12, paddingTop: 25, unit: "mm" }, "64开": { width: 110, height: 142, paddingLeft: 18, paddingTop: 12, unit: "mm" } }); __publicField$1(_DDeiConfig, "SPACE_WIDTH_MAP", {}); (() => { _DDeiConfig.PAPER_DATASOURCE = [{ code: "无", name: "无", desc: "不显示纸张" }]; for (let i2 in _DDeiConfig.PAPER) { let data = _DDeiConfig.PAPER[i2]; data.desc = data.desc; if (!data.desc && data.width && data.height) { data.desc = data.width + " x " + data.height + data.unit; } data.code = i2; data.name = i2; _DDeiConfig.PAPER_DATASOURCE.push(data); } })(); let DDeiConfig = _DDeiConfig; const DDeiConfig$1 = DDeiConfig; class DDeiAbstractShape { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "id"); __publicField2(this, "width"); __publicField2(this, "height"); __publicField2(this, "modelCode"); __publicField2(this, "modelType", "AbstractShape"); __publicField2(this, "baseModelType", "AbstractShape"); __publicField2(this, "state", DDeiEnumControlState.DEFAULT); __publicField2(this, "layer"); __publicField2(this, "pModel", null); __publicField2(this, "stage"); __publicField2(this, "zIndex"); __publicField2(this, "cIndex"); __publicField2(this, "rotate"); __publicField2(this, "hidden", null); __publicField2(this, "__destroyed", null); __publicField2(this, "cpv"); __publicField2(this, "hpv"); __publicField2(this, "pvs"); __publicField2(this, "exPvs"); __publicField2(this, "ovs"); __publicField2(this, "unicode"); __publicField2(this, "fmt"); __publicField2(this, "poly"); __publicField2(this, "linkModels"); __publicField2(this, "depModel", null); __publicField2(this, "mirrorX", false); __publicField2(this, "mirrorY", false); __publicField2(this, "composes"); __publicField2(this, "sptStyle"); for (let i2 in props) { this[i2] = props[i2]; } this.id = props.id; this.width = props.width ? props.width : 0; this.height = props.height ? props.height : 0; this.zIndex = props.zIndex ? props.zIndex : null; this.rotate = props.rotate ? props.rotate : null; this.modelCode = props.modelCode ? props.modelCode : null; this.unicode = props.unicode ? props.unicode : DDeiUtil$1.getUniqueCode(); this.fmt = props.fmt; this.sptStyle = props.sptStyle ? props.sptStyle : {}; this.poly = props.poly; this.composes = props.composes; this.cIndex = props.cIndex ? props.cIndex : null; this.ruleEvals = []; this.initCPV = props.initCPV ? props.initCPV : null; if (props.mirrorX) { this.mirrorX = props.mirrorX; } if (props.mirrorY) { this.mirrorY = props.mirrorY; } if (props.cpv) { this.cpv = new Vector3(props.cpv.x, props.cpv.y, props.cpv.z || props.cpv.z == 0 ? props.cpv.z : 1); } if (props.pvs) { this.pvs = []; props.pvs.forEach((pvd) => { let pv = new Vector3(); for (let i2 in pvd) { pv[i2] = pvd[i2]; } pv.z = pvd.z || pvd.z === 0 ? pvd.z : 1; this.pvs.push(pv); }); } this.hpv = []; if (props.hpv) { props.hpv.forEach((pv) => { this.hpv.push(new Vector3(pv.x, pv.y, pv.z || pv.z == 0 ? pv.z : 1)); }); } this.ovs = []; if (props.ovs) { props.ovs.forEach((pvd) => { let pv = new Vector3(pvd.x, pvd.y, pvd.z || pvd.z == 0 ? pvd.z : 1); if (pvd.index || pvd.index == 0) { pv.index = pvd.index; } if (pvd.rate || pvd.rate == 0) { pv.rate = pvd.rate; } if (pvd.sita || pvd.sita == 0) { pv.sita = pvd.sita; } if (pvd.ovi) { let ovi = new Vector3(pvd.ovi.x, pvd.ovi.y, pvd.ovi.z || pvd.ovi.z == 0 ? pvd.ovi.z : 1); pv.ovi = ovi; } this.ovs.push(pv); }); } if (props.bpv) { this.bpv = new Vector3(props.bpv.x, props.bpv.y, props.bpv.z || props.bpv.z == 0 ? props.bpv.z : 1); } this.exPvs = {}; if (props.exPvs) { for (let i2 in props.exPvs) { let pvd = props.exPvs[i2]; let pv = new Vector3(pvd.x, pvd.y, pvd.z || pvd.z == 0 ? pvd.z : 1); pv.id = pvd.id; if (pvd.index || pvd.index == 0) { pv.index = pvd.index; } if (pvd.rate || pvd.rate == 0) { pv.rate = pvd.rate; } if (pvd.sita || pvd.sita == 0) { pv.sita = pvd.sita; } this.exPvs[pvd.id] = pv; } } this.linkModels = props.linkModels ? props.linkModels : /* @__PURE__ */ new Map(); } // ============================ 方法 ============================ /** * 初始化向量,基于width和height构建向量,默认中心点在0,0的位置 */ initPVS() { var _a3, _b2, _c2, _d2, _e2; if (!this.cpv) { this.cpv = this.initCPV ? new Vector3(this.initCPV.x, this.initCPV.y, 1) : new Vector3(0, 0, 1); delete this.initCPV; } if (!(((_a3 = this.ovs) == null ? void 0 : _a3.length) > 0)) { const defineOvs = (_c2 = (_b2 = DDeiUtil$1.getControlDefine(this)) == null ? void 0 : _b2.define) == null ? void 0 : _c2.ovs; if ((defineOvs == null ? void 0 : defineOvs.length) > 0) { const stageRatio2 = 1; const scaleX2 = this.width / 100; const scaleY2 = this.height / 100; this.ovs = defineOvs.map((ovd) => { if (ovd.constraint.type == 3) { const rad = -ovd.isita * DDeiConfig$1.ROTATE_UNIT; const x2 = ovd.constraint.r * Math.cos(rad); const y2 = ovd.constraint.r * Math.sin(rad); const ov = new Vector3(x2 * scaleX2 * stageRatio2, y2 * scaleY2 * stageRatio2, ovd.z || ovd.z == 0 ? ovd.z : 1); ov.ovi = new Vector3(0, 0, ovd.z || ovd.z == 0 ? ovd.z : 1); return ov; } else { const ov = new Vector3(ovd.x * scaleX2 * stageRatio2, ovd.y * scaleY2 * stageRatio2, ovd.z || ovd.z == 0 ? ovd.z : 1); ov.ovi = new Vector3(ovd.ix * scaleX2 * stageRatio2, ovd.iy * scaleY2 * stageRatio2, ovd.iz || ovd.iz == 0 ? ovd.iz : 1); return ov; } }); } } if (this.poly == 2) { if (!(((_d2 = this.hpv) == null ? void 0 : _d2.length) > 0)) { this.hpv = [new Vector3(0, 0, 1), new Vector3(100, 0, 1)]; } if (!this.bpv) { this.bpv = new Vector3(this.cpv.x + this.width, this.cpv.y + this.height, 1); } this.executeSample(); } else { if (!this.pvs || this.pvs.length == 0) { const halfWidth = this.width / 2; const halfHeight = this.height / 2; this.pvs = [ new Vector3(-halfWidth, -halfHeight, 1), new Vector3(halfWidth, -halfHeight, 1), new Vector3(halfWidth, halfHeight, 1), new Vector3(-halfWidth, halfHeight, 1) ]; } this.initHPV(); } this.calRotate(); this.calLoosePVS(); this.refreshLinkModels(); (_e2 = this.composes) == null ? void 0 : _e2.forEach((compose) => compose.initPVS()); if (!this.isShadowControl) { this.updateExPvs(); } } /** * 根据坐标获取特殊操作点 * @param x * @param y * @returns 操作点 */ getOvPointByPos(x2 = 0, y2 = 0) { var _a3, _b2; if (x2 && y2 && ((_a3 = this.ovs) == null ? void 0 : _a3.length) > 0) { for (let i2 = 0; i2 < ((_b2 = this.ovs) == null ? void 0 : _b2.length); i2++) { let point2 = this.ovs[i2]; if (Math.abs(x2 - point2.x) <= 8 && Math.abs(y2 - point2.y) <= 8) { return point2; } } } return null; } /** * 执行采样计算pvs */ executeSample() { var _a, _b, _c, _d, _e; let defineSample = (_b = (_a = DDeiUtil$1.getControlDefine(this)) == null ? void 0 : _a.define) == null ? void 0 : _b.sample; let stageRatio = 1; if (((_c = defineSample == null ? void 0 : defineSample.rules) == null ? void 0 : _c.length) > 0) { let originOVS = []; if (((_d = this.ovs) == null ? void 0 : _d.length) > 0) { originOVS = cloneDeep(this.ovs); let bpv2 = DDeiUtil$1.pointsToZero([this.bpv], this.cpv, this.rotate)[0]; let scaleX2 = Math.abs(DDeiUtil$1.preciseDiv(bpv2.x, 100)); let scaleY2 = Math.abs(DDeiUtil$1.preciseDiv(bpv2.y, 100)); let m12 = new Matrix3(); let move1Matrix = new Matrix3( 1, 0, -this.cpv.x, 0, 1, -this.cpv.y, 0, 0, 1 ); m12.premultiply(move1Matrix); let rotate2 = 0; if (this.rotate) { rotate2 = this.rotate; let angle2 = DDeiUtil$1.preciseTimes(rotate2, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let scaleMatrix2 = new Matrix3( 1 / scaleX2, 0, 0, 0, 1 / scaleY2, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); let move2Matrix = new Matrix3( 1, 0, this.cpv.x, 0, 1, this.cpv.y, 0, 0, 1 ); m12.premultiply(move2Matrix); originOVS.forEach((ov) => { ov.sita = parseFloat(DDeiUtil$1.getLineAngle(this.cpv.x, this.cpv.y, ov.x, ov.y).toFixed(2)) - rotate2; ov.applyMatrix3(m12); ov.ovi.applyMatrix3(m12); }); } let rotate = this.rotate; if (!rotate) { rotate = 0; } let bpv = DDeiUtil$1.pointsToZero([this.bpv], this.cpv, rotate)[0]; let scaleX = Math.abs(bpv.x / 100); let scaleY = Math.abs(bpv.y / 100); this.scale = { x: scaleX, y: scaleY, stageRatio: 1 }; let sampliesResult = []; let loop = defineSample.loop; let pn = 360 / loop; let angle = defineSample.angle; for (let i = 0; i < loop; i++) { defineSample.sita = angle + i * pn; defineSample.rad = defineSample.sita * DDeiConfig$1.ROTATE_UNIT; defineSample.cos = parseFloat(Math.cos(defineSample.rad).toFixed(4)); defineSample.sin = parseFloat(Math.sin(defineSample.rad).toFixed(4)); defineSample.x = defineSample.r * defineSample.cos; defineSample.y = defineSample.r * defineSample.sin; for (let j = 0; j < ((_e = defineSample.rules) == null ? void 0 : _e.length); j++) { if (this.ruleEvals && !this.ruleEvals[j]) { eval("this.ruleEvals[j] = function" + defineSample.rules[j]); } let spFn = this.ruleEvals[j]; if (!sampliesResult[j]) { sampliesResult[j] = []; } let spResult = sampliesResult[j]; spFn(i, defineSample, spResult, this, originOVS); } } delete this.scale; let pvs = []; let apvs = []; let textArea = []; let operatePVS = []; let opps = []; for (let i2 = 0; i2 < sampliesResult.length; i2++) { if (sampliesResult[i2].length > 0) { sampliesResult[i2].forEach((pvd) => { let pv = new Vector3(); pv.group = i2; if (pvd.dx || pvd.dx == 0 || pvd.dy || pvd.dy == 0) { if (!pvd.dx) { pvd.dx = 0; } if (!pvd.dy) { pvd.dy = 0; } let dp = DDeiUtil$1.getRotatedPoint({ x: pvd.dx * scaleX / stageRatio, y: pvd.dy * scaleY / stageRatio, z: 1 }, rotate); pvd.dx = dp.x; pvd.dy = dp.y; } for (let i3 in pvd) { pv[i3] = pvd[i3]; } pv.z = pvd.z || pvd.z === 0 ? pvd.z : 1; pvs.push(pv); if (pvd.select) { operatePVS.push(pv); } if (pvd.oppoint) { opps.push(pv); } if (pvd.align) { apvs.push(pv); } if (pvd.text) { textArea.push(pv); } }); } } let m1 = new Matrix3(); let scaleMatrix = new Matrix3( scaleX, 0, 0, 0, scaleY, 0, 0, 0, 1 ); m1.premultiply(scaleMatrix); if (this.rotate) { let angle2 = -DDeiUtil$1.preciseTimes(this.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m1.premultiply(rotateMatrix); } let moveMatrix = new Matrix3( 1, 0, this.cpv.x, 0, 1, this.cpv.y, 0, 0, 1 ); m1.premultiply(moveMatrix); pvs.forEach((pv) => { pv.applyMatrix3(m1); }); this.pvs = pvs; this.operatePVS = operatePVS; this.textArea = textArea; this.opps = opps; this.apvs = apvs; } } getOperatePVS(compose = false) { var _a3; let pvs2 = this.operatePVS ? this.operatePVS : this.pvs; let returnPVS = []; if (pvs2) { pvs2.forEach((pv) => { returnPVS.push(pv); }); } if (compose && ((_a3 = this.composes) == null ? void 0 : _a3.length) > 0) { this.composes.forEach((comp) => { let ps = comp.getOperatePVS(compose); if (ps) { ps.forEach((pv) => { returnPVS.push(pv); }); } }); } return returnPVS; } getAPVS() { var _a3; let arr = [this.cpv]; if (((_a3 = this.apvs) == null ? void 0 : _a3.length) > 0) { arr = arr.concat(this.apvs); } return arr; } /** * 刷新链接模型 */ refreshLinkModels() { var _a3; if ((_a3 = this.linkModels) == null ? void 0 : _a3.has) { this.linkModels.forEach((lm) => { if (lm.dm) { let oldCPVX = lm.dm.cpv.x; let oldCPVY = lm.dm.cpv.y; let point2 = null; if (this.baseModelType == "DDeiLine") { if (lm.type == 1) { point2 = this.startPoint; } else if (lm.type == 2) { point2 = this.endPoint; } else if (lm.type == 3) { let pi = Math.floor(this.pvs.length / 2); if (this.pvs.length % 2 == 1) { point2 = this.pvs[pi]; } else { point2 = { x: (this.pvs[pi - 1].x + this.pvs[pi].x) / 2, y: (this.pvs[pi - 1].y + this.pvs[pi].y) / 2 }; } } } else { if (lm.type == 5) { point2 = this.cpv; } else { let essBounds = this.essBounds; let dmEssBounds = lm.dm.essBounds; if (lm.type == 6) { point2 = { x: this.cpv.x, y: essBounds.y - dmEssBounds.height / 2 }; } else if (lm.type == 7) { point2 = { x: essBounds.x1 + dmEssBounds.width / 2, y: this.cpv.y }; } else if (lm.type == 8) { point2 = { x: this.cpv.x, y: essBounds.y1 + dmEssBounds.height / 2 }; } else if (lm.type == 9) { point2 = { x: essBounds.x - dmEssBounds.width / 2, y: this.cpv.y }; } } } let newCPVX = point2.x + lm.dx; let newCPVY = point2.y + lm.dy; let moveMatrix2 = new Matrix3( 1, 0, newCPVX - oldCPVX, 0, 1, newCPVY - oldCPVY, 0, 0, 1 ); lm.dm.transVectors(moveMatrix2); lm.dm.updateLinkModels(); } }); } } /** * 删除本图形的依附链接图形 * @param dmid 依附图形id */ removeLinkModel(dmid, destroy = true, notify = true) { var _a3; if ((_a3 = this.linkModels) == null ? void 0 : _a3.has) { let link2 = this.linkModels.get(dmid); if (link2) { this.linkModels.delete(dmid); this.pModel.removeModel(link2.dm, destroy, notify); } } } /** * 初始化链接模型 */ initLinkModels() { let linkModels = /* @__PURE__ */ new Map(); for (let key in this.linkModels) { let item = this.linkModels[key]; if (item == null ? void 0 : item.dmid) { let dm = this.stage.getModelById(item.dmid); item.dm = dm; item.depModel = this; dm.depModel = this; let lm = new DDeiModelLink(item); linkModels.set(key, lm); } } this.linkModels = linkModels; } /** * 同步向量 * @param source 源模型 * @param cloneVP 是否克隆向量,默认false */ syncVectors(source, clonePV = false) { var _a3, _b2, _c2, _d2; if (this.poly == 2) { if (clonePV) { this.cpv = cloneDeep(source.cpv); this.exPvs = cloneDeep(source.exPvs); this.bpv = cloneDeep(source.bpv); this.ovs = cloneDeep(source.ovs); } else { this.cpv = source.cpv; this.exPvs = source.exPvs; this.bpv = source.bpv; this.ovs = source.ovs; } this.executeSample(); } else { if (clonePV) { this.pvs = cloneDeep(source.pvs); this.cpv = cloneDeep(source.cpv); this.exPvs = cloneDeep(source.exPvs); this.ovs = cloneDeep(source.ovs); } else { this.pvs = source.pvs; this.cpv = source.cpv; this.exPvs = source.exPvs; this.ovs = source.ovs; } } this.initHPV(); this.calRotate(); this.calLoosePVS(); for (let i2 = 0; i2 < ((_a3 = source.composes) == null ? void 0 : _a3.length); i2++) { let scop = source.composes[i2]; let tcop = this.composes[i2]; tcop.syncVectors(scop, clonePV); } (_c2 = (_b2 = this.getTopContainer()) == null ? void 0 : _b2.render) == null ? void 0 : _c2.enableRefreshShape(); (_d2 = this.render) == null ? void 0 : _d2.enableRefreshShape(); } /** * 变换向量 */ transVectors(matrix2, params) { var _a3, _b2, _c2, _d2; this.cpv.applyMatrix3(matrix2); if (this.poly == 2) { if (!(params == null ? void 0 : params.skipSample)) { if (!(params == null ? void 0 : params.ignoreHPV)) { this.hpv.forEach((pv) => { pv.applyMatrix3(matrix2); }); } for (let i2 in this.exPvs) { let pv = this.exPvs[i2]; pv.applyMatrix3(matrix2); } if (!(params == null ? void 0 : params.ignoreBPV)) { this.bpv.applyMatrix3(matrix2); } if (!(params == null ? void 0 : params.ignoreOVS)) { (_a3 = this.ovs) == null ? void 0 : _a3.forEach((pv) => { pv.applyMatrix3(matrix2); if (pv.ovi) { pv.ovi.applyMatrix3(matrix2); } }); } this.initHPV(); this.calRotate(); this.executeSample(); this.calLoosePVS(); } else { if (!(params == null ? void 0 : params.ignoreHPV)) { this.hpv.forEach((pv) => { pv.applyMatrix3(matrix2); }); } for (let i2 in this.exPvs) { let pv = this.exPvs[i2]; pv.applyMatrix3(matrix2); } this.pvs.forEach((pv) => { pv.applyMatrix3(matrix2); }); if (!(params == null ? void 0 : params.ignoreBPV)) { this.bpv.applyMatrix3(matrix2); } if (!(params == null ? void 0 : params.ignoreOVS)) { (_b2 = this.ovs) == null ? void 0 : _b2.forEach((pv) => { pv.applyMatrix3(matrix2); if (pv.ovi) { pv.ovi.applyMatrix3(matrix2); } }); } } } else { this.pvs.forEach((pv) => { pv.applyMatrix3(matrix2); }); for (let i2 in this.exPvs) { let pv = this.exPvs[i2]; pv.applyMatrix3(matrix2); } (_c2 = this.ovs) == null ? void 0 : _c2.forEach((pv) => { pv.applyMatrix3(matrix2); if (pv.ovi) { pv.ovi.applyMatrix3(matrix2); } }); this.initHPV(); this.calRotate(); this.calLoosePVS(); } if (!(params == null ? void 0 : params.ignoreComposes)) { (_d2 = this.composes) == null ? void 0 : _d2.forEach((compose) => { compose.transVectors(matrix2); }); } } /** * 设置特殊文本样式 * @param sIdx 开始文本坐标 * @param eIdx 结束文本坐标 */ setSptStyle(sIdx, eIdx, paths, value, emptyDelete = true) { var _a3, _b2; let attrPaths = []; if (typeof paths == "string") { attrPaths = paths.split(","); } else { attrPaths = paths; } if ((attrPaths == null ? void 0 : attrPaths.length) > 0 && sIdx > -1 && eIdx > -1 && sIdx <= eIdx) { for (let k = sIdx; k < eIdx; k++) { for (let i2 = 0; i2 < attrPaths.length; i2++) { if ((value === null || value === void 0 || isNumber(value) && isNaN(value)) && emptyDelete) { DDeiUtil$1.deletePropertyByPath(this.sptStyle, k + "." + attrPaths[i2]); if (((_a3 = this.sptStyle[k]) == null ? void 0 : _a3.textStyle) && JSON.stringify(this.sptStyle[k].textStyle) == "{}") { delete this.sptStyle[k].textStyle; } if (((_b2 = this.sptStyle[k]) == null ? void 0 : _b2.font) && JSON.stringify(this.sptStyle[k].font) == "{}") { delete this.sptStyle[k].font; } if (this.sptStyle[k] && JSON.stringify(this.sptStyle[k]) == "{}") { delete this.sptStyle[k]; } } else { DDeiUtil$1.setAttrValueByPath(this, ["sptStyle." + k + "." + attrPaths[i2]], value); } } } } } /** * 获取特殊文本样式,返回同样的样式 * @param sIdx 开始文本坐标 * @param eIdx 结束文本坐标 */ getSptStyle(sIdx, eIdx, paths) { let attrPaths = []; if (typeof paths == "string") { attrPaths = paths.split(","); } else { attrPaths = paths; } if ((attrPaths == null ? void 0 : attrPaths.length) > 0 && sIdx > -1 && eIdx > -1 && sIdx <= eIdx) { let first = true; let firstValue = void 0; for (; sIdx < eIdx; sIdx++) { for (let i2 = 0; i2 < attrPaths.length; i2++) { let v = DDeiUtil$1.getDataByPathList(this, "sptStyle." + sIdx + "." + attrPaths[i2]); if (first) { firstValue = v == null || v == void 0 ? void 0 : v; first = false; } else if (v != void 0 && firstValue != v) { return void 0; } } } return firstValue; } return void 0; } /** * 获取特殊文本样式,返回所有的样式 * @param sIdx 开始文本坐标 * @param eIdx 结束文本坐标 */ getSptAllStyles(sIdx, eIdx) { let returnArray = []; if (sIdx > -1 && eIdx > -1 && sIdx <= eIdx) { for (; sIdx < eIdx; sIdx++) { let v = DDeiUtil$1.getDataByPathList(this, "sptStyle." + sIdx); returnArray.push(v); } } return returnArray; } /** * 清空特殊文本样式 */ clearSptStyle() { this.sptStyle = {}; } /** * 设置当前最新的hpv */ initHPV() { this.hpv[0] = clone(this.pvs[0]); this.hpv[1] = clone(this.pvs[1]); } /** * 基于当前向量计算宽松判定向量 */ calLoosePVS() { var _a3; this.loosePVS = ((_a3 = this.operatePVS) == null ? void 0 : _a3.length) > 2 ? cloneDeep(this.operatePVS) : cloneDeep(this.pvs); let move1Matrix = new Matrix3( 1, 0, -this.cpv.x, 0, 1, -this.cpv.y, 0, 0, 1 ); this.loosePVS.forEach((fpv) => { fpv.applyMatrix3(move1Matrix); }); if (this.rotate && this.rotate != 0) { let angle2 = DDeiUtil$1.preciseTimes(this.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); this.loosePVS.forEach((fpv) => { fpv.applyMatrix3(rotateMatrix); }); } let outRect = DDeiAbstractShape.pvsToOutRect(this.loosePVS); if (this.loosePVS.length < 4) { this.loosePVS = DDeiAbstractShape.outRectToPV(outRect); } this.x = outRect.x; this.y = outRect.y; this.width = outRect.width; this.height = outRect.height; this.essBounds = outRect; let m12 = new Matrix3(); let scX = 1, scY = 1; if (this.width <= 30) { scX = 1 + 10 / this.width; } else { scX = 1 + Math.min(0.1, 20 / this.width); } if (this.height <= 30) { scY = 1 + 10 / this.height; } else { scY = 1 + Math.min(0.1, 20 / this.height); } let scaleMatrix2 = new Matrix3( scX, 0, 0, 0, scY, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); if (this.rotate && this.rotate != 0) { let angle2 = -DDeiUtil$1.preciseTimes(this.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let move2Matrix = new Matrix3( 1, 0, this.cpv.x, 0, 1, this.cpv.y, 0, 0, 1 ); m12.premultiply(move2Matrix); this.loosePVS.forEach((fpv) => { fpv.applyMatrix3(m12); }); this.x += this.cpv.x; this.y += this.cpv.y; this.essBounds.x += this.cpv.x; this.essBounds.y += this.cpv.y; this.essBounds.x1 += this.cpv.x; this.essBounds.y1 += this.cpv.y; } /** * 设置旋转角度 */ setRotate(rotate2 = 0) { if (this.rotate != rotate2) { let m12 = new Matrix3(); let toZeroMatrix = new Matrix3( 1, 0, -this.cpv.x, 0, 1, -this.cpv.y, 0, 0, 1 ); m12.premultiply(toZeroMatrix); if (this.rotate) { let angle2 = DDeiUtil$1.preciseTimes(this.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } if (rotate2) { let angle2 = -DDeiUtil$1.preciseTimes(rotate2, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let restoreMatrix = new Matrix3( 1, 0, this.cpv.x, 0, 1, this.cpv.y, 0, 0, 1 ); m12.premultiply(restoreMatrix); this.transVectors(m12); this.rotate = rotate2; } } /** * 基于当前大小缩放 */ scale(scaleX2 = 1, scaleY2 = 1) { if (scaleX2 != 1 || scaleY2 != 1) { let m12 = new Matrix3(); let move1Matrix = new Matrix3( 1, 0, -this.cpv.x, 0, 1, -this.cpv.y, 0, 0, 1 ); m12.premultiply(move1Matrix); let scaleMatrix2 = new Matrix3( scaleX2, 0, 0, 0, scaleY2, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); let move2Matrix = new Matrix3( 1, 0, this.cpv.x, 0, 1, this.cpv.y, 0, 0, 1 ); m12.premultiply(move2Matrix); this.transVectors(m12); } } /** * 计算旋转角度,基于隐藏点与坐标系的夹角 */ calRotate() { let lineV = new Vector3(this.hpv[1].x, this.hpv[1].y, 1); let toZeroMatrix = new Matrix3( 1, 0, -this.hpv[0].x, 0, 1, -this.hpv[0].y, 0, 0, 1 ); lineV.applyMatrix3(toZeroMatrix); let angle2 = (new Vector3(1, 0, 0).angleTo(new Vector3(lineV.x, lineV.y, 0)) * 180 / Math.PI).toFixed(4); if (lineV.x >= 0 && lineV.y >= 0) ; else if (lineV.x <= 0 && lineV.y >= 0) ; else if (lineV.x <= 0 && lineV.y <= 0) { angle2 = -angle2; } else if (lineV.x >= 0 && lineV.y <= 0) { angle2 = -angle2; } this.rotate = parseFloat(angle2); } /** * 设置当前图片base64 * @param base64 */ setImgBase64(base64) { this.imgBase64 = base64; if (this.render) { this.render.imgObj = null; this.render.initImage(); } } notifyChange() { var _a3, _b2; (_a3 = this.render) == null ? void 0 : _a3.clearCachedValue(); DDeiUtil$1.notifyChange((_b2 = this.stage) == null ? void 0 : _b2.ddInstance); } /** * 更新关联图形 */ updateLinkModels(ignoreModelIds) { let links = this.stage.getSourceModelLinks(this.id); let removeLinks = []; links == null ? void 0 : links.forEach((link2) => { var _a3, _b2, _c2; if (!link2.disabled && (!ignoreModelIds || (ignoreModelIds == null ? void 0 : ignoreModelIds.indexOf((_a3 = link2.dm) == null ? void 0 : _a3.id)) == -1)) { let dpv = link2.getDistPV(); if (dpv) { let spv = link2.getSourcePV(); if (spv) { dpv.x = spv.x; dpv.y = spv.y; dpv.z = spv.z; link2.dm.refreshLinePoints(); link2.dm.updateOVS(); let pvs2 = link2.dm.pvs; link2.dm.setLineType1PointPosition(0, pvs2[0].x, pvs2[0].y); if (((_b2 = link2.dm.pModel) == null ? void 0 : _b2.modelType) != "DDeiLayer") { (_c2 = link2.dm.pModel) == null ? void 0 : _c2.changeParentsBounds(); } } else { removeLinks.push(link2); } } } }); if (removeLinks.length > 0) { this.stage.removeLink(removeLinks); } } /** * 单独修改向量导致两点关系发生变化后同步调整exPvs点的位置 */ updateExPvs() { for (let i2 in this.exPvs) { let ov = this.exPvs[i2]; let x2, y2; let pathPvs = this.opps; let st, en; let op2Paths = []; for (let qi = 0; qi < pathPvs.length; qi++) { let opp = pathPvs[qi]; if (opp.oppoint == 2) { op2Paths.push(opp); } } if (op2Paths.length > 0) { if (!(ov.index || ov.index == 0) || op2Paths.length <= ov.index) { let index = -1; for (let qi = 0; qi < op2Paths.length; qi++) { let isInLine = false; if (qi == op2Paths.length - 1) { isInLine = DDeiUtil$1.isPointInLine(ov, op2Paths[qi], op2Paths[0]); } else { isInLine = DDeiUtil$1.isPointInLine(ov, op2Paths[qi], op2Paths[qi + 1]); } if (isInLine) { index = qi; break; } } if (index != -1) { x2 = ov.x; y2 = ov.y; ov.index = index; } else { let proPoints = DDeiAbstractShape.getProjPointDists(op2Paths, ov.x, ov.y, false, 1); x2 = proPoints[0].x; y2 = proPoints[0].y; ov.index = proPoints[0].index; index = proPoints[0].index; } if (index == op2Paths.length - 1) { st = index; en = 0; } else { st = index; en = index + 1; } let pointDistance = DDeiUtil$1.getPointDistance(op2Paths[st].x, op2Paths[st].y, ov.x, ov.y); let distance = DDeiUtil$1.getPointDistance(op2Paths[st].x, op2Paths[st].y, op2Paths[en].x, op2Paths[en].y); let rate = pointDistance / distance; ov.rate = rate > 1 ? rate : rate; } else { let index = ov.index; if (index == op2Paths.length - 1) { st = index; en = 0; } else { st = index; en = index + 1; } x2 = op2Paths[st].x + ov.rate * (op2Paths[en].x - op2Paths[st].x); y2 = op2Paths[st].y + ov.rate * (op2Paths[en].y - op2Paths[st].y); } ov.x = x2; ov.y = y2; } let outRect = this.essBounds; if (ov.x == outRect.x && ov.y > outRect.y && ov.y < outRect.y1) { ov.sita = 180; } else if (ov.x == outRect.x1 && ov.y > outRect.y && ov.y < outRect.y1) { ov.sita = 0; } else if (ov.y == outRect.y && ov.x > outRect.x && ov.x < outRect.x1) { ov.sita = -90; } else if (ov.y == outRect.y1 && ov.x > outRect.x && ov.x < outRect.x1) { ov.sita = 90; } } this.updateLinkModels(); } /** * 更改图形后同步调整OVS点的位置 */ updateOVS() { var _a3, _b2, _c2; if (((_a3 = this.ovs) == null ? void 0 : _a3.length) > 0) { let defineOvs = (_c2 = (_b2 = DDeiUtil$1.getControlDefine(this)) == null ? void 0 : _b2.define) == null ? void 0 : _c2.ovs; for (let i2 = 0; i2 < this.ovs.length; i2++) { let ov = this.ovs[i2]; let ovd = defineOvs[i2]; switch (ovd.constraint.type) { case 0: { let dx = ov.x - ov.ovi.x; let dy = ov.y - ov.ovi.y; let m12 = new Matrix3( 1, 0, this.cpv.x + dx - ov.x, 0, 1, this.cpv.y + dy - ov.y, 0, 0, 1 ); ov.x = this.cpv.x + dx; ov.y = this.cpv.y + dy; ov.ovi.x = ov.x - dx; ov.ovi.y = ov.y - dy; this.updateOVSLink(ov, ovd, m12); break; } case 1: { let pathPvs = []; let pvsStr = ovd.constraint.pvs; if ((pvsStr == null ? void 0 : pvsStr.length) > 0) { pvsStr.forEach((pvsS) => { let pvsData = DDeiUtil$1.getDataByPathList(this, pvsS); if (Array.isArray(pvsData)) { pvsData.forEach((pvsD) => { pathPvs.push(pvsD); }); } else { pathPvs.push(pvsData); } }); } if (pathPvs.length > 1) { let x2, y2, st, en; if (!(ov.index || ov.index == 0) || pathPvs.length <= ov.index) { let proPoints = DDeiAbstractShape.getProjPointDists(pathPvs, ov.x, ov.y, false, 1); let index = proPoints[0].index; ov.index = index; x2 = proPoints[0].x; y2 = proPoints[0].y; if (index == pathPvs.length - 1) { st = index; en = 0; } else { st = index; en = index + 1; } let pointDistance = DDeiUtil$1.getPointDistance(pathPvs[st].x, pathPvs[st].y, ov.x, ov.y); let distance = DDeiUtil$1.getPointDistance(pathPvs[st].x, pathPvs[st].y, pathPvs[en].x, pathPvs[en].y); let rate = pointDistance / distance; ov.rate = rate > 1 ? rate : rate; } else { let index = ov.index; if (index == pathPvs.length - 1) { st = index; en = 0; } else { st = index; en = index + 1; } x2 = pathPvs[st].x + ov.rate * (pathPvs[en].x - pathPvs[st].x); y2 = pathPvs[st].y + ov.rate * (pathPvs[en].y - pathPvs[st].y); } let sita = parseFloat(DDeiUtil$1.getLineAngle(pathPvs[st].x, pathPvs[st].y, pathPvs[en].x, pathPvs[en].y).toFixed(4)); let m12 = new Matrix3(); let dx = x2 - ov.x, dy = y2 - ov.y; let deltaMoveMatrix = new Matrix3( 1, 0, dx, 0, 1, dy, 0, 0, 1 ); m12.premultiply(deltaMoveMatrix); let ovSita = ov.sita; if (!ovSita) { ovSita = 0; } if (sita != ovSita) { let move1Matrix = new Matrix3( 1, 0, -x2, 0, 1, -y2, 0, 0, 1 ); let angle2 = (-(sita - ovSita) * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); let move2Matrix = new Matrix3( 1, 0, x2, 0, 1, y2, 0, 0, 1 ); m12.premultiply(move1Matrix).premultiply(rotateMatrix).premultiply(move2Matrix); } ov.x = x2; ov.y = y2; ov.sita = sita; this.updateOVSLink(ov, ovd, m12); } break; } case 5: { let pathPvs = []; let pvsStr = ovd.constraint.pvs; if ((pvsStr == null ? void 0 : pvsStr.length) > 0) { pvsStr.forEach((pvsS) => { let pvsData = DDeiUtil$1.getDataByPathList(this, pvsS); if (Array.isArray(pvsData)) { pvsData.forEach((pvsD) => { pathPvs.push(pvsD); }); } else { pathPvs.push(pvsData); } }); } if (pathPvs.length == 2) { let mode = 1; let value; if (ovd.constraint.rate || ovd.constraint.rate == 0) { mode = 2; value = ovd.constraint.rate; } else { value = ovd.constraint.len ? ovd.constraint.len : 0; } let point2 = DDeiUtil$1.getPathPoint(pathPvs[0].x, pathPvs[0].y, pathPvs[1].x, pathPvs[1].y, mode, value, 0.5); ov.x = point2.x; ov.y = point2.y; ov.sita = point2.sita; ov.rate = point2.rate; ov.len = point2.len; this.updateOVSLink(ov, ovd); } break; } } } } } updateOVSLink(point, pointDefine, matrix) { if (pointDefine == null ? void 0 : pointDefine.links) { pointDefine.links.forEach((link) => { switch (link.type) { case 1: { let pvsStr = link.pvs; if ((pvsStr == null ? void 0 : pvsStr.length) > 0) { pvsStr.forEach((pvsS) => { let pvsData = DDeiUtil$1.getDataByPathList(this, pvsS); if (pvsData) { if (Array.isArray(pvsData)) { pvsData.forEach((pvsD) => { pvsD.applyMatrix3(matrix); }); } else { if (pvsData.transVectors) { pvsData.transVectors(matrix); } else { pvsData.applyMatrix3(matrix); } } } }); } break; } case 2: { let pvsStr = link.pvs; if ((pvsStr == null ? void 0 : pvsStr.length) > 0) { pvsStr.forEach((pvsS) => { let pvsData = DDeiUtil$1.getDataByPathList(this, pvsS); if (pvsData) { let m12 = new Matrix3(); let moveMatrix2 = new Matrix3( 1, 0, -pvsData.cpv.x, 0, 1, -pvsData.cpv.y, 0, 0, 1 ); m12.premultiply(moveMatrix2); if (pvsData.rotate != 0 && pvsData.rotate != 360) { let angle2 = (pvsData.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } if (point.sita != 0 && point.sita != 360) { let angle2 = (-point.sita * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let moveMatrix1 = new Matrix3( 1, 0, point.x, 0, 1, point.y, 0, 0, 1 ); m12.premultiply(moveMatrix1); pvsData.transVectors(m12); } }); } break; } case 99: { if (!link.evalScript && link.script) { eval("link.evalScript = function" + link.script); } if (link.evalScript) { link.evalScript(this, point, pointDefine, link); } break; } } }); } } /** * 获取实际的内部容器控件 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainer() { return null; } /** * 获取顶级容器(Layer之下) * @return 获取layer之下的顶级容器 */ getTopContainer() { let model = this; while (model.pModel && model.pModel.baseModelType != "DDeiLayer") { model = model.pModel; } if (model == this) { return null; } else { return model; } } /** * 获取实际的内部容器控件 * @param x 相对路径坐标 * @param y 相对路径坐标 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainerByPos(x2, y2) { return null; } /** * 判断是否在某个边线上 * @param direct 1,2,3,4 上、右、下、左 */ isBorderOn(direct, x2, y2, inWeight = -3, outWeight = 3) { let projPoint = this.getProjPointOnLine( { x: x2, y: y2 }, { in: inWeight, out: outWeight }, 1, direct - 1 ); if (projPoint) { return true; } else { return false; } } /** * 获取中心点操作点 */ getCenterOpPoints() { var _a3; if (((_a3 = this.opps) == null ? void 0 : _a3.length) > 0) { return cloneDeep(this.opps); } return []; } /** * 得到点在图形某条线上的投射点 * @param point 测试点 * @param distance 内外部判定区间的距离 * @param direct 方向,1外部,2内部 默认1 * @param index 线开始点向量的下标 * @returns 投影点的坐标 */ getProjPointOnLine(point2, distance = { in: 0, out: 15 }, direct = 1, index) { var _a3; let x0 = point2.x; let y0 = point2.y; if (((_a3 = this.opps) == null ? void 0 : _a3.length) > index) { let st, en; let plLength = Infinity; if (index == this.opps.length - 1) { st = index; en = 0; } else { st = index; en = index + 1; } let x1 = this.opps[st].x; let y1 = this.opps[st].y; let x2 = this.opps[en].x; let y2 = this.opps[en].y; if (x1 == x2 && y1 == y2) { plLength = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); } else { let s = (x0 - x1) * (y2 - y1) - (y0 - y1) * (x2 - x1); let d = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); plLength = s / d; } let flag = false; if (direct == 1) { if (plLength >= distance.in && plLength <= distance.out) { flag = true; } } else if (direct == 2) { if (plLength <= distance.in && plLength >= distance.out) { flag = true; } } if (flag) { let lineV = new Vector3(x2, y2, 1); let pointV = new Vector3(x0, y0, 1); let toZeroMatrix = new Matrix3( 1, 0, -x1, 0, 1, -y1, 0, 0, 1 ); lineV.applyMatrix3(toZeroMatrix); pointV.applyMatrix3(toZeroMatrix); let lineAngle = (new Vector3(1, 0, 0).angleTo(new Vector3(lineV.x, lineV.y, 0)) * 180 / Math.PI).toFixed(4); let angle2 = 0; if (lineV.x >= 0 && lineV.y >= 0) { angle2 = (lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x <= 0 && lineV.y >= 0) { angle2 = (lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x <= 0 && lineV.y <= 0) { angle2 = (-lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x >= 0 && lineV.y <= 0) { angle2 = (-lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); lineV.applyMatrix3(rotateMatrix); pointV.applyMatrix3(rotateMatrix); if (pointV.x >= 0 && pointV.x <= lineV.x) { let v1 = new Vector3(pointV.x, 0, 1); angle2 = -angle2; let rotateMatrix2 = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); v1.applyMatrix3(rotateMatrix2); let removeMatrix = new Matrix3( 1, 0, x1, 0, 1, y1, 0, 0, 1 ); v1.applyMatrix3(removeMatrix); return v1; } } } return null; } /** * 得到点在图形连接线上的投射点 * @param point 测试点 * @param distance 内外部判定区间的距离 * @param direct 方向,1外部,2内部 默认1 * @param pointType 用于判定的点类别,1操作点,2范围点,缺省操作点 * @returns 投影点的坐标 */ getProjPoint(point2, distance = { in: 0, out: 15 }, direct = 1, pointType = 1) { var _a3; let x0 = point2.x; let y0 = point2.y; let opPVS = []; if (pointType == 1) { if ((_a3 = this.opps) == null ? void 0 : _a3.length) { this.opps.forEach((opvs) => { if (opvs.oppoint == 2) { opPVS.push(opvs); } }); } } else { opPVS = this.getOperatePVS(); } if ((opPVS == null ? void 0 : opPVS.length) > 0) { let st, en; for (let j2 = 0; j2 < opPVS.length; j2++) { let plLength = Infinity; if (j2 == opPVS.length - 1) { st = j2; en = 0; } else { st = j2; en = j2 + 1; } let x1 = opPVS[st].x; let y1 = opPVS[st].y; let x2 = opPVS[en].x; let y2 = opPVS[en].y; if (x1 == x2 && y1 == y2) { plLength = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); } else { let s = (x0 - x1) * (y2 - y1) - (y0 - y1) * (x2 - x1); let d = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); plLength = s / d; } let flag = false; if (direct == 1) { if (plLength >= distance.in && plLength <= distance.out) { flag = true; } } else if (direct == 2) { if (plLength <= distance.in && plLength >= distance.out) { flag = true; } } if (flag) { let lineV = new Vector3(x2, y2, 1); let pointV = new Vector3(x0, y0, 1); let toZeroMatrix = new Matrix3( 1, 0, -x1, 0, 1, -y1, 0, 0, 1 ); lineV.applyMatrix3(toZeroMatrix); pointV.applyMatrix3(toZeroMatrix); let angle2 = new Vector3(1, 0, 0).angleTo(new Vector3(lineV.x, lineV.y, 0)); let lineAngle = angle2 / DDeiConfig$1.ROTATE_UNIT; if (lineV.x >= 0 && lineV.y >= 0) ; else if (lineV.x <= 0 && lineV.y >= 0) ; else if (lineV.x <= 0 && lineV.y <= 0) { angle2 = -angle2; } else if (lineV.x >= 0 && lineV.y <= 0) { angle2 = -angle2; } let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); lineV.applyMatrix3(rotateMatrix); pointV.applyMatrix3(rotateMatrix); if (pointV.x >= 0 && pointV.x <= lineV.x) { let isMiddle = false; if (Math.abs(lineV.x / 2 - pointV.x) <= 5) { pointV.x = lineV.x / 2; isMiddle = true; } let v1 = new Vector3(pointV.x, 0, 1); angle2 = -angle2; let rotateMatrix2 = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); v1.applyMatrix3(rotateMatrix2); let removeMatrix = new Matrix3( 1, 0, x1, 0, 1, y1, 0, 0, 1 ); v1.applyMatrix3(removeMatrix); v1.isMiddle = isMiddle; v1.sita = lineAngle; let rate = Math.abs(pointV.x / lineV.x); v1.rate = rate > 1 ? 1 : rate; v1.index = st; v1.plLength = plLength; return v1; } } } } return null; } /** * 返回计算后的坐标、大小 */ getBounds() { return { x: this.x, y: this.y, width: this.width, height: this.height, x1: this.x + this.width, y1: this.y + this.height }; } /** * 获取画布缩放比率 */ getStageRatio() { if (this.stage) { let stageRatio2 = parseFloat(this.stage.ratio) ? parseFloat(this.stage.ratio) : 1; if (!stageRatio2 || isNaN(stageRatio2)) { stageRatio2 = this.stage.ddInstance.ratio; } return stageRatio2; } else { return 1; } } /** * 修改自身状态 */ setState(state) { var _a3; if (this.state != state) { this.state = state; (_a3 = this.render) == null ? void 0 : _a3.renderCacheData.clear(); } } /** * 根据点的数量判断图形是否在一个区域内 * @param x * @param y * @param x1 * @param y1 * @param pointNumber 在区域内点的数量,达到这个数量则看作在区域内,默认1 * @returns 是否在区域内 */ isInRect(x2, y2, x1, y1, pointNumber = 1) { var _a3; if (x2 === void 0 || y2 === void 0 || x1 === void 0 || y1 === void 0) { return false; } let pvs2 = ((_a3 = this.operatePVS) == null ? void 0 : _a3.length) > 2 ? this.operatePVS : this.pvs; let len = pvs2.length; let pn2 = 0; let modelLines = []; for (let i2 = 0; i2 < len; i2++) { let ps = pvs2[i2]; if (ps.x >= x2 && ps.y >= y2 && ps.x <= x1 && ps.y <= y1) { pn2++; } if (pn2 >= pointNumber) { return true; } if (i2 == len - 1) { modelLines.push({ x1: pvs2[i2].x, y1: pvs2[i2].y, x2: pvs2[0].x, y2: pvs2[0].y }); } else { modelLines.push({ x1: pvs2[i2].x, y1: pvs2[i2].y, x2: pvs2[i2 + 1].x, y2: pvs2[i2 + 1].y }); } } let rectLines = [ { x1: x2, y1: y2, x2: x1, y2 }, { x1, y1: y2, x2: x1, y2: y1 }, { x1, y1, x2, y2: y1 }, { x1: x2, y1, x2, y2 } ]; len = modelLines.length; for (let i2 = 0; i2 < len; i2++) { for (let j2 = 0; j2 < 4; j2++) { if (DDeiUtil$1.isLineCross(modelLines[i2], rectLines[j2])) { pn2++; if (pn2 >= pointNumber) { return true; } } } } let outRect = DDeiAbstractShape.pvsToOutRect(pvs2); if (x2 >= outRect.x && x2 <= outRect.x1 && y2 >= outRect.y && y2 <= outRect.y1) { return true; } return false; } /** * 判断某个线段是否与当前图形相交 */ isLineCross(line2) { for (let i2 = 0; i2 < this.pvs.length; i2++) { let s = i2; let e = i2 + 1; if (i2 == this.pvs.length - 1) { e = 0; } if (DDeiUtil$1.isLineCross(line2, { x1: this.pvs[s].x, y1: this.pvs[s].y, x2: this.pvs[e].x, y2: this.pvs[e].y })) { return true; } } return false; } /** * 判断图形是否在一个文本编辑的区域内 * @param x * @param y * @returns 是否在区域内 */ isInTextArea(x2 = void 0, y2 = void 0) { var _a3; if (x2 === void 0 || y2 === void 0) { return false; } if (((_a3 = this.textArea) == null ? void 0 : _a3.length) > 0) { return DDeiAbstractShape.isInsidePolygon( this.textArea, { x: x2, y: y2 } ); } return false; } /** * 判断图形是否在一个区域内,采用宽松的判定模式,允许传入一个大小值 * @param x * @param y * @param loose 宽松判定,默认false * @returns 是否在区域内 */ isInAreaLoose(x2 = void 0, y2 = void 0, loose = false) { var _a3, _b2; if (x2 === void 0 || y2 === void 0) { return false; } let ps = null; if (loose && ((_a3 = this.loosePVS) == null ? void 0 : _a3.length) > 0) { ps = this.loosePVS; } else if (((_b2 = this.pvs) == null ? void 0 : _b2.length) > 0) { ps = this.pvs; } if ((ps == null ? void 0 : ps.length) > 0) { return DDeiAbstractShape.isInsidePolygon( ps, { x: x2, y: y2 } ); } return false; } /** * 获取当前图形的除layer的所有父节点对象 */ getParents() { let pModel = this.pModel; let returnControls = []; while ((pModel == null ? void 0 : pModel.baseModelType) != "DDeiLayer") { returnControls.push(pModel); pModel = pModel.pModel; } return returnControls; } /** * 获取控件坐标 * @param coord 坐标系:1标尺坐标/2页面坐标 * @param unit 标尺单位 * @param type 坐标类型:1左上角/2中心点 */ getPosition(coord = 2, unit = "", type = 2) { switch (coord) { case 1: { if (type == 1) { return DDeiUtil$1.toRulerCoord({ x: this.x, y: this.y }, this.stage, unit); } else if (type == 2) { return DDeiUtil$1.toRulerCoord({ x: this.cpv.x, y: this.cpv.y }, this.stage, unit); } } break; case 2: { if (type == 1) { return { x: this.x, y: this.y }; } else if (type == 2) { return { x: this.cpv.x, y: this.cpv.y }; } } break; } return { x: this.x, y: this.y }; } /** * 设置控件坐标 * @param point 坐标点 * @param coord 坐标系:1标尺坐标/2页面坐标 * @param unit 标尺单位 * @param type 坐标类型:1左上角/2中心点 */ setPosition(point2, coord = 2, unit = "", type = 2) { let moveX = 0, moveY = 0; switch (coord) { case 1: { if (type == 1) { let pv1 = DDeiUtil$1.toPageCoord(point2, this.stage, unit); moveX = pv1.x - this.x; moveY = pv1.y - this.y; } else if (type == 2) { let pv1 = DDeiUtil$1.toPageCoord(point2, this.stage, unit); moveX = pv1.x - this.cpv.x; moveY = pv1.y - this.cpv.y; } } break; case 2: { if (type == 1) { moveX = point2.x - this.x; moveY = point2.y - this.y; } else if (type == 2) { moveX = point2.x - this.cpv.x; moveY = point2.y - this.cpv.y; } } break; } DDeiAbstractShape.moveModels([this], moveX, moveY); } /** * 设置当前模型为被修改状态 */ setModelChanged() { var _a3; (_a3 = this.layer) == null ? void 0 : _a3.setModelChanged(); } /** * 判断当前模型是否已被修改 */ isModelChanged() { var _a3; return (_a3 = this.layer) == null ? void 0 : _a3.isModelChanged(); } /** * 移除自身的方法 */ destroyed() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; if (!this.__destroyed) { if (!this.isShadowControl) { let sourceLinks = (_a3 = this.stage) == null ? void 0 : _a3.getSourceModelLinks(this.id); sourceLinks == null ? void 0 : sourceLinks.forEach((link2) => { var _a22; if (link2.dm) { link2.dm.pModel.removeModel(link2.dm, true); } (_a22 = this.stage) == null ? void 0 : _a22.removeLink(link2); }); let lines = (_b2 = this.stage) == null ? void 0 : _b2.getModelsByBaseType("DDeiLine"); lines == null ? void 0 : lines.forEach((line2) => { var _a22; if ((_a22 = line2.linkModels) == null ? void 0 : _a22.has(this.id)) { line2.linkModels.delete(this.id); } }); (_c2 = this.linkModels) == null ? void 0 : _c2.forEach((lm) => { var _a22; if (lm.dm) { (_a22 = lm.dm.pModel) == null ? void 0 : _a22.removeModel(lm.dm, true); lm.dm.destroyed(); } }); (_d2 = this.linkModels) == null ? void 0 : _d2.clear(); this.linkModels = null; if (this.depModel) { (_e2 = this.depModel.linkModels) == null ? void 0 : _e2.delete(this.id); } } if ((_f = this.render) == null ? void 0 : _f.tempCanvas) { this.render.tempCanvas.remove(); delete this.render.tempCanvas; } if ((_g = this.render) == null ? void 0 : _g.viewer) { DDeiUtil$1.removeRenderViewer(this); } (_h = this.composes) == null ? void 0 : _h.forEach((comp) => { comp.destroyed(); }); this.render = null; this.__destroyed = true; DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_DEL_AFTER", DDeiEnumOperateType.DESTROYED, { models: [this] }, (_i = this.stage) == null ? void 0 : _i.ddInstance, null); } } /** * 移除渲染器 */ destroyRender() { var _a3, _b2, _c2, _d2; if ((_a3 = this.render) == null ? void 0 : _a3.tempCanvas) { this.render.tempCanvas.remove(); delete this.render.tempCanvas; } if ((_b2 = this.render) == null ? void 0 : _b2.viewer) { DDeiUtil$1.removeRenderViewer(this); } (_c2 = this.composes) == null ? void 0 : _c2.forEach((comp) => { comp.destroyRender(); }); if (this.models) { (_d2 = this.midList) == null ? void 0 : _d2.forEach((mid) => { var _a22; (_a22 = this.models.get(mid)) == null ? void 0 : _a22.destroyRender(); }); } this.render = null; } /** * 将模型转换为JSON */ toJSON() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m; let json = new Object(); let skipFields = (_a3 = DDeiConfig$1.SERI_FIELDS[this.modelType]) == null ? void 0 : _a3.SKIP; if (!((skipFields == null ? void 0 : skipFields.length) > 0)) { skipFields = (_b2 = DDeiConfig$1.SERI_FIELDS[this.baseModelType]) == null ? void 0 : _b2.SKIP; } if (!((skipFields == null ? void 0 : skipFields.length) > 0)) { if (this.poly == 2) { skipFields = (_c2 = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _c2.SKIP2; } else { skipFields = (_d2 = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _d2.SKIP; } } let toJSONFields = (_e2 = DDeiConfig$1.SERI_FIELDS[this.modelType]) == null ? void 0 : _e2.TOJSON; if (!((toJSONFields == null ? void 0 : toJSONFields.length) > 0)) { toJSONFields = (_f = DDeiConfig$1.SERI_FIELDS[this.baseModelType]) == null ? void 0 : _f.TOJSON; } if (!((toJSONFields == null ? void 0 : toJSONFields.length) > 0)) { toJSONFields = (_g = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _g.TOJSON; } for (let i2 in this) { if (!skipFields || (skipFields == null ? void 0 : skipFields.indexOf(i2)) == -1) { if (toJSONFields && toJSONFields.indexOf(i2) != -1 && this[i2]) { if (Array.isArray(this[i2])) { let array = []; for (let xi = 0; xi < this[i2].length; xi++) { let element = this[i2][xi]; if (Array.isArray(element)) { let subArray = []; element.forEach((subEle) => { if (subEle == null ? void 0 : subEle.toJSON) { subArray.push(subEle.toJSON()); } else { subArray.push(subEle); } }); array.push(subArray); } else if (element == null ? void 0 : element.toJSON) { array.push(element.toJSON()); } else { array.push(element); } } if (array.length > 0) { json[i2] = array; } } else if (((_h = this[i2]) == null ? void 0 : _h.set) && ((_i = this[i2]) == null ? void 0 : _i.has)) { let map = {}; this[i2].forEach((element, key) => { if (element == null ? void 0 : element.toJSON) { map[key] = element.toJSON(); } else { map[key] = element; } }); if (JSON.stringify(map) != "{}") { json[i2] = map; } } else if ((_j = this[i2]) == null ? void 0 : _j.toJSON) { json[i2] = this[i2].toJSON(); } else if (this[i2] || this[i2] == 0) { json[i2] = this[i2]; } } else { if (Array.isArray(this[i2])) { let array = []; for (let xi = 0; xi < this[i2].length; xi++) { let element = this[i2][xi]; if (Array.isArray(element)) { let subArray = []; element.forEach((subEle) => { if (subEle == null ? void 0 : subEle.toJSON) { subArray.push(subEle.toJSON()); } else { subArray.push(subEle); } }); array.push(subArray); } else if (element == null ? void 0 : element.toJSON) { array.push(element.toJSON()); } else if (element == null ? void 0 : element.isVector3) { let dt = clone(element); delete dt.z; array.push(dt); } else { array.push(element); } } if (array.length > 0) { json[i2] = array; } } else if (((_k = this[i2]) == null ? void 0 : _k.set) && ((_l = this[i2]) == null ? void 0 : _l.has)) { let map = {}; this[i2].forEach((element, key) => { if (element == null ? void 0 : element.toJSON) { map[key] = element.toJSON(); } else { map[key] = element; } }); if (JSON.stringify(map) != "{}") { json[i2] = map; } } else if ((_m = this[i2]) == null ? void 0 : _m.toJSON) { json[i2] = this[i2].toJSON(); } else if (this[i2] || this[i2] == 0) { if (i2 == "rotate" && this[i2] == 0) ; else if ((i2 == "text" || i2 == "imgBase64") && this[i2] == "") ; else if (this[i2].isVector3) { json[i2] = clone(this[i2]); delete json[i2].z; } else { json[i2] = this[i2]; } } } } } return json; } // ============================ 静态方法 ============================ /** * 移动控件位置 * @param models * @param dx * @param dy */ static moveModels(models, dx = 0, dy = 0, ignoreModelIds) { if ((dx != 0 || dy != 0) && (models == null ? void 0 : models.length) > 0) { let moveMatrix2 = new Matrix3( 1, 0, dx, 0, 1, dy, 0, 0, 1 ); models.forEach((m) => { m.transVectors(moveMatrix2); m.refreshLinkModels(); m.updateLinkModels(ignoreModelIds); }); } } /** * 以矩形的大小变化为参照物,修改模型的大小 */ static changeModelBoundByRect(models, rectObj, data) { var _a3; if (!((models == null ? void 0 : models.length) > 0)) { return; } let deltaX = data.deltaX ? data.deltaX : 0; let deltaY = data.deltaY ? data.deltaY : 0; let deltaWidth = data.deltaWidth ? data.deltaWidth : 0; let deltaHeight = data.deltaHeight ? data.deltaHeight : 0; let selector = rectObj; let stageRatio2 = models[0].getStageRatio(); let paddingWeight = 0; if (selector.modelType) { let paddingWeightInfo = ((_a3 = selector.paddingWeight) == null ? void 0 : _a3.selected) ? selector.paddingWeight.selected : DDeiConfig$1.SELECTOR.PADDING_WEIGHT.selected; if (models.length > 1) { paddingWeight = paddingWeightInfo.multiple; } else { paddingWeight = paddingWeightInfo.single; } } selector.width -= 2 * paddingWeight; selector.height -= 2 * paddingWeight; if (selector.width + deltaWidth < 10) { return; } if (selector.height + deltaHeight < 10) { return; } let selectCPVXDelta = deltaX == 0 ? deltaWidth / 2 : deltaX / 2; let selectCPVYDelta = deltaY == 0 ? deltaHeight / 2 : deltaY / 2; let scaleWRate = 1 + deltaWidth / selector.width / stageRatio2; let scaleHRate = 1 + deltaHeight / selector.height / stageRatio2; let itemMoveMatrix = new Matrix3( 1, 0, -selector.cpv.x, 0, 1, -selector.cpv.y, 0, 0, 1 ); let scaleMatrix2 = new Matrix3( scaleWRate, 0, 0, 0, scaleHRate, 0, 0, 0, 1 ); let itemMove1Matrix = new Matrix3( 1, 0, selector.cpv.x + selectCPVXDelta, 0, 1, selector.cpv.y + selectCPVYDelta, 0, 0, 1 ); models.forEach((item) => { var _a22, _b2, _c2, _d2; let m2 = new Matrix3(); m2.premultiply(itemMoveMatrix); if (item.rotate) { let angle2 = item.rotate * DDeiConfig$1.ROTATE_UNIT; let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m2.premultiply(rotateMatrix); } m2.premultiply(scaleMatrix2); if (item.rotate) { let angle2 = -item.rotate * DDeiConfig$1.ROTATE_UNIT; let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m2.premultiply(rotateMatrix); } m2.premultiply(itemMove1Matrix); if (item.baseModelType == "DDeiContainer") { (_a22 = item.layoutManager) == null ? void 0 : _a22.transVectors(m2); } else { item.transVectors(m2); } item.initPVS(); (_c2 = (_b2 = item.getTopContainer()) == null ? void 0 : _b2.render) == null ? void 0 : _c2.enableRefreshShape(); (_d2 = this.render) == null ? void 0 : _d2.enableRefreshShape(); }); } /** * 通过射线法判断点是否在图形内部 * @param pps 多边形顶点 * @param point 测试点 * @returns */ static isInsidePolygon(polygon2, point2) { let x2 = point2.x, y2 = point2.y; let inside = false; for (var i2 = 0, j2 = polygon2.length - 1; i2 < polygon2.length; j2 = i2++) { var xi = polygon2[i2].x, yi = polygon2[i2].y; var xj = polygon2[j2].x, yj = polygon2[j2].y; var intersect = yi > y2 != yj > y2 && x2 < (xj - xi) * (y2 - yi) / (yj - yi) + xi; if (intersect) { inside = !inside; } } return inside; } /** * 基于向量点获取一组图形模型的宽高 * @param models */ static getOutRectByPV(models, ratio = 1) { models = models.filter((item) => !!item); if (!models.length) { return { x: 0, y: 0, width: 0, height: 0 }; } let points = []; models.forEach((item) => { let pvs2 = item.operatePVS ? item.operatePVS : item.pvs; points = points.concat(pvs2); }); return DDeiAbstractShape.pvsToOutRect(points, ratio); } /** * 获取最靠外部的一组向量 * @param models */ static getOutPV(models) { let o = DDeiAbstractShape.getOutRectByPV(models); return DDeiAbstractShape.outRectToPV(o); } /** * 返回外接矩形的点集合 */ static outRectToPV(o) { return [ new Vector3(o.x, o.y, 1), new Vector3(o.x1, o.y, 1), new Vector3(o.x1, o.y1, 1), new Vector3(o.x, o.y1, 1) ]; } /** * 返回点集合的外接矩形 */ static pvsToOutRect(points, ratio = 1) { let x2 = Infinity, y2 = Infinity, x1 = -Infinity, y1 = -Infinity; points.forEach((p) => { x2 = Math.min(p.x, x2); x1 = Math.max(p.x, x1); y2 = Math.min(p.y, y2); y1 = Math.max(p.y, y1); }); return { x: x2 * ratio, y: y2 * ratio, width: (x1 - x2) * ratio, height: (y1 - y2) * ratio, x1: x1 * ratio, y1: y1 * ratio }; } /** * 获取某个控件下的最底层componse控件,如果没有则返回控件本身 */ static findBottomComponseByArea(control, x2 = void 0, y2 = void 0) { var _a3; let componses = []; if (control) { (_a3 = control.composes) == null ? void 0 : _a3.forEach((item) => { if (item.isInAreaLoose(x2, y2, true)) { let subComponse = DDeiAbstractShape.findBottomComponseByArea(item, x2, y2); if (subComponse) { componses.push(subComponse); } else { componses.push(item); } } }); if (componses.length > 0) { componses.sort(function(a, b) { if ((a.cIndex || a.cIndex == 0) && (b.cIndex || b.cIndex == 0)) { return a.cIndex - b.cIndex; } else if ((a.cIndex || a.cIndex == 0) && !(b.cIndex || b.cIndex == 0)) { return 1; } else if (!(a.cIndex || a.cIndex == 0) && (b.cIndex || b.cIndex == 0)) { return -1; } else { return 0; } }); return componses[0]; } else { return control; } } } /** * 得到点在某个路径组合上的投射点 * @param opPVS 构成路径的点 * @param x0,y0 测试点 * @param isClose 是否闭合 * @param sort 是否排序后返回(按照投射距离的绝对值) * @returns 每一条路径上的投影点的坐标 */ static getProjPointDists(opPVS, x0, y0, isClose = false, sort = 0) { if ((opPVS == null ? void 0 : opPVS.length) > 0) { let st, en; let returnData = []; for (let j2 = 0; j2 < opPVS.length; j2++) { let plLength = Infinity; if (j2 == opPVS.length - 1) { if (isClose) { st = j2; en = 0; } else { continue; } } else { st = j2; en = j2 + 1; } let x1 = opPVS[st].x; let y1 = opPVS[st].y; let x2 = opPVS[en].x; let y2 = opPVS[en].y; if (x1 == x2 && y1 == y2) { plLength = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); } else { let s = (x0 - x1) * (y2 - y1) - (y0 - y1) * (x2 - x1); let d = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); plLength = s / d; } let lineV = new Vector3(x2, y2, 1); let pointV = new Vector3(x0, y0, 1); let toZeroMatrix = new Matrix3( 1, 0, -x1, 0, 1, -y1, 0, 0, 1 ); lineV.applyMatrix3(toZeroMatrix); pointV.applyMatrix3(toZeroMatrix); let lineAngle = (new Vector3(1, 0, 0).angleTo(new Vector3(lineV.x, lineV.y, 0)) * 180 / Math.PI).toFixed(4); let angle2 = 0; if (lineV.x >= 0 && lineV.y >= 0) { angle2 = (lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x <= 0 && lineV.y >= 0) { angle2 = (lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x <= 0 && lineV.y <= 0) { angle2 = (-lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x >= 0 && lineV.y <= 0) { angle2 = (-lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); lineV.applyMatrix3(rotateMatrix); pointV.applyMatrix3(rotateMatrix); if (pointV.x < 0) { pointV.x = 0; } else if (pointV.x > lineV.x) { pointV.x = lineV.x; } let v1 = new Vector3(pointV.x, 0, 1); angle2 = -angle2; let rotateMatrix1 = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); v1.applyMatrix3(rotateMatrix1); let removeMatrix = new Matrix3( 1, 0, x1, 0, 1, y1, 0, 0, 1 ); v1.applyMatrix3(removeMatrix); returnData.push({ index: st, dist: plLength, x: v1.x, y: v1.y }); } if (sort == 1) { returnData.sort((a, b) => { return Math.abs(a.dist) - Math.abs(b.dist); }); } else if (sort == 2) { returnData.sort((a, b) => { return Math.abs(b.dist) - Math.abs(a.dist); }); } return returnData; } return null; } /** * 获取某个容器下选中区域的所有控件,如果控件已被选中,且是一个容器,则继续向下直到最底层 * @param container 容器 * @param x X坐标 * @param y Y坐标 * @param loose 启用宽松判定 * @param deep 启动深度判定 * @returns */ static findBottomModelsByArea(container2, x2 = void 0, y2 = void 0, loose = false, deep = false) { let controls2 = []; if (container2) { for (let mg = container2.midList.length - 1; mg >= 0; mg--) { let item = container2.models.get(container2.midList[mg]); if (!DDeiUtil$1.isModelHidden(item) && item.isInAreaLoose(x2, y2, loose)) { if ((item.state == DDeiEnumControlState.SELECTED || deep) && item.baseModelType == "DDeiContainer") { let subControls = DDeiAbstractShape.findBottomModelsByArea(item, x2, y2, loose, deep); if (subControls && subControls.length > 0) { controls2 = controls2.concat(subControls); } else { controls2.push(item); } } else if ((item.state == DDeiEnumControlState.SELECTED || deep) && item.baseModelType == "DDeiTable") { let currentCell = item.getAccuContainerByPos(x2, y2); if ((currentCell == null ? void 0 : currentCell.state) == DDeiEnumControlState.SELECTED) { let subControls = DDeiAbstractShape.findBottomModelsByArea(currentCell, x2, y2, loose, deep); if (subControls && subControls.length > 0) { controls2 = controls2.concat(subControls); } else { controls2.push(item); } } else { controls2.push(item); } } else { controls2.push(item); } } } } if (controls2.length > 1) { controls2.sort(function(a, b) { let anumber = -1; let bnumber = -1; if (a.baseModelType == "DDeiLine") { anumber = 1e3 + (a.zIndex ? b.zIndex : 0); } else if (a.id.startsWith("lsm_")) { anumber = 2100 + (a.zIndex ? b.zIndex : 0); } else { anumber = 1e3 + (a.zIndex ? b.zIndex : 0); } if (b.baseModelType == "DDeiLine") { bnumber = 1e3 + (b.zIndex ? b.zIndex : 0); } else if (b.id.startsWith("lsm_")) { bnumber = 2100 + (b.zIndex ? b.zIndex : 0); } else { bnumber = 1e3 + (b.zIndex ? b.zIndex : 0); } if (a.baseModelType == "DDeiContainer" && a.layout == "compose") { anumber -= 5e3; } if (b.baseModelType == "DDeiContainer" && b.layout == "compose") { bnumber -= 5e3; } return bnumber - anumber; }); } return controls2; } /** * 获取某个容器下选中区域的最底层容器 * @param area 选中区域 * @returns */ static findBottomContainersByArea(container2, x2 = void 0, y2 = void 0) { let controls2 = []; if (container2) { for (let mg = container2.midList.length - 1; mg >= 0; mg--) { let item = container2.models.get(container2.midList[mg]); if (!DDeiUtil$1.isModelHidden(item) && DDeiAbstractShape.isInsidePolygon(item.pvs, { x: x2, y: y2 })) { let accuContainer = item.getAccuContainerByPos(x2, y2); if (accuContainer) { let subControls = DDeiAbstractShape.findBottomContainersByArea(accuContainer, x2, y2); if (subControls && subControls.length > 0) { controls2 = controls2.concat(subControls); } else { controls2.push(accuContainer); } } } } } return controls2; } } const __vite_glob_0_10$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiAbstractShape, default: DDeiAbstractShape }, Symbol.toStringTag, { value: "Module" })); var DDeiEnumBusCommandType = /* @__PURE__ */ ((DDeiEnumBusCommandType2) => { DDeiEnumBusCommandType2["ModelChangeSelect"] = "model-change-select"; DDeiEnumBusCommandType2["StageChangeSelectModels"] = "stage-change-select-models"; DDeiEnumBusCommandType2["CancelCurLevelSelectedModels"] = "cancel-curlevel-selected-models"; DDeiEnumBusCommandType2["UpdateSelectorBounds"] = "update-selector-bounds"; DDeiEnumBusCommandType2["ClearTemplateVars"] = "clear-template-vars"; DDeiEnumBusCommandType2["RefreshShape"] = "refresh-shape"; DDeiEnumBusCommandType2["ModelChangeContainer"] = "model-change-container"; DDeiEnumBusCommandType2["ModelRemove"] = "model-remove"; DDeiEnumBusCommandType2["ModelChangeBounds"] = "model-change-bounds"; DDeiEnumBusCommandType2["ModelChangePosition"] = "model-change-position"; DDeiEnumBusCommandType2["ModelEdgePosition"] = "model-edge-position"; DDeiEnumBusCommandType2["SetHelpLine"] = "set-helpline"; DDeiEnumBusCommandType2["UpdateDragObj"] = "update-dragobj"; DDeiEnumBusCommandType2["ChangeSelectorPassIndex"] = "change-selector-passindex"; DDeiEnumBusCommandType2["ChangeCursor"] = "change-cursor"; DDeiEnumBusCommandType2["ModelChangeRotate"] = "model-change-rotate"; DDeiEnumBusCommandType2["ResetSelectorState"] = "reset-selector-state"; DDeiEnumBusCommandType2["ModelPush"] = "model-push"; DDeiEnumBusCommandType2["CreateDepLinkModel"] = "create-dep-linkmodel"; DDeiEnumBusCommandType2["ModelChangeValue"] = "model-change-value"; DDeiEnumBusCommandType2["ChangeLayout"] = "change-layout"; DDeiEnumBusCommandType2["CopyStyle"] = "copy-style"; DDeiEnumBusCommandType2["AddHistroy"] = "add-histroy"; DDeiEnumBusCommandType2["ModelAlign"] = "model-align"; DDeiEnumBusCommandType2["ModelMerge"] = "model-merge"; DDeiEnumBusCommandType2["ModelCancelMerge"] = "model-cancel-merge"; DDeiEnumBusCommandType2["ModelAutoPos"] = "model-auto-pos"; DDeiEnumBusCommandType2["ChangeEditMode"] = "change-edit-mode"; DDeiEnumBusCommandType2["ChangeStageRatio"] = "change-stage-ratio"; DDeiEnumBusCommandType2["ChangeStageWPV"] = "change-stage-wpv"; DDeiEnumBusCommandType2["CenterStageWPV"] = "center-stage-wpv"; DDeiEnumBusCommandType2["NodifyChange"] = "nodify-change"; DDeiEnumBusCommandType2["NodifyControlCreated"] = "nodify-control-created"; DDeiEnumBusCommandType2["ChangeLinePoint"] = "change-line-point"; DDeiEnumBusCommandType2["TextEditorChangeSelectPos"] = "texteditor-change-select-pos"; DDeiEnumBusCommandType2["OVSChangePosition"] = "ovs-change-position"; DDeiEnumBusCommandType2["UpdatePaperArea"] = "update-paper-area"; return DDeiEnumBusCommandType2; })(DDeiEnumBusCommandType || {}); class DDeiBusCommand { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "code"); __publicField2(this, "name"); __publicField2(this, "desc"); this.code = props.code; this.name = props.name; this.desc = props.desc; } } const _DDeiBusCommandAddHistroy = class _DDeiBusCommandAddHistroy2 extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let stage2 = bus.ddInstance.stage; if (stage2) { let data2 = JSON.stringify(stage2.toJSON()); let lastData = null; if (stage2.histroyIdx != -1) { lastData = stage2.histroy[stage2.histroyIdx]; } if (data2 != lastData) { _DDeiBusCommandAddHistroy2.addHistroy(stage2, data2); } return true; } else { return false; } } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new _DDeiBusCommandAddHistroy2({ code: DDeiEnumBusCommandType.AddHistroy, name: "", desc: "" }); } static addHistroy(stage2, data) { stage2.addHistroy(data); } }; _DDeiBusCommandAddHistroy.addHistroy = debounce(_DDeiBusCommandAddHistroy.addHistroy, 200, { trailing: true, leading: false }); let DDeiBusCommandAddHistroy = _DDeiBusCommandAddHistroy; const __vite_glob_0_0$3$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandAddHistroy, default: DDeiBusCommandAddHistroy }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandCancelCurLevelSelectedModels extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let stage2 = bus.ddInstance.stage; if (stage2) { let ignoreModels = data == null ? void 0 : data.ignoreModels; let optContainer = data == null ? void 0 : data.container; if (!optContainer) { optContainer = stage2.render.currentOperateContainer; } if (!optContainer) { optContainer = stage2.layers[stage2.layerIndex]; } if (optContainer) { if ((data == null ? void 0 : data.curLevel) == true) { optContainer.cancelSelectModels(null, ignoreModels); } else { optContainer.cancelAllLevelSelectModels(ignoreModels); } return true; } } else { return false; } } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandCancelCurLevelSelectedModels({ code: DDeiEnumBusCommandType.CancelCurLevelSelectedModels, name: "", desc: "" }); } } const __vite_glob_0_1$3$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandCancelCurLevelSelectedModels, default: DDeiBusCommandCancelCurLevelSelectedModels }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandCenterStageWPV extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,重绘所有图形 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3; let stage2 = bus.ddInstance.stage; if (stage2) { let maxOutRect = DDeiAbstractShape.getOutRectByPV( stage2.getLayerModels() ); let canvas = bus.ddInstance.render.canvas; let rat1 = bus.ddInstance.render.ratio; let stageRatio2 = stage2.getStageRatio(); let ruleDisplay; if ((_a3 = stage2.ruler) == null ? void 0 : _a3.display) { ruleDisplay = stage2.ruler.display; } else if (stage2.ddInstance.ruler != null && stage2.ddInstance.ruler != void 0) { if (typeof stage2.ddInstance.ruler == "boolean") { ruleDisplay = stage2.ddInstance.ruler ? 1 : 0; } else { ruleDisplay = stage2.ddInstance.ruler.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(stage2, "ruler.display", true); } let ruleWeight = 0; if (ruleDisplay == 1 || ruleDisplay == "1") { ruleWeight = 15; } let centerX = stage2.width / 2 - (maxOutRect.x + maxOutRect.width / 2) * stageRatio2; let centerY = stage2.height / 2 - (maxOutRect.y + maxOutRect.height / 2) * stageRatio2; stage2.wpv.x = -stage2.width / 2 + canvas.width / rat1 / 2 + ruleWeight + centerX; stage2.wpv.y = -stage2.height / 2 + canvas.height / rat1 / 2 + ruleWeight + centerY; return true; } else { return false; } } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus.push(DDeiEnumBusCommandType.RefreshShape); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandCenterStageWPV({ code: DDeiEnumBusCommandType.CenterStageWPV, name: "", desc: "" }); } } const __vite_glob_0_2$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandCenterStageWPV, default: DDeiBusCommandCenterStageWPV }, Symbol.toStringTag, { value: "Module" })); const _DDeiRectangle = class _DDeiRectangle2 extends DDeiAbstractShape { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "border"); __publicField2(this, "fill"); __publicField2(this, "font"); __publicField2(this, "imgBase64"); __publicField2(this, "text"); __publicField2(this, "textStyle"); __publicField2(this, "modelType", "DDeiRectangle"); __publicField2(this, "baseModelType", "DDeiRectangle"); this.border = props.border ? props.border : null; this.fill = props.fill ? props.fill : null; this.font = props.font ? props.font : null; this.text = props.text ? props.text : ""; this.imgBase64 = props.imgBase64 ? props.imgBase64 : ""; this.textStyle = props.textStyle ? props.textStyle : null; } // ============================ 静态变量 ============================ // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}) { let model = new _DDeiRectangle2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; if (!model.pModel) { model.pModel = model.layer; } tempData[model.id] = model; model.initPVS(); model.initRender(); return model; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json, tempData = {}) { let model = new _DDeiRectangle2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; model.initPVS(); return model; } // ============================ 方法 =============================== /** * 初始化渲染器 */ initRender() { DDeiConfig$1.bindRender(this); this.render.init(); } /** * 返回某个点,相对于该图形的角度 */ getPointAngle(point2) { if (DDeiUtil$1.isPointInLine(point2, this.pvs[0], this.pvs[1])) { return DDeiUtil$1.getLineAngle(0, 0, 0, -2); } else if (DDeiUtil$1.isPointInLine(point2, this.pvs[1], this.pvs[2])) { return DDeiUtil$1.getLineAngle(0, 0, 2, 0); } else if (DDeiUtil$1.isPointInLine(point2, this.pvs[2], this.pvs[3])) { return DDeiUtil$1.getLineAngle(0, 0, 0, 2); } else if (DDeiUtil$1.isPointInLine(point2, this.pvs[3], this.pvs[0])) { return DDeiUtil$1.getLineAngle(0, 0, -2, 0); } } }; __publicField2(_DDeiRectangle, "ClsName", "DDeiRectangle"); let DDeiRectangle = _DDeiRectangle; const __vite_glob_0_8$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiRectangle, default: DDeiRectangle }, Symbol.toStringTag, { value: "Module" })); const _DDeiCircle = class _DDeiCircle2 extends DDeiRectangle { constructor() { super(...arguments); __publicField2(this, "modelType", "DDeiCircle"); __publicField2(this, "baseModelType", "DDeiRectangle"); } // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}) { let model = new _DDeiCircle2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; if (!model.pModel) { model.pModel = model.layer; } tempData[model.id] = model; model.initRender(); return model; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json) { let shape = new _DDeiCircle2(json); return shape; } }; __publicField2(_DDeiCircle, "ClsName", "DDeiCircle"); let DDeiCircle = _DDeiCircle; const __vite_glob_0_0$2$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiCircle, default: DDeiCircle }, Symbol.toStringTag, { value: "Module" })); const _DDeiDiamond = class _DDeiDiamond2 extends DDeiRectangle { constructor() { super(...arguments); __publicField2(this, "modelType", "DDeiDiamond"); __publicField2(this, "baseModelType", "DDeiRectangle"); } /** * 得到点在图形连接线上的投射点 * @param point 测试点 * @param distance 内外部判定区间的距离 * @param direct 方向,1外部,2内部 默认1 * @returns 投影点的坐标 */ getProjPoint(point2, distance = { in: -5, out: 15 }, direct = 1) { let pvs2 = []; for (let i2 = 0; i2 < this.currentPointVectors.length; i2++) { let s = null; let e = null; if (i2 == this.currentPointVectors.length - 1) { s = this.currentPointVectors[i2]; e = this.currentPointVectors[0]; } else { s = this.currentPointVectors[i2]; e = this.currentPointVectors[i2 + 1]; } let p = { x: (s.x + e.x) / 2, y: (s.y + e.y) / 2 }; pvs2.push(p); } let x0 = point2.x; let y0 = point2.y; if ((pvs2 == null ? void 0 : pvs2.length) > 0) { let st, en; for (let j2 = 0; j2 < pvs2.length; j2++) { let plLength = Infinity; if (j2 == pvs2.length - 1) { st = j2; en = 0; } else { st = j2; en = j2 + 1; } let x1 = pvs2[st].x; let y1 = pvs2[st].y; let x2 = pvs2[en].x; let y2 = pvs2[en].y; if (x1 == x2 && y1 == y2) { plLength = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); } else { let s = (x0 - x1) * (y2 - y1) - (y0 - y1) * (x2 - x1); let d = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); plLength = s / d; } let flag = false; if (direct == 1) { if (plLength >= distance.in && plLength <= distance.out) { flag = true; } } else if (direct == 2) { if (plLength <= distance.in && plLength >= distance.out) { flag = true; } } if (flag) { let lineV = new Vector3(x2, y2, 1); let pointV = new Vector3(x0, y0, 1); let toZeroMatrix = new Matrix3( 1, 0, -x1, 0, 1, -y1, 0, 0, 1 ); lineV.applyMatrix3(toZeroMatrix); pointV.applyMatrix3(toZeroMatrix); let lineAngle = (new Vector3(1, 0, 0).angleTo(new Vector3(lineV.x, lineV.y, 0)) * 180 / Math.PI).toFixed(4); let angle2 = 0; if (lineV.x >= 0 && lineV.y >= 0) { angle2 = (lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x <= 0 && lineV.y >= 0) { angle2 = (lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x <= 0 && lineV.y <= 0) { angle2 = (-lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (lineV.x >= 0 && lineV.y <= 0) { angle2 = (-lineAngle * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); lineV.applyMatrix3(rotateMatrix); pointV.applyMatrix3(rotateMatrix); if (pointV.x >= 0 && pointV.x <= lineV.x) { let v1 = new Vector3(pointV.x, 0, 1); angle2 = -angle2; let rotateMatrix2 = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); v1.applyMatrix3(rotateMatrix2); let removeMatrix = new Matrix3( 1, 0, x1, 0, 1, y1, 0, 0, 1 ); v1.applyMatrix3(removeMatrix); return v1; } } } } return null; } // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}) { let model = new _DDeiDiamond2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; if (!model.pModel) { model.pModel = model.layer; } tempData[model.id] = model; model.initRender(); return model; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json) { let shape = new _DDeiDiamond2(json); return shape; } }; __publicField2(_DDeiDiamond, "ClsName", "DDeiDiamond"); let DDeiDiamond = _DDeiDiamond; const __vite_glob_0_1$2$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiDiamond, default: DDeiDiamond }, Symbol.toStringTag, { value: "Module" })); const _DDeiLayer = class _DDeiLayer2 { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "id"); __publicField2(this, "name"); __publicField2(this, "models"); __publicField2(this, "midList"); __publicField2(this, "modelType", "DDeiLayer"); __publicField2(this, "baseModelType", "DDeiLayer"); __publicField2(this, "stage"); __publicField2(this, "index"); __publicField2(this, "background"); __publicField2(this, "display", 1); __publicField2(this, "tempDisplay", false); __publicField2(this, "lock", false); __publicField2(this, "print", true); __publicField2(this, "unicode"); __publicField2(this, "bg"); __publicField2(this, "opPoints", []); __publicField2(this, "opLine", null); __publicField2(this, "centerOpPoints", []); __publicField2(this, "layoutManager"); __publicField2(this, "dragInPoints", []); __publicField2(this, "dragOutPoints", []); __publicField2(this, "shadowControls", []); __publicField2(this, "modelCode", "DDeiLayer"); __publicField2(this, "modelChanged", true); __publicField2(this, "modelNumber", 0); this.id = props.id; this.name = props.name; this.models = props.models ? props.models : /* @__PURE__ */ new Map(); this.midList = props.midList ? props.midList : new Array(); this.stage = null; this.index = -1; this.background = props.background ? props.background : null; this.display = props.display || props.display == 0 ? props.display : 1; this.tempDisplay = props.tempDisplay ? props.tempDisplay : false; this.lock = props.lock ? props.lock : false; this.print = props.print ? props.print : true; this.unicode = props.unicode ? props.unicode : DDeiUtil$1.getUniqueCode(); this.bg = props.bg; } // ============================ 静态变量 ============================ // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}) { var _a3; let layer2 = new _DDeiLayer2(json); layer2.stage = tempData["currentStage"]; tempData["currentLayer"] = layer2; let ddInstance = (_a3 = layer2.stage) == null ? void 0 : _a3.ddInstance; tempData[layer2.id] = layer2; let models = /* @__PURE__ */ new Map(); let midList = layer2.midList ? layer2.midList : new Array(); for (let key in json.models) { let item = json.models[key]; let model = ddInstance.controlModelClasses[item.modelType].loadFromJSON(item, tempData); models.set(key, model); if (midList.indexOf(model.id) == -1) { midList.push(model.id); } } tempData["currentLayer"] = null; layer2.models = models; layer2.midList = midList; layer2.initRender(); layer2.calModelNumber(); return layer2; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json) { let layer2 = new _DDeiLayer2(json); return layer2; } // ============================ 方法 =============================== /** * 计算当前layer的模型总数量 */ calModelNumber() { let num = 0; this.midList.forEach((mid) => { let model = this.models.get(mid); if ((model == null ? void 0 : model.baseModelType) == "DDeiContainer") { num += model.calModelNumber(); } else if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { num += model.calModelNumber(); } else { num++; } }); this.modelNumber = num; return num; } /** * 初始化渲染器 */ initRender() { DDeiConfig$1.bindRender(this); this.render.init(); this.models.forEach((item, key) => { item.initRender(); }); } /** * 获取画布缩放比率 */ getStageRatio() { if (this.stage) { let stageRatio2 = parseFloat(this.stage.ratio) ? parseFloat(this.stage.ratio) : 1; if (!stageRatio2 || isNaN(stageRatio2)) { stageRatio2 = this.stage.ddInstance.ratio; } return stageRatio2; } else { return 1; } } notifyChange() { var _a3; (_a3 = this.stage) == null ? void 0 : _a3.notifyChange(); } /** * 获取子模型 */ getSubModels(ignoreModelIds, level = 1, rect) { let models = []; this.midList.forEach((mid) => { if (ignoreModelIds && (ignoreModelIds == null ? void 0 : ignoreModelIds.indexOf(mid)) != -1) { return; } let subModel = null; if (this.models.get) { subModel = this.models.get(mid); } else { subModel = this.models[mid]; } if (subModel) { if (!rect || subModel.isInRect(rect.x, rect.y, rect.x1, rect.y1)) { if (level > 1 && (subModel == null ? void 0 : subModel.getSubModels)) { let subModels = subModel.getSubModels(ignoreModelIds, level - 1, rect); models = models.concat(subModels); } models.push(subModel); } } }); return models; } /** * 获取子模型,通过一个过滤器 */ getSubModelsByFilter(filterName = null, ignoreModelIds, level = 1, params) { let models = []; this.midList.forEach((mid) => { if (ignoreModelIds && (ignoreModelIds == null ? void 0 : ignoreModelIds.indexOf(mid)) != -1) { return; } let subModel = null; if (this.models.get) { subModel = this.models.get(mid); } else { subModel = this.models[mid]; } if (subModel) { let filterMethod = null; if (filterName) { let define2 = DDeiUtil$1.getControlDefine(subModel); if (define2 && define2.filters && define2.filters[filterName]) { filterMethod = define2.filters[filterName]; } } if (!filterMethod || filterMethod(subModel, params)) { if (level > 1 && (subModel == null ? void 0 : subModel.getSubModelsByFilter)) { let subModels = subModel.getSubModelsByFilter(filterName, ignoreModelIds, level - 1, params); models = models.concat(subModels); } models.push(subModel); } } }); return models; } /** * 添加模型,并维护关系 * @param model 被添加的模型 */ addModel(model, notify = true) { if (this.midList.indexOf(model.id) == -1) { model.stage = this.stage; this.models.set(model.id, model); if (this.midList && this.midList.length > 0) { model.zIndex = this.models.get(this.midList[this.midList.length - 1]).zIndex; } this.midList.push(model.id); model.layer = this; model.pModel = this; this.resortModelByZIndex(); if (notify) { this.notifyChange(); } } } /** * 移除模型,并维护关系 * @param model 被移除的模型 * @param destroy 销毁,缺省false */ removeModels(models, destroy = false, notify = true) { models == null ? void 0 : models.forEach((model) => { this.removeModel(model, destroy, false); }); if (notify) { this.notifyChange(); } } /** * 移除所有元素 */ clearModels(destroy = false) { this.models.forEach((model) => { this.removeModel(model, destroy); }); } cascadeRemoveSelf() { } /** * 移除自身的方法 */ destroyed() { var _a3, _b2; if ((_a3 = this.render) == null ? void 0 : _a3.containerViewer) { this.render.containerViewer.remove(); delete this.render.containerViewer; } this.render = null; (_b2 = this.models) == null ? void 0 : _b2.forEach((item, key) => { item == null ? void 0 : item.destroyed(); }); } /** * 移除渲染器 */ destroyRender() { var _a3, _b2; if ((_a3 = this.render) == null ? void 0 : _a3.containerViewer) { this.render.containerViewer.remove(); delete this.render.containerViewer; } (_b2 = this.models) == null ? void 0 : _b2.forEach((item, key) => { item == null ? void 0 : item.destroyRender(); }); this.render = null; } /** * 移除模型,并维护关系 * @param model 被移除的模型 * @param destroy 销毁,缺省false */ removeModel(model, destroy = false, notify = true) { var _a3; this.models.delete(model.id); let idx = this.midList.indexOf(model.id); if (idx != -1) { this.midList.splice(idx, 1); } if (destroy) { model.destroyed(); } model.layer = null; model.stage = null; model.render = null; if ((_a3 = this.stage) == null ? void 0 : _a3.render) { this.stage.render.refreshJumpLine = false; } if (notify) { this.notifyChange(); } } /** * 根据ID删除元素 */ removeModelById(ids, notify = true) { ids == null ? void 0 : ids.forEach((id) => { let model = this.getModelById(id); if (model) { this.removeModel(model); } }); this.models.forEach((model) => { if (model.baseModelType == "DDeiContainer") { model.removeModelById(ids); } }); if (notify) { this.notifyChange(); } } /** * 根据基础模型获取控件 * @param bmt 基础模型类别 */ getModelsByBaseType(bmt) { let returnValues = []; this.midList.forEach((mid) => { let model = this.models.get(mid); if ((model == null ? void 0 : model.baseModelType) == bmt) { returnValues.push(model); } else if ((model == null ? void 0 : model.baseModelType) == "DDeiContainer") { let datas2 = model.getModelsByBaseType(bmt); datas2.forEach((dt) => { returnValues.push(dt); }); } }); return returnValues; } /** * 获取当前图形的除layer的所有父节点对象 */ getParents() { return []; } /** * 将控件设置到顶层 */ pushTop(models, notify = true) { models.forEach((item) => { let lastItem = this.models.get(this.midList[this.midList.length - 1]); if (lastItem.id != item.id) { let lastIndex = lastItem.zIndex ? lastItem == null ? void 0 : lastItem.zIndex : 0; item.zIndex = lastIndex + 1; } }); this.resortModelByZIndex(); if (notify) { this.notifyChange(); } } /** * 将控件设置到底层 */ pushBottom(models, notify = true) { models.forEach((item) => { item.zIndex = null; let oldIdIndex = this.midList.indexOf(item.id); if (oldIdIndex > 0) { this.midList.splice(oldIdIndex, 1); this.midList.splice(0, 0, item.id); } }); this.resortModelByZIndex(); if (notify) { this.notifyChange(); } } /** * 将控件设置到上一层 */ pushUp(models, notify = true) { models.forEach((item) => { if (!item.zIndex) { item.zIndex = 1; } else { item.zIndex++; } }); this.resortModelByZIndex(); if (notify) { this.notifyChange(); } } /** * 将控件设置到下一层 */ pushDown(models, notify = true) { models.forEach((item) => { if (!item.zIndex || item.zIndex <= 1) { item.zIndex = null; let oldIdIndex = this.midList.indexOf(item.id); if (oldIdIndex > 0) { let temp = this.midList[oldIdIndex]; this.midList[oldIdIndex] = this.midList[oldIdIndex - 1]; this.midList[oldIdIndex - 1] = temp; } } else { item.zIndex--; } }); this.resortModelByZIndex(); if (notify) { this.notifyChange(); } } /** * 按照Zindex的顺序,从小到大排列,并重新设置子元素的zindex确保其连续,最后将排序后的List设置成新的midList */ resortModelByZIndex() { let newMidList = new Array(); let hadZIndexList = new Array(); for (let mg = 0; mg < this.midList.length; mg++) { let item = this.models.get(this.midList[mg]); if (item.zIndex && item.zIndex > 0) { let insertIndex = hadZIndexList.length; for (let j2 = 0; j2 < hadZIndexList.length; j2++) { if (this.models.get(hadZIndexList[j2]).zIndex > item.zIndex) { insertIndex = j2; break; } } hadZIndexList.splice(insertIndex, 0, item.id); } else { newMidList.push(item.id); } } this.midList = newMidList.concat(hadZIndexList); } /** * 获取当前图形的绝对旋转坐标值 */ getAbsRotate() { return 0; } /** * 取消选择控件,默认取消所有 */ cancelSelectModels(models, ignoreModels) { if (!models) { models = Array.from(this.models.values()); } models.forEach((item) => { if (!ignoreModels || (ignoreModels == null ? void 0 : ignoreModels.indexOf(item)) == -1) { item.setState(DDeiEnumControlState.DEFAULT); } }); } /** * 取消选择控件,默认取消所有 */ cancelAllLevelSelectModels(ignoreModels) { this.models.forEach((item) => { if (!ignoreModels || (ignoreModels == null ? void 0 : ignoreModels.indexOf(item)) == -1) { item.setState(DDeiEnumControlState.DEFAULT); } if (item.baseModelType == "DDeiContainer") { item.cancelAllLevelSelectModels(ignoreModels); } }); } /** * 获取绝对的控件坐标 */ getAbsPosition(pm) { return { x: 0, y: 0 }; } getPosition() { return { x: 0, y: 0 }; } /** * 根据坐标获取操作点 * @param x * @param y * @returns 操作点 */ getOpPointByPos(x2 = 0, y2 = 0) { var _a3, _b2, _c2, _d2; let minLength = Infinity; let minPoint = null; if (x2 && y2 && (((_a3 = this.opPoints) == null ? void 0 : _a3.length) > 0 || ((_b2 = this.centerOpPoints) == null ? void 0 : _b2.length) > 0)) { for (let i2 = 0; i2 < ((_c2 = this.opPoints) == null ? void 0 : _c2.length); i2++) { let point2 = this.opPoints[i2]; let absX = Math.abs(x2 - point2.x); let absY = Math.abs(y2 - point2.y); if (absX <= 8 && absY <= 8) { if (absX + absY < minLength) { minLength = absX + absY; minPoint = point2; } } } for (let i2 = 0; i2 < ((_d2 = this.centerOpPoints) == null ? void 0 : _d2.length); i2++) { let point2 = this.centerOpPoints[i2]; let absX = Math.abs(x2 - point2.x); let absY = Math.abs(y2 - point2.y); if (absX <= 8 && absY <= 8) { if (absX + absY < minLength) { minLength = absX + absY; minPoint = point2; } } } } return minPoint; } /** * 获取某个选中区域的所有控件 * @param area 选中区域 * @returns */ findModelsByArea(x2 = void 0, y2 = void 0, width = 0, height = 0) { let controls2 = []; this.models.forEach((item) => { if (DDeiAbstractShape.isInsidePolygon(item.pvs, { x: x2, y: y2 })) { controls2.push(item); } }); return controls2; } /** * 修改上层模型大小 */ changeParentsBounds() { return true; } /** * 获取实际的内部容器控件 * @param x 相对路径坐标 * @param y 相对路径坐标 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainer() { return this; } /** * 获取实际的内部容器控件 * @param x 相对路径坐标 * @param y 相对路径坐标 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainerByPos(x2, y2) { return this; } /** * 获取选中状态的所有控件 * @returns */ getSelectedModels() { let controls2 = /* @__PURE__ */ new Map(); this.models.forEach((item, key) => { if (item.state == DDeiEnumControlState.SELECTED) { controls2.set(item.id, item); } }); return controls2; } /** * 设置当前模型为被修改状态 */ setModelChanged() { this.modelChanged = true; } /** * 判断当前模型是否已被修改 */ isModelChanged() { return this.modelChanged; } /** * 根据ID获取模型 * @param id 模型id */ getModelById(id) { let reutrnModel = null; if (id) { if (this.models.has(id)) { reutrnModel = this.models.get(id); } else { this.models.forEach((item) => { let container2 = item.getAccuContainer(); if (container2) { let rm = container2.getModelById(id); if (rm) { reutrnModel = rm; } } }); } } if (!reutrnModel) { reutrnModel = null; } return reutrnModel; } /** * 将模型转换为JSON */ toJSON() { var _a3, _b2, _c2, _d2, _e2, _f; let json = new Object(); let skipFields = (_a3 = DDeiConfig$1.SERI_FIELDS[this.modelType]) == null ? void 0 : _a3.SKIP; if (!((skipFields == null ? void 0 : skipFields.length) > 0)) { skipFields = (_b2 = DDeiConfig$1.SERI_FIELDS[this.baseModelType]) == null ? void 0 : _b2.SKIP; } if (!((skipFields == null ? void 0 : skipFields.length) > 0)) { skipFields = (_c2 = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _c2.SKIP; } let toJSONFields = (_d2 = DDeiConfig$1.SERI_FIELDS[this.modelType]) == null ? void 0 : _d2.TOJSON; if (!((toJSONFields == null ? void 0 : toJSONFields.length) > 0)) { toJSONFields = (_e2 = DDeiConfig$1.SERI_FIELDS[this.baseModelType]) == null ? void 0 : _e2.TOJSON; } if (!((toJSONFields == null ? void 0 : toJSONFields.length) > 0)) { toJSONFields = (_f = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _f.TOJSON; } for (let i2 in this) { if (!skipFields || (skipFields == null ? void 0 : skipFields.indexOf(i2)) == -1) { if (toJSONFields && toJSONFields.indexOf(i2) != -1 && this[i2]) { if (Array.isArray(this[i2])) { let array = []; this[i2].forEach((element) => { if (element == null ? void 0 : element.toJSON) { array.push(element.toJSON()); } else { array.push(element); } }); json[i2] = array; } else if (this[i2].set && this[i2].has) { let map = {}; this[i2].forEach((element, key) => { if (element == null ? void 0 : element.toJSON) { map[key] = element.toJSON(); } else { map[key] = element; } }); json[i2] = map; } else if (this[i2].toJSON) { json[i2] = this[i2].toJSON(); } else { json[i2] = this[i2]; } } else { json[i2] = this[i2]; } } } return json; } }; __publicField2(_DDeiLayer, "ClsName", "DDeiLayer"); let DDeiLayer = _DDeiLayer; const __vite_glob_0_2$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLayer, default: DDeiLayer }, Symbol.toStringTag, { value: "Module" })); const calAutoLinePath = function(sd, ed, obis, extConfig) { var _a3, _b2; let startTime = (/* @__PURE__ */ new Date()).getTime(); if (!sd.direct) { sd.direct = 3; switch (sd.angle) { case -90: sd.direct = 1; break; case 0: sd.direct = 2; break; case 90: sd.direct = 3; break; case 180: sd.direct = 4; break; } } if (!ed.direct) { ed.direct = 1; switch (ed.angle) { case -90: ed.direct = 1; break; case 0: ed.direct = 2; break; case 90: ed.direct = 3; break; case 180: ed.direct = 4; break; } } if (!extConfig) { extConfig = {}; } if (!extConfig.recomWeight) { extConfig.recomWeight = 100; } if (!extConfig.rectMidWeight) { extConfig.rectMidWeight = 50; } let outRects = []; let extLines = []; let corssPoints = []; ed.point.isEnd = true; ed.point.direct = ed.direct; sd.point.direct = sd.direct; sd.point.isStart = true; corssPoints.push(sd.point); corssPoints.push(ed.point); genSEExtLine(sd, corssPoints, extLines); genSEExtLine(ed, corssPoints, extLines); getAutoLineItemExtPoints(corssPoints, outRects, extLines, obis); for (let i2 = 0; i2 < outRects.length; i2++) { let octi = outRects[i2]; for (let j2 = 1; j2 < outRects.length; j2++) { let octj = outRects[j2]; if (i2 != j2 && octi.isStartOrEnd && octj.isStartOrEnd) { if (octj.y1 < octi.y) { let mdy = octj.y1 + (octi.y - octj.y1) / 2; extLines.push([{ x: octj.x - 5e4, y: mdy, prio: extConfig == null ? void 0 : extConfig.rectMidWeight }, { x: octj.x + 5e4, y: mdy }]); } else if (octj.y > octi.y1) { let mdy = octi.y1 + (octj.y - octi.y1) / 2; extLines.push([{ x: octj.x - 5e4, y: mdy, prio: extConfig == null ? void 0 : extConfig.rectMidWeight }, { x: octj.x + 5e4, y: mdy }]); } if (octj.x1 < octi.x) { let mdx = octj.x1 + (octi.x - octj.x1) / 2; extLines.push([{ x: mdx, y: octj.y - 5e4, prio: extConfig == null ? void 0 : extConfig.rectMidWeight }, { x: mdx, y: octj.y + 5e4 }]); } else if (octj.x > octi.x1) { let mdx = octi.x1 + (octj.x - octi.x1) / 2; extLines.push([{ x: mdx, y: octj.y - 5e4, prio: extConfig == null ? void 0 : extConfig.rectMidWeight }, { x: mdx, y: octj.y + 5e4 }]); } } } } (_a3 = extConfig == null ? void 0 : extConfig.recommendPaths) == null ? void 0 : _a3.forEach((point2) => { if (point2.type == "x") { extLines.push([{ x: point2.x, y: point2.y - 5e4, isRecommend: 1, prio: extConfig.recomWeight, color: "blue" }, { x: point2.x, y: point2.y + 5e4 }]); } else if (point2.type == "y") { extLines.push([{ x: point2.x - 5e4, y: point2.y, isRecommend: 1, prio: extConfig.recomWeight, color: "blue" }, { x: point2.x + 5e4, y: point2.y }]); } }); (_b2 = extConfig == null ? void 0 : extConfig.forcePaths) == null ? void 0 : _b2.forEach((point2) => { if (point2.x) { extLines.push([{ x: point2.x, y: point2.y - 5e4, isForce: 1, prio: 9999, color: "orange" }, { x: point2.x, y: point2.y + 5e4 }]); } else if (point2.y) { extLines.push([{ x: point2.x - 5e4, y: point2.y, isForce: 1, prio: 9999, color: "orange" }, { x: point2.x + 5e4, y: point2.y }]); } }); for (let i2 = 0; i2 < extLines.length; i2++) { let linei = extLines[i2]; let lineil = [linei[0]]; if (linei[0].x == linei[1].x) { if (linei[0].y >= linei[1].y) { lineil.push({ x: linei[1].x, y: linei[1].y - 1e3 }); } else { lineil.push({ x: linei[1].x, y: linei[1].y + 1e3 }); } } else if (linei[0].y == linei[1].y) { if (linei[0].x >= linei[1].x) { lineil.push({ x: linei[1].x - 1e3, y: linei[1].y }); } else { lineil.push({ x: linei[1].x + 1e3, y: linei[1].y }); } } for (let j2 = i2 + 1; j2 < extLines.length; j2++) { let linej = extLines[j2]; let linejl = [linej[0]]; if (linej[0].x == linej[1].x) { if (linej[0].y >= linej[1].y) { linejl.push({ x: linej[1].x, y: linej[1].y - 1e3 }); } else { linejl.push({ x: linej[1].x, y: linej[1].y + 1e3 }); } } else if (linej[0].y == linej[1].y) { if (linej[0].x >= linej[1].x) { linejl.push({ x: linej[1].x - 1e3, y: linej[1].y }); } else { linejl.push({ x: linej[1].x + 1e3, y: linej[1].y }); } } let cp = getLineCorssPoint(lineil[0], lineil[1], linejl[0], linejl[1]); if (cp) { cp.prio = (lineil[0].prio ? lineil[0].prio : 1) + (linejl[0].prio ? linejl[0].prio : 1); corssPoints.push(cp); } } } let yIntIndex = {}; let xIntIndex = {}; corssPoints.forEach((point2) => { let intX = parseInt(point2.x); let intY = parseInt(point2.y); point2.intX = intX; point2.intY = intY; if (!yIntIndex[intY]) { yIntIndex[intY] = []; } let arr = yIntIndex[intY]; let idx = -1; for (let i2 = 0; i2 < arr.length; i2++) { if (intX < parseInt(arr[i2].x)) { arr.splice(i2, 0, point2); idx = i2; break; } else if (intX == parseInt(arr[i2].x)) { if (point2.isStart) arr[i2].isStart = point2.isStart; if (point2.isEnd) arr[i2].isEnd = point2.isEnd; if (point2.prio) { arr[i2].prio = (arr[i2].prio ? arr[i2].prio : 0) + point2.prio; } idx = i2; break; } } if (idx == -1) { arr.push(point2); } if (!xIntIndex[intX]) { xIntIndex[intX] = []; } arr = xIntIndex[intX]; idx = -1; for (let i2 = 0; i2 < arr.length; i2++) { if (intY < parseInt(arr[i2].y)) { arr.splice(i2, 0, point2); idx = i2; break; } else if (intY == parseInt(arr[i2].y)) { if (point2.isStart) arr[i2].isStart = point2.isStart; if (point2.isEnd) arr[i2].isEnd = point2.isEnd; if (point2.prio) { arr[i2].prio = (arr[i2].prio ? arr[i2].prio : 0) + point2.prio; } idx = i2; break; } } if (idx == -1) { arr.push(point2); } }); let buildPointTime = (/* @__PURE__ */ new Date()).getTime(); let successPaths = []; getLookForPath(null, sd.point, ed.point, 0, outRects, xIntIndex, yIntIndex, 0, 0, "root", [], successPaths); let lookForTime = (/* @__PURE__ */ new Date()).getTime(); let minTurnNum = -1, minDistance = -1, maxPrio = 0; let candidatePaths = []; for (let i2 = 0; i2 < successPaths.length; i2++) { if (minTurnNum == -1 || minTurnNum > successPaths[i2].turnNum) { minTurnNum = successPaths[i2].turnNum; candidatePaths = [successPaths[i2].pathPoints]; minDistance = successPaths[i2].distance; maxPrio = successPaths[i2].prio; } else if (minTurnNum == successPaths[i2].turnNum) { if (maxPrio < successPaths[i2].prio) { minTurnNum = successPaths[i2].turnNum; candidatePaths = [successPaths[i2].pathPoints]; minDistance = successPaths[i2].distance; candidatePaths.push(successPaths[i2].pathPoints); maxPrio = successPaths[i2].prio; } else if (maxPrio == successPaths[i2].prio && parseInt(minDistance) > parseInt(successPaths[i2].distance)) { minTurnNum = successPaths[i2].turnNum; candidatePaths = [successPaths[i2].pathPoints]; minDistance = successPaths[i2].distance; candidatePaths.push(successPaths[i2].pathPoints); } else if (maxPrio == successPaths[i2].prio && parseInt(minDistance) == parseInt(successPaths[i2].distance)) { candidatePaths.push(successPaths[i2].pathPoints); } } } let newPaths = []; for (let i2 = 0; i2 < candidatePaths.length; i2++) { let paths = candidatePaths[i2]; let upX = paths[0].x, upY = paths[0].y; let upSX = paths[0].x, upSY = paths[0].y; let newPath = [paths[0]], d = 0; for (let j2 = 1; j2 < paths.length; j2++) { let cp = paths[j2]; if (!d) { if (cp.intX == parseInt(upSX) && cp.intY == parseInt(upSY)) ; else if (cp.intX == parseInt(upSX)) { d = 2; } else if (cp.intY == parseInt(upSY)) { d = 1; } } else if (d == 1) { if (cp.intY != parseInt(upSY)) { d = 2; upSX = cp.x; upSY = cp.y; newPath.push({ x: upX, y: upY }); } } else if (d == 2) { if (cp.intX != parseInt(upSX)) { d = 1; upSX = cp.x; upSY = cp.y; newPath.push({ x: upX, y: upY }); } } upX = cp.x; upY = cp.y; } if (parseInt(upX) != newPath[newPath.length - 1].intX || parseInt(upY) != newPath[newPath.length - 1].intY) { newPath.push({ x: upX, y: upY }); } newPaths.push(newPath); } let pathPoints = []; if (newPaths.length > 0) { pathPoints = newPaths[0]; let minDiff = Infinity, bestI = -1; for (let i2 = 0; i2 < newPaths.length; i2++) { let paths = newPaths[i2]; if (paths.length > 2) { let maxDiffY = 0, maxDiffX = 0; let d = paths[0].intX == paths[1].intX ? 2 : 1; for (let j2 = 2; j2 < paths.length; j2++) { if (d == 2) { if (maxDiffY < Math.abs(paths[j2 - 2].y - paths[j2].y)) { maxDiffY = Math.abs(paths[j2 - 2].y - paths[j2].y); } } else { if (maxDiffX < Math.abs(paths[j2 - 2].x - paths[j2].x)) { maxDiffX = Math.abs(paths[j2 - 2].x - paths[j2].x); } } } if (minDiff > maxDiffY + maxDiffX) { minDiff = maxDiffY + maxDiffX; bestI = i2; } } } pathPoints = newPaths[bestI]; } let endTime = (/* @__PURE__ */ new Date()).getTime(); return { corssPoints, pathPoints, extLines, totalTime: endTime - startTime, lookForTime: lookForTime - buildPointTime, selectPathTime: endTime - lookForTime, buildPointTime: buildPointTime - startTime }; }; const getLookForPath = function(upPoint, curPoint, endPoint, fromDirect, outRects, xIntIndex, yIntIndex, turnNum, distance, fullpath, passPoints, successPaths) { let directSortList = [1, 2, 3, 4]; if (!curPoint) { return { state: -1, end: 1, fullpath }; } if (turnNum >= 5 || turnNum > endPoint.minTurnNum) { return { state: -1 }; } let intX = curPoint.intX; let intY = curPoint.intY; if (isNaN(intX) || isNaN(intY)) { return { state: -1, end: 1, fullpath }; } let xyIndex = curPoint.xyIndex; if (!xyIndex) { xyIndex = xIntIndex[intX].indexOf(curPoint); curPoint.xyIndex = xyIndex; } let yxIndex = curPoint.yxIndex; if (!yxIndex) { yxIndex = yIntIndex[intY].indexOf(curPoint); curPoint.yxIndex = yxIndex; } let intXEnd = endPoint.intX; let intYEnd = endPoint.intY; if (xyIndex == -1 || yxIndex == -1) { return { state: -1, end: 1, fullpath }; } else if (passPoints.indexOf(curPoint) != -1) { return { state: -1, end: 1, fullpath }; } else if (upPoint) { let obiLine = { x1: upPoint.intX, y1: upPoint.intY, x2: intX, y2: intY }; let isCorss = isCorssRect(obiLine, upPoint, curPoint, outRects); if (isCorss) { return { state: 0, close: 1, fullpath }; } } if (curPoint == endPoint || curPoint.isEnd || intXEnd == intX && intYEnd == intY) { endPoint.minTurnNum = Math.min(endPoint.minTurnNum ? endPoint.minTurnNum : 10, turnNum); let prio = 0; passPoints.forEach((pt) => { prio += pt.prio ? pt.prio : 0; }); successPaths.push({ fullpath, turnNum, distance, prio, pathPoints: [...passPoints, curPoint] }); return { state: 1, end: 1, fullpath }; } let allClose = true; directSortList.forEach((searchDirect) => { let isClose = deepLookForByDirect(searchDirect); if (!isClose) { allClose = false; } }); function deepLookForByDirect(direct) { switch (direct) { case 1: { if (!curPoint.upClose) { let nextPointXYIndex = xyIndex - 1; if (nextPointXYIndex < 0) { curPoint.upClose = 1; return 1; } else if (endPoint.direct == 3 && !curPoint.isStart && intYEnd > intY) { curPoint.upClose = 1; return 1; } else { let nextPoint = xIntIndex[intX][nextPointXYIndex]; let nextTurnNum = fromDirect == 0 || fromDirect == 3 ? turnNum : turnNum + 1; let nextDistance = distance + (nextPoint ? Math.abs(nextPoint.y - intY) : 0); let nextPointResult = getLookForPath(curPoint, nextPoint, endPoint, 3, outRects, xIntIndex, yIntIndex, nextTurnNum, nextDistance, fullpath + "-up", [...passPoints, curPoint], successPaths); if ((nextPointResult == null ? void 0 : nextPointResult.close) == 1 || (nextPointResult == null ? void 0 : nextPointResult.state) == -1) { return 1; } } } else { return 1; } break; } case 3: { if (!curPoint.downClose) { let nextPointXYIndex = xyIndex + 1; if (nextPointXYIndex >= xIntIndex[intX].length) { curPoint.downClose = 1; return 1; } else if (endPoint.direct == 1 && !curPoint.isStart && intYEnd < intY) { curPoint.downClose = 1; return 1; } else { let nextPoint = xIntIndex[intX][nextPointXYIndex]; let nextTurnNum = fromDirect == 0 || fromDirect == 1 ? turnNum : turnNum + 1; let nextDistance = distance + (nextPoint ? Math.abs(nextPoint.y - intY) : 0); let nextPointResult = getLookForPath(curPoint, nextPoint, endPoint, 1, outRects, xIntIndex, yIntIndex, nextTurnNum, nextDistance, fullpath + "-down", [...passPoints, curPoint], successPaths); if ((nextPointResult == null ? void 0 : nextPointResult.close) == 1 || (nextPointResult == null ? void 0 : nextPointResult.state) == -1) { return 1; } } } else { return 1; } break; } case 4: { if (!curPoint.leftClose) { let nextPointYXIndex = yxIndex - 1; if (nextPointYXIndex < 0) { curPoint.leftClose = 1; return 1; } else if (endPoint.direct == 2 && !curPoint.isStart && intXEnd > intX) { curPoint.leftClose = 1; return 1; } else { let nextPoint = yIntIndex[intY][nextPointYXIndex]; let nextTurnNum = fromDirect == 0 || fromDirect == 2 ? turnNum : turnNum + 1; let nextDistance = distance + (nextPoint ? Math.abs(nextPoint.x - intX) : 0); let nextPointResult = getLookForPath(curPoint, nextPoint, endPoint, 2, outRects, xIntIndex, yIntIndex, nextTurnNum, nextDistance, fullpath + "-left", [...passPoints, curPoint], successPaths); if ((nextPointResult == null ? void 0 : nextPointResult.close) == 1 || (nextPointResult == null ? void 0 : nextPointResult.state) == -1) { return 1; } } } else { return 1; } } case 2: { if (!curPoint.rightClose) { let nextPointYXIndex = yxIndex + 1; if (nextPointYXIndex >= yIntIndex[intY].length) { curPoint.rightClose = 1; return 1; } else if (endPoint.direct == 4 && !curPoint.isStart && intXEnd < intX) { curPoint.rightClose = 1; return 1; } else { let nextPoint = yIntIndex[intY][nextPointYXIndex]; let nextTurnNum = fromDirect == 0 || fromDirect == 4 ? turnNum : turnNum + 1; let nextDistance = distance + (nextPoint ? Math.abs(nextPoint.x - intX) : 0); let nextPointResult = getLookForPath(curPoint, nextPoint, endPoint, 4, outRects, xIntIndex, yIntIndex, nextTurnNum, nextDistance, fullpath + "-right", [...passPoints, curPoint], successPaths); if ((nextPointResult == null ? void 0 : nextPointResult.close) == 1 || (nextPointResult == null ? void 0 : nextPointResult.state) == -1) { return 1; } } } else { return 1; } break; } } } if (allClose) { return { state: -1, close: 1, fullpath }; } return { state: 0, fullpath }; }; const genSEExtLine = function(ed, corssPoints, extLines) { var _a3, _b2, _c2, _d2; switch (ed.direct) { case 1: corssPoints.push({ x: ed.point.x, y: ed.point.y - (((_a3 = ed.rect) == null ? void 0 : _a3.height) > 0 ? ed.rect.height / 4 : 50) }); extLines.push([{ x: ed.point.x, y: ed.point.y }, { x: ed.point.x, y: ed.point.y - 5e4 }]); if (!ed.rect) { extLines.push([{ x: ed.point.x - 5e4, y: ed.point.y }, { x: ed.point.x + 5e4, y: ed.point.y }]); } break; case 2: corssPoints.push({ y: ed.point.y, x: ed.point.x + (((_b2 = ed.rect) == null ? void 0 : _b2.width) > 0 ? ed.rect.width / 4 : 50) }); extLines.push([{ x: ed.point.x, y: ed.point.y }, { x: ed.point.x + 5e4, y: ed.point.y }]); if (!ed.rect) { extLines.push([{ x: ed.point.x, y: ed.point.y - 5e4 }, { x: ed.point.x, y: ed.point.y + 5e4 }]); } break; case 3: corssPoints.push({ x: ed.point.x, y: ed.point.y + (((_c2 = ed.rect) == null ? void 0 : _c2.height) > 0 ? ed.rect.height / 4 : 50) }); extLines.push([{ x: ed.point.x, y: ed.point.y }, { x: ed.point.x, y: ed.point.y + 5e4 }]); if (!ed.rect) { extLines.push([{ x: ed.point.x - 5e4, y: ed.point.y }, { x: ed.point.x + 5e4, y: ed.point.y }]); } break; case 4: corssPoints.push({ y: ed.point.y, x: ed.point.x - (((_d2 = ed.rect) == null ? void 0 : _d2.width) > 0 ? ed.rect.width / 4 : 50) }); extLines.push([{ x: ed.point.x, y: ed.point.y }, { x: ed.point.x - 5e4, y: ed.point.y }]); if (!ed.rect) { extLines.push([{ x: ed.point.x, y: ed.point.y - 5e4 }, { x: ed.point.x, y: ed.point.y + 5e4 }]); } break; } }; const getAutoLineItemExtPoints = function(corssPoints, outRects, extLines, dbis) { let outRectExtRate = 0.25; dbis.forEach((dbi) => { let outRect = pvsToOutRect(dbi.points); if (dbi.isStartOrEnd) { outRect.isStartOrEnd = true; let perWidth = outRect.width * outRectExtRate; let perHeight = outRect.height * outRectExtRate; dbi.points.forEach((point2) => { corssPoints.push({ x: point2.x, y: point2.y }); }); corssPoints.push({ x: outRect.x - perWidth, y: outRect.y }); corssPoints.push({ x: outRect.x - perWidth, y: outRect.y + outRect.height * 0.5 }); corssPoints.push({ x: outRect.x - perWidth, y: outRect.y1 }); extLines.push([{ x: outRect.x - perWidth, y: outRect.y - 5e4 }, { x: outRect.x - perWidth, y: outRect.y + 5e4 }]); extLines.push([{ x: outRect.x, y: outRect.y }, { x: outRect.x - perWidth, y: outRect.y }]); extLines.push([{ x: outRect.x, y: outRect.y + outRect.height * 0.5 }, { x: outRect.x - perWidth, y: outRect.y + outRect.height * 0.5 }]); extLines.push([{ x: outRect.x, y: outRect.y1 }, { x: outRect.x - perWidth, y: outRect.y1 }]); corssPoints.push({ x: outRect.x1 + perWidth, y: outRect.y }); corssPoints.push({ x: outRect.x1 + perWidth, y: outRect.y + outRect.height * 0.5 }); corssPoints.push({ x: outRect.x1 + perWidth, y: outRect.y1 }); extLines.push([{ x: outRect.x1 + perWidth, y: outRect.y - 5e4 }, { x: outRect.x1 + perWidth, y: outRect.y + 5e4 }]); extLines.push([{ x: outRect.x1, y: outRect.y }, { x: outRect.x1 + perWidth, y: outRect.y }]); extLines.push([{ x: outRect.x1, y: outRect.y + outRect.height * 0.5 }, { x: outRect.x1 + perWidth, y: outRect.y + outRect.height * 0.5 }]); extLines.push([{ x: outRect.x1, y: outRect.y1 }, { x: outRect.x1 + perWidth, y: outRect.y1 }]); corssPoints.push({ x: outRect.x, y: outRect.y - perHeight }); corssPoints.push({ x: outRect.x + outRect.width / 2, y: outRect.y - perHeight }); corssPoints.push({ x: outRect.x1, y: outRect.y - perHeight }); extLines.push([{ x: outRect.x - 5e4, y: outRect.y - perHeight }, { x: outRect.x + 5e4, y: outRect.y - perHeight }]); extLines.push([{ x: outRect.x, y: outRect.y }, { x: outRect.x, y: outRect.y - perHeight }]); extLines.push([{ x: outRect.x + outRect.width / 2, y: outRect.y }, { x: outRect.x + outRect.width / 2, y: outRect.y - perHeight }]); extLines.push([{ x: outRect.x1, y: outRect.y }, { x: outRect.x1, y: outRect.y - perHeight }]); corssPoints.push({ x: outRect.x, y: outRect.y1 + perHeight }); corssPoints.push({ x: outRect.x + outRect.width / 2, y: outRect.y1 + perHeight }); corssPoints.push({ x: outRect.x1, y: outRect.y1 + perHeight }); extLines.push([{ x: outRect.x - 5e4, y: outRect.y1 + perHeight }, { x: outRect.x + 5e4, y: outRect.y1 + perHeight }]); extLines.push([{ x: outRect.x, y: outRect.y1 }, { x: outRect.x, y: outRect.y1 + perHeight }]); extLines.push([{ x: outRect.x + outRect.width / 2, y: outRect.y1 }, { x: outRect.x + outRect.width / 2, y: outRect.y1 + perHeight }]); extLines.push([{ x: outRect.x1, y: outRect.y1 }, { x: outRect.x1, y: outRect.y1 + perHeight }]); } outRects.push(outRect); }); }; const isCorssRect = function(obiLine, spt, ept, outRects) { for (let o = 0; o < outRects.length; o++) { let outRect = outRects[o]; let l2; l2 = { x1: parseInt(outRect.x), y1: parseInt(outRect.y), x2: parseInt(outRect.x1), y2: parseInt(outRect.y) }; if (isLineCross(obiLine, l2)) { if (!ept.isEnd && !spt.isStart) { return true; } else { if (ept.isEnd && ept.intY == l2.y2 && spt.intY < l2.y2) ; else if (spt.isStart && spt.intY == l2.y2 && ept.intY < l2.y2) ; else { return true; } } } l2 = { x1: parseInt(outRect.x), y1: parseInt(outRect.y1), x2: parseInt(outRect.x1), y2: parseInt(outRect.y1) }; if (isLineCross(obiLine, l2)) { if (!ept.isEnd && !spt.isStart) { return true; } else { if (ept.isEnd && ept.intY == l2.y2 && spt.intY > l2.y2) ; else if (spt.isStart && spt.intY == l2.y2 && ept.intY > l2.y2) ; else { return true; } } } l2 = { x1: parseInt(outRect.x), y1: parseInt(outRect.y), x2: parseInt(outRect.x), y2: parseInt(outRect.y1) }; if (isLineCross(obiLine, l2)) { if (!ept.isEnd && !spt.isStart) { return true; } else { if (ept.isEnd && ept.intX == l2.x2 && spt.intX < l2.x2) ; else if (spt.isStart && spt.intX == l2.x2 && ept.intX < l2.x2) ; else { return true; } } } l2 = { x1: parseInt(outRect.x1), y1: parseInt(outRect.y), x2: parseInt(outRect.x1), y2: parseInt(outRect.y1) }; if (isLineCross(obiLine, l2)) { if (!ept.isEnd && !spt.isStart) { return true; } else { if (ept.isEnd && ept.intX == l2.x2 && spt.intX > l2.x2) ; else if (spt.isStart && spt.intX == l2.x2 && ept.intX > l2.x2) ; else { return true; } } } } return false; }; const isLineCross = function(l1, l2) { if ((l1.x1 > l1.x2 ? l1.x1 : l1.x2) < (l2.x1 < l2.x2 ? l2.x1 : l2.x2) || (l1.y1 > l1.y2 ? l1.y1 : l1.y2) < (l2.y1 < l2.y2 ? l2.y1 : l2.y2) || (l2.x1 > l2.x2 ? l2.x1 : l2.x2) < (l1.x1 < l1.x2 ? l1.x1 : l1.x2) || (l2.y1 > l2.y2 ? l2.y1 : l2.y2) < (l1.y1 < l1.y2 ? l1.y1 : l1.y2)) { return false; } if (((l1.x1 - l2.x1) * (l2.y2 - l2.y1) - (l1.y1 - l2.y1) * (l2.x2 - l2.x1)) * ((l1.x2 - l2.x1) * (l2.y2 - l2.y1) - (l1.y2 - l2.y1) * (l2.x2 - l2.x1)) > 0 || ((l2.x1 - l1.x1) * (l1.y2 - l1.y1) - (l2.y1 - l1.y1) * (l1.x2 - l1.x1)) * ((l2.x2 - l1.x1) * (l1.y2 - l1.y1) - (l2.y2 - l1.y1) * (l1.x2 - l1.x1)) > 0) { return false; } return true; }; const getLineCorssPoint = function(p1, p2, p3, p4) { let abc = (p1.x - p3.x) * (p2.y - p3.y) - (p1.y - p3.y) * (p2.x - p3.x); let abd = (p1.x - p4.x) * (p2.y - p4.y) - (p1.y - p4.y) * (p2.x - p4.x); if (abc * abd >= 0) { return null; } let cda = (p3.x - p1.x) * (p4.y - p1.y) - (p3.y - p1.y) * (p4.x - p1.x); let cdb = cda + abc - abd; if (cda * cdb >= 0) { return null; } let t = cda / (abd - abc); let dx = t * (p2.x - p1.x), dy = t * (p2.y - p1.y); return { x: p1.x + dx, y: p1.y + dy }; }; const pvsToOutRect = function(points) { let x2 = Infinity, y2 = Infinity, x1 = -Infinity, y1 = -Infinity; points.forEach((p) => { x2 = Math.min(p.x, x2); x1 = Math.max(p.x, x1); y2 = Math.min(p.y, y2); y1 = Math.max(p.y, y1); }); return { x: x2, y: y2, width: x1 - x2, height: y1 - y2, x1, y1 }; }; const getMovePath = function(sAngle, eAngle, startPoint, endPoint) { let movePath = ""; switch (sAngle) { case 0: { switch (eAngle) { case 180: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "sx:0.25,ex:-0.25"; } } else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) { movePath = "sx:0.25,ex:-0.25"; } } else { if (startPoint.x > endPoint.x) { movePath = "sx:0.25,ex:-0.25"; } } } break; case -90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) ; else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) { movePath = "sx:0.25,ey:-0.25"; } else { movePath = "ey:-0.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sx:0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sx:0.25"; } } } break; case 90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "sx:0.25,sy2:0.25"; } else { movePath = "ey:0.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sx:0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sx:0.25"; } else ; } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "sx:0.25,ey:0.25"; } else { movePath = "ey:0.25"; } } } break; case 0: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "sx:0.25,sy1:-0.25"; } else { movePath = "ey1:-0.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sx:0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sx:0.25"; } else { movePath = "ex:0.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sx:0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sx:0.25"; } else { movePath = "ex:0.25"; } } } break; } } break; case 180: { switch (eAngle) { case 0: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) ; else { movePath = "sx:-0.25,ey1:-0.25,ex:0.25"; } } else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) ; else { movePath = "sx:-0.25,ex:0.25"; } } else { if (startPoint.x > endPoint.x) ; else { movePath = "sx:-0.25,ex:0.25"; } } } break; case -90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x < endPoint.x) { movePath = "sx:-0.25,ry-s:-0.25"; } else { movePath = "sx:-0.25,ry-s:-0.25"; } } else if (startPoint.y > endPoint.y) { if (startPoint.x > endPoint.x) { movePath = "sx:-0.25,ey:-0.25"; } else { movePath = "sx:-0.25,ey:-0.25"; } } else { if (startPoint.x > endPoint.x) ; else { movePath = "sx:-0.25"; } } } break; case 90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x < endPoint.x) { movePath = "rx-s:-0.25,ry1-e:0.25"; } else { movePath = "ey2:0.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) ; else { movePath = "sx:-0.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "ex2:-0.25,ey2:0.25"; } else if (startPoint.x > endPoint.x) { movePath = "ey:0.25"; } else { movePath = "sx:-0.25,ey:0.25"; } } } break; case 180: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "ey1:-0.25,ex:-0.25"; } else { movePath = "sx:-0.25,ey1:-0.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sx:-0.25"; } else if (startPoint.x > endPoint.x) { movePath = "ex:-0.25"; } else { movePath = "sx:-0.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sx:-0.25"; } else if (startPoint.x > endPoint.x) { movePath = "ex:-0.25"; } else { movePath = "sx:-0.25"; } } } break; } } break; case -90: { switch (eAngle) { case 90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { movePath = "sy:-0.25,ey:0.25"; } else if (startPoint.y > endPoint.y) ; else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sy:-0.25,sx1:-0.25,ey:0.25"; } else { movePath = "sy:-0.25,ey:0.25"; } } } break; case 0: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "sy:-0.25"; } else { movePath = "sy:-0.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) ; else { movePath = "ex:0.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sy:-0.25,sx2:0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sy:-0.25,sx2:0.25"; } else { movePath = "sy:-0.25,ex:0.25"; } } } break; case 180: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "sy:-0.25"; } else { movePath = "sy:-0.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sx:-0.25"; } else if (startPoint.x > endPoint.x) { movePath = "ex:-0.25"; } else ; } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sy:-0.25,rx-s:-0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sy:-0.25,ex:-0.25"; } else { movePath = "sy:-0.25"; } } } break; case -90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { movePath = "sy:-0.25,ex:0"; } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "ey:-0.25"; } else if (startPoint.x > endPoint.x) { movePath = "ey:-0.25,ex:0"; } else { movePath = "ey:-0.25,ex:0"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sx1:-0.25,eymid"; } else if (startPoint.x > endPoint.x) { movePath = "sy:-0.25,ex:0"; } else { movePath = "sy:-0.25,ex:0"; } } } break; } } break; case 90: { switch (eAngle) { case -90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { if (startPoint.x > endPoint.x) { movePath = "sy:0.25,ey:-0.25"; } else { movePath = "sy:0.25,ey:-0.25"; } } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sy:0.25,ey:-0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sy:0.25,ey:-0.25"; } else { movePath = "sy:0.25,ey:-0.25"; } } else ; } break; case 0: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { movePath = "sy:0.25"; } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sy:0.25,ex:0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sy:0.25"; } else { movePath = "sy:0.25,ex:0.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) ; else { movePath = "ex:0.25"; } } } break; case 180: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { movePath = "sy:0.25"; } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) ; else if (startPoint.x > endPoint.x) { movePath = "sy:0.25,ex:-0.25"; } else { movePath = "sy:0.25"; } } else { if (startPoint.x > endPoint.x) { movePath = "ex:-0.25"; } } } break; case 90: { if (Math.abs(startPoint.y - endPoint.y) <= 1) { movePath = "sy:0.25"; } else if (startPoint.y > endPoint.y) { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "sy:0.25,sx1:-0.25"; } else if (startPoint.x > endPoint.x) { movePath = "sy:0.25"; } else { movePath = "sy:0.25"; } } else { if (Math.abs(startPoint.x - endPoint.x) <= 1) { movePath = "ex2:0.25,ey:0.25"; } else if (startPoint.x > endPoint.x) { movePath = "ey:0.25"; } else { movePath = "ey:0.25"; } } } break; } } break; } return movePath; }; const getRecommendPath = function(sAngle, eAngle, startPoint, endPoint, startRect, endRect, outRect) { let recommendPaths = []; let movePath = getMovePath(sAngle, eAngle, startPoint, endPoint); if (movePath) { let mPaths = movePath.split(","); mPaths.forEach((mPath) => { let mpa = mPath.split(":"); let opType = mpa[0]; let opSize = parseFloat(mpa[1]); let cPoint = {}; switch (opType) { case "sx": cPoint.x = startPoint.x + opSize * startRect.width; cPoint.y = startPoint.y; cPoint.type = "x"; break; case "sy": cPoint.y = startPoint.y + opSize * startRect.height; cPoint.x = startPoint.x; cPoint.type = "y"; break; case "ex": cPoint.x = endPoint.x + opSize * endRect.width; cPoint.y = endPoint.y; cPoint.type = "x"; break; case "sxmid": cPoint.y = startPoint.y; if (outRect) { cPoint.x = outRect.x + outRect.width / 2; } else { cPoint.x = (startPoint.x + endPoint.x) / 2; } cPoint.type = "x"; break; case "symid": cPoint.x = startPoint.x; if (outRect) { cPoint.y = outRect.y + outRect.height / 2; } else { cPoint.y = (startPoint.y + endPoint.y) / 2; } cPoint.type = "y"; break; case "exmid": cPoint.y = endPoint.y; if (outRect) { cPoint.x = outRect.x + outRect.width / 2; } else { cPoint.x = (startPoint.x + endPoint.x) / 2; } cPoint.type = "x"; break; case "eymid": cPoint.x = endPoint.x; if (outRect) { cPoint.y = outRect.y + outRect.height / 2; } else { cPoint.y = (endPoint.y + endPoint.y) / 2; } cPoint.type = "y"; break; case "sx1": cPoint.y = startPoint.y; cPoint.x = startRect.x + startRect.width * opSize; cPoint.type = "x"; break; case "sx2": cPoint.y = startPoint.y; cPoint.x = startRect.x1 + startRect.width * opSize; cPoint.type = "x"; break; case "ex1": cPoint.y = endPoint.y; cPoint.x = endRect.x + endRect.width * opSize; cPoint.type = "x"; break; case "ex2": cPoint.y = endPoint.y; cPoint.x = endRect.x1 + endRect.width * opSize; cPoint.type = "x"; break; case "sy1": cPoint.x = startPoint.x; cPoint.y = startRect.y + startRect.height * opSize; cPoint.type = "y"; break; case "sy2": cPoint.x = startPoint.x; cPoint.y = startRect.y1 + startRect.height * opSize; cPoint.type = "y"; break; case "ey": cPoint.y = endPoint.y + opSize * endRect.height; cPoint.x = endPoint.x; cPoint.type = "y"; break; case "ey1": cPoint.x = endPoint.x; cPoint.y = endRect.y + endRect.height * opSize; cPoint.type = "y"; break; case "ey2": cPoint.x = endPoint.x; cPoint.y = endRect.y1 + endRect.height * opSize; cPoint.type = "y"; break; case "rx-s": if (outRect) { cPoint.x = outRect.x + startRect.width * opSize; cPoint.y = outRect.y; cPoint.type = "x"; } else { cPoint = null; } break; case "rx1-s": if (outRect) { cPoint.x = outRect.x1 + startRect.width * opSize; cPoint.y = outRect.y; cPoint.type = "x"; } else { cPoint = null; } break; case "rx-e": if (outRect) { cPoint.x = outRect.x + endRect.width * opSize; cPoint.y = outRect.y; cPoint.type = "x"; } else { cPoint = null; } break; case "rx1-e": if (outRect) { cPoint.x = outRect.x1 + endRect.width * opSize; cPoint.y = outRect.y; cPoint.type = "x"; } else { cPoint = null; } break; case "ry-s": if (outRect) { cPoint.y = outRect.y + startRect.height * opSize; cPoint.x = outRect.x; cPoint.type = "y"; } else { cPoint = null; } break; case "ry1-s": if (outRect) { cPoint.y = outRect.y1 + startRect.height * opSize; cPoint.x = outRect.x; cPoint.type = "y"; } else { cPoint = null; } break; case "ry-e": if (outRect) { cPoint.y = outRect.y + endRect.height * opSize; cPoint.x = outRect.x; cPoint.type = "y"; } else { cPoint = null; } break; case "ry1-e": if (outRect) { cPoint.y = outRect.y1 + endRect.height * opSize; cPoint.x = outRect.x; cPoint.type = "y"; } else { cPoint = null; } break; } if (cPoint) { recommendPaths.push(cPoint); } }); } return recommendPaths; }; var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; const _DDeiLine = class _DDeiLine2 extends DDeiAbstractShape { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "weight"); __publicField2(this, "color"); __publicField2(this, "fill"); __publicField2(this, "modelType", "DDeiLine"); __publicField2(this, "baseModelType", "DDeiLine"); __publicField2(this, "estyle"); __publicField2(this, "sstyle"); __publicField2(this, "dash"); __publicField2(this, "type"); __publicField2(this, "sp"); __publicField2(this, "ep"); __publicField2(this, "opacity"); __publicField2(this, "round"); __publicField2(this, "startPoint"); __publicField2(this, "endPoint"); __publicField2(this, "spvs"); __publicField2(this, "clps", {}); __publicField2(this, "freeze"); this.color = props.color; this.weight = props.weight; this.estyle = props.estyle; this.sstyle = props.sstyle; this.dash = props.dash; this.type = props.type ? props.type : 1; this.sp = props.sp; this.ep = props.ep; this.opacity = props.opacity; this.round = props.round; this.spvs = props.spvs ? props.spvs : []; this.freeze = props.freeze ? props.freeze : 0; this.fill = props.fill; this.updateLooseCanvasSync = debounce(this.updateLooseCanvasSync, 30); } // ============================ 静态变量 ============================ // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}, initPVS = true) { var _a3, _b2; let model = new _DDeiLine2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; if (!model.pModel) { model.pModel = model.layer; } let ddInstance = (_a3 = model.stage) == null ? void 0 : _a3.ddInstance; tempData[model.id] = model; if (((_b2 = json == null ? void 0 : json.composes) == null ? void 0 : _b2.length) > 0) { let composes = []; json == null ? void 0 : json.composes.forEach((composeJSON) => { let def = DDeiUtil$1.getControlDefine(composeJSON); let composeModel = ddInstance.controlModelClasses[def.type].loadFromJSON( composeJSON, tempData, false ); composeModel.pModel = model; composes.push(composeModel); }); model.composes = composes; } if (initPVS) { model.initPVS(); } return model; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json, tempData = {}, initPVS = true) { var _a3, _b2; let model = new _DDeiLine2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; let ddInstance = (_a3 = model.stage) == null ? void 0 : _a3.ddInstance; if (((_b2 = json == null ? void 0 : json.composes) == null ? void 0 : _b2.length) > 0) { let composes = []; for (let ci = 0; ci < json.composes.length; ci++) { let composeJSON = json.composes[ci]; let def = DDeiUtil$1.getControlDefine(composeJSON); let composeModel = ddInstance.controlModelClasses[def.type].initByJSON( composeJSON, tempData, false ); composeModel.modelCode = composeModel.id; composeModel.id = model.id + "_comp_" + ci; composeModel.pModel = model; composes.push(composeModel); } model.composes = composes; } if (initPVS) { model.initPVS(); } return model; } /** * 计算线段交叉点,用于绘制错线效果 * 该方法在所有线段的calPoints方法执行完后执行,修改已计算好的节点 */ static calLineCrossSync(layer2) { return new Promise((resolve, reject) => { if (!layer2.stage.render.refreshJumpLine) { let lines = layer2.getModelsByBaseType("DDeiLine"); _DDeiLine2.calLineCross(layer2); lines.forEach((line2) => { line2.updateLooseCanvas(); }); layer2.stage.render.refreshJumpLine = true; } resolve(); }); } static calLineCross(layer2) { var _a3, _b2, _c2, _d2; if (!layer2) { return; } if (!layer2.stage.render.refreshJumpLine) { let lines = layer2.getModelsByBaseType("DDeiLine"); lines.forEach((line2) => { line2.clps = {}; }); let wl = 12 * ((_a3 = layer2.stage) == null ? void 0 : _a3.getStageRatio()); let len = lines.length; let rectMap = /* @__PURE__ */ new Map(); let corssLinePoints = []; for (let i2 = 0; i2 < len - 1; i2++) { let l1 = lines[i2]; if (l1.type == 3) { continue; } let jumpLine; if (layer2.stage.ddInstance.jumpline == 0 || layer2.stage.ddInstance.jumpline) { jumpLine = layer2.stage.ddInstance.jumpline; } else { jumpLine = DDeiModelArrtibuteValue.getAttrValueByState(l1, "jumpline", true); if (jumpLine == 0 || !jumpLine) { if ((_b2 = layer2.stage.global) == null ? void 0 : _b2.jumpline) { jumpLine = layer2.stage.global.jumpline; } else if (layer2.stage.ddInstance.jumpline) { jumpLine = layer2.stage.ddInstance.jumpline; } else { jumpLine = DDeiModelArrtibuteValue.getAttrValueByState(layer2.stage, "global.jumpline", true); } } } if (jumpLine == 1) { if (!rectMap.has(l1.id)) { rectMap.set(l1.id, DDeiAbstractShape.getOutRectByPV([l1])); } let l1Rect = rectMap.get(l1.id); for (let j2 = i2 + 1; j2 < len; j2++) { let l2 = lines[j2]; if (l2.type == 3) { continue; } if (l1 != l2) { if (!rectMap.has(l2.id)) { rectMap.set(l2.id, DDeiAbstractShape.getOutRectByPV([l2])); } let l2Rect = rectMap.get(l2.id); if (DDeiUtil$1.isRectCross(l1Rect, l2Rect)) { for (let pi = 0; pi < l1.pvs.length - 1; pi++) { let p1 = l1.pvs[pi]; let p2 = l1.pvs[pi + 1]; for (let pj = 0; pj < l2.pvs.length - 1; pj++) { let p3 = l2.pvs[pj]; let p4 = l2.pvs[pj + 1]; let crossPoint = DDeiUtil$1.getLineCorssPoint(p1, p2, p3, p4); if (crossPoint != null) { let pRotate = DDeiUtil$1.getLineAngle(p1.x, p1.y, p2.x, p2.y); let pAngle = (pRotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let pVectorUnit = new Vector3(1, 0, 1); let pRotateMatrix = new Matrix3( Math.cos(pAngle), Math.sin(pAngle), 0, -Math.sin(pAngle), Math.cos(pAngle), 0, 0, 0, 1 ); pVectorUnit.applyMatrix3(pRotateMatrix); let sdist = DDeiUtil$1.getPointDistance(p1.x, p1.y, crossPoint.x, crossPoint.y); let edist = DDeiUtil$1.getPointDistance(p2.x, p2.y, crossPoint.x, crossPoint.y); let s1dist = DDeiUtil$1.getPointDistance(p3.x, p3.y, crossPoint.x, crossPoint.y); let e1dist = DDeiUtil$1.getPointDistance(p4.x, p4.y, crossPoint.x, crossPoint.y); if (sdist > wl && edist > wl && s1dist > wl && e1dist > wl) { corssLinePoints.push({ line: l1, index: pi, cp: crossPoint, unit: pVectorUnit, r: pRotate, dist: sdist }); } } } } } } } } corssLinePoints.forEach((clp) => { var _a22; if (!clp.line.clps[clp.index]) { clp.line.clps[clp.index] = []; } let dist = clp.dist; let has = false; let lineClps = clp.line.clps[clp.index]; let len2 = lineClps.length; for (let di = 0; di < len2; di++) { if (lineClps[di].cp.x == clp.cp.x && lineClps[di].cp.y == clp.cp.y) { has = true; break; } if (dist <= ((_a22 = lineClps[di]) == null ? void 0 : _a22.dist)) { lineClps.splice(di, 0, clp); has = true; break; } } if (!has) { clp.line.clps[clp.index].push(clp); } }); lines.forEach((line2) => { var _a22; line2.updateLooseCanvas(); (_a22 = line2.render) == null ? void 0 : _a22.enableRefreshShape(); }); (_c2 = layer2.stage) == null ? void 0 : _c2.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); (_d2 = layer2.stage) == null ? void 0 : _d2.ddInstance.bus.executeAll(); layer2.stage.render.refreshJumpLine = true; } } } // ============================ 方法 =============================== /** * 初始化向量,默认开始在0,0的位置 */ initPVS() { var _a3, _b2, _c2, _d2, _e2; if (!this.cpv && !(((_a3 = this.pvs) == null ? void 0 : _a3.length) > 0)) { this.cpv = new Vector3(0, 0, 1); } else { this.cpv = this.pvs[0]; } if (!(((_b2 = this.ovs) == null ? void 0 : _b2.length) > 0)) { let defineOvs = (_d2 = (_c2 = DDeiUtil$1.getControlDefine(this)) == null ? void 0 : _c2.define) == null ? void 0 : _d2.ovs; if ((defineOvs == null ? void 0 : defineOvs.length) > 0) { let stageRatio2 = this.getStageRatio(); let ovs = []; defineOvs.forEach((ovd) => { let ov = new Vector3(ovd.x * stageRatio2, ovd.y * stageRatio2, ovd.z || ovd.z == 0 ? ovd.z : 1); let ovi = new Vector3(ovd.ix * stageRatio2, ovd.iy * stageRatio2, ovd.iz || ovd.iz == 0 ? ovd.iz : 1); ov.ovi = ovi; ovs.push(ov); }); this.ovs = ovs; } } this.initHPV(); this.calRotate(); this.startPoint = this.pvs[0]; this.endPoint = this.pvs[this.pvs.length - 1]; this.calLoosePVS(); this.refreshLinkModels(); (_e2 = this.composes) == null ? void 0 : _e2.forEach((compose) => { compose.initPVS(); }); } /** * 交换开始和结束节点 */ exchangeStartAndEnd() { var _a3; let startPoint = this.startPoint; let endPoint = this.endPoint; let distLinks = (_a3 = this.stage) == null ? void 0 : _a3.getDistModelLinks(this.id); let sms = []; distLinks == null ? void 0 : distLinks.forEach((dl) => { if (dl.dmpath == "startPoint") { dl.dmpath = "endPoint"; } else if (dl.dmpath == "endPoint") { dl.dmpath = "startPoint"; } if (dl.sm) { sms.push(dl.sm); } }); this.startPoint = endPoint; this.endPoint = startPoint; this.cpv = this.startPoint; this.pvs[0] = this.startPoint; this.pvs[this.pvs.length - 1] = this.endPoint; sms.forEach((sm) => { sm.updateLinkModels(); }); } /** * 重新计算线路径并更新图形 */ refreshLinePoints() { var _a3; this.calPoints(); this.calLoosePVS(); this.refreshLinkModels(); (_a3 = this.composes) == null ? void 0 : _a3.forEach((compose) => { compose.initPVS(); }); } /** * 设置当前最新的hpv */ initHPV() { if (!this.hpv || this.hpv.length < 2) { this.hpv[0] = new Vector3(this.cpv.x, this.cpv.y, 1); this.hpv[1] = new Vector3(this.cpv.x + 100, this.cpv.y, 1); } } /** * 根据开始节点和结束节点的关系,自动计算中间节点路径的坐标 */ calPoints() { var _a3; switch (this.type) { case 1: { this.pvs = [this.startPoint, this.endPoint]; } break; case 2: { this.calLineType3(); } break; case 3: { if (this.freeze != 1) { this.calLineType3(); if (this.pvs.length < 4) { if (this.pvs.length == 2) { let x1 = this.pvs[0].x + (this.pvs[1].x - this.pvs[0].x) * 0.33; let y1 = this.pvs[0].y + (this.pvs[1].y - this.pvs[0].y) * 0.33; let x2 = this.pvs[0].x + (this.pvs[1].x - this.pvs[0].x) * 0.66; let y2 = this.pvs[0].y + (this.pvs[1].y - this.pvs[0].y) * 0.66; this.pvs = [this.pvs[0], new Vector3(x1, y1, 1), new Vector3(x2, y2, 1), this.pvs[1]]; } else if (this.pvs.length == 3) { let x1 = this.pvs[0].x + (this.pvs[1].x - this.pvs[0].x) * 0.66; let y1 = this.pvs[0].y + (this.pvs[1].y - this.pvs[0].y) * 0.66; let x2 = this.pvs[1].x + (this.pvs[2].x - this.pvs[1].x) * 0.33; let y2 = this.pvs[1].y + (this.pvs[2].y - this.pvs[1].y) * 0.33; this.pvs = [this.pvs[0], new Vector3(x1, y1, 1), new Vector3(x2, y2, 1), this.pvs[2]]; } } else if (this.pvs.length > 4) { let appendPointSize = 3 - (this.pvs.length - 4) % 3; for (let i2 = 0; i2 < appendPointSize; i2++) { let maxS = -1; let maxlength = 0; for (let j2 = 0; j2 < this.pvs.length - 1; j2++) { let p1 = this.pvs[j2]; let p2 = this.pvs[j2 + 1]; let l = DDeiUtil$1.getPointDistance(p1.x, p1.y, p2.x, p2.y); if (!maxlength) { maxlength = l; maxS = j2; } else if (l > maxlength) { maxlength = l; maxS = j2; } } let s = maxS; let e = maxS + 1; let x1 = this.pvs[s].x + (this.pvs[e].x - this.pvs[s].x) * 0.5; let y1 = this.pvs[s].y + (this.pvs[e].y - this.pvs[s].y) * 0.5; this.pvs.splice(s + 1, 0, new Vector3(x1, y1, 1)); } } } } break; } (_a3 = this.render) == null ? void 0 : _a3.enableRefreshShape(); _DDeiLine2.calLineCross(this.layer); } /** * 计算折线连线点 */ calLineType3() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; this.pvs; let id = this.id; if (id.indexOf("_shadow") != -1) { id = id.substring(0, id.lastIndexOf("_shadow")); } let lineLinks = (_a3 = this.stage) == null ? void 0 : _a3.getDistModelLinks(id); let startLink = null; let endLink = null; lineLinks == null ? void 0 : lineLinks.forEach((lk) => { if (lk.dmpath == "startPoint") { startLink = lk; } else if (lk.dmpath == "endPoint") { endLink = lk; } }); let sAngle = null; let eAngle = null; let startModel = (startLink == null ? void 0 : startLink.sm) ? startLink == null ? void 0 : startLink.sm : (_b2 = this.stage.tempStartOPpoint) == null ? void 0 : _b2.model; let endModel = (endLink == null ? void 0 : endLink.sm) ? endLink == null ? void 0 : endLink.sm : (_c2 = this.stage.tempCursorOPpoint) == null ? void 0 : _c2.model; let startRect, endRect; if (((_d2 = startModel == null ? void 0 : startModel.operatePVS) == null ? void 0 : _d2.length) > 0) { startRect = DDeiAbstractShape.pvsToOutRect(startModel.operatePVS); } if (((_e2 = endModel == null ? void 0 : endModel.operatePVS) == null ? void 0 : _e2.length) > 0) { endRect = DDeiAbstractShape.pvsToOutRect(endModel.operatePVS); } let startPoint = this.startPoint; let endPoint = this.endPoint; if (this == this.stage.render.currentOperateShape) { let passIndex = (_f = this.stage.render.dragObj) == null ? void 0 : _f.passIndex; let opvsIndex = (_g = this.stage.render.dragObj) == null ? void 0 : _g.opvsIndex; if (passIndex == 1) { if (opvsIndex == 0) { startPoint = this.stage.tempCursorOPpoint ? this.stage.tempCursorOPpoint : this.startPoint; this.startPoint.x = startPoint.x; this.startPoint.y = startPoint.y; } else if (opvsIndex == ((_i = (_h = this.stage.render.dragObj) == null ? void 0 : _h.opvs) == null ? void 0 : _i.length) - 1) { endPoint = this.stage.tempCursorOPpoint ? this.stage.tempCursorOPpoint : this.endPoint; this.endPoint.x = endPoint.x; this.endPoint.y = endPoint.y; } } } if (startModel == null ? void 0 : startModel.getPointAngle) { sAngle = startModel.getPointAngle(startPoint); sAngle = this.calSpecilPointAngle(sAngle); } if (endModel == null ? void 0 : endModel.getPointAngle) { eAngle = endModel.getPointAngle(endPoint); eAngle = this.calSpecilPointAngle(eAngle); } let outRect = null; if (startRect && endRect) { outRect = { x: Math.min(startRect.x, endRect.x), x1: Math.max(startRect.x1, endRect.x1), y: Math.min(startRect.y, endRect.y), y1: Math.max(startRect.y1, endRect.y1) }; outRect.width = outRect.x1 - outRect.x; outRect.height = outRect.y1 - outRect.y; } let recommendPaths = getRecommendPath(sAngle, eAngle, startPoint, endPoint, startRect, endRect, outRect); let allModels = this.layer.getSubModelsByFilter("LINE_OBI_FILTER", null, 10, { line: this }); let obis = []; allModels.forEach((model) => { var _a22; if (model.baseModelType != "DDeiLine" && ((_a22 = model.operatePVS) == null ? void 0 : _a22.length) > 0 && !model.depModel) { let obj = { points: model.operatePVS }; if (model.id == (startModel == null ? void 0 : startModel.id) || model.id == (endModel == null ? void 0 : endModel.id)) { obj.isStartOrEnd = true; } obis.push(obj); } }); let marr = [startModel, endModel]; marr.forEach((model) => { if (model) { let modelConts = model.getParents(); modelConts.forEach((contModel) => { let rmIdx = allModels.indexOf(contModel); if (rmIdx != -1) { allModels.splice(rmIdx, 1); } }); } }); let forcePaths = []; (_j = this.spvs) == null ? void 0 : _j.forEach((pv) => { if (pv) { let newPV = { x: 0, y: 0 }; if (pv.x) { newPV.x = pv.x + this.startPoint.x; } if (pv.y) { newPV.y = pv.y + this.startPoint.y; } forcePaths.push(newPV); } }); let linePathData = calAutoLinePath( { point: { x: startPoint.x, y: startPoint.y }, rect: startRect, angle: sAngle }, { point: { x: endPoint.x, y: endPoint.y }, rect: endRect, angle: eAngle }, obis, { recommendPaths, forcePaths, recomWeight: 100, rectMidWeight: 50 } ); this.pvs = [this.startPoint]; if (linePathData) { if ((_k = this.stage) == null ? void 0 : _k.render) { this.stage.render.linePathData = linePathData; } if (((_l = linePathData.pathPoints) == null ? void 0 : _l.length) > 2) { for (let i2 = 1; i2 < linePathData.pathPoints.length - 1; i2++) { let mp = linePathData.pathPoints[i2]; this.pvs.push(new Vector3(mp.x, mp.y, 1)); } } } this.pvs.push(this.endPoint); } /** * 计算特殊点位的角度 */ calSpecilPointAngle(eAngle) { if (eAngle > 1e3) { switch (eAngle) { case 1001: if (Math.abs(this.startPoint.x - this.endPoint.x) > Math.abs(this.startPoint.y - this.endPoint.y)) { eAngle = 180; } else { eAngle = -90; } break; case 1002: if (Math.abs(this.startPoint.x - this.endPoint.x) > Math.abs(this.startPoint.y - this.endPoint.y)) { eAngle = 0; } else { eAngle = -90; } break; case 1003: if (Math.abs(this.startPoint.x - this.endPoint.x) > Math.abs(this.startPoint.y - this.endPoint.y)) { eAngle = 0; } else { eAngle = 90; } break; case 1004: if (Math.abs(this.startPoint.x - this.endPoint.x) > Math.abs(this.startPoint.y - this.endPoint.y)) { eAngle = 180; } else { eAngle = 90; } break; } } return eAngle; } /** * 设置直线的坐标,会根据约束关系来调整位置 */ setLineType1PointPosition(pointType, ex, ey) { var _a3, _b2, _c2, _d2; let sx = this.pvs[0].x; let sy = this.pvs[0].y; let endX = this.pvs[this.pvs.length - 1].x; let endY = this.pvs[this.pvs.length - 1].y; if (pointType == 0) { sx = ex; sy = ey; } else if (pointType == 1) { endX = ex; endY = ey; } let constraint = (_b2 = (_a3 = DDeiUtil$1.getControlDefine(this)) == null ? void 0 : _a3.define) == null ? void 0 : _b2.constraint; if (((_d2 = (_c2 = constraint == null ? void 0 : constraint.type[1]) == null ? void 0 : _c2.angles) == null ? void 0 : _d2.length) > 0) { let lineAngle = DDeiUtil$1.getLineAngle(sx, sy, endX, endY); let angle2 = this.rotate ? this.rotate : 0; let inArea = false; let minAngle = lineAngle; let minAngleABS = Infinity; for (let i2 = 0; i2 < constraint.type[1].angles.length; i2++) { let angleArea = constraint.type[1].angles[i2]; if (angleArea[0] + angle2 <= lineAngle && angleArea[1] + angle2 >= lineAngle) { inArea = true; break; } if (Math.abs(angleArea[0] + angle2 - lineAngle) < minAngleABS) { minAngleABS = Math.abs(angleArea[0] + angle2 - lineAngle); minAngle = angleArea[0] + angle2; } if (Math.abs(angleArea[1] + angle2 - lineAngle) < minAngleABS) { minAngleABS = Math.abs(angleArea[1] + angle2 - lineAngle); minAngle = angleArea[1] + angle2; } } if (pointType == 0) { let sdx = this.pvs[this.pvs.length - 1].x - this.pvs[0].x; let sdy = this.pvs[this.pvs.length - 1].y - this.pvs[0].y; let zeroEndPoints = [new Vector3(sdx, sdy, 1)]; let endPoint = DDeiUtil$1.zeroToPoints(zeroEndPoints, new Vector3(sx, sy), minAngle - lineAngle)[0]; endX = endPoint.x; endY = endPoint.y; } else if (!inArea && pointType == 1) { let zeroEndPoints = DDeiUtil$1.pointsToZero([new Vector3(endX, endY, 1)], new Vector3(sx, sy), 0); let endPoint = DDeiUtil$1.zeroToPoints(zeroEndPoints, new Vector3(sx, sy), minAngle - lineAngle)[0]; endX = endPoint.x; endY = endPoint.y; } } this.pvs[0].x = sx; this.pvs[0].y = sy; this.pvs[this.pvs.length - 1].x = endX; this.pvs[this.pvs.length - 1].y = endY; } /** * 基于当前向量计算宽松判定向量 */ calLoosePVS() { this.loosePVS = this.pvs; this.updateLooseCanvasSync(); } updateLooseCanvasSync() { return new Promise((resolve, reject) => { this.updateLooseCanvas(); resolve(); }); } updateLooseCanvas() { var _a3; if (!this.isShadowControl && this.render) { if (!this.looseCanvas) { this.looseCanvas = document.createElement("canvas"); this.looseCanvas.setAttribute("style", "-moz-transform-origin:left top;position:absolute;left:0px;top:0px;"); } let canvas = this.looseCanvas; let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); let pvs2 = this.pvs; let outRect = DDeiAbstractShape.pvsToOutRect(pvs2, stageRatio2); let weight = 10; if (this.weight) { weight = this.weight + 5; } outRect.x -= weight; outRect.x1 += weight; outRect.y -= weight; outRect.y1 += weight; outRect.width += 2 * weight; outRect.height += 2 * weight; this.loosePVS = this.pvs; canvas.setAttribute("width", outRect.width); canvas.setAttribute("height", outRect.height); let ctx = canvas.getContext("2d", { willReadFrequently: true }); ctx.translate(-outRect.x, -outRect.y); this.render.drawLine({ color: "red", weight, dash: [], rat1: 1, fill: { color: "red" } }, ctx); } } /** * 变换向量 */ transVectors(matrix2, params) { var _a3, _b2, _c2; this.pvs.forEach((pv) => { pv.applyMatrix3(matrix2); }); for (let i2 in this.exPvs) { let pv = this.exPvs[i2]; pv.applyMatrix3(matrix2); } (_a3 = this.ovs) == null ? void 0 : _a3.forEach((pv) => { pv.applyMatrix3(matrix2); if (pv.ovi) { pv.ovi.applyMatrix3(matrix2); } }); this.hpv[0].applyMatrix3(matrix2); this.hpv[1].applyMatrix3(matrix2); this.calRotate(); this.calLoosePVS(); (_b2 = this.composes) == null ? void 0 : _b2.forEach((compose) => { compose.transVectors(matrix2, params); }); (_c2 = this.render) == null ? void 0 : _c2.enableRefreshShape(); } /** * 获取中心点操作点 */ getCenterOpPoints() { return []; } /** * 判断图形是否在一个区域内,采用宽松的判定模式,允许传入一个大小值 * @param x * @param y * @param loose 宽松判定,默认false * @returns 是否在区域内 */ isInAreaLoose(x2 = void 0, y2 = void 0, loose = false) { var _a3; if (this.looseCanvas) { let isArea = false; let projPoint = this.getProjPoint( { x: x2, y: y2 }, { in: -10, out: 10 }, 1, 2 ); if (projPoint) { isArea = true; } if (isArea) { let ctx = this.looseCanvas.getContext("2d"); let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); let outRect = DDeiAbstractShape.pvsToOutRect(this.pvs, stageRatio2); let weight = 10; if (this.weight) { weight = this.weight + 5; } outRect.x -= weight; outRect.y -= weight; let cx = x2 * stageRatio2 - outRect.x; let cy = y2 * stageRatio2 - outRect.y; let cdata = ctx.getImageData(cx, cy, 1, 1).data; if (cdata && cdata[0] == 255 && cdata[1] != 255 && cdata[2] != 255) { return true; } } } return false; } /** * 移除自身的方法 */ destroyed() { var _a3; let layer2 = this.layer; if (!this.isShadowControl) { let distLinks = (_a3 = this.stage) == null ? void 0 : _a3.getDistModelLinks(this.id); distLinks == null ? void 0 : distLinks.forEach((dl) => { var _a22, _b2; if ((dl == null ? void 0 : dl.sm) && (dl == null ? void 0 : dl.smpath)) { DDeiUtil$1.deletePropertyByPath(dl.sm, dl.smpath); dl.sm.transVectors(new Matrix3()); dl.sm.updateLinkModels(); (_a22 = dl.sm.render) == null ? void 0 : _a22.enableRefreshShape(); } (_b2 = this.stage) == null ? void 0 : _b2.removeLink(dl); }); } super.destroyed(); _DDeiLine2.calLineCross(layer2); } syncVectors(source, clonePV = false) { var _a3, _b2; super.syncVectors(source, clonePV); if (source.freeze != null && source.freeze != void 0) { this.freeze = source.freeze; } this.startPoint = this.pvs[0]; this.endPoint = this.pvs[this.pvs.length - 1]; let distLinks = (_a3 = this.stage) == null ? void 0 : _a3.getDistModelLinks(this.id); distLinks == null ? void 0 : distLinks.forEach((dl) => { let pv = null; if (dl.dmpath == "startPoint") { pv = this.startPoint; } else { pv = this.endPoint; } if ((dl == null ? void 0 : dl.sm) && (dl == null ? void 0 : dl.smpath)) { DDeiUtil$1.setAttrValueByPath(dl.sm, dl.smpath + ".x", pv.x); DDeiUtil$1.setAttrValueByPath(dl.sm, dl.smpath + ".y", pv.y); } }); for (let i2 = 0; i2 < ((_b2 = source.composes) == null ? void 0 : _b2.length); i2++) { let scop = source.composes[i2]; let tcop = this.composes[i2]; tcop.syncVectors(scop, clonePV); } } /** * 初始化渲染器 */ initRender() { var _a3; DDeiConfig$1.bindRender(this); this.render.init(); (_a3 = this.composes) == null ? void 0 : _a3.forEach((compose) => { compose.initRender(); }); delete this.__destroyed; } toJSON() { var _a3, _b2, _c2; let json = super.toJSON(); let ruleDisplay; let ruleInit; if (((_a3 = this.stage.ruler) == null ? void 0 : _a3.display) || ((_b2 = this.stage.ruler) == null ? void 0 : _b2.display) == 0 || ((_c2 = this.stage.ruler) == null ? void 0 : _c2.display) == false) { ruleDisplay = this.stage.ruler.display; } else if (this.stage.ddInstance.ruler != null && this.stage.ddInstance.ruler != void 0) { if (typeof this.stage.ddInstance.ruler == "boolean") { ruleDisplay = this.stage.ddInstance.ruler ? 1 : 0; } else { ruleInit = this.stage.ddInstance.ruler; ruleDisplay = ruleInit.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(this.stage, "ruler.display", true); } let unit = DDeiModelArrtibuteValue.getAttrValueByState(this.stage, "ruler.unit", true, ruleInit); if (ruleDisplay) { if (this.hpv) { json.hpv = cloneDeep(this.hpv); for (let i2 = 0; i2 < this.hpv.length; i2++) { let hpv = DDeiUtil$1.toRulerCoord({ x: this.hpv[i2].x, y: this.hpv[i2].y }, this.stage, unit); json.hpv[i2].x = hpv.x; json.hpv[i2].y = hpv.y; } } if (this.pvs) { json.pvs = cloneDeep(this.pvs); for (let i2 = 0; i2 < this.pvs.length; i2++) { let pv = DDeiUtil$1.toRulerCoord({ x: this.pvs[i2].x, y: this.pvs[i2].y }, this.stage, unit); json.pvs[i2].x = pv.x; json.pvs[i2].y = pv.y; } } if (this.exPvs) { json.exPvs = cloneDeep(this.exPvs); for (let i2 in this.exPvs) { let pv = DDeiUtil$1.toRulerCoord({ x: this.exPvs[i2].x, y: this.exPvs[i2].y }, this.stage, unit); json.exPvs[i2].x = pv.x; json.exPvs[i2].y = pv.y; } } } return json; } }; _DDeiLine.calLineCross = debounce(_DDeiLine.calLineCross, 50); __publicField(_DDeiLine, "ClsName", "DDeiLine"); let DDeiLine = _DDeiLine; const __vite_glob_0_3$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLine, default: DDeiLine }, Symbol.toStringTag, { value: "Module" })); class DDeiLayoutManager { constructor(container2 = null) { __publicField2(this, "container"); this.container = container2; } /** * 计算时拖入待确认时的显示图形的向量 */ calDragInPVS(x2, y2, models) { if (this.container.layer) { let pvs2 = this.container.pvs; this.container.layer.dragInPoints = pvs2; } } /** * 计算时拖出确认时的显示图形的向量 */ calDragOutPVS(x2, y2, models) { if (this.container.layer) { let pvs2 = this.container.pvs; this.container.layer.dragOutPoints = pvs2; } } /** * 获取实际的内部容器控件 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainer() { return this.container; } /** * 获取实际的内部容器控件 * @param x 相对路径坐标 * @param y 相对路径坐标 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainerByPos(x2, y2) { return this.container; } /** * 获取切分区域的点,超出区域的范围不会显示内容 */ getAreasPVS(rotated = true) { return [this.container.pvs]; } } class DDeiLayoutManagerCompose extends DDeiLayoutManager { // ============================ 方法 =============================== /** * 修改模型的位置和大小 */ changeSubModelBounds() { } transVectors(matrix2) { this.container.transVectors(matrix2); } /** * 根据子模型大小,修改自身大小 */ changeParentsBounds() { this.container.updateBoundsByModels(); if (this.container.pModel) { this.container.pModel.changeParentsBounds(); } } canAppend(x2, y2, models) { return true; } append(x2, y2, models) { models.forEach((item) => { let oldContainer = item.pModel; let newContainer = this.container; if (oldContainer) { item.destroyRender(); oldContainer.removeModel(item, false, false); } newContainer.addModel(item, false); item.initRender(); }); return true; } /** * 修改布局信息 */ updateLayout(x2, y2, models, isAlt = false) { } canConvertLayout(oldLayout) { return false; } convertLayout(oldLayout) { } canChangePosition(x2, y2, models, isAlt = false) { return true; } canChangeSize(x2, y2, models) { return true; } canChangeRotate() { return true; } // ============================ 静态方法 ============================ /** * 返回当前实例 */ static newInstance(model) { return new DDeiLayoutManagerCompose(); } } const __vite_glob_0_0$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLayoutManagerCompose, default: DDeiLayoutManagerCompose }, Symbol.toStringTag, { value: "Module" })); class DDeiLayoutManagerFree extends DDeiLayoutManager { // ============================ 方法 =============================== /** * 根据自身大小修改子模型大小 */ changeSubModelBounds() { } transVectors(matrix2) { this.container.transSelfVectors(matrix2); } /** * 根据子模型大小,修改自身大小 */ changeParentsBounds() { } canAppend(x2, y2, models) { var _a3; let parentControls = this.container.getParents(); for (let i2 = 0; i2 < models.length; i2++) { let model = models[i2]; if (model) { if (model.id.indexOf("_shadow") != -1) { let id = model.id.substring(model.id, model.id.lastIndexOf("_shadow")); model = (_a3 = this.container.stage) == null ? void 0 : _a3.getModelById(id); } if (model == this.container) { return false; } else if (parentControls.indexOf(model) != -1) { return false; } } } return true; } append(x2, y2, models) { models.forEach((item) => { if (item) { let oldContainer = item.pModel; let newContainer = this.container; if (oldContainer) { item.destroyRender(); oldContainer.removeModel(item, false, false); } newContainer.addModel(item, false); item.initRender(); } }); return true; } /** * 修改布局信息 */ updateLayout(x2, y2, models, isAlt = false) { } canConvertLayout(oldLayout) { return true; } convertLayout(oldLayout) { } canChangePosition(x2, y2, models, isAlt = false) { return true; } canChangeSize(x2, y2, models) { return true; } canChangeRotate() { return true; } // ============================ 静态方法 ============================ /** * 返回当前实例 */ static newInstance(model) { return new DDeiLayoutManagerFree(); } } const __vite_glob_0_1$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLayoutManagerFree, default: DDeiLayoutManagerFree }, Symbol.toStringTag, { value: "Module" })); class DDeiLayoutManagerFull extends DDeiLayoutManager { // ============================ 方法 =============================== /** * 修改模型的位置和大小 */ changeSubModelBounds() { if (this.container.models.size == 1) { let model = Array.from(this.container.models.values())[0]; let m12 = new Matrix3(); let moveZeroMatrix = new Matrix3( 1, 0, -model.cpv.x, 0, 1, -model.cpv.y, 0, 0, 1 ); m12.premultiply(moveZeroMatrix); if (model.rotate) { let angle2 = (model.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let scaleMatrix2 = new Matrix3( this.container.width / model.width, 0, 0, 0, this.container.height / model.height, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); if (model.rotate) { let angle2 = -(model.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let moveContainerMatrix = new Matrix3( 1, 0, this.container.cpv.x, 0, 1, this.container.cpv.y, 0, 0, 1 ); m12.premultiply(moveContainerMatrix); model.transVectors(m12); } } transVectors(matrix2) { this.container.transVectors(matrix2); } /** * 根据子模型大小,修改自身大小 */ changeParentsBounds() { } canConvertLayout(oldLayout) { if (this.container.models.size <= 1) { return true; } else { return false; } } convertLayout(oldLayout) { } updateLayout(x2, y2, models, isAlt = false) { this.changeSubModelBounds(); } canAppend(x2, y2, models) { var _a3; if ((models == null ? void 0 : models.length) == 1) { let parentControls = this.container.getParents(); let model = models[0]; if (model.id.indexOf("_shadow") != -1) { let id = model.id.substring(model.id, model.id.lastIndexOf("_shadow")); model = (_a3 = this.container.stage) == null ? void 0 : _a3.getModelById(id); } if (model == this.container) { return false; } else if (parentControls.indexOf(model) != -1) { return false; } return true; } return false; } append(x2, y2, models) { var _a3; let item = models[0]; let oldModel = null; if (this.container.models.size == 1) { oldModel = Array.from(this.container.models.values())[0]; } let oldContainer = item.pModel; let newContainer = this.container; oldContainer.removeModel(item, false); newContainer.addModel(item, false); item.initRender(); if (oldModel) { newContainer.removeModel(oldModel, false); oldContainer.addModel(oldModel, false); if (item.originCPV && item.originPVS) { oldModel.cpv = item.originCPV; oldModel.pvs = item.originPVS; let rotate2 = oldModel.rotate; oldModel.initPVS(); oldModel.setRotate(rotate2); item.originCPV = null; item.originPVS = null; } else { oldModel.syncVectors(item, true); } oldModel.initRender(); let oldAbsPos2 = oldContainer.getAbsPosition(); (_a3 = oldContainer.layoutManager) == null ? void 0 : _a3.updateLayout(oldAbsPos2.x, oldAbsPos2.y, [oldModel]); } return true; } canChangePosition(x2, y2, models, isAlt = false) { if (isAlt) { return true; } return false; } canChangeSize(x2, y2, models) { return false; } canChangeRotate() { return true; } // ============================ 静态方法 ============================ /** * 返回当前实例 */ static newInstance(model) { return new DDeiLayoutManagerFull(model); } } const __vite_glob_0_2$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLayoutManagerFull, default: DDeiLayoutManagerFull }, Symbol.toStringTag, { value: "Module" })); class DDeiLayoutManagerNine extends DDeiLayoutManager { // ============================ 方法 =============================== /** * 是否可以从其他布局转换到当前布局的方法 * @return true可以转换,false不可以转换 */ canConvertLayout(oldLayout) { if (oldLayout == "free" || !oldLayout) { if (this.container.models.size <= 9) { return true; } else { return false; } } else if (oldLayout == "full") { return true; } else ; return false; } /** * 从其他布局转换到当前布局的方法 */ convertLayout(oldLayout) { var _a3; if (!this.container.layoutData) { this.container.layoutData = {}; } this.container.layoutData.nine = {}; if (oldLayout == "free" || !oldLayout) { let models = DDeiUtil$1.getSortedModels(this.container.models); let idx = 0; for (let row = 0; row < 3; row++) { for (let col = 0; col < 3; col++) { if (models.length > idx) { this.container.layoutData.nine[models[idx].id] = { "row": row, "col": col }; idx++; } } } } else if (oldLayout == "full") { if (((_a3 = this.container.models) == null ? void 0 : _a3.size) > 0) { let model = Array.from(this.container.models.values())[0]; this.container.layoutData.nine[model.id] = { "row": 1, "col": 1 }; } } else ; } /** * 根据layoutData修改模型的位置和大小 */ changeSubModelBounds() { let layoutData = this.container.layoutData.nine; let unitWidth = this.container.width / 3; let unitHeight = this.container.height / 3; let areasPVS = this.getAreasPVS(); for (let key in layoutData) { let model = this.container.models.get(key); let data = layoutData[key]; if (model) { let m12 = new Matrix3(); let moveZeroMatrix = new Matrix3( 1, 0, -model.cpv.x, 0, 1, -model.cpv.y, 0, 0, 1 ); m12.premultiply(moveZeroMatrix); if (model.rotate) { let angle2 = (model.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let scaleMatrix2 = new Matrix3( unitWidth / model.width, 0, 0, 0, unitHeight / model.height, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); if (model.rotate) { let angle2 = -(model.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let areaPV = areasPVS[data.row * 3 + data.col]; let areaPVC = { x: (areaPV[0].x + areaPV[2].x) / 2, y: (areaPV[0].y + areaPV[2].y) / 2 }; let moveContainerMatrix = new Matrix3( 1, 0, areaPVC.x, 0, 1, areaPVC.y, 0, 0, 1 ); m12.premultiply(moveContainerMatrix); model.transVectors(m12); if (model.changeChildrenBounds) { model.changeChildrenBounds(); } } } } /** * 根据子模型大小,修改自身大小 */ changeParentsBounds() { } transVectors(matrix2) { this.container.transVectors(matrix2); } canAppend(x2, y2, models) { var _a3; if ((models == null ? void 0 : models.length) == 1 || (models == null ? void 0 : models.length) <= 9 - this.container.models.size) { let parentControls = this.container.getParents(); for (let i2 = 0; i2 < models.length; i2++) { let model = models[i2]; if (model.id.indexOf("_shadow") != -1) { let id = model.id.substring(model.id, model.id.lastIndexOf("_shadow")); model = (_a3 = this.container.stage) == null ? void 0 : _a3.getModelById(id); } if (model == this.container) { return false; } else if (parentControls.indexOf(model) != -1) { return false; } } return true; } return false; } append(x2, y2, models) { var _a3, _b2, _c2, _d2; let layoutData = null; if ((_b2 = (_a3 = this == null ? void 0 : this.container) == null ? void 0 : _a3.layoutData) == null ? void 0 : _b2.nine) { layoutData = this.container.layoutData.nine; } let layoutIndex = this.getLayoutIndex(x2, y2); let indexModel = null; let emptyAreas = [ [0, 0, 0], [0, 0, 0], [0, 0, 0] ]; for (let key in layoutData) { let data = layoutData[key]; if (data.row == layoutIndex.row && data.col == layoutIndex.col) { indexModel = this.container.models.get(key); } emptyAreas[data.row][data.col] = 1; } let newContainer = this.container; for (let i2 = 0; i2 < models.length; i2++) { let item = models[i2]; let oldContainer = item.pModel; if (oldContainer) { oldContainer.removeModel(item, false); } newContainer.addModel(item, false); item.initRender(); if (models.length == 1 && layoutIndex.row != -1 && layoutIndex.col != -1) { layoutData[item.id] = { row: layoutIndex.row, col: layoutIndex.col }; if (indexModel) { newContainer.removeModel(indexModel, false); if (item.dragOriginX || item.dragOriginX == 0) { indexModel.setBounds(item.dragOriginX, item.dragOriginY, item.dragOriginWidth, item.dragOriginHeight); item.dragOriginX = null; item.dragOriginY = null; item.dragOriginWidth = null; item.dragOriginHeight = null; } if (oldContainer.layout == "nine") { let oldLayoutData = (_c2 = oldContainer == null ? void 0 : oldContainer.layoutData) == null ? void 0 : _c2.nine; let oldLayoutInfo = oldLayoutData[item.id]; if (oldLayoutInfo) { delete oldLayoutData[item.id]; oldLayoutData[indexModel.id] = oldLayoutInfo; } } oldContainer.addModel(indexModel, false); indexModel.initRender(); (_d2 = oldContainer.layoutManager) == null ? void 0 : _d2.updateLayout(oldAbsPos.x, oldAbsPos.y, [indexModel]); } } else { for (let sr = 0; sr < 3; sr++) { let has = false; for (let sc = 0; sc < 3; sc++) { if (emptyAreas[sr][sc] == 0) { layoutData[item.id] = { row: sr, col: sc }; emptyAreas[sr][sc] = 1; has = true; break; } } if (has) { break; } } } } return true; } /** * 修改布局信息 */ updateLayout(x2, y2, models) { var _a3, _b2; if (((_b2 = (_a3 = this == null ? void 0 : this.container) == null ? void 0 : _a3.layoutData) == null ? void 0 : _b2.nine) && (models == null ? void 0 : models.length) > 0) { let layoutData = this.container.layoutData.nine; let layoutIndex = this.getLayoutIndex(x2, y2); if (layoutIndex.row != -1 && layoutIndex.col != -1) { let oldRow = -1; let oldCol = -1; if (layoutData[models[0].id]) { oldRow = layoutData[models[0].id].row; oldCol = layoutData[models[0].id].col; } let oldModel = null; for (let key in layoutData) { let data = layoutData[key]; if (data.row == layoutIndex.row && data.col == layoutIndex.col) { oldModel = this.container.models.get(key); break; } } if (oldRow == -1 && oldModel) ; else if (oldRow != -1 && oldModel) { layoutData[models[0].id] = { row: layoutIndex.row, col: layoutIndex.col }; layoutData[oldModel.id] = { row: oldRow, col: oldCol }; } else if (!oldModel) { layoutData[models[0].id] = { row: layoutIndex.row, col: layoutIndex.col }; } } } this.changeSubModelBounds(); } canChangePosition(x2, y2, models, isAlt = false) { if (isAlt) { return true; } else if (this.container.isInAreaLoose(x2, y2, 0)) { return true; } return false; } canChangeSize(x2, y2, models) { return false; } canChangeRotate() { return true; } /** * 获取切分区域的点,超出区域的范围不会显示内容 */ getAreasPVS() { var _a3; let stageRatio2 = (_a3 = this.container) == null ? void 0 : _a3.getStageRatio(); let vc1 = new Vector3(this.container.pvs[0].x, this.container.pvs[0].y, 1); let vc2 = new Vector3(this.container.pvs[1].x, this.container.pvs[1].y, 1); let vc3 = new Vector3(this.container.pvs[2].x, this.container.pvs[2].y, 1); let vc4 = new Vector3(this.container.pvs[3].x, this.container.pvs[3].y, 1); let width = this.container.width * stageRatio2; let height = this.container.height * stageRatio2; let unitWidth = width / 3; let unitHeight = height / 3; if (this.container.rotate) { let move1Matrix = new Matrix3( 1, 0, -this.container.cpv.x, 0, 1, -this.container.cpv.y, 0, 0, 1 ); let angle2 = this.container.rotate * DDeiConfig$1.ROTATE_UNIT; let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); let move2Matrix = new Matrix3( 1, 0, this.container.cpv.x, 0, 1, this.container.cpv.y, 0, 0, 1 ); let m12 = new Matrix3().premultiply(move1Matrix).premultiply(rotateMatrix).premultiply(move2Matrix); vc1.applyMatrix3(m12); vc2.applyMatrix3(m12); vc3.applyMatrix3(m12); vc4.applyMatrix3(m12); } let p11 = new Vector3(vc1.x, vc1.y, 1); let p12 = new Vector3(vc1.x + unitWidth, vc1.y, 1); let p13 = new Vector3(vc1.x + unitWidth * 2, vc1.y, 1); let p14 = new Vector3(vc2.x, vc2.y, 1); let p21 = new Vector3(vc1.x, vc1.y + unitHeight, 1); let p22 = new Vector3(vc1.x + unitWidth, vc1.y + unitHeight, 1); let p23 = new Vector3(vc1.x + unitWidth * 2, vc1.y + unitHeight, 1); let p24 = new Vector3(vc2.x, vc1.y + unitHeight, 1); let p31 = new Vector3(vc1.x, vc1.y + unitHeight * 2, 1); let p32 = new Vector3(vc1.x + unitWidth, vc1.y + unitHeight * 2, 1); let p33 = new Vector3(vc1.x + unitWidth * 2, vc1.y + unitHeight * 2, 1); let p34 = new Vector3(vc2.x, vc1.y + unitHeight * 2, 1); let p41 = new Vector3(vc4.x, vc4.y, 1); let p42 = new Vector3(vc4.x + unitWidth, vc4.y, 1); let p43 = new Vector3(vc4.x + unitWidth * 2, vc4.y, 1); let p44 = new Vector3(vc3.x, vc4.y, 1); if (this.container.rotate) { let centerPoint = this.container.cpv; let move1Matrix = new Matrix3( 1, 0, -centerPoint.x, 0, 1, -centerPoint.y, 0, 0, 1 ); let angle2 = -this.container.rotate * DDeiConfig$1.ROTATE_UNIT; let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); let move2Matrix = new Matrix3( 1, 0, centerPoint.x, 0, 1, centerPoint.y, 0, 0, 1 ); let m12 = new Matrix3().premultiply(move1Matrix).premultiply(rotateMatrix).premultiply(move2Matrix); p11.applyMatrix3(m12); p12.applyMatrix3(m12); p13.applyMatrix3(m12); p14.applyMatrix3(m12); p21.applyMatrix3(m12); p22.applyMatrix3(m12); p23.applyMatrix3(m12); p24.applyMatrix3(m12); p31.applyMatrix3(m12); p32.applyMatrix3(m12); p33.applyMatrix3(m12); p34.applyMatrix3(m12); p41.applyMatrix3(m12); p42.applyMatrix3(m12); p43.applyMatrix3(m12); p44.applyMatrix3(m12); } let returnArray = [ [p11, p12, p22, p21], [p12, p13, p23, p22], [p13, p14, p24, p23], [p21, p22, p32, p31], [p22, p23, p33, p32], [p23, p24, p34, p33], [p31, p32, p42, p41], [p32, p33, p43, p42], [p33, p34, p44, p43] ]; return returnArray; } /** * 计算时拖入待确认时的显示图形的向量 */ calDragInPVS(x2, y2, models) { if (this.container.layer) { let areasPVS = this.getAreasPVS(); for (let i2 = 0; i2 < areasPVS.length; i2++) { let inArea = DDeiAbstractShape.isInsidePolygon( areasPVS[i2], { x: x2, y: y2 } ); if (inArea) { this.container.layer.dragInPoints = areasPVS[i2]; return; } } } } /** * 计算时拖入出确认时的显示图形的向量 */ calDragOutPVS(x2, y2, models) { var _a3, _b2; if (this.container.layer && models.length > 0) { let model = models[0]; if (model.id.indexOf("_shadow") != -1) { model = (_b2 = (_a3 = this.container) == null ? void 0 : _a3.stage) == null ? void 0 : _b2.getModelById(model.id.substring(0, model.id.lastIndexOf("_shadow"))); } let areasPVS = this.getAreasPVS(); for (let i2 = 0; i2 < areasPVS.length; i2++) { let inArea = DDeiAbstractShape.isInsidePolygon( areasPVS[i2], { x: model.cpv.x, y: model.cpv.y } ); if (inArea) { this.container.layer.dragOutPoints = areasPVS[i2]; return; } } } } /** * 获取落入的布局行列 * @param x * @param y * @returns */ getLayoutIndex(x2, y2) { if (this.container.layer) { let areasPVS = this.getAreasPVS(); for (let i2 = 0; i2 < areasPVS.length; i2++) { let inArea = DDeiAbstractShape.isInsidePolygon( areasPVS[i2], { x: x2, y: y2 } ); if (inArea) { let row = parseInt(i2 / 3); let col = parseInt(i2 % 3); return { row, col }; } } } return { row: -1, col: -1 }; } // ============================ 静态方法 ============================ /** * 返回当前实例 */ static newInstance(model) { return new DDeiLayoutManagerNine(model); } } const __vite_glob_0_3$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLayoutManagerNine, default: DDeiLayoutManagerNine }, Symbol.toStringTag, { value: "Module" })); const _DDeiLayoutManagerFactory = class _DDeiLayoutManagerFactory2 { /** * 根据layout获取layout实例 */ static getLayoutInstance(layout) { var _a3, _b2; if (_DDeiLayoutManagerFactory2.LayoutManagers.size == 0) { let modules2 = /* @__PURE__ */ Object.assign({ "./manager/layout-manager-compose.ts": __vite_glob_0_0$1$1, "./manager/layout-manager-free.ts": __vite_glob_0_1$1$1, "./manager/layout-manager-full.ts": __vite_glob_0_2$1$1, "./manager/layout-manager-nine.ts": __vite_glob_0_3$2 }); for (let i2 in modules2) { let cls = modules2[i2].default; let newI = i2.substring(i2.lastIndexOf("-") + 1, i2.lastIndexOf(".")); _DDeiLayoutManagerFactory2.LayoutManagers.set(newI, cls); } } if (layout) { let lm = (_a3 = _DDeiLayoutManagerFactory2.LayoutManagers.get(layout)) == null ? void 0 : _a3.newInstance(); if (lm) { return lm; } } return (_b2 = _DDeiLayoutManagerFactory2.LayoutManagers.get("free")) == null ? void 0 : _b2.newInstance(); } }; __publicField2(_DDeiLayoutManagerFactory, "LayoutManagers", /* @__PURE__ */ new Map()); let DDeiLayoutManagerFactory = _DDeiLayoutManagerFactory; const _DDeiPolygon = class _DDeiPolygon2 extends DDeiAbstractShape { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "border"); __publicField2(this, "fill"); __publicField2(this, "font"); __publicField2(this, "imgBase64"); __publicField2(this, "text"); __publicField2(this, "textStyle"); __publicField2(this, "textArea"); __publicField2(this, "modelType", "DDeiPolygon"); __publicField2(this, "baseModelType", "DDeiPolygon"); this.border = props.border ? props.border : null; this.fill = props.fill ? props.fill : null; this.font = props.font ? props.font : null; this.text = props.text ? props.text : ""; this.imgBase64 = props.imgBase64 ? props.imgBase64 : ""; this.textStyle = props.textStyle ? props.textStyle : null; if (props.textArea) { this.textArea = []; props.textArea.forEach((pvd) => { let pv = new Vector3(); for (let i2 in pvd) { pv[i2] = pvd[i2]; } pv.z = pvd.z || pvd.z === 0 ? pvd.z : 1; this.textArea.push(pv); }); } } // ============================ 静态变量 ============================ // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}, initPVS = true) { var _a3, _b2; let model = new _DDeiPolygon2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; let ddInstance = (_a3 = model.stage) == null ? void 0 : _a3.ddInstance; if (!model.pModel) { model.pModel = model.layer; } tempData[model.id] = model; if (((_b2 = json == null ? void 0 : json.composes) == null ? void 0 : _b2.length) > 0) { let composes = []; json == null ? void 0 : json.composes.forEach((composeJSON) => { let def = DDeiUtil$1.getControlDefine(composeJSON); let composeModel = ddInstance.controlModelClasses[def.type].loadFromJSON( composeJSON, tempData, false ); composeModel.pModel = model; composes.push(composeModel); }); model.composes = composes; } if (initPVS) { model.initPVS(); } model.initRender(); return model; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json, tempData = {}, initPVS = true) { var _a3, _b2; let model = new _DDeiPolygon2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; let ddInstance = (_a3 = model.stage) == null ? void 0 : _a3.ddInstance; if (((_b2 = json == null ? void 0 : json.composes) == null ? void 0 : _b2.length) > 0) { let composes = []; for (let ci = 0; ci < json.composes.length; ci++) { let composeJSON = json.composes[ci]; let def = DDeiUtil$1.getControlDefine(composeJSON); let composeModel = ddInstance.controlModelClasses[def.type].initByJSON( composeJSON, tempData, false ); composeModel.modelCode = composeModel.id; composeModel.id = model.id + "_comp_" + ci; composeModel.pModel = model; composes.push(composeModel); } model.composes = composes; } if (initPVS) { model.initPVS(); } return model; } // ============================ 方法 =============================== /** * 初始化渲染器 */ initRender() { var _a3; DDeiConfig$1.bindRender(this); this.render.init(); (_a3 = this.composes) == null ? void 0 : _a3.forEach((compose) => { compose.initRender(); }); delete this.__destroyed; } //覆写hpv initHPV() { } transVectors(matrix2, params) { if (this.poly == 2) ; else { this.textArea.forEach((pv) => { pv.applyMatrix3(matrix2); }); this.hpv.forEach((pv) => { pv.applyMatrix3(matrix2); }); } super.transVectors(matrix2, params); } /** * 同步向量 * @param source 源模型 * @param cloneVP 是否克隆向量,默认false */ syncVectors(source, clonePV = false) { if (this.poly == 2) ; else { if (clonePV) { this.textArea = cloneDeep(source.textArea); this.hpv = cloneDeep(source.hpv); } else { this.textArea = source.textArea; this.hpv = source.hpv; } } super.syncVectors(source, clonePV); } /** * 返回某个点,相对于该图形的角度 */ getPointAngle(point2) { let bpv2 = DDeiUtil$1.pointsToZero([this.bpv], this.cpv, this.rotate)[0]; let scaleX2 = Math.abs(bpv2.x / 100); let scaleY2 = Math.abs(bpv2.y / 100); let zeroPoint = DDeiUtil$1.pointsToZero([new Vector3(point2.x, point2.y, 1)], this.cpv, this.rotate)[0]; zeroPoint.x /= scaleX2; zeroPoint.y /= scaleY2; let lineAngle = parseFloat(DDeiUtil$1.getLineAngle(0, 0, zeroPoint.x, zeroPoint.y).toFixed(4)); if (lineAngle < -45 && lineAngle > -135) { return -90; } else if (lineAngle > -45 && lineAngle < 45) { return 0; } else if (lineAngle > 45 && lineAngle < 135) { return 90; } else { switch (lineAngle) { case -45: return 1002; case 45: return 1003; case -135: return 1001; case 135: return 1004; } return 180; } } toJSON() { var _a3, _b2, _c2; let json = super.toJSON(); let ruleDisplay; let ruleInit; if (((_a3 = this.stage.ruler) == null ? void 0 : _a3.display) || ((_b2 = this.stage.ruler) == null ? void 0 : _b2.display) == 0 || ((_c2 = this.stage.ruler) == null ? void 0 : _c2.display) == false) { ruleDisplay = this.stage.ruler.display; } else if (this.stage.ddInstance.ruler != null && this.stage.ddInstance.ruler != void 0) { if (typeof this.stage.ddInstance.ruler == "boolean") { ruleDisplay = this.stage.ddInstance.ruler ? 1 : 0; } else { ruleInit = this.stage.ddInstance.ruler; ruleDisplay = ruleInit.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(this.stage, "ruler.display", true); } let unit = DDeiModelArrtibuteValue.getAttrValueByState(this.stage, "ruler.unit", true, ruleInit); if (ruleDisplay) { if (this.cpv) { json.cpv = cloneDeep(this.cpv); let cpv = DDeiUtil$1.toRulerCoord({ x: this.cpv.x, y: this.cpv.y }, this.stage, unit); json.cpv.x = cpv.x; json.cpv.y = cpv.y; } if (this.hpv) { json.hpv = cloneDeep(this.hpv); for (let i2 = 0; i2 < this.hpv.length; i2++) { let hpv = DDeiUtil$1.toRulerCoord({ x: this.hpv[i2].x, y: this.hpv[i2].y }, this.stage, unit); json.hpv[i2].x = hpv.x; json.hpv[i2].y = hpv.y; } } if (this.bpv) { json.bpv = cloneDeep(this.bpv); let bpv2 = DDeiUtil$1.toRulerCoord({ x: this.bpv.x, y: this.bpv.y }, this.stage, unit); json.bpv.x = bpv2.x; json.bpv.y = bpv2.y; } if (this.exPvs) { json.exPvs = cloneDeep(this.exPvs); for (let i2 in this.exPvs) { let pv = DDeiUtil$1.toRulerCoord({ x: this.exPvs[i2].x, y: this.exPvs[i2].y }, this.stage, unit); json.exPvs[i2].x = pv.x; json.exPvs[i2].y = pv.y; } } } return json; } }; __publicField2(_DDeiPolygon, "ClsName", "DDeiPolygon"); let DDeiPolygon = _DDeiPolygon; const __vite_glob_0_7$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiPolygon, default: DDeiPolygon }, Symbol.toStringTag, { value: "Module" })); const _DDeiPolygonContainer = class _DDeiPolygonContainer2 extends DDeiPolygon { constructor(props) { super(props); __publicField2(this, "modelType", "DDeiPolygonContainer"); __publicField2(this, "baseModelType", "DDeiContainer"); __publicField2(this, "layout"); __publicField2(this, "layoutData"); __publicField2(this, "layoutManager"); __publicField2(this, "models"); __publicField2(this, "midList"); this.layout = props.layout; this.layoutData = props.layoutData; this.models = props.models ? props.models : /* @__PURE__ */ new Map(); this.midList = props.midList ? props.midList : new Array(); this.layoutManager = DDeiLayoutManagerFactory.getLayoutInstance(this.layout); this.layoutManager.container = this; } // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}) { var _a3; let container2 = new _DDeiPolygonContainer2(json); container2.layer = tempData["currentLayer"]; container2.stage = tempData["currentStage"]; container2.pModel = tempData["currentContainer"]; if (!container2.pModel) { container2.pModel = container2.layer; } let ddInstance = (_a3 = container2.stage) == null ? void 0 : _a3.ddInstance; tempData[container2.id] = container2; let models = /* @__PURE__ */ new Map(); let midList = new Array(); for (let key in json.models) { tempData["currentContainer"] = container2; let item = json.models[key]; let model = ddInstance.controlModelClasses[item.modelType].loadFromJSON(item, tempData); models.set(key, model); tempData["currentContainer"] = null; midList.push(model.id); } container2.models = models; container2.midList = midList; container2.initPVS(); container2.initRender(); return container2; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json, tempData = {}) { let model = new _DDeiPolygonContainer2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; model.initPVS(); return model; } // ============================ 方法 =============================== /** * 计算当前容器的模型总数量 */ calModelNumber() { let num = 0; this.midList.forEach((mid) => { let model = this.models.get(mid); if ((model == null ? void 0 : model.baseModelType) == "DDeiContainer") { num += model.calModelNumber(); } else if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { num += model.calModelNumber(); } else { num++; } }); return num; } /** * 初始化渲染器 */ initRender() { DDeiConfig$1.bindRender(this); this.render.init(); this.models.forEach((item, key) => { item.initRender(); }); delete this.__destroyed; } /** * 添加模型,并维护关系 * @param model 被添加的模型 */ addModel(model, notify = true) { if (this.midList.indexOf(model.id) == -1) { model.stage = this.stage; this.models.set(model.id, model); this.midList.push(model.id); model.pModel = this; model.layer = this.layer; this.resortModelByZIndex(); if (notify) { this.notifyChange(); } } } /** * 移除模型,并维护关系 * @param model 被移除的模型 * @param destroy 销毁,缺省false */ removeModels(models, destroy = false, notify = true) { models == null ? void 0 : models.forEach((model) => { this.removeModel(model, destroy); }); if (notify) { this.notifyChange(); } } /** * 移除模型,并维护关系 * @param model 被移除的模型 * @param destroy 销毁,缺省false */ removeModel(model, destroy = false, notify = true) { var _a3; this.models.delete(model.id); let idx = this.midList.indexOf(model.id); if (idx != -1) { this.midList.splice(idx, 1); } if (destroy) { model.destroyed(); } model.pModel = null; model.stage = null; model.render = null; if ((_a3 = this.stage) == null ? void 0 : _a3.render) { this.stage.render.refreshJumpLine = false; } if (notify) { this.notifyChange(); } } /** * 移除自身的方法 */ destroyed() { this.midList.forEach((key) => { let item = this.models.get(key); item.destroyed(); }); super.destroyed(); } /** * 移除渲染器 */ destroyRender() { super.destroyRender(); this.midList.forEach((key) => { let item = this.models.get(key); item == null ? void 0 : item.destroyRender(); }); } /** * 仅变换自身向量 */ transSelfVectors(matrix2) { super.transVectors(matrix2); } /** * 变换向量 */ transVectors(matrix2, params) { super.transVectors(matrix2, params); if (!(params == null ? void 0 : params.ignoreChildren)) { this.midList.forEach((key) => { let item = this.models.get(key); item.transVectors(matrix2, params); }); } } /** * 变换向量,只能用于两个结构和数据相同的变量进行交换,如影子控件 */ syncVectors(source) { super.syncVectors(source); this.midList.forEach((key) => { let itemDist = this.models.get(key); let itemSource = source.models.get(key); itemDist.syncVectors(itemSource); }); } /** * 获取实际的内部容器控件 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainer() { return this.layoutManager ? this.layoutManager.getAccuContainer() : this; } /** * 获取实际的内部容器控件 * @param x 相对路径坐标 * @param y 相对路径坐标 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainerByPos(x2, y2) { return this.layoutManager ? this.layoutManager.getAccuContainerByPos(x2, y2) : this; } /** * 根据基础模型获取控件 * @param bmt 基础模型类别 */ getModelsByBaseType(bmt) { let returnValues = []; this.midList.forEach((mid) => { let model = this.models.get(mid); if ((model == null ? void 0 : model.baseModelType) == bmt) { returnValues.push(model); } else if ((model == null ? void 0 : model.baseModelType) == "DDeiContainer") { let datas2 = model.getModelsByBaseType(bmt); datas2.forEach((dt) => { returnValues.push(dt); }); } }); return returnValues; } /** * 获取子模型 */ getSubModels(ignoreModelIds, level = 1, rect) { let models = []; this.midList.forEach((mid) => { if (ignoreModelIds && (ignoreModelIds == null ? void 0 : ignoreModelIds.indexOf(mid)) != -1) { return; } let subModel = this.models.get(mid); if (subModel) { if (!rect || subModel.isInRect(rect.x, rect.y, rect.x1, rect.y1)) { if (level > 1 && subModel.getSubModels) { let subModels = subModel.getSubModels(ignoreModelIds, level - 1, rect); models = models.concat(subModels); } models.push(subModel); } } }); return models; } /** * 获取子模型,通过一个过滤器 */ getSubModelsByFilter(filterName = null, ignoreModelIds, level = 1, params) { let models = []; this.midList.forEach((mid) => { if (ignoreModelIds && (ignoreModelIds == null ? void 0 : ignoreModelIds.indexOf(mid)) != -1) { return; } let subModel = null; if (this.models.get) { subModel = this.models.get(mid); } else { subModel = this.models[mid]; } if (subModel) { let filterMethod = null; if (filterName) { let define2 = DDeiUtil$1.getControlDefine(subModel); if (define2 && define2.filters && define2.filters[filterName]) { filterMethod = define2.filters[filterName]; } } if (!filterMethod || filterMethod(subModel, params)) { if (level > 1 && (subModel == null ? void 0 : subModel.getSubModelsByFilter)) { let subModels = subModel.getSubModelsByFilter(filterName, ignoreModelIds, level - 1, params); models = models.concat(subModels); } models.push(subModel); } } }); return models; } /** * 将控件设置到顶层 */ pushTop(models) { models.forEach((item) => { let lastItem = this.models.get(this.midList[this.midList.length - 1]); if (lastItem.id != item.id) { let lastIndex = lastItem.zIndex ? lastItem == null ? void 0 : lastItem.zIndex : 0; item.zIndex = lastIndex + 1; } }); this.resortModelByZIndex(); } /** * 将控件设置到底层 */ pushBottom(models) { models.forEach((item) => { item.zIndex = null; let oldIdIndex = this.midList.indexOf(item.id); if (oldIdIndex > 0) { this.midList.splice(oldIdIndex, 1); this.midList.splice(0, 0, item.id); } }); this.resortModelByZIndex(); } /** * 将控件设置到上一层 */ pushUp(models) { models.forEach((item) => { if (!item.zIndex) { item.zIndex = 1; } else { item.zIndex++; } }); this.resortModelByZIndex(); } /** * 将控件设置到下一层 */ pushDown(models) { models.forEach((item) => { if (!item.zIndex || item.zIndex <= 1) { item.zIndex = null; let oldIdIndex = this.midList.indexOf(item.id); if (oldIdIndex > 0) { let temp = this.midList[oldIdIndex]; this.midList[oldIdIndex] = this.midList[oldIdIndex - 1]; this.midList[oldIdIndex - 1] = temp; } } else { item.zIndex--; } }); this.resortModelByZIndex(); } /** * 按照Zindex的顺序,从小到大排列,并重新设置子元素的zindex确保其连续,最后将排序后的List设置成新的midList */ resortModelByZIndex() { let newMidList = new Array(); let hadZIndexList = new Array(); for (let mg = 0; mg < this.midList.length; mg++) { let item = this.models.get(this.midList[mg]); if (item.zIndex && item.zIndex > 0) { let insertIndex = hadZIndexList.length; for (let j2 = 0; j2 < hadZIndexList.length; j2++) { if (this.models.get(hadZIndexList[j2]).zIndex > item.zIndex) { insertIndex = j2; break; } } hadZIndexList.splice(insertIndex, 0, item.id); } else { newMidList.push(item.id); } } this.midList = newMidList.concat(hadZIndexList); } cascadeRemoveSelf() { var _a3, _b2; let newContainer = this.pModel; if (newContainer.baseModelType == "DDeiLayer" && !newContainer.layoutManager) { let freeLayoutManager = DDeiLayoutManagerFactory.getLayoutInstance("free"); freeLayoutManager.container = newContainer; newContainer.layoutManager = freeLayoutManager; } if (this.layout == "compose" && this.models.size <= 1) { let models = Array.from(this.models.values()); (_a3 = newContainer.layoutManager) == null ? void 0 : _a3.append(null, null, models); newContainer.changeParentsBounds(); (_b2 = newContainer.layoutManager) == null ? void 0 : _b2.updateLayout(null, null, models); newContainer.removeModel(this, true); } newContainer == null ? void 0 : newContainer.cascadeRemoveSelf(); } /** * 获取选中状态的所有控件 * @returns */ getSelectedModels() { let controls2 = /* @__PURE__ */ new Map(); this.models.forEach((item, key) => { if (item.state == DDeiEnumControlState.SELECTED) { controls2.set(item.id, item); } }); return controls2; } /** * 取消选择控件,默认取消所有 */ cancelSelectModels(models, ignoreModels) { if (!models) { models = Array.from(this.models.values()); } models.forEach((item) => { if (!ignoreModels || (ignoreModels == null ? void 0 : ignoreModels.indexOf(item)) == -1) { item.setState(DDeiEnumControlState.DEFAULT); } }); } /** * 取消选择控件,默认取消所有 */ cancelAllLevelSelectModels(ignoreModels) { this.models.forEach((item) => { if (!ignoreModels || (ignoreModels == null ? void 0 : ignoreModels.indexOf(item)) == -1) { item.setState(DDeiEnumControlState.DEFAULT); } if (item.baseModelType == "DDeiContainer") { item.cancelAllLevelSelectModels(ignoreModels); } }); } /** * 根据ID获取模型 * @param id 模型id */ getModelById(id) { let reutrnModel = null; if (id) { if (this.models.has(id)) { reutrnModel = this.models.get(id); } else { this.models.forEach((item) => { let container2 = item.getAccuContainer(); if (container2) { let rm = container2.getModelById(id); if (rm) { reutrnModel = rm; } } }); } } if (!reutrnModel) { reutrnModel = null; } return reutrnModel; } /** * 修改上层模型大小 */ changeParentsBounds() { if (this.layoutManager) { this.layoutManager.changeParentsBounds(); } return true; } /** * 通过下层模型更新本层模型的信息 */ updateBoundsByModels() { let subModels = Array.from(this.models.values()); let outRect = DDeiAbstractShape.getOutRectByPV(subModels); this.setSelfBounds(outRect.x, outRect.y, outRect.width, outRect.height); this.setModelChanged(); } //仅设置自身的大小以及宽高 setSelfBounds(x2, y2, width, height) { let m12 = new Matrix3(); let move1Matrix = new Matrix3( 1, 0, -this.cpv.x, 0, 1, -this.cpv.y, 0, 0, 1 ); m12.premultiply(move1Matrix); if (this.rotate) { let angle2 = DDeiUtil$1.preciseTimes(this.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let scaleMatrix2 = new Matrix3( width / this.essBounds.width, 0, 0, 0, height / this.essBounds.height, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); if (this.rotate) { let angle2 = -DDeiUtil$1.preciseTimes(this.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let move2Matrix = new Matrix3( 1, 0, x2 + width / 2, 0, 1, y2 + height / 2, 0, 0, 1 ); m12.premultiply(move2Matrix); this.transSelfVectors(m12); } /** * 修改子元素大小 */ changeChildrenBounds() { if (this.layoutManager) { this.layoutManager.changeSubModelBounds(); } return true; } /** * 更新关联图形 */ updateLinkModels(ignoreModelIds) { super.updateLinkModels(ignoreModelIds); this.models.forEach((model) => { model.updateLinkModels(ignoreModelIds); }); } getAPVS() { let arr = [this.cpv]; this.models.forEach((model) => { let modelarr = model.getAPVS(); arr = arr.concat(modelarr); }); return arr; } removeModelById(ids) { ids == null ? void 0 : ids.forEach((id) => { let model = this.getModelById(id); if (model) { this.removeModel(model); } }); this.models.forEach((model) => { if (model.baseModelType == "DDeiContainer") { model.removeModelById(ids); } }); } toJSON() { var _a3, _b2, _c2; let json = super.toJSON(); let ruleDisplay; let ruleInit; if (((_a3 = this.stage.ruler) == null ? void 0 : _a3.display) || ((_b2 = this.stage.ruler) == null ? void 0 : _b2.display) == 0 || ((_c2 = this.stage.ruler) == null ? void 0 : _c2.display) == false) { ruleDisplay = this.stage.ruler.display; } else if (this.stage.ddInstance.ruler != null && this.stage.ddInstance.ruler != void 0) { if (typeof this.stage.ddInstance.ruler == "boolean") { ruleDisplay = this.stage.ddInstance.ruler ? 1 : 0; } else { ruleInit = this.stage.ddInstance.ruler; ruleDisplay = ruleInit.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(this.stage, "ruler.display", true); } let unit = DDeiModelArrtibuteValue.getAttrValueByState(this.stage, "ruler.unit", true, ruleInit); if (ruleDisplay) { if (this.cpv) { json.cpv = cloneDeep(this.cpv); let cpv = DDeiUtil$1.toRulerCoord({ x: this.cpv.x, y: this.cpv.y }, this.stage, unit); json.cpv.x = cpv.x; json.cpv.y = cpv.y; } if (this.pvs) { json.pvs = cloneDeep(this.pvs); for (let i2 = 0; i2 < this.pvs.length; i2++) { let pv = DDeiUtil$1.toRulerCoord({ x: this.pvs[i2].x, y: this.pvs[i2].y }, this.stage, unit); json.pvs[i2].x = pv.x; json.pvs[i2].y = pv.y; } } if (this.exPvs) { json.exPvs = cloneDeep(this.exPvs); for (let i2 in this.exPvs) { let pv = DDeiUtil$1.toRulerCoord({ x: this.exPvs[i2].x, y: this.exPvs[i2].y }, this.stage, unit); json.exPvs[i2].x = pv.x; json.exPvs[i2].y = pv.y; } } } return json; } }; __publicField2(_DDeiPolygonContainer, "ClsName", "DDeiPolygonContainer"); let DDeiPolygonContainer = _DDeiPolygonContainer; const __vite_glob_0_6$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiPolygonContainer, default: DDeiPolygonContainer }, Symbol.toStringTag, { value: "Module" })); var DDeiEnumState = /* @__PURE__ */ ((DDeiEnumState2) => { DDeiEnumState2[DDeiEnumState2["IN_ACTIVITY"] = -1] = "IN_ACTIVITY"; DDeiEnumState2[DDeiEnumState2["NONE"] = 0] = "NONE"; return DDeiEnumState2; })(DDeiEnumState || {}); const _DDeiStage = class _DDeiStage2 { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "id"); __publicField2(this, "layers"); __publicField2(this, "layerIndex"); __publicField2(this, "idIdx"); __publicField2(this, "modelType", "DDeiStage"); __publicField2(this, "ddInstance", null); __publicField2(this, "selectedModels", null); __publicField2(this, "histroy", []); __publicField2(this, "histroyIdx", -1); __publicField2(this, "unicode"); __publicField2(this, "ratio", 1.2); __publicField2(this, "width"); __publicField2(this, "height"); __publicField2(this, "wpv"); __publicField2(this, "links"); __publicField2(this, "mark"); __publicField2(this, "paper"); __publicField2(this, "spv", null); __publicField2(this, "ruler"); __publicField2(this, "grid"); __publicField2(this, "modelCode", "DDeiStage"); var _a3; this.id = props.id; this.layers = []; this.layerIndex = props.layerIndex != void 0 && props.layerIndex != null && props.layerIndex >= 0 ? props.layerIndex : -1; this.idIdx = props.idIdx ? props.idIdx : 0; this.unicode = props.unicode ? props.unicode : DDeiUtil$1.getUniqueCode(); this.histroy = props.histroy ? props.histroy : []; this.histroyIdx = props.histroyIdx || props.histroyIdx == 0 ? props.histroyIdx : -1; this.ratio = props.ratio; this.width = props.width; this.height = props.height; this.wpv = props.wpv; this.mark = props.mark; this.paper = props.paper; this.ruler = props.ruler; this.grid = props.grid; this.global = props.global; if (props.spv) { this.spv = new Vector3(props.spv.x, props.spv.y, 1); } this.links = []; (_a3 = props == null ? void 0 : props.links) == null ? void 0 : _a3.forEach((link2) => { this.links.push(link2); }); } // ============================ 静态变量 ============================ // ============================ 静态方法 ============================ /** * 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 */ static loadFromJSON(json, tempData = {}) { var _a3; let stage2 = new _DDeiStage2(json); stage2.ddInstance = tempData["currentDdInstance"]; if (!stage2.ratio) { stage2.ratio = (_a3 = stage2.ddInstance) == null ? void 0 : _a3.ratio; } tempData["currentStage"] = stage2; tempData[stage2.id] = stage2; let layers = []; json.layers.forEach((layer2) => { let model = DDeiLayer.loadFromJSON(layer2, tempData); layers.push(model); }); stage2.layers = layers; stage2.initHistroy(); stage2.initRender(); if (stage2.links) { let links = []; stage2.links.forEach((lk) => { let sm = null; let dm = null; if (lk.sm) { sm = lk.sm; } else if (lk.smid) { sm = stage2.getModelById(lk.smid); } if (lk.dm) { dm = lk.dm; } else if (lk.dmid) { dm = stage2.getModelById(lk.dmid); } lk.stage = stage2; lk.sm = sm; lk.dm = dm; let link2 = new DDeiLink(lk); links.push(link2); }); stage2.links = links; stage2.refreshLinkCache(); } let models = stage2.getLayerModels([], 100); models.forEach((model) => { if (model.baseModelType == "DDeiLine") { model.initPVS(); } model.initLinkModels(); }); return stage2; } /** * 通过JSON初始化对象,数据未传入时将初始化数据 */ static initByJSON(json, tempData = {}) { var _a3; let stage2 = new _DDeiStage2(json); stage2.ddInstance = tempData["currentDdInstance"]; if (!stage2.ratio) { stage2.ratio = (_a3 = stage2.ddInstance) == null ? void 0 : _a3.ratio; } let dDeiLayer1 = DDeiLayer.initByJSON({ id: "layer_default", name: "L-1" }); dDeiLayer1.index = 0; dDeiLayer1.stage = stage2; stage2.layers[0] = dDeiLayer1; stage2.layerIndex = 0; stage2.initHistroy(); return stage2; } // ============================ 方法 =============================== /** * 添加连接点 * @param link 链接点 */ addLink(...links) { links == null ? void 0 : links.forEach((link2) => { if (link2) { if (this.links.indexOf(link2) == -1) { this.links.push(link2); } } }); this.refreshLinkCache(); } /** * 删除连接点 * @param link 链接点 */ removeLink(...links) { links == null ? void 0 : links.forEach((link2) => { if (link2) { let index = this.links.indexOf(link2); if (index != -1) { this.links.splice(index, 1); } } }); this.refreshLinkCache(); } /** * 刷新链接缓存 */ refreshLinkCache() { this.sourceLinkCache = /* @__PURE__ */ new Map(); this.distLinkCache = /* @__PURE__ */ new Map(); this.links.forEach((link2) => { if (link2.sm) { let smid = link2.sm.id; if (!this.sourceLinkCache.has(smid)) { this.sourceLinkCache.set(smid, []); } let sourceLinks = this.sourceLinkCache.get(smid); if (sourceLinks.indexOf(link2) == -1) { sourceLinks.push(link2); } } if (link2.dm) { let dmid = link2.dm.id; if (!this.distLinkCache.has(dmid)) { this.distLinkCache.set(dmid, []); } let distLinks = this.distLinkCache.get(dmid); if (distLinks.indexOf(link2) == -1) { distLinks.push(link2); } } }); } /** * 获取源模型的链接 * @param modelId 模型ID */ getSourceModelLinks(modelId) { var _a3; if (modelId) { return (_a3 = this.sourceLinkCache) == null ? void 0 : _a3.get(modelId); } } getPaperArea(paperType) { let stageRatio2 = this.getStageRatio(); let offsetWidth = 1 * stageRatio2 / 2; let paperSize = DDeiUtil$1.getPaperSize(this, paperType, false); let paperWidth = paperSize.width; let paperHeight = paperSize.height; if (!this.spv) { let sx = this.width / 2 - paperWidth / 2; let sy = this.height / 2 - paperHeight / 2; this.spv = new Vector3(sx, sy, 1); } let startPaperX = this.spv.x + 1; let startPaperY = this.spv.y + 1; let posX = startPaperX + offsetWidth; let posY = startPaperY + offsetWidth; this.paperStartX = posX; this.paperStartY = posY; let maxOutRect = DDeiAbstractShape.getOutRectByPV(this.getLayerModels([], 100)); let leftExtNum = 0, rightExtNum = 0, topExtNum = 0, bottomExtNum = 0; if (maxOutRect.width > 0 && maxOutRect.height > 0) { if (maxOutRect.x < startPaperX) { leftExtNum = parseInt((startPaperX - maxOutRect.x) / paperWidth); if (Math.abs((startPaperX - maxOutRect.x) % paperWidth) > 1) { leftExtNum++; } } if (maxOutRect.x1 > startPaperX + paperWidth) { rightExtNum = parseInt((maxOutRect.x1 - startPaperX - paperWidth) / paperWidth); if (Math.abs((maxOutRect.x1 - startPaperX - paperWidth) % paperWidth) > 1) { rightExtNum++; } } if (maxOutRect.y < startPaperY) { topExtNum = parseInt((startPaperY - maxOutRect.y) / paperHeight); if (Math.abs((startPaperY - maxOutRect.y) % paperHeight) > 1) { topExtNum++; } } if (maxOutRect.y1 > startPaperY + paperHeight) { bottomExtNum = parseInt((maxOutRect.y1 - startPaperY - paperHeight) / paperHeight); if (Math.abs((maxOutRect.y1 - startPaperY - paperHeight) % paperHeight) > 1) { bottomExtNum++; } } } let paperOutRect = { x: posX + -leftExtNum * paperWidth, y: posY + -topExtNum * paperHeight, w: (rightExtNum + leftExtNum + 1) * paperWidth, h: (bottomExtNum + topExtNum + 1) * paperHeight, unitWidth: paperWidth, unitHeight: paperHeight }; paperOutRect.x /= stageRatio2; paperOutRect.y /= stageRatio2; paperOutRect.w /= stageRatio2; paperOutRect.h /= stageRatio2; paperOutRect.unitWidth /= stageRatio2; paperOutRect.unitHeight /= stageRatio2; return paperOutRect; } /** * 获取目标模型的链接 * @param modelId 模型ID */ getDistModelLinks(modelId) { var _a3; if (modelId) { return (_a3 = this.distLinkCache) == null ? void 0 : _a3.get(modelId); } } /** * 计算当前stage的模型总数量 */ calModelNumber() { let num = 0; this.layers.forEach((layer2) => { num += layer2.calModelNumber(); }); return num; } /** * 初始化渲染器 */ initRender() { DDeiConfig$1.bindRender(this); this.render.init(); for (let i2 = 0; i2 < this.layers.length; i2++) { this.layers[i2].initRender(); } DDeiLine.calLineCross(this.layers[this.layerIndex]); this.initStageSize(); } initStageSize() { var _a3, _b2, _c2, _d2, _e2; let stage2 = this; if (!stage2.width || !stage2.height || !stage2.spv) { let paperType; if ((_a3 = stage2.paper) == null ? void 0 : _a3.type) { paperType = stage2.paper.type; } else if (stage2.ddInstance.paper) { if (typeof stage2.ddInstance.paper == "string") { paperType = stage2.ddInstance.paper; } else { paperType = stage2.ddInstance.paper.type; } } else { paperType = DDeiModelArrtibuteValue.getAttrValueByState(stage2, "paper.type", true); } let paperSize = DDeiUtil$1.getPaperSize(stage2, paperType, false); let w = stage2.ddInstance.render.canvas.width / stage2.ddInstance.render.ratio; let h = stage2.ddInstance.render.canvas.height / stage2.ddInstance.render.ratio; if (!stage2.width) { stage2.width = ((_b2 = stage2.ddInstance) == null ? void 0 : _b2.width) ? (_c2 = stage2.ddInstance) == null ? void 0 : _c2.width : (paperSize == null ? void 0 : paperSize.width) ? w > 2 * paperSize.width ? w : 2 * paperSize.width : w; } if (!stage2.height) { stage2.height = ((_d2 = stage2.ddInstance) == null ? void 0 : _d2.height) ? (_e2 = stage2.ddInstance) == null ? void 0 : _e2.height : (paperSize == null ? void 0 : paperSize.height) ? h > 2 * paperSize.height ? h : 2 * paperSize.height : h; } let stageRatio2 = stage2.getStageRatio(); if (!stage2.spv) { let sx = stage2.width / 2 - paperSize.width / 2 - (stageRatio2 - 1) * (paperSize.width / (stageRatio2 * 2)); let sy = stage2.height / 2 - paperSize.height / 2 - (stageRatio2 - 1) * (paperSize.height / (stageRatio2 * 2)); stage2.spv = new Vector3(sx, sy, 1); } if (!stage2.wpv) { stage2.wpv = { x: stage2.width > w ? -(stage2.width - w) / 2 : 0, y: stage2.height > h ? -(stage2.height - h) / 2 : 0, z: 0 }; } } } notifyChange() { DDeiUtil$1.notifyChange(this.ddInstance); } /** * 添加图层到某一层,如果不指定则添加到最外层 * @param layer 被添加的图层 * @param layerIndex 图层Index */ addLayer(layer2, layerIndex, notify = true) { var _a3; if (!layer2) { let curIdx = this.idIdx++; layer2 = DDeiLayer.initByJSON({ id: "layer_" + curIdx, name: "L-" + curIdx }); } else if (((_a3 = layer2.constructor) == null ? void 0 : _a3.ClsName) == "DDeiLayer") ; else { let json = layer2; if (!(json == null ? void 0 : json.id)) { let curIdx = this.idIdx++; json.id = "layer_" + curIdx; } if (!(json == null ? void 0 : json.name)) { json.name = "L-" + this.idIdx; } layer2 = DDeiLayer.initByJSON(json); } layer2.stage = this; if (!layerIndex || layerIndex < 0) { layerIndex = 0; } else if (layerIndex > this.layers.length - 1) { layerIndex = this.layers.length - 1; } this.layers.splice(layerIndex, 0, layer2); for (let i2 = 0; i2 < this.layers.length; i2++) { this.layers[i2].index = i2; } this.layerIndex = layerIndex; if (notify) { this.notifyChange(); } return layer2; } /** * 修改当前图层 * @param layerIndex 图层下标 */ changeLayer(layerIndex) { this.layerIndex = layerIndex; } /** * 获取画布缩放比率 */ getStageRatio() { let stageRatio2 = parseFloat(this.ratio) ? parseFloat(this.ratio) : 1; if (!stageRatio2 || isNaN(stageRatio2)) { stageRatio2 = this.ddInstance.ratio; } return stageRatio2; } /** * 设置全局缩放比率 */ setStageRatio(newValue = 1) { if (newValue != this.ratio) { if (this.ratio || this.ratio == 0) { this.oldRatio = this.ratio; } this.ratio = newValue; } } /** * 隐藏图层 * @param layerIndex 图层下标,不传则为当前图层 */ hiddenLayer(layerIndex) { if (!layerIndex) { layerIndex = this.layerIndex; } this.layers[layerIndex].display = 0; } /** * 显示图层 * @param layerIndex 图层下标,不传则为当前图层 * @param temp 是否临时显示 */ displayLayer(layerIndex, temp = false) { if (!layerIndex || layerIndex < 0 || layerIndex > this.layers[layerIndex].length - 1) { layerIndex = this.layerIndex; } if (temp) { this.layers.forEach((layer2) => { layer2.tempDisplay = false; }); this.layers[layerIndex].tempDisplay = true; } else { this.layers[layerIndex].display = 1; } } /** * 移除图层,如果不指定则移除当前图层 * @param layerIndex 移除图层的index */ removeLayer(layerIndex, notify = true) { if (this.layers.length <= 1) { return null; } if (!layerIndex && layerIndex != 0) { layerIndex = this.layerIndex; } if (layerIndex < 0) { layerIndex = 0; } else if (layerIndex > this.layers.length - 1) { layerIndex = this.layers.length - 1; } let layer2 = this.layers[layerIndex]; this.layers.splice(layerIndex, 1); if (layerIndex > this.layers.length - 1) { layerIndex = this.layers.length - 1; } for (let i2 = 0; i2 < this.layers.length; i2++) { this.layers[i2].index = i2; } this.layerIndex = layerIndex; if (notify) { this.notifyChange(); } return layer2; } /** * 添加模型到当前图层 */ addModel(model) { if (this.layerIndex != -1) { if (this.layers[this.layerIndex]) { this.layers[this.layerIndex].addModel(model); } } } destroyed() { this.layers.forEach((layer2) => { layer2.destroyed(); }); } /** * 移除渲染器 */ destroyRender() { this.layers.forEach((layer2) => { layer2.destroyRender(); }); this.render = null; } /** * 移除当前图层模型 */ removeModel(model, destroy = false) { if (this.layerIndex != -1) { if (this.layers[this.layerIndex]) { this.layers[this.layerIndex].removeModel(model, destroy); } } } /** * 清除当前画布所有控件 */ clearModels(destroy = false) { this.layers.forEach((layer2) => { layer2.clearModels(destroy); }); } /** * 根据ID删除元素 */ removeModelById(ids) { this.layers.forEach((layer2) => { layer2.removeModelById(ids); }); } /** * 选择控件 */ makeSelectModels(models, cancelSelectOther = true) { if (cancelSelectOther) { for (let i2 = 0; i2 < this.layers.length; i2++) { this.layers[i2].cancelAllLevelSelectModels(); } } models == null ? void 0 : models.forEach((model) => { model.state = DDeiEnumControlState.SELECTED; }); } /** * 全部取消所有已选控件 */ cancelSelectModels(models, ignoreModels) { for (let i2 = 0; i2 < this.layers.length; i2++) { this.layers[i2].cancelSelectModels(models, ignoreModels); } } /** * 根据ID获取控件 * @param id 控件ID * @param allLayer 是否查询所有layer,true是,false只查询当前layer */ getModelById(id, allLayer = false) { let reutrnModel = null; let curLayer = this.layers[this.layerIndex]; if (curLayer) { reutrnModel = curLayer.getModelById(id); } if (!reutrnModel && allLayer) { for (let i2 = 0; i2 < this.layers.length; i2++) { if (i2 != this.layerIndex) { reutrnModel = this.layers[i2].getModelById(id); if (reutrnModel) { break; } } } } return reutrnModel; } /** * 根据基础模型获取控件 * @param bmt 基础模型类别 */ getModelsByBaseType(bmt) { let returnValues = []; this.layers.forEach((layer2) => { let datas2 = layer2.getModelsByBaseType(bmt); datas2.forEach((dt) => { returnValues.push(dt); }); }); return returnValues; } /** * 更改选中控件 */ changeSelecetdModels(selectedModels) { var _a3; if (this.selectedModels != selectedModels) { (_a3 = this.selectedModels) == null ? void 0 : _a3.forEach((item) => { var _a22, _b2, _c2; (_b2 = (_a22 = item.getTopContainer()) == null ? void 0 : _a22.render) == null ? void 0 : _b2.enableRefreshShape(); (_c2 = item.render) == null ? void 0 : _c2.enableRefreshShape(); }); selectedModels == null ? void 0 : selectedModels.forEach((item) => { var _a22, _b2, _c2; (_b2 = (_a22 = item.getTopContainer()) == null ? void 0 : _a22.render) == null ? void 0 : _b2.enableRefreshShape(); (_c2 = item.render) == null ? void 0 : _c2.enableRefreshShape(); }); this.selectedModels = selectedModels; } } /** * 获取所有图层的模型 */ getLayerModels(ignoreModelIds, level = 1, rect) { let models = []; for (let i2 = 0; i2 < this.layers.length; i2++) { let subModels = this.layers[i2].getSubModels(ignoreModelIds, level, rect); models = models.concat(subModels); } return models; } /** * 获取多个图层之间的所有对齐模型 * @param data 判定的数据 * @param souceModels 源模型,可能包含多个 * @param points 判定的点,如果传入,则直接以这个点作为判定点,忽略其他点 * @returns */ getAlignData(data, souceModels, points = null) { let hpoint = {}; let vpoint = {}; let hasH = false; let hasV = false; let hAds = Infinity; let vAds = Infinity; if (souceModels.set) { souceModels = Array.from(souceModels.values()); } let fModel = null; let sourceModelKeys = []; for (let k = 0; k < souceModels.length; k++) { let item = souceModels[k]; let id = item.id; if (id.lastIndexOf("_shadow") != -1) { id = id.substring(id, id.lastIndexOf("_shadow")); } sourceModelKeys.push(id); if (!fModel) { fModel = this.getModelById(id); } } let canvas = this.ddInstance.render.getCanvas(); let rat1 = this.ddInstance.render.ratio; let x2 = -this.wpv.x; let y2 = -this.wpv.y; let x1 = x2 + canvas.width / rat1; let y1 = y2 + canvas.height / rat1; let stageRatio2 = this.getStageRatio(); let curLevelModels = fModel.pModel.getSubModels(sourceModelKeys, 1, { x: x2 / stageRatio2, y: y2 / stageRatio2, x1: x1 / stageRatio2, y1: y1 / stageRatio2 }); curLevelModels.forEach((model) => { let outPVS = (points == null ? void 0 : points.length) > 0 ? points : data.pvs; let inPVS = model.getAPVS(); outPVS.forEach((pv) => { inPVS == null ? void 0 : inPVS.forEach((mpv) => { let pvy = pv.y; let pvx = pv.x; let mpvy = mpv.y; let mpvx = mpv.x; if (Math.abs(pvy - mpvy) < 1) { hasH = true; if (!hpoint[pvy]) { hpoint[pvy] = { sx: Math.min(pvx, mpvx), ex: Math.max(pvx, mpvx) }; } else { hpoint[pvy].sx = Math.min(hpoint[pvy].sx, pvx, mpvx); hpoint[pvy].ex = Math.max(hpoint[pvy].sx, pvx, mpvx); } } if (hAds == Infinity && Math.abs(pvy - mpvy) <= this.ddInstance.GLOBAL_ADV_WEIGHT) { hAds = pvy - mpvy; } if (Math.abs(pvx - mpvx) < 1) { hasV = true; if (!vpoint[pvx]) { vpoint[pvx] = { sy: Math.min(pvy, mpvy), ey: Math.max(pvy, mpvy) }; } else { vpoint[pvx].sy = Math.min(vpoint[pvx].sy, pvy, mpvy); vpoint[pvx].ey = Math.max(vpoint[pvx].sy, pvy, mpvy); } } if (vAds == Infinity && Math.abs(pvx - mpvx) <= this.ddInstance.GLOBAL_ADV_WEIGHT) { vAds = pvx - mpvx; } }); }); }); return { hpoint: hasH ? hpoint : null, vpoint: hasV ? vpoint : null, hAds, vAds }; } /** * 将模型转换为JSON */ toJSON() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; let json = new Object(); let skipFields = (_a3 = DDeiConfig$1.SERI_FIELDS[this.modelType]) == null ? void 0 : _a3.SKIP; if (!((skipFields == null ? void 0 : skipFields.length) > 0)) { skipFields = (_b2 = DDeiConfig$1.SERI_FIELDS[this.baseModelType]) == null ? void 0 : _b2.SKIP; } if (!((skipFields == null ? void 0 : skipFields.length) > 0)) { skipFields = (_c2 = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _c2.SKIP; } let toJSONFields = (_d2 = DDeiConfig$1.SERI_FIELDS[this.modelType]) == null ? void 0 : _d2.TOJSON; if (!((toJSONFields == null ? void 0 : toJSONFields.length) > 0)) { toJSONFields = (_e2 = DDeiConfig$1.SERI_FIELDS[this.baseModelType]) == null ? void 0 : _e2.TOJSON; } if (!((toJSONFields == null ? void 0 : toJSONFields.length) > 0)) { toJSONFields = (_f = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _f.TOJSON; } for (let i2 in this) { if (!skipFields || (skipFields == null ? void 0 : skipFields.indexOf(i2)) == -1) { if (toJSONFields && toJSONFields.indexOf(i2) != -1 && this[i2]) { if (Array.isArray(this[i2])) { let array = []; this[i2].forEach((element) => { if (Array.isArray(element)) { let subArray = []; element.forEach((subEle) => { if (subEle == null ? void 0 : subEle.toJSON) { subArray.push(subEle.toJSON()); } else { subArray.push(subEle); } }); array.push(subArray); } else if (element == null ? void 0 : element.toJSON) { array.push(element.toJSON()); } else { array.push(element); } }); json[i2] = array; } else if (this[i2].set && this[i2].has) { let map = {}; this[i2].forEach((element, key) => { if (element == null ? void 0 : element.toJSON) { map[key] = element.toJSON(); } else { map[key] = element; } }); json[i2] = map; } else if (this[i2].toJSON) { json[i2] = this[i2].toJSON(); } else { json[i2] = this[i2]; } } else { json[i2] = this[i2]; } } } let ruleDisplay; let ruleInit; if (((_g = this.ruler) == null ? void 0 : _g.display) || ((_h = this.ruler) == null ? void 0 : _h.display) == 0 || ((_i = this.ruler) == null ? void 0 : _i.display) == false) { ruleDisplay = this.ruler.display; } else if (this.ddInstance.ruler != null && this.ddInstance.ruler != void 0) { if (typeof this.ddInstance.ruler == "boolean") { ruleDisplay = this.ddInstance.ruler ? 1 : 0; } else { ruleInit = this.ddInstance.ruler; ruleDisplay = ruleInit.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(this, "ruler.display", true); } if (ruleDisplay) { json.unit = DDeiModelArrtibuteValue.getAttrValueByState(this, "ruler.unit", true, ruleInit); } return json; } /** * 初始化日志,记录初始化状态 */ initHistroy() { if (this.histroy.length == 0 && this.histroyIdx == -1) { this.histroy.push({ time: (/* @__PURE__ */ new Date()).getTime(), data: JSON.stringify(this.toJSON()) }); this.histroyIdx = 0; } } /** * 记录日志 * @param layerIndex 图层下标 */ addHistroy(data) { if (this.histroyIdx == -1) { this.histroy = this.histroy.slice(0, 1); this.histroyIdx = 0; } else { this.histroy = this.histroy.slice(0, this.histroyIdx + 1); } this.histroy.push({ time: (/* @__PURE__ */ new Date()).getTime(), data }); this.histroyIdx = this.histroy.length - 1; } /** * 返回上一个历史数据,并将下标-1 * @param layerIndex 图层下标 */ revokeHistroyData() { if (this.histroyIdx != -1) { this.histroyIdx--; if (this.histroyIdx == -1) { this.histroyIdx = 0; return this.histroy[0]; } else { return this.histroy[this.histroyIdx]; } } } /** * 撤销上一次撤销并将下标+1 * @param layerIndex 图层下标 */ reRevokeHistroyData() { if (this.histroyIdx < this.histroy.length - 1) { this.histroyIdx++; return this.histroy[this.histroyIdx]; } } /** * 根据属性搜索控件 * @param keywords 关键字/正则表达式 * @param attr 搜索的属性 * @param isReg 是否正则表达式 * @param matchCase 区分大小写 * @param matchAll 全字匹配 */ searchModels(keywords, attr, isReg = false, matchCase = false, matchAll = false) { let resultArray = new Array(); if (keywords && attr) { let models = this.getLayerModels([], 100); if (isReg) ; else { for (let i2 = 0; i2 < models.length; i2++) { let model = models[i2]; let data = model[attr]; if (data && typeof data == "string") { if (!matchCase) { data = data.toLowerCase(); keywords = keywords.toLowerCase(); } if (!matchAll) { let searchIndex = 0; while (true) { let ix = data.indexOf(keywords, searchIndex); if (ix != -1) { resultArray.push({ model, attr, index: ix, len: keywords.length }); searchIndex = ix + 1; } else { break; } } } else { if (data == keywords) { resultArray.push({ model, attr, index: 0, len: keywords.length }); } } } } } } return resultArray; } /** * 返回画布图片 * @models 选中控件模型,如果不传入则返回整个画布 */ toImageDataUrl(models = null) { let ddInstance = this.ddInstance; if (ddInstance == null ? void 0 : ddInstance.render) { let canvas = document.createElement("canvas"); let ctx = canvas.getContext("2d"); let rat1 = ddInstance.render.ratio; let allLayers = false; if (!models || models.length < 0) { models = this.getLayerModels(null, 100); allLayers = true; } let outRect = DDeiAbstractShape.getOutRectByPV(models); let stageRatio2 = this.getStageRatio(); outRect.x *= stageRatio2; outRect.y *= stageRatio2; outRect.width *= stageRatio2; outRect.height *= stageRatio2; let lineOffset = 5 * stageRatio2; let addWidth = 2 * lineOffset; let editorId = DDeiUtil$1.getEditorId(ddInstance); let containerDiv = document.getElementById(editorId + "_ddei_cut_img_div"); canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;zoom:" + 1 / rat1); let cW = (outRect.width + addWidth) * rat1; let cH = (outRect.height + addWidth) * rat1; canvas.setAttribute("width", cW); canvas.setAttribute("height", cH); ctx.translate((-outRect.x + lineOffset - 5 * stageRatio2) * rat1, (-outRect.y + lineOffset - 5 * stageRatio2) * rat1); containerDiv.appendChild(canvas); if (allLayers) { let layers = this.layers; layers.forEach((ly) => { ly.midList.forEach((mid) => { var _a3, _b2; let model = ly.models.get(mid); (_a3 = model == null ? void 0 : model.render) == null ? void 0 : _a3.clearCachedValue(); (_b2 = model == null ? void 0 : model.render) == null ? void 0 : _b2.drawShape(); if (model.baseModelType == "DDeiLine") { let lineRect = DDeiAbstractShape.getOutRectByPV([model]); ctx.drawImage(model.render.tempCanvas, (lineRect.x - 5) * stageRatio2 * rat1, (lineRect.y - 5) * stageRatio2 * rat1); } else if (!model.render.viewer) { ctx.drawImage(model.render.tempCanvas, model.x * stageRatio2 * rat1, model.y * stageRatio2 * rat1); } }); }); } else { models[0].pModel.midList.forEach((mid) => { models.forEach((item) => { if (item.id == mid) { let rendList = DDeiUtil$1.sortRendList(item); rendList.forEach((rendItem) => { rendItem.render.clearCachedValue(); rendItem.render.drawShape({}); if (rendItem.baseModelType == "DDeiLine") { let lineRect = DDeiAbstractShape.getOutRectByPV([rendItem]); ctx.drawImage(rendItem.render.tempCanvas, (lineRect.x - 5) * stageRatio2 * rat1, (lineRect.y - 5) * stageRatio2 * rat1); } else if (!rendItem.render.viewer) { ctx.drawImage(rendItem.render.tempCanvas, rendItem.x * stageRatio2 * rat1, rendItem.y * stageRatio2 * rat1); } this.drawComposeImageToCanvas(rendItem, ctx, stageRatio2, rat1); }); } }); }); } let dataURL = canvas.toDataURL(); containerDiv.removeChild(canvas); return dataURL; } return null; } drawComposeImageToCanvas(model, ctx, stageRatio2, rat1) { var _a3; (_a3 = model.composes) == null ? void 0 : _a3.forEach((comp) => { comp.render.clearCachedValue(); comp.render.drawShape(); if (comp.baseModelType == "DDeiLine") { let lineRect = DDeiAbstractShape.getOutRectByPV([comp]); ctx.drawImage(comp.render.tempCanvas, (lineRect.x - 5) * stageRatio2 * rat1, (lineRect.y - 5) * stageRatio2 * rat1); } else if (!comp.render.viewer) { ctx.drawImage(comp.render.tempCanvas, comp.x * stageRatio2 * rat1, comp.y * stageRatio2 * rat1); } this.drawComposeImageToCanvas(comp, ctx, stageRatio2, rat1); }); } }; __publicField2(_DDeiStage, "ClsName", "DDeiStage"); let DDeiStage = _DDeiStage; const __vite_glob_0_11$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiStage, default: DDeiStage }, Symbol.toStringTag, { value: "Module" })); class DDeiFuncCallResult { constructor() { __publicField2(this, "state", 0); } } const _DDei = class _DDei2 { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "id"); __publicField2(this, "containerid"); __publicField2(this, "stage"); __publicField2(this, "modelType", "DDei"); __publicField2(this, "disabled", false); __publicField2(this, "pixel", 2); __publicField2(this, "controlModelClasses"); __publicField2(this, "controlViewClasses"); __publicField2(this, "state", DDeiEnumState.NONE); __publicField2(this, "bus", null); __publicField2(this, "editMode", 1); __publicField2(this, "width", 0); __publicField2(this, "height", 0); __publicField2(this, "ratio", 1); __publicField2(this, "mark", null); __publicField2(this, "ruler", null); __publicField2(this, "grid", null); __publicField2(this, "paper", null); __publicField2(this, "background", null); __publicField2(this, "EXT_STAGE_WIDTH", true); __publicField2(this, "EXT_STAGE_HEIGHT", true); __publicField2(this, "GLOBAL_ALLOW_STAGE_RATIO", true); __publicField2(this, "GLOBAL_ADV_WEIGHT", 5); __publicField2(this, "GLOBAL_HELP_LINE_ENABLE", true); __publicField2(this, "EVENT_LOAD_FILE", null); __publicField2(this, "EVENT_SAVE_FILE", null); __publicField2(this, "EVENT_CONTROL_SELECT_BEFORE", null); __publicField2(this, "EVENT_CONTROL_SELECT_AFTER", null); __publicField2(this, "EVENT_CONTROL_CREATE_BEFORE", null); __publicField2(this, "EVENT_MOUSE_OPERATING", null); __publicField2(this, "EVENT_CONTROL_CREATE_AFTER", null); __publicField2(this, "EVENT_CONTROL_DRAG_BEFORE", null); __publicField2(this, "EVENT_CONTROL_DRAG_AFTER", null); __publicField2(this, "EVENT_LINE_DRAG_BEFORE", null); __publicField2(this, "EVENT_LINE_DRAG_AFTER", null); __publicField2(this, "EVENT_CONTROL_DEL_BEFORE", null); __publicField2(this, "EVENT_CONTROL_DEL_AFTER", null); __publicField2(this, "EVENT_CONTROL_EDIT_BEFORE", null); __publicField2(this, "EVENT_CONTROL_EDIT_AFTER", null); __publicField2(this, "EVENT_CONTROL_VIEW_BEFORE", null); __publicField2(this, "EVENT_CONTROL_VIEW_AFTER", null); __publicField2(this, "EVENT_STAGE_CHANGE_WPV", null); __publicField2(this, "EVENT_STAGE_CHANGE_RATIO", null); __publicField2(this, "dpi", null); this.id = props.id; this.containerid = props.containerid; this.stage = null; this.EVENT_CONTROL_SELECT_BEFORE = _DDei2.beforeOperateValid; this.EVENT_CONTROL_CREATE_BEFORE = _DDei2.beforeOperateValid; this.EVENT_CONTROL_DRAG_BEFORE = _DDei2.beforeOperateValid; this.EVENT_CONTROL_DEL_BEFORE = _DDei2.beforeOperateValid; this.EVENT_CONTROL_EDIT_BEFORE = _DDei2.beforeOperateValid; this.EVENT_CONTROL_VIEW_BEFORE = _DDei2.beforeOperateValid; } // ============================ 静态方法 ============================ /** * 选中前,一般用于校验,默认根据权限配置参数进行校验 */ static beforeOperateValid(operate, data, ddInstance, evt) { let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", ddInstance); let rs = new DDeiFuncCallResult(); rs.state = 1; let models = data == null ? void 0 : data.models; let propName = data == null ? void 0 : data.propName; for (let i2 = 0; i2 < (models == null ? void 0 : models.length); i2++) { let access = DDeiUtil$1.isAccess( operate, models[i2], propName, modeName, ddInstance ); if (!access) { rs.state = -2; return rs; } } return rs; } /** * 给予container构建一个DDei实例 * 每一个DDei至少包含1个文件 * @param {id} id 文件id * @param {containerid} containerid 容器id * @param {stagejson} stagejson 内容JSON,如果没有则会创建一个 */ static newInstance(id, containerid, stagejson, editor) { if (id && containerid) { if (!_DDei2.INSTANCE_POOL.get(id)) { let ddInstance = new _DDei2({ id, containerid }); if (editor) { editor.ddInstance = ddInstance; } if (stagejson) { ddInstance.stage = DDeiStage.loadFromJSON(stagejson, { currentDdInstance: ddInstance }); } else { ddInstance.stage = DDeiStage.initByJSON({ id: "stage_1" }, { currentDdInstance: ddInstance }); } ddInstance.stage.ddInstance = ddInstance; _DDei2.INSTANCE_POOL.set(id, ddInstance); ddInstance.bus = new DDeiBus$1({ ddInstance }); ddInstance.dpi = DDeiUtil$1.getDPI(); return ddInstance; } else { let ddInstance = _DDei2.INSTANCE_POOL.get(id); return ddInstance; } } } //以上字段为初始化时传入的全局控制变量或钩子函数,在运行时不会改变 // ============================ 方法 ============================ /** * 初始化渲染器 */ initRender() { if (this.render) { this.render.destroyed(); } DDeiConfig$1.bindRender(this); this.render.init(); this.stage.initRender(); } /** * 修改当前编辑模式 * @param mode 编辑模式 */ changeEditMode(mode) { if (this.editMode != mode) { this.editMode = mode; } } /** * 应用外部配置文件,覆写配置文件内容 * @param config */ applyConfig(config2) { if (config2) { for (let i2 in config2) { if (i2 != "SERI_FIELDS") { this[i2] = config2[i2]; } } } } /** * 将模型转换为JSON */ toJSON() { var _a3, _b2, _c2, _d2, _e2, _f; let json = new Object(); let skipFields = (_a3 = DDeiConfig$1.SERI_FIELDS[this.modelType]) == null ? void 0 : _a3.SKIP; if (!((skipFields == null ? void 0 : skipFields.length) > 0)) { skipFields = (_b2 = DDeiConfig$1.SERI_FIELDS[this.baseModelType]) == null ? void 0 : _b2.SKIP; } if (!((skipFields == null ? void 0 : skipFields.length) > 0)) { skipFields = (_c2 = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _c2.SKIP; } let toJSONFields = (_d2 = DDeiConfig$1.SERI_FIELDS[this.modelType]) == null ? void 0 : _d2.TOJSON; if (!((toJSONFields == null ? void 0 : toJSONFields.length) > 0)) { toJSONFields = (_e2 = DDeiConfig$1.SERI_FIELDS[this.baseModelType]) == null ? void 0 : _e2.TOJSON; } if (!((toJSONFields == null ? void 0 : toJSONFields.length) > 0)) { toJSONFields = (_f = DDeiConfig$1.SERI_FIELDS["AbstractShape"]) == null ? void 0 : _f.TOJSON; } for (let i2 in this) { if (!skipFields || (skipFields == null ? void 0 : skipFields.indexOf(i2)) == -1) { if (toJSONFields && toJSONFields.indexOf(i2) != -1 && this[i2]) { if (Array.isArray(this[i2])) { let array = []; this[i2].forEach((element) => { if (element == null ? void 0 : element.toJSON) { array.push(element.toJSON()); } else { array.push(element); } }); json[i2] = array; } else if (this[i2].set && this[i2].has) { let map = {}; this[i2].forEach((element, key) => { if (element == null ? void 0 : element.toJSON) { map[key] = element.toJSON(); } else { map[key] = element; } }); json[i2] = map; } else if (this[i2].toJSON) { json[i2] = this[i2].toJSON(); } else { json[i2] = this[i2]; } } else { json[i2] = this[i2]; } } } return json; } }; __publicField2(_DDei, "INSTANCE_POOL", /* @__PURE__ */ new Map()); __publicField2(_DDei, "KEY_DOWN_STATE", /* @__PURE__ */ new Map()); let DDei = _DDei; var DDeiEnumOperateState = /* @__PURE__ */ ((DDeiEnumOperateState2) => { DDeiEnumOperateState2[DDeiEnumOperateState2["NONE"] = 0] = "NONE"; DDeiEnumOperateState2[DDeiEnumOperateState2["CONTROL_CONFIRMING"] = 1] = "CONTROL_CONFIRMING"; DDeiEnumOperateState2[DDeiEnumOperateState2["CONTROL_CREATING"] = 2] = "CONTROL_CREATING"; DDeiEnumOperateState2[DDeiEnumOperateState2["CONTROL_DRAGING"] = 3] = "CONTROL_DRAGING"; DDeiEnumOperateState2[DDeiEnumOperateState2["CONTROL_CHANGING_BOUND"] = 4] = "CONTROL_CHANGING_BOUND"; DDeiEnumOperateState2[DDeiEnumOperateState2["CONTROL_ROTATE"] = 5] = "CONTROL_ROTATE"; DDeiEnumOperateState2[DDeiEnumOperateState2["SELECT_WORKING"] = 10] = "SELECT_WORKING"; DDeiEnumOperateState2[DDeiEnumOperateState2["TABLE_INNER_DRAG"] = 11] = "TABLE_INNER_DRAG"; DDeiEnumOperateState2[DDeiEnumOperateState2["GRAB_WORKING"] = 20] = "GRAB_WORKING"; DDeiEnumOperateState2[DDeiEnumOperateState2["STAGE_SCROLL_WORKING"] = 21] = "STAGE_SCROLL_WORKING"; DDeiEnumOperateState2[DDeiEnumOperateState2["TEXT_CREATING"] = 30] = "TEXT_CREATING"; DDeiEnumOperateState2[DDeiEnumOperateState2["LINE_POINT_CHANGING"] = 40] = "LINE_POINT_CHANGING"; DDeiEnumOperateState2[DDeiEnumOperateState2["LINE_POINT_CHANGING_CONFIRM"] = 41] = "LINE_POINT_CHANGING_CONFIRM"; DDeiEnumOperateState2[DDeiEnumOperateState2["QUICK_EDITING"] = 50] = "QUICK_EDITING"; DDeiEnumOperateState2[DDeiEnumOperateState2["QUICK_EDITING_TEXT_SELECTING"] = 51] = "QUICK_EDITING_TEXT_SELECTING"; DDeiEnumOperateState2[DDeiEnumOperateState2["OV_POINT_CHANGING"] = 60] = "OV_POINT_CHANGING"; return DDeiEnumOperateState2; })(DDeiEnumOperateState || {}); const _DDeiSelector = class _DDeiSelector2 extends DDeiRectangle { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "modelType", "DDeiSelector"); __publicField2(this, "baseModelType", "DDeiSelector"); __publicField2(this, "paddingWeight"); __publicField2(this, "operateIconFill"); __publicField2(this, "passIndex", -1); __publicField2(this, "opvsIndex", -1); __publicField2(this, "passType", ""); __publicField2(this, "passChange", false); this.paddingWeight = props.paddingWeight; this.operateIconFill = props.operateIconFill; } // ============================ 静态变量 ============================ // ============================ 静态方法 ============================ // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json) { let shape = new _DDeiSelector2(json); return shape; } // ============================ 方法 =============================== /** * 设置passindex * @param index pass值 */ setPassIndex(passType, passIndex, opvsIndex) { if (this.passType != passType || this.passIndex != passIndex || this.opvsIndex != opvsIndex) { this.passIndex = passIndex; this.passType = passType; this.opvsIndex = opvsIndex; this.passChange = true; } } /** * 重制状态 */ resetState(x2 = -1, y2 = -1) { this.startX = x2; this.startY = y2; this.updatePVSByRect(0, 0, 0, 0); this.setState(DDeiEnumControlState.DEFAULT); } /** * 获取当前选择器包含的模型 * @returns */ getIncludedModels() { let rectPVS = this.pvs; let selectBounds = DDeiAbstractShape.pvsToOutRect(rectPVS); let looseWeight = 2; selectBounds.x -= looseWeight; selectBounds.y -= looseWeight; selectBounds.x1 += 2 * looseWeight; selectBounds.y1 += 2 * looseWeight; let models = /* @__PURE__ */ new Map(); this.stage.layers[this.stage.layerIndex].models.forEach((item, key) => { if (item.id != this.id) { let pvs2 = item.pvs; let inRectNum = 0; pvs2.forEach((pv) => { if (selectBounds.x <= pv.x && selectBounds.y < pv.y && selectBounds.x1 >= pv.x && selectBounds.y1 >= pv.y) { inRectNum++; } }); if (pvs2.length > 3 && inRectNum >= pvs2.length - 1) { models.set(item.id, item); } else if (inRectNum == pvs2.length) { models.set(item.id, item); } } }); return models; } /** * 获取画布缩放比率 */ getStageRatio() { var _a3; return (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); } updatePVSByRect(x2, y2, w, h) { let pvs2 = []; pvs2.push(new Vector3(x2, y2, 1)); pvs2.push(new Vector3(x2 + w, y2, 1)); pvs2.push(new Vector3(x2 + w, y2 + h, 1)); pvs2.push(new Vector3(x2, y2 + h, 1)); this.cpv = this.cpv = new Vector3(x2 + w / 2, y2 + h / 2, 1); this.pvs = pvs2; this.initHPV(); this.calRotate(); this.calOPVS(); this.calLoosePVS(); } /** * 根据已选择的控件更新向量信息 * @param pContainerModel 上层容器控件 */ updatePVSByModels(models) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; if (!models) { models = (_a3 = this.stage) == null ? void 0 : _a3.selectedModels; } if (!models) { let pContainerModel = this.stage.layers[this.stage.layerIndex]; models = pContainerModel.getSelectedModels(); } if ((models == null ? void 0 : models.size) > 0 || (models == null ? void 0 : models.length) > 0) { if (models.set) { models = Array.from(models.values()); } let paddingWeightInfo = ((_b2 = this.paddingWeight) == null ? void 0 : _b2.selected) ? this.paddingWeight.selected : DDeiConfig$1.SELECTOR.PADDING_WEIGHT.selected; let paddingWeight = 0; if (models.length > 1) { paddingWeight = paddingWeightInfo.multiple; } else { paddingWeight = paddingWeightInfo.single; } let pvs2 = null; let exeCalLoosePVS = true; if (models.length == 1) { if (models[0].baseModelType == "DDeiLine") { exeCalLoosePVS = false; pvs2 = cloneDeep(models[0].pvs); this.cpv = cloneDeep(models[0].cpv); } pvs2 = DDeiUtil$1.pointsToZero(models[0].operatePVS, models[0].cpv, models[0].rotate); let oct = DDeiAbstractShape.pvsToOutRect(pvs2); pvs2 = [new Vector3(oct.x, oct.y, 1), new Vector3(oct.x1, oct.y, 1), new Vector3(oct.x1, oct.y1, 1), new Vector3(oct.x, oct.y1, 1)]; pvs2 = DDeiUtil$1.zeroToPoints(pvs2, models[0].cpv, models[0].rotate); this.cpv = clone(models[0].cpv); let defineSample2 = (_d2 = (_c2 = DDeiUtil$1.getControlDefine(models[0])) == null ? void 0 : _c2.define) == null ? void 0 : _d2.sample; this.eqrat = ((_f = (_e2 = models[0]) == null ? void 0 : _e2.sample) == null ? void 0 : _f.eqrat) || (defineSample2 == null ? void 0 : defineSample2.eqrat); } else { this.eqrat = false; for (let i2 = 0; i2 < models.length; i2++) { let defineSample2 = (_h = (_g = DDeiUtil$1.getControlDefine(models[i2])) == null ? void 0 : _g.define) == null ? void 0 : _h.sample; if (((_j = (_i = models[i2]) == null ? void 0 : _i.sample) == null ? void 0 : _j.eqrat) || (defineSample2 == null ? void 0 : defineSample2.eqrat)) { this.eqrat = true; break; } } let outRectBounds = DDeiAbstractShape.getOutRectByPV(models); pvs2 = DDeiAbstractShape.getOutPV(models); pvs2[0].x -= paddingWeight; pvs2[0].y -= paddingWeight; pvs2[1].x += paddingWeight; pvs2[1].y -= paddingWeight; pvs2[2].x += paddingWeight; pvs2[2].y += paddingWeight; pvs2[3].x -= paddingWeight; pvs2[3].y += paddingWeight; this.cpv = new Vector3(outRectBounds.x + outRectBounds.width / 2, outRectBounds.y + outRectBounds.height / 2, 1); } this.pvs = pvs2; this.initHPV(); this.calRotate(); this.calOPVS(); if (exeCalLoosePVS) { this.calLoosePVS(); } this.setState(DDeiEnumControlState.SELECTED); } else { this.resetState(); } } /** * 变换向量 */ transVectors(matrix2, params) { this.cpv.applyMatrix3(matrix2); this.pvs.forEach((pv) => { pv.applyMatrix3(matrix2); }); for (let i2 in this.exPvs) { let pv = this.exPvs[i2]; pv.applyMatrix3(matrix2); } this.initHPV(); this.calRotate(); this.calOPVS(); this.calLoosePVS(); } /** * 基于当前向量计算宽松判定向量 */ calLoosePVS() { var _a3, _b2, _c2, _d2, _e2; let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); let looseWeight = DDeiConfig$1.SELECTOR.OPERATE_ICON.weight / 2; let tempPVS = cloneDeep(this.pvs); let move1Matrix = new Matrix3( 1, 0, -this.cpv.x, 0, 1, -this.cpv.y, 0, 0, 1 ); tempPVS.forEach((fpv) => { fpv.applyMatrix3(move1Matrix); }); if (this.rotate && this.rotate != 0) { let angle2 = DDeiUtil$1.preciseTimes(this.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); tempPVS.forEach((fpv) => { fpv.applyMatrix3(rotateMatrix); }); } this.x = tempPVS[0].x / stageRatio2; this.y = tempPVS[0].y / stageRatio2; let models = null; if (((_c2 = (_b2 = this.stage) == null ? void 0 : _b2.selectedModels) == null ? void 0 : _c2.size) > 0) { models = Array.from(this.stage.selectedModels.values()); } if (this.stage.render.operateState == DDeiEnumOperateState.SELECT_WORKING || !((models == null ? void 0 : models.length) == 1 && ((_d2 = models[0]) == null ? void 0 : _d2.baseModelType) == "DDeiLine" || tempPVS.length == 2)) { this.width = (tempPVS[1].x - tempPVS[0].x) / stageRatio2; this.height = (tempPVS[3].y - tempPVS[0].y) / stageRatio2; this.essBounds = { x: tempPVS[0].x, y: tempPVS[0].y, width: tempPVS[1].x - tempPVS[0].x, height: tempPVS[3].y - tempPVS[0].y }; this.loosePVS = []; this.loosePVS[0] = new Vector3(tempPVS[0].x - looseWeight, tempPVS[0].y - looseWeight, 1); this.loosePVS[1] = new Vector3(tempPVS[0].x + (tempPVS[1].x - tempPVS[0].x) / 2 - looseWeight, tempPVS[0].y - looseWeight, 1); this.loosePVS[2] = new Vector3(this.loosePVS[1].x, this.loosePVS[1].y - 40, 1); this.loosePVS[3] = new Vector3(this.loosePVS[2].x + 2 * looseWeight, this.loosePVS[2].y, 1); this.loosePVS[4] = new Vector3(this.loosePVS[3].x, this.loosePVS[3].y - 40, 1); this.loosePVS[5] = new Vector3(tempPVS[1].x + looseWeight, tempPVS[1].y - looseWeight, 1); this.loosePVS[6] = new Vector3(this.loosePVS[5].x, tempPVS[2].y + looseWeight, 1); this.loosePVS[7] = new Vector3(tempPVS[3].x - looseWeight, this.loosePVS[6].y, 1); } else if ((models == null ? void 0 : models.length) == 1 && ((_e2 = models[0]) == null ? void 0 : _e2.baseModelType) == "DDeiLine" || tempPVS.length == 2) { this.width = (tempPVS[1].x - tempPVS[0].x) / stageRatio2; this.height = (tempPVS[1].y - tempPVS[0].y) / stageRatio2; this.essBounds = { x: tempPVS[0].x, y: tempPVS[0].y, width: tempPVS[1].x - tempPVS[0].x, height: tempPVS[1].y - tempPVS[0].y }; this.loosePVS = []; this.loosePVS[0] = new Vector3(tempPVS[0].x - looseWeight, tempPVS[0].y - looseWeight, 1); this.loosePVS[1] = new Vector3(tempPVS[1].x + looseWeight, tempPVS[0].y - looseWeight, 1); this.loosePVS[2] = new Vector3(tempPVS[1].x + looseWeight, tempPVS[1].y + looseWeight, 1); this.loosePVS[3] = new Vector3(tempPVS[0].x - looseWeight, tempPVS[1].y + looseWeight, 1); } if (this.rotate && this.rotate != 0) { let angle2 = -DDeiUtil$1.preciseTimes(this.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); this.loosePVS.forEach((fpv) => { fpv.applyMatrix3(rotateMatrix); }); } let move2Matrix = new Matrix3( 1, 0, this.cpv.x, 0, 1, this.cpv.y, 0, 0, 1 ); this.loosePVS.forEach((fpv) => { fpv.applyMatrix3(move2Matrix); }); this.x += this.cpv.x / stageRatio2; this.y += this.cpv.y / stageRatio2; this.essBounds.x += this.cpv.x; this.essBounds.y += this.cpv.y; } /** * 根据向量点计算操作图标的向量点 */ calOPVS() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; let models = null; if (((_b2 = (_a3 = this.stage) == null ? void 0 : _a3.selectedModels) == null ? void 0 : _b2.size) > 0) { models = Array.from(this.stage.selectedModels.values()); } if ((models == null ? void 0 : models.length) == 1 && ((_c2 = models[0]) == null ? void 0 : _c2.baseModelType) == "DDeiLine") { let lineModel = models[0]; let type = DDeiModelArrtibuteValue.getAttrValueByState(lineModel, "type", true); let { startDX, startDY, endDX, endDY } = lineModel.render.getPointShapeSize(); let opvs = []; let opvsType = []; let pvs2 = lineModel.pvs; opvs.push(pvs2[0]); opvsType.push(1); switch (type) { case 2: { for (let i2 = 1; i2 < pvs2.length; i2++) { let x2 = (pvs2[i2].x + pvs2[i2 - 1].x) / 2; let y2 = (pvs2[i2].y + pvs2[i2 - 1].y) / 2; opvs.push(new Vector3(x2, y2, 1)); opvsType.push(3); if (i2 != pvs2.length - 1) { opvs.push(pvs2[i2]); opvsType.push(2); } } break; } case 3: { if (pvs2.length >= 4) { for (let i2 = 4; i2 <= pvs2.length; i2 += 3) { let i0 = i2 - 4; let i1 = i2 - 3; let i22 = i2 - 2; let i3 = i2 - 1; if (i0 != 0) { opvs.push(new Vector3(pvs2[i0].x, pvs2[i0].y, 1)); opvsType.push(4); } let stratX = pvs2[i0].x; let stratY = pvs2[i0].y; let endX = pvs2[i3].x; let endY = pvs2[i3].y; if (i0 == 0) { stratX = pvs2[i0].x + startDX; stratY = pvs2[i0].y + startDY; } if (i2 == pvs2.length) { endX = pvs2[i3].x + endDX; endY = pvs2[i3].y + endDY; } let btx = stratX * DDeiUtil$1.p331t3 + DDeiUtil$1.p331t2t3 * pvs2[i1].x + DDeiUtil$1.p33t21t3 * pvs2[i22].x + DDeiUtil$1.p33t3 * endX; let bty = stratY * DDeiUtil$1.p331t3 + DDeiUtil$1.p331t2t3 * pvs2[i1].y + DDeiUtil$1.p33t21t3 * pvs2[i22].y + DDeiUtil$1.p33t3 * endY; opvs.push(new Vector3(btx, bty, 1)); opvsType.push(4); btx = stratX * DDeiUtil$1.p661t3 + DDeiUtil$1.p661t2t3 * pvs2[i1].x + DDeiUtil$1.p66t21t3 * pvs2[i22].x + DDeiUtil$1.p66t3 * endX; bty = stratY * DDeiUtil$1.p661t3 + DDeiUtil$1.p661t2t3 * pvs2[i1].y + DDeiUtil$1.p66t21t3 * pvs2[i22].y + DDeiUtil$1.p66t3 * endY; opvs.push(new Vector3(btx, bty, 1)); opvsType.push(4); } } break; } } opvs.push(pvs2[pvs2.length - 1]); opvsType.push(1); this.opvs = opvs; this.opvsType = opvsType; } else { let canRotate = DDei.beforeOperateValid(DDeiEnumOperateType.ROTATE, { models }, (_d2 = this.stage) == null ? void 0 : _d2.ddInstance, null); let canScale = DDei.beforeOperateValid(DDeiEnumOperateType.SCALE, { models }, (_e2 = this.stage) == null ? void 0 : _e2.ddInstance, null); let pvs2 = this.pvs; let opvs = []; let opvsType = []; let lockWidth = 0; let scale = 0; if ((models == null ? void 0 : models.length) == 1) { scale = (_g = (_f = models[0]) == null ? void 0 : _f.render) == null ? void 0 : _g.getCachedValue("textStyle.scale"); if (scale == 3) { lockWidth = (_i = (_h = models[0]) == null ? void 0 : _h.render) == null ? void 0 : _i.getCachedValue("textStyle.lockWidth"); } } if ((pvs2 == null ? void 0 : pvs2.length) > 0) { if (canScale.state == 0 || canScale.state == 1) { if (scale == 3) { if (lockWidth == 1) { opvs[3] = { x: (pvs2[1].x + pvs2[2].x) / 2, y: (pvs2[1].y + pvs2[2].y) / 2 }; opvs[7] = { x: (pvs2[0].x + pvs2[3].x) / 2, y: (pvs2[0].y + pvs2[3].y) / 2 }; } } else { opvs[1] = { x: (pvs2[0].x + pvs2[1].x) / 2, y: (pvs2[0].y + pvs2[1].y) / 2 }; opvs[3] = { x: (pvs2[1].x + pvs2[2].x) / 2, y: (pvs2[1].y + pvs2[2].y) / 2 }; opvs[5] = { x: (pvs2[2].x + pvs2[3].x) / 2, y: (pvs2[2].y + pvs2[3].y) / 2 }; opvs[7] = { x: (pvs2[0].x + pvs2[3].x) / 2, y: (pvs2[0].y + pvs2[3].y) / 2 }; if (!this.eqrat) { opvs[2] = { x: pvs2[1].x, y: pvs2[1].y }; opvs[4] = { x: pvs2[2].x, y: pvs2[2].y }; opvs[6] = { x: pvs2[3].x, y: pvs2[3].y }; opvs[8] = { x: pvs2[0].x, y: pvs2[0].y }; } } } let v1 = new Vector3(pvs2[1].x, pvs2[1].y, 1); let moveMatrix2 = new Matrix3( 1, 0, -(pvs2[0].x + pvs2[1].x) / 2, 0, 1, -(pvs2[0].y + pvs2[1].y) / 2, 0, 0, 1 ); v1.applyMatrix3(moveMatrix2); let angle1 = (new Vector3(1, 0, 0).angleTo(new Vector3(v1.x, v1.y, 0)) * 180 / Math.PI).toFixed(4); let angle2 = 0; if (v1.x >= 0 && v1.y >= 0) { angle2 = (angle1 * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (v1.x <= 0 && v1.y >= 0) { angle2 = (angle1 * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (v1.x <= 0 && v1.y <= 0) { angle2 = (-angle1 * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } else if (v1.x >= 0 && v1.y <= 0) { angle2 = (-angle1 * DDeiConfig$1.ROTATE_UNIT).toFixed(4); } if (canRotate.state == 0 || canRotate.state == 1) { let angleR1 = (90 * DDeiConfig$1.ROTATE_UNIT).toFixed(4) - angle2; v1 = new Vector3(20, 0, 1); let rotateMatrix = new Matrix3( Math.cos(angleR1), Math.sin(angleR1), 0, -Math.sin(angleR1), Math.cos(angleR1), 0, 0, 0, 1 ); v1.applyMatrix3(rotateMatrix); let removeMatrix = new Matrix3( 1, 0, (pvs2[0].x + pvs2[1].x) / 2, 0, 1, (pvs2[0].y + pvs2[1].y) / 2, 0, 0, 1 ); v1.applyMatrix3(removeMatrix); opvs[9] = v1; } let v2 = new Vector3(25, 0, 1); let angleR2 = (135 * DDeiConfig$1.ROTATE_UNIT).toFixed(4) - angle2; let rotateMatrix2 = new Matrix3( Math.cos(angleR2), Math.sin(angleR2), 0, -Math.sin(angleR2), Math.cos(angleR2), 0, 0, 0, 1 ); v2.applyMatrix3(rotateMatrix2); let removeMatrix2 = new Matrix3( 1, 0, pvs2[0].x, 0, 1, pvs2[0].y, 0, 0, 1 ); v2.applyMatrix3(removeMatrix2); opvs[10] = v2; this.opvs = opvs; this.opvsType = opvsType; } } } /** * 返回当前坐标是否在操作点上,并返回操作点的类型 * @param direct 操作点下标 * @param x * @param y */ isOpvOnLine(x2, y2) { let weight = DDeiConfig$1.SELECTOR.OPERATE_ICON.weight; let halfWeigth = weight * 0.5; for (let i2 = 0; i2 < this.opvs.length; i2++) { let pv = this.opvs[i2]; if (DDeiAbstractShape.isInsidePolygon( [ { x: pv.x - halfWeigth, y: pv.y - halfWeigth }, { x: pv.x + halfWeigth, y: pv.y - halfWeigth }, { x: pv.x + halfWeigth, y: pv.y + halfWeigth }, { x: pv.x - halfWeigth, y: pv.y + halfWeigth } ], { x: x2, y: y2 } )) { return { type: this.opvsType[i2], index: i2 }; } } return null; } /** * 判断是否在某个操作点上 * @param direct 操作点下标 * @param x * @param y */ isOpvOn(direct, x2, y2) { if (this.opvs && this.opvs[direct]) { let pv = this.opvs[direct]; if (pv) { let width = DDeiConfig$1.SELECTOR.OPERATE_ICON.weight; let halfWidth = width * 0.5; return DDeiAbstractShape.isInsidePolygon( [ { x: pv.x - halfWidth, y: pv.y - halfWidth }, { x: pv.x + halfWidth, y: pv.y - halfWidth }, { x: pv.x + halfWidth, y: pv.y + halfWidth }, { x: pv.x - halfWidth, y: pv.y + halfWidth } ], { x: x2, y: y2 } ); } } return false; } /** * 判断图形是否在一个区域内,采用宽松的判定模式,允许传入一个大小值 * @param x * @param y * @param loose 宽松判定,默认false * @returns 是否在区域内 */ isInAreaLoose(x2 = void 0, y2 = void 0, loose = false) { var _a3, _b2, _c2; let models = null; if (((_b2 = (_a3 = this.stage) == null ? void 0 : _a3.selectedModels) == null ? void 0 : _b2.size) > 0) { models = Array.from(this.stage.selectedModels.values()); } if ((models == null ? void 0 : models.length) == 1 && ((_c2 = models[0]) == null ? void 0 : _c2.baseModelType) == "DDeiLine") { return models[0].isInAreaLoose(x2, y2, loose); } else { return super.isInAreaLoose(x2, y2, loose); } } }; __publicField2(_DDeiSelector, "ClsName", "DDeiSelector"); let DDeiSelector = _DDeiSelector; const __vite_glob_0_9$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiSelector, default: DDeiSelector }, Symbol.toStringTag, { value: "Module" })); const _DDeiTableCell = class _DDeiTableCell2 extends DDeiPolygonContainer { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "modelType", "DDeiTableCell"); __publicField2(this, "baseModelType", "DDeiTableCell"); __publicField2(this, "table"); __publicField2(this, "mergeRowNum"); __publicField2(this, "mergeColNum"); __publicField2(this, "mergedCell"); __publicField2(this, "originWidth"); __publicField2(this, "originHeight"); __publicField2(this, "row"); __publicField2(this, "col"); this.table = props.table; this.row = props.row; this.col = props.col; this.mergeRowNum = props.mergeRowNum; this.mergeColNum = props.mergeColNum; this.mergedCell = props.mergedCell; this.originWidth = props.originWidth; this.originHeight = props.originHeight; } // ============================ 方法 =============================== /** * 当前单元格是否为合并单元格 */ isMergeCell() { return this.mergeRowNum > 1 || this.mergeColNum > 1; } /** * 当前单元格是否为被合并单元格 */ isMergedCell() { return this.mergedCell != null; } /** * 设置当前单元格状态为选中 */ selectCell() { this.setState(DDeiEnumControlState.SELECTED); this.table.curRow = this.row; this.table.curCol = this.col; } /** * 选择或者取消选择当前单元格 */ selectOrCancelCell() { if (this.state == DDeiEnumControlState.SELECTED) { this.setState(DDeiEnumControlState.DEFAULT); this.table.curRow = -1; this.table.curCol = -1; } else { this.selectCell(); } } // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}) { var _a3; let container2 = new _DDeiTableCell2(json); container2.layer = tempData["currentLayer"]; container2.stage = tempData["currentStage"]; container2.pModel = tempData["currentContainer"]; if (!container2.pModel) { container2.pModel = container2.layer; } tempData[container2.id] = container2; let ddInstance = (_a3 = container2.stage) == null ? void 0 : _a3.ddInstance; let models = /* @__PURE__ */ new Map(); for (let key in json.models) { tempData["currentContainer"] = container2; let item = json.models[key]; let model = ddInstance.controlModelClasses[item.modelType].loadFromJSON(item, tempData); models.set(key, model); tempData["currentContainer"] = null; } container2.models = models; container2.initPVS(); container2.initRender(); return container2; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json, tempData = {}) { let model = new _DDeiTableCell2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; model.initPVS(); return model; } }; __publicField2(_DDeiTableCell, "ClsName", "DDeiTableCell"); let DDeiTableCell = _DDeiTableCell; const __vite_glob_0_12$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiTableCell, default: DDeiTableCell }, Symbol.toStringTag, { value: "Module" })); const _DDeiTableSelector = class _DDeiTableSelector2 extends DDeiSelector { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "modelType", "DDeiTableSelector"); __publicField2(this, "baseModelType", "DDeiSelector"); __publicField2(this, "table"); this.table = props.table; } // ============================ 方法 =============================== /** * 根据已选择的表格单元格,更新自身的大小以及位置 */ updatedBounds() { if (this.table.state == DDeiEnumControlState.DEFAULT) { this.setBounds(0, 0, 0, 0); } else { let minMax = this.table.getMinMaxRowAndCol(this.table.getSelectedCells()); if (minMax) { let rect = this.table.getCellPositionRect(minMax.minRow, minMax.minCol, minMax.maxRow, minMax.maxCol); let tableAbsPos = this.table.getAbsPosition(); this.setBounds(tableAbsPos.x + rect.x, tableAbsPos.y + rect.y, rect.width, rect.height); } else { this.setBounds(0, 0, 0, 0); } } } // ============================ 静态变量 ============================ // ============================ 静态方法 ============================ // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json, tempData = {}) { let model = new _DDeiTableSelector2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; model.initPVS(); return model; } // ============================ 方法 =============================== /** * 获取画布缩放比率 */ getStageRatio() { if (this.stage) { let stageRatio2 = parseFloat(this.stage.ratio) ? this.stage.ratio : 1; if (!stageRatio2 || isNaN(stageRatio2)) { stageRatio2 = this.stage.ddInstance.ratio; } return stageRatio2; } else { return 1; } } }; __publicField2(_DDeiTableSelector, "ClsName", "DDeiTableSelector"); let DDeiTableSelector = _DDeiTableSelector; const __vite_glob_0_13$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiTableSelector, default: DDeiTableSelector }, Symbol.toStringTag, { value: "Module" })); const _DDeiTable = class _DDeiTable2 extends DDeiAbstractShape { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "modelType", "DDeiTable"); __publicField2(this, "baseModelType", "DDeiTable"); __publicField2(this, "cols"); __publicField2(this, "rows"); __publicField2(this, "initRowNum", 5); __publicField2(this, "initColNum", 5); __publicField2(this, "curCol", -1); __publicField2(this, "curRow", -1); __publicField2(this, "selector", null); this.cols = props.cols; this.rows = props.rows; this.initRowNum = props.initRowNum ? props.initRowNum : 5; this.initColNum = props.initColNum ? props.initColNum : 5; } // ============================ 方法 =============================== /** * 初始化渲染器 */ initRender() { DDeiConfig$1.bindRender(this); this.render.init(); for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cellObj = rowObj[j2]; cellObj.stage = this.stage; cellObj.table = this; cellObj.layer = this.layer; cellObj.pModel = this; cellObj.ddInstance = this.ddInstance; cellObj.initRender(); } } this.initSelector(); } /** * 初始化表格 */ initTable() { var _a3, _b2, _c2; if (!(((_a3 = this.rows) == null ? void 0 : _a3.length) > 0 && ((_b2 = this.cols) == null ? void 0 : _b2.length) > 0)) { let initWidth = parseFloat((this.width / this.initColNum).toFixed(4)); let initHeight = parseFloat((this.height / this.initRowNum).toFixed(4)); this.rows = []; this.cols = []; for (let i2 = 0; i2 < this.initRowNum; i2++) { this.rows[i2] = []; for (let j2 = 0; j2 < this.initColNum; j2++) { if (i2 == 0) { this.cols[j2] = []; } let initJSON = DDeiUtil$1.getSubControlJSON(this.modelCode, (_c2 = this.stage) == null ? void 0 : _c2.ddInstance); initJSON.id = this.id + "_c_" + i2 + "_" + j2; let x2 = (j2 + 0.5) * initWidth; let y2 = (i2 + 0.5) * initHeight; initJSON.row = i2; initJSON.col = j2; initJSON.width = initWidth; initJSON.height = initHeight; initJSON.table = this; this.rows[i2][j2] = DDeiTableCell.initByJSON(initJSON, { currentStage: this.stage }); this.rows[i2][j2].cpv.x += this.x + x2; this.rows[i2][j2].cpv.y += this.y + y2; this.rows[i2][j2].pvs.forEach((pv) => { pv.x += this.x + x2; pv.y += this.y + y2; }); this.rows[i2][j2].calLoosePVS(); this.cols[j2][i2] = this.rows[i2][j2]; } } } } /** * 初始化选择器 */ initSelector() { if (!this.selector) { this.selector = DDeiTableSelector.initByJSON({ id: this.id + "_table_selector", border: DDeiConfig$1.TABLE.selector.border, fill: { default: {}, selected: {} }, table: this }); this.selector.stage = this.stage; DDeiConfig$1.bindRender(this.selector); this.selector.initRender(); this.selector.resetState(); } } /** * 清除所有选中的单元格,并将curRow和curCol归位 */ clearSelectionCells() { for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cellObj = rowObj[j2]; cellObj.setState(DDeiEnumControlState.DEFAULT); } } this.curRow = -1; this.curCol = -1; } //重设所有单元格的行列关系,以及对应的坐标、向量等 resetCellData() { let tmpY = 0; for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; let tmpX = 0; for (let j2 = 0; j2 < rowObj.length; j2++) { let cellObj = rowObj[j2]; cellObj.row = i2; cellObj.col = j2; cellObj.setPosition(tmpX, tmpY); if (cellObj.mergedCell != null || cellObj.mergeRowNum > 1 || cellObj.mergeColNum > 1) { tmpX = tmpX + cellObj.originWidth; } else { tmpX = tmpX + cellObj.width; } if (j2 == rowObj.length - 1) { if (cellObj.mergedCell != null || cellObj.mergeRowNum > 1 || cellObj.mergeColNum > 1) { tmpY = tmpY + cellObj.originHeight; } else { tmpY = tmpY + cellObj.height; } } } } } /** * 获取子模型 */ getSubModels(ignoreModelIds, level = 1) { let models = []; for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let subModels = rowObj[j2].getSubModels(ignoreModelIds, level - 1); models = models.concat(subModels); } } return models; } /** * 设置表格大小 * @param w * @param h */ setSize(w, h) { if (this.width && this.height) { let wR = w / this.width; let hR = h / this.height; for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cellObj = rowObj[j2]; cellObj.setBounds(cellObj.x * wR, cellObj.y * hR, cellObj.width * wR, cellObj.height * hR); cellObj.originWidth = cellObj.originWidth * wR; cellObj.originHeight = cellObj.originHeight * hR; } } } super.setSize(w, h); } /** * 在第row行(下标)之下插入一个新行,插入的行的大小等于row的大小 * 插入后会重新维护所有行列关系 * 插入后会维护合并单元格关系 * 插入行后会往下增加表格的总高度,使表格高度=SUM(行高) * @param row 行数 * @param direction 1向上,2向下 */ insertRow(row, direction) { var _a3; let firstInsert = false; if (row < 0) { row = 0; firstInsert = true; } else if (row > this.rows.length - 1) { row = this.rows.length - 1; } let currentRow = this.rows[row]; let newRow = []; let corssMergeCell = []; let addHeight = 0; for (let i2 = 0; i2 < currentRow.length; i2++) { let oldCell = currentRow[i2]; let newWidth = 0; let newHeight = 0; if (oldCell.mergeRowNum > 1 || oldCell.mergeColNum > 1 || oldCell.mergedCell) { newWidth = oldCell.originWidth; newHeight = oldCell.originHeight; } else { newWidth = oldCell.width; newHeight = oldCell.height; } let initJSON = DDeiUtil$1.getSubControlJSON(this.modelCode, (_a3 = this.stage) == null ? void 0 : _a3.ddInstance); initJSON.width = newWidth; initJSON.height = newHeight; initJSON.table = this; let newCell = DDeiTableCell.initByJSON(initJSON, { currentStage: this.stage }); newCell.cpv.x += x; newCell.cpv.y += y; newCell.pvs.forEach((pv) => { pv.x += x; pv.y += y; }); newCell.calLoosePVS(); newCell.layer = this.layer; newCell.stage = this.stage; newCell.pModel = this; newCell.initRender(); newRow[i2] = newCell; if (i2 == 0) { addHeight = newCell.height; } let mCell = null; if (!firstInsert && (oldCell.mergeRowNum > 1 || oldCell.mergeColNum > 1 || oldCell.mergedCell)) { if (oldCell.mergeRowNum > 1 || oldCell.mergeColNum > 1) { mCell = oldCell; } else if (oldCell.mergedCell) { mCell = this.rows[oldCell.mergedCell.row][oldCell.mergedCell.col]; } newCell.mergedCell = mCell; if (corssMergeCell.indexOf(mCell) == -1) { corssMergeCell[corssMergeCell.length] = mCell; mCell.mergeRowNum = mCell.mergeRowNum + 1; mCell.setSize(void 0, parseFloat(mCell.height) + parseFloat(newCell.height)); } newCell.originWidth = newCell.width; newCell.originHeight = newCell.height; newCell.height = 0; newCell.width = 0; } } this.height = this.height + addHeight; this.setModelChanged(); for (let i2 = 0; i2 < this.cols.length; i2++) { let currentCol = this.cols[i2]; if (firstInsert) { currentCol.splice(0, 0, newRow[i2]); } else { currentCol.splice(row + 1, 0, newRow[i2]); } } if (firstInsert) { this.rows.splice(0, 0, newRow); } else { this.rows.splice(row + 1, 0, newRow); } this.resetCellData(); window.globalTableCopyData = null; window.globalTableCutData = null; if (this.copyAreaShape) { this.copyAreaShape.style.display = "none"; } this.clearSelectionCells(); if (firstInsert) { if (direction == 1) { this.curRow = 0; } else { this.curRow = 1; } } else { this.curRow = row + 1; } this.setState(DDeiEnumControlState.SELECTED); for (let i2 = 0; i2 < this.cols.length; i2++) { this.cols[i2][this.curRow].setState(DDeiEnumControlState.SELECTED); } this.changeChildrenBounds(); } /** * 修改自身状态 */ setState(state) { super.setState(state); if (this.state == DDeiEnumControlState.DEFAULT) { this.selector.resetState(); } } /** * 计算单元格的点旋转后的坐标 * @param rotateMatrix 旋转矩阵 */ calCellsRotatePointVectors(rotateMatrix) { var _a3; let looseWeight = 10; let parentCenterPointVector = this.centerPointVector; if (parentCenterPointVector) { for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let item = rowObj[j2]; let halfWidth = item.width * 0.5; let halfHeight = item.height * 0.5; let vc, vc1, vc2, vc3, vc4; let loosePointVectors = null; if (((_a3 = item.pointVectors) == null ? void 0 : _a3.length) > 0) { vc = item.centerPointVector; vc1 = item.pointVectors[0]; vc2 = item.pointVectors[1]; vc3 = item.pointVectors[2]; vc4 = item.pointVectors[3]; loosePointVectors = item.loosePointVectors; } else { item.pointVectors = []; let absBoundsOrigin = item.getAbsBounds(); vc = new Vector3(absBoundsOrigin.x + halfWidth, absBoundsOrigin.y + halfHeight, 1); vc1 = new Vector3(vc.x - halfWidth, vc.y - halfHeight, 1); vc2 = new Vector3(vc.x + halfWidth, vc.y - halfHeight, 1); vc3 = new Vector3(vc.x + halfWidth, vc.y + halfHeight, 1); vc4 = new Vector3(vc.x - halfWidth, vc.y + halfHeight, 1); item.pointVectors.push(vc1); item.pointVectors.push(vc2); item.pointVectors.push(vc3); item.pointVectors.push(vc4); item.centerPointVector = vc; let stageRatio2 = item.getStageRatio(); let globalScaleMatrix = new Matrix3( stageRatio2, 0, 0, 0, stageRatio2, 0, 0, 0, 1 ); item.centerPointVector.applyMatrix3(globalScaleMatrix); item.pointVectors.forEach((pv) => { pv.applyMatrix3(globalScaleMatrix); }); loosePointVectors = []; loosePointVectors.push(new Vector3(vc1.x - looseWeight, vc1.y - looseWeight, vc1.z)); loosePointVectors.push(new Vector3(vc2.x + looseWeight, vc2.y - looseWeight, vc2.z)); loosePointVectors.push(new Vector3(vc3.x + looseWeight, vc3.y + looseWeight, vc3.z)); loosePointVectors.push(new Vector3(vc4.x - looseWeight, vc4.y + looseWeight, vc4.z)); item.loosePointVectors = loosePointVectors; } vc1.applyMatrix3(rotateMatrix); vc2.applyMatrix3(rotateMatrix); vc3.applyMatrix3(rotateMatrix); vc4.applyMatrix3(rotateMatrix); vc.applyMatrix3(rotateMatrix); loosePointVectors == null ? void 0 : loosePointVectors.forEach((pv) => { pv.applyMatrix3(rotateMatrix); }); item.calChildrenRotatePointVectors(rotateMatrix); } } } } /** * 修改上层模型大小 */ changeParentsBounds() { if (this.pModel) { this.pModel.changeParentsBounds(); } return true; } /** * 修改子元素大小 */ changeChildrenBounds(originRect, newRect) { var _a3; for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cell = rowObj[j2]; (_a3 = cell == null ? void 0 : cell.layoutManager) == null ? void 0 : _a3.changeSubModelBounds(); } } return true; } /** * 在第col列(下标)之下插入一个新列,插入的列的大小等于col的大小 * 插入后会重新维护所有行列关系 * 插入后会维护合并单元格关系 * 插入行后会往下增加表格的总高度,使表格高度=SUM(行高) * @param col * @param direction 1左边,2右边 */ insertCol(col, direction) { var _a3; let firstInsert = false; if (col < 0) { col = 0; firstInsert = true; } else if (col > this.cols.length - 1) { col = this.cols.length - 1; } let currentCol = this.cols[col]; let newCol = []; let corssMergeCell = []; let addWidth = 0; for (let i2 = 0; i2 < currentCol.length; i2++) { let oldCell = currentCol[i2]; let newWidth = 0; let newHeight = 0; if (oldCell.mergeRowNum > 1 || oldCell.mergeColNum > 1 || oldCell.mergedCell) { newWidth = oldCell.originWidth; newHeight = oldCell.originHeight; } else { newWidth = oldCell.width; newHeight = oldCell.height; } let initJSON = DDeiUtil$1.getSubControlJSON(this.modelCode, (_a3 = this.stage) == null ? void 0 : _a3.ddInstance); initJSON.width = newWidth; initJSON.height = newHeight; initJSON.table = this; let newCell = DDeiTableCell.initByJSON(initJSON); newCell.layer = this.layer; newCell.stage = this.stage; newCell.pModel = this; newCell.initRender(); newCol[i2] = newCell; if (i2 == 0) { addWidth = newCell.width; } let mCell = null; if (!firstInsert && (oldCell.mergeRowNum > 1 || oldCell.mergeColNum > 1 || oldCell.mergedCell)) { if (oldCell.mergeRowNum > 1 || oldCell.mergeColNum > 1) { mCell = oldCell; } else if (oldCell.mergedCell) { mCell = this.rows[oldCell.mergedCell.row][oldCell.mergedCell.col]; } newCell.mergedCell = mCell; if (corssMergeCell.indexOf(mCell) == -1) { corssMergeCell[corssMergeCell.length] = mCell; mCell.mergeColNum = mCell.mergeColNum + 1; mCell == null ? void 0 : mCell.setSize(parseFloat(mCell.width) + parseFloat(newCell.width)); } newCell.originWidth = newCell.width; newCell.originHeight = newCell.height; newCell.height = 0; newCell.width = 0; } } this.width = this.width + addWidth; this.setModelChanged(); for (let i2 = 0; i2 < this.rows.length; i2++) { let currentRow = this.rows[i2]; if (firstInsert) { currentRow.splice(0, 0, newCol[i2]); } else { currentRow.splice(col + 1, 0, newCol[i2]); } } if (firstInsert) { this.cols.splice(0, 0, newCol); } else { this.cols.splice(col + 1, 0, newCol); } this.resetCellData(); window.globalTableCopyData = null; window.globalTableCutData = null; if (this.copyAreaShape) { this.copyAreaShape.style.display = "none"; } this.clearSelectionCells(); if (firstInsert) { if (direction == 1) { this.curCol = 0; } else { this.curCol = 1; } } else { this.curCol = col + 1; } this.setState(DDeiEnumControlState.SELECTED); for (let i2 = 0; i2 < this.rows.length; i2++) { this.rows[i2][this.curCol].setState(DDeiEnumControlState.SELECTED); } this.changeChildrenBounds(); } /** * 删除行 * @param row */ removeRow(row) { if (this.rows.length <= 1) { return; } let firstRemove = false; if (row < 0) { row = 0; firstRemove = true; } else if (row > this.rows.length - 1) { row = this.rows.length - 1; } let removeCells = null; if (firstRemove) { removeCells = this.rows[0]; } else { removeCells = this.rows[row]; } let removeHeight = 0; let corssMergeCell = []; for (let x2 = 0; x2 < removeCells.length; x2++) { let removeCell = removeCells[x2]; removeHeight = removeCell.height; let mCell = null; if (removeCell.mergeRowNum == 1) ; else if (removeCell.mergeRowNum > 1 || removeCell.mergeColNum > 1) { mCell = this.rows[removeCell.row + 1][x2]; mCell.setSize(removeCell.width, removeCell.height); mCell.mergeRowNum = removeCell.mergeRowNum; mCell.mergeColNum = removeCell.mergeColNum; for (let i2 = mCell.row; i2 < mCell.row + removeCell.mergeRowNum - 1; i2++) { for (let j2 = mCell.col; j2 < mCell.col + mCell.mergeColNum; j2++) { this.rows[i2][j2].mergedCell = mCell; } } removeHeight = removeCell.originHeight; } else if (removeCell.mergedCell != null) { mCell = removeCell.mergedCell; removeHeight = removeCell.originHeight; } if (mCell != null) { if (corssMergeCell.indexOf(mCell) == -1) { corssMergeCell[corssMergeCell.length] = mCell; mCell.mergeRowNum = mCell.mergeRowNum - 1; mCell.setSize(mCell.width, parseInt(mCell.height) - removeHeight); } } } if (firstRemove) { this.rows.splice(0, 1); } else { this.rows.splice(row, 1); } this.height = this.height - removeHeight; this.setModelChanged(); for (let i2 = 0; i2 < this.cols.length; i2++) { let currentCol = this.cols[i2]; if (firstRemove) { currentCol.splice(0, 1); } else { currentCol.splice(row, 1); } } if (row < 0) { this.curRow = 0; } else if (row > this.rows.length - 1) { this.curRow = this.rows.length - 1; } else { this.curRow = row; } this.resetCellData(); } /** * 删除列 * @param col */ removeCol(col) { if (this.cols.length <= 1) { return; } let firstRemove = false; if (col < 0) { col = 0; firstRemove = true; } else if (col > this.cols.length - 1) { col = this.cols.length - 1; } let removeCells = null; if (firstRemove) { removeCells = this.cols[0]; } else { removeCells = this.cols[col]; } let removeWidth = 0; let corssMergeCell = []; for (let x2 = 0; x2 < removeCells.length; x2++) { let removeCell = removeCells[x2]; removeWidth = removeCell.width; let mCell = null; if (removeCell.mergeColNum == 1) ; else if (removeCell.mergeColNum > 1 || removeCell.mergeRowNum > 1) { mCell = this.rows[x2][removeCell.col + 1]; mCell.setSize(removeCell.width, removeCell.height); mCell.mergeRowNum = removeCell.mergeRowNum; mCell.mergeColNum = removeCell.mergeColNum; for (let i2 = mCell.col; i2 < mCell.col + removeCell.mergeColNum - 1; i2++) { for (let j2 = mCell.row; j2 < mCell.row + mCell.mergeRowNum; j2++) { this.rows[j2][i2].mergedCell = mCell; } } removeWidth = removeCell.originWidth; } else if (removeCell.mergedCell != null) { mCell = removeCell.mergedCell; removeWidth = removeCell.originWidth; } if (mCell != null) { if (corssMergeCell.indexOf(mCell) == -1) { corssMergeCell[corssMergeCell.length] = mCell; mCell.mergeColNum = mCell.mergeColNum - 1; mCell.setSize(parseInt(mCell.width) - removeWidth, mCell.height); } } } this.width = this.width - removeWidth; this.setModelChanged(); if (firstRemove) { this.cols.splice(0, 1); } else { this.cols.splice(col, 1); } for (let i2 = 0; i2 < this.rows.length; i2++) { let currentRow = this.rows[i2]; if (firstRemove) { currentRow.splice(0, 1); } else { currentRow.splice(col, 1); } } if (col < 0) { this.curCol = 0; } else if (col > this.cols.length - 1) { this.curCol = this.cols.length - 1; } else { this.curCol = col; } this.resetCellData(); } // 取得区域内的所有单元格 getCellsByRect(minRow, minCol, maxRow, maxCol) { let returnCells = []; for (let i2 = minRow; i2 <= maxRow; i2++) { for (let j2 = minCol; j2 <= maxCol; j2++) { returnCells[returnCells.length] = this.rows[i2][j2]; } } return returnCells; } /** * 合并选中的单元格 */ mergeSelectedCells() { let selectedCells = this.getSelectedCells(); this.cancelMergeCells(selectedCells); selectedCells = this.getSelectedCells(); this.mergeCells(selectedCells); } /** * 合并的单元格 */ mergeCells(selectedCells) { var _a3, _b2, _c2; let minMaxRowCol = this.getMinMaxRowAndCol(selectedCells); let firstCell = this.rows[minMaxRowCol.minRow][minMaxRowCol.minCol]; let mergeHeight = 0; for (let i2 = minMaxRowCol.minRow; i2 <= minMaxRowCol.maxRow; i2++) { mergeHeight = mergeHeight + this.rows[i2][minMaxRowCol.minCol].height; } let mergeWidth = 0; for (let j2 = minMaxRowCol.minCol; j2 <= minMaxRowCol.maxCol; j2++) { mergeWidth = mergeWidth + this.rows[minMaxRowCol.minRow][j2].width; } firstCell.originWidth = firstCell.width; firstCell.originHeight = firstCell.height; for (let i2 = minMaxRowCol.minRow; i2 <= minMaxRowCol.maxRow; i2++) { for (let j2 = minMaxRowCol.minCol; j2 <= minMaxRowCol.maxCol; j2++) { this.rows[i2][j2].originWidth = this.rows[i2][j2].width; this.rows[i2][j2].originHeight = this.rows[i2][j2].height; this.rows[i2][j2].setSize(0, 0); this.rows[i2][j2].mergedCell = firstCell; if ((!firstCell.text || firstCell.text.trim() == "") && firstCell.midList.length == 0) { if (this.rows[i2][j2].midList.length > 0) { (_c2 = (_b2 = (_a3 = this.stage) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.bus) == null ? void 0 : _c2.push(DDeiEnumBusCommandType.ModelChangeContainer, { oldContainer: this.rows[i2][j2], newContainer: firstCell, models: Array.from(this.rows[i2][j2].models.values()) }, { offsetX: 0, offsetY: 0 }); } else if (this.rows[i2][j2].text && this.rows[i2][j2].text.trim() != "") { firstCell.text = this.rows[i2][j2].text; this.rows[i2][j2].text = ""; } } this.rows[i2][j2].setState(DDeiEnumControlState.DEFAULT); } } firstCell.mergeRowNum = minMaxRowCol.maxRow - minMaxRowCol.minRow + 1; firstCell.mergeColNum = minMaxRowCol.maxCol - minMaxRowCol.minCol + 1; firstCell.setSize(mergeWidth, mergeHeight); firstCell.setState(DDeiEnumControlState.SELECTED); this.curRow = firstCell.row; this.curCol = firstCell.col; this.changeChildrenBounds(); } /** * 将当前选中的单元格取消合并 */ cancelSelectedMergeCells() { let selectedCells = this.getSelectedCells(); this.cancelMergeCells(selectedCells); } /** * 取得区域的开始和结束坐标 */ getCellPositionRect(startRow, startCol, endRow, endCol) { let x2 = 0, y2 = 0, width = 0, height = 0; x2 = this.rows[startRow][startCol].x; y2 = this.rows[startRow][startCol].y; for (let i2 = startRow; i2 <= endRow; i2++) { let rowWidth = 0; for (let j2 = startCol; j2 <= endCol; j2++) { rowWidth = rowWidth + this.rows[i2][j2].width; } if (rowWidth > width) { width = rowWidth; } } for (let i2 = startCol; i2 <= endCol; i2++) { let colHeight = 0; for (let j2 = startRow; j2 <= endRow; j2++) { colHeight = colHeight + this.cols[i2][j2].height; } if (colHeight > height) { height = colHeight; } } return { x: x2, y: y2, width, height }; } /** * 取消合并传入的单元格 */ cancelMergeCells(cells) { if (cells != null) { for (let c = 0; c < cells.length; c++) { let firstCell = cells[c]; for (let i2 = firstCell.row; i2 < firstCell.row + firstCell.mergeRowNum; i2++) { for (let j2 = firstCell.col; j2 < firstCell.col + firstCell.mergeColNum; j2++) { let cel = this.rows[i2][j2]; cel.setSize(cel.originWidth, cel.originHeight); cel.originWidth = null; cel.originHeight = null; cel.mergedCell = null; cel.setState(DDeiEnumControlState.SELECTED); } } firstCell.mergeRowNum = null; firstCell.mergeColNum = null; this.curRow = firstCell.row; this.curCol = firstCell.col; } this.changeChildrenBounds(); } } /** * 根据表格内坐标获取单元格 */ getCellByTablePosition(x2, y2) { for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cell = rowObj[j2]; if (cell.width <= 0 || cell.height <= 0) { continue; } if (cell.isInAreaLoose(x2, y2)) { return cell; } } } return null; } // 返回当前表格所有选中的单元格,ignoreMerged默认为false,不忽略 getSelectedCells() { let arr = []; for (let i2 = 0; i2 < this.rows.length; i2++) { for (let j2 = 0; j2 < this.rows[i2].length; j2++) { if (this.rows[i2][j2].state == DDeiEnumControlState.SELECTED) { arr[arr.length] = this.rows[i2][j2]; } } } return arr; } /** * 根据ID获取模型 * @param id 模型id */ getModelById(id) { for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cell = rowObj[j2]; let returnModel = cell.getModelById(id); if (returnModel) { return returnModel; } } } } /** * 获取实际的内部容器控件 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainer() { return this; } /** * 获取实际的内部容器控件 * @param x 相对路径坐标 * @param y 相对路径坐标 * @return 容器控件根据布局的模式不同返回不同的内部控件,普通控件返回null */ getAccuContainerByPos(x2, y2) { for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cell = rowObj[j2]; if (cell.width <= 0 || cell.height <= 0) { continue; } if (cell.isInAreaLoose(x2, y2)) { return cell; } } } return null; } // 判断两个区域是否有重合 isOverlap(rect1, rect2) { let l1 = { x: rect1.minCol, y: rect1.minRow }; let r1 = { x: rect1.maxCol, y: rect1.maxRow }; let l2 = { x: rect2.minCol, y: rect2.minRow }; let r2 = { x: rect2.maxCol, y: rect2.maxRow }; if (l1.x > r2.x || l2.x > r1.x || l1.y > r2.y || l2.y > r1.y) return false; return true; } // 判断区域内是否存在合并单元格或被合并单元格 hasMergeCell(minRow, minCol, maxRow, maxCol) { for (let i2 = minRow; i2 <= maxRow && i2 <= this.rows.length - 1; i2++) { for (let j2 = minCol; j2 <= maxCol && j2 <= this.cols.length - 1; j2++) { if (this.rows[i2][j2].isMergeCell() || this.rows[i2][j2].isMergedCell()) { return true; } } } return false; } /** * 获取单元格的最大外接矩形区域 * @arr 单元格 */ getMinMaxRowAndCol(arr) { let minCol = -1, maxCol = -1, minRow = -1, maxRow = -1; for (let i2 = 0; i2 < arr.length; i2++) { if (i2 == 0) { minRow = arr[i2].row; minCol = arr[i2].col; maxRow = arr[i2].row; maxCol = arr[i2].col; if (arr[i2].mergeRowNum > 1 || arr[i2].mergeColNum > 1) { maxRow = arr[i2].row + arr[i2].mergeRowNum - 1; maxCol = arr[i2].col + arr[i2].mergeColNum - 1; } } else { if (minRow > arr[i2].row) { minRow = arr[i2].row; } if (minCol > arr[i2].col) { minCol = arr[i2].col; } if (arr[i2].mergeRowNum > 1 || arr[i2].mergeColNum > 1) { let r1 = arr[i2].row + arr[i2].mergeRowNum - 1; let c1 = arr[i2].col + arr[i2].mergeColNum - 1; if (maxRow < r1) { maxRow = r1; } if (maxCol < c1) { maxCol = c1; } } else { if (maxRow < arr[i2].row) { maxRow = arr[i2].row; } if (maxCol < arr[i2].col) { maxCol = arr[i2].col; } } } } if (minRow != -1 && maxRow != -1 && minCol != -1 && maxCol != -1) { for (let i2 = minRow; i2 <= maxRow; i2++) { for (let j2 = minCol; j2 <= maxCol; j2++) { if (this.rows[i2][j2].mergeRowNum > 1 || this.rows[i2][j2].mergeColNum > 1) { if (this.rows[i2][j2].row + this.rows[i2][j2].mergeRowNum - 1 > maxRow || this.rows[i2][j2].col + this.rows[i2][j2].mergeColNum - 1 > maxCol) { arr[arr.length] = this.rows[i2][j2]; return this.getMinMaxRowAndCol(arr); } } else if (this.rows[i2][j2].mergedCell != null) { let mCell = this.rows[this.rows[i2][j2].mergedCell.row][this.rows[i2][j2].mergedCell.col]; if (mCell.row + mCell.mergeRowNum - 1 > maxRow || mCell.col + mCell.mergeColNum - 1 > maxCol || mCell.col < minCol || mCell.row < minRow) { arr[arr.length] = mCell; return this.getMinMaxRowAndCol(arr); } } } } } if (minCol != -1 && maxCol != -1 && minRow != -1 && maxRow != -1) { return { minCol, maxCol, minRow, maxRow }; } return null; } /** * 判断指定区域内的所有单元格是否都被选中 * @param r 行 * @param c 列 * @param r1 行1 * @param c1 列1 * @returns true都选中,false都没选中 */ isAllSelected(r, c, r1, c1) { let returnData = true; let minCol = c > c1 ? c1 : c; let maxCol = c > c1 ? c : c1; let minRow = r > r1 ? r1 : r; let maxRow = r > r1 ? r : r1; for (let i2 = minRow; i2 <= maxRow; i2++) { for (let j2 = minCol; j2 <= maxCol; j2++) { if (this.rows[i2][j2].mergedCell != null) { continue; } if (this.rows[i2][j2].state != DDeiEnumControlState.SELECTED) { return false; } } } return returnData; } /** * 从上边调整表格的大小 * 该方法在拖拽过程中调用,会处理由拖拽引起的合并单元格的变动 */ changeTableSizeToTop(x2, y2) { let table2 = this; let dragObj = table2.stage.render.dragObj; let changeHeight = dragObj.y - y2; dragObj.y = dragObj.y - changeHeight; if (changeHeight != 0) { let processedCells = []; for (let i2 = 0; i2 < table2.cols.length; i2++) { let afterCell = table2.cols[i2][0]; if (afterCell.height != 0 && afterCell.height + changeHeight < 5 || afterCell.originHeight != null && afterCell.originHeight + changeHeight < 5) { return; } } for (let i2 = 0; i2 < table2.cols.length; i2++) { let rowObj = table2.cols[i2]; let afterCell = table2.cols[i2][0]; if (processedCells.indexOf(afterCell) == -1) { if (!afterCell.isMergedCell() && !afterCell.isMergeCell()) { afterCell.setSize(void 0, afterCell.height + changeHeight); processedCells[processedCells.length] = afterCell; } else if (afterCell.isMergeCell()) { let mCell = afterCell; mCell.originHeight = mCell.originHeight + changeHeight; mCell.setSize(void 0, mCell.height + changeHeight); processedCells[processedCells.length] = mCell; } else if (afterCell.isMergedCell()) { afterCell.originHeight = afterCell.originHeight + changeHeight; processedCells[processedCells.length] = afterCell; } } for (let j2 = 1; j2 < rowObj.length; j2++) { rowObj[j2].setPosition(void 0, rowObj[j2].y + changeHeight); } } table2.height = table2.height + changeHeight; table2.setPosition(void 0, table2.y - changeHeight); this.updateCopyShapeArea(); this.changeChildrenBounds(); } } /** * 从下边调整表格的大小 * 该方法在拖拽过程中调用,会处理由拖拽引起的合并单元格的变动 */ changeTableSizeToBottom(x2, y2) { let table2 = this; let dragObj = table2.stage.render.dragObj; let changeHeight = y2 - dragObj.y; dragObj.y = dragObj.y + changeHeight; if (changeHeight != 0) { let processedCells = []; for (let i2 = 0; i2 < table2.cols.length; i2++) { let beforeCell = table2.cols[i2][table2.rows.length - 1]; if (beforeCell.height != 0 && beforeCell.height + changeHeight < 5 || beforeCell.originHeight != null && beforeCell.originHeight + changeHeight < 5) { return; } } for (let i2 = 0; i2 < table2.cols.length; i2++) { let beforeCell = table2.cols[i2][table2.rows.length - 1]; if (processedCells.indexOf(beforeCell) == -1) { if (!beforeCell.isMergedCell() && !beforeCell.isMergeCell()) { beforeCell.setSize(void 0, beforeCell.height + changeHeight); processedCells[processedCells.length] = beforeCell; } else if (beforeCell.isMergeCell()) { beforeCell.originHeight = beforeCell.originHeight + changeHeight; beforeCell.setSize(void 0, beforeCell.height + changeHeight); processedCells[processedCells.length] = beforeCell; } else if (beforeCell.isMergedCell()) { let mCell = beforeCell.mergedCell; beforeCell.originHeight = beforeCell.originHeight + changeHeight; if (processedCells.indexOf(mCell) == -1) { processedCells[processedCells.length] = mCell; mCell.setSize(void 0, mCell.height + changeHeight); } processedCells[processedCells.length] = beforeCell; } } } table2.height = table2.height + changeHeight; table2.setModelChanged(); this.updateCopyShapeArea(); this.changeChildrenBounds(); } } /** * 从左边调整表格的大小 * 该方法在拖拽过程中调用,会处理由拖拽引起的合并单元格的变动 */ changeTableSizeToLeft(x2, y2) { let table2 = this; let dragObj = table2.stage.render.dragObj; let changeWidth = dragObj.x - x2; dragObj.x = dragObj.x - changeWidth; if (changeWidth != 0) { let processedCells = []; for (let i2 = 0; i2 < table2.rows.length; i2++) { let afterCell = table2.rows[i2][0]; if (afterCell.width != 0 && afterCell.width + changeWidth < 5 || afterCell.originWidth != null && afterCell.originWidth + changeWidth < 5) { return; } } for (let i2 = 0; i2 < table2.rows.length; i2++) { let rowObj = table2.rows[i2]; let afterCell = table2.rows[i2][0]; if (processedCells.indexOf(afterCell) == -1) { if (!afterCell.isMergedCell() && !afterCell.isMergeCell()) { afterCell.setSize(afterCell.width + changeWidth); processedCells[processedCells.length] = afterCell; } else if (afterCell.isMergeCell()) { let mCell = afterCell; mCell.originWidth = mCell.originWidth + changeWidth; mCell.setSize(mCell.width + changeWidth); processedCells[processedCells.length] = mCell; } else if (afterCell.isMergedCell()) { afterCell.originWidth = afterCell.originWidth + changeWidth; processedCells[processedCells.length] = afterCell; } } for (let j2 = 1; j2 < rowObj.length; j2++) { rowObj[j2].setPosition(rowObj[j2].x + changeWidth); } } table2.width = table2.width + changeWidth; table2.setPosition(table2.x - changeWidth); this.updateCopyShapeArea(); this.changeChildrenBounds(); } } /** * 从右边调整表格的大小 * 该方法在拖拽过程中调用,会处理由拖拽引起的合并单元格的变动 */ changeTableSizeToRight(x2, y2) { let table2 = this; let dragObj = table2.stage.render.dragObj; let changeWidth = x2 - dragObj.x; dragObj.x = dragObj.x + changeWidth; if (changeWidth != 0) { let processedCells = []; for (let i2 = 0; i2 < table2.rows.length; i2++) { let beforeCell = table2.rows[i2][table2.cols.length - 1]; if (beforeCell.width != 0 && beforeCell.width + changeWidth < 5 || beforeCell.originWidth != null && beforeCell.originWidth + changeWidth < 5) { return; } } for (let i2 = 0; i2 < table2.rows.length; i2++) { let beforeCell = table2.rows[i2][table2.cols.length - 1]; if (processedCells.indexOf(beforeCell) == -1) { if (!beforeCell.isMergedCell() && !beforeCell.isMergeCell()) { beforeCell.setSize(beforeCell.width + changeWidth); processedCells[processedCells.length] = beforeCell; } else if (beforeCell.isMergeCell()) { beforeCell.originWidth = beforeCell.originWidth + changeWidth; beforeCell.setSize(beforeCell.width + changeWidth); processedCells[processedCells.length] = beforeCell; } else if (beforeCell.isMergedCell()) { let mCell = beforeCell.mergedCell; beforeCell.originWidth = beforeCell.originWidth + changeWidth; if (processedCells.indexOf(mCell) == -1) { processedCells[processedCells.length] = mCell; mCell.setSize(mCell.width + changeWidth); } processedCells[processedCells.length] = beforeCell; } } } table2.width = table2.width + changeWidth; table2.setModelChanged(); this.updateCopyShapeArea(); this.changeChildrenBounds(); } } /** * 拖拽行大小 * 该方法在拖拽过程中调用,会处理由拖拽引起的合并单元格的变动 */ dragRow(x2, y2) { let cell = this.dragCell; let table2 = this; if (cell.row >= table2.rows.length - 1) { return; } for (let i2 = 0; i2 < table2.rows.length; i2++) { if (table2.cols[cell.col][i2].specilCol) { this.specilDrag = true; for (let j2 = 0; j2 < table2.rows.length; j2++) { if (!table2.cols[cell.col][j2].specilCol) { table2.cols[cell.col][j2].specilCol = true; } } break; } } let dragObj = table2.stage.render.dragObj; let changeHeight = y2 - dragObj.y; dragObj.y = dragObj.y + changeHeight; if (changeHeight != 0) { if (this.specilDrag) { let pass = false; for (let i2 = 0; i2 < table2.rows.length; i2++) { if (table2.cols[cell.col][i2].isMergedCell() || table2.cols[cell.col][i2].isMergeCell()) { pass = true; break; } } if (cell.height != 0 && cell.height + changeHeight < 5 || table2.cols[cell.col][cell.row + 1].height != 0 && table2.cols[cell.col][cell.row + 1].height - changeHeight < 5) { pass = true; } if (!pass) { cell.setSize(void 0, cell.height + changeHeight); table2.cols[cell.col][cell.row + 1].setSize(void 0, table2.cols[cell.col][cell.row + 1].height - changeHeight); table2.cols[cell.col][cell.row + 1].setPosition(void 0, table2.cols[cell.col][cell.row + 1].y + changeHeight); for (let i2 = 0; i2 < table2.rows.length; i2++) { table2.cols[cell.col][i2].specilCol = true; } return; } } let processedCells = []; for (let i2 = 0; i2 < table2.cols.length; i2++) { let beforeCell = table2.cols[i2][cell.row]; let afterCell = table2.cols[i2][cell.row + 1]; if (!beforeCell.specilCol && (beforeCell.height != 0 && beforeCell.height + changeHeight < 5 || beforeCell.originHeight != null && beforeCell.originHeight + changeHeight < 5)) { return; } if (!afterCell.specilCol && (afterCell.height != 0 && afterCell.height - changeHeight < 5 || afterCell.originHeight != null && afterCell.originHeight - changeHeight < 5)) { return; } } for (let i2 = 0; i2 < table2.cols.length; i2++) { let beforeCell = table2.cols[i2][cell.row]; if (processedCells.indexOf(beforeCell) == -1 && !beforeCell.specilCol) { if (!beforeCell.isMergedCell() && !beforeCell.isMergeCell()) { beforeCell.setSize(void 0, beforeCell.height + changeHeight); processedCells[processedCells.length] = beforeCell; } else if (beforeCell.isMergeCell()) { let mCell = beforeCell; if (mCell.mergeRowNum == 1) { beforeCell.originHeight = beforeCell.originHeight + changeHeight; beforeCell.setSize(void 0, beforeCell.height + changeHeight); processedCells[processedCells.length] = beforeCell; } else { beforeCell.originHeight = beforeCell.originHeight + changeHeight; processedCells[processedCells.length] = beforeCell; } } else if (beforeCell.isMergedCell()) { let mCell = beforeCell.mergedCell; if (mCell.row + mCell.mergeRowNum - 1 == beforeCell.row) { beforeCell.originHeight = beforeCell.originHeight + changeHeight; if (processedCells.indexOf(mCell) == -1) { processedCells[processedCells.length] = mCell; mCell.setSize(void 0, mCell.height + changeHeight); } processedCells[processedCells.length] = beforeCell; } else { beforeCell.originHeight = beforeCell.originHeight + changeHeight; processedCells[processedCells.length] = beforeCell; } } } let afterCell = table2.cols[i2][cell.row + 1]; if (processedCells.indexOf(afterCell) == -1 && !afterCell.specilCol) { if (!afterCell.isMergedCell() && !afterCell.isMergeCell()) { afterCell.setSize(void 0, afterCell.height - changeHeight); afterCell.setPosition(void 0, afterCell.y + changeHeight); processedCells[processedCells.length] = afterCell; } else if (afterCell.isMergeCell()) { let mCell = afterCell; mCell.originHeight = mCell.originHeight - changeHeight; mCell.setSize(void 0, mCell.height - changeHeight); mCell.setPosition(void 0, mCell.y + changeHeight); processedCells[processedCells.length] = mCell; for (let x3 = mCell.col + 1; x3 < mCell.col + mCell.mergeColNum; x3++) { if (!table2.cols[x3][mCell.row].specilCol) { table2.cols[x3][mCell.row].originHeight = table2.cols[x3][mCell.row].originHeight - changeHeight; table2.cols[x3][mCell.row].setPosition(void 0, table2.cols[x3][mCell.row].y + changeHeight); processedCells[processedCells.length] = table2.cols[x3][mCell.row]; } } } else if (afterCell.isMergedCell()) { let mCell = afterCell.mergedCell; if (mCell.row + mCell.mergeRowNum == afterCell.row) { afterCell.originHeight = afterCell.originHeight - changeHeight; if (processedCells.indexOf(mCell) == -1) { mCell.setSize(void 0, mCell.height - changeHeight); processedCells[processedCells.length] = mCell; } processedCells[processedCells.length] = afterCell; } else { afterCell.originHeight = afterCell.originHeight - changeHeight; afterCell.setPosition(void 0, afterCell.y + changeHeight); processedCells[processedCells.length] = afterCell; } } } } this.updateCopyShapeArea(); this.changeChildrenBounds(); } } /** * 拖拽时选中单元格 * @param x * @param y */ dragAndSelectedCell(x2, y2) { let cell = this.dragCell; let table2 = this; if (!table2.tempUpCel) { table2.tempUpCel = cell; } let targetCell = table2.getCellByTablePosition(x2, y2); if (targetCell && table2.tempUpCel != targetCell) { let minMax = table2.getMinMaxRowAndCol([cell, table2.tempUpCel]); for (let i2 = minMax.minRow; i2 <= minMax.maxRow; i2++) { for (let j2 = minMax.minCol; j2 <= minMax.maxCol; j2++) { table2.rows[i2][j2].setState(DDeiEnumControlState.DEFAULT); } } table2.tempUpCel = targetCell; minMax = table2.getMinMaxRowAndCol([cell, table2.tempUpCel]); for (let i2 = minMax.minRow; i2 <= minMax.maxRow; i2++) { for (let j2 = minMax.minCol; j2 <= minMax.maxCol; j2++) { table2.rows[i2][j2].setState(DDeiEnumControlState.SELECTED); } } } } /** * 拖拽列大小 * 该方法在拖拽过程中调用,会处理由拖拽引起的合并单元格的变动 */ dragCol(x2, y2) { let cell = this.dragCell; let table2 = this; if (cell.col >= table2.cols.length - 1) { return; } for (let i2 = 0; i2 < table2.cols.length; i2++) { if (table2.rows[cell.row][i2].specilRow) { this.specilDrag = true; for (let j2 = 0; j2 < table2.cols.length; j2++) { if (!table2.rows[cell.row][j2].specilRow) { table2.rows[cell.row][j2].specilRow = true; } } break; } } let dragObj = table2.stage.render.dragObj; let changeWidth = x2 - dragObj.x; dragObj.x = dragObj.x + changeWidth; if (changeWidth != 0) { if (this.specilDrag) { let pass = false; for (let i2 = 0; i2 < table2.cols.length; i2++) { if (table2.rows[cell.row][i2].isMergedCell() || table2.rows[cell.row][i2].isMergeCell()) { pass = true; break; } } if (cell.width != 0 && cell.width + changeWidth < 5 || table2.rows[cell.row][cell.col + 1].width != 0 && table2.rows[cell.row][cell.col + 1].width - changeWidth < 5) { pass = true; } if (!pass) { cell.setSize(cell.width + changeWidth); table2.rows[cell.row][cell.col + 1].setSize(table2.rows[cell.row][cell.col + 1].width - changeWidth); table2.rows[cell.row][cell.col + 1].setPosition(table2.rows[cell.row][cell.col + 1].x + changeWidth); for (let i2 = 0; i2 < table2.cols.length; i2++) { table2.rows[cell.row][i2].specilRow = true; } return; } } for (let i2 = 0; i2 < table2.rows.length; i2++) { let beforeCell = table2.rows[i2][cell.col]; let afterCell = table2.rows[i2][cell.col + 1]; if (!beforeCell.specilRow && (beforeCell.width != 0 && beforeCell.width + changeWidth < 5 || beforeCell.originWidth != null && beforeCell.originWidth + changeWidth < 5)) { return; } if (!afterCell.specilRow && (afterCell.width != 0 && afterCell.width - changeWidth < 5 || afterCell.originWidth != null && afterCell.originWidth - changeWidth < 5)) { return; } } let processedCells = []; for (let i2 = 0; i2 < table2.rows.length; i2++) { let beforeCell = table2.rows[i2][cell.col]; if (processedCells.indexOf(beforeCell) == -1 && !beforeCell.specilRow) { if (!beforeCell.isMergedCell() && !beforeCell.isMergeCell()) { beforeCell.setSize(beforeCell.width + changeWidth); processedCells[processedCells.length] = beforeCell; } else if (beforeCell.isMergeCell()) { let mCell = beforeCell; if (mCell.mergeColNum == 1) { beforeCell.originWidth = beforeCell.originWidth + changeWidth; beforeCell.setSize(beforeCell.width + changeWidth); processedCells[processedCells.length] = beforeCell; } else { beforeCell.originWidth = beforeCell.originWidth + changeWidth; processedCells[processedCells.length] = beforeCell; } } else if (beforeCell.isMergedCell()) { let mCell = beforeCell.mergedCell; if (mCell.col + mCell.mergeColNum - 1 == beforeCell.col) { beforeCell.originWidth = beforeCell.originWidth + changeWidth; if (processedCells.indexOf(mCell) == -1) { processedCells[processedCells.length] = mCell; mCell.setSize(mCell.width + changeWidth); } processedCells[processedCells.length] = beforeCell; } else { beforeCell.originWidth = beforeCell.originWidth + changeWidth; processedCells[processedCells.length] = beforeCell; } } } let afterCell = table2.rows[i2][cell.col + 1]; if (processedCells.indexOf(afterCell) == -1 && !afterCell.specilRow) { if (!afterCell.isMergedCell() && !afterCell.isMergeCell()) { afterCell.setSize(afterCell.width - changeWidth); afterCell.setPosition(afterCell.x + changeWidth); processedCells[processedCells.length] = afterCell; } else if (afterCell.isMergeCell()) { let mCell = afterCell; mCell.originWidth = mCell.originWidth - changeWidth; mCell.setSize(mCell.width - changeWidth); mCell.setPosition(mCell.x + changeWidth); processedCells[processedCells.length] = mCell; for (let x3 = mCell.row + 1; x3 < mCell.row + mCell.mergeRowNum; x3++) { if (!table2.rows[x3][mCell.col].specilRow) { table2.rows[x3][mCell.col].originWidth = table2.rows[x3][mCell.col].originWidth - changeWidth; table2.rows[x3][mCell.col].setPosition(table2.rows[x3][mCell.col].x + changeWidth); processedCells[processedCells.length] = table2.rows[x3][mCell.col]; } } } else if (afterCell.isMergedCell()) { let mCell = afterCell.mergedCell; if (mCell.col + mCell.mergeColNum == afterCell.col) { afterCell.originWidth = afterCell.originWidth - changeWidth; if (processedCells.indexOf(mCell) == -1) { mCell.setSize(mCell.width - changeWidth); processedCells[processedCells.length] = mCell; } processedCells[processedCells.length] = afterCell; } else { afterCell.originWidth = afterCell.originWidth - changeWidth; afterCell.setPosition(afterCell.x + changeWidth); processedCells[processedCells.length] = afterCell; } } } } this.updateCopyShapeArea(); this.changeChildrenBounds(); } } /** * TODO 更新复制图形的区域 */ updateCopyShapeArea() { if (window.globalTableCopyData || window.globalTableCutData) { let sourceCells = null; if (window.globalTableCopyData && window.globalTableCopyData.length > 0) { sourceCells = window.globalTableCopyData; } else { sourceCells = window.globalTableCutData; } if (sourceCells[0].table == this) { let minMaxColRow = this.getMinMaxRowAndCol(sourceCells); let rect = this.getCellPositionRect(minMaxColRow.minRow, minMaxColRow.minCol, minMaxColRow.maxRow, minMaxColRow.maxCol); this.copyAreaShape.style.width = rect.width - 1 + "px"; this.copyAreaShape.style.height = rect.height - 1 + "px"; this.copyAreaShape.style.left = PDSetting.DEFAULT_TABLE_BORDER_PADDING + rect.x - 1 + "px"; this.copyAreaShape.style.top = PDSetting.DEFAULT_TABLE_BORDER_PADDING + rect.y - 1 + "px"; this.copyAreaShape.style.display = "block"; } } } /** * 变换向量 */ transVectors(matrix2, params) { super.transVectors(matrix2); for (let i2 = 0; i2 < this.rows.length; i2++) { let rowObj = this.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cellObj = rowObj[j2]; cellObj.transVectors(matrix2); } } } // ============================ 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static loadFromJSON(json, tempData = {}) { let model = new _DDeiTable2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; if (!model.pModel) { model.pModel = model.layer; } tempData[model.id] = model; let rows = []; let cols = []; for (let i2 = 0; i2 < json.rows.length; i2++) { let rowJSON = json.rows[i2]; rows[i2] = []; for (let j2 = 0; j2 < rowJSON.length; j2++) { if (i2 == 0) { cols[j2] = []; } let cell = DDeiTableCell.loadFromJSON(rowJSON[j2], tempData); cell.table = model; rows[i2][j2] = cell; cols[j2][i2] = cell; } } for (let i2 = 0; i2 < rows.length; i2++) { for (let j2 = 0; j2 < cols.length; j2++) { let cellJSON = json.rows[i2][j2]; if (cellJSON.mergeRowNum > 1 || cellJSON.mergeColNum > 1) { let mergedCell = rows[i2][j2]; for (let mr = 0; mr < cellJSON.mergeRowNum; mr++) { for (let mj = 0; mj < cellJSON.mergeColNum; mj++) { let mergeCell = rows[i2 + mr][j2 + mj]; mergeCell.mergedCell = mergedCell; } } } } } model.rows = rows; model.cols = cols; model.initPVS(); model.initRender(); return model; } // 通过JSON初始化对象,数据未传入时将初始化数据 static initByJSON(json, tempData = {}) { let model = new _DDeiTable2(json); model.layer = tempData["currentLayer"]; model.stage = tempData["currentStage"]; model.pModel = tempData["currentContainer"]; model.initPVS(); model.initTable(); return model; } }; __publicField2(_DDeiTable, "ClsName", "DDeiTable"); __publicField2(_DDeiTable, "initSubControlJson", null); let DDeiTable = _DDeiTable; const __vite_glob_0_14$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiTable, default: DDeiTable }, Symbol.toStringTag, { value: "Module" })); class DDeiAbstractShapeRender { constructor(props) { __publicField2(this, "model"); __publicField2(this, "stage"); __publicField2(this, "layer"); __publicField2(this, "ddRender"); __publicField2(this, "stageRender"); __publicField2(this, "layerRender"); __publicField2(this, "renderCacheData", /* @__PURE__ */ new Map()); __publicField2(this, "refreshShape", true); this.model = props.model; this.ddRender = null; } enableRefreshShape() { var _a3, _b2; this.refreshShape = true; (_a3 = this.model.composes) == null ? void 0 : _a3.forEach((comp) => { var _a22; (_a22 = comp.render) == null ? void 0 : _a22.enableRefreshShape(); }); (_b2 = this.model.linkModels) == null ? void 0 : _b2.forEach((lm) => { var _a22; if (lm.dm) { (_a22 = lm.dm.render) == null ? void 0 : _a22.enableRefreshShape(); } }); } /** * 获取html */ getHTML() { return null; } /** * 获取缓存的渲染数据 */ getCachedValue(attrPath) { let returnValue = null; if (!this.renderCacheData.has(attrPath)) { returnValue = DDeiModelArrtibuteValue.getAttrValueByState(this.model, attrPath, true); this.setCachedValue(attrPath, returnValue); } else { returnValue = this.renderCacheData.get(attrPath); } return returnValue; } /** * 设置渲染缓存数据 */ setCachedValue(attrPath, value) { if (attrPath) { if (Array.isArray(attrPath)) { attrPath.forEach((item) => { this.renderCacheData.set(item, value); this.changeComposesCacheValue(item, value); }); } else { this.renderCacheData.set(attrPath, value); this.changeComposesCacheValue(attrPath, value); } } } clearCachedValue() { this.renderCacheData.clear(); this.enableRefreshShape(); this.clearComposesCacheValue(); } clearComposesCacheValue() { var _a3, _b2, _c2; let define2 = (_a3 = DDeiUtil$1.getControlDefine(this.model)) == null ? void 0 : _a3.define; if (((_b2 = define2 == null ? void 0 : define2.composes) == null ? void 0 : _b2.length) > 0) { for (let i2 = 0; i2 < define2.composes.length; i2++) { let comDef = define2.composes[i2]; let comModel = this.model.composes[i2]; if (((_c2 = comDef.attrLinks) == null ? void 0 : _c2.length) > 0) { comDef.attrLinks.forEach((attrLink) => { attrLink.mapping.forEach((mp) => { var _a22, _b22; if (mp == "*") { (_a22 = comModel.render) == null ? void 0 : _a22.clearCachedValue(); } else { (_b22 = comModel.render) == null ? void 0 : _b22.clearCachedValue(); } }); }); } } } } changeComposesCacheValue(attrPath, value) { var _a3, _b2, _c2; let define2 = (_a3 = DDeiUtil$1.getControlDefine(this.model)) == null ? void 0 : _a3.define; if (((_b2 = define2 == null ? void 0 : define2.composes) == null ? void 0 : _b2.length) > 0) { for (let i2 = 0; i2 < define2.composes.length; i2++) { let comDef = define2.composes[i2]; let comModel = this.model.composes[i2]; if (((_c2 = comDef.attrLinks) == null ? void 0 : _c2.length) > 0) { comDef.attrLinks.forEach((attrLink) => { var _a22; if (attrPath.startsWith(attrLink.code) && ((_a22 = attrLink.mapping) == null ? void 0 : _a22.length) > 0) { attrLink.mapping.forEach((mp) => { if (mp == "*") { comModel.render.setCachedValue(attrPath, value); } else { comModel.render.setCachedValue(mp, value); } }); } }); } } } } // ============================== 事件 =============================== /** * 拖拽本控件结束 * @param evt */ controlDragEnd(evt) { } /** * 鼠标按下事件 */ mouseDown(evt) { } /** * 绘制图形 */ mouseUp(evt) { this.controlSelect(); } /** * 选中 */ controlSelect(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; let pContainerModel = this.model.pModel; let pushMulits = []; this.stageRender.currentOperateContainer = pContainerModel; let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_SELECT_BEFORE", DDeiEnumOperateType.SELECT, { models: [this.model] }, (_a3 = this.stage) == null ? void 0 : _a3.ddInstance, evt); if (rsState == 0 || rsState == 1) { let isCtrl = DDei.KEY_DOWN_STATE.get("ctrl"); if (isCtrl) { if (((_b2 = this.stageRender.currentOperateShape) == null ? void 0 : _b2.state) == DDeiEnumControlState.SELECTED) { pushMulits.push({ actionType: DDeiEnumBusCommandType.ModelChangeSelect, data: [{ id: this.model.id, value: DDeiEnumControlState.DEFAULT }] }); } else { pushMulits.push({ actionType: DDeiEnumBusCommandType.ModelChangeSelect, data: [{ id: this.model.id, value: DDeiEnumControlState.SELECTED }] }); } } else { pushMulits.push({ actionType: DDeiEnumBusCommandType.CancelCurLevelSelectedModels, data: { ignoreModels: [this.model] } }); pushMulits.push({ actionType: DDeiEnumBusCommandType.ModelChangeSelect, data: [{ id: this.model.id, value: DDeiEnumControlState.SELECTED }] }); } this.model.layer.render.enableRefreshShape(); pushMulits.push({ actionType: DDeiEnumBusCommandType.StageChangeSelectModels }); (_e2 = (_d2 = (_c2 = this.stage) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.bus) == null ? void 0 : _e2.pushMulit(pushMulits, evt); (_h = (_g = (_f = this.stage) == null ? void 0 : _f.ddInstance) == null ? void 0 : _g.bus) == null ? void 0 : _h.executeAll(); DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_SELECT_AFTER", DDeiEnumOperateType.SELECT, { models: [this.model] }, (_i = this.stage) == null ? void 0 : _i.ddInstance, evt); } return true; } /** * 鼠标移动 */ mouseMove(evt) { var _a3, _b2, _c2; if (this.layer) { this.stage.ddInstance.bus.insert(DDeiEnumBusCommandType.ChangeCursor, { cursor: "all-scroll" }, evt, 0); let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", (_a3 = this.ddRender) == null ? void 0 : _a3.model); let accessLink = DDeiUtil$1.isAccess( DDeiEnumOperateType.LINK, [this.model], null, modeName, (_b2 = this.ddRender) == null ? void 0 : _b2.model ); if (accessLink) { let stageRatio2 = (_c2 = this.stage) == null ? void 0 : _c2.getStageRatio(); let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; ex /= stageRatio2; ey /= stageRatio2; this.changeOpPoints(ex, ey); } } } changeOpPoints(ex, ey, pointMode = null) { var _a3; let appendPoints = []; let hasPoint = false; let projPoint; if (((_a3 = this.stageRender) == null ? void 0 : _a3.operateState) == DDeiEnumOperateState.LINE_POINT_CHANGING) { projPoint = this.model.getProjPoint({ x: ex, y: ey }, { in: -8, out: 15 }); } else { let modelWeight = Math.min(this.model.width, this.model.height); let inWeight = -8; if (modelWeight <= 24) { inWeight = 0; } projPoint = this.model.getProjPoint({ x: ex, y: ey }, { in: inWeight, out: 15 }); } let pots = []; if (projPoint) { projPoint.model = this.model; projPoint.mode = pointMode; hasPoint = true; pots.push(projPoint); } let centerOpPoints = this.model.getCenterOpPoints(); centerOpPoints.forEach((op) => { op.model = this.model; op.mode = 3; if (op.oppoint == 1 || op.oppoint == 3) { let dist = DDeiUtil$1.getPointDistance(op.x, op.y, ex, ey); if (Math.abs(dist) <= 5) { op.isMiddle = true; this.stage.tempCursorOPpoint = op; delete op.mode; hasPoint = true; } } if (op.oppoint == 3) { let rotate2 = this.model.rotate; if (!rotate2) { rotate2 = 0; } let bpv2 = DDeiUtil$1.pointsToZero([this.model.bpv], this.model.cpv, rotate2)[0]; let scaleX2 = Math.abs(bpv2.x / 100); let scaleY2 = Math.abs(bpv2.y / 100); let dist1 = DDeiUtil$1.getPointDistance(0, 0, (ex - op.x) / scaleX2, (ey - op.y) / scaleY2); if (Math.abs(op.r - dist1) <= 5) { let dr = op.r - dist1; let rotate22 = DDeiUtil$1.getLineAngle(op.x, op.y, ex, ey); let dx = dr * Math.cos(rotate22 * DDeiConfig$1.ROTATE_UNIT); let dy = dr * Math.sin(rotate22 * DDeiConfig$1.ROTATE_UNIT); let op1 = new Vector3(ex + dx, ey + dy, 1); op1.model = this.model; op1.oppoint = op.oppoint; pots.push(op1); hasPoint = true; } } else { let angle2 = DDeiUtil$1.getLineAngle(this.model.cpv.x, this.model.cpv.y, op.x, op.y); angle2 -= this.model.rotate ? this.model.rotate : 0; op.sita = angle2; appendPoints.push(op); } }); pots.forEach((po) => { let insert = true; for (let i2 = 0; i2 < centerOpPoints.length; i2++) { let co = centerOpPoints[i2]; if (co.isMiddle) { let dist = DDeiUtil$1.getPointDistance(po.x, po.y, co.x, co.y); if (Math.abs(dist) <= 5) { insert = false; } } } if (insert) { let angle2 = DDeiUtil$1.getLineAngle(this.model.cpv.x, this.model.cpv.y, po.x, po.y); angle2 -= this.model.rotate ? this.model.rotate : 0; po.sita = angle2; this.stage.tempCursorOPpoint = po; appendPoints.push(po); } }); if (appendPoints.length > 0) { appendPoints.forEach((po) => { this.layer.opPoints.push(po); }); this.layer.opPoints.push({ isSplit: 1 }); } if (hasPoint) { this.stage.ddInstance.bus.insert(DDeiEnumBusCommandType.ChangeCursor, { cursor: "pointer" }, null, 1); } } //数据 refreshView(editor, vNode, tempShape, composeRender) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M; let shapeElement = vNode.el; let model = this.model; let stage2 = model.stage; let ddInstance = stage2.ddInstance; let render = model.render; let ruleWeight = 0; if (stage2.render.tempRuleDisplay == 1 || stage2.render.tempRuleDisplay == "1") { ruleWeight = 15; } let stageRatio2 = model.getStageRatio(); let rat1 = window.remRatio; if (DDeiUtil$1.isModelHidden(model)) { shapeElement.style.display = "none"; } else { shapeElement.style.width = model.width * rat1 + "px"; shapeElement.style.height = model.height * rat1 + "px"; let transform = ""; if (stageRatio2 > 0 && stageRatio2 != 1) { transform += " scale(" + stageRatio2 + ")"; } if (model.rotate) { transform += " rotate(" + model.rotate + "deg)"; } if (this.model.mirrorX) { transform += " rotateY(180deg)"; } if (this.model.mirrorY) { transform += " rotateX(180deg)"; } shapeElement.style.transform = transform; let type = ((_a3 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _a3.type) || ((_b2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _b2.type) == 0 ? (_c2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _c2.type : render.getCachedValue("border.type"); let opacity = ((_d2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _d2.opacity) || ((_e2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _e2.opacity) == 0 ? (_f = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _f.opacity : render.getCachedValue("border.opacity"); let width = ((_g = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _g.width) || ((_h = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _h.width) == 0 ? (_i = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _i.width : render.getCachedValue("border.width"); let dash = ((_j = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _j.dash) || ((_k = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _k.dash) == 0 ? (_l = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _l.dash : render.getCachedValue("border.dash"); let color = ((_m = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _m.color) || ((_n = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _n.color) == 0 ? (_o = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _o.color : render.getCachedValue("border.color"); let drawLine = (type == 1 || type == "1") && width > 0; if (drawLine) { let type2 = !dash || dash.length == 0 ? "solid" : "dashed"; if (!color) { color = "var(--border)"; } if (opacity >= 0 && opacity < 1) { let value16 = parseInt(opacity * 255); color += value16.toString(16); } shapeElement.style.setProperty("--borderColor", color); shapeElement.style.setProperty("--borderType", type2); shapeElement.style.setProperty("--borderWidth", width + "px"); } shapeElement.style.left = model.cpv.x * stageRatio2 + stage2.wpv.x - (shapeElement.offsetWidth ? shapeElement.offsetWidth : model.width * rat1) / 2 - ruleWeight + "px"; shapeElement.style.top = model.cpv.y * stageRatio2 + stage2.wpv.y - (shapeElement.offsetHeight ? shapeElement.offsetHeight : model.height * rat1) / 2 - ruleWeight + "px"; let fillColor = ((_p = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _p.color) ? tempShape.fill.color : render.getCachedValue("fill.color"); if (!fillColor) { fillColor = DDeiUtil$1.getStyleValue("canvas-control-background", ddInstance); } let fillOpacity = ((_q = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _q.opacity) ? tempShape.fill.opacity : render.getCachedValue("fill.opacity"); let fillType = ((_r = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _r.type) ? tempShape.fill.type : render.getCachedValue("fill.type"); if (fillType == 1) { if (fillOpacity >= 0 && fillOpacity < 1) { let value16 = parseInt(fillOpacity * 255); fillColor += value16.toString(16); } shapeElement.style.setProperty("--fillColor", fillColor); } let round = ((_s = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _s.round) ? (_t = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _t.round : render.getCachedValue("border.round"); if (round) { shapeElement.style.setProperty("--borderRound", round + "px"); } let fiFamily = ((_u = tempShape == null ? void 0 : tempShape.font) == null ? void 0 : _u.family) ? (_v = tempShape == null ? void 0 : tempShape.font) == null ? void 0 : _v.family : render.getCachedValue("font.family"); let fiSize = ((_w = tempShape == null ? void 0 : tempShape.font) == null ? void 0 : _w.size) ? (_x = tempShape == null ? void 0 : tempShape.font) == null ? void 0 : _x.size : render.getCachedValue("font.size"); let fiColor = ((_y = tempShape == null ? void 0 : tempShape.font) == null ? void 0 : _y.color) ? (_z = tempShape == null ? void 0 : tempShape.font) == null ? void 0 : _z.color : render.getCachedValue("font.color"); if (!fiColor) { fiColor = DDeiUtil$1.getStyleValue("canvas-control-title", ddInstance); } if (fiFamily) { shapeElement.style.setProperty("--fontFamily", fiFamily); } if (fiSize) { shapeElement.style.setProperty("--fontSize", fiSize + "px"); } if (fiColor) { shapeElement.style.setProperty("--fontColor", fiColor); } let bold = ((_A = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _A.bold) ? (_B = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _B.bold : render.getCachedValue("textStyle.bold"); if (bold == 1 || bold == "1") { shapeElement.style.setProperty("--fontWeight", "bold"); } let italic = ((_C = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _C.italic) ? (_D = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _D.italic : render.getCachedValue("textStyle.italic"); if (italic == 1 || italic == "1") { shapeElement.style.setProperty("--fontStyle", "italic"); } let underline = ((_E = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _E.underline) ? (_F = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _F.underline : render.getCachedValue("textStyle.underline"); if (underline == "1" || underline == 1) { shapeElement.style.setProperty("--textDecoration", "underline"); } else { let deleteline = ((_G = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _G.deleteline) ? (_H = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _H.deleteline : render.getCachedValue("textStyle.deleteline"); if (deleteline == "1" || deleteline == 1) { shapeElement.style.setProperty("--textDecoration", "line-through"); } else { let overline = ((_I = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _I.topline) ? (_J = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _J.topline : render.getCachedValue("textStyle.topline"); if (overline == "1" || overline == 1) { shapeElement.style.setProperty("--textDecoration", "overline"); } } } let textBgColor = ((_K = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _K.bgcolor) ? (_L = tempShape == null ? void 0 : tempShape.textStyle) == null ? void 0 : _L.bgcolor : render.getCachedValue("textStyle.bgcolor"); if (textBgColor) { shapeElement.style.setProperty("--textBgColor", textBgColor); } shapeElement.style.zIndex = model.render.tempZIndex; shapeElement.style.display = "block"; if (model.baseModelType == "DDeiContainer") { for (let m = 0; m < ((_M = model.midList) == null ? void 0 : _M.length); m++) { let key = model.midList[m]; let item = model.models.get(key); if (item == null ? void 0 : item.render) { item.render.tempZIndex = model.render.tempZIndex + (m + 1); item.render.drawShape(tempShape, composeRender); } } } if (vNode.component.ctx.refreshView) { vNode.component.ctx.refreshView(model, vNode, tempShape, composeRender); } } } removeViewerCanvas() { var _a3, _b2; if (!this.viewer) { (_a3 = this.tempCanvas) == null ? void 0 : _a3.remove(); (_b2 = this.model.composes) == null ? void 0 : _b2.forEach((comp) => { comp.render.removeViewerCanvas(); }); } else { DDeiUtil$1.createRenderViewer(this.model, "VIEW-HIDDEN"); } } } const __vite_glob_1_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiAbstractShapeRender, default: DDeiAbstractShapeRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiRectangleCanvasRender = class _DDeiRectangleCanvasRender2 extends DDeiAbstractShapeRender { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "textUsedArea", []); __publicField2(this, "clip", true); } // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiRectangleCanvasRender2(props); } // ============================== 方法 =============================== /** * 初始化 */ init() { this.ddRender = this.model.stage.ddInstance.render; this.stage = this.model.stage; this.stageRender = this.model.stage.render; if (this.model.layer) { this.layer = this.model.layer; this.layerRender = this.model.layer.render; } } initImage() { let that = this; let bgImage = DDeiUtil$1.getReplacibleValue(this.model, "fill.image"); if ((this.model.bgImageBase64 || bgImage) && !this.imgObj) { let img = new Image(); img.onload = function() { that.imgObj = img; that.upFillImage = bgImage; that.ddRender.model.bus.push(DDeiEnumBusCommandType.RefreshShape, null, null); that.ddRender.model.bus.executeAll(); }; img.src = this.model.bgImageBase64 ? this.model.bgImageBase64 : bgImage; } } /** * 创建图形 */ drawShape(tempShape) { let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_BEFORE", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); if (rsState == 0 || rsState == 1) { let rsState1 = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", DDeiEnumOperateType.VIEW, { models: [this.model], tempShape }, this.ddRender.model, null); if (rsState1 == 0 || rsState1 == 1) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); ctx.save(); this.drawBorder(tempShape); this.drawFill(tempShape); this.drawText(tempShape); this.tempFillAreaRect = null; ctx.restore(); } DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_AFTER", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); } } /** * 生成边框的区域向量 */ getBorderPVS(tempBorder) { let topRound = this.getBorderInfo(tempBorder, 1, "round"); let topType = this.getBorderInfo(tempBorder, 1, "type"); let topWidth = this.getBorderInfo(tempBorder, 1, "width"); let rightType = this.getBorderInfo(tempBorder, 2, "type"); let rightWidth = this.getBorderInfo(tempBorder, 2, "width"); let bottomType = this.getBorderInfo(tempBorder, 3, "type"); let bottomWidth = this.getBorderInfo(tempBorder, 3, "width"); let leftType = this.getBorderInfo(tempBorder, 4, "type"); let leftWidth = this.getBorderInfo(tempBorder, 4, "width"); if (!topType) { topWidth = 0; } if (rightType) { rightWidth = 0; } if (bottomType) { bottomWidth = 0; } if (leftType) { leftWidth = 0; } leftWidth = leftWidth / 2; rightWidth = rightWidth / 2; bottomWidth = bottomWidth / 2; topWidth = topWidth / 2; let borderPVS = []; let essBounds = this.model.essBounds; borderPVS[0] = new Vector3(essBounds.x + topRound, essBounds.y + topWidth, 1); borderPVS[4] = new Vector3(essBounds.x + leftWidth, essBounds.y + topWidth, 1); borderPVS[1] = new Vector3(essBounds.x + essBounds.width - rightWidth, essBounds.y + topWidth, 1); borderPVS[2] = new Vector3(essBounds.x + essBounds.width - rightWidth, essBounds.y + essBounds.height - bottomWidth, 1); borderPVS[3] = new Vector3(essBounds.x + leftWidth, essBounds.y + essBounds.height - bottomWidth, 1); if (this.model.rotate && this.model.rotate != 0) { let m12 = new Matrix3(); let move1Matrix = new Matrix3( 1, 0, -this.model.cpv.x, 0, 1, -this.model.cpv.y, 0, 0, 1 ); m12.premultiply(move1Matrix); let angle2 = -(this.model.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); let move2Matrix = new Matrix3( 1, 0, this.model.cpv.x, 0, 1, this.model.cpv.y, 0, 0, 1 ); m12.premultiply(move2Matrix); borderPVS.forEach((fpv) => { fpv.applyMatrix3(m12); }); } this.borderPVS = borderPVS; } /** * 取得边框的绘制区域 */ getBorderRatPos() { let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; let absBounds = this.model.getAbsBounds(); return DDeiUtil$1.getRatioPosition(absBounds, ratio); } /** * 获取边框信息 * @param tempBorder */ getBorderInfo(tempBorder, direct, path) { let borderInfo = null; if (tempBorder) { try { let returnJSON = DDeiUtil$1.getDataByPath(tempBorder, path.split(".")); borderInfo = returnJSON.data; } catch (e) { } } else { let attrpath = null; if (direct == 1) { attrpath = "border.top." + path; } else if (direct == 2) { attrpath = "border.right." + path; } else if (direct == 3) { attrpath = "border.bottom." + path; } else if (direct == 4) { attrpath = "border.left." + path; } borderInfo = this.getCachedValue(attrpath); } return borderInfo; } /** * 绘制边框 * @param tempBorder 临时边框,优先级最高 * @param usePV 是否采用向量输出 */ drawBorder(tempBorder) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; rat1 = ratio; let type = this.getBorderInfo(tempBorder, 1, "type"); let color = this.getBorderInfo(tempBorder, 1, "color"); let opacity = this.getBorderInfo(tempBorder, 1, "opacity"); let width = this.getBorderInfo(tempBorder, 1, "width"); let dash = this.getBorderInfo(tempBorder, 1, "dash"); let round = this.getBorderInfo(null, 1, "round"); if (!(type == 0 || type == "0") && color && (!opacity || opacity > 0) && width > 0) { let lineOffset = 1 * ratio / 2; let lineWidth = width * ratio; ctx.lineWidth = lineWidth; ctx.beginPath(); if (dash) { ctx.setLineDash(dash); } if (opacity != null && opacity != void 0) { ctx.globalAlpha = opacity; } ctx.strokeStyle = DDeiUtil$1.getColor(color); this.getBorderPVS(tempBorder); let pvs2 = this.borderPVS; if ((pvs2 == null ? void 0 : pvs2.length) > 0) { lineOffset = 0; ctx.moveTo(pvs2[0].x * rat1 + lineOffset, pvs2[0].y * rat1 + lineOffset); ctx.arcTo(pvs2[1].x * rat1 + lineOffset, pvs2[1].y * rat1 + lineOffset, pvs2[2].x * rat1 + lineOffset, pvs2[2].y * rat1 + lineOffset, round * rat1); ctx.arcTo(pvs2[2].x * rat1 + lineOffset, pvs2[2].y * rat1 + lineOffset, pvs2[3].x * rat1 + lineOffset, pvs2[3].y * rat1 + lineOffset, round * rat1); ctx.arcTo(pvs2[3].x * rat1 + lineOffset, pvs2[3].y * rat1 + lineOffset, pvs2[4].x * rat1 + lineOffset, pvs2[4].y * rat1 + lineOffset, round * rat1); ctx.arcTo(pvs2[4].x * rat1 + lineOffset, pvs2[4].y * rat1 + lineOffset, pvs2[1].x * rat1 + lineOffset, pvs2[1].y * rat1 + lineOffset, round * rat1); } ctx.stroke(); if (this.clip) { ctx.clip(); } ctx.globalAlpha = 1; ctx.lineWidth = 1; ctx.lineColor = "black"; ctx.setLineDash([]); } } /** * 填充图片 */ drawImage() { let bgImage = DDeiUtil$1.getReplacibleValue(this.model, "fill.image"); if (!this.imgObj || bgImage != this.upFillImage) { this.initImage(); } else { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; let fillRect = this.tempFillAreaRect; ctx.save(); let imgFillInfo = this.getCachedValue("fill.opacity"); if (imgFillInfo) { ctx.globalAlpha = imgFillInfo; } let lineOffset = 1 * ratio / 2; ctx.translate(this.model.cpv.x * rat1, this.model.cpv.y * rat1); ctx.rotate(this.model.rotate * DDeiConfig$1.ROTATE_UNIT); ctx.translate(-this.model.cpv.x * rat1, -this.model.cpv.y * rat1); ctx.drawImage(this.imgObj, (this.model.cpv.x - fillRect.width / 2) * rat1 + lineOffset, (this.model.cpv.y - fillRect.height / 2) * rat1 + lineOffset, fillRect.width * rat1, fillRect.height * rat1); ctx.restore(); } } /** * 绘制填充 */ drawFill(tempShape) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let fillPVS = this.getFillAreaPVS(); let rat1 = this.ddRender.ratio; ctx.save(); let fillType = ((_a3 = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _a3.type) ? (_b2 = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _b2.type : this.getCachedValue("fill.type"); if (this.isEditoring) { if (!fillType || fillType == "0") { fillType = 1; } } if (fillType == 1) { let fillColor = ((_c2 = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _c2.color) ? (_d2 = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _d2.color : this.getCachedValue("fill.color"); let fillOpacity = ((_e2 = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _e2.opacity) ? (_f = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _f.opacity : this.getCachedValue("fill.opacity"); let fillType2 = ((_g = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _g.type) ? (_h = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _h.type : this.getCachedValue("fill.type"); if (this.isEditoring) { fillType2 = 0; fillOpacity = 1; } if (!fillType2 && fillColor && (!fillOpacity || fillOpacity > 0)) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); if (fillOpacity != null && !fillOpacity != void 0) { ctx.globalAlpha = fillOpacity; } ctx.beginPath(); for (let i2 = 0; i2 < fillPVS.length; i2++) { if (i2 == fillPVS.length - 1) { ctx.lineTo(fillPVS[i2].x * rat1, fillPVS[i2].y * rat1); ctx.lineTo(fillPVS[0].x * rat1, fillPVS[0].y * rat1); } else if (i2 == 0) { ctx.moveTo(fillPVS[i2].x * rat1, fillPVS[i2].y * rat1); } else { ctx.lineTo(fillPVS[i2].x * rat1, fillPVS[i2].y * rat1); } } ctx.closePath(); ctx.fill(); } } else if (fillType == 2) { this.drawImage(); } ctx.restore(); } /** * 绘制文本 */ drawText() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L; let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; let fillRect = this.tempFillAreaRect; let ratPos = DDeiUtil$1.getRatioPosition(fillRect, rat1); ctx.textAlign = "left"; ctx.textBaseline = "top"; let editorText = null; if (this.isEditoring) { editorText = DDeiUtil$1.getEditorText(); } let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; this.stageRender.editorShadowControl.tempCursorStart = curSIdx; this.stageRender.editorShadowControl.tempCursorEnd = curEIdx; } let align = this.getCachedValue("textStyle.align"); let valign = this.getCachedValue("textStyle.valign"); let scale = this.getCachedValue("textStyle.scale"); let feed = this.getCachedValue("textStyle.feed"); let fiFamily = this.getCachedValue("font.family"); let fiSize = this.getCachedValue("font.size"); let fiColor = this.getCachedValue("font.color"); let hollow = this.getCachedValue("textStyle.hollow"); let bold = this.getCachedValue("textStyle.bold"); let italic = this.getCachedValue("textStyle.italic"); let underline = this.getCachedValue("textStyle.underline"); let deleteline = this.getCachedValue("textStyle.deleteline"); let topline = this.getCachedValue("textStyle.topline"); let textBgColor = this.getCachedValue("textStyle.bgcolor"); ctx.save(); ctx.translate(this.model.cpv.x * rat1, this.model.cpv.y * rat1); ctx.rotate(this.model.rotate * DDeiConfig$1.ROTATE_UNIT); let textContainer = []; let loop2 = true; let fontSize = fiSize; let cText = null; let sptStyle = null; if (this.isEditoring) { sptStyle = this.model.sptStyle; feed = "1"; scale = "1"; cText = this.getCachedValue("text"); } else { cText = DDeiUtil$1.getReplacibleValue(this.model, "text", true, true); sptStyle = this.tempSptStyle ? this.tempSptStyle : this.model.sptStyle; } if (cText && trim(cText) != "") { cText = "" + cText; let contentWidth = ratPos.width; let subtractionFontSize = 0; while (loop2) { let usedWidth = 0; let usedHeight = 0; let textRowContainer = { text: "", widths: [], heights: [] }; textContainer.push(textRowContainer); let isOutSize = false; let maxFontSize = 0; if (fontSize > ratPos.height) { if (scale == 1) { textContainer = []; let ds = fontSize < 50 ? 0.5 : Math.floor(fontSize / 50); fontSize -= ds; continue; } } let baseFont = fontSize + "px " + fiFamily; if (bold == "1") { baseFont = "bold " + baseFont; } if (italic == "1") { baseFont = "italic " + baseFont; } let rcIndex = 0; let lastUnSubTypeFontSize2 = 0; for (let ti = 0; ti < cText.length; ti++, rcIndex++) { let te = cText[ti]; let font = null; let fontHeight = null; let isEnter = false; let fontShapeRect = null; if ((feed == 1 || feed == "1") && te == "\n") { isEnter = true; textRowContainer.text += te; textRowContainer.widths[rcIndex] = 0; textRowContainer.heights[rcIndex] = 0; textRowContainer.width = Math.max(0, usedWidth); textRowContainer.height = Math.max(0, textRowContainer.height ? textRowContainer.height : 0, lastUnSubTypeFontSize2 * ratio); } else { if (sptStyle[ti]) { let ftsize = ((_b2 = (_a3 = sptStyle[ti]) == null ? void 0 : _a3.font) == null ? void 0 : _b2.size) ? ((_d2 = (_c2 = sptStyle[ti]) == null ? void 0 : _c2.font) == null ? void 0 : _d2.size) - subtractionFontSize : fontSize; if ((_e2 = sptStyle[ti].textStyle) == null ? void 0 : _e2.subtype) { if (!lastUnSubTypeFontSize2) { lastUnSubTypeFontSize2 = ftsize; } ftsize = lastUnSubTypeFontSize2 / 2; } else if (ftsize < 1) { ftsize = 2; } let ftfamily = ((_g = (_f = sptStyle[ti]) == null ? void 0 : _f.font) == null ? void 0 : _g.family) ? (_i = (_h = sptStyle[ti]) == null ? void 0 : _h.font) == null ? void 0 : _i.family : fiFamily; font = ftsize + "px " + ftfamily; if (((_k = (_j = sptStyle[ti]) == null ? void 0 : _j.textStyle) == null ? void 0 : _k.bold) == "1") { font = "bold " + font; } if (((_m = (_l = sptStyle[ti]) == null ? void 0 : _l.textStyle) == null ? void 0 : _m.italic) == "1") { font = "italic " + font; } fontHeight = ftsize; } if (!font) { font = baseFont; fontHeight = fontSize; } if (!((_o = (_n = sptStyle[ti]) == null ? void 0 : _n.textStyle) == null ? void 0 : _o.subtype)) { lastUnSubTypeFontSize2 = fontHeight; } maxFontSize = Math.max(maxFontSize, fontHeight); let rc1 = DDeiUtil$1.measureText(te, font, ctx, fontHeight); fontShapeRect = { width: rc1.width * ratio, height: rc1.height * ratio }; usedWidth += fontShapeRect.width; textRowContainer.text += te; textRowContainer.widths[rcIndex] = fontShapeRect.width; textRowContainer.heights[rcIndex] = fontHeight * ratio; textRowContainer.width = usedWidth; textRowContainer.height = Math.max(fontHeight * ratio, textRowContainer.height ? textRowContainer.height : 0, lastUnSubTypeFontSize2 * ratio); } if (feed == 0) { if (scale == 1 && usedWidth > contentWidth) { isOutSize = true; break; } else if (usedWidth > contentWidth) { textRowContainer.text = textRowContainer.text.substring(0, textRowContainer.text.length - 1); usedWidth -= fontShapeRect.width; textRowContainer.width = usedWidth; break; } } else if (feed == 1 || feed == "1") { if (isEnter) { usedWidth = 0; usedHeight += textRowContainer.height; if (usedHeight + textRowContainer.height > ratPos.height) { if (scale == 1) { isOutSize = true; } break; } rcIndex = -1; textRowContainer = { text: "", widths: [], heights: [] }; textRowContainer.width = usedWidth; textRowContainer.height = 0; textContainer.push(textRowContainer); } else if (usedWidth > contentWidth) { textRowContainer.text = textRowContainer.text.substring(0, textRowContainer.text.length - 1); textRowContainer.width -= fontShapeRect.width; textRowContainer.widths.splice(rcIndex, 1); textRowContainer.heights.splice(rcIndex, 1); usedWidth = fontShapeRect.width; usedHeight += textRowContainer.height; if (usedHeight + textRowContainer.height > ratPos.height) { if (scale == 1) { isOutSize = true; } break; } rcIndex = 0; textRowContainer = { text: te, widths: [], heights: [] }; textRowContainer.widths[rcIndex] = fontShapeRect.width; textRowContainer.heights[rcIndex] = fontHeight * ratio; textRowContainer.width = usedWidth; textRowContainer.height = Math.max(fontHeight * ratio, lastUnSubTypeFontSize2 * ratio); textContainer.push(textRowContainer); } } } if (!isOutSize) { loop2 = false; } else { textContainer = []; let ds = maxFontSize < 50 ? 0.5 : Math.floor(maxFontSize / 50); fontSize -= ds; subtractionFontSize += ds; } } let containerRect = { width: 0, height: 0 }; for (let i2 = 0; i2 < textContainer.length; i2++) { if (i2 == 0) { containerRect.width += textContainer[i2].width; } containerRect.height += textContainer[i2].height; } let containerWidth = containerRect.width; let containerHeight = containerRect.height; let x2, y2; if (align == 1) { x2 = 0; } else if (align == 2) { x2 = (ratPos.width - containerWidth) * 0.5; } else if (align == 3) { x2 = ratPos.width - containerWidth; } x2 = x2 + ratPos.x; if (valign == 1) { y2 = 0; } else if (valign == 2) { y2 = (ratPos.height - containerHeight) * 0.5; } else if (valign == 3) { y2 = ratPos.height - containerHeight; } y2 = y2 + ratPos.y; let cursorX = -Infinity; let cursorY = -Infinity; let cursorHeight = 0; let tempIdx = 0; let usedY = 0, usedX = 0; let lastUsedX, lastUsedY, lastWidth, lastHeight; let lastUnSubTypeFontSize = 0; if (textContainer.length > 0) { textContainer[0].textPosCache = []; } for (let tci = 0; tci < textContainer.length; tci++) { let rRect = textContainer[tci]; let x1, y1; if (align == 1) { x1 = x2; y1 = y2 + usedY; } else if (align == 2) { x1 = ratPos.x + (ratPos.width - rRect.width) * 0.5; y1 = y2 + usedY; } else if (align == 3) { x1 = ratPos.x + (ratPos.width - rRect.width); y1 = y2 + usedY; } textContainer[tci].x = x1; textContainer[tci].y = y1; usedX = x1; for (let tj = 0; tj < textContainer[tci].text.length; tj++, tempIdx++) { let width = textContainer[tci].widths[tj]; let height = textContainer[tci].heights[tj]; lastWidth = width; lastHeight = height; ctx.save(); let font = fontSize * ratio + "px " + fiFamily; if (bold == "1") { font = "bold " + font; } if (italic == "1") { font = "italic " + font; } let tHollow = hollow; let tUnderline = underline; let tDeleteline = deleteline; let tTopline = topline; let tFontColor = fiColor; let tBgColor = textBgColor; let ftsize = fontSize * ratio; let subScriptOffY = 0; if (sptStyle[tempIdx]) { tBgColor = ((_p = sptStyle[tempIdx].textStyle) == null ? void 0 : _p.bgcolor) ? sptStyle[tempIdx].textStyle.bgcolor : textBgColor; ftsize = ((_q = sptStyle[tempIdx].font) == null ? void 0 : _q.size) ? ((_r = sptStyle[tempIdx].font) == null ? void 0 : _r.size) - subtractionFontSize : fontSize; ftsize *= ratio; if ((_s = sptStyle[tempIdx].textStyle) == null ? void 0 : _s.subtype) { if (!lastUnSubTypeFontSize) { lastUnSubTypeFontSize = ftsize; } ftsize = lastUnSubTypeFontSize / 2; switch ((_t = sptStyle[tempIdx].textStyle) == null ? void 0 : _t.subtype) { case 1: subScriptOffY = -(lastUnSubTypeFontSize - ftsize); break; case 2: subScriptOffY = -(lastUnSubTypeFontSize - ftsize) / 2; break; } } else if (ftsize < 1) { ftsize = 2 * ratio; } let ftfamily = ((_u = sptStyle[tempIdx].font) == null ? void 0 : _u.family) ? (_v = sptStyle[tempIdx].font) == null ? void 0 : _v.family : fiFamily; font = ftsize + "px " + ftfamily; if (((_x = (_w = sptStyle[tempIdx]) == null ? void 0 : _w.textStyle) == null ? void 0 : _x.bold) == "1") { font = "bold " + font; } if (((_z = (_y = sptStyle[tempIdx]) == null ? void 0 : _y.textStyle) == null ? void 0 : _z.italic) == "1") { font = "italic " + font; } tHollow = ((_B = (_A = sptStyle[tempIdx]) == null ? void 0 : _A.textStyle) == null ? void 0 : _B.hollow) == "1" ? "1" : tHollow; tUnderline = ((_D = (_C = sptStyle[tempIdx]) == null ? void 0 : _C.textStyle) == null ? void 0 : _D.underline) == "1" ? "1" : tUnderline; tDeleteline = ((_F = (_E = sptStyle[tempIdx]) == null ? void 0 : _E.textStyle) == null ? void 0 : _F.deleteline) == "1" ? "1" : tDeleteline; tTopline = ((_H = (_G = sptStyle[tempIdx]) == null ? void 0 : _G.textStyle) == null ? void 0 : _H.topline) == "1" ? "1" : tTopline; tFontColor = ((_J = (_I = sptStyle[tempIdx]) == null ? void 0 : _I.font) == null ? void 0 : _J.color) ? sptStyle[tempIdx].font.color : tFontColor; } if (!((_L = (_K = sptStyle[tempIdx]) == null ? void 0 : _K.textStyle) == null ? void 0 : _L.subtype)) { lastUnSubTypeFontSize = ftsize; } if (!textContainer[tci].tHollow) { textContainer[tci].tHollow = []; textContainer[tci].tUnderline = []; textContainer[tci].tDeleteline = []; textContainer[tci].tTopline = []; textContainer[tci].tFontColor = []; textContainer[tci].font = []; textContainer[tci].subScriptOffY = []; } textContainer[tci].tHollow[tj] = tHollow; textContainer[tci].tUnderline[tj] = tUnderline; textContainer[tci].tDeleteline[tj] = tDeleteline; textContainer[tci].tTopline[tj] = tTopline; textContainer[tci].tFontColor[tj] = tFontColor; textContainer[tci].font[tj] = font; textContainer[tci].subScriptOffY[tj] = subScriptOffY; let ofY = rRect.height - height + subScriptOffY; if (tempIdx >= curSIdx && tempIdx < curEIdx) { ctx.save(); ctx.fillStyle = "#017fff"; ctx.globalAlpha = 0.4; ctx.fillRect(usedX - 0.5, y1 + ofY, width + 1, height); ctx.restore(); } else if (tBgColor) { ctx.save(); ctx.fillStyle = DDeiUtil$1.getColor(tBgColor); ctx.fillRect(usedX - 0.5, y1 + ofY, width + 1, height); ctx.restore(); } if (curSIdx == curEIdx && tempIdx == curEIdx) { cursorX = usedX; cursorHeight = tj > 1 ? textContainer[tci].heights[tj - 1] : height; ofY = rRect.height - cursorHeight + (tj > 1 ? textContainer[tci].subScriptOffY[tj - 1] : subScriptOffY); cursorY = y1 + ofY; } ctx.fillStyle = tFontColor; ctx.font = font; lastUsedY = y1 + ofY; lastUsedX = usedX; usedX += width; ctx.restore(); } usedX = x1; for (let tj = 0; tj < textContainer[tci].text.length; tj++) { let outputText = textContainer[tci].text[tj]; let width = textContainer[tci].widths[tj]; let height = textContainer[tci].heights[tj]; ctx.save(); let tHollow = textContainer[tci].tHollow[tj]; let tUnderline = textContainer[tci].tUnderline[tj]; let tDeleteline = textContainer[tci].tDeleteline[tj]; let tTopline = textContainer[tci].tTopline[tj]; let tFontColor = textContainer[tci].tFontColor[tj]; let font = textContainer[tci].font[tj]; let subScriptOffY = textContainer[tci].subScriptOffY[tj]; let ofY = rRect.height - height + subScriptOffY; ctx.fillStyle = tFontColor; ctx.font = font; if (tHollow == "1") { ctx.strokeStyle = tFontColor; ctx.strokeText(outputText, usedX, y1 + ofY); } else { ctx.fillText(outputText, usedX, y1 + ofY); } if (curSIdx != -1 && curEIdx != -1) { textContainer[0].textPosCache.push({ x: usedX, y: y1 + ofY }); } if (tUnderline == "1") { ctx.beginPath(); ctx.strokeStyle = tFontColor; ctx.moveTo(usedX, y1 + ofY + height); ctx.lineTo(usedX + width, y1 + ofY + height); ctx.closePath(); ctx.stroke(); } if (tDeleteline == "1") { ctx.beginPath(); ctx.strokeStyle = tFontColor; ctx.moveTo(usedX, y1 + ofY + height / 2); ctx.lineTo(usedX + width, y1 + ofY + height / 2); ctx.closePath(); ctx.stroke(); } if (tTopline == "1") { ctx.beginPath(); ctx.strokeStyle = tFontColor; ctx.moveTo(usedX, y1 + ofY); ctx.lineTo(usedX + width, y1 + ofY); ctx.closePath(); ctx.stroke(); } usedX += width; ctx.restore(); } usedY += rRect.height; } if (cursorX != -Infinity && cursorY != -Infinity && curSIdx == curEIdx) { ctx.strokeStyle = "black"; ctx.lineWidth = 1.5; ctx.beginPath(); ctx.moveTo(cursorX, cursorY - 2); ctx.lineTo(cursorX, cursorY + cursorHeight + 2); ctx.closePath(); ctx.stroke(); } else if ((editorText == null ? void 0 : editorText.selectionEnd) == cText.length) { ctx.strokeStyle = "black"; ctx.lineWidth = 1.5; ctx.beginPath(); ctx.moveTo(lastUsedX + lastWidth, lastUsedY - 2); ctx.lineTo(lastUsedX + lastWidth, lastUsedY + lastHeight + 2); ctx.closePath(); ctx.stroke(); } this.textUsedArea = textContainer; } ctx.restore(); } /** * 计算除边框外的填充区域,用于填充颜色和字体 */ getFillArea() { let type = this.getBorderInfo(null, 1, "type"); let color = this.getBorderInfo(null, 1, "color"); let opacity = this.getBorderInfo(null, 1, "opacity"); let width = this.getBorderInfo(null, 1, "width"); if (!(!(type == 0 || type == "0") && color && (!opacity || opacity > 0) && width > 0)) { width = 0; } return { x: this.model.x + width, y: this.model.y + width, width: this.model.width - 2 * width, height: this.model.height - 2 * width }; } /** * 计算除边框外的填充区域,用于填充颜色和字体 */ getFillAreaPVS() { let topDisabled = this.getCachedValue("border.top.disabled"); let topColor = this.getCachedValue("border.top.color"); let topOpac = this.getCachedValue("border.top.opacity"); let topWidth = this.getCachedValue("border.top.width"); let rightDisabled = this.getCachedValue("border.right.disabled"); let rightColor = this.getCachedValue("border.right.color"); let rightOpac = this.getCachedValue("border.right.opacity"); let rightWidth = this.getCachedValue("border.right.width"); let bottomDisabled = this.getCachedValue("border.bottom.disabled"); let bottomColor = this.getCachedValue("border.bottom.color"); let bottomOpac = this.getCachedValue("border.bottom.opacity"); let bottomWidth = this.getCachedValue("border.bottom.width"); let leftDisabled = this.getCachedValue("border.left.disabled"); let leftColor = this.getCachedValue("border.left.color"); let leftOpac = this.getCachedValue("border.left.opacity"); let leftWidth = this.getCachedValue("border.left.width"); if (!(!leftDisabled && leftColor && (!leftOpac || leftOpac > 0) && leftWidth > 0)) { leftWidth = 0; } if (!(!rightDisabled && rightColor && (!rightOpac || rightOpac > 0) && rightWidth > 0)) { rightWidth = 0; } if (!(!topDisabled && topColor && (!topOpac || topOpac > 0) && topWidth > 0)) { bottomWidth = 0; } if (!(!bottomDisabled && bottomColor && (!bottomOpac || bottomOpac > 0) && bottomWidth > 0)) { bottomWidth = 0; } topWidth = topWidth / 2; bottomWidth = bottomWidth / 2; leftWidth = leftWidth / 2; rightWidth = rightWidth / 2; let fillPVS = cloneDeep(this.model.pvs); let move1Matrix = new Matrix3( 1, 0, -this.model.cpv.x, 0, 1, -this.model.cpv.y, 0, 0, 1 ); fillPVS.forEach((fpv) => { fpv.applyMatrix3(move1Matrix); }); if (this.model.rotate && this.model.rotate != 0) { let angle2 = (this.model.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); fillPVS.forEach((fpv) => { fpv.applyMatrix3(rotateMatrix); }); } fillPVS[1].x -= rightWidth; fillPVS[0].y += topWidth; fillPVS[2].x -= rightWidth; fillPVS[1].y += topWidth; fillPVS[2].y -= bottomWidth; fillPVS[3].y -= bottomWidth; fillPVS[0].x += leftWidth; fillPVS[3].x += leftWidth; this.tempFillAreaRect = { x: fillPVS[0].x, y: fillPVS[0].y, width: fillPVS[1].x - fillPVS[0].x, height: fillPVS[3].y - fillPVS[0].y }; if (this.model.rotate && this.model.rotate != 0) { let angle2 = -(this.model.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); fillPVS.forEach((fpv) => { fpv.applyMatrix3(rotateMatrix); }); } let move2Matrix = new Matrix3( 1, 0, this.model.cpv.x, 0, 1, this.model.cpv.y, 0, 0, 1 ); fillPVS.forEach((fpv) => { fpv.applyMatrix3(move2Matrix); }); return fillPVS; } // ============================== 事件 =============================== /** * 鼠标按下事件 */ mouseDown(evt) { super.mouseDown(evt); } /** * 绘制图形 */ mouseUp(evt) { super.mouseUp(evt); } /** * 鼠标移动 */ mouseMove(evt) { super.mouseMove(evt); } /** * 鼠标双击 * @param evt */ dblClick(evt) { } }; __publicField2(_DDeiRectangleCanvasRender, "ClsName", "DDeiRectangleCanvasRender"); let DDeiRectangleCanvasRender = _DDeiRectangleCanvasRender; const __vite_glob_1_7$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiRectangleCanvasRender, default: DDeiRectangleCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiCircleCanvasRender = class _DDeiCircleCanvasRender2 extends DDeiRectangleCanvasRender { // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiCircleCanvasRender2(props); } // ============================== 方法 =============================== /** * 绘制边框 * @param tempBorder 临时border信息 */ drawBorder(tempBorder) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; let ratPos = this.getBorderRatPos(); let borderType = null; let borderColor = null; let borderOpac = null; let borderWidth = null; let borderDash = null; if (tempBorder) { borderType = tempBorder == null ? void 0 : tempBorder.type; borderColor = tempBorder == null ? void 0 : tempBorder.color; borderOpac = tempBorder == null ? void 0 : tempBorder.opacity; borderWidth = tempBorder == null ? void 0 : tempBorder.width; borderDash = tempBorder == null ? void 0 : tempBorder.dash; } else { borderType = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.type", true); borderColor = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.color", true); borderOpac = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.opacity", true); borderWidth = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.width", true); borderDash = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.dash", true); } if ((borderType == 1 || borderType == "1") && borderColor && (!borderOpac || borderOpac > 0) && borderWidth > 0) { ctx.save(); this.doRotate(ctx, ratPos); ctx.beginPath(); ctx.lineWidth = borderWidth * ratio; if (borderDash) { ctx.setLineDash(borderDash); } if (borderOpac) { ctx.globalAlpha = borderOpac; } ctx.strokeStyle = DDeiUtil$1.getColor(border.color); ctx.ellipse(ratPos.x + ratPos.width * 0.5 + 0.5, ratPos.y + ratPos.height * 0.5 + 0.5, ratPos.width * 0.5, ratPos.height * 0.5, 0, 0, Math.PI * 2); ctx.stroke(); ctx.restore(); } } /** * 绘制填充 */ drawFill() { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; let fillAreaE = this.getFillArea(); let ratPos = DDeiUtil$1.getRatioPosition(fillAreaE, ratio); ctx.save(); this.doRotate(ctx, ratPos); let fillColor = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "fill.color", true); if (fillColor) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); let fillOpac = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "fill.opacity", true); if (fillOpac) { ctx.globalAlpha = fillOpac; } ctx.ellipse(ratPos.x + ratPos.width * 0.5, ratPos.y + ratPos.height * 0.5, ratPos.width * 0.5, ratPos.height * 0.5, 0, 0, Math.PI * 2); ctx.fill(); } ctx.restore(); } /** * 填充图片 */ drawImage() { if (this.imgObj) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; let fillAreaE = this.getFillArea(); let ratPos = DDeiUtil$1.getRatioPosition(fillAreaE, ratio); ctx.save(); this.doRotate(ctx, ratPos); let imgFillInfo = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "image.opacity", true); if (imgFillInfo) { ctx.globalAlpha = imgFillInfo; } ctx.ellipse(ratPos.x + ratPos.width * 0.5, ratPos.y + ratPos.height * 0.5, ratPos.width * 0.5, ratPos.height * 0.5, 0, 0, Math.PI * 2); ctx.clip(); ctx.drawImage(this.imgObj, ratPos.x, ratPos.y, ratPos.width, ratPos.height); ctx.restore(); } } /** * 绘制文本 */ drawText() { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; let fillAreaE = this.getFillArea(); let ratPos = DDeiUtil$1.getRatioPosition(fillAreaE, ratio); ctx.textAlign = "left"; ctx.textBaseline = "top"; let fiFamily = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "font.family", true); let fiSize = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "font.size", true); let fiColor = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "font.color", true); let align = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "textStyle.align", true); let valign = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "textStyle.valign", true); let scale = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "textStyle.scale", true); let hollow = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "textStyle.hollow", true); let feed = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "textStyle.feed", true); if (!fiFamily) { return; } if (!align) { align = 1; } if (!valign) { valign = 2; } if (!scale) { scale = 0; } if (!hollow) { hollow = 0; } if (!feed) { feed = 0; } ctx.save(); this.doRotate(ctx, ratPos); let textContainer = []; let loop2 = true; let fontSize = fiSize * ratio; let cText = this.model.text; cText = "" + cText; let contentWidth = ratPos.width; while (loop2) { let usedWidth = 0; let usedHeight = 0; let textRowContainer = { text: "" }; textContainer.push(textRowContainer); let isOutSize = false; if (fontSize > ratPos.height) { if (scale == 1) { textContainer = []; fontSize = fontSize - 0.5; continue; } } ctx.font = fontSize + "px " + fiFamily; ctx.fillStyle = fiColor; for (let ti = 0; ti < cText.length; ti++) { let te = cText[ti]; textRowContainer.text += te; let fontShapeRect = ctx.measureText(textRowContainer.text); usedWidth = fontShapeRect.width; let fontHeight = parseFloat(fontSize); textRowContainer.width = usedWidth; textRowContainer.height = fontHeight; if (feed == 0) { if (scale == 1 && usedWidth > contentWidth) { isOutSize = true; break; } else if (usedWidth > contentWidth) { textRowContainer.text = textRowContainer.text.substring(0, textRowContainer.text.length - 1); let fontShapeRect2 = ctx.measureText(textRowContainer.text); usedWidth = fontShapeRect2.width; textRowContainer.width = usedWidth; break; } } else if (feed == 1) { if (usedWidth > contentWidth) { textRowContainer.text = textRowContainer.text.substring(0, textRowContainer.text.length - 1); let fontShapeRect2 = ctx.measureText(textRowContainer.text); textRowContainer.width = fontShapeRect2.width; usedWidth = 0; usedHeight += fontHeight; if (usedHeight + fontHeight > ratPos.height) { if (scale == 1) { isOutSize = true; } break; } textRowContainer = { text: te }; fontShapeRect2 = ctx.measureText(textRowContainer.text); usedWidth = fontShapeRect2.width; textRowContainer.width = usedWidth; textRowContainer.height = fontHeight; textContainer.push(textRowContainer); } } } if (!isOutSize) { loop2 = false; } else { textContainer = []; fontSize = fontSize - 0.5; } } let containerRect = { width: 0, height: 0 }; for (let i2 = 0; i2 < textContainer.length; i2++) { if (i2 == 0) { containerRect.width += textContainer[i2].width; } containerRect.height += textContainer[i2].height; } let containerWidth = containerRect.width; let containerHeight = containerRect.height; let x2, y2; if (align == 1) { x2 = 0; } else if (align == 2) { x2 = (ratPos.width - containerWidth) * 0.5; } else if (align == 3) { x2 = ratPos.width - containerWidth; } x2 = x2 + ratPos.x; if (valign == 1) { y2 = 0; } else if (valign == 2) { y2 = (ratPos.height - containerHeight) * 0.5; } else if (valign == 3) { y2 = ratPos.height - containerHeight; } y2 = y2 + ratPos.y; if (feed == 1) { for (let tci = 0; tci < textContainer.length; tci++) { let rRect = textContainer[tci]; if (align == 1) { if (hollow == 1) { ctx.strokeText(rRect.text, x2, y2 + rRect.height * tci); } else { ctx.fillText(rRect.text, x2, y2 + rRect.height * tci); } } else if (align == 2) { if (hollow == 1) { ctx.strokeText(rRect.text, ratPos.x + (ratPos.width - rRect.width) * 0.5, y2 + rRect.height * tci); } else { ctx.fillText(rRect.text, ratPos.x + (ratPos.width - rRect.width) * 0.5, y2 + rRect.height * tci); } } else if (align == 3) { if (hollow == 1) { ctx.strokeText(rRect.text, ratPos.x + (ratPos.width - rRect.width), y2 + rRect.height * tci); } else { ctx.fillText(rRect.text, ratPos.x + (ratPos.width - rRect.width), y2 + rRect.height * tci); } } } } else { if (hollow == 1) { ctx.strokeText(textContainer[0].text, x2, y2); } else { ctx.fillText(textContainer[0].text, x2, y2); } } ctx.restore(); } /** * 私有函数,计算除边框外的填充区域,用于填充颜色 */ getFillArea() { let borderType = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.type", true); let borderColor = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.color", true); let borderOpac = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.opacity", true); let borderWidth = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border.width", true); if (!((borderType == 1 || borderType == "1") && borderColor && (!borderOpac || borderOpac > 0) && borderWidth > 0)) { borderWidth = 0; } let absBounds = this.model.getAbsBounds(); let fillAreaE = { x: absBounds.x + borderWidth, y: absBounds.y + borderWidth, width: absBounds.width - borderWidth - borderWidth, height: absBounds.height - borderWidth - borderWidth }; return fillAreaE; } /** * 私有函数,计算除边框外的填充区域字体 */ getTextArea(fillArea, fInfo) { let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; if (!fillArea) { fillArea = this.getFillArea(); fillArea = DDeiUtil$1.getRatioPosition(fillArea, ratio); } if (!fInfo) { fInfo = this.model.font && this.model.font.default ? this.model.font.default : DDeiConfig$1.CIRCLE.FONT.default; if (this.model.state == DDeiEnumControlState.SELECTED) { fInfo = this.model.font && this.model.font.selected ? this.model.font.selected : DDeiConfig$1.CIRCLE.FONT.selected; } } fInfo.size * ratio; fillArea.width * 0.5; } }; __publicField2(_DDeiCircleCanvasRender, "ClsName", "DDeiCircleCanvasRender"); let DDeiCircleCanvasRender = _DDeiCircleCanvasRender; const __vite_glob_1_0$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiCircleCanvasRender, default: DDeiCircleCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiCanvasRender = class _DDeiCanvasRender2 { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "model"); __publicField2(this, "canvas", null); __publicField2(this, "tempCanvas", null); __publicField2(this, "ratio", 1); this.model = props.model; } // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiCanvasRender2(props); } // ============================== 方法 =============================== /** * 初始化 */ init() { this.container = document.getElementById(this.model.containerid); if (this.container) { if (this.container.children.length > 0) { let cvs = this.container.getElementsByTagName("canvas"); while ((cvs == null ? void 0 : cvs.length) > 0) { cvs[0].remove(); } } if (this.model.width) { this.container.style.width = this.model.width + "px"; } if (this.model.height) { this.container.style.height = this.model.height + "px"; } this.realCanvas = document.createElement("canvas"); this.realCanvas.setAttribute("id", this.model.id + "_canvas"); let ctx = this.realCanvas.getContext("2d"); let ratio = Math.max(this.model.pixel, DDeiUtil$1.getPixelRatio(ctx)); this.container.appendChild(this.realCanvas); let w = this.model.width ? this.model.width : this.container.clientWidth; let h = this.model.height ? this.model.height : this.container.clientHeight; this.canvas = this.realCanvas; this.realCanvas.setAttribute("style", "pointer-events:none;z-index:100;position:absolute;-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / ratio + ");display:block;zoom:" + 1 / ratio); this.realCanvas.setAttribute("width", w * ratio); this.realCanvas.setAttribute("height", h * ratio); this.ratio = ratio * window.remRatio; this.bindEvent(); } else { throw new Error("容器" + this.model.containerid + "不存在"); } } // webglTest() { // let canvas = document.createElement('canvas'); // canvas.setAttribute("width", 480) // canvas.setAttribute("height", 240) // canvas.setAttribute("style", "border:1px solid red;position:absolute;left:0;top:400px;") // document.body.appendChild(canvas) // let gl = canvas.getContext('webgl') // gl.viewport(0, 0, 480, 240) // //创建顶点着色器 // const vertexShader = gl.createShader(gl.VERTEX_SHADER) // //创建片元着色器 // const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER) // //顶点着色器代码 // const vertexShaderSource = ` // attribute vec4 a_pos; // void main() { // gl_Position = a_pos; // } // ` // //片元着色器代码 // const fragmentShaderSource = ` // void main() { // gl_FragColor = vec4(0.0,0.0,0.0,1.0); // } // ` // //绑定数据源 // gl.shaderSource(vertexShader, vertexShaderSource) // gl.shaderSource(fragmentShader, fragmentShaderSource) // // 编译着色器 // gl.compileShader(vertexShader) // gl.compileShader(fragmentShader) // // 创建着色器程序 // const program = gl.createProgram() // gl.attachShader(program, vertexShader) // gl.attachShader(program, fragmentShader) // // 链接 并使用着色器 // gl.linkProgram(program) // gl.useProgram(program) // gl.program = program // // //错误输出日志 // // const success = gl.getProgramParameter(program, gl.LINK_STATUS) // // if (success) { // // gl.useProgram(program) // // return program // // } // // console.error(gl.getProgramInfoLog(program), 'test---') // // gl.deleteProgram(program) // //抗锯齿 // // gl.enable(gl.MULTISAMPLE) // //创建顶点缓冲对象 // const buffer = gl.createBuffer() // //把标识符buffer设置为当前缓冲区,后面的所有的数据都会都会被放入当前缓冲区,直到bindBuffer绑定另一个当前缓冲区 // gl.bindBuffer(gl.ARRAY_BUFFER, buffer) // //构造三角形的点 // let data = new Float32Array([-0.2, 0.5, // -0.5, -0.3, // 0, -0.3, // 0.29, 0.5]) // gl.bufferData(gl.ARRAY_BUFFER, data, gl?.DYNAMIC_DRAW) // //从刚才创建的GLSL着色程序中找到这个属性值所在的位置。 // const aposlocation = gl.getAttribLocation(program, 'a_pos') // gl.enableVertexAttribArray(aposlocation) // //从缓冲中读取数据绑定给被激活的aposlocation的位置 // gl.vertexAttribPointer(aposlocation, 2, gl.FLOAT, false, 2 * 4, 0 * 4) // //渲染 // //清空颜色 // gl.clearColor(1, 1, 1, 1) // gl.clear(gl.COLOR_BUFFER_BIT) // // gl.drawArrays(gl?.LINE_LOOP, 0, 4) // //索引缓冲区,可以控制绘制的顺序 // let indexArr = new Uint16Array([ // 0, 1, 2, // 0, 3, 1, // ]); // let indexBuffer = gl?.createBuffer() // gl?.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer) // gl?.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArr, gl.STATIC_DRAW) // gl?.drawElements(gl.TRIANGLES, indexArr.length, gl.UNSIGNED_SHORT, 0) // let indexArr1 = new Uint16Array([ // 1, 2, 3 // ]); // gl?.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer) // gl?.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArr1, gl.STATIC_DRAW) // gl?.drawElements(gl.LINE_LOOP, indexArr1.length, gl.UNSIGNED_SHORT, 0) // // data = new Float32Array([0.3, 0.5, 0.1, -0.3, 0.5, -0.3]) // // gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW) // // gl.drawArrays(gl?.LINE_LOOP, 0, 3) // // gl.drawArrays(gl?.TRIANGLES, 0, 3) // } /** * 获取当前画布 */ getCanvas() { if (this.tempCanvas) { return this.tempCanvas; } return this.canvas; } /** * 显示 */ show() { document.getElementById(this.model.containerid).style.display = "block"; } /** * 隐藏 */ hidden() { document.getElementById(this.model.containerid).style.display = "none"; } /** * 重新设置大小 */ setSize(width = 0, height = 0, deltaX = 0, deltaY = 0) { if (!width || width == 0) { width = this.container.clientWidth; } width += deltaX; if (!height || height == 0) { height = this.container.clientHeight; } height += deltaY; this.realCanvas.setAttribute("width", width * this.ratio / window.remRatio); this.realCanvas.setAttribute("height", height * this.ratio / window.remRatio); } /** * 绘制图形 */ drawShape() { var _a3, _b2; if (this.model.stage) { if (((_a3 = this.model.stage.render) == null ? void 0 : _a3.refresh) || ((_b2 = this.model.stage.render) == null ? void 0 : _b2.editorShadowControl)) { this.model.stage.render.drawShape(); this.model.stage.drawing = false; this.model.stage.render.refresh = false; } } else { throw new Error("当前实例未加载舞台模型,无法渲染图形"); } } // ============================== 事件 =============================== /** * 绑定事件 */ bindEvent() { this.interval = setInterval(() => { if (this.model.render != this) { this.destroyRender(); } else if (!this.model.disabled) { let allowBackActive = DDeiUtil$1.isBackActive(this.model); if (allowBackActive) { this.mouseInEdge(); } this.model.stage.drawing = true; this.drawShape(); } }, 20); } destroyed() { if (this.interval) { clearInterval(this.interval); } } /** * 鼠标在画布边缘 */ mouseInEdge() { var _a3, _b2; if (this.upInEdge != this.inEdge) { this.inEdgeTime = 0; this.upInEdge = this.inEdge; } if (this.inEdge) { this.inEdgeTime += 20; (_b2 = (_a3 = this.model.stage) == null ? void 0 : _a3.render) == null ? void 0 : _b2.mouseInEdge(this.inEdge, this.inEdgeTime); } DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_IN_AREA", "MOUSE_IN_AREA", { x: this.inAreaX, y: this.inAreaY, models: this.inAreaControls }, this.model, null); } /** * 鼠标按下事件 */ mouseDown(evt) { this.model.eventCancel = false; this.model.stage.render.mouseDown(evt); } /** * 绘制图形 */ mouseUp(evt) { this.model.eventCancel = false; this.model.stage.render.mouseUp(evt); } /** * 鼠标移动 */ mouseMove(evt) { let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; let sx = evt.screenX; let sy = evt.screenY; sx /= window.remRatio; sy /= window.remRatio; let stage2 = this.model.stage; ex -= stage2.wpv.x; ey -= stage2.wpv.y; sx -= stage2.wpv.x; sy -= stage2.wpv.y; this.model.eventCancel = false; this.model.stage.render.mouseMove(evt); } /** * 鼠标滚轮或滑动事件 */ mouseWheel(evt) { let wheelDeltaY = evt.wheelDeltaY; let wheelDeltaYAbs = Math.abs(wheelDeltaY); if (wheelDeltaYAbs > 0 && wheelDeltaYAbs % 120 == 0) { if (DDeiUtil$1.getConfigValue("GLOBAL_ALLOW_STAGE_RATIO", this.model)) { this.mouseScale(evt.wheelDeltaY, evt); } } else if (evt.wheelDeltaX || evt.wheelDeltaY) { let ctrl = DDei.KEY_DOWN_STATE.get("ctrl"); if (DDeiUtil$1.getConfigValue("GLOBAL_ALLOW_STAGE_RATIO", this.model) && ctrl && evt.wheelDeltaY) { this.mouseScale(evt.wheelDeltaY, evt); } else { let dx = 0; let dy = 0; if (Math.abs(evt.wheelDeltaX) > Math.abs(evt.wheelDeltaY)) { dx = evt.wheelDeltaX; } else { dy = evt.wheelDeltaY; } this.mouseWPV(dx, dy, evt); } } } /** * 通过鼠标放大或缩小 */ mouseScale(delta, evt) { let stage2 = this.model.stage; if (stage2) { let ratio = stage2.getStageRatio(); let newValue = ratio; let dn = 0.02 * ratio; if (delta > 0) { newValue = ratio + dn; } else { newValue = ratio - dn; } if (newValue < 0.1) { newValue = 0.1; } else if (newValue > 10) { newValue = 10; } if (newValue != ratio) { stage2.setStageRatio(newValue); if (!this.model.ratioWatch) { this.model.bus.push( DDeiEnumBusCommandType.ChangeStageRatio, { oldValue: ratio, newValue }, null ); this.model.bus.executeAll(); } } } } /** * 通过鼠标平移窗体 */ mouseWPV(dx, dy, evt) { let stage2 = this.model.stage; let rat1 = this.ratio; let stageRatio2 = stage2.getStageRatio(); if (stage2) { let maxMove = 75 * stageRatio2 * rat1; dx *= stageRatio2 * rat1; dy *= stageRatio2 * rat1; if (dx > maxMove) { dx = maxMove; } else if (dx < -maxMove) { dx = -maxMove; } if (dy > maxMove) { dy = maxMove; } else if (dy < -maxMove) { dy = -maxMove; } this.model.bus.push(DDeiEnumBusCommandType.ChangeStageWPV, { dragObj: { dx: 0, dy: 0 }, x: dx, y: dy }); this.model.bus.executeAll(); } } }; __publicField2(_DDeiCanvasRender, "ClsName", "DDeiCanvasRender"); let DDeiCanvasRender = _DDeiCanvasRender; const __vite_glob_1_1$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: DDeiCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiDiamondCanvasRender = class _DDeiDiamondCanvasRender2 extends DDeiRectangleCanvasRender { // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiDiamondCanvasRender2(props); } // ============================== 方法 =============================== /** * 创建图形 */ drawShape() { this.drawBorderAndFill(); this.drawImage(); this.drawText(); } /** * 填充图片 */ drawImage() { if (this.imgObj) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = parseFloat(this.stage.ratio) ? this.stage.ratio : 1; if (!stageRatio2 || isNaN(stageRatio2)) { stageRatio2 = 1; } let ratio = this.ddRender.ratio * stageRatio2; let fillAreaE = this.getFillArea(); let ratPos = DDeiUtil$1.getRatioPosition(fillAreaE, ratio); ctx.save(); this.doRotate(ctx, ratPos); let imgFillInfo = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "image.opacity", true); if (imgFillInfo) { ctx.globalAlpha = imgFillInfo; } ctx.beginPath(); ctx.moveTo(ratPos.x + ratPos.width * 0.5, ratPos.y); ctx.lineTo(ratPos.x + ratPos.width, ratPos.y + ratPos.height * 0.5); ctx.lineTo(ratPos.x + ratPos.width * 0.5, ratPos.y + ratPos.height); ctx.lineTo(ratPos.x, ratPos.y + ratPos.height * 0.5); ctx.lineTo(ratPos.x + ratPos.width * 0.5, ratPos.y); ctx.clip(); ctx.drawImage(this.imgObj, ratPos.x, ratPos.y, ratPos.width, ratPos.height); ctx.closePath(); ctx.restore(); } } /** * 绘制边框 * @param tempBorder 临时边框,优先级最高 */ drawBorderAndFill(tempBorder) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; let ratPos = this.getBorderRatPos(); ctx.save(); if (this.model.rotate) { ctx.translate(ratPos.x + ratPos.width * 0.5, ratPos.y + ratPos.height * 0.5); ctx.rotate(this.model.rotate * DDeiConfig$1.ROTATE_UNIT); ctx.translate(-ratPos.x - ratPos.width * 0.5, -ratPos.y - ratPos.height * 0.5); } for (let i2 = 1; i2 <= 4; i2++) { let disabled = this.getBorderInfo(tempBorder, i2, "disabled"); let color = this.getBorderInfo(tempBorder, i2, "color"); let opacity = this.getBorderInfo(tempBorder, i2, "opacity"); let width = this.getBorderInfo(tempBorder, i2, "width"); let dash = this.getBorderInfo(tempBorder, i2, "dash"); if (!disabled && color && (!opacity || opacity > 0) && width > 0) { ctx.beginPath(); ctx.lineWidth = width * ratio; if (dash) { ctx.setLineDash(dash); } if (opacity != null && opacity != void 0) { ctx.globalAlpha = opacity; } ctx.strokeStyle = DDeiUtil$1.getColor(color); if (i2 == 1) { ctx.moveTo(ratPos.x + ratPos.width * 0.5, ratPos.y); ctx.lineTo(ratPos.x + ratPos.width, ratPos.y + ratPos.height * 0.5); } else if (i2 == 2) { ctx.moveTo(ratPos.x + ratPos.width, ratPos.y + ratPos.height * 0.5); ctx.lineTo(ratPos.x + ratPos.width * 0.5, ratPos.y + ratPos.height); } else if (i2 == 3) { ctx.moveTo(ratPos.x + ratPos.width * 0.5, ratPos.y + ratPos.height); ctx.lineTo(ratPos.x, ratPos.y + ratPos.height * 0.5); } else if (i2 == 4) { ctx.moveTo(ratPos.x, ratPos.y + ratPos.height * 0.5); ctx.lineTo(ratPos.x + ratPos.width * 0.5, ratPos.y); } ctx.stroke(); ctx.closePath(); } } let fillColor = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "fill.color", true); if (fillColor) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); let fillOpac = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "fill.opacity", true); if (fillOpac) { ctx.globalAlpha = fillOpac; } ctx.beginPath(); ctx.moveTo(ratPos.x + ratPos.width * 0.5, ratPos.y); ctx.lineTo(ratPos.x + ratPos.width, ratPos.y + ratPos.height * 0.5); ctx.lineTo(ratPos.x + ratPos.width * 0.5, ratPos.y + ratPos.height); ctx.lineTo(ratPos.x, ratPos.y + ratPos.height * 0.5); ctx.lineTo(ratPos.x + ratPos.width * 0.5, ratPos.y); ctx.closePath(); ctx.fill(); } ctx.restore(); } }; __publicField2(_DDeiDiamondCanvasRender, "ClsName", "DDeiDiamondCanvasRender"); let DDeiDiamondCanvasRender = _DDeiDiamondCanvasRender; const __vite_glob_1_2$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiDiamondCanvasRender, default: DDeiDiamondCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiLayerCanvasRender = class _DDeiLayerCanvasRender2 { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "model"); __publicField2(this, "stage"); __publicField2(this, "ddRender"); __publicField2(this, "stageRender"); __publicField2(this, "renderCacheData", /* @__PURE__ */ new Map()); __publicField2(this, "containerViewer", null); this.model = props.model; this.ddRender = null; } // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiLayerCanvasRender2(props); } // ============================ 方法 =============================== /** * 初始化 */ init() { this.ddRender = this.model.stage.ddInstance.render; this.stage = this.model.stage; this.stageRender = this.model.stage.render; this.initContainerViewer(); } initContainerViewer() { var _a3; if (!this.containerViewer) { let editorId = DDeiUtil$1.getEditorId((_a3 = this.ddRender) == null ? void 0 : _a3.model); this.containerViewer = document.getElementById(editorId + "_layer_" + this.model.id); if (!this.containerViewer) { let canvasViewerElement = this.ddRender.getCanvas().parentElement; if (canvasViewerElement) { let containerElement = document.createElement("div"); containerElement.setAttribute("class", "ddei-editor-canvasview-contentlayer"); containerElement.setAttribute("id", editorId + "_layer_" + this.model.id); canvasViewerElement.insertBefore(containerElement, this.ddRender.realCanvas); this.containerViewer = containerElement; } } } } /** * 清空shadowControl */ clearShadowControls() { var _a3; (_a3 = this.model.shadowControls) == null ? void 0 : _a3.forEach((c) => { if (c.isShadowControl) { c.destroyed(); } }); this.model.shadowControls = []; } /** * 绘制图形 */ drawShape(inRect = true) { var _a3, _b2, _c2; this.initContainerViewer(); if (this.model.display || this.model.tempDisplay) { let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_BEFORE", DDeiEnumOperateType.VIEW, { models: [this.model] }, (_a3 = this.stage) == null ? void 0 : _a3.ddInstance, null); if (rsState == 0 || rsState == 1) { let rsState1 = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", DDeiEnumOperateType.VIEW, { models: [this.model] }, (_b2 = this.stage) == null ? void 0 : _b2.ddInstance, null); if (rsState1 == 0 || rsState1 == 1) { this.containerViewer.style.display = "block"; this.containerViewer.style.zIndex = this.tempZIndex; this.drawChildrenShapes(inRect); this.drawOpPoints(); this.drawOpLine(); this.drawDragInOutPoints(); this.drawShadowControls(); this.modelChanged = false; } DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_AFTER", DDeiEnumOperateType.VIEW, { models: [this.model] }, (_c2 = this.stage) == null ? void 0 : _c2.ddInstance, null); } } else { this.containerViewer.style.display = "none"; this.drawChildrenShapes(inRect, true); } } /** * 绘制背景 */ drawBackground(px, py, pw, ph, isBottom) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m; this.initContainerViewer(); if (this.containerViewer && (this.model.display || this.model.tempDisplay)) { let ratio = this.ddRender.ratio; if (!this.bgCanvas) { let editorId = DDeiUtil$1.getEditorId((_a3 = this.ddRender) == null ? void 0 : _a3.model); this.bgCanvas = document.getElementById(editorId + "_layerbg_" + this.model.id); if (!this.bgCanvas) { let bgCanvas = document.createElement("canvas"); bgCanvas.setAttribute("style", "z-index:0;position:absolute;-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / ratio + ");display:block;zoom:" + 1 / ratio); bgCanvas.setAttribute("id", editorId + "_layerbg_" + this.model.id); this.containerViewer.appendChild(bgCanvas); this.bgCanvas = bgCanvas; } } this.bgCanvas.setAttribute("width", this.containerViewer.clientWidth * ratio); this.bgCanvas.setAttribute("height", this.containerViewer.clientHeight * ratio); let canvas = this.bgCanvas; let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.ratio; ctx.save(); let ruleWeight = 0; if (this.stageRender.tempRuleDisplay == 1 || this.stageRender.tempRuleDisplay == "1") { ruleWeight = 15; } ctx.translate(-ruleWeight * rat1, -ruleWeight * rat1); let bgInit; if (((_b2 = this.ddRender) == null ? void 0 : _b2.model.background) && typeof ((_c2 = this.ddRender) == null ? void 0 : _c2.model.background) == "object") { bgInit = (_d2 = this.ddRender) == null ? void 0 : _d2.model.background; } let bgInfoType = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.type", true, bgInit); let bgInfoColor; if ((_e2 = this.model.bg) == null ? void 0 : _e2.color) { bgInfoColor = this.model.bg.color; } else if ((_f = this.ddRender) == null ? void 0 : _f.model.background) { if (typeof ((_g = this.ddRender) == null ? void 0 : _g.model.background) == "string" || typeof ((_h = this.ddRender) == null ? void 0 : _h.model.background) == "number") { if (((_i = this.ddRender) == null ? void 0 : _i.model.background) == "-1" || ((_j = this.ddRender) == null ? void 0 : _j.model.background) == -1) { bgInfoType = -1; } else { bgInfoColor = (_k = this.ddRender) == null ? void 0 : _k.model.background; if (!bgInfoType) { bgInfoType = 1; } } } else { bgInfoColor = (_l = this.ddRender) == null ? void 0 : _l.model.background.color; } } else { bgInfoColor = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.color", true); } if (!bgInfoColor && isBottom) { bgInfoColor = DDeiUtil$1.getStyleValue("panel-background", this.ddRender.model); } if (bgInfoType == 1) { if (bgInfoColor) { let bgInfoOpacity = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.opacity", true, bgInit); ctx.fillStyle = DDeiUtil$1.getColor(bgInfoColor); if (bgInfoOpacity || bgInfoOpacity == 0) { ctx.globalAlpha = bgInfoOpacity; } ctx.fillRect(px, py, pw, ph); } } else if (bgInfoType == 2) { let bgImage = DDeiUtil$1.getReplacibleValue(this.model, "bg.image"); if (!bgImage) { bgImage = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.image", true, bgInit); } if (!this.bgImgObj || bgImage != this.upBgImage) { this.initBgImage(); } else { let bgImgMode = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.imageMode", true, bgInit); let bgInfoOpacity = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.opacity", true, bgInit); if (bgInfoOpacity || bgInfoOpacity == 0) { ctx.globalAlpha = bgInfoOpacity; } let x2 = px; let y2 = py; let w = this.bgImgObj.width; let h = this.bgImgObj.height; let cwidth = pw; let cheight = ph; let ruleDisplay; if ((_m = this.stage.ruler) == null ? void 0 : _m.display) { ruleDisplay = this.stage.ruler.display; } else if (this.stage.ddInstance.ruler != null && this.stage.ddInstance.ruler != void 0) { if (typeof this.model.ddInstance.ruler == "boolean") { ruleDisplay = this.stage.ddInstance.ruler ? 1 : 0; } else { ruleDisplay = this.stage.ddInstance.ruler.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(this.stage, "ruler.display", true); } if (ruleDisplay == 1) { cwidth -= 16 * rat1; cheight -= 16 * rat1; } let scrollWeight = rat1 * 15; if (this.stageRender.hScroll == 1) { cheight -= scrollWeight; } if (this.stageRender.vScroll == 1) { cwidth -= scrollWeight; } if (bgImgMode == 2) { w = cwidth; h = cheight; } else if (bgImgMode == 1) { let bgImageScale = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.imageScale", true, bgInit); w = w * bgImageScale; h = h * bgImageScale; } if (bgImgMode != 2) { let bgImageAlign = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.imageAlign", true, bgInit); let align = 2; let valign = 2; switch (bgImageAlign) { case 1: align = 1; valign = 1; break; case 2: align = 2; valign = 1; break; case 3: align = 3; valign = 1; break; case 4: align = 1; valign = 2; break; case 5: align = 2; valign = 2; break; case 6: align = 3; valign = 2; break; case 7: align = 1; valign = 3; break; case 8: align = 2; valign = 3; break; case 9: align = 3; valign = 3; break; } switch (align) { case 1: x2 = px; break; case 2: x2 = px + (cwidth - w) / 2; break; case 3: x2 = px + cwidth - w; break; } switch (valign) { case 1: y2 = py; break; case 2: y2 = py + (cheight - h) / 2; break; case 3: y2 = py + cheight - h; break; } } ctx.drawImage(this.bgImgObj, x2, y2, w, h); } } ctx.restore(); } } /** * 初始化背景图片 */ initBgImage() { var _a3, _b2, _c2; let that = this; let bgImage = DDeiUtil$1.getReplacibleValue(this.model, "bg.image"); if (!bgImage) { let bgInit; if (((_a3 = this.ddRender) == null ? void 0 : _a3.model.background) && typeof ((_b2 = this.ddRender) == null ? void 0 : _b2.model.background) == "object") { bgInit = (_c2 = this.ddRender) == null ? void 0 : _c2.model.background; } bgImage = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "bg.image", true, bgInit); } if (this.model.bgImageBase64 || bgImage) { let img = new Image(); img.onload = function() { if (!that.mark) { that.mark = {}; } that.upBgImage = bgImage; that.bgImgObj = img; that.ddRender.model.bus.push(DDeiEnumBusCommandType.RefreshShape, null, null); that.ddRender.model.bus.executeAll(); }; img.src = this.model.bgImageBase64 ? this.model.bgImageBase64 : bgImage; } } /** * 绘制影子元素 */ drawShadowControls() { var _a3; if (((_a3 = this.model.shadowControls) == null ? void 0 : _a3.length) > 0) { this.model.shadowControls.forEach((item) => { item.render.enableRefreshShape(); if (item.modelType == "DDeiLine") { item.render.drawShape({ color: "#017fff", dash: [], opacity: 0.7, fill: { color: "#017fff", opacity: 0.7 } }, 0, null, 99999); } else { item.render.drawShape({ fill: { color: "#017fff", opacity: 0.7 } }, 0, null, 99999); } }); } } /** * 绘制子元素 */ drawChildrenShapes(inRect = true, hidden = false) { var _a3; if (this.model.models) { let canvas = this.ddRender.getCanvas(); let rat1 = this.ddRender.ratio; let stageRatio2 = this.model.getStageRatio(); let x2 = -this.stage.wpv.x / stageRatio2; let y2 = -this.stage.wpv.y / stageRatio2; let x1 = x2 + canvas.width / rat1 / stageRatio2; let y1 = y2 + canvas.height / rat1 / stageRatio2; if (!hidden) { let rect = inRect ? { x: x2, y: y2, x1, y1 } : null; for (let li = 0; li < this.model.midList.length; li++) { let key = this.model.midList[li]; let item = this.model.models.get(key); (_a3 = item == null ? void 0 : item.render) == null ? void 0 : _a3.drawShape(null, 0, rect, this.tempZIndex + (li + 1)); } } else { DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", "VIEW-HIDDEN", { models: Array.from(this.model.models.values()) }, this.ddRender.model, null); } } } /** * 绘制操作点 */ drawOpPoints() { var _a3, _b2, _c2, _d2; if (((_b2 = (_a3 = this.model) == null ? void 0 : _a3.opPoints) == null ? void 0 : _b2.length) > 0) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = (_c2 = this.stage) == null ? void 0 : _c2.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; ctx.save(); let firstOp2Point, beforeOp2Point; (_d2 = this.model) == null ? void 0 : _d2.opPoints.forEach((point2) => { if (!point2 || point2.isSplit) { beforeOp2Point = null; firstOp2Point = null; } else if (point2.mode == 3) { if (point2.oppoint == 2 || point2.oppoint == 4) { if (!beforeOp2Point) { beforeOp2Point = point2; firstOp2Point = point2; } else { let weight = 4; ctx.fillStyle = "white"; ctx.strokeStyle = "#017fff"; ctx.beginPath(); ctx.ellipse((point2.x + beforeOp2Point.x) / 2 * ratio, (point2.y + beforeOp2Point.y) / 2 * ratio, weight * ratio, weight * ratio, 0, 0, Math.PI * 2); ctx.fill(); ctx.stroke(); ctx.closePath(); beforeOp2Point = point2; if (point2.op2close == 1) { ctx.beginPath(); ctx.ellipse((point2.x + firstOp2Point.x) / 2 * ratio, (point2.y + firstOp2Point.y) / 2 * ratio, weight * ratio, weight * ratio, 0, 0, Math.PI * 2); ctx.fill(); ctx.stroke(); ctx.closePath(); } } } else { let weight = 4; ctx.fillStyle = "white"; ctx.strokeStyle = "#017fff"; ctx.beginPath(); ctx.ellipse(point2.x * ratio, point2.y * ratio, weight * ratio, weight * ratio, 0, 0, Math.PI * 2); ctx.fill(); ctx.stroke(); ctx.closePath(); } } else { let weight = 4; if (point2.isMiddle) { weight = 5; } ctx.fillStyle = "white"; ctx.beginPath(); ctx.ellipse(point2.x * ratio, point2.y * ratio, (weight + 1) * ratio, (weight + 1) * ratio, 0, 0, Math.PI * 2); ctx.fill(); ctx.closePath(); if (point2.mode == 1) { ctx.fillStyle = "red"; } else { ctx.fillStyle = "#017fff"; } ctx.beginPath(); ctx.ellipse(point2.x * ratio, point2.y * ratio, weight * ratio, weight * ratio, 0, 0, Math.PI * 2); ctx.fill(); ctx.closePath(); } }); ctx.restore(); } } enableRefreshShape() { } /** * 绘制操作线 */ drawOpLine() { if (this.model.opLine) { let opLine = this.model.opLine; let lineRender = this.model.opLine.render; lineRender.getCachedValue("color"); let weight = lineRender.getCachedValue("weight"); lineRender.enableRefreshShape(); opLine.render.drawShape({ color: "red", opacity: 0.5, weight: weight * 1.5 }, false, null, this.model.opLine.render.tempZIndex); opLine.render.drawOpShape(); } } /** * 绘制移入移出效果图形 */ drawDragInOutPoints() { var _a3, _b2, _c2, _d2, _e2; if (((_b2 = (_a3 = this.model) == null ? void 0 : _a3.dragInPoints) == null ? void 0 : _b2.length) > 0 || ((_d2 = (_c2 = this.model) == null ? void 0 : _c2.dragOutPoints) == null ? void 0 : _d2.length) > 0) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = (_e2 = this.stage) == null ? void 0 : _e2.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; ctx.save(); ctx.lineWidth = 2.5 * ratio; ctx.setLineDash([0, 1 * ratio, 1 * ratio]); ctx.strokeStyle = DDeiUtil$1.getColor("green"); let lineOffset = 0; let pvs2 = this.model.dragInPoints; for (let i2 = 0; i2 < (pvs2 == null ? void 0 : pvs2.length); i2++) { let s = i2; let e = i2 + 1; if (i2 == pvs2.length - 1) { e = 0; } ctx.beginPath(); ctx.moveTo(pvs2[s].x * ratio + lineOffset, pvs2[s].y * ratio + lineOffset); ctx.lineTo(pvs2[e].x * ratio + lineOffset, pvs2[e].y * ratio + lineOffset); ctx.stroke(); ctx.closePath(); } ctx.strokeStyle = DDeiUtil$1.getColor("red"); pvs2 = this.model.dragOutPoints; for (let i2 = 0; i2 < (pvs2 == null ? void 0 : pvs2.length); i2++) { let s = i2; let e = i2 + 1; if (i2 == pvs2.length - 1) { e = 0; } ctx.beginPath(); ctx.moveTo(pvs2[s].x * ratio + lineOffset, pvs2[s].y * ratio + lineOffset); ctx.lineTo(pvs2[e].x * ratio + lineOffset, pvs2[e].y * ratio + lineOffset); ctx.stroke(); ctx.closePath(); } ctx.restore(); } this.model.dragInPoints = []; this.model.dragOutPoints = []; } /** * 获取缓存的渲染数据 */ getCachedValue(attrPath) { let returnValue = null; if (!this.renderCacheData.has(attrPath)) { returnValue = DDeiModelArrtibuteValue.getAttrValueByState(this.model, attrPath, true); this.renderCacheData.set(attrPath, returnValue); } else { returnValue = this.renderCacheData.get(attrPath); } return returnValue; } /** * 设置渲染缓存数据 */ setCachedValue(attrPath, value) { if (attrPath) { if (Array.isArray(attrPath)) { attrPath.forEach((item) => { this.renderCacheData.set(item, value); }); } else { this.renderCacheData.set(attrPath, value); } } } clearCachedValue() { this.renderCacheData.clear(); this.model.models.forEach((item) => { var _a3; (_a3 = item == null ? void 0 : item.render) == null ? void 0 : _a3.clearCachedValue(); }); } /** * 获取单个点移动后的坐标增量 * 考虑最小移动像素 * @param evt 事件 * @returns 计算的坐标增量 */ getMovedPositionDelta(evt) { let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; this.stage.getStageRatio(); ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; let movedBounds = { x: ex - this.stageRender.dragObj.x, y: ey - this.stageRender.dragObj.y }; return movedBounds; } // ============================== 事件 =============================== /** * 鼠标按下事件 */ mouseDown(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z; if (this.stage.ddInstance.disabled) { return; } if (this.stage.ddInstance.state == DDeiEnumState.IN_ACTIVITY) { return; } if (this.stage.ddInstance.eventCancel) { return; } if (!this.model.display && !this.model.tempDisplay || this.model.lock) { return; } let isCtrl = DDei.KEY_DOWN_STATE.get("ctrl"); let stageRatio2 = this.model.getStageRatio(); let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; let ex2 = ex / stageRatio2; let ey2 = ey / stageRatio2; if (((_a3 = this.stageRender) == null ? void 0 : _a3.operateState) == DDeiEnumOperateState.QUICK_EDITING) { let canvas = this.ddRender.getCanvas(); if ((evt.target == canvas || evt.target == canvas.parentElement) && (!this.stageRender.editorShadowControl || !((_b2 = this.stageRender.editorShadowControl) == null ? void 0 : _b2.isInAreaLoose(ex, ey)))) { (_c2 = DDeiUtil$1.getEditorText()) == null ? void 0 : _c2.enterValue(); } } let isOvPoint = false; if (((_e2 = (_d2 = this.stage) == null ? void 0 : _d2.selectedModels) == null ? void 0 : _e2.size) == 1) { let model = Array.from((_f = this.stage) == null ? void 0 : _f.selectedModels.values())[0]; let ovPoint = model.getOvPointByPos(ex2, ey2); if (ovPoint) { let ovsDefine = (_h = (_g = DDeiUtil$1.getControlDefine(model)) == null ? void 0 : _g.define) == null ? void 0 : _h.ovs; let ovd = ovsDefine[model.ovs.indexOf(ovPoint)]; if (((_i = ovd == null ? void 0 : ovd.constraint) == null ? void 0 : _i.type) && ovd.constraint.type != 5) { isOvPoint = true; this.stageRender.operateState = DDeiEnumOperateState.OV_POINT_CHANGING; (_l = (_k = (_j = this.stage) == null ? void 0 : _j.ddInstance) == null ? void 0 : _k.bus) == null ? void 0 : _l.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj: { x: ex2, y: ey2, opPoint: ovPoint, model } }, evt); (_o = (_n = (_m = this.stage) == null ? void 0 : _m.ddInstance) == null ? void 0 : _n.bus) == null ? void 0 : _o.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "pointer" }, evt); } } } if (isOvPoint) ; else if (this.stageRender.selector && this.stageRender.selector.isInAreaLoose(ex2, ey2, true) && (this.stageRender.selector.passIndex >= 1 && this.stageRender.selector.passIndex <= 9 || this.stageRender.selector.passIndex == 13)) { this.stageRender.selector.render.mouseDown(evt); } else { let opPoint = this.model.getOpPointByPos(ex2, ey2); let isStop = false; if (opPoint) { let innerSize = 0; let outRect = DDeiAbstractShape.getOutRectByPV([opPoint.model]); if (outRect.height > 20 && outRect.width > 20) { innerSize = -5; } if (opPoint.oppoint == 3 || opPoint.model.getProjPoint({ x: ex2, y: ey2 }, { in: innerSize, out: 15 }, 1, 2)) { let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", this.stage.ddInstance); let accessLink = DDeiUtil$1.isAccess( DDeiEnumOperateType.LINK, null, null, modeName, this.stage.ddInstance ); if (accessLink) { isStop = true; (_r = (_q = (_p = this.stage) == null ? void 0 : _p.ddInstance) == null ? void 0 : _q.bus) == null ? void 0 : _r.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj: { opPoint } }, evt); (_u = (_t = (_s = this.stage) == null ? void 0 : _s.ddInstance) == null ? void 0 : _t.bus) == null ? void 0 : _u.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); this.stageRender.operateState = DDeiEnumOperateState.LINE_POINT_CHANGING_CONFIRM; } } } if (!isStop) { let operateControls = DDeiAbstractShape.findBottomModelsByArea(this.model, ex2, ey2, true); if (operateControls != null && operateControls.length > 0) { let operateControl = operateControls[0]; this.stageRender.currentOperateShape = operateControl; this.stageRender.tempSX = ex2; this.stageRender.tempSY = ey2; this.stageRender.operateState = DDeiEnumOperateState.CONTROL_CONFIRMING; operateControl.render.mouseDown(evt); let pContainerModel = operateControl.pModel; if (pContainerModel) { if (!isCtrl) { let selectedModels = pContainerModel.getSelectedModels(); if (!selectedModels.has(operateControl.id)) { (_x = (_w = (_v = this.stage) == null ? void 0 : _v.ddInstance) == null ? void 0 : _w.bus) == null ? void 0 : _x.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, { container: pContainerModel, curLevel: true }, evt); (_A = (_z = (_y = this.stage) == null ? void 0 : _y.ddInstance) == null ? void 0 : _z.bus) == null ? void 0 : _A.push(DDeiEnumBusCommandType.ResetSelectorState, {}, evt); } } } } else { if ((_B = this.stage) == null ? void 0 : _B.brushData) { this.stage.brushData = null; this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "default" }, evt); } (_E = (_D = (_C = this.stage) == null ? void 0 : _C.ddInstance) == null ? void 0 : _D.bus) == null ? void 0 : _E.push(DDeiEnumBusCommandType.ResetSelectorState, { x: ex2, y: ey2 }, evt); let clearSelect = false; switch ((_F = this.stage.ddInstance) == null ? void 0 : _F.editMode) { case 1: { this.stageRender.operateState = DDeiEnumOperateState.SELECT_WORKING; clearSelect = !isCtrl; break; } case 2: { (_I = (_H = (_G = this.stage) == null ? void 0 : _G.ddInstance) == null ? void 0 : _H.bus) == null ? void 0 : _I.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj: { dx: ex, dy: ey } }, evt); this.stageRender.operateState = DDeiEnumOperateState.GRAB_WORKING; clearSelect = !isCtrl; break; } case 3: { (_L = (_K = (_J = this.stage) == null ? void 0 : _J.ddInstance) == null ? void 0 : _K.bus) == null ? void 0 : _L.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj: { dx: ex2, dy: ey2 } }, evt); this.stageRender.operateState = DDeiEnumOperateState.TEXT_CREATING; clearSelect = true; } case 4: { let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", (_M = this.stage) == null ? void 0 : _M.ddInstance); let accessLink = DDeiUtil$1.isAccess( DDeiEnumOperateType.LINK, null, null, modeName, (_N = this.stage) == null ? void 0 : _N.ddInstance ); if (accessLink) { (_Q = (_P = (_O = this.stage) == null ? void 0 : _O.ddInstance) == null ? void 0 : _P.bus) == null ? void 0 : _Q.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj: { dx: ex2, dy: ey2 } }, evt); this.stageRender.operateState = DDeiEnumOperateState.LINE_POINT_CHANGING; clearSelect = true; } } } if (clearSelect) { (_T = (_S = (_R = this.stage) == null ? void 0 : _R.ddInstance) == null ? void 0 : _S.bus) == null ? void 0 : _T.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); } } } } (_W = (_V = (_U = this.stage) == null ? void 0 : _U.ddInstance) == null ? void 0 : _V.bus) == null ? void 0 : _W.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_Z = (_Y = (_X = this.stage) == null ? void 0 : _X.ddInstance) == null ? void 0 : _Y.bus) == null ? void 0 : _Z.executeAll(); } /** * 绘制图形 */ mouseUp(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a; if (this.stage.ddInstance.disabled) { return; } if (this.stage.ddInstance.state == DDeiEnumState.IN_ACTIVITY) { return; } if (this.stage.ddInstance.eventCancel) { return; } if (!this.model.display && !this.model.tempDisplay || this.model.lock) { return; } let isAlt = DDei.KEY_DOWN_STATE.get("alt"); let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; let stageRatio2 = this.stage.getStageRatio(); ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; let ex2 = ex / stageRatio2; let ey2 = ey / stageRatio2; if (evt.button == 2) { let operateControls = DDeiAbstractShape.findBottomModelsByArea(this.model, ex2, ey2); if (operateControls != null && operateControls.length > 0) { DDeiUtil$1.showContextMenu(operateControls[0], (_a3 = this.ddRender) == null ? void 0 : _a3.model, evt); } this.model.opPoints = []; if ((_b2 = this.model.opLine) == null ? void 0 : _b2.render) { this.model.opLine.render.enableRefreshShape(); } delete this.model.opLine; this.clearShadowControls(); } else { switch (this.stageRender.operateState) { case DDeiEnumOperateState.LINE_POINT_CHANGING_CONFIRM: { let operateControls = DDeiAbstractShape.findBottomModelsByArea(this.model, ex2, ey2, true); if (operateControls != null && operateControls.length > 0) { let operateControl = operateControls[0]; this.stageRender.currentOperateShape = operateControl; } } case DDeiEnumOperateState.CONTROL_CONFIRMING: { this.stageRender.currentOperateShape.render.mouseUp(evt); if ((_c2 = this.stage) == null ? void 0 : _c2.brushData) { (_f = (_e2 = (_d2 = this.stage) == null ? void 0 : _d2.ddInstance) == null ? void 0 : _e2.bus) == null ? void 0 : _f.push(DDeiEnumBusCommandType.CopyStyle, { models: [this.stageRender.currentOperateShape], brushData: this.stage.brushData }, evt); } this.clearShadowControls(); break; } case DDeiEnumOperateState.SELECT_WORKING: let pushDatas = []; let includedModels = this.stageRender.selector.getIncludedModels(); let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_SELECT_BEFORE", DDeiEnumOperateType.SELECT, { models: Array.from(includedModels.values()) }, (_g = this.stage) == null ? void 0 : _g.ddInstance, evt); if (rsState == 0 || rsState == 1) { let isCtrl = DDei.KEY_DOWN_STATE.get("ctrl"); if (!isCtrl) { (_j = (_i = (_h = this.stage) == null ? void 0 : _h.ddInstance) == null ? void 0 : _i.bus) == null ? void 0 : _j.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); } this.stageRender.currentOperateContainer = this.model; includedModels.forEach((model, key) => { pushDatas.push({ id: model.id, value: DDeiEnumControlState.SELECTED }); }); this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeSelect, pushDatas, evt); this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); this.stage.ddInstance.bus.executeAll(); DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_SELECT_AFTER", DDeiEnumOperateType.SELECT, { models: Array.from(includedModels.values()) }, (_k = this.stage) == null ? void 0 : _k.ddInstance, evt); } else { (_n = (_m = (_l = this.stage) == null ? void 0 : _l.ddInstance) == null ? void 0 : _m.bus) == null ? void 0 : _n.push(DDeiEnumBusCommandType.UpdateSelectorBounds); this.stageRender.operateState = DDeiEnumOperateState.NONE; } break; case DDeiEnumOperateState.GRAB_WORKING: break; case DDeiEnumOperateState.TEXT_CREATING: break; case DDeiEnumOperateState.LINE_POINT_CHANGING: { let hasChange2 = false; if (this.model.shadowControls.length > 0) { let item = this.model.shadowControls[0]; let id = item.id.substring(item.id, item.id.lastIndexOf("_shadow")); let model = (_o = this.stage) == null ? void 0 : _o.getModelById(id); let isStop2 = false; let rsState2 = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_DRAG_AFTER", DDeiEnumOperateType.DRAG, this.stageRender.dragObj, (_p = this.stage) == null ? void 0 : _p.ddInstance, null); if (rsState2 == 0 || rsState2 == 1) { if (model) { model.syncVectors(item); } else { let opPoint = this.model.getOpPointByPos(ex2, ey2); let maxLength = 0; if (!(opPoint == null ? void 0 : opPoint.model)) { for (let i2 = 0; i2 < item.pvs.length - 1; i2++) { maxLength += DDeiUtil$1.getPointDistance(item.pvs[i2].x, item.pvs[i2].y, item.pvs[i2 + 1].x, item.pvs[i2 + 1].y); } } if ((opPoint == null ? void 0 : opPoint.model) && (Math.abs(opPoint.x - item.startPoint.x) >= 1 || Math.abs(opPoint.y - item.startPoint.y) >= 1) || maxLength >= 15) { item.id = id; item.destroyRender(); this.model.addModel(item, false); item.initRender(); model = item; delete model.isShadowControl; } else { isStop2 = true; } } if (!isStop2) { let passIndex = this.stageRender.dragObj.passIndex; if (passIndex == 1) { let skip = false; let constraint = (_r = (_q = DDeiUtil$1.getControlDefine(model)) == null ? void 0 : _q.define) == null ? void 0 : _r.constraint; let opvsIndex = this.stageRender.dragObj.opvsIndex; let dmpath = ""; if (opvsIndex == 0) { if ((constraint == null ? void 0 : constraint.sp) && constraint.sp.link == false) { skip = true; } else { dmpath = "startPoint"; } } else { if ((constraint == null ? void 0 : constraint.ep) && constraint.ep.link == false) { skip = true; } else { dmpath = "endPoint"; } } if (!skip) { let distLinks = (_s = this.stage) == null ? void 0 : _s.getDistModelLinks(model.id); distLinks == null ? void 0 : distLinks.forEach((dl) => { var _a22, _b22; if (dl.dmpath == dmpath) { (_a22 = this.stage) == null ? void 0 : _a22.removeLink(dl); if ((dl == null ? void 0 : dl.sm) && (dl == null ? void 0 : dl.smpath)) { DDeiUtil$1.deletePropertyByPath(dl.sm, dl.smpath); dl.sm.transVectors(new Matrix3()); dl.sm.updateLinkModels(); (_b22 = dl.sm.render) == null ? void 0 : _b22.enableRefreshShape(); } } }); let opPoint = this.model.getOpPointByPos(ex2, ey2); if (opPoint) { let smodel = opPoint.model; let id2 = "_" + DDeiUtil$1.getUniqueCode(); smodel.exPvs[id2] = new Vector3(opPoint.x, opPoint.y, opPoint.z); smodel.exPvs[id2].rate = opPoint.rate; smodel.exPvs[id2].sita = opPoint.sita; smodel.exPvs[id2].index = opPoint.index; smodel.exPvs[id2].id = id2; let link2 = new DDeiLink({ sm: smodel, dm: model, smpath: "exPvs." + id2, dmpath, stage: this.stage }); this.stage.addLink(link2); model.initPVS(); } } } let dlinks = (_t = this.stage) == null ? void 0 : _t.getDistModelLinks(model.id); dlinks == null ? void 0 : dlinks.forEach((dl) => { if (dl.sm) { dl.sm.transVectors(new Matrix3()); dl.sm.updateLinkModels(); dl.sm.render.enableRefreshShape(); } }); model.initPVS(); model.updateOVS(); model.clps = []; this.stageRender.refreshJumpLine = false; if (model.pModel != this.model) { (_u = model.pModel) == null ? void 0 : _u.changeParentsBounds(); } hasChange2 = true; this.stage.refreshLinkCache(); } } } (_x = (_w = (_v = this.stage) == null ? void 0 : _v.ddInstance) == null ? void 0 : _w.bus) == null ? void 0 : _x.push(DDeiEnumBusCommandType.ClearTemplateVars); if (hasChange2) { (_A = (_z = (_y = this.stage) == null ? void 0 : _y.ddInstance) == null ? void 0 : _z.bus) == null ? void 0 : _A.push(DDeiEnumBusCommandType.UpdateSelectorBounds); (_D = (_C = (_B = this.stage) == null ? void 0 : _B.ddInstance) == null ? void 0 : _C.bus) == null ? void 0 : _D.push(DDeiEnumBusCommandType.NodifyChange); (_G = (_F = (_E = this.stage) == null ? void 0 : _E.ddInstance) == null ? void 0 : _F.bus) == null ? void 0 : _G.push(DDeiEnumBusCommandType.AddHistroy); } (_J = (_I = (_H = this.stage) == null ? void 0 : _H.ddInstance) == null ? void 0 : _I.bus) == null ? void 0 : _J.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "grab" }, evt); this.clearShadowControls(); break; } case DDeiEnumOperateState.CONTROL_DRAGING: let isStop = false; let hasChange = false; if (isAlt) { let mouseOnContainers = DDeiAbstractShape.findBottomContainersByArea(this.model, ex2, ey2); let lastOnContainer = this.model; let pContainerModel = this.stageRender.currentOperateShape.pModel; if (mouseOnContainers && mouseOnContainers.length > 0) { for (let k = mouseOnContainers.length - 1; k >= 0; k--) { if (mouseOnContainers[k].id != this.stageRender.currentOperateShape.id) { lastOnContainer = mouseOnContainers[k]; break; } } } if (lastOnContainer.id != pContainerModel.id || lastOnContainer.unicode != pContainerModel.unicode) { if (!lastOnContainer.layoutManager || lastOnContainer.layoutManager.canAppend(ex2, ey2, this.model.shadowControls)) { let operateModels2 = []; let selMods = []; this.model.shadowControls.forEach((item) => { var _a22; let id = item.id.substring(item.id, item.id.lastIndexOf("_shadow")); let model = (_a22 = this.stage) == null ? void 0 : _a22.getModelById(id); model.originCPV = model.cpv; model.originPVS = model.pvs; model.syncVectors(item, true); operateModels2.push(model); selMods.push({ id: model == null ? void 0 : model.id, value: DDeiEnumControlState.SELECTED }); }); if (pContainerModel.baseModelType == "DDeiTableCell") { selMods.push({ id: (_K = pContainerModel.pModel) == null ? void 0 : _K.id, value: DDeiEnumControlState.DEFAULT }); } else { selMods.push({ id: pContainerModel.id, value: DDeiEnumControlState.DEFAULT }); } if ((lastOnContainer == null ? void 0 : lastOnContainer.baseModelType) == "DDeiTableCell") { selMods.push({ id: (_L = lastOnContainer.pModel) == null ? void 0 : _L.id, value: DDeiEnumControlState.SELECTED }); } else { selMods.push({ id: lastOnContainer == null ? void 0 : lastOnContainer.id, value: DDeiEnumControlState.SELECTED }); } DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_DRAG_AFTER", DDeiEnumOperateType.DRAG, { models: operateModels2 }, (_M = this.stage) == null ? void 0 : _M.ddInstance, null); (_P = (_O = (_N = this.stage) == null ? void 0 : _N.ddInstance) == null ? void 0 : _O.bus) == null ? void 0 : _P.push(DDeiEnumBusCommandType.ModelChangeContainer, { oldContainer: pContainerModel, newContainer: lastOnContainer, models: operateModels2 }, evt); (_S = (_R = (_Q = this.stage) == null ? void 0 : _Q.ddInstance) == null ? void 0 : _R.bus) == null ? void 0 : _S.push(DDeiEnumBusCommandType.ModelChangeSelect, selMods, evt); hasChange = true; } isStop = true; } } if (!isStop) { let pContainerModel = this.stageRender.currentOperateShape.pModel; if (!pContainerModel.layoutManager || pContainerModel.layoutManager.canChangePosition(ex2, ey2, this.model.shadowControls)) { let operateModels2 = []; let lines = (_T = this.stage) == null ? void 0 : _T.getModelsByBaseType("DDeiLine"); let moveOriginModels = []; let moveOriginModelIds = []; let moveOriginLines = []; this.model.shadowControls.forEach((item) => { var _a22; let id = item.id.substring(item.id, item.id.lastIndexOf("_shadow")); let momodel = (_a22 = this.stage) == null ? void 0 : _a22.getModelById(id); if (momodel) { if ((momodel == null ? void 0 : momodel.baseModelType) == "DDeiLine") { moveOriginLines.push(momodel.id); } moveOriginModels.push(momodel); moveOriginModelIds.push(momodel.id); } }); for (let i2 = 0; i2 < this.model.shadowControls.length; i2++) { let item = this.model.shadowControls[i2]; let model = moveOriginModels[i2]; model.syncVectors(item); hasChange = true; operateModels2.push(model); if (model.modelType == "DDeiLine") { let distLinks = (_U = this.stage) == null ? void 0 : _U.getDistModelLinks(model.id); let skipStart = false, skipEnd = false; distLinks == null ? void 0 : distLinks.forEach((dl) => { var _a22, _b22; if (!dl.disabled && (!dl.sm || moveOriginModels.indexOf(dl.sm) == -1)) { (_a22 = this.stage) == null ? void 0 : _a22.removeLink(dl); if ((dl == null ? void 0 : dl.sm) && (dl == null ? void 0 : dl.smpath)) { DDeiUtil$1.deletePropertyByPath(dl.sm, dl.smpath); dl.sm.transVectors(new Matrix3()); dl.sm.updateLinkModels(); (_b22 = dl.sm.render) == null ? void 0 : _b22.enableRefreshShape(); } } else { if (dl.dmpath == "startPoint") { skipStart = true; } else if (dl.dmpath == "endPoint") { skipEnd = true; } } }); if (!skipStart) { let lineInModelsStart = DDeiAbstractShape.findBottomModelsByArea(this.model, model.startPoint.x, model.startPoint.y, true, true); if (lineInModelsStart.length > 0) { for (let li = 0; li < lineInModelsStart.length; li++) { if (!((_V = model.linkModels) == null ? void 0 : _V.has(lineInModelsStart[li].id)) && moveOriginModelIds.indexOf(lineInModelsStart[li].id) == -1) { DDeiUtil$1.addLineLink(model, lineInModelsStart[li], model.startPoint, 1); } break; } } } if (!skipEnd) { let lineInModelsEnd = DDeiAbstractShape.findBottomModelsByArea(this.model, model.endPoint.x, model.endPoint.y, true, true); if (lineInModelsEnd.length > 0) { for (let li = 0; li < lineInModelsEnd.length; li++) { if (!((_W = model.linkModels) == null ? void 0 : _W.has(lineInModelsEnd[li].id)) && moveOriginModelIds.indexOf(lineInModelsEnd[li].id) == -1) { DDeiUtil$1.addLineLink(model, lineInModelsEnd[li], model.endPoint, 2); } break; } } } } else { model.updateLinkModels(moveOriginLines); if (model.depModel) { let lm = (_X = model.depModel.linkModels) == null ? void 0 : _X.get(model.id); if (model.depModel.baseModelType == "DDeiLine") { let point2 = null; if (lm.type == 1) { point2 = model.depModel.startPoint; } else if (lm.type == 2) { point2 = model.depModel.endPoint; } else if (lm.type == 3) { let pi = Math.floor(model.depModel.pvs.length / 2); if (model.depModel.pvs.length % 3 == 0) { point2 = model.depModel.pvs[pi]; } else { point2 = { x: (model.depModel.pvs[pi - 1].x + model.depModel.pvs[pi].x) / 2, y: (model.depModel.pvs[pi - 1].y + model.depModel.pvs[pi].y) / 2 }; } } lm.dx = model.cpv.x - point2.x; lm.dy = model.cpv.y - point2.y; } else { if (lm.type == 5) { lm.dx = model.cpv.x - model.depModel.cpv.x; lm.dy = model.cpv.y - model.depModel.cpv.y; } else { let essBounds = model.depModel.essBounds; let dmEssBounds = lm.dm.essBounds; let point2; if (lm.type == 6) { point2 = { x: model.depModel.cpv.x, y: essBounds.y - dmEssBounds.height / 2 }; } else if (lm.type == 7) { point2 = { y: model.depModel.cpv.y, x: essBounds.x1 + dmEssBounds.width / 2 }; } else if (lm.type == 8) { point2 = { x: model.depModel.cpv.x, y: essBounds.y1 + dmEssBounds.height / 2 }; } else if (lm.type == 9) { point2 = { y: model.depModel.cpv.y, x: essBounds.x - dmEssBounds.width / 2 }; } lm.dx = model.cpv.x - point2.x; lm.dy = model.cpv.y - point2.y; } } } } model.refreshLinkModels(); } lines == null ? void 0 : lines.forEach((line2) => { line2.clps = []; }); this.stageRender.refreshJumpLine = false; pContainerModel == null ? void 0 : pContainerModel.changeParentsBounds(); (_Y = pContainerModel == null ? void 0 : pContainerModel.layoutManager) == null ? void 0 : _Y.updateLayout(ex2, ey2, operateModels2); operateModels2 == null ? void 0 : operateModels2.forEach((item) => { var _a22; (_a22 = item.render) == null ? void 0 : _a22.controlDragEnd(evt); }); DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_DRAG_AFTER", DDeiEnumOperateType.DRAG, { models: operateModels2 }, (_Z = this.stage) == null ? void 0 : _Z.ddInstance, null); } } if (hasChange) { (_aa = (_$ = (__ = this.stage) == null ? void 0 : __.ddInstance) == null ? void 0 : _$.bus) == null ? void 0 : _aa.push(DDeiEnumBusCommandType.UpdatePaperArea); (_da = (_ca = (_ba = this.stage) == null ? void 0 : _ba.ddInstance) == null ? void 0 : _ca.bus) == null ? void 0 : _da.push(DDeiEnumBusCommandType.StageChangeSelectModels); (_ga = (_fa = (_ea = this.stage) == null ? void 0 : _ea.ddInstance) == null ? void 0 : _fa.bus) == null ? void 0 : _ga.push(DDeiEnumBusCommandType.UpdateSelectorBounds); (_ja = (_ia = (_ha = this.stage) == null ? void 0 : _ha.ddInstance) == null ? void 0 : _ia.bus) == null ? void 0 : _ja.push(DDeiEnumBusCommandType.NodifyChange); (_ma = (_la = (_ka = this.stage) == null ? void 0 : _ka.ddInstance) == null ? void 0 : _la.bus) == null ? void 0 : _ma.push(DDeiEnumBusCommandType.AddHistroy); } this.clearShadowControls(); break; case DDeiEnumOperateState.TABLE_INNER_DRAG: let table2 = this.stageRender.currentOperateShape; (_na = table2 == null ? void 0 : table2.render) == null ? void 0 : _na.mouseUp(evt); (_pa = (_oa = this.stage) == null ? void 0 : _oa.ddInstance) == null ? void 0 : _pa.bus.push(DDeiEnumBusCommandType.CopyStyle, { models: [table2], brushData: this.stage.brushData }); break; case DDeiEnumOperateState.CONTROL_ROTATE: DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_ROTATE_AFTER", DDeiEnumOperateType.ROTATE, { models: this.stageRender.dragObj.models }, (_qa = this.stage) == null ? void 0 : _qa.ddInstance, evt); (_ta = (_sa = (_ra = this.stage) == null ? void 0 : _ra.ddInstance) == null ? void 0 : _sa.bus) == null ? void 0 : _ta.push(DDeiEnumBusCommandType.ClearTemplateVars); (_wa = (_va = (_ua = this.stage) == null ? void 0 : _ua.ddInstance) == null ? void 0 : _va.bus) == null ? void 0 : _wa.push(DDeiEnumBusCommandType.NodifyChange); (_za = (_ya = (_xa = this.stage) == null ? void 0 : _xa.ddInstance) == null ? void 0 : _ya.bus) == null ? void 0 : _za.push(DDeiEnumBusCommandType.AddHistroy); break; case DDeiEnumOperateState.CONTROL_CHANGING_BOUND: let operateModels = []; this.model.shadowControls.forEach((item) => { var _a22; let id = item.id.substring(item.id, item.id.lastIndexOf("_shadow")); let model = (_a22 = this.stage) == null ? void 0 : _a22.getModelById(id); if (model) { model.syncVectors(item); if (model.changeChildrenBounds) { model.changeChildrenBounds(); } model.updateLinkModels(); operateModels.push(model); } }); (_Ca = (_Ba = (_Aa = this.stage) == null ? void 0 : _Aa.ddInstance) == null ? void 0 : _Ba.bus) == null ? void 0 : _Ca.push(DDeiEnumBusCommandType.NodifyChange); (_Fa = (_Ea = (_Da = this.stage) == null ? void 0 : _Da.ddInstance) == null ? void 0 : _Ea.bus) == null ? void 0 : _Fa.push(DDeiEnumBusCommandType.AddHistroy, null, evt); this.stageRender.selector.updatePVSByModels(operateModels); this.clearShadowControls(); break; case DDeiEnumOperateState.QUICK_EDITING_TEXT_SELECTING: delete this.stage.brushData; if (((_Ga = this.stage.brushDataText) == null ? void 0 : _Ga.length) > 0) { let shadowControl = this.stage.render.editorShadowControl; if (shadowControl) { let editorText = DDeiUtil$1.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; let tempI = 0; if (curSIdx > -1 && curEIdx > -1 && curSIdx <= curEIdx) { for (; curSIdx < curEIdx; curSIdx++) { shadowControl.sptStyle[curSIdx] = cloneDeep(this.stage.brushDataText[tempI]); tempI++; if (tempI >= this.stage.brushDataText.length) { tempI = 0; } } } } } delete this.stage.brushDataText; } this.stageRender.operateState = DDeiEnumOperateState.QUICK_EDITING; (_Ja = (_Ia = (_Ha = this.stage) == null ? void 0 : _Ha.ddInstance) == null ? void 0 : _Ia.bus) == null ? void 0 : _Ja.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); (_Ma = (_La = (_Ka = this.stage) == null ? void 0 : _Ka.ddInstance) == null ? void 0 : _La.bus) == null ? void 0 : _Ma.push(DDeiEnumBusCommandType.RefreshShape); (_Pa = (_Oa = (_Na = this.stage) == null ? void 0 : _Na.ddInstance) == null ? void 0 : _Oa.bus) == null ? void 0 : _Pa.executeAll(); return; case DDeiEnumOperateState.QUICK_EDITING: let canvas = this.ddRender.getCanvas(); if ((evt.target == canvas || evt.target == canvas.parentElement) && (!this.stageRender.editorShadowControl || !((_Qa = this.stageRender.editorShadowControl) == null ? void 0 : _Qa.isInAreaLoose(ex, ey)))) { (_Ra = DDeiUtil$1.getEditorText()) == null ? void 0 : _Ra.enterValue(); } else if (evt.target != canvas && evt.target != canvas.parentElement) { return; } break; } } (_Ua = (_Ta = (_Sa = this.stage) == null ? void 0 : _Sa.ddInstance) == null ? void 0 : _Ta.bus) == null ? void 0 : _Ua.push(DDeiEnumBusCommandType.ClearTemplateVars, null, evt); (_Xa = (_Wa = (_Va = this.stage) == null ? void 0 : _Va.ddInstance) == null ? void 0 : _Wa.bus) == null ? void 0 : _Xa.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (__a = (_Za = (_Ya = this.stage) == null ? void 0 : _Ya.ddInstance) == null ? void 0 : _Za.bus) == null ? void 0 : __a.executeAll(); } /** * 鼠标移动 */ mouseMove(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za; if (this.stage.ddInstance.disabled) { return; } if (this.stage.ddInstance.state == DDeiEnumState.IN_ACTIVITY) { return; } if (this.stage.ddInstance.eventCancel) { return; } if (!this.model.display && !this.model.tempDisplay || this.model.lock) { return; } let isCtrl = DDei.KEY_DOWN_STATE.get("ctrl"); let isAlt = DDei.KEY_DOWN_STATE.get("alt"); let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; let rat1 = (_a3 = this.ddRender) == null ? void 0 : _a3.ratio; let canvasWidth = this.ddRender.canvas.width / rat1; let canvasHeight = this.ddRender.canvas.height / rat1; let edgeWeight = 25; if (ex < edgeWeight) { this.ddRender.inEdge = 4; } else if (ex > canvasWidth - edgeWeight) { this.ddRender.inEdge = 2; } else if (ey < edgeWeight) { this.ddRender.inEdge = 1; } else if (ey > canvasHeight - edgeWeight) { this.ddRender.inEdge = 3; } else { this.ddRender.inEdge = 0; } ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; let stageRatio2 = this.model.getStageRatio(); let ex2 = ex / stageRatio2; let ey2 = ey / stageRatio2; this.ddRender.inAreaX = ex2; this.ddRender.inAreaY = ey2; switch (this.stageRender.operateState) { case DDeiEnumOperateState.CONTROL_CONFIRMING: { if (Math.abs(ex2 - this.stageRender.tempSX) <= 2 && Math.abs(ey2 - this.stageRender.tempSY) <= 2) { return; } this.model.opPoints = []; if ((_b2 = this.model.opLine) == null ? void 0 : _b2.render) { this.model.opLine.render.enableRefreshShape(); } delete this.model.opLine; let operateControl = this.stageRender.currentOperateShape; if (operateControl.pModel != this.model && operateControl.state != DDeiEnumControlState.SELECTED) { operateControl = operateControl.pModel; } let pContainerModel = operateControl.pModel; let dragObj = { x: ex, y: ey, model: this.stageRender.currentOperateShape }; (_e2 = (_d2 = (_c2 = this.stage) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.bus) == null ? void 0 : _e2.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj }, evt); if (((_f = this.stageRender.currentOperateShape) == null ? void 0 : _f.baseModelType) == "DDeiTable" && !isCtrl) { this.stageRender.operateState = DDeiEnumOperateState.TABLE_INNER_DRAG; (_i = (_h = (_g = this.stage) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.bus) == null ? void 0 : _i.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, { ignoreModels: [this.stageRender.currentOperateShape] }, evt); (_l = (_k = (_j = this.stage) == null ? void 0 : _j.ddInstance) == null ? void 0 : _k.bus) == null ? void 0 : _l.push(DDeiEnumBusCommandType.ModelChangeSelect, [{ id: this.stageRender.currentOperateShape.id, value: DDeiEnumControlState.SELECTED }], evt); } else { let selectedModels = pContainerModel.getSelectedModels(); let sms = Array.from(selectedModels.values()); if (sms.indexOf(this.stageRender.currentOperateShape) == -1) { sms.push(this.stageRender.currentOperateShape); } let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_DRAG_BEFORE", DDeiEnumOperateType.DRAG, { models: sms }, this.ddRender.model, evt); if (rsState == 0 || rsState == 1) { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", DDeiEnumOperateType.DRAG, { models: sms }, this.ddRender.model, evt); this.stageRender.operateState = DDeiEnumOperateState.CONTROL_DRAGING; sms.forEach((m) => { let md = DDeiUtil$1.getShadowControl(m); dragObj[md.id] = { dx: md.cpv.x - ex2, dy: md.cpv.y - ey2 }; this.model.shadowControls.push(md); }); this.stageRender.currentOperateShape = this.model.shadowControls[this.model.shadowControls.length - 1]; } else { this.stageRender.operateState = DDeiEnumOperateState.NONE; } } break; } case DDeiEnumOperateState.SELECT_WORKING: { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "SELECT_WORKING", null, (_m = this.stage) == null ? void 0 : _m.ddInstance, evt); (_p = (_o = (_n = this.stage) == null ? void 0 : _n.ddInstance) == null ? void 0 : _o.bus) == null ? void 0 : _p.push(DDeiEnumBusCommandType.UpdateSelectorBounds, { operateState: this.stageRender.operateState }, evt); (_s = (_r = (_q = this.stage) == null ? void 0 : _q.ddInstance) == null ? void 0 : _r.bus) == null ? void 0 : _s.push(DDeiEnumBusCommandType.RefreshShape, null, evt); break; } case DDeiEnumOperateState.GRAB_WORKING: { (_v = (_u = (_t = this.stage) == null ? void 0 : _t.ddInstance) == null ? void 0 : _u.bus) == null ? void 0 : _v.push(DDeiEnumBusCommandType.ChangeStageWPV, { x: ex, y: ey, dragObj: this.stageRender.dragObj }, evt); break; } case DDeiEnumOperateState.LINE_POINT_CHANGING_CONFIRM: { let dx, dy, opPoint; if (this.stageRender.dragObj.opPoint) { opPoint = this.stageRender.dragObj.opPoint; dx = opPoint.x; dy = opPoint.y; } else { dx = this.stageRender.dragObj.dx; dy = this.stageRender.dragObj.dy; } DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "CHANGE_WPV", null, (_w = this.stage) == null ? void 0 : _w.ddInstance, evt); if (Math.abs(ex - dx) >= 10 || Math.abs(ey - dy) >= 10) { this.stageRender.operateState = DDeiEnumOperateState.LINE_POINT_CHANGING; } break; } case DDeiEnumOperateState.LINE_POINT_CHANGING: { if (!this.stageRender.currentOperateShape) { let lineJson = DDeiUtil$1.getLineInitJSON(this.stage.ddInstance); let editor = DDeiUtil$1.getEditorInsByDDei(this.stage.ddInstance); let lineDefine = (_x = editor.controls) == null ? void 0 : _x.get(lineJson.modelCode ? lineJson.modelCode : lineJson.model ? lineJson.model : lineJson.id ? lineJson.id : lineJson.code); let initJSON = clone(lineDefine); initJSON.modelCode = initJSON.id; initJSON.id = "line_" + ++this.stage.idIdx; if (!lineJson.type) { initJSON.type = 2; } else { initJSON.type = lineJson.type; } if (initJSON.img) { initJSON.fill = { type: 2, image: initJSON.img }; delete initJSON.img; } if (initJSON.define) { for (let i2 in initJSON == null ? void 0 : initJSON.define) { initJSON[i2] = initJSON.define[i2]; } delete initJSON.define; } delete initJSON.ovs; delete initJSON.attrDefineMap; delete initJSON.filters; delete initJSON.icon; delete initJSON.groups; delete initJSON.name; delete initJSON.def; delete initJSON.code; delete initJSON.desc; (_y = initJSON.composes) == null ? void 0 : _y.forEach((comp) => { if (comp) { delete comp.attrs; } }); let dx, dy, opPoint; if (this.stageRender.dragObj.opPoint) { opPoint = this.stageRender.dragObj.opPoint; dx = opPoint.x; dy = opPoint.y; } else { dx = this.stageRender.dragObj.dx; dy = this.stageRender.dragObj.dy; } let moveMatrix2 = new Matrix3( 1, 0, dx, 0, 1, dy, 0, 0, 1 ); initJSON.cpv = new Vector3(0, 0, 1); if (initJSON.type == 1) { initJSON.pvs = [initJSON.cpv, new Vector3(ex2 - dx, ey2 - dy, 1)]; } else { initJSON.pvs = [initJSON.cpv, new Vector3((ex2 - dx) / 2, initJSON.cpv.y, 1), new Vector3((ex2 - dx) / 2, ey2 - dy, 1), new Vector3(ex2 - dx, ey2 - dy, 1)]; } let ddeiLine = DDeiLine.initByJSON(initJSON, { currentStage: this.stage, currentLayer: this.model, currentContainer: this.model }); ddeiLine.transVectors(moveMatrix2); let lineShadow = DDeiUtil$1.getShadowControl(ddeiLine); this.model.shadowControls.push(lineShadow); this.stageRender.currentOperateShape = lineShadow; if (opPoint) { this.stage.tempStartOPpoint = opPoint; let smodel = opPoint.model; let id = "_" + DDeiUtil$1.getUniqueCode(); smodel.exPvs[id] = new Vector3(opPoint.x, opPoint.y, opPoint.z); smodel.exPvs[id].rate = opPoint.rate; smodel.exPvs[id].sita = opPoint.sita; smodel.exPvs[id].index = opPoint.index; smodel.exPvs[id].id = id; let link2 = new DDeiLink({ sm: smodel, dm: lineShadow, smpath: "exPvs." + id, dmpath: "startPoint", stage: this.stage }); (_z = this.stage) == null ? void 0 : _z.addLink(link2); smodel.updateLinkModels(); } let dragObj = { x: ex2, y: ey2, dragPoint: lineShadow.pvs[lineShadow.pvs.length - 1], model: lineShadow, passIndex: 1, opvsIndex: ddeiLine.pvs.length - 1, opvs: ddeiLine.pvs, create: true }; (_C = (_B = (_A = this.stage) == null ? void 0 : _A.ddInstance) == null ? void 0 : _B.bus) == null ? void 0 : _C.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj }, evt); (_F = (_E = (_D = this.stage) == null ? void 0 : _D.ddInstance) == null ? void 0 : _E.bus) == null ? void 0 : _F.push(DDeiEnumBusCommandType.RefreshShape); } else { let lineModel = this.stageRender.dragObj.model; let passIndex = this.stageRender.dragObj.passIndex; let opvsIndex = this.stageRender.dragObj.opvsIndex; let opvs = this.stageRender.dragObj.opvs; if (passIndex == 1 && opvsIndex == 0) { let endPoint = lineModel.endPoint; if (Math.abs(endPoint.x - ex2) <= ((_G = this.stage) == null ? void 0 : _G.ddInstance.GLOBAL_ADV_WEIGHT)) { ex2 = endPoint.x; } else if (Math.abs(endPoint.y - ey2) <= ((_H = this.stage) == null ? void 0 : _H.ddInstance.GLOBAL_ADV_WEIGHT)) { ey2 = endPoint.y; } } else if (passIndex == 1 && opvsIndex == opvs.length - 1) { let startPoint = lineModel.startPoint; if (Math.abs(startPoint.x - ex2) <= ((_I = this.stage) == null ? void 0 : _I.ddInstance.GLOBAL_ADV_WEIGHT)) { ex2 = startPoint.x; } else if (Math.abs(startPoint.y - ey2) <= ((_J = this.stage) == null ? void 0 : _J.ddInstance.GLOBAL_ADV_WEIGHT)) { ey2 = startPoint.y; } } (_M = (_L = (_K = this.stage) == null ? void 0 : _K.ddInstance) == null ? void 0 : _L.bus) == null ? void 0 : _M.push(DDeiEnumBusCommandType.ChangeLinePoint, { ex: ex2, ey: ey2 }); (_P = (_O = (_N = this.stage) == null ? void 0 : _N.ddInstance) == null ? void 0 : _O.bus) == null ? void 0 : _P.push(DDeiEnumBusCommandType.RefreshShape); } this.model.opPoints = []; if ((_Q = this.model.opLine) == null ? void 0 : _Q.render) { this.model.opLine.render.enableRefreshShape(); } delete this.model.opLine; delete this.stage.tempCursorOPpoint; let operateControls = DDeiAbstractShape.findBottomModelsByArea(this.model, ex2, ey2, true, true); if (operateControls != null && operateControls.length > 0) { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "LINE_POINT_CHANGING", { line: this.stageRender.currentOperateShape, model: operateControls[0] }, (_R = this.stage) == null ? void 0 : _R.ddInstance, evt); operateControls[0].render.changeOpPoints(ex2, ey2, 1); } else { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "LINE_POINT_CHANGING", { line: this.stageRender.currentOperateShape }, (_S = this.stage) == null ? void 0 : _S.ddInstance, evt); } break; } case DDeiEnumOperateState.CONTROL_DRAGING: { if (!this.ddRender.inEdge) { let pContainerModel = null; if (this.stageRender.currentOperateShape.id.indexOf("_shadow") != -1) { let id = this.stageRender.currentOperateShape.id.substring(this.stageRender.currentOperateShape.id, this.stageRender.currentOperateShape.id.lastIndexOf("_shadow")); let model = (_T = this.stage) == null ? void 0 : _T.getModelById(id); pContainerModel = model.pModel; } else { pContainerModel = this.stageRender.currentOperateShape.pModel; } if (pContainerModel) { let pushData = { x: ex, y: ey, dragObj: this.stageRender.dragObj, models: this.model.shadowControls, changeContainer: isAlt }; pushData.oldContainer = pContainerModel; if (isAlt) { let mouseOnContainers = DDeiAbstractShape.findBottomContainersByArea(this.model, ex2, ey2); let lastOnContainer = this.model; if (mouseOnContainers && mouseOnContainers.length > 0) { for (let k = mouseOnContainers.length - 1; k >= 0; k--) { if (mouseOnContainers[k].id != this.stageRender.currentOperateShape.id) { lastOnContainer = mouseOnContainers[k]; break; } } } pushData.isAlt = true; pushData.newContainer = lastOnContainer; } else { if (!((_U = this.ddRender) == null ? void 0 : _U.model.EXT_STAGE_WIDTH) || !((_V = this.ddRender) == null ? void 0 : _V.model.EXT_STAGE_HEIGHT)) { let dragObj = pushData.dragObj; let outRect = DDeiAbstractShape.getOutRectByPV(this.model.shadowControls); let nmodel = this.stageRender.currentOperateShape; let dx = 0; let dy = 0; if (dragObj && dragObj[nmodel.id]) { dx = ((_W = dragObj[nmodel.id]) == null ? void 0 : _W.dx) ? (_X = dragObj[nmodel.id]) == null ? void 0 : _X.dx : 0; dy = ((_Y = dragObj[nmodel.id]) == null ? void 0 : _Y.dy) ? (_Z = dragObj[nmodel.id]) == null ? void 0 : _Z.dy : 0; } if (!((__ = this.ddRender) == null ? void 0 : __.model.EXT_STAGE_WIDTH)) { let xm = ex - nmodel.cpv.x + dx; if (outRect.x + xm < 0) { pushData.x -= outRect.x + xm; } else if (outRect.x1 + xm > this.stage.width) { pushData.x -= outRect.x1 + xm - this.stage.width; } } if (!((_$ = this.ddRender) == null ? void 0 : _$.model.EXT_STAGE_HEIGHT)) { let ym = ey - nmodel.cpv.y + dy; if (outRect.y + ym < 0) { pushData.y -= outRect.y + ym; } else if (outRect.y1 + ym > this.stage.height) { pushData.y -= outRect.y1 + ym - this.stage.height; } } } } (_ca = (_ba = (_aa = this.stage) == null ? void 0 : _aa.ddInstance) == null ? void 0 : _ba.bus) == null ? void 0 : _ca.push(DDeiEnumBusCommandType.SetHelpLine, { models: this.model.shadowControls }, evt); (_fa = (_ea = (_da = this.stage) == null ? void 0 : _da.ddInstance) == null ? void 0 : _ea.bus) == null ? void 0 : _fa.push(DDeiEnumBusCommandType.ModelChangePosition, pushData, evt); (_ia = (_ha = (_ga = this.stage) == null ? void 0 : _ga.ddInstance) == null ? void 0 : _ha.bus) == null ? void 0 : _ia.push(DDeiEnumBusCommandType.RefreshShape); } } break; } case DDeiEnumOperateState.TABLE_INNER_DRAG: { this.model.opPoints = []; if ((_ja = this.model.opLine) == null ? void 0 : _ja.render) { this.model.opLine.render.enableRefreshShape(); } delete this.model.opLine; let table2 = this.stageRender.currentOperateShape; table2.render.mouseMove(evt); (_ma = (_la = (_ka = this.stage) == null ? void 0 : _ka.ddInstance) == null ? void 0 : _la.bus) == null ? void 0 : _ma.push(DDeiEnumBusCommandType.RefreshShape, null, evt); break; } case DDeiEnumOperateState.CONTROL_CHANGING_BOUND: { let points = []; switch (this.stageRender.selector.passIndex) { case 1: { points.push({ x: this.stageRender.selector.x + this.stageRender.selector.width / 2, y: this.stageRender.selector.y }); } break; case 2: { points.push({ x: this.stageRender.selector.x + this.stageRender.selector.width, y: this.stageRender.selector.y }); } break; case 3: { points.push({ x: this.stageRender.selector.x + this.stageRender.selector.width, y: this.stageRender.selector.y + this.stageRender.selector.height / 2 }); } break; case 4: { points.push({ x: this.stageRender.selector.x + this.stageRender.selector.width, y: this.stageRender.selector.y + this.stageRender.selector.height }); } break; case 5: { points.push({ x: this.stageRender.selector.x + this.stageRender.selector.width / 2, y: this.stageRender.selector.y + this.stageRender.selector.height }); } break; case 6: { points.push({ x: this.stageRender.selector.x, y: this.stageRender.selector.y + this.stageRender.selector.height }); } break; case 7: { points.push({ x: this.stageRender.selector.x, y: this.stageRender.selector.y + this.stageRender.selector.height / 2 }); } break; case 8: { points.push({ x: this.stageRender.selector.x, y: this.stageRender.selector.y }); } break; } points.forEach((point2) => { point2.x = point2.x * stageRatio2; point2.y = point2.y * stageRatio2; }); (_pa = (_oa = (_na = this.stage) == null ? void 0 : _na.ddInstance) == null ? void 0 : _oa.bus) == null ? void 0 : _pa.push(DDeiEnumBusCommandType.SetHelpLine, { models: this.model.shadowControls, points }, evt); (_sa = (_ra = (_qa = this.stage) == null ? void 0 : _qa.ddInstance) == null ? void 0 : _ra.bus) == null ? void 0 : _sa.executeAll(); let movedBounds = this.stageRender.selector.render.getMovedBounds(ex2, ey2, isCtrl || this.stageRender.selector.eqrat); if (movedBounds) { let selector = this.stageRender.selector; let pushData = { x: ex, y: ey, deltaX: movedBounds.x - selector.x * stageRatio2, deltaY: movedBounds.y - selector.y * stageRatio2, deltaWidth: movedBounds.width - selector.width * stageRatio2, deltaHeight: movedBounds.height - selector.height * stageRatio2, selector, models: this.model.shadowControls }; this.model.opPoints = []; if ((_ta = this.model.opLine) == null ? void 0 : _ta.render) { this.model.opLine.render.enableRefreshShape(); } delete this.model.opLine; Array.from(this.stage.selectedModels.values())[0]; (_wa = (_va = (_ua = this.stage) == null ? void 0 : _ua.ddInstance) == null ? void 0 : _va.bus) == null ? void 0 : _wa.push(DDeiEnumBusCommandType.ModelChangeBounds, pushData, evt); (_za = (_ya = (_xa = this.stage) == null ? void 0 : _xa.ddInstance) == null ? void 0 : _ya.bus) == null ? void 0 : _za.push(DDeiEnumBusCommandType.RefreshShape); } break; } case DDeiEnumOperateState.CONTROL_ROTATE: { let dragObj = this.stageRender.dragObj; (_Ca = (_Ba = (_Aa = this.stage) == null ? void 0 : _Aa.ddInstance) == null ? void 0 : _Ba.bus) == null ? void 0 : _Ca.push(DDeiEnumBusCommandType.ModelChangeRotate, { ex: ex2, ey: ey2, container: dragObj.container, models: dragObj.models }, evt); (_Fa = (_Ea = (_Da = this.stage) == null ? void 0 : _Da.ddInstance) == null ? void 0 : _Ea.bus) == null ? void 0 : _Fa.push(DDeiEnumBusCommandType.RefreshShape, null, evt); break; } case DDeiEnumOperateState.QUICK_EDITING: { if (this.stageRender.editorShadowControl) { this.model.opPoints = []; if ((_Ga = this.model.opLine) == null ? void 0 : _Ga.render) { this.model.opLine.render.enableRefreshShape(); } delete this.model.opLine; let shadowControl = this.stageRender.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.isInTextArea(ex, ey)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "text" }, evt); } else { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "default" }, evt); } } break; } case DDeiEnumOperateState.QUICK_EDITING_TEXT_SELECTING: { let shadowControl = this.stageRender.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.isInTextArea(ex2, ey2)) { let cx = (ex2 - shadowControl.cpv.x) * rat1 * stageRatio2; let cy = (ey2 - shadowControl.cpv.y) * rat1 * stageRatio2; let startIndex = 0; let sx = 0; let i2 = 0; let scaleSize = 1; for (; i2 < shadowControl.render.textUsedArea.length; i2++) { let rowData = shadowControl.render.textUsedArea[i2]; let ry = rowData.y / scaleSize; let rh = rowData.height / scaleSize; let rx = rowData.x / scaleSize; let rw = rowData.width / scaleSize; if (cy >= ry && cy <= ry + rh) { if (cx >= rx && cx <= rx + rw) { let endI = startIndex + rowData.text.length; for (let x2 = startIndex; x2 < endI; x2++) { let fx = shadowControl.render.textUsedArea[0].textPosCache[x2].x / scaleSize; let lx = x2 < endI - 1 ? shadowControl.render.textUsedArea[0].textPosCache[x2 + 1].x / scaleSize : rx + rw; let halfW = (lx - fx) / 2; if (cx >= fx && cx < lx) { if (cx > fx + halfW) { sx = x2 + 1; } else { sx = x2; } break; } } } if (!sx) { if (ex2 < shadowControl.cpv.x) { sx = startIndex; } else { sx = startIndex + rowData.text.length; } } break; } startIndex += rowData.text.length; } if (!sx) { if (ex2 < shadowControl.cpv.x) { sx = 0; } else { sx = startIndex + shadowControl.render.textUsedArea[i2 - 1].text.length; } } let editorText = DDeiUtil$1.getEditorText(); if (this.stageRender.tempTextStart > sx) { editorText.selectionStart = sx; editorText.selectionEnd = this.stageRender.tempTextStart; } else { editorText.selectionEnd = sx; } setTimeout(() => { editorText.focus(); }, 10); this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "text" }, evt); this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); this.stage.ddInstance.bus.executeAll(); break; } break; } case DDeiEnumOperateState.OV_POINT_CHANGING: { (_Ja = (_Ia = (_Ha = this.stage) == null ? void 0 : _Ha.ddInstance) == null ? void 0 : _Ia.bus) == null ? void 0 : _Ja.push(DDeiEnumBusCommandType.OVSChangePosition, { x: ex2, y: ey2 }, evt); (_Ma = (_La = (_Ka = this.stage) == null ? void 0 : _Ka.ddInstance) == null ? void 0 : _La.bus) == null ? void 0 : _Ma.push(DDeiEnumBusCommandType.RefreshShape); break; } default: { this.model.opPoints = []; if ((_Na = this.model.opLine) == null ? void 0 : _Na.render) { this.model.opLine.render.enableRefreshShape(); } delete this.model.opLine; let inSelector = false; if (this.stageRender.selector && this.stageRender.selector.isInAreaLoose(ex2, ey2, true)) { this.stageRender.selector.render.mouseMove(evt); inSelector = true; } let operateControls = DDeiAbstractShape.findBottomModelsByArea(this.model, ex2, ey2, true); this.ddRender.inAreaControls = operateControls; if (operateControls != null && operateControls.length > 0) { let allowBackActive = DDeiUtil$1.isBackActive((_Oa = this.stage) == null ? void 0 : _Oa.ddInstance); if (allowBackActive) { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_MOVE_IN_CONTROL", "MOVE_IN_CONTROL", { models: operateControls }, this.ddRender.model, evt); } for (let li = 0; li < operateControls.length; li++) { let control = operateControls[li]; control.render.mouseMove(evt); if (control.baseModelType != "DDeiContainer") { break; } } } else if (!inSelector || this.stageRender.selector.passIndex == -1) { if (((_Pa = this.stage.ddInstance) == null ? void 0 : _Pa.editMode) == 1) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "default" }, evt); } else if (((_Qa = this.stage.ddInstance) == null ? void 0 : _Qa.editMode) == 2) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "grab" }, evt); } else if (((_Ra = this.stage.ddInstance) == null ? void 0 : _Ra.editMode) == 4) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "default" }, evt); } let allowBackActive = DDeiUtil$1.isBackActive((_Sa = this.stage) == null ? void 0 : _Sa.ddInstance); if (allowBackActive) { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_MOVE_IN_LAYER", "MOVE_IN_LAYER", { layer: this.model, ex, ey }, this.ddRender.model, evt); } } if ((_Ta = this.stage) == null ? void 0 : _Ta.brushData) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { image: "cursor-brush" }, evt); } (_Wa = (_Va = (_Ua = this.stage) == null ? void 0 : _Ua.ddInstance) == null ? void 0 : _Va.bus) == null ? void 0 : _Wa.push(DDeiEnumBusCommandType.RefreshShape); break; } } (_Za = (_Ya = (_Xa = this.stage) == null ? void 0 : _Xa.ddInstance) == null ? void 0 : _Ya.bus) == null ? void 0 : _Za.executeAll(); } }; __publicField2(_DDeiLayerCanvasRender, "ClsName", "DDeiLayerCanvasRender"); let DDeiLayerCanvasRender = _DDeiLayerCanvasRender; const __vite_glob_1_3$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLayerCanvasRender, default: DDeiLayerCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiLineCanvasRender = class _DDeiLineCanvasRender2 extends DDeiAbstractShapeRender { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "textUsedArea", []); } // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiLineCanvasRender2(props); } // ============================== 方法 =============================== /** * 初始化 */ init() { this.ddRender = this.model.stage.ddInstance.render; this.stage = this.model.stage; this.stageRender = this.model.stage.render; if (this.model.layer) { this.layer = this.model.layer; this.layerRender = this.model.layer.render; } } createTempShape() { var _a3; let rat1 = this.ddRender.ratio; if (!this.tempCanvas) { this.tempCanvas = document.createElement("canvas"); this.tempCanvas.setAttribute("style", "pointer-events:none;position:absolute;-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;scale:" + 1 / rat1); } let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); let tempCanvas = this.tempCanvas; let pvs2 = this.model.getOperatePVS(true); let outRect = DDeiAbstractShape.pvsToOutRect(pvs2, stageRatio2); let weight = 5 * stageRatio2 * rat1; outRect.x -= weight; outRect.x1 += weight; outRect.y -= weight; outRect.y1 += weight; outRect.width += 2 * weight; outRect.height += 2 * weight; tempCanvas.setAttribute("width", outRect.width * rat1); tempCanvas.setAttribute("height", outRect.height * rat1); let tempCtx = tempCanvas.getContext("2d", { willReadFrequently: true }); tempCanvas.tx = -outRect.x * rat1; tempCanvas.ty = -outRect.y * rat1; tempCanvas.outRect = outRect; tempCtx.translate(tempCanvas.tx, tempCanvas.ty); } /** * 创建图形 */ drawShape(tempShape, composeRender = false, inRect = null, zIndex = 0) { var _a3; if (!inRect || this.model.isInRect(inRect.x, inRect.y, inRect.x1, inRect.y1)) { this.tempZIndex = zIndex; let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_BEFORE", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); if (rsState == 0 || rsState == 1) { let rsState1 = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", DDeiEnumOperateType.VIEW, { models: [this.model], tempShape, composeRender }, this.ddRender.model, null); if (rsState1 == 0 || rsState1 == 1) { if (!this.viewer) { let print = false; if (!DDeiUtil$1.isModelHidden(this.model) && this.refreshShape) { print = true; this.createTempShape(); let rendList = DDeiUtil$1.sortRendList(this.model); for (let ri = 0; ri < rendList.length; ri++) { let c = rendList[ri]; if (c == this.model) { this.tempZIndex = this.tempZIndex + ri; let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); ctx.save(); if (this.inited && this.model.id.indexOf("_shadow") == -1 && (!this.upLineType || this.upLineType != this.model.type)) { this.upLineType = this.model.type; this.model.freeze = 0; this.model.spvs = []; this.model.refreshLinePoints(); this.model.updateOVS(); (_a3 = this.stageRender) == null ? void 0 : _a3.selector.updatePVSByModels(); } else if (!this.inited) { this.inited = true; this.upLineType = this.model.type; } this.drawLine(tempShape); ctx.restore(); } else { c.render.drawShape(tempShape, 1, null, this.tempZIndex + ri); } } this.refreshShape = false; } this.drawSelfToCanvas(composeRender, print); } else { if (!DDeiUtil$1.isModelHidden(this.model) && this.refreshShape) { DDeiUtil$1.createRenderViewer(this.model, "VIEW", tempShape, composeRender); } else { DDeiUtil$1.createRenderViewer(this.model, "VIEW-HIDDEN"); } } } DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_AFTER", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); } } else { let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", "VIEW-HIDDEN", { models: [this.model] }, this.ddRender.model, null); if (rsState == 0 || rsState == 1) { if (!this.viewer) { this.removeViewerCanvas(); } else { DDeiUtil$1.createRenderViewer(this.model, "VIEW-HIDDEN"); } } } } drawSelfToCanvas(composeRender, print) { var _a3; if (this.viewer) { if (!DDeiUtil$1.isModelHidden(this.model) && this.refreshShape) { DDeiUtil$1.createRenderViewer(this.model, "VIEW", null, composeRender); } else { DDeiUtil$1.createRenderViewer(this.model, "VIEW-HIDDEN"); } } else if (this.tempCanvas) { if (!DDeiUtil$1.isModelHidden(this.model)) { let outRect = this.tempCanvas.outRect; let model = this.model; let stage2 = model.stage; let ruleWeight = 0; if (stage2.render.tempRuleDisplay == 1 || stage2.render.tempRuleDisplay == "1") { ruleWeight = 15; } if (!this.tempCanvas.parentElement) { let viewerEle = this.model.layer.render.containerViewer; viewerEle.appendChild(this.tempCanvas); } this.tempCanvas.style.zIndex = this.tempZIndex; this.tempCanvas.style.left = (outRect.x + outRect.x1) / 2 + this.model.stage.wpv.x - this.tempCanvas.offsetWidth / 2 - ruleWeight + "px"; this.tempCanvas.style.top = (outRect.y + outRect.y1) / 2 + this.model.stage.wpv.y - this.tempCanvas.offsetHeight / 2 - ruleWeight + "px"; if (!print) { (_a3 = this.model.composes) == null ? void 0 : _a3.forEach((comp) => { comp.render.drawSelfToCanvas(composeRender + 1); }); } } else { this.removeViewerCanvas(); } } } getRenderCanvas(composeRender) { var _a3; if (composeRender) { return this.model.pModel.render.getCanvas(); } else { return (_a3 = this.ddRender) == null ? void 0 : _a3.getCanvas(); } } getCanvas() { return this.tempCanvas; } /** * 绘制线段 */ drawLine(tempLine, tempCtx) { var _a3, _b2, _c2, _d2, _e2; let canvas = this.getCanvas(); if (!canvas) { return; } let ctx = tempCtx ? tempCtx : canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let rat1 = (tempLine == null ? void 0 : tempLine.rat1) ? tempLine.rat1 : this.ddRender.ratio; let ratio = rat1 * stageRatio2; rat1 = ratio; let color = (tempLine == null ? void 0 : tempLine.color) ? tempLine.color : this.getCachedValue("color"); if (!color) { color = DDeiUtil$1.getStyleValue("canvas-control-border", this.ddRender.model); } let weight = (tempLine == null ? void 0 : tempLine.weight) ? tempLine.weight : this.getCachedValue("weight"); let fillWeight = ((_a3 = tempLine == null ? void 0 : tempLine.fill) == null ? void 0 : _a3.weight) ? (_b2 = tempLine == null ? void 0 : tempLine.fill) == null ? void 0 : _b2.weight : this.getCachedValue("fill.weight"); weight = weight + fillWeight; let fillColor = ((_c2 = tempLine == null ? void 0 : tempLine.fill) == null ? void 0 : _c2.color) ? (_d2 = tempLine == null ? void 0 : tempLine.fill) == null ? void 0 : _d2.color : this.getCachedValue("fill.color"); let dash = (tempLine == null ? void 0 : tempLine.dash) ? tempLine.dash : this.getCachedValue("dash"); let round = (tempLine == null ? void 0 : tempLine.round) ? tempLine.round : this.getCachedValue("round"); let type = this.getCachedValue("type"); let opacity = (tempLine == null ? void 0 : tempLine.opacity) ? tempLine.opacity : this.getCachedValue("opacity"); let pvs2 = this.model.pvs; let jumpLine = DDeiModelArrtibuteValue.getAttrValueByState(this, "jumpline", true); if (jumpLine == 0 || !jumpLine) { if ((_e2 = this.stage.global) == null ? void 0 : _e2.jumpline) { jumpLine = this.stage.global.jumpline; } else if (this.stage.ddInstance.jumpline) { jumpLine = this.stage.ddInstance.jumpline; } else { jumpLine = DDeiModelArrtibuteValue.getAttrValueByState(this.stage, "global.jumpline", true); } } if ((pvs2 == null ? void 0 : pvs2.length) >= 2 && color && (!opacity || opacity > 0) && weight > 0) { let { startDX, startDY, endDX, endDY } = this.getPointShapeSize(); ctx.save(); let lineWidth = weight * ratio; let fillLineWidth = fillWeight * ratio; ctx.lineWidth = lineWidth; if (dash) { ctx.setLineDash(dash); } if (opacity != null && opacity != void 0) { ctx.globalAlpha = opacity; } ctx.strokeStyle = DDeiUtil$1.getColor(color); let crossWeight = 4; switch (type) { case 1: { ctx.beginPath(); ctx.moveTo((pvs2[0].x + startDX) * rat1, (pvs2[0].y + startDY) * rat1); if (this.model.clps[0] && jumpLine == 1) { let clps = this.model.clps[0]; for (let c = 0; c < clps.length; c++) { let cpi = clps[c].cp; let r = clps[c].r; ctx.arc(cpi.x * rat1, cpi.y * rat1, crossWeight * rat1, Math.PI / 180 * (r + 180), Math.PI / 180 * r, true); } } ctx.lineTo((pvs2[pvs2.length - 1].x + endDX) * rat1, (pvs2[pvs2.length - 1].y + endDY) * rat1); ctx.stroke(); if (fillLineWidth > 0) { ctx.lineWidth = fillLineWidth; ctx.strokeStyle = DDeiUtil$1.getColor(fillColor); ctx.stroke(); } ctx.closePath(); } break; case 2: { ctx.beginPath(); ctx.moveTo((pvs2[0].x + startDX) * rat1, (pvs2[0].y + startDY) * rat1); for (let i2 = 1; i2 < pvs2.length; i2++) { if (this.model.clps[i2 - 1] && jumpLine == 1) { let clps = this.model.clps[i2 - 1]; for (let c = 0; c < clps.length; c++) { let cpi = clps[c].cp; let r = clps[c].r; ctx.arc(cpi.x * rat1, cpi.y * rat1, crossWeight * rat1, Math.PI / 180 * (r + 180), Math.PI / 180 * r, true); } if (i2 == pvs2.length - 1) { ctx.lineTo((pvs2[i2].x + endDX) * rat1, (pvs2[i2].y + endDY) * rat1); } else { ctx.arcTo(pvs2[i2].x * rat1, pvs2[i2].y * rat1, pvs2[i2 + 1].x * rat1, pvs2[i2 + 1].y * rat1, round * rat1); } } else { if (i2 == pvs2.length - 1) { ctx.lineTo((pvs2[i2].x + endDX) * rat1, (pvs2[i2].y + endDY) * rat1); } else { ctx.arcTo(pvs2[i2].x * rat1, pvs2[i2].y * rat1, pvs2[i2 + 1].x * rat1, pvs2[i2 + 1].y * rat1, round * rat1); } } } ctx.stroke(); if (fillLineWidth > 0) { ctx.lineWidth = fillLineWidth; ctx.strokeStyle = DDeiUtil$1.getColor(fillColor); ctx.stroke(); } ctx.closePath(); } break; case 3: { if (pvs2.length >= 4) { for (let i2 = 4; i2 <= pvs2.length; i2 += 3) { ctx.beginPath(); let i0 = i2 - 4; let i1 = i2 - 3; let i22 = i2 - 2; let i3 = i2 - 1; if (i2 == 4) { ctx.moveTo((pvs2[i0].x + startDX) * rat1, (pvs2[i0].y + startDY) * rat1); } else { ctx.moveTo(pvs2[i0].x * rat1, pvs2[i0].y * rat1); } if (i2 == pvs2.length) { ctx.bezierCurveTo(pvs2[i1].x * rat1, pvs2[i1].y * rat1, pvs2[i22].x * rat1, pvs2[i22].y * rat1, (pvs2[i3].x + endDX) * rat1, (pvs2[i3].y + endDY) * rat1); } else { ctx.bezierCurveTo(pvs2[i1].x * rat1, pvs2[i1].y * rat1, pvs2[i22].x * rat1, pvs2[i22].y * rat1, pvs2[i3].x * rat1, pvs2[i3].y * rat1); } ctx.stroke(); if (fillLineWidth > 0) { ctx.lineWidth = fillLineWidth; ctx.strokeStyle = DDeiUtil$1.getColor(fillColor); ctx.stroke(); } ctx.closePath(); } } else { ctx.beginPath(); ctx.moveTo((pvs2[0].x + startDX) * rat1, (pvs2[0].y + startDY) * rat1); ctx.lineTo((pvs2[0].x + endDX) * rat1, pvs2[0].y * rat1, pvs2[1].x * rat1, (pvs2[1].y + endDY) * rat1); ctx.stroke(); if (fillLineWidth > 0) { ctx.lineWidth = fillLineWidth; ctx.strokeStyle = DDeiUtil$1.getColor(fillColor); ctx.stroke(); } ctx.closePath(); } } break; } this.drawPoint(tempLine, tempCtx); ctx.restore(); } } /** * 获取点图形所占用的空间 * @returns */ getPointShapeSize() { let stageRatio2 = this.model.getStageRatio(); let pvs2 = this.model.pvs; let startDX = 0; let endDX = 0; let startDY = 0; let endDY = 0; let stype = this.getCachedValue("sp.type"); let etype = this.getCachedValue("ep.type"); let sweight = this.getCachedValue("sp.weight"); let eweight = this.getCachedValue("ep.weight"); let fillWeight = this.getCachedValue("fill.weight"); let lineWeight = this.getCachedValue("weight"); lineWeight = lineWeight * stageRatio2; sweight += fillWeight; eweight += fillWeight; if (sweight <= 0) { sweight = 1; } if (eweight <= 0) { eweight = 1; } let startRotate = DDeiUtil$1.getLineAngle(pvs2[1].x, pvs2[1].y, pvs2[0].x, pvs2[0].y); let endRotate = DDeiUtil$1.getLineAngle(pvs2[pvs2.length - 2].x, pvs2[pvs2.length - 2].y, pvs2[pvs2.length - 1].x, pvs2[pvs2.length - 1].y); let startAngle = (startRotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let endAngle = (endRotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let startVectorUnit = new Vector3(1, 0, 1); let endVectorUnit = new Vector3(1, 0, 1); let startRotateMatrix = new Matrix3( Math.cos(startAngle), Math.sin(startAngle), 0, -Math.sin(startAngle), Math.cos(startAngle), 0, 0, 0, 1 ); startVectorUnit.applyMatrix3(startRotateMatrix); let endRotateMatrix = new Matrix3( Math.cos(endAngle), Math.sin(endAngle), 0, -Math.sin(endAngle), Math.cos(endAngle), 0, 0, 0, 1 ); endVectorUnit.applyMatrix3(endRotateMatrix); let wl = 0; switch (stype) { case 1: break; case 21: case 2: wl = sweight * stageRatio2; break; case 31: case 3: wl = sweight * stageRatio2; break; case 41: case 4: wl = 2 * sweight * stageRatio2 + lineWeight; break; case 51: case 5: wl = sweight * stageRatio2 + lineWeight; break; case 61: case 6: wl = sweight * stageRatio2 / 2; break; } startDX = -startVectorUnit.x * wl; startDY = startVectorUnit.y * wl; wl = 0; switch (etype) { case 1: break; case 21: case 2: wl = eweight * stageRatio2; break; case 31: case 3: wl = eweight * stageRatio2; break; case 41: case 4: wl = 2 * eweight * stageRatio2 + lineWeight; break; case 51: case 5: wl = eweight * stageRatio2 + lineWeight; break; case 61: case 6: wl = eweight * stageRatio2 / 2; break; } endDX = -endVectorUnit.x * wl; endDY = endVectorUnit.y * wl; return { startDX, startDY, endDX, endDY }; } /** * 绘制端点 */ drawPoint(tempLine, tempCtx) { let canvas = this.getCanvas(); if (!canvas) { return; } let ctx = tempCtx ? tempCtx : canvas.getContext("2d"); let stype = this.getCachedValue("sp.type"); let etype = this.getCachedValue("ep.type"); let sweight = this.getCachedValue("sp.weight"); let eweight = this.getCachedValue("ep.weight"); this.drawOnePoint(1, stype, sweight, ctx, tempLine); this.drawOnePoint(2, etype, eweight, ctx, tempLine); } /** * 绘制单个端点 * @param type * @param direct */ drawOnePoint(pointType, type, weight, ctx, tempLine) { var _a3, _b2, _c2, _d2; if (!type) { return; } let stageRatio2 = this.model.getStageRatio(); let rat1 = (tempLine == null ? void 0 : tempLine.rat1) ? tempLine.rat1 : this.ddRender.ratio; let ratio = rat1 * stageRatio2; rat1 = ratio; let color = (tempLine == null ? void 0 : tempLine.color) ? tempLine.color : this.getCachedValue("color"); let opacity = (tempLine == null ? void 0 : tempLine.opacity) ? tempLine.opacity : this.getCachedValue("opacity"); ctx.save(); ctx.setLineDash([]); let pvs2 = this.model.pvs; let point2 = null; let upPoint = null; let lineWeight = (tempLine == null ? void 0 : tempLine.weight) ? tempLine.weight : this.getCachedValue("weight"); let fillColor = ((_a3 = tempLine == null ? void 0 : tempLine.fill) == null ? void 0 : _a3.color) ? (_b2 = tempLine == null ? void 0 : tempLine.fill) == null ? void 0 : _b2.color : this.getCachedValue("fill.color"); let fillWeight = ((_c2 = tempLine == null ? void 0 : tempLine.fill) == null ? void 0 : _c2.weight) ? (_d2 = tempLine == null ? void 0 : tempLine.fill) == null ? void 0 : _d2.weight : this.getCachedValue("fill.weight"); weight += fillWeight; if (weight <= 0) { weight = 1; } let lineWidth = lineWeight * ratio; ctx.lineWidth = lineWidth; if (pointType == 1) { point2 = this.model.startPoint; upPoint = pvs2[1]; } else if (pointType == 2) { point2 = this.model.endPoint; upPoint = pvs2[pvs2.length - 2]; } point2 = new Vector3(point2.x, point2.y, 1); if (opacity != null && opacity != void 0) { ctx.globalAlpha = opacity; } ctx.fillStyle = DDeiUtil$1.getColor(color); ctx.strokeStyle = DDeiUtil$1.getColor(color); let rotate2 = DDeiUtil$1.getLineAngle(upPoint.x, upPoint.y, point2.x, point2.y); if (rotate2 != 0) { ctx.translate(point2.x * rat1, point2.y * rat1); ctx.rotate(rotate2 * DDeiConfig$1.ROTATE_UNIT); ctx.translate(-point2.x * rat1, -point2.y * rat1); } switch (type) { case 1: { let wl = weight * stageRatio2; ctx.beginPath(); ctx.moveTo((point2.x - wl) * rat1, (point2.y - 0.8 * wl) * rat1); ctx.lineTo(point2.x * rat1 - lineWidth / 2, point2.y * rat1); ctx.lineTo((point2.x - wl) * rat1, (point2.y + 0.8 * wl) * rat1); ctx.stroke(); ctx.closePath(); break; } case 21: case 2: { let wl = weight * stageRatio2; ctx.beginPath(); ctx.ellipse((point2.x - wl / 2) * rat1 - lineWidth / 2, point2.y * rat1, wl / 2 * rat1, wl / 2 * rat1, 0, 0, Math.PI * 2); ctx.closePath(); ctx.stroke(); if (fillWeight > 0 || type == 21 || tempLine) { if (fillWeight > 0) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); } ctx.fill(); } break; } case 31: case 3: { let wl = weight * stageRatio2; ctx.beginPath(); ctx.moveTo((point2.x - wl) * rat1 - lineWidth / 2, (point2.y - wl / 2) * rat1); ctx.lineTo(point2.x * rat1 - lineWidth / 2, (point2.y - wl / 2) * rat1); ctx.lineTo(point2.x * rat1 - lineWidth / 2, (point2.y + wl / 2) * rat1); ctx.lineTo((point2.x - wl) * rat1 - lineWidth / 2, (point2.y + wl / 2) * rat1); ctx.closePath(); ctx.stroke(); if (fillWeight > 0 || type == 31 || tempLine) { if (fillWeight > 0) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); } ctx.fill(); } break; } case 41: case 4: { let wl = weight * stageRatio2; ctx.beginPath(); ctx.moveTo(point2.x * rat1 - lineWidth, point2.y * rat1); ctx.lineTo((point2.x - wl) * rat1 - lineWidth, (point2.y - wl / 2) * rat1); ctx.lineTo((point2.x - 2 * wl) * rat1 - lineWidth, point2.y * rat1); ctx.lineTo((point2.x - wl) * rat1 - lineWidth, (point2.y + wl / 2) * rat1); ctx.lineTo(point2.x * rat1 - lineWidth, point2.y * rat1); ctx.closePath(); ctx.stroke(); if (fillWeight > 0 || type == 41 || tempLine) { if (fillWeight > 0) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); } ctx.fill(); } break; } case 51: case 5: { let wl = weight * stageRatio2; ctx.beginPath(); ctx.moveTo(point2.x * rat1 - lineWidth, point2.y * rat1); ctx.lineTo((point2.x - wl) * rat1 - lineWidth, (point2.y - wl / 2) * rat1); ctx.lineTo((point2.x - wl) * rat1 - lineWidth, (point2.y + wl / 2) * rat1); ctx.lineTo(point2.x * rat1 - lineWidth, point2.y * rat1); ctx.closePath(); ctx.stroke(); if (fillWeight > 0 || type == 51 || tempLine) { if (fillWeight > 0) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); } ctx.fill(); } break; } case 61: case 6: { let wl = weight * stageRatio2 / 2; ctx.beginPath(); ctx.ellipse((point2.x - wl / 2) * rat1 - lineWidth / 2, point2.y * rat1, wl * rat1, wl * rat1, 0, 0.4 * Math.PI, Math.PI * 1.6); ctx.stroke(); if (fillWeight > 0 || type == 61 || tempLine) { if (fillWeight > 0) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); } ctx.fill(); } break; } } ctx.restore(); } // ============================== 事件 =============================== /** * 鼠标按下事件 */ mouseDown(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; if (this.layer) { let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", (_a3 = this.ddRender) == null ? void 0 : _a3.model); let accessLink = DDeiUtil$1.isAccess( DDeiEnumOperateType.LINK, [this.model], null, modeName, (_b2 = this.ddRender) == null ? void 0 : _b2.model ); if (accessLink) { let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; let stageRatio2 = this.stage.getStageRatio(); ex = ex / stageRatio2; ey = ey / stageRatio2; let tpdata; let weight = DDeiConfig$1.SELECTOR.OPERATE_ICON.weight; let halfWeigth = weight * 0.5; for (let i2 = 0; i2 < this.opvs.length; i2++) { let pv = this.opvs[i2]; if (DDeiAbstractShape.isInsidePolygon( [ { x: pv.x - halfWeigth, y: pv.y - halfWeigth }, { x: pv.x + halfWeigth, y: pv.y - halfWeigth }, { x: pv.x + halfWeigth, y: pv.y + halfWeigth }, { x: pv.x - halfWeigth, y: pv.y + halfWeigth } ], { x: ex, y: ey } )) { tpdata = { type: this.opvsType[i2], index: i2 }; } } if (tpdata) { let dragPoint = this.opvs[tpdata.index]; let lineShadow = DDeiUtil$1.getShadowControl(this.model); this.layer.shadowControls.push(lineShadow); this.stageRender.currentOperateShape = lineShadow; this.stageRender.currentOperateShape.dragPoint = dragPoint; let dragObj = { x: ex, y: ey, dragPoint, model: lineShadow, opvsIndex: tpdata.index, passIndex: tpdata.type, opvs: this.opvs }; let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_LINE_DRAG_BEFORE", DDeiEnumOperateType.DRAG, dragObj, (_c2 = this.stage) == null ? void 0 : _c2.ddInstance, evt); if (rsState == 0 || rsState == 1) { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", DDeiEnumOperateType.LINK, null, (_d2 = this.stage) == null ? void 0 : _d2.ddInstance, evt); (_g = (_f = (_e2 = this.stage) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.bus) == null ? void 0 : _g.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj }, evt); (_j = (_i = (_h = this.stage) == null ? void 0 : _h.ddInstance) == null ? void 0 : _i.bus) == null ? void 0 : _j.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "grabbing" }, evt); this.stageRender.operateState = DDeiEnumOperateState.LINE_POINT_CHANGING; } } } } } /** * 绘制图形 */ mouseUp(evt) { super.mouseUp(evt); } /** * 鼠标移动 */ mouseMove(evt) { var _a3, _b2, _c2; if (this.layer) { let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", (_a3 = this.ddRender) == null ? void 0 : _a3.model); let accessLink = DDeiUtil$1.isAccess( DDeiEnumOperateType.LINK, [this.model], null, modeName, (_b2 = this.ddRender) == null ? void 0 : _b2.model ); if (accessLink) { this.layer.opLine = this.model; let type = this.getCachedValue("type"); let pvs2 = this.model.pvs; let { startDX, startDY, endDX, endDY } = this.getPointShapeSize(); let opvs = []; let opvsType = []; opvs.push(pvs2[0]); opvsType.push(1); switch (type) { case 2: { for (let i2 = 1; i2 < pvs2.length; i2++) { let x2 = (pvs2[i2].x + pvs2[i2 - 1].x) / 2; let y2 = (pvs2[i2].y + pvs2[i2 - 1].y) / 2; opvs.push(new Vector3(x2, y2, 1)); opvsType.push(3); if (i2 != pvs2.length - 1) { opvs.push(pvs2[i2]); opvsType.push(2); } } break; } case 3: { if (pvs2.length >= 4) { for (let i2 = 4; i2 <= pvs2.length; i2 += 3) { let i0 = i2 - 4; let i1 = i2 - 3; let i22 = i2 - 2; let i3 = i2 - 1; if (i0 != 0) { opvs.push(new Vector3(pvs2[i0].x, pvs2[i0].y, 1)); opvsType.push(4); } let stratX = pvs2[i0].x; let stratY = pvs2[i0].y; let endX = pvs2[i3].x; let endY = pvs2[i3].y; if (i0 == 0) { stratX = pvs2[i0].x + startDX; stratY = pvs2[i0].y + startDY; } if (i2 == pvs2.length) { endX = pvs2[i3].x + endDX; endY = pvs2[i3].y + endDY; } let btx = stratX * DDeiUtil$1.p331t3 + DDeiUtil$1.p331t2t3 * pvs2[i1].x + DDeiUtil$1.p33t21t3 * pvs2[i22].x + DDeiUtil$1.p33t3 * endX; let bty = stratY * DDeiUtil$1.p331t3 + DDeiUtil$1.p331t2t3 * pvs2[i1].y + DDeiUtil$1.p33t21t3 * pvs2[i22].y + DDeiUtil$1.p33t3 * endY; opvs.push(new Vector3(btx, bty, 1)); opvsType.push(4); btx = stratX * DDeiUtil$1.p661t3 + DDeiUtil$1.p661t2t3 * pvs2[i1].x + DDeiUtil$1.p66t21t3 * pvs2[i22].x + DDeiUtil$1.p66t3 * endX; bty = stratY * DDeiUtil$1.p661t3 + DDeiUtil$1.p661t2t3 * pvs2[i1].y + DDeiUtil$1.p66t21t3 * pvs2[i22].y + DDeiUtil$1.p66t3 * endY; opvs.push(new Vector3(btx, bty, 1)); opvsType.push(4); } } break; } } opvs.push(pvs2[pvs2.length - 1]); opvsType.push(1); this.opvs = opvs; this.opvsType = opvsType; let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; let stageRatio2 = (_c2 = this.stage) == null ? void 0 : _c2.getStageRatio(); ex = ex / stageRatio2; ey = ey / stageRatio2; let tpdata; let weight = DDeiConfig$1.SELECTOR.OPERATE_ICON.weight; let halfWeigth = weight * 0.5; for (let i2 = 0; i2 < this.opvs.length; i2++) { let pv = this.opvs[i2]; if (DDeiAbstractShape.isInsidePolygon( [ { x: pv.x - halfWeigth, y: pv.y - halfWeigth }, { x: pv.x + halfWeigth, y: pv.y - halfWeigth }, { x: pv.x + halfWeigth, y: pv.y + halfWeigth }, { x: pv.x - halfWeigth, y: pv.y + halfWeigth } ], { x: ex, y: ey } )) { tpdata = { type: this.opvsType[i2], index: i2 }; } } if (tpdata) { let direct = null; if (tpdata.type == 3) { let beforeP = this.opvs[tpdata.index - 1]; let afterP = this.opvs[tpdata.index + 1]; if (Math.abs(beforeP.x - afterP.x) <= 1) { direct = 2; } else { direct = 1; } } this.stage.ddInstance.bus.insert(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { type: "line", passIndex: tpdata.type, direct, opvsIndex: tpdata.index }, evt, 1); } else { this.stage.ddInstance.bus.insert(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { type: "line", passIndex: -1, opvsIndex: -1 }, evt, 1); } } } } /** * 绘制操作图形 */ drawOpShape() { let canvas = this.tempCanvas; let ctx = canvas.getContext("2d"); let stageRatio2 = this.stage.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; rat1 = ratio; let pvs2 = this.model.pvs; let type = this.getCachedValue("type"); let weight = this.getCachedValue("weight"); let w10 = 1.3 * weight * ratio; if (w10 > 5 * rat1) { w10 = 5 * rat1; } else if (w10 < 2 * rat1) { w10 = 2 * rat1; } let w15 = 1.5 * w10; let w20 = 2 * w10; let w30 = 2 * w15; let lineModel = this.model; ctx.save(); switch (type) { case 1: { this.drawSEPoint(pvs2, w10, w20, ctx, rat1, ratio); break; } case 2: { this.drawSEPoint(pvs2, w10, w20, ctx, rat1, ratio); ctx.strokeStyle = "#017fff"; ctx.fillStyle = "white"; for (let i2 = 1; i2 < pvs2.length; i2++) { if (i2 != pvs2.length - 1) { ctx.save(); let x1 = pvs2[i2].x * rat1; let y1 = pvs2[i2].y * rat1; if (lineModel.rotate) { ctx.translate(x1, y1); ctx.rotate(lineModel.rotate * DDeiConfig$1.ROTATE_UNIT); ctx.translate(-x1, -y1); } ctx.fillRect(x1 - w15, y1 - w15, w30, w30); ctx.strokeRect(x1 - w15, y1 - w15, w30, w30); ctx.restore(); } ctx.save(); let x2 = (pvs2[i2].x + pvs2[i2 - 1].x) / 2 * rat1; let y2 = (pvs2[i2].y + pvs2[i2 - 1].y) / 2 * rat1; ctx.translate(x2, y2); ctx.rotate(((lineModel.rotate ? lineModel.rotate : 0) + 45) * DDeiConfig$1.ROTATE_UNIT); ctx.translate(-x2, -y2); ctx.fillRect(x2 - w10, y2 - w10, w20, w20); ctx.strokeRect(x2 - w10, y2 - w10, w20, w20); ctx.restore(); } break; } case 3: { this.drawSEPoint(pvs2, w10, w20, ctx, rat1, ratio); if (pvs2.length >= 4) { ctx.strokeStyle = "#017fff"; ctx.fillStyle = "white"; for (let i2 = 1; i2 < this.opvs.length - 1; i2++) { let pv = this.opvs[i2]; ctx.beginPath(); ctx.ellipse(pv.x * rat1, pv.y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.stroke(); } } break; } } ctx.restore(); } getOvPointByPos(x2 = 0, y2 = 0) { var _a3, _b2; if (x2 && y2 && ((_a3 = this.ovs) == null ? void 0 : _a3.length) > 0) { for (let i2 = 0; i2 < ((_b2 = this.ovs) == null ? void 0 : _b2.length); i2++) { let point2 = this.ovs[i2]; if (Math.abs(x2 - point2.x) <= 8 && Math.abs(y2 - point2.y) <= 8) { return point2; } } } return null; } /** * 绘制开始和结束操作点 */ drawSEPoint(pvs2, w10, w20, ctx, rat1, ratio) { ctx.strokeStyle = "red"; ctx.lineWidth = ratio; ctx.fillStyle = "white"; ctx.beginPath(); ctx.ellipse(pvs2[0].x * rat1, pvs2[0].y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.beginPath(); ctx.ellipse(pvs2[pvs2.length - 1].x * rat1, pvs2[pvs2.length - 1].y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.fillStyle = "red"; ctx.beginPath(); ctx.ellipse(pvs2[0].x * rat1, pvs2[0].y * rat1, w10, w10, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.beginPath(); ctx.ellipse(pvs2[pvs2.length - 1].x * rat1, pvs2[pvs2.length - 1].y * rat1, w10, w10, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.beginPath(); ctx.ellipse(pvs2[0].x * rat1, pvs2[0].y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.stroke(); ctx.beginPath(); ctx.ellipse(pvs2[pvs2.length - 1].x * rat1, pvs2[pvs2.length - 1].y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.stroke(); } }; __publicField2(_DDeiLineCanvasRender, "ClsName", "DDeiLineCanvasRender"); let DDeiLineCanvasRender = _DDeiLineCanvasRender; const __vite_glob_1_4$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiLineCanvasRender, default: DDeiLineCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiPolygonCanvasRender = class _DDeiPolygonCanvasRender2 extends DDeiAbstractShapeRender { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "textUsedArea", []); } // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiPolygonCanvasRender2(props); } // ============================== 方法 =============================== /** * 初始化 */ init() { this.ddRender = this.model.stage.ddInstance.render; this.stage = this.model.stage; this.stageRender = this.model.stage.render; if (this.model.layer) { this.layer = this.model.layer; this.layerRender = this.model.layer.render; } } initImage() { let that = this; let bgImage = DDeiUtil$1.getReplacibleValue(this.model, "fill.image"); if ((this.model.imgBase64 || bgImage) && !this.imgObj) { let img = new Image(); img.onload = function() { that.imgObj = img; that.upFillImage = bgImage; that.clearCachedValue(); that.ddRender.model.bus.push(DDeiEnumBusCommandType.RefreshShape, null, null); that.ddRender.model.bus.executeAll(); }; img.src = this.model.imgBase64 ? this.model.imgBase64 : bgImage; } } createTempShape() { let stageRatio2 = this.model.getStageRatio(); let rat1 = this.ddRender.ratio; if (!this.tempCanvas) { this.tempCanvas = document.createElement("canvas"); this.tempCanvas.setAttribute("style", "pointer-events:none;position:absolute;-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;scale:" + 1 / rat1); } let tempCanvas = this.tempCanvas; let pvs2 = this.model.operatePVS ? this.model.operatePVS : this.model.pvs; let outRect = DDeiAbstractShape.pvsToOutRect(pvs2, stageRatio2); let weight = 5; outRect.x -= weight; outRect.x1 += weight; outRect.y -= weight; outRect.y1 += weight; outRect.width += 2 * weight; outRect.height += 2 * weight; tempCanvas.style.width = outRect.width; tempCanvas.style.height = outRect.height; tempCanvas.setAttribute("width", outRect.width * rat1); tempCanvas.setAttribute("height", outRect.height * rat1); let tempCtx = tempCanvas.getContext("2d", { willReadFrequently: true }); tempCanvas.tx = -outRect.x * rat1; tempCanvas.ty = -outRect.y * rat1; tempCanvas.outRect = outRect; tempCtx.translate(tempCanvas.tx, tempCanvas.ty); } /** * 绘制图形 */ drawShape(tempShape, composeRender = 0, inRect = null, zIndex = 0) { if (!inRect || this.model.isInRect(inRect.x, inRect.y, inRect.x1, inRect.y1)) { this.tempZIndex = zIndex; let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_BEFORE", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); if (composeRender || rsState == 0 || rsState == 1) { let rsState1 = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", DDeiEnumOperateType.VIEW, { models: [this.model], tempShape, composeRender }, this.ddRender.model, null); if (rsState1 == 0 || rsState1 == 1) { if (!this.viewer) { const isModelVisible = !DDeiUtil$1.isModelHidden(this.model); const shouldRefresh = this.refreshShape || this.isEditoring; if (isModelVisible && shouldRefresh) { this.createAndPrepareShape(tempShape); const rendList = this.getCachedRenderList(); for (let ri = 0; ri < rendList.length; ri++) { let c = rendList[ri]; if (c == this.model) { this.renderSelf(tempShape, composeRender); } else { this.renderCompose(c, tempShape, composeRender, ri); } } if (!this.isEditoring) { this.refreshShape = false; } } this.drawSelfToCanvas(composeRender, isModelVisible && shouldRefresh); } else { this.renderWithViewer(tempShape, composeRender); } } if (!composeRender) { DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_AFTER", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); } } } else { this.handleHiddenState(); } } // 新增的辅助方法 createAndPrepareShape(tempShape) { this.createTempShape(); this.calScaleType3Size(tempShape); this.calPVSS(tempShape); } getCachedRenderList() { var _a3; if (!this._cachedRenderList) { this._cachedRenderList = []; if (((_a3 = this.model.composes) == null ? void 0 : _a3.length) > 0) { this._cachedRenderList = this._cachedRenderList.concat(this.model.composes); } this._cachedRenderList.push(this.model); this._cachedRenderList.sort((a, b) => (a.cIndex || 0) - (b.cIndex || 0)); } return this._cachedRenderList; } renderSelf(tempShape, composeRender) { const canvas = this.getCanvas(); const ctx = canvas.getContext("2d"); ctx.save(); this.createClip(tempShape); this.drawFill(tempShape); this.drawText(tempShape); this.drawBorder(tempShape); ctx.restore(); } renderCompose(c, tempShape, composeRender, index) { if (tempShape && (tempShape == null ? void 0 : tempShape.drawCompose) == false) { c.render.drawShape(null, composeRender + 1, null, this.tempZIndex + index); } else { c.render.drawShape(tempShape, composeRender + 1, null, this.tempZIndex + index); } } renderWithViewer(tempShape, composeRender) { if (!DDeiUtil$1.isModelHidden(this.model) && (this.refreshShape || this.isEditoring)) { DDeiUtil$1.createRenderViewer(this.model, "VIEW", tempShape, composeRender); } else { DDeiUtil$1.createRenderViewer(this.model, "VIEW-HIDDEN"); } } handleHiddenState() { let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", "VIEW-HIDDEN", { models: [this.model] }, this.ddRender.model, null); if (rsState == 0 || rsState == 1) { if (!this.viewer) { this.removeViewerCanvas(); } else { DDeiUtil$1.createRenderViewer(this.model, "VIEW-HIDDEN"); } } } /** * 绘制自身到最外层canvas */ drawSelfToCanvas(composeRender, print) { var _a3; if (this.viewer) { if (!DDeiUtil$1.isModelHidden(this.model) && this.refreshShape) { DDeiUtil$1.createRenderViewer(this.model, "VIEW", null, composeRender); } else { DDeiUtil$1.createRenderViewer(this.model, "VIEW-HIDDEN"); } } else if (this.tempCanvas) { let model = this.model; if (!DDeiUtil$1.isModelHidden(this.model)) { let stage2 = model.stage; let ruleWeight = 0; if (stage2.render.tempRuleDisplay == 1 || stage2.render.tempRuleDisplay == "1") { ruleWeight = 15; } let stageRatio2 = this.model.getStageRatio(); if (!this.tempCanvas.parentElement) { let viewerEle = this.model.layer.render.containerViewer; viewerEle.appendChild(this.tempCanvas); } this.tempCanvas.style.zIndex = this.tempZIndex; this.tempCanvas.style.left = this.model.cpv.x * stageRatio2 + this.model.stage.wpv.x - this.tempCanvas.offsetWidth / 2 - ruleWeight + "px"; this.tempCanvas.style.top = this.model.cpv.y * stageRatio2 + this.model.stage.wpv.y - this.tempCanvas.offsetHeight / 2 - ruleWeight + "px"; let transform = ""; if (this.model.mirrorX) { transform += " rotateY(180deg)"; } if (this.model.mirrorY) { transform += " rotateX(180deg)"; } this.tempCanvas.style.transform = transform; if (!print) { (_a3 = this.model.composes) == null ? void 0 : _a3.forEach((comp) => { comp.render.drawSelfToCanvas(composeRender + 1); }); } } else { this.removeViewerCanvas(); } } } getRenderCanvas(composeRender) { var _a3; if (composeRender) { return this.model.pModel.render.getCanvas(); } else if (this.model.pModel.baseModelType == "DDeiContainer") { return this.model.pModel.render.getCanvas(); } else { return (_a3 = this.ddRender) == null ? void 0 : _a3.getCanvas(); } } getCanvas() { if (this.tempCanvas) { return this.tempCanvas; } else { return this.getRenderCanvas(); } } /** * 创建剪切区 * @param tempShape */ createClip(tempShape) { var _a3, _b2, _c2, _d2, _e2; let i2 = 0; let createClip = false; for (; i2 < this.borderPVSS.length; i2++) { if (this.borderPVSS[i2][0].clip == 1) { createClip = true; break; } } if (createClip) { let type = ((_a3 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _a3.type) || ((_b2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _b2.type) == 0 ? (_c2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _c2.type : this.getCachedValue("border.type"); let width = ((_d2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _d2.width) ? (_e2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _e2.width : this.getCachedValue("border.width"); let pvs2 = this.borderPVSS[i2]; if ((type == 1 || type == "1") && width > 0) { let stageRatio2 = this.model.getStageRatio(); width *= stageRatio2; let rat1 = this.ddRender.ratio; if (pvs2.length == 1) { pvs2 = cloneDeep(pvs2); pvs2[0].r = pvs2[0].r * (1 + rat1 * width / this.model.width); } else { pvs2 = DDeiUtil$1.pointsToZero(pvs2, this.model.cpv, this.model.rotate); pvs2 = DDeiUtil$1.zeroToPoints(pvs2, this.model.cpv, this.model.rotate, 1 + rat1 * width / this.model.width, 1 + rat1 * width / this.model.height); } } let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); this.createPath(pvs2, tempShape); ctx.clip(); } } /** * 生成边框的区域向量 */ getBorderPVS(pvs2, tempShape) { var _a3, _b2, _c2, _d2, _e2; let stageRatio2 = this.model.getStageRatio(); let round = ((_a3 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _a3.round) ? (_b2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _b2.round : this.getCachedValue("border.round"); ((_c2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _c2.type) || ((_d2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _d2.type) == 0 ? (_e2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _e2.type : this.getCachedValue("border.type"); if (!round) { round = 0; } let borderPVS = []; for (let s = 0; s < pvs2.length; s++) { borderPVS[s] = clone(pvs2[s]); } for (let i2 = 1; i2 < borderPVS.length + 1; i2++) { let rd = round; let s = i2; let e = s + 1; let upI = s - 1; if (s == borderPVS.length - 1) { e = 0; } else if (s == borderPVS.length) { s = 0; e = 1; upI = borderPVS.length - 1; } if (borderPVS[s].rd || borderPVS[s].rd == 0) { rd = borderPVS[s].rd; } if (rd && (borderPVS[s].stroke || borderPVS[s].fill)) { let usx = borderPVS[upI].x; let usy = borderPVS[upI].y; let sx = borderPVS[s].x; let sy = borderPVS[s].y; let ex = borderPVS[e].x; let ey = borderPVS[e].y; let lineRadius = DDeiUtil$1.getLinesAngle(usx, usy, sx, sy, sx, sy, ex, ey, true) / 2; let lineBCDistance = DDeiUtil$1.getPointDistance(sx, sy, ex, ey); let lineABDistance = DDeiUtil$1.getPointDistance(usx, usy, sx, sy); let tanRadis = Math.tan(lineRadius); let maxR = Math.abs(tanRadis * lineBCDistance); rd = Math.min(maxR, rd, lineBCDistance / 2, lineABDistance / 2); rd *= stageRatio2; let lineBC1Distance = Math.abs(rd / tanRadis); let distLength = Math.min(lineBCDistance / 2, lineABDistance / 2, lineBC1Distance); let bc1pv = DDeiUtil$1.getPathPoint(sx, sy, ex, ey, 1, distLength, -1, lineBCDistance); borderPVS[s].roundDistLength = distLength; borderPVS[s].roundVal = rd; borderPVS[s].roundPV = bc1pv; } } return borderPVS; } /** * 取得边框的绘制区域 */ getBorderRatPos() { let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; let absBounds = this.model.getAbsBounds(); return DDeiUtil$1.getRatioPosition(absBounds, ratio); } /** * 对pvs按group进行拆分, */ calPVSS(tempShape) { let pvss = []; let curPVS = null; let curGroup = -1; let len1 = this.model.pvs.length; for (let i2 = 0; i2 < len1; i2++) { if (curGroup != this.model.pvs[i2].group) { curGroup = this.model.pvs[i2].group; curPVS = []; pvss.push(curPVS); } curPVS == null ? void 0 : curPVS.push(this.model.pvs[i2]); } let borderPVSS = []; pvss.forEach((pvs2) => { if (pvs2.length > 2) { let borderPVS = this.getBorderPVS(pvs2, tempShape); borderPVSS.push(borderPVS); } else { borderPVSS.push(pvs2); } }); this.pvss = pvss; this.borderPVSS = borderPVSS; } /** * 创建路径 */ createPath(pvs2, tempShape, drawLine = false) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m; let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; rat1 = ratio; let type = ((_a3 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _a3.type) || ((_b2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _b2.type) == 0 ? (_c2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _c2.type : this.getCachedValue("border.type"); let color = ((_d2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _d2.color) ? (_e2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _e2.color : this.getCachedValue("border.color"); if (!color) { color = DDeiUtil$1.getStyleValue("canvas-control-border", this.ddRender.model); } let opacity = ((_f = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _f.opacity) ? (_g = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _g.opacity : this.getCachedValue("border.opacity"); let width = ((_h = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _h.width) ? (_i = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _i.width : this.getCachedValue("border.width"); let dash = ((_j = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _j.dash) ? (_k = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _k.dash : this.getCachedValue("border.dash"); let lineWidth = width * ratio; drawLine = drawLine && ((type == 1 || type == "1") && (!opacity || opacity > 0) && width > 0); ((_l = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _l.round) ? (_m = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _m.round : this.getCachedValue("border.round"); if (!pvs2 || (pvs2 == null ? void 0 : pvs2.length) < 1) { return; } let rest = false; if (drawLine) { ctx.save(); ctx.lineWidth = lineWidth; if (dash) { ctx.setLineDash(dash); } if (opacity != null && opacity != void 0) { ctx.globalAlpha = opacity; } ctx.strokeStyle = DDeiUtil$1.getColor(color); if (pvs2[0].strokeClear) { ctx.globalCompositeOperation = "destination-out"; } } if ((pvs2 == null ? void 0 : pvs2.length) > 2) { let len = pvs2.length; if (pvs2[0].begin) { ctx.beginPath(); } if (!pvs2[0].roundPV) { ctx.moveTo(pvs2[0].x * rat1, pvs2[0].y * rat1); } else { ctx.moveTo(pvs2[0].roundPV.x * rat1, pvs2[0].roundPV.y * rat1); } for (let i2 = 1; i2 < len; i2++) { let pv = pvs2[i2]; let s = i2; let e = i2 + 1; if (i2 == len - 1) { e = 0; } let dx = pv.dx ? pv.dx : 0; let dy = pv.dy ? pv.dy : 0; if (pv.begin) { ctx.beginPath(); } if (pv.move) { ctx.moveTo(pv.x * rat1, pv.y * rat1); } if (pv.type == 3 || drawLine && !pv.stroke) { ctx.moveTo(pv.x * rat1, pv.y * rat1); } else if (pv.type == 2 || pv.type == 4) { let rotate2 = this.model.rotate; if (!rotate2) { rotate2 = 0; } let bpv2 = DDeiUtil$1.pointsToZero([this.model.bpv], this.model.cpv, rotate2)[0]; let scaleX2 = Math.abs(bpv2.x / 100); let scaleY2 = Math.abs(bpv2.y / 100); let upPV = pvs2[i2 - 1]; let wr = upPV.r; let hr = upPV.r; if (pv.type == 4) { wr = pvs2[i2 + 1].r; hr = pvs2[i2 + 2].r; i2 = i2 + 2; } ctx.ellipse((this.model.cpv.x + dx) * rat1, (this.model.cpv.y + dy) * rat1, wr * rat1 * scaleX2, hr * rat1 * scaleY2, DDeiConfig$1.ROTATE_UNIT * rotate2, upPV.rad, pv.rad, !pv.direct); } else if (pv.type == 5) { let i1 = i2 + 1; let i22 = i2 + 2; let i3 = i2 + 3; i2 = i2 + 3; ctx.bezierCurveTo(pvs2[i1].x * rat1, pvs2[i1].y * rat1, pvs2[i22].x * rat1, pvs2[i22].y * rat1, pvs2[i3].x * rat1, pvs2[i3].y * rat1); } else { let sx = pvs2[s].x * rat1; let sy = pvs2[s].y * rat1; if (!pvs2[s].roundVal) { let ex = pvs2[e].x * rat1; let ey = pvs2[e].y * rat1; ctx.lineTo(sx, sy, ex, ey); } else { let rd = pvs2[s].roundVal; let ex = pvs2[s].roundPV.x * rat1; let ey = pvs2[s].roundPV.y * rat1; ctx.arcTo(sx, sy, ex, ey, rd); } } if (i2 == len - 1 && pvs2[0].roundVal) { let rd = pvs2[0].roundVal; let ex = pvs2[0].roundPV.x * rat1; let ey = pvs2[0].roundPV.y * rat1; ctx.arcTo(pvs2[0].x * rat1, pvs2[0].y * rat1, ex, ey, rd); } if (pv.end) { ctx.closePath(); } if ((drawLine || pv.forceStroke) && pv.stroke) { if (pv.forceStroke) { ctx.strokeStyle = DDeiUtil$1.getColor(color); } rest = true; ctx.stroke(); } } } else if (pvs2.length == 1) { let pv = pvs2[0]; if (pv.begin) { ctx.beginPath(); } let rotate2 = this.model.rotate; if (!rotate2) { rotate2 = 0; } let bpv2 = DDeiUtil$1.pointsToZero([this.model.bpv], this.model.cpv, rotate2)[0]; let scaleX2 = Math.abs(bpv2.x / 100); let scaleY2 = Math.abs(bpv2.y / 100); let x2 = pv.cx || pv.cx == 0 ? this.model.cpv.x + pv.cx : this.model.cpv.x; let y2 = pv.cy || pv.cy == 0 ? this.model.cpv.y + pv.cy : this.model.cpv.y; ctx.ellipse(x2 * rat1, y2 * rat1, pv.r * rat1 * scaleX2, pv.r * rat1 * scaleY2, DDeiConfig$1.ROTATE_UNIT * rotate2, DDeiConfig$1.ROTATE_UNIT * 0, Math.PI * 2); if (pv.end) { ctx.closePath(); } if (drawLine && pv.stroke) { ctx.stroke(); } } else if (pvs2.length == 2) { if (pvs2[0].begin) { ctx.beginPath(); } if (pvs2[1].type == 1) { ctx.moveTo(pvs2[0].x * rat1, pvs2[0].y * rat1); ctx.lineTo(pvs2[1].x * rat1, pvs2[1].y * rat1); } else { let rotate2 = this.model.rotate; if (!rotate2) { rotate2 = 0; } let bpv2 = DDeiUtil$1.pointsToZero([this.model.bpv], this.model.cpv, rotate2)[0]; let scaleX2 = Math.abs(bpv2.x / 100); let scaleY2 = Math.abs(bpv2.y / 100); ctx.moveTo(this.model.cpv.x * rat1, this.model.cpv.y * rat1); ctx.lineTo(pvs2[0].x * rat1, pvs2[0].y * rat1); ctx.ellipse(this.model.cpv.x * rat1, this.model.cpv.y * rat1, pvs2[0].r * rat1 * scaleX2, pvs2[0].r * rat1 * scaleY2, DDeiConfig$1.ROTATE_UNIT * rotate2, pvs2[0].rad, pvs2[1].rad, !pvs2[1].direct); ctx.lineTo(pvs2[1].x * rat1, pvs2[1].y * rat1); } if (pvs2[1].end) { ctx.closePath(); } if (drawLine && pvs2[1].stroke) { ctx.stroke(); } } if (drawLine || rest) { ctx.restore(); } } /** * 绘制边框 * @param tempShape 临时图形,优先级最高 */ drawBorder(tempShape) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; ((_a3 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _a3.type) || ((_b2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _b2.type) == 0 ? (_c2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _c2.type : this.getCachedValue("border.type"); ((_d2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _d2.opacity) || ((_e2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _e2.opacity) == 0 ? (_f = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _f.opacity : this.getCachedValue("border.opacity"); ((_g = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _g.width) || ((_h = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _h.width) == 0 ? (_i = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _i.width : this.getCachedValue("border.width"); for (let i2 = 0; i2 < ((_j = this.borderPVSS) == null ? void 0 : _j.length); i2++) { let pvs2 = this.borderPVSS[i2]; this.createPath(pvs2, tempShape, true); } } /** * 绘制边框以及Compose的边框 * @param tempShape 临时图形,优先级最高 */ drawBorderAndComposesBorder(tempShape, drawCompose = true) { let rsState1 = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", DDeiEnumOperateType.VIEW, { models: [this.model], tempShape, composeRender: drawCompose }, this.ddRender.model, null); if (rsState1 == 0 || rsState1 == 1) { let rendList = DDeiUtil$1.sortRendList(this.model); this.createTempShape(); rendList.forEach((c) => { if (c == this.model) { this.drawBorder(tempShape); } else if (drawCompose) { c.render.drawBorder(tempShape, true); c.render.drawSelfToCanvas(1); } }); this.drawSelfToCanvas(0); } } /** * 填充图片 */ drawImage() { var _a3; let bgImage = DDeiUtil$1.getReplacibleValue(this.model, "fill.image"); if (!this.imgObj || bgImage != this.upFillImage) { this.initImage(); } else { let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.oldRatio ? this.ddRender.oldRatio : this.ddRender.ratio; let fillRect = this.model.essBounds; ctx.save(); let imgFillInfo = this.getCachedValue("fill.opacity"); if (imgFillInfo) { ctx.globalAlpha = imgFillInfo; } let lineOffset = 0; ctx.translate(this.model.cpv.x * rat1, this.model.cpv.y * rat1); ctx.rotate(this.model.rotate * DDeiConfig$1.ROTATE_UNIT); ctx.translate(-this.model.cpv.x * rat1, -this.model.cpv.y * rat1); ctx.imageSmoothingQuality = "high"; let ratio = rat1 * ((_a3 = this.stage) == null ? void 0 : _a3.getStageRatio()); ctx.drawImage(this.imgObj, 0, 0, this.imgObj.width, this.imgObj.height, (this.model.cpv.x - fillRect.width / 2) * ratio + lineOffset, (this.model.cpv.y - fillRect.height / 2) * ratio + lineOffset, fillRect.width * ratio, fillRect.height * ratio); ctx.restore(); } } /** * 绘制填充 */ drawFill(tempShape) { var _a3, _b2, _c2, _d2, _e2; let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); let fillColor = ((_a3 = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _a3.color) ? tempShape.fill.color : this.getCachedValue("fill.color"); if (!fillColor) { fillColor = DDeiUtil$1.getStyleValue("canvas-control-background", this.ddRender.model); } let fillOpacity = ((_b2 = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _b2.opacity) ? tempShape.fill.opacity : this.getCachedValue("fill.opacity"); let fillType = ((_c2 = tempShape == null ? void 0 : tempShape.fill) == null ? void 0 : _c2.type) ? tempShape.fill.type : this.getCachedValue("fill.type"); ctx.save(); let haveFilled = false; for (let i2 = 0; i2 < this.borderPVSS.length; i2++) { if (this.borderPVSS[i2][0].fill == 1) { let hasOpacity = false; haveFilled = true; let pvs2 = this.borderPVSS[i2]; if (pvs2[0].fillColor) { if (pvs2[0].fillColor == "none") { ctx.save(); hasOpacity = true; ctx.globalCompositeOperation = "destination-out"; fillColor = DDeiUtil$1.getColor("black"); } else if (pvs2[0].fillColor == "border") { fillColor = ((_d2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _d2.color) ? (_e2 = tempShape == null ? void 0 : tempShape.border) == null ? void 0 : _e2.color : this.getCachedValue("border.color"); if (!fillColor) { fillColor = DDeiUtil$1.getStyleValue("canvas-control-border", this.ddRender.model); } } else { fillColor = DDeiUtil$1.getColor(pvs2[0].fillColor); } } this.createPath(pvs2, tempShape); if (this.isEditoring) { if (!fillType || fillType == "0") { fillType = 1; } } if (fillType == 1) { if (this.isEditoring) { fillOpacity = 1; } if (fillColor && (!fillOpacity || fillOpacity > 0)) { ctx.fillStyle = DDeiUtil$1.getColor(fillColor); if (fillOpacity != null && !fillOpacity != void 0) { ctx.globalAlpha = fillOpacity; } if (pvs2[0].fillClear) { ctx.globalCompositeOperation = "destination-out"; } ctx.fill(); } } else if (fillType == 2) { this.drawImage(); } if (hasOpacity) { ctx.restore(); } } } if (!haveFilled && this.isEditoring) { let pvs2 = this.model.textArea; this.createPath(pvs2, tempShape); ctx.globalAlpha = 1; if (!fillColor) { fillColor = "white"; } ctx.fillStyle = DDeiUtil$1.getColor(fillColor); ctx.fill(); } ctx.restore(); } /** * 绘制文本 */ drawText(tempShape) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L; let align = this.getCachedValue("textStyle.align"); let valign = this.getCachedValue("textStyle.valign"); let scale = this.getCachedValue("textStyle.scale"); let feed = this.getCachedValue("textStyle.feed"); let hspace = this.getCachedValue("textStyle.hspace"); let vspace = this.getCachedValue("textStyle.vspace"); let fiFamily = this.getCachedValue("font.family"); let fiSize = this.getCachedValue("font.size"); let fiColor = this.getCachedValue("font.color"); if (!fiColor) { fiColor = DDeiUtil$1.getStyleValue("canvas-control-title", this.ddRender.model); } let hollow = this.getCachedValue("textStyle.hollow"); let bold = this.getCachedValue("textStyle.bold"); let italic = this.getCachedValue("textStyle.italic"); let underline = this.getCachedValue("textStyle.underline"); let deleteline = this.getCachedValue("textStyle.deleteline"); let topline = this.getCachedValue("textStyle.topline"); let textBgColor = this.getCachedValue("textStyle.bgcolor"); if (!this.model.textArea || this.model.textArea.length < 4) { return; } let fillRect = this.tempFillRect; if (!fillRect || fillRect.width == -Infinity || fillRect == -Infinity) { return; } let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; rat1 = ratio; let ratPos = DDeiUtil$1.getRatioPosition(fillRect, rat1); ctx.textAlign = "left"; ctx.textBaseline = "top"; let editorText = null; if (this.isEditoring) { editorText = DDeiUtil$1.getEditorText(); } let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; this.stageRender.editorShadowControl.tempCursorStart = curSIdx; this.stageRender.editorShadowControl.tempCursorEnd = curEIdx; } if (!hspace) { hspace = 0; } if (!vspace) { vspace = 0; } hspace = hspace * ratio; vspace = vspace * ratio; ctx.save(); ctx.translate(this.model.cpv.x * rat1, this.model.cpv.y * rat1); ctx.rotate(this.model.rotate * DDeiConfig$1.ROTATE_UNIT); let textContainer = []; let loop2 = true; let fontSize = fiSize; let cText = null; let sptStyle = null; if (this.isEditoring) { sptStyle = this.model.sptStyle; cText = this.getCachedValue("text"); } else { cText = DDeiUtil$1.getReplacibleValue(this.model, "text", true, true); sptStyle = this.tempSptStyle ? this.tempSptStyle : (tempShape == null ? void 0 : tempShape.sptStyle) ? tempShape.sptStyle : this.model.sptStyle; } if (!cText) { cText = ""; } let contentWidth = ratPos.width; let subtractionFontSize = 0; let isOutSize = false; let dotRect = null; if (scale == 3) { textContainer = this.tempTextContainer; } else { while (loop2) { let usedWidth = 0; let usedHeight = 0; let textRowContainer = { text: "", widths: [], heights: [], dHeights: [] }; textContainer.push(textRowContainer); isOutSize = false; let maxFontSize = 0; if (fontSize + vspace > ratPos.height) { if (scale == 1) { textContainer = []; let ds = fontSize < 50 ? 0.5 : Math.floor(fontSize / 50); fontSize -= ds; vspace -= ds; if (vspace < 0) { vspace = 0; } continue; } } let baseFont = fontSize + "px " + fiFamily; if (bold == "1") { baseFont = "bold " + baseFont; } if (italic == "1") { baseFont = "italic " + baseFont; } let rcIndex = 0; let lastUnSubTypeFontSize2 = 0; for (let ti = 0; ti < cText.length; ti++, rcIndex++) { let te = cText[ti]; let font = null; let fontHeight = null; let isEnter = false; let fontShapeRect = null; if ((feed == 1 || feed == "1") && te == "\n") { isEnter = true; textRowContainer.text += te; textRowContainer.widths[rcIndex] = 0; textRowContainer.heights[rcIndex] = 0; textRowContainer.width = Math.max(0, usedWidth); textRowContainer.height = Math.max(0, textRowContainer.height ? textRowContainer.height : 0, lastUnSubTypeFontSize2 ? lastUnSubTypeFontSize2 * ratio + vspace : fontSize * ratio + vspace); } else { if (sptStyle[ti]) { let ftsize = ((_b2 = (_a3 = sptStyle[ti]) == null ? void 0 : _a3.font) == null ? void 0 : _b2.size) ? ((_d2 = (_c2 = sptStyle[ti]) == null ? void 0 : _c2.font) == null ? void 0 : _d2.size) - subtractionFontSize : fontSize; if ((_e2 = sptStyle[ti].textStyle) == null ? void 0 : _e2.subtype) { if (!lastUnSubTypeFontSize2) { lastUnSubTypeFontSize2 = ftsize; } ftsize = lastUnSubTypeFontSize2 / 2; } else if (ftsize < 1) { ftsize = 2; } let ftfamily = ((_g = (_f = sptStyle[ti]) == null ? void 0 : _f.font) == null ? void 0 : _g.family) ? (_i = (_h = sptStyle[ti]) == null ? void 0 : _h.font) == null ? void 0 : _i.family : fiFamily; font = ftsize + "px " + ftfamily; if (((_k = (_j = sptStyle[ti]) == null ? void 0 : _j.textStyle) == null ? void 0 : _k.bold) == "1") { font = "bold " + font; } if (((_m = (_l = sptStyle[ti]) == null ? void 0 : _l.textStyle) == null ? void 0 : _m.italic) == "1") { font = "italic " + font; } fontHeight = ftsize; } if (!font) { font = baseFont; fontHeight = fontSize; } if (!((_o = (_n = sptStyle[ti]) == null ? void 0 : _n.textStyle) == null ? void 0 : _o.subtype)) { lastUnSubTypeFontSize2 = fontHeight; } maxFontSize = Math.max(maxFontSize, fontHeight); let rc1 = DDeiUtil$1.measureText(te, font, ctx, fontHeight); if (!dotRect) { dotRect = DDeiUtil$1.measureText("...", font, ctx, fontHeight); } fontShapeRect = { width: rc1.width * ratio + hspace, height: rc1.height * ratio, dHeight: rc1.dHeight * ratio }; usedWidth += fontShapeRect.width; textRowContainer.text += te; textRowContainer.widths[rcIndex] = fontShapeRect.width; textRowContainer.heights[rcIndex] = fontShapeRect.height + vspace; textRowContainer.dHeights[rcIndex] = fontShapeRect.dHeight; textRowContainer.width = usedWidth; textRowContainer.height = Math.max(fontShapeRect.height + vspace, textRowContainer.height ? textRowContainer.height : 0, lastUnSubTypeFontSize2 ? lastUnSubTypeFontSize2 * ratio + vspace : fontSize * ratio + vspace); } if (feed == 0) { if (usedWidth > contentWidth) { if (scale == 1 || scale == 2) { isOutSize = true; break; } } } else if (feed == 1 || feed == "1") { if (isEnter) { usedWidth = 0; usedHeight += textRowContainer.height; if (usedHeight + textRowContainer.height > ratPos.height) { if (scale == 1 || scale == 2) { isOutSize = true; break; } break; } rcIndex = -1; let lastRowHeight = textRowContainer.height; textRowContainer = { text: "", widths: [], heights: [], dHeights: [] }; textRowContainer.width = usedWidth; textRowContainer.height = lastRowHeight; textContainer.push(textRowContainer); } else if (usedWidth > contentWidth) { textRowContainer.text = textRowContainer.text.substring(0, textRowContainer.text.length - 1); textRowContainer.width -= fontShapeRect.width; textRowContainer.widths.splice(rcIndex, 1); textRowContainer.heights.splice(rcIndex, 1); usedWidth = fontShapeRect.width; usedHeight += textRowContainer.height; if (usedHeight + textRowContainer.height > ratPos.height) { if (scale == 1 || scale == 2) { isOutSize = true; break; } break; } rcIndex = 0; textRowContainer = { text: te, widths: [], heights: [], dHeights: [] }; textRowContainer.widths[rcIndex] = fontShapeRect.width; textRowContainer.heights[rcIndex] = fontShapeRect.height + vspace; textRowContainer.dHeights[rcIndex] = fontShapeRect.dHeight; textRowContainer.width = usedWidth; textRowContainer.height = Math.max(fontShapeRect.height + vspace, lastUnSubTypeFontSize2 * ratio + vspace); textContainer.push(textRowContainer); } } } if (!isOutSize) { loop2 = false; } else if (scale == 1) { textContainer = []; let ds = maxFontSize < 50 ? 0.5 : Math.floor(maxFontSize / 50); fontSize -= ds; vspace -= ds; if (vspace < 0) { vspace = 0; } subtractionFontSize += ds; } else { loop2 = false; } } if (isOutSize) { if (scale == 2) { if (textContainer.length > 0) { let lastText = textContainer[textContainer.length - 1].text; let widths = textContainer[textContainer.length - 1].widths; let heights = textContainer[textContainer.length - 1].heights; let dHeights = textContainer[textContainer.length - 1].dHeights; let dotWidth = dotRect.width / 3; if (lastText.length > 0) { textContainer[textContainer.length - 1].width = textContainer[textContainer.length - 1].width - widths[widths.length - 1] + dotRect.width; lastText = lastText.substring(0, lastText.length - 1); widths.splice(widths.length - 1, 1, dotWidth, dotWidth, dotWidth); heights.splice(heights.length - 1, 1, heights[heights.length - 1], heights[heights.length - 1], heights[heights.length - 1]); dHeights.splice(dHeights.length - 1, 1, dHeights[dHeights.length - 1], dHeights[dHeights.length - 1], dHeights[dHeights.length - 1]); lastText += "..."; textContainer[textContainer.length - 1].text = lastText; } } } } } let containerRect = { width: 0, height: 0 }; for (let i2 = 0; i2 < textContainer.length; i2++) { if (i2 == 0) { containerRect.width += textContainer[i2].width; } containerRect.height += textContainer[i2].height; } let containerWidth = containerRect.width; let containerHeight = containerRect.height; let x2, y2; if (align == 1) { x2 = 0; } else if (align == 2) { x2 = (ratPos.width - containerWidth) * 0.5; } else if (align == 3) { x2 = ratPos.width - containerWidth; } x2 = x2 + ratPos.x; if (valign == 1) { y2 = 0; } else if (valign == 2) { y2 = (ratPos.height - containerHeight) * 0.5; } else if (valign == 3) { y2 = ratPos.height - containerHeight; } y2 = y2 + ratPos.y; let cursorX = -Infinity; let cursorY = -Infinity; let cursorHeight = 0; let tempIdx = 0; let usedY = 0, usedX = 0; let lastUsedX, lastUsedY, lastWidth, lastHeight; let lastUnSubTypeFontSize = 0; if (textContainer.length > 0) { textContainer[0].textPosCache = []; } for (let tci = 0; tci < textContainer.length; tci++) { lastUsedX = 0; let rRect = textContainer[tci]; let x1, y1; if (align == 1) { x1 = x2; y1 = y2 + usedY; } else if (align == 2) { x1 = ratPos.x + (ratPos.width - rRect.width) * 0.5; y1 = y2 + usedY; } else if (align == 3) { x1 = ratPos.x + (ratPos.width - rRect.width); y1 = y2 + usedY; } textContainer[tci].x = x1; textContainer[tci].y = y1; usedX = x1; for (let tj = 0; tj < textContainer[tci].text.length; tj++, tempIdx++) { let width = textContainer[tci].widths[tj]; let height = textContainer[tci].heights[tj]; lastWidth = width; lastHeight = height; ctx.save(); let font = fontSize * ratio + "px " + fiFamily; if (bold == "1") { font = "bold " + font; } if (italic == "1") { font = "italic " + font; } let tHollow = hollow; let tUnderline = underline; let tDeleteline = deleteline; let tTopline = topline; let tFontColor = fiColor; let tBgColor = textBgColor; let ftsize = fontSize * ratio; let subScriptOffY = 0; if (sptStyle[tempIdx]) { tBgColor = ((_p = sptStyle[tempIdx].textStyle) == null ? void 0 : _p.bgcolor) ? sptStyle[tempIdx].textStyle.bgcolor : textBgColor; ftsize = ((_q = sptStyle[tempIdx].font) == null ? void 0 : _q.size) ? ((_r = sptStyle[tempIdx].font) == null ? void 0 : _r.size) - subtractionFontSize : fontSize; ftsize *= ratio; if ((_s = sptStyle[tempIdx].textStyle) == null ? void 0 : _s.subtype) { if (!lastUnSubTypeFontSize) { lastUnSubTypeFontSize = ftsize; } ftsize = lastUnSubTypeFontSize / 2; switch ((_t = sptStyle[tempIdx].textStyle) == null ? void 0 : _t.subtype) { case 1: subScriptOffY = -(lastUnSubTypeFontSize - ftsize); break; case 2: subScriptOffY = -(lastUnSubTypeFontSize - ftsize) / 2; break; } } else if (ftsize < 1) { ftsize = 2 * ratio; } let ftfamily = ((_u = sptStyle[tempIdx].font) == null ? void 0 : _u.family) ? (_v = sptStyle[tempIdx].font) == null ? void 0 : _v.family : fiFamily; font = ftsize + "px " + ftfamily; if (((_x = (_w = sptStyle[tempIdx]) == null ? void 0 : _w.textStyle) == null ? void 0 : _x.bold) == "1") { font = "bold " + font; } if (((_z = (_y = sptStyle[tempIdx]) == null ? void 0 : _y.textStyle) == null ? void 0 : _z.italic) == "1") { font = "italic " + font; } tHollow = ((_B = (_A = sptStyle[tempIdx]) == null ? void 0 : _A.textStyle) == null ? void 0 : _B.hollow) == "1" ? "1" : tHollow; tUnderline = ((_D = (_C = sptStyle[tempIdx]) == null ? void 0 : _C.textStyle) == null ? void 0 : _D.underline) == "1" ? "1" : tUnderline; tDeleteline = ((_F = (_E = sptStyle[tempIdx]) == null ? void 0 : _E.textStyle) == null ? void 0 : _F.deleteline) == "1" ? "1" : tDeleteline; tTopline = ((_H = (_G = sptStyle[tempIdx]) == null ? void 0 : _G.textStyle) == null ? void 0 : _H.topline) == "1" ? "1" : tTopline; tFontColor = ((_J = (_I = sptStyle[tempIdx]) == null ? void 0 : _I.font) == null ? void 0 : _J.color) ? sptStyle[tempIdx].font.color : tFontColor; } if (!((_L = (_K = sptStyle[tempIdx]) == null ? void 0 : _K.textStyle) == null ? void 0 : _L.subtype)) { lastUnSubTypeFontSize = ftsize; } if (!textContainer[tci].tHollow) { textContainer[tci].tHollow = []; textContainer[tci].tUnderline = []; textContainer[tci].tDeleteline = []; textContainer[tci].tTopline = []; textContainer[tci].tFontColor = []; textContainer[tci].font = []; textContainer[tci].subScriptOffY = []; } textContainer[tci].tHollow[tj] = tHollow; textContainer[tci].tUnderline[tj] = tUnderline; textContainer[tci].tDeleteline[tj] = tDeleteline; textContainer[tci].tTopline[tj] = tTopline; textContainer[tci].tFontColor[tj] = tFontColor; textContainer[tci].font[tj] = font; textContainer[tci].subScriptOffY[tj] = subScriptOffY; let ofY = rRect.height - height + subScriptOffY; if (tempIdx >= curSIdx && tempIdx < curEIdx) { ctx.save(); ctx.fillStyle = DDeiUtil$1.getStyleValue("canvas-text-selection", this.ddRender.model); ctx.globalAlpha = 1; ctx.fillRect(usedX - 0.5, y1 + ofY, width + 1, height); ctx.restore(); } else if (tBgColor) { ctx.save(); ctx.fillStyle = DDeiUtil$1.getColor(tBgColor); ctx.fillRect(usedX - 0.5, y1 + ofY, width + 1, height); ctx.restore(); } if (curSIdx == curEIdx && tempIdx == curEIdx) { cursorX = usedX; cursorHeight = tj > 1 ? textContainer[tci].heights[tj - 1] : height; ofY = rRect.height - cursorHeight + (tj > 1 ? textContainer[tci].subScriptOffY[tj - 1] : subScriptOffY); cursorY = y1 + ofY; } ctx.fillStyle = tFontColor; ctx.font = font; lastUsedY = y1 + ofY; lastUsedX = usedX; usedX += width; ctx.restore(); } usedX = x1; for (let tj = 0; tj < textContainer[tci].text.length; tj++) { let outputText = textContainer[tci].text[tj]; let width = textContainer[tci].widths[tj]; let height = textContainer[tci].heights[tj]; ctx.save(); let tHollow = textContainer[tci].tHollow[tj]; let tUnderline = textContainer[tci].tUnderline[tj]; let tDeleteline = textContainer[tci].tDeleteline[tj]; let tTopline = textContainer[tci].tTopline[tj]; let tFontColor = textContainer[tci].tFontColor[tj]; let font = textContainer[tci].font[tj]; let subScriptOffY = textContainer[tci].subScriptOffY[tj]; let dfh = textContainer[tci].dHeights[tj]; let ofY = rRect.height - height + subScriptOffY + dfh; ctx.fillStyle = tFontColor; ctx.font = font; if (tHollow == "1") { ctx.strokeStyle = tFontColor; ctx.strokeText(outputText, usedX, y1 + ofY); } else { ctx.fillText(outputText, usedX, y1 + ofY); } if (curSIdx != -1 && curEIdx != -1) { textContainer[0].textPosCache.push({ x: usedX, y: y1 + ofY }); } if (tUnderline == "1") { ctx.beginPath(); ctx.strokeStyle = tFontColor; ctx.moveTo(usedX, y1 + ofY + height); ctx.lineTo(usedX + width, y1 + ofY + height); ctx.closePath(); ctx.stroke(); } if (tDeleteline == "1") { ctx.beginPath(); ctx.strokeStyle = tFontColor; ctx.moveTo(usedX, y1 + ofY + height / 2); ctx.lineTo(usedX + width, y1 + ofY + height / 2); ctx.closePath(); ctx.stroke(); } if (tTopline == "1") { ctx.beginPath(); ctx.strokeStyle = tFontColor; ctx.moveTo(usedX, y1 + ofY); ctx.lineTo(usedX + width, y1 + ofY); ctx.closePath(); ctx.stroke(); } usedX += width; ctx.restore(); } usedY += rRect.height; } if (this.isEditoring && Date.now() % 1e3 >= 500) { if (cursorX != -Infinity && cursorY != -Infinity && curSIdx == curEIdx) { ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-text-cursor", this.ddRender.model); ctx.lineWidth = 1.5; ctx.beginPath(); ctx.moveTo(cursorX, cursorY - 2); ctx.lineTo(cursorX, cursorY + cursorHeight + 2); ctx.closePath(); ctx.stroke(); } else if (cText == "") { let weight = fontSize * ratio + vspace; if (align == 1) { x2 = 5; } else if (align == 2) { x2 = ratPos.width * 0.5; } else if (align == 3) { x2 = ratPos.width - 5; } x2 = x2 + ratPos.x; if (valign == 1) { y2 = 0; } else if (valign == 2) { y2 = (ratPos.height - weight) * 0.5; } else if (valign == 3) { y2 = ratPos.height; } y2 = y2 + ratPos.y; ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-text-cursor", this.ddRender.model); ctx.lineWidth = 1.5; ctx.beginPath(); ctx.moveTo(x2, y2 - 2); ctx.lineTo(x2, y2 + weight + 2); ctx.closePath(); ctx.stroke(); } else if ((editorText == null ? void 0 : editorText.selectionEnd) == cText.length) { if (!lastHeight) { for (let tci = textContainer.length - 1; tci >= 0; tci--) { if (textContainer[tci].height) { lastHeight = textContainer[tci].height; break; } } } x2 = lastUsedX + lastWidth; if (textContainer[textContainer.length - 1].text == "" || textContainer[textContainer.length - 1].text == "\n") { if (align == 1) { x2 = 5; } else if (align == 2) { x2 = ratPos.width * 0.5; } else if (align == 3) { x2 = ratPos.width - 5; } x2 = x2 + ratPos.x; } ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-text-cursor", this.ddRender.model); ctx.lineWidth = 1.5; ctx.beginPath(); ctx.moveTo(x2, lastUsedY - 2); ctx.lineTo(x2, lastUsedY + lastHeight + 2); ctx.closePath(); ctx.stroke(); } } this.textUsedArea = textContainer; ctx.restore(); } /** * 如果缩放类别为3,则自动计算并将计算的区域缓存到当前对象中,如果不为3则不会进行任何处理 */ calScaleType3Size() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; let scale = this.getCachedValue("textStyle.scale"); let textArea2 = DDeiUtil$1.pointsToZero(this.model.textArea, this.model.cpv, this.model.rotate); let fillRect = DDeiAbstractShape.pvsToOutRect(textArea2); if (scale == 3) { let lockExtWidth = this.getCachedValue("textStyle.lockWidth"); let paddingWeight = this.getCachedValue("textStyle.paddingWeight"); if (!paddingWeight) { paddingWeight = 0; } let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); ctx.save(); ctx.textAlign = "left"; ctx.textBaseline = "top"; let stageRatio2 = this.model.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; let ratPos = DDeiUtil$1.getRatioPosition(fillRect, rat1); let feed = this.getCachedValue("textStyle.feed"); let hspace = this.getCachedValue("textStyle.hspace"); let vspace = this.getCachedValue("textStyle.vspace"); let fiFamily = this.getCachedValue("font.family"); let fiSize = this.getCachedValue("font.size"); let bold = this.getCachedValue("textStyle.bold"); let italic = this.getCachedValue("textStyle.italic"); let textContainer = []; let fontSize = fiSize; let cText = null; let sptStyle = null; if (this.isEditoring) { sptStyle = this.model.sptStyle; cText = this.getCachedValue("text"); } else { cText = DDeiUtil$1.getReplacibleValue(this.model, "text", true, true); sptStyle = this.tempSptStyle ? this.tempSptStyle : this.model.sptStyle; } if (!cText) { cText = ""; } let contentWidth = ratPos.width; let usedWidth = 0; let usedHeight = 0; let textRowContainer = { text: "", widths: [], heights: [], dHeights: [] }; textContainer.push(textRowContainer); let baseFont = fontSize + "px " + fiFamily; if (bold == "1") { baseFont = "bold " + baseFont; } if (italic == "1") { baseFont = "italic " + baseFont; } let rcIndex = 0; let lastUnSubTypeFontSize = 0; for (let ti = 0; ti < cText.length; ti++, rcIndex++) { let te = cText[ti]; let font = null; let fontHeight = null; let isEnter = false; let fontShapeRect = null; if ((feed == 1 || feed == "1") && te == "\n") { isEnter = true; textRowContainer.text += te; textRowContainer.widths[rcIndex] = 0; textRowContainer.heights[rcIndex] = 0; textRowContainer.width = Math.max(0, usedWidth); textRowContainer.height = Math.max(0, textRowContainer.height ? textRowContainer.height : 0, lastUnSubTypeFontSize ? lastUnSubTypeFontSize * ratio + vspace : fontSize * ratio + vspace); } else { if (sptStyle[ti]) { let ftsize = ((_b2 = (_a3 = sptStyle[ti]) == null ? void 0 : _a3.font) == null ? void 0 : _b2.size) ? (_d2 = (_c2 = sptStyle[ti]) == null ? void 0 : _c2.font) == null ? void 0 : _d2.size : fontSize; if ((_e2 = sptStyle[ti].textStyle) == null ? void 0 : _e2.subtype) { if (!lastUnSubTypeFontSize) { lastUnSubTypeFontSize = ftsize; } ftsize = lastUnSubTypeFontSize / 2; } else if (ftsize < 1) { ftsize = 2; } let ftfamily = ((_g = (_f = sptStyle[ti]) == null ? void 0 : _f.font) == null ? void 0 : _g.family) ? (_i = (_h = sptStyle[ti]) == null ? void 0 : _h.font) == null ? void 0 : _i.family : fiFamily; font = ftsize + "px " + ftfamily; if (((_k = (_j = sptStyle[ti]) == null ? void 0 : _j.textStyle) == null ? void 0 : _k.bold) == "1") { font = "bold " + font; } if (((_m = (_l = sptStyle[ti]) == null ? void 0 : _l.textStyle) == null ? void 0 : _m.italic) == "1") { font = "italic " + font; } fontHeight = ftsize; } if (!font) { font = baseFont; fontHeight = fontSize; } if (!((_o = (_n = sptStyle[ti]) == null ? void 0 : _n.textStyle) == null ? void 0 : _o.subtype)) { lastUnSubTypeFontSize = fontHeight; } let rc1 = DDeiUtil$1.measureText(te, font, ctx, fontHeight); fontShapeRect = { width: rc1.width * ratio + hspace, height: rc1.height * ratio, dHeight: rc1.dHeight * ratio }; usedWidth += fontShapeRect.width; textRowContainer.text += te; textRowContainer.widths[rcIndex] = fontShapeRect.width; textRowContainer.heights[rcIndex] = fontShapeRect.height + vspace; textRowContainer.dHeights[rcIndex] = fontShapeRect.dHeight; textRowContainer.width = usedWidth; textRowContainer.height = Math.max(fontShapeRect.height + vspace, textRowContainer.height ? textRowContainer.height : 0, lastUnSubTypeFontSize ? lastUnSubTypeFontSize * ratio + vspace : fontSize * ratio + vspace); } if (feed == 1 || feed == "1") { if (isEnter) { usedWidth = 0; usedHeight += textRowContainer.height; rcIndex = -1; let lastRowHeight = textRowContainer.height; textRowContainer = { text: "", widths: [], heights: [], dHeights: [] }; textRowContainer.width = usedWidth; textRowContainer.height = lastRowHeight; textContainer.push(textRowContainer); } else if ((lockExtWidth == 1 || lockExtWidth == "1") && usedWidth > contentWidth) { textRowContainer.text = textRowContainer.text.substring(0, textRowContainer.text.length - 1); textRowContainer.width -= fontShapeRect.width; textRowContainer.widths.splice(rcIndex, 1); textRowContainer.heights.splice(rcIndex, 1); usedWidth = fontShapeRect.width; usedHeight += textRowContainer.height; rcIndex = 0; textRowContainer = { text: te, widths: [], heights: [], dHeights: [] }; textRowContainer.widths[rcIndex] = fontShapeRect.width; textRowContainer.heights[rcIndex] = fontShapeRect.height + vspace; textRowContainer.dHeights[rcIndex] = fontShapeRect.dHeight; textRowContainer.width = usedWidth; textRowContainer.height = Math.max(fontShapeRect.height + vspace, lastUnSubTypeFontSize * ratio + vspace); textContainer.push(textRowContainer); } } } let textAreaWidth = 0, textAreaHeight = 0; for (let ri = 0; ri < textContainer.length; ri++) { textAreaWidth = Math.max(textAreaWidth, textContainer[ri].width); textAreaHeight += textContainer[ri].height; } let textAreaOutRect = fillRect; let nowOutRect = { width: textAreaWidth / ratio + paddingWeight * 2, height: textAreaHeight / ratio + paddingWeight * 2 }; if (nowOutRect.width > 40 && nowOutRect.height > fontSize) { let scaleX2 = nowOutRect.width / textAreaOutRect.width; let scaleY2 = nowOutRect.height / textAreaOutRect.height; if (lockExtWidth == 1 || lockExtWidth == "1") { scaleX2 = 1; } if (scaleX2.toFixed(4) != "1.0000" || scaleY2.toFixed(4) != "1.0000") { let m12 = new Matrix3(); let moveMatrix2 = new Matrix3( 1, 0, -this.model.cpv.x, 0, 1, -this.model.cpv.y, 0, 0, 1 ); m12.premultiply(moveMatrix2); if (this.model.rotate) { let angle2 = DDeiUtil$1.preciseTimes(this.model.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let scaleMatrix2 = new Matrix3( scaleX2, 0, 0, 0, scaleY2, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); if (this.model.rotate) { let angle2 = DDeiUtil$1.preciseTimes(-this.model.rotate, DDeiConfig$1.ROTATE_UNIT); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } let move1Matrix = new Matrix3( 1, 0, this.model.cpv.x, 0, 1, this.model.cpv.y, 0, 0, 1 ); m12.premultiply(move1Matrix); this.model.transVectors(m12); this.model.updateLinkModels(); fillRect = DDeiAbstractShape.pvsToOutRect(DDeiUtil$1.pointsToZero(this.model.textArea, this.model.cpv, this.model.rotate)); } } this.tempTextContainer = textContainer; ctx.restore(); } this.tempFillRect = fillRect; } // ============================== 事件 =============================== /** * 鼠标按下事件 */ mouseDown(evt) { super.mouseDown(evt); } /** * 绘制图形 */ mouseUp(evt) { super.mouseUp(evt); } /** * 鼠标移动 */ mouseMove(evt) { super.mouseMove(evt); } /** * 鼠标双击 * @param evt */ dblClick(evt) { } }; __publicField2(_DDeiPolygonCanvasRender, "ClsName", "DDeiPolygonCanvasRender"); let DDeiPolygonCanvasRender = _DDeiPolygonCanvasRender; const __vite_glob_1_6$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiPolygonCanvasRender, default: DDeiPolygonCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiPolygonContainerCanvasRender = class _DDeiPolygonContainerCanvasRender2 extends DDeiPolygonCanvasRender { // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiPolygonContainerCanvasRender2(props); } // ============================== 方法 =============================== enableRefreshShape() { var _a3; super.enableRefreshShape(); (_a3 = this.model.models) == null ? void 0 : _a3.forEach((model) => { var _a22; (_a22 = model.render) == null ? void 0 : _a22.enableRefreshShape(); }); } clearCachedValue() { super.clearCachedValue(); this.model.models.forEach((item) => { var _a3; (_a3 = item == null ? void 0 : item.render) == null ? void 0 : _a3.clearCachedValue(); }); } /** * 绘制图形 */ drawShape(tempShape, composeRender = 0, inRect = null, zIndex = 0) { var _a3, _b2, _c2, _d2, _e2; if (!inRect || this.model.isInRect(inRect.x, inRect.y, inRect.x1, inRect.y1)) { let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_BEFORE", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); if (composeRender || rsState == 0 || rsState == 1) { let rsState1 = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", DDeiEnumOperateType.VIEW, { models: [this.model], tempShape, composeRender }, this.ddRender.model, null); if (rsState1 == 0 || rsState1 == 1) { if (!DDeiUtil$1.isModelHidden(this.model) && (this.refreshShape || this.isEditoring)) { this.createTempShape(); let rendList = []; if (((_a3 = this.model.composes) == null ? void 0 : _a3.length) > 0) { rendList = rendList.concat(this.model.composes); } rendList.push(this.model); rendList.sort((a, b) => { if ((a.cIndex || a.cIndex == 0) && (b.cIndex || b.cIndex == 0)) { return a.cIndex - b.cIndex; } else if ((a.cIndex || a.cIndex == 0) && !(b.cIndex || b.cIndex == 0)) { return 1; } else if (!(a.cIndex || a.cIndex == 0) && (b.cIndex || b.cIndex == 0)) { return -1; } else { return 0; } }); for (let ri = 0; ri < rendList.length; ri++) { let c = rendList[ri]; if (c == this.model) { let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); if (!tempShape && this.stageRender.operateState == DDeiEnumOperateState.QUICK_EDITING || this.stageRender.operateState == DDeiEnumOperateState.QUICK_EDITING_TEXT_SELECTING) { if (this.isEditoring) ; else if ((_b2 = this.stage.render) == null ? void 0 : _b2.editorShadowControl) { if (this.model.id + "_shadow" == this.stage.render.editorShadowControl.id) { return; } } } else if (!tempShape && ((_d2 = (_c2 = this.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) == 1 && Array.from((_e2 = this.stage) == null ? void 0 : _e2.selectedModels.values())[0].id == this.model.id) { tempShape = { border: { type: 1, width: 1, color: "#017fff", dash: [10, 5] }, drawCompose: false }; } this.calScaleType3Size(tempShape); ctx.save(); this.calPVSS(tempShape); this.createClip(tempShape); this.drawFill(tempShape); this.drawText(tempShape); this.drawBorder(tempShape); this.drawChildrenShapes(tempShape); ctx.restore(); } else { if (tempShape && (tempShape == null ? void 0 : tempShape.drawCompose) == false) { c.render.drawShape(null, composeRender + 1, null, zIndex + ri); } else { c.render.drawShape(tempShape, composeRender + 1, null, zIndex + ri); } } } if (!this.isEditoring) { this.refreshShape = false; } } this.drawSelfToCanvas(composeRender); } if (!composeRender) { DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_AFTER", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); } } } else { let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", "VIEW-HIDDEN", { models: [this.model] }, this.ddRender.model, null); if (rsState == 0 || rsState == 1) { this.removeViewerCanvas(); } } } /** * 绘制自身到最外层canvas */ drawSelfToCanvas(composeRender) { var _a3, _b2; if (this.tempCanvas) { let model = this.model; let stage2 = model.stage; let ruleWeight = 0; if (stage2.render.tempRuleDisplay == 1 || stage2.render.tempRuleDisplay == "1") { ruleWeight = 15; } let stageRatio2 = this.model.getStageRatio(); if (!this.tempCanvas.parentElement) { let viewerEle = this.model.layer.render.containerViewer; viewerEle.appendChild(this.tempCanvas); } this.tempCanvas.style.zIndex = this.tempZIndex; this.tempCanvas.style.left = this.model.cpv.x * stageRatio2 + this.model.stage.wpv.x - this.tempCanvas.offsetWidth / 2 - ruleWeight + "px"; this.tempCanvas.style.top = this.model.cpv.y * stageRatio2 + this.model.stage.wpv.y - this.tempCanvas.offsetHeight / 2 - ruleWeight + "px"; for (let m = 0; m < ((_a3 = this.model.midList) == null ? void 0 : _a3.length); m++) { let key = this.model.midList[m]; let item = this.model.models.get(key); (_b2 = item.render) == null ? void 0 : _b2.drawSelfToCanvas(composeRender); } } } /** * 绘制子元素 */ drawChildrenShapes(tempShape, inRect = true, hidden = false) { var _a3, _b2; if (((_a3 = this.model.models) == null ? void 0 : _a3.size) > 0) { let canvas = this.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.stage.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; let lineOffset = 0; let areaPVS = this.model.layoutManager.getAreasPVS(); let usedMidIds = []; for (let n = 0; n < areaPVS.length; n++) { let pvs2 = areaPVS[n]; for (let m = 0; m < ((_b2 = this.model.midList) == null ? void 0 : _b2.length); m++) { let key = this.model.midList[m]; let item = this.model.models.get(key); usedMidIds.push(item.id); ctx.save(); ctx.beginPath(); for (let i2 = 0; i2 < pvs2.length; i2++) { if (i2 == pvs2.length - 1) { ctx.lineTo(pvs2[0].x * ratio + lineOffset, pvs2[0].y * ratio + lineOffset); } else if (i2 == 0) { ctx.moveTo(pvs2[i2].x * ratio + lineOffset, pvs2[i2].y * ratio + lineOffset); ctx.lineTo(pvs2[i2 + 1].x * ratio + lineOffset, pvs2[i2 + 1].y * ratio + lineOffset); } else { ctx.lineTo(pvs2[i2 + 1].x * ratio + lineOffset, pvs2[i2 + 1].y * ratio + lineOffset); } } ctx.closePath(); item.render.tempZIndex = this.tempZIndex + (m + 1); item.render.drawShape(tempShape); ctx.restore(); } } } } }; __publicField2(_DDeiPolygonContainerCanvasRender, "ClsName", "DDeiPolygonContainerCanvasRender"); let DDeiPolygonContainerCanvasRender = _DDeiPolygonContainerCanvasRender; const __vite_glob_1_5$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiPolygonContainerCanvasRender, default: DDeiPolygonContainerCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiSelectorCanvasRender = class _DDeiSelectorCanvasRender2 extends DDeiRectangleCanvasRender { constructor(props) { super(props); this.clip = false; } // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiSelectorCanvasRender2(props); } /** * 创建图形 */ drawShape() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); ctx.save(); let models = null; if (((_b2 = (_a3 = this.stage) == null ? void 0 : _a3.selectedModels) == null ? void 0 : _b2.size) > 0) { models = Array.from(this.stage.selectedModels.values()); } if (this.stageRender.operateState == DDeiEnumOperateState.SELECT_WORKING) { (_e2 = (_d2 = (_c2 = this.stage) == null ? void 0 : _c2.layers[this.stage.layerIndex]) == null ? void 0 : _d2.render) == null ? void 0 : _e2.enableRefreshShape(); this.drawBorder(); } else if (this.stageRender.operateState != DDeiEnumOperateState.LINE_POINT_CHANGING) { if ((models == null ? void 0 : models.length) == 1 && ((_f = models[0]) == null ? void 0 : _f.baseModelType) == "DDeiLine") { this.drawLine(); this.drawOperatorShapeLine(); } else { if ((models == null ? void 0 : models.length) == 1 && (models[0].mirrorX || models[0].mirrorY)) { let model = models[0]; let oldRat1 = this.ddRender.ratio * ((_g = this.stage) == null ? void 0 : _g.getStageRatio()); ctx.translate(model.cpv.x * oldRat1, model.cpv.y * oldRat1); if (model.mirrorX) { ctx.scale(-1, 1); } if (model.mirrorY) { ctx.scale(1, -1); } ctx.translate(-model.cpv.x * oldRat1, -model.cpv.y * oldRat1); } if (this.stageRender.operateState == DDeiEnumOperateState.QUICK_EDITING || this.stageRender.operateState == DDeiEnumOperateState.QUICK_EDITING_TEXT_SELECTING) ; else { if (((_i = (_h = this.stage) == null ? void 0 : _h.selectedModels) == null ? void 0 : _i.size) > 1) { this.drawBorder(); } this.drawOperatorShape(); } } this.drawOvsPoints(); } this.drawIncludedStyle(); ctx.restore(); } /** * 绘制特殊操作点 */ drawOvsPoints() { var _a3, _b2, _c2, _d2, _e2, _f; if (this.model.state == DDeiEnumControlState.SELECTED && ((_b2 = (_a3 = this.stage) == null ? void 0 : _a3.selectedModels) == null ? void 0 : _b2.size) == 1) { let model = Array.from((_c2 = this.stage) == null ? void 0 : _c2.selectedModels.values())[0]; let ovs = model.ovs; if ((ovs == null ? void 0 : ovs.length) > 0) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let ratio = this.ddRender.ratio * this.stage.getStageRatio(); let weight = 4; ctx.save(); ctx.fillStyle = "yellow"; ctx.strokeStyle = "black"; let ovsDefine = (_e2 = (_d2 = DDeiUtil$1.getControlDefine(model)) == null ? void 0 : _d2.define) == null ? void 0 : _e2.ovs; for (let i2 = 0; i2 < ovs.length; i2++) { let point2 = ovs[i2]; let pointDefine2 = ovsDefine[i2]; if (((_f = pointDefine2 == null ? void 0 : pointDefine2.constraint) == null ? void 0 : _f.type) && pointDefine2.constraint.type != 5) { ctx.beginPath(); ctx.moveTo((point2.x + weight) * ratio, point2.y * ratio); ctx.lineTo(point2.x * ratio, (point2.y + weight) * ratio); ctx.lineTo((point2.x - weight) * ratio, point2.y * ratio); ctx.lineTo(point2.x * ratio, (point2.y - weight) * ratio); ctx.closePath(); ctx.stroke(); ctx.fill(); } } ctx.restore(); } } } /** * 绘制编辑边框 * @param tempBorder 临时边框,优先级最高 * @param usePV 是否采用向量输出 */ drawEditBorder() { var _a3, _b2; if (((_b2 = (_a3 = this.stageRender.editorShadowControl) == null ? void 0 : _a3.textArea) == null ? void 0 : _b2.length) > 3) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); ctx.save(); let stageRatio2 = this.model.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; let lineOffset = 0; let lineWidth = 1.25 * ratio; ctx.lineWidth = lineWidth; ctx.beginPath(); ctx.setLineDash([10, 10]); ctx.strokeStyle = DDeiUtil$1.getColor("#017fff"); let pvs2 = this.stageRender.editorShadowControl.textArea; if ((pvs2 == null ? void 0 : pvs2.length) > 0) { ctx.moveTo(pvs2[0].x * rat1 + lineOffset, pvs2[0].y * rat1 + lineOffset); ctx.lineTo(pvs2[1].x * rat1 + lineOffset, pvs2[1].y * rat1 + lineOffset); ctx.lineTo(pvs2[2].x * rat1 + lineOffset, pvs2[2].y * rat1 + lineOffset); ctx.lineTo(pvs2[3].x * rat1 + lineOffset, pvs2[3].y * rat1 + lineOffset); } ctx.closePath(); ctx.stroke(); ctx.restore(); } } /** * 线模式下绘制线的效果 */ drawLine() { } /** * 线模式下绘制线的操作图形 */ drawOperatorShapeLine() { var _a3, _b2, _c2, _d2; if (this.model.state != DDeiEnumControlState.SELECTED) { return; } if (((_b2 = (_a3 = this.stage) == null ? void 0 : _a3.selectedModels) == null ? void 0 : _b2.size) > 0) { let lineModel = Array.from((_d2 = (_c2 = this.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.values())[0]; if (lineModel.baseModelType == "DDeiLine") { let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", this.ddRender.model); let accessLink = DDeiUtil$1.isAccess( DDeiEnumOperateType.LINK, [lineModel], null, modeName, this.ddRender.model ); if (accessLink) { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.stage.getStageRatio(); let rat1 = this.ddRender.ratio; let ratio = rat1 * stageRatio2; rat1 = ratio; let pvs2 = lineModel.pvs; let type = DDeiModelArrtibuteValue.getAttrValueByState(lineModel, "type", true); let weight = DDeiModelArrtibuteValue.getAttrValueByState(lineModel, "weight", true); let w10 = 1.3 * weight * ratio; if (w10 > 5 * rat1) { w10 = 5 * rat1; } else if (w10 < 2 * rat1) { w10 = 2 * rat1; } let w15 = 1.5 * w10; let w20 = 2 * w10; let w30 = 2 * w15; ctx.save(); switch (type) { case 1: { this.drawSEPoint(pvs2, w10, w20, ctx, rat1, ratio); break; } case 2: { this.drawSEPoint(pvs2, w10, w20, ctx, rat1, ratio); ctx.strokeStyle = "#017fff"; ctx.fillStyle = "white"; for (let i2 = 1; i2 < pvs2.length; i2++) { if (i2 != pvs2.length - 1) { ctx.save(); let x1 = pvs2[i2].x * rat1; let y1 = pvs2[i2].y * rat1; if (lineModel.rotate) { ctx.translate(x1, y1); ctx.rotate(lineModel.rotate * DDeiConfig$1.ROTATE_UNIT); ctx.translate(-x1, -y1); } ctx.fillRect(x1 - w15, y1 - w15, w30, w30); ctx.strokeRect(x1 - w15, y1 - w15, w30, w30); ctx.restore(); } ctx.save(); let x2 = (pvs2[i2].x + pvs2[i2 - 1].x) / 2 * rat1; let y2 = (pvs2[i2].y + pvs2[i2 - 1].y) / 2 * rat1; ctx.translate(x2, y2); ctx.rotate(((lineModel.rotate ? lineModel.rotate : 0) + 45) * DDeiConfig$1.ROTATE_UNIT); ctx.translate(-x2, -y2); ctx.fillRect(x2 - w10, y2 - w10, w20, w20); ctx.strokeRect(x2 - w10, y2 - w10, w20, w20); ctx.restore(); } break; } case 3: { this.drawSEPoint(pvs2, w10, w20, ctx, rat1, ratio); if (pvs2.length >= 4) { ctx.strokeStyle = "#017fff"; ctx.fillStyle = "white"; for (let i2 = 1; i2 < this.model.opvs.length - 1; i2++) { let pv = this.model.opvs[i2]; ctx.beginPath(); ctx.ellipse(pv.x * rat1, pv.y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.stroke(); } } break; } } ctx.restore(); } } } } /** * 绘制开始和结束操作点 */ drawSEPoint(pvs2, w10, w20, ctx, rat1, ratio) { ctx.strokeStyle = "red"; ctx.lineWidth = ratio; ctx.fillStyle = "white"; ctx.beginPath(); ctx.ellipse(pvs2[0].x * rat1, pvs2[0].y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.beginPath(); ctx.ellipse(pvs2[pvs2.length - 1].x * rat1, pvs2[pvs2.length - 1].y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.fillStyle = "red"; ctx.beginPath(); ctx.ellipse(pvs2[0].x * rat1, pvs2[0].y * rat1, w10, w10, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.beginPath(); ctx.ellipse(pvs2[pvs2.length - 1].x * rat1, pvs2[pvs2.length - 1].y * rat1, w10, w10, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.fill(); ctx.beginPath(); ctx.ellipse(pvs2[0].x * rat1, pvs2[0].y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.stroke(); ctx.beginPath(); ctx.ellipse(pvs2[pvs2.length - 1].x * rat1, pvs2[pvs2.length - 1].y * rat1, w20, w20, 0, 0, DDeiUtil$1.PI2); ctx.closePath(); ctx.stroke(); } /** * 获取边框上的操作图形 * @param tempBorder */ drawOperatorShape(tempBorder) { var _a3, _b2; if (this.model.state != DDeiEnumControlState.SELECTED) { return; } let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; ctx.save(); let width = DDeiConfig$1.SELECTOR.OPERATE_ICON.weight * ratio; let halfWidth = width * 0.5; let selectedModels = (_b2 = this.stage) == null ? void 0 : _b2.selectedModels; if ((selectedModels == null ? void 0 : selectedModels.size) > 0) { let firstModel = Array.from(selectedModels == null ? void 0 : selectedModels.values())[0]; for (let i2 = 1; i2 <= 10; i2++) { let type = null; let color = null; let opacity = null; let bWidth = null; if (i2 <= 2 || i2 >= 9) { type = this.getBorderInfo(tempBorder, 1, "type"); color = this.getBorderInfo(tempBorder, 1, "color"); opacity = this.getBorderInfo(tempBorder, 1, "opacity"); bWidth = this.getBorderInfo(tempBorder, 1, "width"); } else if (i2 <= 4) { type = this.getBorderInfo(tempBorder, 2, "type"); color = this.getBorderInfo(tempBorder, 2, "color"); opacity = this.getBorderInfo(tempBorder, 2, "opacity"); bWidth = this.getBorderInfo(tempBorder, 2, "width"); } else if (i2 <= 6) { type = this.getBorderInfo(tempBorder, 3, "type"); color = this.getBorderInfo(tempBorder, 3, "color"); opacity = this.getBorderInfo(tempBorder, 3, "opacity"); bWidth = this.getBorderInfo(tempBorder, 3, "width"); } else if (i2 <= 8) { type = this.getBorderInfo(tempBorder, 4, "type"); color = this.getBorderInfo(tempBorder, 4, "color"); opacity = this.getBorderInfo(tempBorder, 4, "opacity"); bWidth = this.getBorderInfo(tempBorder, 4, "width"); } if (!(type == 0 || type == "0") && color && (!opacity || opacity > 0) && bWidth > 0) { let lineOffset = 0; ctx.lineWidth = bWidth * ratio; ctx.beginPath(); if (opacity != null && opacity != void 0) { ctx.globalAlpha = opacity; } ctx.strokeStyle = DDeiUtil$1.getColor(color); let defaultFillColor = DDeiUtil$1.getColor(DDeiConfig$1.SELECTOR.OPERATE_ICON.FILL.default); ctx.fillStyle = defaultFillColor; if (this.model.passIndex == i2) { ctx.fillStyle = DDeiUtil$1.getColor(DDeiConfig$1.SELECTOR.OPERATE_ICON.FILL.pass); } let opvs = this.model.opvs; if ((opvs == null ? void 0 : opvs.length) > 0) { if (i2 >= 1 && i2 <= 8) { if (opvs[i2]) { ctx.ellipse(opvs[i2].x * ratio + lineOffset, opvs[i2].y * ratio + lineOffset, halfWidth, halfWidth, 0, 0, Math.PI * 2); ctx.fill(); ctx.stroke(); } } else if (i2 == 9) { if (opvs[9]) { if (this.model.passIndex == i2) { ctx.ellipse(opvs[9].x * ratio + lineOffset, opvs[9].y * ratio + lineOffset, halfWidth, halfWidth, 0, 0, Math.PI * 2); ctx.fill(); } else { ctx.arc(opvs[9].x * ratio + lineOffset, opvs[9].y * ratio + lineOffset, halfWidth, 50, Math.PI * 1.6); ctx.stroke(); } } } else if (i2 == 10 && selectedModels.size == 1 && firstModel.baseModelType == "DDeiTable") { ctx.fillStyle = DDeiUtil$1.getColor(color); ctx.ellipse(opvs[10].x * ratio + lineOffset, opvs[10].y * ratio + lineOffset, halfWidth, halfWidth, 0, 0, Math.PI * 2); ctx.fill(); } } } } } ctx.restore(); } /** * 获取边框信息 * @param tempBorder */ getBorderInfo(tempBorder, direct, path) { let borderInfo = null; if (tempBorder) { try { let returnJSON = DDeiUtil$1.getDataByPath(tempBorder, path.split(".")); borderInfo = returnJSON.data; } catch (e) { } } else { borderInfo = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "border." + path, true); } return borderInfo; } /** * 计算除边框外的填充区域,用于填充颜色和字体 */ getFillArea() { let disabled = this.getBorderInfo(null, 1, "disabled"); let color = this.getBorderInfo(null, 1, "color"); let opacity = this.getBorderInfo(null, 1, "opacity"); let width = this.getBorderInfo(null, 1, "width"); if (!(!disabled && color && (!opacity || opacity > 0) && width > 0)) { width = 0; } let absBounds = this.model.getAbsBounds(); let fillAreaE = { x: absBounds.x - width, y: absBounds.y - width, width: absBounds.width + 2 * width, height: absBounds.height + 2 * width }; return fillAreaE; } /** * 绘制选中图形特效 */ drawIncludedStyle() { var _a3, _b2; let includedModels = null; let selectNumber = 0; if (this.model.state == DDeiEnumControlState.DEFAULT) { includedModels = this.model.getIncludedModels(); } else if (this.model.state == DDeiEnumControlState.SELECTED) { includedModels = (_a3 = this.stage) == null ? void 0 : _a3.selectedModels; selectNumber = 1; } (_b2 = this.upIncludeModels) == null ? void 0 : _b2.forEach((im) => { var _a22; (_a22 = im == null ? void 0 : im.render) == null ? void 0 : _a22.enableRefreshShape(); }); if (includedModels && includedModels.size > selectNumber) { includedModels.forEach((model, key) => { let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); ctx.save(); model.render.enableRefreshShape(); if (model.baseModelType == "DDeiLine") { model.render.drawShape({ color: "red", dash: [] }, 0, null, 99999); } else { model.render.drawShape({ type: 1, width: 1, color: "red", border: { type: 1, dash: [], width: 1, color: "red" } }, 0, null, 99999); } ctx.restore(); }); } this.upIncludeModels = includedModels; } /** * 鼠标移动事件,经由上层容器分发 */ mouseMove(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da; let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); ex = ex / stageRatio2; ey = ey / stageRatio2; let models = null; if (((_c2 = (_b2 = this.stage) == null ? void 0 : _b2.selectedModels) == null ? void 0 : _c2.size) > 0) { models = Array.from(this.stage.selectedModels.values()); } let isOvPoint = false; if ((models == null ? void 0 : models.length) == 1 && ((_d2 = models[0]) == null ? void 0 : _d2.ovs.length) > 0) { let ovPoint = models[0].getOvPointByPos(ex, ey); if (ovPoint) { let ovsDefine = (_f = (_e2 = DDeiUtil$1.getControlDefine(models[0])) == null ? void 0 : _e2.define) == null ? void 0 : _f.ovs; let ovd = ovsDefine[models[0].ovs.indexOf(ovPoint)]; if (((_g = ovd == null ? void 0 : ovd.constraint) == null ? void 0 : _g.type) && ovd.constraint.type != 5) { isOvPoint = true; (_j = (_i = (_h = this.stage) == null ? void 0 : _h.ddInstance) == null ? void 0 : _i.bus) == null ? void 0 : _j.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "pointer" }, evt); } } } if (!isOvPoint) { if ((models == null ? void 0 : models.length) == 1 && ((_k = models[0]) == null ? void 0 : _k.baseModelType) == "DDeiLine") { let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", this.ddRender.model); let accessLink = DDeiUtil$1.isAccess( DDeiEnumOperateType.LINK, [models[0]], null, modeName, this.ddRender.model ); if (accessLink) { let tpdata = this.model.isOpvOnLine(ex, ey); if (tpdata) { let direct = null; if (tpdata.type == 3) { let beforeP = this.model.opvs[tpdata.index - 1]; let afterP = this.model.opvs[tpdata.index + 1]; if (Math.abs(beforeP.x - afterP.x) <= 1) { direct = 2; } else { direct = 1; } } (_n = (_m = (_l = this.stage) == null ? void 0 : _l.ddInstance) == null ? void 0 : _m.bus) == null ? void 0 : _n.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { type: "line", passIndex: tpdata.type, direct, opvsIndex: tpdata.index }, evt); } } else { (_q = (_p = (_o = this.stage) == null ? void 0 : _o.ddInstance) == null ? void 0 : _p.bus) == null ? void 0 : _q.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { type: "line", passIndex: -1, opvsIndex: -1 }, evt); } } else { if (this.model.isOpvOn(1, ex, ey)) { (_t = (_s = (_r = this.stage) == null ? void 0 : _r.ddInstance) == null ? void 0 : _s.bus) == null ? void 0 : _t.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 1, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(2, ex, ey)) { (_w = (_v = (_u = this.stage) == null ? void 0 : _u.ddInstance) == null ? void 0 : _v.bus) == null ? void 0 : _w.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 2, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(3, ex, ey)) { (_z = (_y = (_x = this.stage) == null ? void 0 : _x.ddInstance) == null ? void 0 : _y.bus) == null ? void 0 : _z.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 3, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(4, ex, ey)) { (_C = (_B = (_A = this.stage) == null ? void 0 : _A.ddInstance) == null ? void 0 : _B.bus) == null ? void 0 : _C.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 4, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(5, ex, ey)) { (_F = (_E = (_D = this.stage) == null ? void 0 : _D.ddInstance) == null ? void 0 : _E.bus) == null ? void 0 : _F.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 5, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(6, ex, ey)) { (_I = (_H = (_G = this.stage) == null ? void 0 : _G.ddInstance) == null ? void 0 : _H.bus) == null ? void 0 : _I.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 6, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(7, ex, ey)) { (_L = (_K = (_J = this.stage) == null ? void 0 : _J.ddInstance) == null ? void 0 : _K.bus) == null ? void 0 : _L.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 7, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(8, ex, ey)) { (_O = (_N = (_M = this.stage) == null ? void 0 : _M.ddInstance) == null ? void 0 : _N.bus) == null ? void 0 : _O.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 8, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(9, ex, ey)) { (_R = (_Q = (_P = this.stage) == null ? void 0 : _P.ddInstance) == null ? void 0 : _Q.bus) == null ? void 0 : _R.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 9, opvsIndex: -1 }, evt); } else if (this.model.isOpvOn(10, ex, ey)) { (_U = (_T = (_S = this.stage) == null ? void 0 : _S.ddInstance) == null ? void 0 : _T.bus) == null ? void 0 : _U.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 13, opvsIndex: -1 }, evt); } else { let models2 = (_W = this.stage) == null ? void 0 : _W.layers[(_V = this.stage) == null ? void 0 : _V.layerIndex].findModelsByArea(ex, ey); if (models2 && models2.length > 0) { (_Z = (_Y = (_X = this.stage) == null ? void 0 : _X.ddInstance) == null ? void 0 : _Y.bus) == null ? void 0 : _Z.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 10, opvsIndex: -1 }, evt); } else { (_aa = (_$ = (__ = this.stage) == null ? void 0 : __.ddInstance) == null ? void 0 : _$.bus) == null ? void 0 : _aa.push(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: -1, opvsIndex: -1 }, evt); } } } } (_da = (_ca = (_ba = this.stage) == null ? void 0 : _ba.ddInstance) == null ? void 0 : _ca.bus) == null ? void 0 : _da.push(DDeiEnumBusCommandType.RefreshShape); } /** * 鼠标按下事件,经由上层容器分发 */ mouseDown(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z; let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= this.stage.wpv.x; ey -= this.stage.wpv.y; let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); ex = ex / stageRatio2; ey = ey / stageRatio2; if (this.model.passType == "line") { let lineModel = null; if (((_c2 = (_b2 = this.stage) == null ? void 0 : _b2.selectedModels) == null ? void 0 : _c2.size) > 0) { let layer2 = this.stage.layers[(_d2 = this.stage) == null ? void 0 : _d2.layerIndex]; lineModel = Array.from(this.stage.selectedModels.values())[0]; let modeName = DDeiUtil$1.getConfigValue("MODE_NAME", this.ddRender.model); let accessLink = DDeiUtil$1.isAccess( DDeiEnumOperateType.LINK, [lineModel], null, modeName, this.ddRender.model ); if (accessLink) { let dragPoint = this.model.opvs[this.model.opvsIndex]; let lineShadow = DDeiUtil$1.getShadowControl(lineModel); layer2.shadowControls.push(lineShadow); this.stageRender.currentOperateShape = lineShadow; this.stageRender.currentOperateShape.dragPoint = dragPoint; let dragObj = { x: ex, y: ey, dragPoint, model: lineShadow, opvsIndex: this.model.opvsIndex, passIndex: this.model.passIndex, opvs: this.model.opvs }; let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_LINE_DRAG_BEFORE", DDeiEnumOperateType.DRAG, dragObj, (_e2 = this.stage) == null ? void 0 : _e2.ddInstance, evt); if (rsState == 0 || rsState == 1) { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", DDeiEnumOperateType.LINK, null, (_f = this.stage) == null ? void 0 : _f.ddInstance, evt); (_i = (_h = (_g = this.stage) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.bus) == null ? void 0 : _i.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj }, evt); (_l = (_k = (_j = this.stage) == null ? void 0 : _j.ddInstance) == null ? void 0 : _k.bus) == null ? void 0 : _l.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "grabbing" }, evt); this.stageRender.operateState = DDeiEnumOperateState.LINE_POINT_CHANGING; } } } } else { if (this.model.passIndex >= 1 && this.model.passIndex <= 8) { let dragObj = { x: ex, y: ey, originData: { x: this.model.x, y: this.model.y, width: this.model.width, height: this.model.height } }; let pContainerModel = this.stage.render.currentOperateContainer; if (!pContainerModel) { pContainerModel = this.stage.layers[this.stage.layerIndex]; } let selectedModels = pContainerModel.getSelectedModels(); let layer2 = this.stage.layers[this.stage.layerIndex]; selectedModels.forEach((m) => { let md = DDeiUtil$1.getShadowControl(m); layer2.shadowControls.push(md); }); (_o = (_n = (_m = this.stage) == null ? void 0 : _m.ddInstance) == null ? void 0 : _n.bus) == null ? void 0 : _o.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj }, evt); this.stageRender.operateState = DDeiEnumOperateState.CONTROL_CHANGING_BOUND; } else if (this.model.passIndex == 9) { let pContainerModel = this.stageRender.currentOperateContainer; if (!pContainerModel) { pContainerModel = this.layer; } let selectedModels = pContainerModel.getSelectedModels(); if (selectedModels) { if (selectedModels.set) { selectedModels = Array.from(selectedModels.values()); } let stop = false; for (let i2 = 0; i2 < selectedModels.length; i2++) { let parentContainer = selectedModels[i2].pModel; if (parentContainer == null ? void 0 : parentContainer.layoutManager) { if (!parentContainer.layoutManager.canChangeRotate()) { stop = true; break; } } } if (!stop) { let dragObj = { x: ex, y: ey, cx: this.model.cpv.x, cy: this.model.cpv.y, models: selectedModels, container: pContainerModel }; let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_ROTATE_BEFORE", DDeiEnumOperateType.ROTATE, { models: dragObj.models }, this.stage.ddInstance, evt); if (rsState == 0 || rsState == 1) { (_r = (_q = (_p = this.stage) == null ? void 0 : _p.ddInstance) == null ? void 0 : _q.bus) == null ? void 0 : _r.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj }, evt); this.stageRender.operateState = DDeiEnumOperateState.CONTROL_ROTATE; } } } } else if (this.model.passIndex == 13) { let selectedModels = (_s = this.stage) == null ? void 0 : _s.selectedModels; this.stageRender.operateState = DDeiEnumOperateState.CONTROL_DRAGING; let layer2 = Array.from(selectedModels == null ? void 0 : selectedModels.values())[0].layer; layer2.opPoints = []; if ((_t = layer2.opLine) == null ? void 0 : _t.render) { layer2.opLine.render.enableRefreshShape(); } delete layer2.opLine; let centerPointVector = this.model.cpv; let dragObj = { x: ex, y: ey, dx: centerPointVector.x - ex, //鼠标在控件中心坐标的增量位置 dy: centerPointVector.y - ey }; selectedModels.forEach((m) => { let md = DDeiUtil$1.getShadowControl(m); layer2.shadowControls.push(md); if (!this.stageRender.currentOperateShape) { this.stageRender.currentOperateShape = md; } }); (_w = (_v = (_u = this.stage) == null ? void 0 : _u.ddInstance) == null ? void 0 : _v.bus) == null ? void 0 : _w.push(DDeiEnumBusCommandType.ModelChangeSelect, [{ id: this.stageRender.currentOperateShape.id, value: DDeiEnumControlState.SELECTED }], evt); (_z = (_y = (_x = this.stage) == null ? void 0 : _x.ddInstance) == null ? void 0 : _y.bus) == null ? void 0 : _z.push(DDeiEnumBusCommandType.UpdateDragObj, { dragObj }, evt); } if (this.model.passIndex != -1) ; } } /** * 计算移动后的坐标 * @param x * @param y * @param er 是否等比 */ getMovedBounds(x2, y2, er = false) { var _a3, _b2, _c2, _d2, _e2, _f, _g; let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); let returnBounds = { x: this.model.x * stageRatio2, y: this.model.y * stageRatio2, width: this.model.width * stageRatio2, height: this.model.height * stageRatio2 }; let centerPointVector = this.model.cpv; if (this.model.rotate) { let tempPV = new Vector3(x2, y2, 1); let move1Matrix = new Matrix3( 1, 0, -centerPointVector.x, 0, 1, -centerPointVector.y, 0, 0, 1 ); let angle2 = (this.model.rotate * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); let move2Matrix = new Matrix3( 1, 0, centerPointVector.x, 0, 1, centerPointVector.y, 0, 0, 1 ); let m12 = new Matrix3().premultiply(move1Matrix).premultiply(rotateMatrix).premultiply(move2Matrix); tempPV.applyMatrix3(m12); x2 = tempPV.x; y2 = tempPV.y; } let wbh = returnBounds.width / returnBounds.height; let stage2 = this.model.stage; let hAds = ((_b2 = stage2.render.helpLines) == null ? void 0 : _b2.hAds) || ((_c2 = stage2.render.helpLines) == null ? void 0 : _c2.hAds) == 0 ? (_d2 = stage2.render.helpLines) == null ? void 0 : _d2.hAds : Infinity; let vAds = ((_e2 = stage2.render.helpLines) == null ? void 0 : _e2.vAds) || ((_f = stage2.render.helpLines) == null ? void 0 : _f.vAds) == 0 ? (_g = stage2.render.helpLines) == null ? void 0 : _g.vAds : Infinity; let hAdsValue = Infinity; let vAdsValue = Infinity; if (hAds != Infinity) { if (stage2.render.isHAds && Math.abs(stage2.render.hAdsY - y2) > stage2.ddInstance.GLOBAL_ADV_WEIGHT) { stage2.render.isHAds = false; stage2.render.hAdsY = Infinity; } else if (stage2.render.isHAds) { hAdsValue = 0; } else { stage2.render.isHAds = true; hAdsValue = -hAds; stage2.render.hAdsY = y2; } } if (vAds != Infinity) { if (stage2.render.isVAds && Math.abs(stage2.render.vAdsX - x2) > stage2.ddInstance.GLOBAL_ADV_WEIGHT) { stage2.render.isVAds = false; stage2.render.vAdsX = Infinity; } else if (stage2.render.isVAds) { vAdsValue = 0; } else { stage2.render.isVAds = true; vAdsValue = -vAds; stage2.render.vAdsX = x2; } } switch (this.model.passIndex) { case 1: { let dy = y2 - (centerPointVector.y - returnBounds.height / 2); if (hAdsValue != Infinity) { dy = hAdsValue; } returnBounds.y = returnBounds.y + dy; returnBounds.height = returnBounds.height - dy; if (er) { returnBounds.x = returnBounds.x + dy * wbh / 2; returnBounds.width = returnBounds.width - dy * wbh; } break; } case 2: { let dy = y2 - (centerPointVector.y - returnBounds.height / 2); let dx = x2 - centerPointVector.x - returnBounds.width / 2; if (hAdsValue != Infinity) { dy = hAdsValue; } if (vAdsValue != Infinity) { dx = vAdsValue; } returnBounds.y = returnBounds.y + dy; returnBounds.height = returnBounds.height - dy; returnBounds.width = returnBounds.width + dx; if (er) { returnBounds.x = returnBounds.x + dy * wbh / 2; returnBounds.width = returnBounds.width - dy * wbh; returnBounds.y = returnBounds.y - dx / wbh / 2; returnBounds.height = returnBounds.height + dx / wbh; } break; } case 3: { let dx = x2 - centerPointVector.x - returnBounds.width / 2; if (vAdsValue != Infinity) { dx = vAdsValue; } returnBounds.width = returnBounds.width + dx; if (er) { returnBounds.y = returnBounds.y - dx / wbh / 2; returnBounds.height = returnBounds.height + dx / wbh; } break; } case 4: { let dx = x2 - centerPointVector.x - returnBounds.width / 2; let dy = y2 - centerPointVector.y - returnBounds.height / 2; if (hAdsValue != Infinity) { dy = hAdsValue; } if (vAdsValue != Infinity) { dx = vAdsValue; } returnBounds.width = returnBounds.width + dx; returnBounds.height = returnBounds.height + dy; if (er) { returnBounds.y = returnBounds.y - dx / wbh / 2; returnBounds.height = returnBounds.height + dx / wbh; returnBounds.x = returnBounds.x - dy * wbh / 2; returnBounds.width = returnBounds.width + dy * wbh; } break; } case 5: { let dy = y2 - centerPointVector.y - returnBounds.height / 2; if (hAdsValue != Infinity) { dy = hAdsValue; } returnBounds.height = returnBounds.height + dy; if (er) { returnBounds.x = returnBounds.x - dy * wbh / 2; returnBounds.width = returnBounds.width + dy * wbh; } break; } case 6: { let dy = y2 - centerPointVector.y - returnBounds.height / 2; let dx = -(centerPointVector.x - x2 - returnBounds.width / 2); if (hAdsValue != Infinity) { dy = hAdsValue; } if (vAdsValue != Infinity) { dx = vAdsValue; } returnBounds.x = returnBounds.x + dx; returnBounds.width = returnBounds.width - dx; returnBounds.height = returnBounds.height + dy; if (er) { returnBounds.x = returnBounds.x - dy * wbh / 2; returnBounds.width = returnBounds.width + dy * wbh; returnBounds.y = returnBounds.y + dx / wbh / 2; returnBounds.height = returnBounds.height - dx / wbh; } break; } case 7: { let dx = -(centerPointVector.x - x2 - returnBounds.width / 2); if (vAdsValue != Infinity) { dx = vAdsValue; } returnBounds.x = returnBounds.x + dx; returnBounds.width = returnBounds.width - dx; if (er) { returnBounds.y = returnBounds.y + dx / wbh / 2; returnBounds.height = returnBounds.height - dx / wbh; } break; } case 8: { let dy = y2 - (centerPointVector.y - returnBounds.height / 2); let dx = -(centerPointVector.x - x2 - returnBounds.width / 2); if (hAdsValue != Infinity) { dy = hAdsValue; } if (vAdsValue != Infinity) { dx = vAdsValue; } returnBounds.x = returnBounds.x + dx; returnBounds.width = returnBounds.width - dx; returnBounds.y = returnBounds.y + dy; returnBounds.height = returnBounds.height - dy; if (er) { returnBounds.y = returnBounds.y + dx / wbh / 2; returnBounds.height = returnBounds.height - dx / wbh; returnBounds.x = returnBounds.x + dy * wbh / 2; returnBounds.width = returnBounds.width - dy * wbh; } break; } } return returnBounds; } }; __publicField2(_DDeiSelectorCanvasRender, "ClsName", "DDeiSelectorCanvasRender"); let DDeiSelectorCanvasRender = _DDeiSelectorCanvasRender; const __vite_glob_1_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiSelectorCanvasRender, default: DDeiSelectorCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiStageCanvasRender = class _DDeiStageCanvasRender2 { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "model"); __publicField2(this, "ddRender"); __publicField2(this, "currentOperateShape", null); __publicField2(this, "operateState", DDeiEnumOperateState.NONE); __publicField2(this, "selector"); __publicField2(this, "editorShadowControl", null); __publicField2(this, "refresh", true); __publicField2(this, "hScroll", null); __publicField2(this, "vScroll", null); __publicField2(this, "renderCacheData", /* @__PURE__ */ new Map()); this.model = props.model; this.ddRender = null; } // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiStageCanvasRender2(props); } // ============================== 方法 =============================== /** * 初始化 */ init() { this.ddRender = this.model.ddInstance.render; this.initSelector(); } /** * 创建图形 */ drawShape() { var _a3, _b2, _c2, _d2; let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_BEFORE", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); if (rsState == 0 || rsState == 1) { let rsState1 = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); let canvas = this.ddRender.getCanvas(); let rat1 = this.ddRender.ratio; if (rsState1 == 0 || rsState1 == 1) { this.clearStage(); if (this.model.disabled || !this.model.width || !this.model.height) { return; } let ruleDisplay; let ruleInit; if (((_a3 = this.model.ruler) == null ? void 0 : _a3.display) || ((_b2 = this.model.ruler) == null ? void 0 : _b2.display) == 0 || ((_c2 = this.model.ruler) == null ? void 0 : _c2.display) == false) { ruleDisplay = this.model.ruler.display; } else if (this.model.ddInstance.ruler != null && this.model.ddInstance.ruler != void 0) { if (typeof this.model.ddInstance.ruler == "boolean") { ruleDisplay = this.model.ddInstance.ruler ? 1 : 0; } else { ruleInit = this.model.ddInstance.ruler; ruleDisplay = ruleInit.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "ruler.display", true); } this.tempRuleDisplay = ruleDisplay; this.drawPaper(); this.calScroll(); let ctx = canvas.getContext("2d"); ctx.save(); ctx.translate(this.model.wpv.x * rat1, this.model.wpv.y * rat1); let topDisplayIndex = -1; let initI = this.model.layers.length - 1; for (let i2 = initI; i2 >= 0; i2--) { if (this.model.layers[i2].tempDisplay) { topDisplayIndex = i2; } else if (this.model.layers[i2].display == 1) { this.model.layers[i2].render.tempZIndex = initI - i2 + 1; this.model.layers[i2].render.drawShape(); } else if (this.model.layers[i2].display == 0) { this.model.layers[i2].render.drawShape(); } } if (topDisplayIndex != -1) { this.model.layers[topDisplayIndex].render.tempZIndex = initI + 2; this.model.layers[topDisplayIndex].render.drawShape(); } this.drawGrid(topDisplayIndex == -1 ? 0 : topDisplayIndex); this.drawEditorShadowControl(); if (this.selector) { this.selector.render.drawShape(); } ctx.restore(); this.drawMark(); this.drawRuler(); this.drawHelpLines(); this.drawScroll(); this.helpLines = null; } DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_VIEW_AFTER", DDeiEnumOperateType.VIEW, { models: [this.model] }, this.ddRender.model, null); let viewerEles = (_d2 = canvas.parentElement) == null ? void 0 : _d2.getElementsByClassName("ddei-editor-canvasview-contentlayer"); if (viewerEles) { let ruleWeight = 0; if (this.tempRuleDisplay == 1 || this.tempRuleDisplay == "1") { ruleWeight = 15; } let hScrollWeight = 0, vScrollWeight = 0; if (this.vScroll) { vScrollWeight = 15; } if (this.hScroll) { hScrollWeight = 15; } for (let ei = 0; ei < viewerEles.length; ei++) { let viewerEle = viewerEles[ei]; viewerEle.style.marginLeft = ruleWeight + "px"; viewerEle.style.marginTop = ruleWeight + "px"; viewerEle.style.width = canvas.offsetWidth / rat1 - ruleWeight - vScrollWeight + "px"; viewerEle.style.height = canvas.offsetHeight / rat1 - ruleWeight - hScrollWeight + "px"; } delete this.tempRuleDisplay; } } } /** * 显示辅助对齐线以及文本 */ drawHelpLines() { var _a3, _b2, _c2; if (this.helpLines) { let ruleInit; if (((_a3 = this.model.ruler) == null ? void 0 : _a3.display) || ((_b2 = this.model.ruler) == null ? void 0 : _b2.display) == 0 || ((_c2 = this.model.ruler) == null ? void 0 : _c2.display) == false) ; else if (this.model.ddInstance.ruler != null && this.model.ddInstance.ruler != void 0) { if (typeof this.model.ddInstance.ruler == "boolean") ; else { ruleInit = this.model.ddInstance.ruler; } } else ; let hpoint = this.helpLines.hpoint; let vpoint = this.helpLines.vpoint; let rect = this.helpLines.rect; let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.ratio; let stageRatio2 = this.model.getStageRatio(); let ratio = rat1 * stageRatio2; ctx.save(); ctx.translate((this.model.wpv.x + 1) * rat1, (this.model.wpv.y + 1) * rat1); if (rect) { ctx.save(); ctx.textAlign = "left"; ctx.textBaseline = "top"; let fontSize = 12; let font = "bold " + fontSize * rat1 + "px Microsoft YaHei"; ctx.font = font; let xText = 0; let yText = 0; if (this.operateState == DDeiEnumOperateState.CONTROL_DRAGING || this.operateState == DDeiEnumOperateState.CONTROL_CREATING) { xText = rect.x.toFixed(0); yText = rect.y.toFixed(0); } else if (this.operateState == DDeiEnumOperateState.CONTROL_CHANGING_BOUND) { xText = rect.width.toFixed(0); yText = rect.height.toFixed(0); } else if (this.operateState == DDeiEnumOperateState.CONTROL_ROTATE) { xText = rect.rotate.toFixed(0); } if ((this.tempRuleDisplay == 1 || this.tempRuleDisplay == "1") && this.operateState != DDeiEnumOperateState.CONTROL_ROTATE) { let stageRatio22 = this.model.getStageRatio(); let xDPI = this.ddRender.model.dpi.x; let unit = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "ruler.unit", true, ruleInit); let rulerConfig = DDeiConfig$1.RULER[unit]; let unitWeight = DDeiUtil$1.unitToPix(rulerConfig.size, unit, xDPI) * rat1; let marginWeight = unitWeight * stageRatio22; if (this.operateState == DDeiEnumOperateState.CONTROL_DRAGING || this.operateState == DDeiEnumOperateState.CONTROL_CREATING) { let startBaseX = this.model.spv.x * rat1; let startBaseY = this.model.spv.y * rat1; xText = (rect.x * rat1 - startBaseX) / marginWeight * rulerConfig.size; yText = (rect.y * rat1 - startBaseY) / marginWeight * rulerConfig.size; } else if (this.operateState == DDeiEnumOperateState.CONTROL_CHANGING_BOUND) { xText = rect.width * rat1 / marginWeight * rulerConfig.size; yText = rect.height * rat1 / marginWeight * rulerConfig.size; } if (xText) { if (("" + xText).indexOf(".") != -1) { xText = xText.toFixed(1); } xText += rulerConfig.title; } if (yText) { if (("" + yText).indexOf(".") != -1) { yText = yText.toFixed(1); } yText += rulerConfig.title; } } let text2 = ""; if (xText || yText) { if (this.operateState == DDeiEnumOperateState.CONTROL_DRAGING || this.operateState == DDeiEnumOperateState.CONTROL_CREATING) { text2 = xText + " , " + yText; } else if (this.operateState == DDeiEnumOperateState.CONTROL_CHANGING_BOUND) { text2 = xText + " x " + yText; } else if (this.operateState == DDeiEnumOperateState.CONTROL_ROTATE) { text2 = xText + "°"; } } let textRect = DDeiUtil$1.measureText(text2, font, ctx, fontSize * rat1); let width = textRect.width / rat1 + 10; let height = fontSize + 4; let x2, y2; if (this.operateState == DDeiEnumOperateState.CONTROL_DRAGING || this.operateState == DDeiEnumOperateState.CONTROL_CREATING) { x2 = (rect.x * stageRatio2 - width / 2) * rat1; y2 = (rect.y * stageRatio2 - height - 5) * rat1; } else if (this.operateState == DDeiEnumOperateState.CONTROL_CHANGING_BOUND) { x2 = (rect.x * stageRatio2 + (rect.width - width) / 2) * rat1; y2 = (rect.y * stageRatio2 + rect.height + height / 2) * rat1; } else if (this.operateState == DDeiEnumOperateState.CONTROL_ROTATE) { x2 = rect.x * ratio; y2 = rect.y * ratio; } width *= rat1; height *= rat1; DDeiUtil$1.drawRectRound(ctx, x2, y2, width, height, 5, false, "", true, "#1F72FF"); ctx.fillStyle = "white"; ctx.fillText(text2, x2 + (width - textRect.width) / 2, y2 + (height - fontSize * rat1) / 2); if (this.tempRuleDisplay == 1 || this.tempRuleDisplay == "1") { ctx.strokeStyle = "red"; let weight = 16 * rat1; ctx.lineWidth = 1.5 * rat1; ctx.globalAlpha = 0.5; let x1 = (rect.x * stageRatio2 + this.model.wpv.x) * rat1; let y1 = (rect.y * stageRatio2 + this.model.wpv.y) * rat1; ctx.translate(-this.model.wpv.x * rat1, -this.model.wpv.y * rat1); ctx.beginPath(); ctx.moveTo(x1, 0); ctx.lineTo(x1, weight); ctx.closePath(); ctx.stroke(); ctx.beginPath(); ctx.moveTo(0, y1); ctx.lineTo(weight, y1); ctx.closePath(); ctx.stroke(); } ctx.restore(); } if (this.ddRender.model.GLOBAL_HELP_LINE_ENABLE) { let lineOffset = 0; ctx.lineWidth = 1 * ratio; ctx.setLineDash([0, 1 * ratio, 1 * ratio]); ctx.strokeStyle = DDeiUtil$1.getStyleValue("dot", this.ddRender.model); if (hpoint) { for (let y2 in hpoint) { ctx.beginPath(); ctx.moveTo(hpoint[y2].sx * ratio - 100, y2 * ratio + lineOffset); ctx.lineTo(hpoint[y2].ex * ratio + 100, y2 * ratio + lineOffset); ctx.stroke(); } } if (vpoint) { for (let x2 in vpoint) { ctx.beginPath(); ctx.moveTo(x2 * ratio + lineOffset, vpoint[x2].sy * ratio - 100); ctx.lineTo(x2 * ratio + lineOffset, vpoint[x2].ey * ratio + 100); ctx.stroke(); } } } ctx.beginPath(); ctx.restore(); } } /** * 绘制编辑时的影子元素 */ drawEditorShadowControl() { if (this.editorShadowControl) { let item = this.editorShadowControl; item.render.drawShape(null, 0, null, 99999); } } /** * 清空画布 */ clearStage() { let canvas = this.ddRender.getCanvas(); canvas.width = canvas.width; } /** * 绘制纸张 */ drawPaper() { var _a3, _b2, _c2, _d2, _e2, _f; let paperType; if ((_a3 = this.model.paper) == null ? void 0 : _a3.type) { paperType = this.model.paper.type; } else if ((_b2 = this.ddRender) == null ? void 0 : _b2.model.paper) { if (typeof ((_c2 = this.ddRender) == null ? void 0 : _c2.model.paper) == "string") { paperType = (_d2 = this.ddRender) == null ? void 0 : _d2.model.paper; } else { paperType = (_e2 = this.ddRender) == null ? void 0 : _e2.model.paper.type; } } else { paperType = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "paper.type", true); } let paperConfig = DDeiConfig$1.PAPER[paperType]; if (paperConfig) { let rat1 = this.ddRender.ratio; let stageRatio2 = this.model.getStageRatio(); let ratio = rat1 * stageRatio2; let wpv = this.model.wpv; let wpvX = -wpv.x * rat1; let wpvY = -wpv.y * rat1; let offsetWidth = 1 * ratio / 2; let paperSize = DDeiUtil$1.getPaperSize(this.model, paperType); let paperWidth = paperSize.width; let paperHeight = paperSize.height; let startPaperX = this.model.spv.x * ratio + 1; let startPaperY = this.model.spv.y * ratio + 1; let posX = startPaperX - wpvX + offsetWidth; let posY = startPaperY - wpvY + offsetWidth; this.paperStartX = posX; this.paperStartY = posY; let maxOutRect = DDeiAbstractShape.getOutRectByPV(this.model.getLayerModels()); maxOutRect.x = maxOutRect.x * ratio; maxOutRect.x1 = maxOutRect.x1 * ratio; maxOutRect.y = maxOutRect.y * ratio; maxOutRect.y1 = maxOutRect.y1 * ratio; let leftExtNum = 0, rightExtNum = 0, topExtNum = 0, bottomExtNum = 0; if (maxOutRect.width > 0 && maxOutRect.height > 0) { if (maxOutRect.x < startPaperX) { leftExtNum = parseInt((startPaperX - maxOutRect.x) / paperWidth); if (Math.abs((startPaperX - maxOutRect.x) % paperWidth) > 1) { leftExtNum++; } } if (maxOutRect.x1 > startPaperX + paperWidth) { rightExtNum = parseInt((maxOutRect.x1 - startPaperX - paperWidth) / paperWidth); if (Math.abs((maxOutRect.x1 - startPaperX - paperWidth) % paperWidth) > 1) { rightExtNum++; } } if (maxOutRect.y < startPaperY) { topExtNum = parseInt((startPaperY - maxOutRect.y) / paperHeight); if (Math.abs((startPaperY - maxOutRect.y) % paperHeight) > 1) { topExtNum++; } } if (maxOutRect.y1 > startPaperY + paperHeight) { bottomExtNum = parseInt((maxOutRect.y1 - startPaperY - paperHeight) / paperHeight); if (Math.abs((maxOutRect.y1 - startPaperY - paperHeight) % paperHeight) > 1) { bottomExtNum++; } } } let paperOutRect = { x: posX + -leftExtNum * paperWidth, y: posY + -topExtNum * paperHeight, w: (rightExtNum + leftExtNum + 1) * paperWidth, h: (bottomExtNum + topExtNum + 1) * paperHeight }; this.paperOutRect = paperOutRect; let topDisplayIndex = -1; let isBottom = true; for (let l = this.model.layers.length - 1; l >= 0; l--) { if (this.model.layers[l].tempDisplay) { topDisplayIndex = l; } else if (this.model.layers[l].display == 1) { this.model.layers[l].render.drawBackground(paperOutRect.x, paperOutRect.y, paperOutRect.w, paperOutRect.h, isBottom); isBottom = false; } } if (topDisplayIndex != -1) { this.model.layers[topDisplayIndex].render.drawBackground(paperOutRect.x, paperOutRect.y, paperOutRect.w, paperOutRect.h, isBottom); isBottom = false; } let canvas = (_f = this.model.layers[topDisplayIndex == -1 ? 0 : topDisplayIndex].render) == null ? void 0 : _f.bgCanvas; if (canvas) { let ctx = canvas.getContext("2d"); ctx.save(); let ruleWeight = 0; if (this.tempRuleDisplay == 1 || this.tempRuleDisplay == "1") { ruleWeight = 15; } ctx.translate(-ruleWeight * rat1, -ruleWeight * rat1); ctx.lineWidth = 1; ctx.fillStyle = "white"; ctx.strokeStyle = "grey"; ctx.setLineDash([5, 5]); for (let i2 = -leftExtNum + 1; i2 <= rightExtNum; i2++) { ctx.beginPath(); ctx.moveTo(posX + i2 * paperWidth, paperOutRect.y); ctx.lineTo(posX + i2 * paperWidth, paperOutRect.y + paperOutRect.h); ctx.stroke(); } for (let i2 = -topExtNum + 1; i2 <= bottomExtNum; i2++) { ctx.beginPath(); ctx.moveTo(paperOutRect.x, posY + i2 * paperHeight); ctx.lineTo(paperOutRect.x + paperOutRect.w, posY + i2 * paperHeight); ctx.stroke(); } ctx.setLineDash([]); let lineWidth = 1; ctx.lineWidth = lineWidth; ctx.strokeStyle = "black"; ctx.strokeRect(posX + -leftExtNum * paperWidth - lineWidth, posY + -topExtNum * paperHeight - lineWidth, (rightExtNum + leftExtNum + 1) * paperWidth + 2 * lineWidth, (bottomExtNum + topExtNum + 1) * paperHeight + 2 * lineWidth); ctx.restore(); } } else { let canvas = this.ddRender.getCanvas(); let topDisplayIndex = -1; for (let l = this.model.layers.length - 1; l >= 0; l--) { if (this.model.layers[l].tempDisplay) { topDisplayIndex = l; } else if (this.model.layers[l].display == 1) { this.model.layers[l].render.drawBackground(0, 0, canvas.width, canvas.height); } } if (topDisplayIndex != -1) { this.model.layers[topDisplayIndex].render.drawBackground(0, 0, canvas.width, canvas.height); } } } drawTest() { let linePathData = this.linePathData; if (linePathData) { let corssPoints = linePathData.corssPoints; let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.ratio; let stageRatio2 = this.model.getStageRatio(); let ratio = rat1 * stageRatio2; ctx.save(); ctx.font = "bold " + 12 * ratio + "px Microsoft YaHei"; corssPoints.forEach((point2) => { let weight = 3; ctx.fillStyle = "grey"; ctx.strokeStyle = "green"; ctx.beginPath(); ctx.ellipse(point2.x * rat1, point2.y * rat1, weight * ratio, weight * ratio, 0, 0, Math.PI * 2); ctx.fill(); ctx.stroke(); ctx.closePath(); }); let extLines = linePathData.extLines; ctx.lineWidth = 1; extLines.forEach((extLine) => { ctx.strokeStyle = "red"; ctx.globalAlpha = 0.1; ctx.beginPath(); ctx.moveTo(extLine[0].x * rat1, extLine[0].y * rat1); if (extLine[0].color) { ctx.strokeStyle = extLine[0].color; ctx.globalAlpha = 0.3; } if (extLine[0].x == extLine[1].x) { if (extLine[0].y >= extLine[1].y) { ctx.lineTo(extLine[1].x * rat1, (extLine[1].y - 1e3) * rat1); } else { ctx.lineTo(extLine[1].x * rat1, (extLine[1].y + 1e3) * rat1); } } else if (extLine[0].y == extLine[1].y) { if (extLine[0].x >= extLine[1].x) { ctx.lineTo((extLine[1].x - 1e3) * rat1, extLine[1].y * rat1); } else { ctx.lineTo((extLine[1].x + 1e3) * rat1, extLine[1].y * rat1); } } ctx.stroke(); ctx.closePath(); }); ctx.restore(); } } /** * 标尺 */ drawRuler() { var _a3, _b2, _c2, _d2, _e2; let ruleInit; if (((_a3 = this.model.ruler) == null ? void 0 : _a3.display) || ((_b2 = this.model.ruler) == null ? void 0 : _b2.display) == 0 || ((_c2 = this.model.ruler) == null ? void 0 : _c2.display) == false) ; else if (this.model.ddInstance.ruler != null && this.model.ddInstance.ruler != void 0) { if (typeof this.model.ddInstance.ruler == "boolean") ; else { ruleInit = this.model.ddInstance.ruler; } } else ; if (this.tempRuleDisplay == 1 || this.tempRuleDisplay == "1") { let canvas = (_d2 = this.ddRender) == null ? void 0 : _d2.getCanvas(); let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.ratio; let stageRatio2 = this.model.getStageRatio(); let xDPI = this.ddRender.model.dpi.x; let unit = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "ruler.unit", true, ruleInit); let rulerConfig = DDeiConfig$1.RULER[unit]; let unitWeight = DDeiUtil$1.unitToPix(rulerConfig.size, unit, xDPI) * rat1; let marginWeight = unitWeight * stageRatio2; let timesNums = [0.25, 0.5, 1, 2, 4, 8]; let curTimes = 0.25; for (let i2 = 1; i2 < timesNums.length; i2++) { if (stageRatio2 >= timesNums[i2]) { curTimes = timesNums[i2]; } } let standWeight = curTimes * unitWeight; let passPercent = Math.round((marginWeight - standWeight) / standWeight * 100); let splitNumber = rulerConfig.parts[0]; if (passPercent > 0) { let p = Math.round(1 / rulerConfig.parts.length * 100); for (let i2 = 1; i2 < rulerConfig.parts.length; i2++) { if (passPercent >= i2 * p) { splitNumber = rulerConfig.parts[i2]; } } } let splitedWeight = marginWeight / splitNumber; let weight = 16 * rat1; ctx.save(); let fontSize = 9.5; if (stageRatio2 <= 0.5) { fontSize -= 1; } else if (stageRatio2 <= 0.25) { fontSize -= 3; } fontSize *= rat1; ctx.font = fontSize + "px Microsoft YaHei"; ctx.lineWidth = 1; ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-rule-border", this.ddRender.model); ctx.fillStyle = DDeiUtil$1.getStyleValue("canvas-rule-background", this.ddRender.model); let cwidth = canvas.width; let cheight = canvas.height; let paperSize = DDeiUtil$1.getPaperSize(this.model); let paperWidth = paperSize.width; let paperHeight = paperSize.height; if (!this.model.spv) { let sx = this.model.width / 2 - paperWidth / 2 / rat1 / stageRatio2; let sy = this.model.height / 2 - paperHeight / 2 / rat1 / stageRatio2; this.model.spv = new Vector3(sx, sy, 1); } let startBaseX = this.model.spv.x * rat1 * stageRatio2; let startBaseY = this.model.spv.y * rat1 * stageRatio2; if (this.tempRuleDisplay == 1 || this.tempRuleDisplay == "1") { ctx.beginPath(); ctx.fillRect(0, 0, cwidth, weight); ctx.moveTo(cwidth, 0); ctx.lineTo(cwidth, weight); ctx.lineTo(0, weight); ctx.stroke(); ctx.beginPath(); ctx.fillRect(0, 0, weight, cheight); ctx.moveTo(0, cheight); ctx.lineTo(weight, cheight); ctx.lineTo(weight, 0); ctx.stroke(); } let textOffset = 1 * rat1; ctx.fillStyle = "rgb(200,200,200)"; let wpvX = -this.model.wpv.x * rat1; let wpvY = -this.model.wpv.y * rat1; let x2 = 0; let curX = startBaseX - wpvX; while (curX <= cwidth) { if (curX > weight) { ctx.beginPath(); ctx.moveTo(curX, 0); let nMod = x2 % splitNumber; if (nMod != 0) { ctx.moveTo(curX, 15); } if (nMod != 0) { ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-rule-border", this.ddRender.model); } else { ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-rule-border", this.ddRender.model); } ctx.lineTo(curX, weight); ctx.stroke(); } curX += splitedWeight; x2++; } x2 = 0; curX = startBaseX - wpvX; while (curX >= 0) { if (curX > weight) { ctx.beginPath(); ctx.moveTo(curX, 0); let nMod = x2 % splitNumber; if (nMod != 0) { ctx.moveTo(curX, 15); } if (nMod != 0) { ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-rule-border", this.ddRender.model); } else { ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-rule-border", this.ddRender.model); } ctx.lineTo(curX, weight); ctx.stroke(); } curX -= splitedWeight; x2--; } let curY = startBaseY - wpvY; let y2 = 0; while (curY <= cheight) { if (curY > weight) { ctx.beginPath(); ctx.moveTo(0, curY); let lineToNumber = 0; let nMod = y2 % splitNumber; if (nMod != 0) { ctx.moveTo(15, curY); } lineToNumber = weight; if (nMod != 0) { ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-rule-border", this.ddRender.model); } else { ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-rule-border", this.ddRender.model); } ctx.lineTo(lineToNumber, curY); ctx.stroke(); } curY += splitedWeight; y2++; } curY = startBaseY - wpvY; y2 = 0; while (curY >= 0) { if (curY > weight) { ctx.beginPath(); ctx.moveTo(0, curY); let lineToNumber = 0; let nMod = y2 % splitNumber; if (nMod != 0) { ctx.moveTo(15, curY); } lineToNumber = weight; if (nMod != 0) { ctx.strokeStyle = "rgb(230,230,230)"; } else { ctx.strokeStyle = "rgb(220,220,220)"; } ctx.lineTo(lineToNumber, curY); ctx.stroke(); } curY -= splitedWeight; y2--; } ctx.fillStyle = DDeiUtil$1.getStyleValue("canvas-control-title", this.ddRender.model); curX = startBaseX - wpvX; x2 = 0; let textTime = 1; if (stageRatio2 > 0.25 && stageRatio2 <= 0.5) { textTime = 2; } else if (stageRatio2 > 0 && stageRatio2 <= 0.25) { textTime = 4; } while (curX <= cwidth) { if (x2 % textTime == 0) { let posText = x2 * rulerConfig.size + ""; if (posText.indexOf(".") != -1) { posText = parseFloat(posText).toFixed(2); } ctx.fillText(posText, curX + textOffset, fontSize); } x2++; curX += marginWeight; } curX = startBaseX - wpvX; x2 = 0; while (curX >= 0) { if (x2 % textTime == 0) { let posText = x2 * rulerConfig.size + ""; if (posText.indexOf(".") != -1) { posText = parseFloat(posText).toFixed(2); } ctx.fillText(posText, curX + textOffset, fontSize); } x2--; curX -= marginWeight; } ctx.save(); ctx.scale(-1, 1); ctx.rotate(90 * DDeiConfig$1.ROTATE_UNIT); ctx.scale(-1, 1); curY = startBaseY - wpvY; y2 = 0; let oneSize = DDeiUtil$1.measureTextSize((_e2 = this.ddRender) == null ? void 0 : _e2.model, "0", "Microsoft YaHei", fontSize).width; while (curY <= cheight) { if (y2 % textTime == 0) { let posText = y2 * rulerConfig.size + ""; if (posText.indexOf(".") != -1) { posText = parseFloat(posText).toFixed(2); } ctx.fillText(posText, -curY - textOffset - oneSize * posText.length, fontSize); } y2++; curY += marginWeight; } curY = startBaseY - wpvY; y2 = 0; while (curY >= 0) { if (y2 % textTime == 0) { let posText = y2 * rulerConfig.size + ""; if (posText.indexOf(".") != -1) { posText = parseFloat(posText).toFixed(2); } ctx.fillText(posText, -curY - textOffset - oneSize * posText.length, fontSize); } y2--; curY -= marginWeight; } ctx.restore(); ctx.fillStyle = DDeiUtil$1.getStyleValue("canvas-rule-background", this.ddRender.model); ctx.fillRect(0, 0, weight, weight); ctx.moveTo(0, weight); ctx.lineTo(weight, weight); ctx.stroke(); ctx.moveTo(weight, 0); ctx.lineTo(weight, weight); ctx.stroke(); let selectedModels = this.model.selectedModels; if ((selectedModels == null ? void 0 : selectedModels.size) > 0) { let rect = DDeiAbstractShape.getOutRectByPV(Array.from(selectedModels == null ? void 0 : selectedModels.values())); ctx.strokeStyle = "#1F72FF"; let weight2 = 16 * rat1; ctx.lineWidth = 1.5 * rat1; ctx.globalAlpha = 0.7; let x1 = (rect.x * stageRatio2 + this.model.wpv.x) * rat1; let y1 = (rect.y * stageRatio2 + this.model.wpv.y) * rat1; ctx.beginPath(); ctx.moveTo(x1, 0); ctx.lineTo(x1, weight2); ctx.closePath(); ctx.stroke(); ctx.beginPath(); ctx.moveTo(0, y1); ctx.lineTo(weight2, y1); ctx.closePath(); ctx.stroke(); } ctx.restore(); } } /** * 绘制网格 */ drawGrid(layerIndex) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k; if (layerIndex == -1 || !this.model.layers[layerIndex].render.bgCanvas) { return; } let paperType; if ((_a3 = this.model.paper) == null ? void 0 : _a3.type) { paperType = this.model.paper.type; } else if ((_b2 = this.ddRender) == null ? void 0 : _b2.model.paper) { if (typeof ((_c2 = this.ddRender) == null ? void 0 : _c2.model.paper) == "string") { paperType = (_d2 = this.ddRender) == null ? void 0 : _d2.model.paper; } else { paperType = (_e2 = this.ddRender) == null ? void 0 : _e2.model.paper.type; } } else { paperType = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "paper.type", true); } let paperConfig = DDeiConfig$1.PAPER[paperType]; if (paperConfig) { let gridDisplay; if (((_f = this.model.grid) == null ? void 0 : _f.display) || ((_g = this.model.grid) == null ? void 0 : _g.display) == 0) { gridDisplay = (_h = this.model.grid) == null ? void 0 : _h.display; } else if (((_i = this.ddRender) == null ? void 0 : _i.model.grid) || ((_j = this.ddRender) == null ? void 0 : _j.model.grid) == 0) { gridDisplay = (_k = this.ddRender) == null ? void 0 : _k.model.grid; } else { gridDisplay = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "grid.display", true); } if (gridDisplay == 1 || gridDisplay == "1" || gridDisplay == 2 || gridDisplay == "2") { let canvas = this.model.layers[layerIndex].render.bgCanvas; let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.ratio; let stageRatio2 = this.model.getStageRatio(); let xDPI = this.ddRender.model.dpi.x; let ruleInit; if (this.model.ddInstance.ruler) { if (typeof this.model.ddInstance.ruler == "object") { ruleInit = this.model.ddInstance.ruler; } } let unit = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "ruler.unit", true, ruleInit); let rulerConfig = DDeiConfig$1.RULER[unit]; let unitWeight = DDeiUtil$1.unitToPix(rulerConfig.size, unit, xDPI) * rat1; let marginWeight = unitWeight * stageRatio2; let timesNums = [0.25, 0.5, 1, 2, 4, 8]; let curTimes = 0.25; for (let i2 = 1; i2 < timesNums.length; i2++) { if (stageRatio2 >= timesNums[i2]) { curTimes = timesNums[i2]; } } let standWeight = curTimes * unitWeight; let passPercent = Math.round((marginWeight - standWeight) / standWeight * 100); let splitNumber = rulerConfig.parts[0]; if (passPercent > 0) { let p = Math.round(1 / rulerConfig.parts.length * 100); for (let i2 = 1; i2 < rulerConfig.parts.length; i2++) { if (passPercent >= i2 * p) { splitNumber = rulerConfig.parts[i2]; } } } let paperOutRect = this.paperOutRect; let splitedWeight = marginWeight / splitNumber; ctx.save(); let ruleWeight = 0; if (this.tempRuleDisplay == 1 || this.tempRuleDisplay == "1") { ruleWeight = 15; } ctx.translate(-ruleWeight * rat1, -ruleWeight * rat1); let fontSize = 11 * rat1; ctx.font = fontSize + "px Microsoft YaHei"; ctx.lineWidth = 1; ctx.strokeStyle = "rgb(190,190,190)"; ctx.fillStyle = "white"; let ex = paperOutRect.x + paperOutRect.w; let ey = paperOutRect.y + paperOutRect.h; if (gridDisplay == 2 || gridDisplay == "2") { ctx.strokeStyle = DDeiUtil$1.getColorObj(DDeiUtil$1.getStyleValue("canvas-grid-dot", this.ddRender.model)); ctx.lineWidth = 2 * stageRatio2; ctx.setLineDash([2 * stageRatio2, splitedWeight - stageRatio2]); for (let sx = this.paperStartX; sx <= ex; sx = sx + splitedWeight) { ctx.beginPath(); ctx.moveTo(sx, paperOutRect.y); ctx.lineTo(sx, ey); ctx.stroke(); } for (let sx = this.paperStartX; sx >= paperOutRect.x; sx = sx - splitedWeight) { ctx.beginPath(); ctx.moveTo(sx, paperOutRect.y); ctx.lineTo(sx, ey); ctx.stroke(); } } else if (gridDisplay == 1 || gridDisplay == "1") { let strokeColor = DDeiUtil$1.getColorObj(DDeiUtil$1.getStyleValue("canvas-grid-line", this.ddRender.model)); let strokeLighten = strokeColor == null ? void 0 : strokeColor.lighten(0.05); for (let sx = this.paperStartX, n = 0; sx <= ex; sx = sx + splitedWeight, n++) { let nMod = n % splitNumber; if (nMod != 0) { ctx.strokeStyle = strokeLighten == null ? void 0 : strokeLighten.toColor(); } else { ctx.strokeStyle = strokeColor == null ? void 0 : strokeColor.toColor(); } ctx.beginPath(); ctx.moveTo(sx, paperOutRect.y); ctx.lineTo(sx, ey); ctx.stroke(); } for (let sx = this.paperStartX, n = 0; sx >= paperOutRect.x; sx = sx - splitedWeight, n++) { let nMod = n % splitNumber; if (nMod != 0) { ctx.strokeStyle = strokeLighten == null ? void 0 : strokeLighten.toColor(); } else { ctx.strokeStyle = strokeColor == null ? void 0 : strokeColor.toColor(); } ctx.beginPath(); ctx.moveTo(sx, paperOutRect.y); ctx.lineTo(sx, ey); ctx.stroke(); } for (let sy = this.paperStartY, n = 0; sy <= ey; sy = sy + splitedWeight, n++) { let nMod = n % splitNumber; if (nMod != 0) { ctx.strokeStyle = strokeLighten == null ? void 0 : strokeLighten.toColor(); } else { ctx.strokeStyle = strokeColor == null ? void 0 : strokeColor.toColor(); } ctx.beginPath(); ctx.moveTo(paperOutRect.x, sy); ctx.lineTo(ex, sy); ctx.stroke(); } for (let sy = this.paperStartY, n = 0; sy >= paperOutRect.y; sy = sy - splitedWeight, n++) { let nMod = n % splitNumber; if (nMod != 0) { ctx.strokeStyle = strokeLighten == null ? void 0 : strokeLighten.toColor(); } else { ctx.strokeStyle = strokeColor == null ? void 0 : strokeColor.toColor(); } ctx.beginPath(); ctx.moveTo(paperOutRect.x, sy); ctx.lineTo(ex, sy); ctx.stroke(); } } ctx.restore(); } } } /** * 绘制水印 */ drawMark() { var _a3, _b2, _c2; let ddInstance = (_a3 = this.ddRender) == null ? void 0 : _a3.model; let markInit; if (ddInstance.mark) { if (typeof ddInstance.mark == "object") { markInit = ddInstance.mark; } else { markInit = { data: ddInstance == null ? void 0 : ddInstance.mark, type: 1 }; } } let markType = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "mark.type", true, markInit); if (markType == 1 || markType == "1") { let text2 = DDeiUtil$1.getReplacibleValue(this.model, "mark.data", false, false, markInit); if (text2) { if (!this.markCanvas) { this.markCanvas = document.createElement("canvas"); } let markCanvas = this.markCanvas; let canvas = (_b2 = this.ddRender) == null ? void 0 : _b2.getCanvas(); let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.ratio; let stageRatio2 = this.model.getStageRatio(); let ratio = rat1 * stageRatio2; ctx.save(); let fiFamily = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "mark.font.family", true, markInit); let fiSize = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "mark.font.size", true, markInit); let fiColor = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "mark.font.color", true, markInit); if (!fiColor) { fiColor = DDeiUtil$1.getStyleValue("canvas-mark-title", this.ddRender.model); } let fontSize = fiSize * ratio; let textSize = DDeiUtil$1.measureTextSize(this.model.ddInstance, text2, fiFamily, fontSize); let weight = Math.max(textSize.width, textSize.height); let direct = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "mark.direct", true, markInit); let ps = [ new Vector3(-weight * 0.5, -weight * 0.5, 1), new Vector3(weight * 0.5, -weight * 0.5, 1), new Vector3(weight * 0.5, weight * 0.5, 1), new Vector3(-weight * 0.5, weight * 0.5, 1) ]; if (direct == 1) { let rotateMatrix = new Matrix3( Math.cos(45 * DDeiConfig$1.ROTATE_UNIT), Math.sin(45 * DDeiConfig$1.ROTATE_UNIT), 0, -Math.sin(45 * DDeiConfig$1.ROTATE_UNIT), Math.cos(45 * DDeiConfig$1.ROTATE_UNIT), 0, 0, 0, 1 ); ps.forEach((p) => { p.applyMatrix3(rotateMatrix); }); let outRect = DDeiAbstractShape.pvsToOutRect(ps); markCanvas.setAttribute("width", outRect.width); markCanvas.setAttribute("height", outRect.height); } else if (direct == 2) { let rotateMatrix = new Matrix3( Math.cos(-45 * DDeiConfig$1.ROTATE_UNIT), Math.sin(-45 * DDeiConfig$1.ROTATE_UNIT), 0, -Math.sin(-45 * DDeiConfig$1.ROTATE_UNIT), Math.cos(-45 * DDeiConfig$1.ROTATE_UNIT), 0, 0, 0, 1 ); ps.forEach((p) => { p.applyMatrix3(rotateMatrix); }); let outRect = DDeiAbstractShape.pvsToOutRect(ps); markCanvas.setAttribute("width", outRect.width); markCanvas.setAttribute("height", outRect.height); } else { markCanvas.setAttribute("width", weight); markCanvas.setAttribute("height", weight); } let markCtx = markCanvas.getContext("2d"); markCtx.save(); markCtx.font = fontSize + "px " + fiFamily; markCtx.fillStyle = fiColor; let opac = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "mark.opacity", true, markInit); if (opac) { markCtx.globalAlpha = opac; } if (direct == 1) { markCtx.translate(markCanvas.width * 0.5, markCanvas.height * 0.5); markCtx.rotate(45 * DDeiConfig$1.ROTATE_UNIT); markCtx.translate(-markCanvas.width * 0.5, -markCanvas.height * 0.5); } else if (direct == 2) { markCtx.translate(markCanvas.width * 0.5, markCanvas.height * 0.5); markCtx.rotate(-45 * DDeiConfig$1.ROTATE_UNIT); markCtx.translate(-markCanvas.width * 0.5, -markCanvas.height * 0.5); } markCtx.clearRect(0, 0, markCanvas.width, markCanvas.height); markCtx == null ? void 0 : markCtx.fillText(text2, 0, (markCanvas.height - textSize.height) / 2); let marginWidth = textSize.width + 50 * ratio; let marginHeight = textSize.height + 100 * ratio; this.paperOutRect; let cwidth = this.model.width * rat1; let cheight = this.model.height * rat1; let startBaseX = this.model.spv.x * ratio; let wpvX = -this.model.wpv.x * rat1; let startBaseY = this.model.spv.y * ratio; let wpvY = -this.model.wpv.y * rat1; for (let x2 = startBaseX - wpvX; x2 <= cwidth; x2 += marginWidth) { for (let y2 = startBaseY - wpvY; y2 <= cheight; y2 += marginHeight) { ctx.drawImage(markCanvas, x2, y2); } for (let y2 = startBaseY - wpvY - marginHeight; y2 >= 0; y2 -= marginHeight) { ctx.drawImage(markCanvas, x2, y2); } } for (let x2 = startBaseX - wpvX - marginWidth; x2 >= 0; x2 -= marginWidth) { for (let y2 = startBaseY - wpvY; y2 <= cheight; y2 += marginHeight) { ctx.drawImage(markCanvas, x2, y2); } for (let y2 = startBaseY - wpvY - marginHeight; y2 >= 0; y2 -= marginHeight) { ctx.drawImage(markCanvas, x2, y2); } } ctx.restore(); markCtx.restore(); } } else if (markType == 2 || markType == "2") { let imgData = DDeiUtil$1.getReplacibleValue(this.model, "mark.data", false, false, markInit); if (!((_c2 = this.mark) == null ? void 0 : _c2.imgObj) || this.mark.upMarkImg != imgData) { this.initMarkImage(); } else { if (!this.markCanvas) { this.markCanvas = document.createElement("canvas"); } let markCanvas = this.markCanvas; let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.ratio; let stageRatio2 = this.model.getStageRatio(); let ratio = rat1 * stageRatio2; ctx.save(); let weight = Math.max(this.mark.imgObj.width, this.mark.imgObj.height); markCanvas.setAttribute("width", weight); markCanvas.setAttribute("height", weight); let markCtx = markCanvas.getContext("2d"); markCtx.save(); let opac = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "mark.opacity", true, markInit); if (opac) { markCtx.globalAlpha = opac; } let direct = DDeiModelArrtibuteValue.getAttrValueByState(this.model, "mark.direct", true, markInit); if (direct == 1) { markCtx.translate(markCanvas.width * 0.5, markCanvas.height * 0.5); markCtx.rotate(45 * DDeiConfig$1.ROTATE_UNIT); markCtx.translate(-markCanvas.width * 0.5, -markCanvas.height * 0.5); } else if (direct == 2) { markCtx.translate(markCanvas.width * 0.5, markCanvas.height * 0.5); markCtx.rotate(-45 * DDeiConfig$1.ROTATE_UNIT); markCtx.translate(-markCanvas.width * 0.5, -markCanvas.height * 0.5); } markCtx.clearRect(0, 0, markCanvas.width, markCanvas.height); markCtx.drawImage(this.mark.imgObj, weight - this.mark.imgObj.width, (weight - this.mark.imgObj.height) / 2); let marginWidth = markCanvas.width + 50 * ratio; let marginHeight = markCanvas.height + 50 * ratio; let cwidth = canvas.width + marginWidth; let cheight = canvas.height + marginHeight; let x2 = -marginWidth; let xdr = this.model.wpv.x * rat1 % marginWidth; let ydr = this.model.wpv.y * rat1 % marginHeight; for (; x2 <= cwidth; x2 += marginWidth) { let y2 = -marginHeight; for (; y2 <= cheight; y2 += marginHeight) { ctx.drawImage(markCanvas, x2 + xdr, y2 + ydr); } } ctx.restore(); markCtx.restore(); } } } /** * 绘制滚动条 */ drawScroll() { var _a3, _b2; let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let rat1 = this.ddRender.ratio; ctx.save(); let scrollWeight = rat1 * 15; let cwidth = canvas.width - scrollWeight; let cheight = canvas.height - scrollWeight; if (this.hScroll) { ctx.fillStyle = DDeiUtil$1.getStyleValue("canvas-scroll-background", this.ddRender.model); ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-scroll-border", this.ddRender.model); ctx.fillRect(0, cheight, this.hScroll.width * rat1, scrollWeight); ctx.strokeRect(0, cheight, this.hScroll.width * rat1, scrollWeight); ctx.fillStyle = "rgb(210,210,210)"; if (this.operateState == DDeiEnumOperateState.STAGE_SCROLL_WORKING && ((_a3 = this.dragObj) == null ? void 0 : _a3.scroll) == 1) { ctx.fillStyle = "rgb(200,200,200)"; } ctx.fillRect(this.hScroll.x * rat1, cheight, this.hScroll.contentWidth * rat1, scrollWeight); } if (this.vScroll) { ctx.fillStyle = DDeiUtil$1.getStyleValue("canvas-scroll-background", this.ddRender.model); ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-scroll-border", this.ddRender.model); ctx.fillRect(cwidth, 0, scrollWeight, this.vScroll.height * rat1); ctx.strokeRect(cwidth, 0, scrollWeight, this.vScroll.height * rat1); ctx.fillStyle = "rgb(210,210,210)"; if (this.operateState == DDeiEnumOperateState.STAGE_SCROLL_WORKING && ((_b2 = this.dragObj) == null ? void 0 : _b2.scroll) == 2) { ctx.fillStyle = "rgb(200,200,200)"; } ctx.fillRect(cwidth, this.vScroll.y * rat1, scrollWeight, this.vScroll.contentHeight * rat1); } if (this.vScroll || this.hScroll) { ctx.strokeStyle = DDeiUtil$1.getStyleValue("canvas-scroll-border", this.ddRender.model); ctx.fillStyle = DDeiUtil$1.getStyleValue("canvas-scroll-background", this.ddRender.model); ctx.fillRect(cwidth, cheight, scrollWeight, scrollWeight); ctx.strokeRect(cwidth, cheight, scrollWeight, scrollWeight); } } enableRefreshShape() { } /** * 计算滚动条信息 */ calScroll() { let canvas = this.ddRender.getCanvas(); let rat1 = this.ddRender.ratio; let canvasHeight = canvas.height / rat1; let canvasWidth = canvas.width / rat1; let curX = -this.model.wpv.x; let curY = -this.model.wpv.y; let scrollWeight = 15; let maxWidth = this.model.width; let maxHeight = this.model.height; if (maxHeight > canvasHeight) { let height = canvasHeight - scrollWeight; this.vScroll = { height, contentHeight: height * height / maxHeight, y: height * curY / maxHeight, bn: curY / maxHeight }; } else { this.vScroll = null; this.model.wpv.y = 0; } if (maxWidth > canvasWidth) { let width = canvasWidth - scrollWeight; this.hScroll = { width, contentWidth: width * width / maxWidth, x: width * curX / maxWidth, bn: curX / maxWidth }; } else { this.hScroll = null; this.model.wpv.x = 0; } } /** * 获取缓存的渲染数据 */ getCachedValue(attrPath) { let returnValue = null; if (!this.renderCacheData.has(attrPath)) { returnValue = DDeiModelArrtibuteValue.getAttrValueByState(this.model, attrPath, true); this.renderCacheData.set(attrPath, returnValue); } else { returnValue = this.renderCacheData.get(attrPath); } return returnValue; } /** * 设置渲染缓存数据 */ setCachedValue(attrPath, value) { if (attrPath) { if (Array.isArray(attrPath)) { attrPath.forEach((item) => { this.renderCacheData.set(item, value); }); } else { this.renderCacheData.set(attrPath, value); } } } clearCachedValue() { this.renderCacheData.clear(); this.model.layers.forEach((layer2) => { var _a3; (_a3 = layer2 == null ? void 0 : layer2.render) == null ? void 0 : _a3.clearCachedValue(); }); } /** * 初始化选择器 */ initSelector() { if (!this.selector) { this.selector = DDeiSelector.initByJSON({ id: this.model.id + "_inner_selector", border: DDeiConfig$1.SELECTOR.BORDER, fill: { default: {}, selected: {} } }); this.selector.stage = this.model; DDeiConfig$1.bindRender(this.selector); this.selector.initRender(); } this.selector.resetState(); } /** * 初始化水印图片 */ initMarkImage() { var _a3, _b2; let that = this; let markInit; if (this.model.ddInstance.mark) { if (typeof this.model.ddInstance.mark == "object") { markInit = this.model.ddInstance.mark; } else { markInit = { data: this.model.ddInstance.mark, type: 1 }; } } let imgData = DDeiUtil$1.getReplacibleValue(this.model, "mark.data", false, false, markInit); if (((_a3 = this.model.mark) == null ? void 0 : _a3.imgBase64) || imgData) { let img = new Image(); img.onload = function() { var _a22; if (!that.mark) { that.mark = {}; } let imgData2 = DDeiUtil$1.getReplacibleValue(that.model, "mark.data", false, false, markInit); that.mark.upMarkImg = ((_a22 = that.model.mark) == null ? void 0 : _a22.imgBase64) ? that.model.mark.imgBase64 : imgData2; that.mark.imgObj = img; that.model.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, null); that.model.ddInstance.bus.executeAll(); }; img.src = ((_b2 = this.model.mark) == null ? void 0 : _b2.imgBase64) ? this.model.mark.imgBase64 : imgData; } } /** * 重置选择器状态 * @param evt 事件 */ resetSelectorState(evt) { this.selector.resetState(evt.offsetX - this.model.wpv.x, evt.offsetY - this.model.wpv.y); } // ============================== 事件 =============================== /** * 鼠标按下事件 */ mouseDown(evt) { if (this.model.disabled) { return; } if (!this.model.ddInstance.eventCancel) { let canvas = this.ddRender.getCanvas(); let rat1 = this.ddRender.ratio; let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; let scrollWeight = 15; let cwidth = canvas.width / rat1 - scrollWeight; let cheight = canvas.height / rat1 - scrollWeight; if (this.vScroll && ex > cwidth && ey >= this.vScroll.y && ey <= this.vScroll.y + this.vScroll.contentHeight) { this.dragObj = { dy: ey - this.vScroll.y, scroll: 2 }; this.operateState = DDeiEnumOperateState.STAGE_SCROLL_WORKING; } else if (this.hScroll && ey > cheight && ex >= this.hScroll.x && ex <= this.hScroll.x + this.hScroll.contentWidth) { this.dragObj = { dx: ex - this.hScroll.x, scroll: 1 }; this.operateState = DDeiEnumOperateState.STAGE_SCROLL_WORKING; } else { this.model.layers[this.model.layerIndex].render.mouseDown(evt); } } } mouseUp(evt) { if (this.model.ddInstance.disabled) { return; } if (!this.model.ddInstance.eventCancel) { if (this.operateState == DDeiEnumOperateState.STAGE_SCROLL_WORKING) { this.dragObj = null; this.operateState = DDeiEnumOperateState.NONE; } else { this.model.layers[this.model.layerIndex].render.mouseUp(evt); } } } /** * 鼠标移动 */ mouseMove(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; if (this.model.ddInstance.disabled) { return; } if (!this.model.ddInstance.eventCancel) { if (this.operateState == DDeiEnumOperateState.STAGE_SCROLL_WORKING) { let canvasPos = DDeiUtil$1.getDomAbsPosition((_b2 = (_a3 = this.ddRender) == null ? void 0 : _a3.canvas) == null ? void 0 : _b2.parentElement); let ex = evt.pageX - canvasPos.left; let ey = evt.pageY - canvasPos.top; if (((_c2 = this.dragObj) == null ? void 0 : _c2.scroll) == 1) { let width = this.hScroll.width; let posRat = (ex / window.remRatio - this.dragObj.dx) / width; this.model.wpv.x = -this.model.width * posRat; let hScrollWidth = ((_d2 = this.hScroll) == null ? void 0 : _d2.width) ? (_e2 = this.hScroll) == null ? void 0 : _e2.width : 0; if (this.model.wpv.x > 0) { this.model.wpv.x = 0; } else if (this.model.wpv.x < -this.model.width + hScrollWidth) { this.model.wpv.x = -this.model.width + hScrollWidth; } } else if (((_f = this.dragObj) == null ? void 0 : _f.scroll) == 2) { let height = this.vScroll.height; let posRat = (ey / window.remRatio - this.dragObj.dy) / height; this.model.wpv.y = -this.model.height * posRat; let vScrollHeight = ((_g = this.vScroll) == null ? void 0 : _g.height) ? (_h = this.vScroll) == null ? void 0 : _h.height : 0; if (this.model.wpv.y > 0) { this.model.wpv.y = 0; } else if (this.model.wpv.y < -this.model.height + vScrollHeight) { this.model.wpv.y = -this.model.height + vScrollHeight; } } DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "SCROLL_WORKING", null, this.model.ddInstance, evt); (_j = (_i = this.model.ddInstance) == null ? void 0 : _i.bus) == null ? void 0 : _j.push(DDeiEnumBusCommandType.RefreshShape); (_l = (_k = this.model.ddInstance) == null ? void 0 : _k.bus) == null ? void 0 : _l.executeAll(); } else { this.model.layers[this.model.layerIndex].render.mouseMove(evt); } } } /** * 鼠标悬停 * @param inEdge 悬停方位 * @param inEdgeTime 悬停时间 */ mouseInEdge(inEdge, inEdgeTime) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; switch (this.operateState) { case DDeiEnumOperateState.CONTROL_CREATING: case DDeiEnumOperateState.CONTROL_DRAGING: { if (inEdge && inEdgeTime > 400) { let pContainerModel = null; if (this.currentOperateShape.id.indexOf("_shadow") != -1) { let id = this.currentOperateShape.id.substring(this.currentOperateShape.id, this.currentOperateShape.id.lastIndexOf("_shadow")); let model = this.model.getModelById(id); pContainerModel = model.pModel; } else { pContainerModel = this.currentOperateShape.pModel; } if (pContainerModel) { let dx = 0, dy = 0; let deltaSize = 10 * this.model.getStageRatio(); switch (inEdge) { case 1: dy = -deltaSize; break; case 2: dx = deltaSize; break; case 3: dy = deltaSize; break; case 4: dx = -deltaSize; break; } if (dx || dy) { let shadowControls = this.model.layers[this.model.layerIndex].shadowControls; if (!((shadowControls == null ? void 0 : shadowControls.length) > 0)) { shadowControls = [this.currentOperateShape]; } let pushData = { dx, dy, dragObj: this.dragObj, models: shadowControls }; (_c2 = (_b2 = (_a3 = this.model) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.bus) == null ? void 0 : _c2.push(DDeiEnumBusCommandType.ModelEdgePosition, pushData); (_f = (_e2 = (_d2 = this.model) == null ? void 0 : _d2.ddInstance) == null ? void 0 : _e2.bus) == null ? void 0 : _f.push(DDeiEnumBusCommandType.RefreshShape); (_i = (_h = (_g = this.model) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.bus) == null ? void 0 : _i.executeAll(); } } } } break; } } }; __publicField2(_DDeiStageCanvasRender, "ClsName", "DDeiStageCanvasRender"); let DDeiStageCanvasRender = _DDeiStageCanvasRender; const __vite_glob_1_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiStageCanvasRender, default: DDeiStageCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiTableCellCanvasRender = class _DDeiTableCellCanvasRender2 extends DDeiPolygonContainerCanvasRender { // ============================ 构造函数 ============================ constructor(props) { super(props); } // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiTableCellCanvasRender2(props); } // ============================== 方法 =============================== getHTML() { let cell = this.model; if (cell.isMergedCell() && !cell.isMergeCell()) { return ""; } let fiFamily = this.getCachedValue("font.family"); let fiSize = this.getCachedValue("font.size"); let fiColor = this.getCachedValue("font.color"); let align = this.getCachedValue("textStyle.align"); let valign = this.getCachedValue("textStyle.valign"); let bold = this.getCachedValue("textStyle.bold"); let italic = this.getCachedValue("textStyle.italic"); let underline = this.getCachedValue("textStyle.underline"); let deleteline = this.getCachedValue("textStyle.deleteline"); let feed = this.getCachedValue("textStyle.feed"); let topDisabled = this.getCachedValue("border.top.disabled"); let topColor = this.getCachedValue("border.top.color"); let topOpac = this.getCachedValue("border.top.opacity"); let topWidth = this.getCachedValue("border.top.width"); let rightDisabled = this.getCachedValue("border.right.disabled"); let rightColor = this.getCachedValue("border.right.color"); let rightOpac = this.getCachedValue("border.right.opacity"); let rightWidth = this.getCachedValue("border.right.width"); let bottomDisabled = this.getCachedValue("border.bottom.disabled"); let bottomColor = this.getCachedValue("border.bottom.color"); let bottomOpac = this.getCachedValue("border.bottom.opacity"); let bottomWidth = this.getCachedValue("border.bottom.width"); let leftDisabled = this.getCachedValue("border.left.disabled"); let leftColor = this.getCachedValue("border.left.color"); let leftOpac = this.getCachedValue("border.left.opacity"); let leftWidth = this.getCachedValue("border.left.width"); let fillColor = this.getCachedValue("fill.color"); let fillOpacity = this.getCachedValue("fill.opacity"); let fillDisabled = this.getCachedValue("fill.disabled"); let topDash = this.getCachedValue("border.top.dash"); let bottomDash = this.getCachedValue("border.bottom.dash"); let leftDash = this.getCachedValue("border.left.dash"); let rightDash = this.getCachedValue("border.right.dash"); let html = ""; html += ' 0) && topWidth > 0) { let dash = "solid"; if (topDash && topDash.length > 0) { dash = "dashed"; } html += "border-top: " + topWidth + "px " + dash + " " + topColor + ";"; } if (!bottomDisabled && bottomColor && (!bottomOpac || bottomOpac > 0) && bottomWidth > 0) { let dash = "solid"; if (bottomDash && bottomDash.length > 0) { dash = "dashed"; } html += "border-bottom: " + bottomWidth + "px " + dash + " " + bottomColor + ";"; } if (!leftDisabled && leftColor && (!leftOpac || leftOpac > 0) && leftWidth > 0) { let dash = "solid"; if (leftDash && leftDash.length > 0) { dash = "dashed"; } html += "border-left: " + leftWidth + "px " + dash + " " + leftColor + ";"; } if (!rightDisabled && rightColor && (!rightOpac || rightOpac > 0) && rightWidth > 0) { let dash = "solid"; if (rightDash && rightDash.length > 0) { dash = "dashed"; } html += "border-right: " + rightWidth + "px " + dash + " " + rightColor + ";"; } if (!fillDisabled && fillColor && (!fillOpacity || fillOpacity > 0)) { html += "background-color: " + fillColor + ";"; } html += "width: " + cell.width + "px;"; html += "height: " + cell.height + "px;"; html += '"'; if (cell.isMergeCell()) { html += ' rowspan="' + cell.mergeRowNum + '"'; html += ' colspan="' + cell.mergeColNum + '"'; } html += ' width="' + cell.width + '"'; html += ' height="' + cell.height + '"'; html += ">"; if (cell.text) { html += cell.text; } html += ""; return html; } // ============================== 事件 =============================== /** * 鼠标按下事件 */ mouseDown(e) { if (!this.stage.ddInstance.eventCancel) ; } mouseUp(e) { if (!this.stage.ddInstance.eventCancel) ; } /** * 鼠标移动 */ mouseMove(evt) { if (!this.stage.ddInstance.eventCancel) ; } }; __publicField2(_DDeiTableCellCanvasRender, "ClsName", "DDeiTableCellCanvasRender"); let DDeiTableCellCanvasRender = _DDeiTableCellCanvasRender; const __vite_glob_1_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiTableCellCanvasRender, default: DDeiTableCellCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiTableCanvasRender = class _DDeiTableCanvasRender2 extends DDeiRectangleCanvasRender { // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiTableCanvasRender2(props); } // ============================== 方法 =============================== /** * 获取html */ getHTML() { let selectedCells = this.model.getSelectedCells(); if ((selectedCells == null ? void 0 : selectedCells.length) > 0) { let html = ""; html += " { item.render.drawShape(); }); } // ============================== 事件 =============================== /** * 鼠标按下事件 */ mouseDown(e) { if (!this.stage.ddInstance.eventCancel) { let table2 = this.model; let isCtrl = DDei.KEY_DOWN_STATE.get("ctrl"); let isShift = DDei.KEY_DOWN_STATE.get("shift"); let currentCell = table2.tempDragCell; if (e.button == 2) { table2.curRow = currentCell.row; table2.curCol = currentCell.col; table2.dragChanging = false; table2.specilDrag = false; table2.tempDragCell = null; table2.tempDragType = null; table2.tempUpCel = null; table2.dragCell = null; table2.dragType = null; } else if (table2.tempDragType) { table2.dragType = table2.tempDragType; table2.dragChanging = true; table2.dragCell = table2.tempDragCell; if (table2.dragType == "table-select-col") { table2.clearSelectionCells(); for (let col = 0; col < table2.cols.length; col++) { let colObj = table2.cols[col]; if (colObj[0].isBorderOn(1, e.offsetX, e.offsetY, 1, 5)) { colObj.forEach((item) => { item.selectCell(); }); break; } } } else if (table2.dragType == "table-select-row") { table2.clearSelectionCells(); for (let row = 0; row < table2.rows.length; row++) { let rowObj = table2.rows[row]; if (rowObj[0].isBorderOn(4, e.offsetX, e.offsetY, 1, 5)) { rowObj.forEach((item) => { item.selectCell(); }); break; } } } else if (table2.dragType == "cell") { if (isShift) { if (table2.curRow != -1 && table2.curCol != -1) { let minMax = table2.getMinMaxRowAndCol([currentCell, table2.rows[table2.curRow][table2.curCol]]); for (let x2 = minMax.minRow; x2 <= minMax.maxRow; x2++) { for (let y2 = minMax.minCol; y2 <= minMax.maxCol; y2++) { table2.rows[x2][y2].selectCell(); } } table2.curRow = currentCell.row; table2.curCol = currentCell.col; } else { currentCell.selectOrCancelCell(); } } else { if (!isCtrl) { table2.clearSelectionCells(); currentCell.selectCell(); } else { currentCell.selectOrCancelCell(); } currentCell.render.mouseDown(e); } } if (!isCtrl) { if (table2.dragType == "row-top") { if (table2.dragCell.row > 0) { table2.dragCell = table2.rows[table2.dragCell.row - 1][table2.dragCell.col]; table2.dragType = "row"; } } else if (table2.dragType == "row-bottom") { if (table2.dragCell.isMergeCell()) { table2.dragCell = table2.rows[table2.dragCell.row + table2.dragCell.mergeRowNum - 1][table2.dragCell.col]; } if (table2.dragCell.row < table2.rows.length - 1) { table2.dragType = "row"; } } else if (table2.dragType == "col-left") { if (table2.dragCell.col > 0) { table2.dragCell = table2.rows[table2.dragCell.row][table2.dragCell.col - 1]; table2.dragType = "col"; } } else if (table2.dragType == "col-right") { if (table2.dragCell.isMergeCell()) { table2.dragCell = table2.rows[table2.dragCell.row][table2.dragCell.col + table2.dragCell.mergeColNum - 1]; } if (table2.dragCell.col < table2.cols.length - 1) { table2.dragType = "col"; } } } } else { table2.dragChanging = false; table2.dragCell = null; table2.dragType = null; } } } controlDragEnd(e) { if (!this.stage.ddInstance.eventCancel) { let table2 = this.model; table2.dragChanging = false; table2.specilDrag = false; table2.tempDragCell = null; table2.tempDragType = null; table2.tempUpCel = null; table2.dragCell = null; table2.dragType = null; } } /** * 绘制图形 */ mouseUp(e) { var _a3, _b2; if (!this.stage.ddInstance.eventCancel) { let table2 = this.model; if (table2.dragChanging) { if (table2.dragType == "cell") { (_b2 = (_a3 = table2.dragCell) == null ? void 0 : _a3.render) == null ? void 0 : _b2.mouseUp(e); } table2.dragChanging = false; table2.specilDrag = false; table2.tempUpCel = null; table2.dragCell = null; table2.dragType = null; } } } /** * 鼠标移动 */ mouseMove(e) { if (!this.stage.ddInstance.eventCancel) { super.mouseMove(e); let table2 = this.model; if (table2.dragChanging) { table2.setState(DDeiEnumControlState.SELECTED); if (table2.dragType == "col") { table2.dragCol(e.offsetX, e.offsetY); } else if (table2.dragType == "row") { table2.dragRow(e.offsetX, e.offsetY); } else if (table2.dragType == "cell") { table2.dragAndSelectedCell(e.offsetX, e.offsetY); } else if (table2.dragType == "table-size-right") { table2.changeTableSizeToRight(e.offsetX, e.offsetY); } else if (table2.dragType == "table-size-left") { table2.changeTableSizeToLeft(e.offsetX, e.offsetY); } else if (table2.dragType == "table-size-bottom") { table2.changeTableSizeToBottom(e.offsetX, e.offsetY); } else if (table2.dragType == "table-size-top") { table2.changeTableSizeToTop(e.offsetX, e.offsetY); } } else { if (table2.isBorderOn(1, e.offsetX, e.offsetY, 6, 10) || table2.isBorderOn(1, e.offsetX, e.offsetY, -3, 0)) { table2.tempDragType = "table-size-top"; this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "ns-resize" }, e); } else if (table2.isBorderOn(1, e.offsetX, e.offsetY, 1, 5)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "s-resize" }, e); table2.tempDragType = "table-select-col"; } else if (table2.isBorderOn(2, e.offsetX, e.offsetY, -5, 10)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "ew-resize" }, e); table2.tempDragType = "table-size-right"; } else if (table2.isBorderOn(3, e.offsetX, e.offsetY, -5, 10)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "ns-resize" }, e); table2.tempDragType = "table-size-bottom"; } else if (table2.isBorderOn(4, e.offsetX, e.offsetY, 6, 10) || table2.isBorderOn(4, e.offsetX, e.offsetY, -3, 0)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "ew-resize" }, e); table2.tempDragType = "table-size-left"; } else if (table2.isBorderOn(4, e.offsetX, e.offsetY, 1, 5)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "e-resize" }, e); table2.tempDragType = "table-select-row"; } else { for (let i2 = 0; i2 < table2.rows.length; i2++) { let rowObj = table2.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let cellObj = rowObj[j2]; let isDrag = false; if (cellObj.width <= 0 || cellObj.height <= 0) { continue; } if (cellObj.isBorderOn(1, e.offsetX, e.offsetY, -3, 0)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "ns-resize" }, e); table2.tempDragType = "row-top"; isDrag = true; } else if (cellObj.isBorderOn(2, e.offsetX, e.offsetY, -3, 0)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "ew-resize" }, e); table2.tempDragType = "col-right"; isDrag = true; } else if (cellObj.isBorderOn(3, e.offsetX, e.offsetY, -3, 0)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "ns-resize" }, e); table2.tempDragType = "row-bottom"; isDrag = true; } else if (cellObj.isBorderOn(4, e.offsetX, e.offsetY, -3, 0)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "ew-resize" }, e); table2.tempDragType = "col-left"; isDrag = true; } else if (cellObj.isInAreaLoose(e.offsetX, e.offsetY, 0)) { this.stage.ddInstance.bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "all-scroll" }, e); table2.tempDragType = "cell"; isDrag = true; } if (isDrag) { table2.tempDragCell = cellObj; cellObj.render.mouseMove(e); return; } } } } } } } }; __publicField2(_DDeiTableCanvasRender, "ClsName", "DDeiTableCanvasRender"); let DDeiTableCanvasRender = _DDeiTableCanvasRender; const __vite_glob_1_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiTableCanvasRender, default: DDeiTableCanvasRender }, Symbol.toStringTag, { value: "Module" })); const _DDeiTableSelectorCanvasRender = class _DDeiTableSelectorCanvasRender2 extends DDeiSelectorCanvasRender { // ============================== 静态方法 ============================ // 通过一个JSON反向序列化成对象,模型数据与JSON完全一样 static newInstance(props) { return new _DDeiTableSelectorCanvasRender2(props); } /** * 创建图形 */ drawShape() { this.drawBorder(); this.fillSelectedCell(); } /** * 填充选中单元格 */ fillSelectedCell() { let table2 = this.model.table; let canvas = this.ddRender.getCanvas(); let ctx = canvas.getContext("2d"); let stageRatio2 = this.model.getStageRatio(); let ratio = this.ddRender.ratio * stageRatio2; ctx.save(); ctx.fillStyle = DDeiUtil$1.getColor("rgb(210,210,210)"); ctx.globalAlpha = 0.5; let rect = this.model.getBounds(); ({ x: rect.x, y: rect.y, width: rect.width, height: rect.height }); let ratPos = DDeiUtil$1.getRatioPosition(rect, ratio); this.doRotate(ctx, ratPos); let rect1 = null; if (table2.curRow != -1 && table2.curCol != -1) { let curCell = table2.rows[table2.curRow][table2.curCol]; if (curCell) { let cellBounds = curCell.getAbsBounds(); if (rect.y - cellBounds.y == 0 && rect.x - cellBounds.x == 0) { rect1 = { x: rect.x, y: rect.y + cellBounds.height - this.model.border.width, width: rect.width, height: rect.height - cellBounds.height + this.model.border.width }; rect = { x: rect.x + cellBounds.width, y: rect.y, width: rect.width - cellBounds.width, height: cellBounds.height }; } else if (rect.y - cellBounds.y == 0 && rect.x + rect.width - cellBounds.x - cellBounds.width == 0) { rect1 = { x: rect.x, y: rect.y + cellBounds.height - this.model.border.width, width: rect.width, height: rect.height - cellBounds.height + this.model.border.width }; rect = { x: rect.x, y: rect.y, width: rect.width - cellBounds.width, height: cellBounds.height }; } else if (rect.y + rect.height - cellBounds.y - cellBounds.height == 0 && rect.x - cellBounds.x == 0) { rect1 = { x: rect.x + cellBounds.width, y: cellBounds.y - this.model.border.width, width: rect.width - cellBounds.width, height: cellBounds.height + this.model.border.width }; rect = { x: rect.x, y: rect.y, width: rect.width, height: rect.height - cellBounds.height }; } else if (rect.y + rect.height - cellBounds.y - cellBounds.height == 0 && rect.x + rect.width - cellBounds.x - cellBounds.width == 0) { rect1 = { x: rect.x, y: cellBounds.y - this.model.border.width, width: rect.width - cellBounds.width, height: cellBounds.height + this.model.border.width }; rect = { x: rect.x, y: rect.y, width: rect.width, height: rect.height - cellBounds.height }; } } } rect.x += this.model.border.width; rect.y += this.model.border.width; rect.width -= this.model.border.width; rect.height -= this.model.border.width; ratPos = DDeiUtil$1.getRatioPosition(rect, ratio); ctx.fillRect(ratPos.x, ratPos.y, ratPos.width, ratPos.height); if ((rect1 == null ? void 0 : rect1.width) > 0 && (rect1 == null ? void 0 : rect1.height) > 0) { rect1.x += this.model.border.width; rect1.y += this.model.border.width; rect1.width -= this.model.border.width; rect1.height -= this.model.border.width; ratPos = DDeiUtil$1.getRatioPosition(rect1, ratio); ctx.fillRect(ratPos.x, ratPos.y, ratPos.width, ratPos.height); } ctx.restore(); } // /** // * 绘制边框 // * @param tempBorder 临时边框,优先级最高 // */ // drawBorder(tempBorder: object | null): void { // //获得 2d 上下文对象 // let canvas = this.ddRender.getCanvas(); // let ctx = canvas.getContext('2d'); // //获取全局缩放比例 // let stageRatio = this.model.getStageRatio() // let ratio = this.ddRender.ratio * stageRatio; // //转换为缩放后的坐标 // let ratPos = this.getBorderRatPos(); // //1,2,3,4 上,右,下,左 // for (let i = 1; i <= 4; i++) { // //如果被选中,使用选中的边框,否则使用缺省边框 // let disabled = this.getBorderInfo(tempBorder, i, "disabled"); // let color = this.getBorderInfo(tempBorder, i, "color"); // let opacity = this.getBorderInfo(tempBorder, i, "opacity"); // let width = this.getBorderInfo(tempBorder, i, "width"); // let dash = this.getBorderInfo(tempBorder, i, "dash"); // //绘制四个方向的边框 // //如果边框未被disabled,则绘制边框 // if (!disabled && color && (!opacity || opacity > 0) && width > 0) { // //保存状态 // ctx.save(); // //设置旋转 // this.doRotate(ctx, ratPos); // //偏移量,因为线是中线对齐,实际坐标应该加上偏移量 // let lineOffset = width * ratio / 2; // ctx.lineWidth = width * ratio; // ctx.beginPath(); // //线段、虚线样式 // if (dash) { // ctx.setLineDash(dash); // } // //透明度 // if (opacity != null && opacity != undefined) { // ctx.globalAlpha = opacity // } // //颜色 // ctx.strokeStyle = DDeiUtil.getColor(color); // if (i == 1) { // ctx.moveTo(ratPos.x + lineOffset, ratPos.y + lineOffset); // ctx.lineTo(ratPos.x + ratPos.width + lineOffset, ratPos.y + lineOffset); // } else if (i == 2) { // ctx.moveTo(ratPos.x + ratPos.width + lineOffset, ratPos.y + lineOffset); // ctx.lineTo(ratPos.x + ratPos.width + lineOffset, ratPos.y + ratPos.height + lineOffset); // } else if (i == 3) { // ctx.moveTo(ratPos.x + lineOffset, ratPos.y + ratPos.height + lineOffset); // ctx.lineTo(ratPos.x + ratPos.width + lineOffset, ratPos.y + ratPos.height + lineOffset); // } else if (i == 4) { // ctx.moveTo(ratPos.x + lineOffset, ratPos.y + lineOffset); // ctx.lineTo(ratPos.x + lineOffset, ratPos.y + ratPos.height + lineOffset); // } // ctx.stroke(); // //恢复状态 // ctx.restore(); // } // } // } }; __publicField2(_DDeiTableSelectorCanvasRender, "ClsName", "DDeiTableSelectorCanvasRender"); let DDeiTableSelectorCanvasRender = _DDeiTableSelectorCanvasRender; const __vite_glob_1_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiTableSelectorCanvasRender, default: DDeiTableSelectorCanvasRender }, Symbol.toStringTag, { value: "Module" })); class DDeiPluginBase { constructor(options) { __publicField2(this, "name", ""); __publicField2(this, "type", "plugin"); __publicField2(this, "options"); __publicField2(this, "defaultOptions"); __publicField2(this, "plugins", []); __publicField2(this, "order", 1); __publicField2(this, "initConfig", null); this.options = options; } installed(editor) { } getOptions() { var _a3; let options = {}; if (this.type == "package") { (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let pluginOptions; let pluginName; let pluginType; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { pluginOptions = plugin.defaultIns.getOptions(); pluginName = plugin.defaultIns.getName(); pluginType = plugin.defaultIns.type; } else if (plugin instanceof DDeiPluginBase) { pluginOptions = plugin.getOptions(); pluginName = plugin.getName(); pluginType = plugin.type; } if (pluginOptions) { if (pluginType == "package") { for (let i2 in pluginOptions) { options[i2] = pluginOptions[i2]; } } else { options[pluginName] = pluginOptions; } } }); } else if (this.type == "plugin") { if (this.options) { options = this.options; } else if (this.defaultOptions) { options = this.defaultOptions; } if (options && options.config instanceof Function) { options = options.config(cloneDeep(this.defaultOptions)); } } return options; } init() { } /** * 修改自身的方法,通过传入一个回调函数,让插件使用者可以更灵活的修改插件属性 * @param fn * @returns */ modify(fn) { let cloneThis = cloneDeep(this); fn(cloneThis); return cloneThis; } getInitConfig() { return this.initConfig; } getName() { return this.name; } getType() { return this.type; } static isSubclass(a, b) { return a.prototype && (Object.getPrototypeOf(a.prototype) === b.prototype || a.prototype instanceof b); } } class DDeiKeyAction extends DDeiPluginBase { // ============================ 构造函数 ============================ constructor(props) { super(props); __publicField2(this, "name"); __publicField2(this, "desc"); this.name = props == null ? void 0 : props.name; this.desc = props == null ? void 0 : props.desc; } // ============================ 静态方法 ============================ /** * 更新按键状态 */ static updateKeyState(evt) { let editor = DDeiEditor$1.ACTIVE_INSTANCE; let ddInstance = editor == null ? void 0 : editor.ddInstance; if (ddInstance == null ? void 0 : ddInstance.disabled) { DDei.KEY_DOWN_STATE.clear(); return; } let ctrl = evt.ctrlKey || evt.metaKey; let shift = evt.shiftKey; let alt = evt.altKey; if (ctrl == true) { DDei.KEY_DOWN_STATE.set("ctrl", true); } else { DDei.KEY_DOWN_STATE.set("ctrl", false); } if (shift == true) { DDei.KEY_DOWN_STATE.set("shift", true); } else { DDei.KEY_DOWN_STATE.set("shift", false); } if (alt == true) { DDei.KEY_DOWN_STATE.set("alt", true); } else { DDei.KEY_DOWN_STATE.set("alt", false); } if (evt.keyCode != 93 && evt.keyCode != 18 && evt.keyCode != 16 && evt.keyCode != 17) { DDei.KEY_DOWN_STATE.set("" + evt.keyCode, true); } } /** * 根据快捷键配置以及当前操作的上下文环境 * 路由到合理的键行为实例上 */ static route(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; let editor = DDeiEditor$1.ACTIVE_INSTANCE; let ddInstance = editor == null ? void 0 : editor.ddInstance; if (ddInstance == null ? void 0 : ddInstance.disabled) { return false; } let ctrl = evt.ctrlKey || evt.metaKey; let shift = evt.shiftKey; let alt = evt.altKey; DDeiKeyAction.updateKeyState(evt); let onlySelectModel = null; let selectedModels = (_a3 = editor.ddInstance.stage) == null ? void 0 : _a3.selectedModels; if ((selectedModels == null ? void 0 : selectedModels.size) == 1) { onlySelectModel = Array.from(selectedModels.values())[0]; } let m1Str = editor.state + "_"; m1Str += ((_d2 = (_c2 = (_b2 = editor.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.render) == null ? void 0 : _d2.operateState) + "_"; if (ctrl == true) { m1Str += "ctrl_"; } if (shift == true) { m1Str += "shift_"; } if (alt == true) { m1Str += "alt_"; } if (evt.keyCode != 93 && evt.keyCode != 18 && evt.keyCode != 16 && evt.keyCode != 17) { m1Str += evt.keyCode; } let matched = false; for (let it = 0; it < ((_e2 = editor.hotKeyMapping) == null ? void 0 : _e2.length); it++) { let item = editor.hotKeyMapping[it]; let matchStr = null; if (item.editorState) { matchStr = item.editorState + "_"; } else { matchStr = editor.state + "_"; } if (item.operateState) { matchStr += item.operateState + "_"; } else { matchStr += ((_h = (_g = (_f = editor.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.render) == null ? void 0 : _h.operateState) + "_"; } if (item.ctrl == 1) { matchStr += "ctrl_"; } else if (item.ctrl == 2 && ctrl == true) { matchStr += "ctrl_"; } if (item.shift == 1) { matchStr += "shift_"; } else if (item.shift == 2 && shift == true) { matchStr += "shift_"; } if (item.alt == 1) { matchStr += "alt_"; } else if (item.alt == 2 && alt == true) { matchStr += "alt_"; } if (item.keys) { matchStr += item.keys; } if (m1Str == matchStr) { if (!item.modelType || item.modelType && item.modelType == (onlySelectModel == null ? void 0 : onlySelectModel.baseModelType)) { if (item.times && item.times > 1 && item.interval && item.interval > 0) { if (!DDeiConfig$1.KEY_DOWN_TIMES.has(m1Str)) { DDeiConfig$1.KEY_DOWN_TIMES.set(m1Str, 1); DDeiConfig$1.KEY_DOWN_INTERVAL.set(m1Str, Date.now()); } else { let startTime = DDeiConfig$1.KEY_DOWN_INTERVAL.get(m1Str); let nowTime = Date.now(); let times = DDeiConfig$1.KEY_DOWN_TIMES.get(m1Str); if (nowTime - startTime <= item.interval && times + 1 >= item.times) { item.action.action(evt, ddInstance, editor, item); DDeiConfig$1.KEY_DOWN_TIMES.delete(m1Str); DDeiConfig$1.KEY_DOWN_INTERVAL.delete(m1Str); break; } else { DDeiConfig$1.KEY_DOWN_TIMES.set(m1Str, 1); DDeiConfig$1.KEY_DOWN_INTERVAL.set(m1Str, nowTime); } } } else { let state = item.action.action(evt, ddInstance, editor, item); if (state == void 0 || state === true) { matched = true; if (item.break == true || item.break == 1) { break; } } } } } } return matched; } // ============================ 方法 =============================== /** * 键行为 * @param evt 事件 */ action(evt, ddInstance) { } } var DDeiEditorState = /* @__PURE__ */ ((DDeiEditorState2) => { DDeiEditorState2["DESIGNING"] = "designing"; DDeiEditorState2["PROPERTY_EDITING"] = "property_editing"; DDeiEditorState2["QUICK_EDITING"] = "quick_editing"; DDeiEditorState2["CONTROL_CREATING"] = "control_creating"; DDeiEditorState2["TOOLBOX_ACTIVE"] = "toolbox_active"; DDeiEditorState2["FRAME_CHANGING"] = "frame_changing"; DDeiEditorState2["TOP_MENU_OPERATING"] = "top_menu_operating"; DDeiEditorState2["BOTTOM_MENU_OPERATING"] = "bottom_menu_operating"; return DDeiEditorState2; })(DDeiEditorState || {}); var DDeiActiveType = /* @__PURE__ */ ((DDeiActiveType2) => { DDeiActiveType2[DDeiActiveType2["ACTIVE"] = 1] = "ACTIVE"; DDeiActiveType2[DDeiActiveType2["NONE"] = 0] = "NONE"; return DDeiActiveType2; })(DDeiActiveType || {}); var DDeiFileState = /* @__PURE__ */ ((DDeiFileState2) => { DDeiFileState2[DDeiFileState2["NEW"] = 1] = "NEW"; DDeiFileState2[DDeiFileState2["MODIFY"] = 2] = "MODIFY"; DDeiFileState2[DDeiFileState2["DELETE"] = 3] = "DELETE"; DDeiFileState2[DDeiFileState2["NONE"] = 0] = "NONE"; DDeiFileState2[DDeiFileState2["SAVING"] = 4] = "SAVING"; DDeiFileState2[DDeiFileState2["PUBLISHING"] = 5] = "PUBLISHING"; return DDeiFileState2; })(DDeiFileState || {}); class DDeiSheet { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "name"); __publicField2(this, "desc"); __publicField2(this, "stage"); __publicField2(this, "active"); __publicField2(this, "modelType", "DDeiSheet"); __publicField2(this, "unicode", DDeiUtil$1.getUniqueCode()); this.name = props.name; this.desc = props.desc; this.stage = props.stage; this.active = props.active ? props.active : DDeiActiveType.NONE; } // ============================ 静态变量 ============================ static loadFromJSON(json, tempData = {}) { let sheet = new DDeiSheet(json); let stage2 = DDeiStage.loadFromJSON(sheet.stage, tempData); sheet.stage = stage2; return sheet; } // ============================ 方法 ============================ /** * 计算当前sheet的模型总数量 */ calModelNumber() { var _a3; return (_a3 = this.stage) == null ? void 0 : _a3.calModelNumber(); } /** * 将模型转换为JSON */ toJSON() { let json = new Object(); for (let i2 in this) { if (this[i2] || this[i2] == 0) { if (Array.isArray(this[i2])) { let array = []; this[i2].forEach((element) => { if (element == null ? void 0 : element.toJSON) { array.push(element.toJSON()); } else { array.push(element); } }); json[i2] = array; } else if (this[i2].set && this[i2].has) { let map = {}; this[i2].forEach((element, key) => { if (element == null ? void 0 : element.toJSON) { map[key] = element.toJSON(); } else { map[key] = element; } }); json[i2] = map; } else if (this[i2].toJSON) { json[i2] = this[i2].toJSON(); } else { json[i2] = this[i2]; } } } return json; } } class DDeiFile { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "id"); __publicField2(this, "name"); __publicField2(this, "desc", ""); __publicField2(this, "extData"); __publicField2(this, "busiData"); __publicField2(this, "state"); __publicField2(this, "active"); __publicField2(this, "publish", "0"); __publicField2(this, "lastUpdateTime", (/* @__PURE__ */ new Date()).getTime()); __publicField2(this, "path"); __publicField2(this, "sheets"); __publicField2(this, "currentSheetIndex"); __publicField2(this, "modelType", "DDeiFile"); __publicField2(this, "histroy", []); __publicField2(this, "modelNumber", 0); __publicField2(this, "histroyIdx", -1); __publicField2(this, "unicode", DDeiUtil$1.getUniqueCode()); this.id = props.id; this.name = props.name; this.path = props.path; this.sheets = props.sheets ? props.sheets : []; this.currentSheetIndex = props.currentSheetIndex || props.currentSheetIndex == 0 ? props.currentSheetIndex : -1; this.state = props.state ? props.state : DDeiFileState.NONE; this.active = props.active ? props.active : DDeiActiveType.NONE; this.lastUpdateTime = props.lastUpdateTime ? props.lastUpdateTime : (/* @__PURE__ */ new Date()).getTime(); this.publish = props.publish ? props.publish : "0"; this.desc = props.desc ? props.desc : ""; this.extData = props.extData ? props.extData : {}; this.busiData = props.busiData; this.closeLocalFile = debounce(this.closeLocalFile, 1e3); } // ============================ 静态变量 ============================ static loadFromJSON(json, tempData = {}) { var _a3, _b2, _c2, _d2; let model = new DDeiFile(json); let sheets = []; let dpi; if (DDei.INSTANCE_POOL.size > 0) { dpi = (_a3 = Array.from(DDei.INSTANCE_POOL.values())[0].dpi) == null ? void 0 : _a3.x; } if (!dpi) { dpi = DDeiUtil$1.getDPI().x; } for (let i2 = 0; i2 < model.sheets.length; i2++) { if (!model.sheets[i2].stage.ddInstance && !model.sheets[i2].stage.dpi) { model.sheets[i2].stage.dpi = dpi; } let unit = model.sheets[i2].stage.unit; if (dpi && unit && unit != "px") { (_d2 = (_c2 = (_b2 = model.sheets[i2]) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.layers) == null ? void 0 : _d2.forEach((layer2) => { var _a22; DDeiUtil$1.convertChildrenJsonUnit(layer2, (_a22 = model.sheets[i2]) == null ? void 0 : _a22.stage, unit); }); } sheets[i2] = DDeiSheet.loadFromJSON(model.sheets[i2], tempData); } model.sheets = sheets; model.calModelNumber(); return model; } // ============================ 方法 ============================ /** * 计算当前文件的模型总数量 */ calModelNumber() { let num = 0; this.sheets.forEach((sheet) => { num += sheet.calModelNumber(); }); this.modelNumber = num; return num; } /** * 切换sheet * @param index 下标 */ changeSheet(index) { if (index < 0) { index = 0; } for (let i2 = 0; i2 < this.sheets.length; i2++) { let sheet = this.sheets[i2]; if (i2 != index) { sheet.active = DDeiActiveType.NONE; } else { sheet.active = DDeiActiveType.ACTIVE; this.currentSheetIndex = index; } } } /** * 初始化日志,记录初始化状态 */ initHistroy() { if (this.histroy.length == 0 && this.histroyIdx == -1) { this.histroy.push({ time: (/* @__PURE__ */ new Date()).getTime(), data: JSON.stringify(this.toJSON()) }); this.histroyIdx = 0; } } /** * 记录日志 * @param layerIndex 图层下标 */ addHistroy(data) { if (this.histroyIdx == -1) { this.histroy = this.histroy.slice(0, 1); this.histroyIdx = 0; } else { this.histroy = this.histroy.slice(0, this.histroyIdx + 1); } this.histroy.push({ time: (/* @__PURE__ */ new Date()).getTime(), data }); this.histroyIdx = this.histroy.length - 1; } /** * 返回上一个历史数据,并将下标-1 * @param layerIndex 图层下标 */ revokeHistroyData() { if (this.histroyIdx != -1) { this.histroyIdx--; if (this.histroyIdx == -1) { this.histroyIdx = 0; return this.histroy[0]; } else { return this.histroy[this.histroyIdx]; } } } /** * 撤销上一次撤销并将下标+1 * @param layerIndex 图层下标 */ reRevokeHistroyData() { if (this.histroyIdx < this.histroy.length - 1) { this.histroyIdx++; return this.histroy[this.histroyIdx]; } } /** * 写入本地文件 */ async writeLocalFile(data) { if (!this.writeLocalQueue) { this.writeLocalQueue = []; } if (this.localWriteLock == 1) { this.writeLocalQueue.push(data); } else { if (!this.localFileWriter) { this.localFileWriter = await this.localFileHandler.createWritable(); } await this.localFileWriter.write(data); this.closeLocalFile(); } } async closeLocalFile() { if (this.localFileWriter) { this.localWriteLock = 1; await this.localFileWriter.close(); delete this.localFileWriter; this.localWriteLock = 0; if (this.writeLocalQueue.length > 0) { this.writeLocalFile(this.writeLocalQueue[this.writeLocalQueue.length - 1]); this.writeLocalQueue = []; } } } /** * 将模型转换为JSON */ toJSON() { let json = new Object(); for (let i2 in this) { if (i2 == "active" || i2 == "histroy" || i2 == "histroyIdx" || i2 == "busiData") { continue; } if (this[i2] || this[i2] == 0) { if (Array.isArray(this[i2])) { let array = []; this[i2].forEach((element) => { if (element == null ? void 0 : element.toJSON) { array.push(element.toJSON()); } else { array.push(element); } }); json[i2] = array; } else if (this[i2].set && this[i2].has) { let map = {}; this[i2].forEach((element, key) => { if (element == null ? void 0 : element.toJSON) { map[key] = element.toJSON(); } else { map[key] = element; } }); json[i2] = map; } else if (this[i2].toJSON) { json[i2] = this[i2].toJSON(); } else { json[i2] = this[i2]; } } } json.ddeiVersion = 1243; return json; } /** * 根据属性搜索控件 * @param keywords 关键字/正则表达式 * @param attr 搜索的属性 * @param isReg 是否正则表达式 * @param matchCase 区分大小写 * @param matchAll 全字匹配 */ searchModels(keywords, attr, isReg = false, matchCase = false, matchAll = false) { let resultArray = new Array(); if (keywords && attr) { for (let i2 = 0; i2 < this.sheets.length; i2++) { let rs = this.sheets[i2].stage.searchModels(keywords, attr, isReg, matchCase, matchAll); rs == null ? void 0 : rs.forEach((r) => { r.sheetIndex = i2; resultArray.push(r); }); } } return resultArray; } } const config = { HISTROY_LEVEL: "file", //允许多图层编辑 GLOBAL_ALLOW_OPEN_MULT_LAYERS: true, //允许全局缩放 GLOBAL_ALLOW_STAGE_RATIO: true, //模式标识,模式标识对应以ac_开头的访问权限配置 MODE_NAME: "DESIGN", /** * 全局权限配置,按照配置自动读取规则 * 配置规则:ac_模式_操作_功能项 * 模式标识:可以自定义,模式只是用来区分权限分组,可以全局设置或由组件参数传入 * 操作:create(创建控件)、edit(编辑控件)、view(查看控件)、drag(拖拽控件)、link(建立连线)、del(删除控件)、select(选中控件) * 功能项:ModelType < ModelCode < Code < Id */ AC_DESIGN_CREATE: true, AC_DESIGN_EDIT: true, AC_DESIGN_ROTATE: true, AC_DESIGN_SCALE: true, AC_DESIGN_COMPOSE: true, AC_DESIGN_VIEW: true, AC_DESIGN_DRAG: true, AC_DESIGN_LINK: true, AC_DESIGN_DEL: true, AC_DESIGN_SELECT: true }; const isSupportFontFamily = function(f) { if (typeof f != "string") { return false; } let h = "Arial"; if (f.toLowerCase() == h.toLowerCase()) { return true; } let e = "a"; let d = 100; let a = 100, i2 = 100; let c = document.createElement("canvas"); let b = c.getContext("2d", { willReadFrequently: true }); c.width = a; c.height = i2; b.textAlign = "center"; b.fillStyle = "black"; b.textBaseline = "middle"; let g = function(j2) { b.clearRect(0, 0, a, i2); b.font = d + "px " + j2 + ", " + h; b.fillText(e, a / 2, i2 / 2); let k = b.getImageData(0, 0, a, i2).data; return [].slice.call(k).filter(function(l) { return l != 0; }); }; return g(h).join("") !== g(f).join(""); }; const isSupportFontFamilySync = function(f) { return new Promise((resolve, rejected) => { resolve(isSupportFontFamily(f)); }); }; const fontTypes = { windows: [ { ch: "Arial", en: "Arial" }, { ch: "Helvetica", en: "Helvetica" }, { ch: "Arial Black", en: "Arial Black" }, { ch: "Calibri", en: "Calibri" }, { ch: "Constantia", en: "Constantia" }, { ch: "Frutiger", en: "Frutiger" }, { ch: "Futura", en: "Futura" }, { ch: "Corbel", en: "Corbel" }, { ch: "Roboto", en: "Roboto" }, { ch: "Montserrat", en: "Montserrat" }, { ch: "Bebas Neue", en: "Bebas Neue" }, { ch: "Monument Extended", en: "Monument Extended" }, { ch: "D-DIN", en: "D-DIN" }, { ch: "宋体", en: "SimSun" }, { ch: "黑体", en: "SimHei" }, { ch: "微软雅黑", en: "Microsoft Yahei" }, { ch: "微软正黑体", en: "Microsoft JhengHei" }, { ch: "楷体", en: "KaiTi" }, { ch: "新宋体", en: "NSimSun" }, { ch: "仿宋", en: "FangSong" } ], "OS X": [{ ch: "苹方", en: "PingFang SC" }, { ch: "华文黑体", en: "STHeiti" }, { ch: "华文楷体", en: "STKaiti" }, { ch: "华文中宋", en: "STZhongsong" }, { ch: "华文琥珀", en: "STHupo" }, { ch: "华文新魏", en: "STXinwei" }, { ch: "华文隶书", en: "STLiti" }, { ch: "华文行楷", en: "STXingkai" }, { ch: "冬青黑体简", en: "Hiragino Sans GB" }, { ch: "兰亭黑-简", en: "Lantinghei SC" }, { ch: "翩翩体-简", en: "Hanzipen SC" }, { ch: "手札体-简", en: "Hannotate SC" }, { ch: "宋体-简", en: "Songti SC" }, { ch: "娃娃体-简", en: "Wawati SC" }, { ch: "魏碑-简", en: "Weibei SC" }, { ch: "行楷-简", en: "Xingkai SC" }, { ch: "雅痞-简", en: "Yapi SC" }, { ch: "圆体-简", en: "Yuanti SC" }], "office": [{ ch: "幼圆", en: "YouYuan" }, { ch: "隶书", en: "LiSu" }, { ch: "华文细黑", en: "STXihei" }, { ch: "华文宋体", en: "STSong" }, { ch: "华文仿宋", en: "STFangsong" }, { ch: "华文中宋", en: "STZhongsong" }, { ch: "华文彩云", en: "STCaiyun" }, { ch: "华文琥珀", en: "STHupo" }, { ch: "华文新魏", en: "STXinwei" }, { ch: "华文隶书", en: "STLiti" }, { ch: "华文行楷", en: "STXingkai" }, { ch: "方正舒体", en: "FZShuTi" }, { ch: "方正姚体", en: "FZYaoti" }], "open": [{ ch: "思源黑体", en: "Source Han Sans CN" }, { ch: "思源宋体", en: "Source Han Serif SC" }, { ch: "文泉驿微米黑", en: "WenQuanYi Micro Hei" }], "hanyi": [{ ch: "汉仪旗黑", en: "HYQihei 40S" }, { ch: "汉仪旗黑", en: "HYQihei 50S" }, { ch: "汉仪旗黑", en: "HYQihei 60S" }, { ch: "汉仪大宋简", en: "HYDaSongJ" }, { ch: "汉仪楷体", en: "HYKaiti" }, { ch: "汉仪家书简", en: "HYJiaShuJ" }, { ch: "汉仪PP体简", en: "HYPPTiJ" }, { ch: "汉仪乐喵体简", en: "HYLeMiaoTi" }, { ch: "汉仪小麦体", en: "HYXiaoMaiTiJ" }, { ch: "汉仪程行体", en: "HYChengXingJ" }, { ch: "汉仪黑荔枝", en: "HYHeiLiZhiTiJ" }, { ch: "汉仪雅酷黑W", en: "HYYaKuHeiW" }, { ch: "汉仪大黑简", en: "HYDaHeiJ" }, { ch: "汉仪尚魏手书W", en: "HYShangWeiShouShuW" }], "fangzheng": [{ "ch": "方正粗雅宋简体", "en": "FZYaSongS-B-GB" }, { "ch": "方正报宋简体", "en": "FZBaoSong-Z04S" }, { "ch": "方正粗圆简体", "en": "FZCuYuan-M03S" }, { "ch": "方正大标宋简体", "en": "FZDaBiaoSong-B06S" }, { "ch": "方正大黑简体", "en": "FZDaHei-B02S" }, { "ch": "方正仿宋简体", "en": "FZFangSong-Z02S" }, { "ch": "方正黑体简体", "en": "FZHei-B01S" }, { "ch": "方正琥珀简体", "en": "FZHuPo-M04S" }, { "ch": "方正楷体简体", "en": "FZKai-Z03S" }, { "ch": "方正隶变简体", "en": "FZLiBian-S02S" }, { "ch": "方正隶书简体", "en": "FZLiShu-S01S" }, { "ch": "方正美黑简体", "en": "FZMeiHei-M07S" }, { "ch": "方正书宋简体", "en": "FZShuSong-Z01S" }, { "ch": "方正舒体简体", "en": "FZShuTi-S05S" }, { "ch": "方正水柱简体", "en": "FZShuiZhu-M08S" }, { "ch": "方正宋黑简体", "en": "FZSongHei-B07S" }, { "ch": "方正宋三简体", "en": "FZSong" }, { "ch": "方正魏碑简体", "en": "FZWeiBei-S03S" }, { "ch": "方正细等线简体", "en": "FZXiDengXian-Z06S" }, { "ch": "方正细黑一简体", "en": "FZXiHei I-Z08S" }, { "ch": "方正细圆简体", "en": "FZXiYuan-M01S" }, { "ch": "方正小标宋简体", "en": "FZXiaoBiaoSong-B05S" }, { "ch": "方正行楷简体", "en": "FZXingKai-S04S" }, { "ch": "方正姚体简体", "en": "FZYaoTi-M06S" }, { "ch": "方正中等线简体", "en": "FZZhongDengXian-Z07S" }, { "ch": "方正准圆简体", "en": "FZZhunYuan-M02S" }, { "ch": "方正综艺简体", "en": "FZZongYi-M05S" }, { "ch": "方正彩云简体", "en": "FZCaiYun-M09S" }, { "ch": "方正隶二简体", "en": "FZLiShu II-S06S" }, { "ch": "方正康体简体", "en": "FZKangTi-S07S" }, { "ch": "方正超粗黑简体", "en": "FZChaoCuHei-M10S" }, { "ch": "方正新报宋简体", "en": "FZNew BaoSong-Z12S" }, { "ch": "方正新舒体简体", "en": "FZNew ShuTi-S08S" }, { "ch": "方正黄草简体", "en": "FZHuangCao-S09S" }, { "ch": "方正少儿简体", "en": "FZShaoEr-M11S" }, { "ch": "方正稚艺简体", "en": "FZZhiYi-M12S" }, { "ch": "方正细珊瑚简体", "en": "FZXiShanHu-M13S" }, { "ch": "方正粗宋简体", "en": "FZCuSong-B09S" }, { "ch": "方正平和简体", "en": "FZPingHe-S11S" }, { "ch": "方正华隶简体", "en": "FZHuaLi-M14S" }, { "ch": "方正瘦金书简体", "en": "FZShouJinShu-S10S" }, { "ch": "方正细倩简体", "en": "FZXiQian-M15S" }, { "ch": "方正中倩简体", "en": "FZZhongQian-M16S" }, { "ch": "方正粗倩简体", "en": "FZCuQian-M17S" }, { "ch": "方正胖娃简体", "en": "FZPangWa-M18S" }, { "ch": "方正宋一简体", "en": "FZSongYi-Z13S" }, { "ch": "方正剪纸简体", "en": "FZJianZhi-M23S" }, { "ch": "方正流行体简体", "en": "FZLiuXingTi-M26S" }, { "ch": "方正祥隶简体", "en": "FZXiangLi-S17S" }, { "ch": "方正粗活意简体", "en": "FZCuHuoYi-M25S" }, { "ch": "方正胖头鱼简体", "en": "FZPangTouYu-M24S" }, { "ch": "方正卡通简体", "en": "FZKaTong-M19S" }, { "ch": "方正艺黑简体", "en": "FZYiHei-M20S" }, { "ch": "方正水黑简体", "en": "FZShuiHei-M21S" }, { "ch": "方正古隶简体", "en": "FZGuLi-S12S" }, { "ch": "方正幼线简体", "en": "FZYouXian-Z09S" }, { "ch": "方正启体简体", "en": "FZQiTi-S14S" }, { "ch": "方正小篆体", "en": "FZXiaoZhuanTi-S13T" }, { "ch": "方正硬笔楷书简体", "en": "FZYingBiKaiShu-S15S" }, { "ch": "方正毡笔黑简体", "en": "FZZhanBiHei-M22S" }, { "ch": "方正硬笔行书简体", "en": "FZYingBiXingShu-S16S" }] }; const rootFontFamily = (document.documentElement.currentStyle ? document.documentElement.currentStyle : window.getComputedStyle(document.documentElement)).fontFamily; const FONTS = []; const loadFonts = function() { let fontData = null; let fontJSON = localStorage.getItem("DDEI-CACHE-FONT"); if (fontJSON) { fontData = JSON.parse(fontJSON); fontData.forEach((fd) => { FONTS.push(fd); }); } if (FONTS.length == 0) { for (let key in fontTypes) { let fontType = fontTypes[key]; fontType.forEach((font) => { let fontEn = font.en, fontCh = font.ch; isSupportFontFamilySync(fontEn).then((support) => { if (support) { if (fontEn.toLowerCase() === rootFontFamily.toLowerCase() || ('"' + fontEn + '"').toLowerCase() === rootFontFamily.toLowerCase() || fontCh.toLowerCase() === rootFontFamily.toLowerCase() || ('"' + fontCh + '"').toLowerCase() === rootFontFamily.toLowerCase()) { font.isSystemDefault = true; } FONTS.push(font); localStorage.setItem("DDEI-CACHE-FONT", JSON.stringify(FONTS)); } }); }); } } }; setTimeout(() => { loadFonts(); }, 500); class DDeiFuncData { constructor(name, sort, func) { __publicField2(this, "name", ""); __publicField2(this, "sort", null); __publicField2(this, "func", null); if (name) { this.name = name; } if (sort) { this.sort = sort; } if (func) { this.func = func; } } } var DDeiEditorEnumBusCommandType = /* @__PURE__ */ ((DDeiEditorEnumBusCommandType2) => { DDeiEditorEnumBusCommandType2["ClearTemplateUI"] = "clear-template-ui"; DDeiEditorEnumBusCommandType2["RefreshEditorParts"] = "refresh-editor-parts"; DDeiEditorEnumBusCommandType2["FileDirty"] = "file-dirty"; DDeiEditorEnumBusCommandType2["SaveFile"] = "save-file"; DDeiEditorEnumBusCommandType2["LoadFile"] = "load-file"; DDeiEditorEnumBusCommandType2["AddFileHistroy"] = "add-file-histroy"; DDeiEditorEnumBusCommandType2["ChangeEditMode"] = "editor-change-edit-mode"; return DDeiEditorEnumBusCommandType2; })(DDeiEditorEnumBusCommandType || {}); const _DDeiEditor = class _DDeiEditor2 { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "theme", null); __publicField2(this, "GLOBAL_LOCAL_CACHE_THEME", true); __publicField2(this, "GLOBAL_KEYBOARD_ALIGN_ENABLE", true); __publicField2(this, "GLOBAL_ALLOW_OPEN_MULT_LAYERS", true); __publicField2(this, "EVENT_LOAD_FILE", null); __publicField2(this, "EVENT_SAVE_FILE", null); __publicField2(this, "EVENT_PUBLISH_FILE", null); __publicField2(this, "EVENT_CONTROL_SELECT_BEFORE", null); __publicField2(this, "EVENT_CONTROL_SELECT_AFTER", null); __publicField2(this, "EVENT_STAGE_CHANGE_WPV", null); __publicField2(this, "EVENT_STAGE_CHANGE_RATIO", null); __publicField2(this, "GLOBAL_ALLOW_BACK_ACTIVE", false); __publicField2(this, "id"); __publicField2(this, "containerid"); __publicField2(this, "files"); __publicField2(this, "currentFileIndex"); __publicField2(this, "state"); __publicField2(this, "modelType", "DDeiEditor"); __publicField2(this, "ddInstance", null); __publicField2(this, "leftWidth", 0); __publicField2(this, "topHeight", 0); __publicField2(this, "rightWidth", 0); __publicField2(this, "bottomHeight", 0); __publicField2(this, "middleWidth", 0); __publicField2(this, "middleHeight", 0); __publicField2(this, "bus", null); __publicField2(this, "setCurrentMenu", null); __publicField2(this, "editMode", 1); __publicField2(this, "components", vue.markRaw({})); __publicField2(this, "propeditors", vue.markRaw({})); __publicField2(this, "panels", vue.markRaw({})); __publicField2(this, "langs", vue.markRaw({})); __publicField2(this, "lang", null); __publicField2(this, "layouts", vue.markRaw({})); __publicField2(this, "dialogs", vue.markRaw({})); __publicField2(this, "hotkeys", vue.markRaw({})); __publicField2(this, "hotKeyMapping", vue.markRaw([])); __publicField2(this, "menus", vue.markRaw({})); __publicField2(this, "fonts", FONTS); __publicField2(this, "viewerMap", vue.markRaw(/* @__PURE__ */ new Map())); __publicField2(this, "menuMapping", vue.markRaw({})); __publicField2(this, "controls", vue.markRaw(/* @__PURE__ */ new Map())); __publicField2(this, "groups", vue.markRaw([])); __publicField2(this, "controlModelClasses", vue.markRaw({})); __publicField2(this, "controlViewClasses", vue.markRaw({})); __publicField2(this, "themes", vue.markRaw([])); __publicField2(this, "currentTheme", ""); __publicField2(this, "currentLayout", "ddei-core-layout-standard"); __publicField2(this, "converters", vue.markRaw({})); __publicField2(this, "lifecyclies", vue.markRaw([])); __publicField2(this, "funcIndex", /* @__PURE__ */ new Map()); this.id = props.id; this.containerid = props.containerid; this.files = props.files ? props.files : []; this.currentFileIndex = props.currentFileIndex ? props.currentFileIndex : -1; this.state = DDeiEditorState.DESIGNING; if (props.currentLayout) { this.currentLayout = props.currentLayout; } } // ============================ 静态方法 ============================ /** * 给予container构建一个DDei实例 * 每一个DDei至少包含1个文件 * @param {id} id 文件id * @param {containerid} containerid 容器id * @param {active} active 是否设置为活动实例,缺省是 */ static newInstance(id, containerid, active = true, options = {}) { var _a3, _b2, _c2, _d2; if (id && containerid) { if (!_DDeiEditor2.INSTANCE_POOL.get(id)) { let editorInitOptions = clone(options); editorInitOptions.id = id; editorInitOptions.containerid = containerid; (_a3 = editorInitOptions.extensions) == null ? void 0 : _a3.sort((a, b) => { return a.order - b.order; }); for (let i2 = 0; i2 < ((_b2 = editorInitOptions.extensions) == null ? void 0 : _b2.length); i2++) { if (editorInitOptions.extensions[i2].getInitConfig) { let initConfigData = editorInitOptions.extensions[i2].getInitConfig(); if (initConfigData) { _DDeiEditor2.changeInitConfigData(editorInitOptions, initConfigData); } } } let editorInstance2 = new _DDeiEditor2(editorInitOptions); if (!DDeiUtil$1.getAttrValueByConfig) { DDeiUtil$1.getAttrValueByConfig = DDeiEditorUtil$1.getAttrValueByConfig; } if (!DDeiUtil$1.getControlDefine) { DDeiUtil$1.getControlDefine = DDeiEditorUtil$1.getControlDefine; } if (!DDeiUtil$1.getMenuConfig) { DDeiUtil$1.getMenuConfig = DDeiEditorUtil$1.getMenuConfig; } if (!DDeiUtil$1.getMenuControlId) { DDeiUtil$1.getMenuControlId = DDeiEditorUtil$1.getMenuControlId; } if (!DDeiUtil$1.showContextMenu) { DDeiUtil$1.showContextMenu = DDeiEditorUtil$1.showContextMenu; } if (!DDeiUtil$1.getSubControlJSON) { DDeiUtil$1.getSubControlJSON = DDeiEditorUtil$1.getSubControlJSON; } if (!DDeiUtil$1.getLineInitJSON) { DDeiUtil$1.getLineInitJSON = DDeiEditorUtil$1.getLineInitJSON; } if (!DDeiUtil$1.getModelInitJSON) { DDeiUtil$1.getModelInitJSON = DDeiEditorUtil$1.getModelInitJSON; } if (!DDeiUtil$1.getBusiData) { DDeiUtil$1.getBusiData = DDeiEditorUtil$1.getBusiData; } if (!DDeiUtil$1.getEditorText) { DDeiUtil$1.getEditorText = DDeiEditorUtil$1.getEditorText; } if (!DDeiUtil$1.getStyleValue) { DDeiUtil$1.getStyleValue = DDeiEditorUtil$1.getStyleValue; } if (!DDeiUtil$1.getEditorId) { DDeiUtil$1.getEditorId = DDeiEditorUtil$1.getEditorId; } if (!DDeiUtil$1.invokeCallbackFunc) { DDeiUtil$1.invokeCallbackFunc = DDeiEditorUtil$1.invokeCallbackFunc; } if (!DDeiUtil$1.notifyChange) { DDeiUtil$1.notifyChange = DDeiEditorUtil$1.notifyChange; } if (!DDeiUtil$1.isBackActive) { DDeiUtil$1.isBackActive = DDeiEditorUtil$1.isBackActive; } if (!DDeiUtil$1.getEditorInsByDDei) { DDeiUtil$1.getEditorInsByDDei = DDeiEditorUtil$1.getEditorInsByDDei; } if (!DDeiUtil$1.createControl) { DDeiUtil$1.createControl = DDeiEditorUtil$1.createControl; } _DDeiEditor2.INSTANCE_POOL.set(id, editorInstance2); if (active) { _DDeiEditor2.ACTIVE_INSTANCE = editorInstance2; } let ddInstance = DDei.newInstance( editorInstance2.id, editorInstance2.id + "_canvas", null, editorInstance2 ); ddInstance.bus.invoker = editorInstance2; editorInstance2.bus = ddInstance.bus; ddInstance.controlModelClasses = editorInstance2.controlModelClasses; ddInstance.controlViewClasses = editorInstance2.controlViewClasses; let control_ctx2 = /* @__PURE__ */ Object.assign({ "../../framework/js/models/circle.ts": __vite_glob_0_0$2$1, "../../framework/js/models/diamond.ts": __vite_glob_0_1$2$1, "../../framework/js/models/layer.ts": __vite_glob_0_2$2, "../../framework/js/models/line.ts": __vite_glob_0_3$3, "../../framework/js/models/link.ts": __vite_glob_0_4$2, "../../framework/js/models/modellink.ts": __vite_glob_0_5$2, "../../framework/js/models/polygon-container.ts": __vite_glob_0_6$2, "../../framework/js/models/polygon.ts": __vite_glob_0_7$1$1, "../../framework/js/models/rectangle.ts": __vite_glob_0_8$1$1, "../../framework/js/models/selector.ts": __vite_glob_0_9$1$1, "../../framework/js/models/shape.ts": __vite_glob_0_10$1$1, "../../framework/js/models/stage.ts": __vite_glob_0_11$1$1, "../../framework/js/models/table-cell.ts": __vite_glob_0_12$1$1, "../../framework/js/models/table-selector.ts": __vite_glob_0_13$1$1, "../../framework/js/models/table.ts": __vite_glob_0_14$1$1 }); for (let path in control_ctx2) { let cls = control_ctx2[path].default; if (cls == null ? void 0 : cls.ClsName) { editorInstance2.controlModelClasses[cls.ClsName] = cls; } } let view_ctx = /* @__PURE__ */ Object.assign({ "../../framework/js/views/canvas/circle-render.ts": __vite_glob_1_0$2, "../../framework/js/views/canvas/ddei-render.ts": __vite_glob_1_1$2, "../../framework/js/views/canvas/diamond-render.ts": __vite_glob_1_2$2, "../../framework/js/views/canvas/layer-render.ts": __vite_glob_1_3$1, "../../framework/js/views/canvas/line-render.ts": __vite_glob_1_4$1, "../../framework/js/views/canvas/polygon-container-render.ts": __vite_glob_1_5$1, "../../framework/js/views/canvas/polygon-render.ts": __vite_glob_1_6$1, "../../framework/js/views/canvas/rectangle-render.ts": __vite_glob_1_7$1, "../../framework/js/views/canvas/selector-render.ts": __vite_glob_1_8, "../../framework/js/views/canvas/shape-render-base.ts": __vite_glob_1_9, "../../framework/js/views/canvas/stage-render.ts": __vite_glob_1_10, "../../framework/js/views/canvas/table-cell-render.ts": __vite_glob_1_11, "../../framework/js/views/canvas/table-render.ts": __vite_glob_1_12, "../../framework/js/views/canvas/table-selector-render.ts": __vite_glob_1_13 }); for (let path in view_ctx) { let cls = view_ctx[path].default; if (cls == null ? void 0 : cls.ClsName) { editorInstance2.controlViewClasses[cls.ClsName] = cls; } } if (options) { editorInstance2.options = editorInitOptions; (_c2 = options.extensions) == null ? void 0 : _c2.forEach((item) => editorInstance2.registerExtension(item)); for (let i2 in editorInstance2.hotkeys) { let hotkey = editorInstance2.hotkeys[i2]; let options2 = hotkey.getOptions(); if (options2 == null ? void 0 : options2.keys) { let keys2 = cloneDeep(options2 == null ? void 0 : options2.keys); keys2.forEach((key) => { key.action = hotkey; }); editorInstance2.hotKeyMapping = editorInstance2.hotKeyMapping.concat(keys2); } } editorInstance2.hotKeyMapping.sort((a, b) => { if (a.times && b.times) { return 0; } else if (a.times && !b.times) { return -1; } else if (!a.times && b.times) { return 1; } else if (!a.times && !b.times) { return 0; } }); for (let i2 in editorInstance2.menus) { let menu = editorInstance2.menus[i2]; let options2 = menu.getOptions(); menu.label = options2.label ? options2.label : ""; menu.icon = options2.icon ? options2.icon : ""; menu.disabled = options2.disabled ? options2.disabled : false; (_d2 = options2 == null ? void 0 : options2.models) == null ? void 0 : _d2.forEach((model) => { if (!editorInstance2.menuMapping[model]) { editorInstance2.menuMapping[model] = []; } let menus2 = editorInstance2.menuMapping[model]; let finded = false; for (let j2 = 0; j2 < menus2.length; j2++) { if (menu.name == menus2[j2].name) { finded = true; break; } } if (!finded) { menus2.push(menu); } }); } editorInstance2.lifecyclies.forEach((lifeCycle) => { for (let i2 in lifeCycle) { if (lifeCycle[i2] && lifeCycle[i2] instanceof DDeiFuncData) { if (!editorInstance2.funcIndex.has(i2)) { editorInstance2.funcIndex.set(i2, []); } let funcArray = editorInstance2.funcIndex.get(i2); funcArray == null ? void 0 : funcArray.push(lifeCycle[i2]); } } }); editorInstance2.funcIndex.forEach((funcArr) => { funcArr.sort((a, b) => { if (a.sort && b.sort) { return a.sort - b.sort; } else if (a.sort && !b.sort) { return 1; } else if (!a.sort && b.sort) { return -1; } else if (!a.sort && !b.sort) { return 0; } }); }); } return editorInstance2; } else { return _DDeiEditor2.INSTANCE_POOL.get(id); } } return null; } /** * 修改初始化数据,有append,rewrite,remove三种 * @param editor * @param config * @param initConfigData */ static changeInitConfigData(config2, initConfigData) { var _a3, _b2; if (initConfigData.remove) { (_a3 = initConfigData.remove.extensions) == null ? void 0 : _a3.forEach((ext) => { var _a22; let findedNi = -1; for (let ni = 0; ni < ((_a22 = config2.extensions) == null ? void 0 : _a22.length); ni++) { let existsExt = config2.extensions[ni]; if (existsExt == ext || existsExt.name == ext.name || existsExt && ext && existsExt.name == ext || ext && existsExt && existsExt == ext.name) { findedNi = ni; break; } } if (findedNi != -1) { config2.extensions.splice(findedNi, 1); } }); } if (initConfigData.append) { if (!config2.extensions) { config2.extensions = []; } (_b2 = initConfigData.append.extensions) == null ? void 0 : _b2.forEach((ext) => { var _a22; let finded = false; for (let ni = 0; ni < ((_a22 = config2.extensions) == null ? void 0 : _a22.length); ni++) { let existsExt = config2.extensions[ni]; if (existsExt == ext || existsExt.name == ext.name || existsExt && ext && existsExt.name == ext || ext && existsExt && existsExt == ext.name) { finded = true; break; } } if (!finded) { config2.extensions.push(ext); } }); } if (initConfigData.rewrite) { for (let k in initConfigData.rewrite) { if (k != "config") { config2[k] = initConfigData.rewrite[k]; } } if (initConfigData.rewrite.config) { for (let k in initConfigData.rewrite.config) { if (!config2.config) { config2.config = {}; } config2.config[k] = initConfigData.rewrite.config[k]; } } } } /** * 将语言包添加进当前editor * @param langs 语言包 */ registerLangs(langs) { if (langs) { for (let n in langs) { if (!this.langs[n]) { this.langs[n] = langs[n]; } else { this.langs[n] = defaultsDeep$1({}, langs[n], this.langs[n]); } } } } setI18nLang(language) { if (!language) { language = navigator.language || navigator.userLanguage; } if (!language) { language = "zh_CN"; } else { language = language.replace("-", "_"); } if (!this.langs[language]) { this.lang = "zh_CN"; } else { this.lang = language; } } i18n(path) { let lang = this.langs[this.lang]; let value = DDeiUtil$1.getDataByPathList(lang, path); if (value) { return value; } else { return path; } } /** * 注册外部插件 */ registerExtension(plugin) { if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { plugin = plugin.defaultIns; } if (plugin.getLangs) { let langs = plugin.getLangs(this); this.registerLangs(langs); } if (plugin.getComponents) { let components = plugin.getComponents(this); components == null ? void 0 : components.forEach((component) => { this.panels[component.name] = component; }); } if (plugin.getDialogs) { let dialogs = plugin.getDialogs(this); dialogs == null ? void 0 : dialogs.forEach((dialog) => { this.dialogs[dialog.name] = cloneDeep(dialog); }); } if (plugin.getPanels) { let panels = plugin.getPanels(this); panels == null ? void 0 : panels.forEach((panel) => { this.panels[panel.name] = panel; }); } if (plugin.getLayouts) { let layouts = plugin.getLayouts(this); layouts == null ? void 0 : layouts.forEach((layout) => { this.layouts[layout.name] = layout; }); } if (plugin.getPropEditors) { let propEditors = plugin.getPropEditors(this); propEditors == null ? void 0 : propEditors.forEach((propEditor) => { this.propeditors[propEditor.name] = propEditor; }); } if (plugin.getHotKeys) { let hotKeys = plugin.getHotKeys(this); hotKeys == null ? void 0 : hotKeys.forEach((hotkey) => { this.hotkeys[hotkey.name] = hotkey; }); } if (plugin.getFonts) { let fonts = plugin.getFonts(this); fonts == null ? void 0 : fonts.forEach((font) => { this.fonts.push(font); let fontObj = new FontFace(font.ch, "url(" + font.font + ")"); fontObj.load().then((f) => { document.fonts.add(f); }); }); } if (plugin.getThemes) { let themes = plugin.getThemes(this); themes == null ? void 0 : themes.forEach((theme) => { var _a3; let finded = false; for (let i2 = 0; i2 < ((_a3 = this.themes) == null ? void 0 : _a3.length); i2++) { if (this.themes[i2].name == theme.name) { finded = true; this.themes[i2] = theme; break; } } if (!finded) { this.themes.push(theme); } }); } if (plugin.getMenus) { let menus2 = plugin.getMenus(this); menus2 == null ? void 0 : menus2.forEach((menu) => { this.menus[menu.name] = menu; }); } if (plugin.getControls) { let controls2 = plugin.getControls(this); controls2 == null ? void 0 : controls2.forEach((control) => { this.controls.set(control.id, control); }); } if (plugin.getGroups) { let groups = plugin.getGroups(this); groups == null ? void 0 : groups.forEach((group2) => { let finded = false; for (let i2 = 0; i2 < this.groups.length; i2++) { if (this.groups[i2].id == group2.id) { this.groups[i2] = group2; finded = true; break; } } if (!finded) { this.groups.push(group2); } }); } if (plugin.getModels) { let models = plugin.getModels(this); models == null ? void 0 : models.forEach((model) => { this.controlModelClasses[model.ClsName] = model; }); } if (plugin.getViews) { let views = plugin.getViews(this); views == null ? void 0 : views.forEach((view) => { this.controlViewClasses[view.ClsName] = view; }); } if (plugin.getConverters) { let converters = plugin.getConverters(this); converters == null ? void 0 : converters.forEach((converter) => { this.converters[converter.name] = converter; }); } if (plugin.getLifeCyclies) { let lifeCyclies = plugin.getLifeCyclies(this); lifeCyclies == null ? void 0 : lifeCyclies.forEach((lifeCycle) => { this.lifecyclies.push(lifeCycle); }); } if (plugin.installed) { plugin.installed(this); } let options = null; if (plugin.getOptions) { options = plugin.getOptions(); } if (options) { let pluginType = plugin.getType(); if (pluginType == "plugin") { let pluginName = plugin.getName(); if (pluginName) { this.options[pluginName] = options; } } else if (pluginType == "package") { this.options = Object.assign({}, this.options, options); } } } /** * 应用外部配置文件 * @param custConfig */ applyConfig(custConfig) { if (config) { for (let i2 in config) { this[i2] = config[i2]; } if (this.ddInstance) { this.ddInstance.applyConfig(config); } } if (custConfig) { for (let i2 in custConfig) { this[i2] = custConfig[i2]; } if (this.ddInstance) { this.ddInstance.applyConfig(custConfig); } } } // ============================ 方法 ============================ /** * 修改当前编辑模式 * @param mode 编辑模式 */ changeEditMode(mode) { if (this.editMode != mode) { this.editMode = mode; } } /** * 加载文件到设计器中 * @param fileJson 文件json * @param append 是否添加 */ loadData(fileJson, append = false) { var _a3; if (fileJson) { if (typeof fileJson == "string") { fileJson = JSON.parse(fileJson); } let json = fileJson; let file; if (json == null ? void 0 : json.content) { file = DDeiFile.loadFromJSON(json.content, { currentDdInstance: this.ddInstance }); file.id = json.id; file.publish = json.publish; file.name = json.name; file.path = json.path; file.desc = json.desc; file.version = json.version; file.extData = json.extData; file.busiData = json.busiData; } else { file = DDeiFile.loadFromJSON(json, { currentDdInstance: this.ddInstance }); } file.state = DDeiFileState.NONE; if (append) { this.addFile(file); this.files.forEach((f) => { f.active = DDeiActiveType.NONE; }); this.currentFileIndex = this.files.indexOf(file); } else { this.files[this.currentFileIndex] = file; } if (file && ((_a3 = file.sheets) == null ? void 0 : _a3.length) > 0) { file.active = DDeiActiveType.ACTIVE; let sheets = file == null ? void 0 : file.sheets; file.changeSheet(file.currentSheetIndex); let stage2 = sheets[file.currentSheetIndex].stage; stage2.ddInstance = this.ddInstance; file.initHistroy(); this.ddInstance.stage = stage2; stage2.initRender(); } this.notifyChange(); } } /** * 添加文件到列表中,默认添加到最后面 */ addFile(file, index = null) { if (index || index == 0) { this.files.splice(index, 0, file); } else { this.files.push(file); } } /** * 移除文件 */ removeFile(file, index) { if (file) { if (this.files.indexOf(file) != -1) { this.files.splice(this.files.indexOf(file), 1); } } else if (index || index == 0) { this.files.splice(index, 1); } } /** * 交换文件的位置 */ exchangeFile(indexA, indexB) { let fileA = this.files[indexA]; let fileB = this.files[indexB]; this.files[indexA] = fileB; this.files[indexB] = fileA; } // ============================ 事件 ============================ /** * 绑定事件 */ bindEvent() { window.removeEventListener("blur", this.blur); document.removeEventListener("keydown", this.keyDown); document.removeEventListener("keyup", this.keyUp); document.addEventListener("keydown", this.keyDown); document.addEventListener("keyup", this.keyUp); window.addEventListener("blur", this.blur); } /** * 改变编辑器状态 * @param state 新状态 */ changeState(state) { if (this.state != state) { this.state = state; } } /** * 键盘按下 */ keyDown(evt) { var _a3; let isActive = false; if (((_a3 = document.activeElement) == null ? void 0 : _a3.tagName) == "BODY") { isActive = true; } else { isActive = DDeiEditorUtil$1.isEditorSubElement(document.activeElement, _DDeiEditor2.ACTIVE_INSTANCE); } if (isActive && DDeiKeyAction.route(evt)) { evt.preventDefault(); } } /** * 键盘弹起 */ keyUp(evt) { var _a3; let isActive = false; if (((_a3 = document.activeElement) == null ? void 0 : _a3.tagName) == "BODY") { isActive = true; } else { isActive = DDeiEditorUtil$1.isEditorSubElement(document.activeElement, this); } if (isActive) { DDeiKeyAction.updateKeyState(evt); } } /** * 失去焦点 */ blur() { var _a3; DDei.KEY_DOWN_STATE.clear(); if ((_a3 = this.ddInstance) == null ? void 0 : _a3.render) { this.ddInstance.render.inEdge = 0; } } /** * 获取属性编辑器 */ getPropEditor(controlType) { if (controlType && this.propeditors && this.propeditors["pv-" + controlType]) { return this.propeditors["pv-" + controlType]; } } /** * 获取布局 */ getLayout() { return this.layouts[this.currentLayout]; } /** * 获取布局选项 */ getLayoutOptions() { return this.options[this.currentLayout]; } /** * 返回所有弹出框以及选项 */ getDialogs() { let returnArray = []; for (let i2 in this.dialogs) { let dialog = this.dialogs[i2]; if (dialog) { let dialogOption = this.options[i2]; let options = null; if (typeof dialogOption == "string") { options = this.options[dialogOption]; } else if (dialogOption == null ? void 0 : dialogOption.getName) { options = dialogOption.getOptions(); } else { options = dialogOption; } returnArray.push({ dialog, options }); } } return returnArray; } /** * 获取options中的各个部分的配置 */ getPartPanels(options, part) { let partOption = null; if (options && options[part]) { if (options[part]) { partOption = options[part]; } } if (partOption && this.panels) { let returnArray = []; partOption.forEach((poption) => { if (typeof poption == "string") { if (this.panels[poption]) { let comp = this.panels[poption]; let opts = this.options[poption]; returnArray.push({ comp, options: opts }); } } else if (poption instanceof DDeiPluginBase) { let name = poption.getName(); if (this.panels[name]) { let comp = this.panels[name]; let opts = poption.getOptions(); returnArray.push({ comp, options: opts }); } } else if (DDeiPluginBase.isSubclass(poption, DDeiPluginBase)) { let name = poption.defaultIns.getName(); if (this.panels[name]) { let comp = this.panels[name]; let opts = poption.defaultIns.getOptions(); returnArray.push({ comp, options: opts }); } } }); return returnArray; } } /** * 获取开启的转换器 * fileData 文件内容 */ getEnabledConverters(fileData, sort = 1) { let returnArray = []; for (let i2 in this.converters) { let converter = this.converters[i2]; if (converter.isEnable(fileData)) { returnArray.push(converter); } } if (sort == 1) { returnArray.sort((c1, c2) => { if (c1.sort && c2.sort) { return (c1 == null ? void 0 : c1.sort) - (c2 == null ? void 0 : c2.sort); } else if (c1.sort && !c2.sort) { return 1; } else if (!c1.sort && c2.sort) { return -1; } else { return 0; } }); } else { returnArray.sort((c1, c2) => { if (c1.sort && c2.sort) { return (c2 == null ? void 0 : c2.sort) - (c1 == null ? void 0 : c1.sort); } else if (c1.sort && !c2.sort) { return -1; } else if (!c1.sort && c2.sort) { return 1; } else { return 0; } }); } return returnArray; } /** * 设置当前主题 * @param themeName 主题名称 */ changeTheme(themeName) { var _a3; if (!themeName) { if (this.GLOBAL_LOCAL_CACHE_THEME) { themeName = localStorage.getItem("ddei-theme-" + this.id); } } let finded = false; let defaultJSON = null; for (let i2 = 0; i2 < ((_a3 = this.themes) == null ? void 0 : _a3.length); i2++) { if (this.theme && this.themes[i2].name == this.theme) { defaultJSON = this.themes[i2]; } else if (this.themes[i2].default == true) { defaultJSON = this.themes[i2]; } if (this.themes[i2].name == themeName) { finded = true; this.currentTheme = themeName; let themeConfig = this.themes[i2]; this.changeStyle(this.currentTheme, themeConfig); break; } } if (!finded) { this.currentTheme = defaultJSON.name; let themeConfig = defaultJSON; this.changeStyle(this.currentTheme, themeConfig); } } changeStyle(name, obj) { var _a3, _b2, _c2, _d2, _e2; let container2 = document.getElementById(this.containerid); container2 == null ? void 0 : container2.setAttribute("theme", name); let removeProperties = []; for (let i2 = 0; i2 < container2.style.length; i2++) { if (container2.style[i2] && container2.style[i2].startsWith("--")) { removeProperties.push(container2.style[i2]); } } removeProperties.forEach((prop) => { container2.style.removeProperty(prop); }); for (let key in obj) { if (obj[key]) { container2.style.setProperty(`--${key}`, obj[key]); } } if ((_b2 = (_a3 = this.ddInstance) == null ? void 0 : _a3.stage) == null ? void 0 : _b2.render) { (_e2 = (_d2 = (_c2 = this.ddInstance) == null ? void 0 : _c2.stage) == null ? void 0 : _d2.render) == null ? void 0 : _e2.clearCachedValue(); this.ddInstance.stage.render.refresh = true; } if (this.GLOBAL_LOCAL_CACHE_THEME) { let curInsTheme = localStorage.getItem("ddei-theme-" + this.id); if (!curInsTheme || curInsTheme != name) { localStorage.setItem("ddei-theme-" + this.id, name); } } } /** * 向当前画布添加控件,缺省坐标为当前画布的中心 * @param controls 要添加的控件 * @param applyRatio 应用缩放 * @param notify 通知刷新 */ addControls(controls2, applyRatio = true, notify = true, beforeInvoke = false) { if ((controls2 == null ? void 0 : controls2.length) > 0) { let stage2 = this.ddInstance.stage; let layer2 = stage2 == null ? void 0 : stage2.layers[stage2 == null ? void 0 : stage2.layerIndex]; let shapes = []; if (layer2) { controls2.forEach((control) => { var _a3, _b2; let controlDefine = this.controls.get(control.model); if (controlDefine) { let controlModel = DDeiEditorUtil$1.createControl(controlDefine, this); let valid = false; if (!beforeInvoke) { valid = true; } else { let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", "CREATE", { models: controlModel }, this.ddInstance); if (rsState == 0 || rsState == 1) { valid = true; } } if (valid && (controlModel == null ? void 0 : controlModel.length) > 0) { let cc = controlModel[0]; for (let i2 in control) { if (i2 != "spv" && i2 != "hpv" && i2 != "cpv" && i2 != "x" && i2 != "y" && i2 != "width" && i2 != "height" && (control[i2] || control[i2] == 0 || control[i2] == false)) { cc[i2] = control[i2]; } } let stageRatio1 = stage2.getStageRatio(); let stageRatio2 = !applyRatio ? 1 / stageRatio1 : 1; let m12 = new Matrix3(); if (control.width || control.height) { let width = (control.width ? control.width : 0) * stageRatio2; let height = (control.height ? control.height : 0) * stageRatio2; let scaleMatrix2 = new Matrix3( width / cc.essBounds.width, 0, 0, 0, height / cc.essBounds.height, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); } let centerMoveX = (-stage2.wpv.x + this.ddInstance.render.canvas.width / this.ddInstance.render.ratio / 2) / stageRatio1; let centerMoveY = (-stage2.wpv.y + this.ddInstance.render.canvas.height / this.ddInstance.render.ratio / 2) / stageRatio1; let moveMatrix2 = new Matrix3( 1, 0, centerMoveX, 0, 1, centerMoveY, 0, 0, 1 ); m12.premultiply(moveMatrix2); if (control.offsetX || control.offsetY) { let move1Matrix = new Matrix3( 1, 0, control.offsetX ? control.offsetX * stageRatio2 : 0, 0, 1, control.offsetY ? control.offsetY * stageRatio2 : 0, 0, 0, 1 ); m12.premultiply(move1Matrix); } else if ((control.x || control.x == 0) && (control.y || control.y == 0)) { let move1Matrix = new Matrix3( 1, 0, -centerMoveX + control.x * stageRatio2, 0, 1, -centerMoveY + control.y * stageRatio2, 0, 0, 1 ); m12.premultiply(move1Matrix); } cc.transVectors(m12); if ((_b2 = (_a3 = controlDefine == null ? void 0 : controlDefine.define) == null ? void 0 : _a3.sample) == null ? void 0 : _b2.depProps) { let depProps = controlDefine.define.sample.depProps; for (let type in depProps) { let property = depProps[type]; let modelPropValue = cc[property]; if (modelPropValue) { DDeiUtil$1.createDepLinkModel(cc, modelPropValue, type); } } } cc.updateLinkModels(); cc.refreshLinkModels(); layer2.addModel(cc, false); cc.initRender(); shapes.push(cc); } } }); if (notify) { this.notifyChange(); } } return shapes; } } /** * 向特定图层添加控件,缺省坐标为当前画布的中心 * @param controls 要添加的控件 * @param layerIndex 图层下标 * @param applyRatio 应用缩放 * @param notify 通知刷新 */ addControlsToLayer(controls2, layerIndex = -1, applyRatio = true, notify = true, beforeInvoke = false) { var _a3; let stage2 = this.ddInstance.stage; if (layerIndex > -1 && layerIndex < ((_a3 = stage2 == null ? void 0 : stage2.layers) == null ? void 0 : _a3.length)) { let layer2 = stage2 == null ? void 0 : stage2.layers[layerIndex]; let shapes = []; if (layer2) { controls2.forEach((control) => { var _a22, _b2; let controlDefine = this.controls.get(control.model); if (controlDefine) { let controlModel = DDeiEditorUtil$1.createControl(controlDefine, this); let valid = false; if (!beforeInvoke) { valid = true; } else { let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", "CREATE", { models: controlModel }, this.ddInstance); if (rsState == 0 || rsState == 1) { valid = true; } } if (valid && (controlModel == null ? void 0 : controlModel.length) > 0) { let cc = controlModel[0]; for (let i2 in control) { if (i2 != "spv" && i2 != "hpv" && i2 != "cpv" && i2 != "x" && i2 != "y" && i2 != "width" && i2 != "height" && (control[i2] || control[i2] == 0 || control[i2] == false)) { cc[i2] = control[i2]; } } let stageRatio1 = stage2.getStageRatio(); let stageRatio2 = !applyRatio ? 1 / stageRatio1 : 1; let m12 = new Matrix3(); if (control.width || control.height) { let width = (control.width ? control.width : 0) * stageRatio2; let height = (control.height ? control.height : 0) * stageRatio2; let scaleMatrix2 = new Matrix3( width / cc.essBounds.width, 0, 0, 0, height / cc.essBounds.height, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); } let centerMoveX = (-stage2.wpv.x + this.ddInstance.render.canvas.width / this.ddInstance.render.ratio / 2) / stageRatio1; let centerMoveY = (-stage2.wpv.y + this.ddInstance.render.canvas.height / this.ddInstance.render.ratio / 2) / stageRatio1; let moveMatrix2 = new Matrix3( 1, 0, centerMoveX, 0, 1, centerMoveY, 0, 0, 1 ); m12.premultiply(moveMatrix2); if (control.offsetX || control.offsetY) { let move1Matrix = new Matrix3( 1, 0, control.offsetX ? control.offsetX * stageRatio2 : 0, 0, 1, control.offsetY ? control.offsetY * stageRatio2 : 0, 0, 0, 1 ); m12.premultiply(move1Matrix); } else if ((control.x || control.x == 0) && (control.y || control.y == 0)) { let move1Matrix = new Matrix3( 1, 0, -centerMoveX + control.x * stageRatio2, 0, 1, -centerMoveY + control.y * stageRatio2, 0, 0, 1 ); m12.premultiply(move1Matrix); } cc.transVectors(m12); if ((_b2 = (_a22 = controlDefine == null ? void 0 : controlDefine.define) == null ? void 0 : _a22.sample) == null ? void 0 : _b2.depProps) { let depProps = controlDefine.define.sample.depProps; for (let type in depProps) { let property = depProps[type]; let modelPropValue = cc[property]; if (modelPropValue) { DDeiUtil$1.createDepLinkModel(cc, modelPropValue, type); } } } cc.updateLinkModels(); cc.refreshLinkModels(); layer2.addModel(cc, false); cc.initRender(); shapes.push(cc); } } }); if (notify) { this.notifyChange(); } } return shapes; } return null; } /** * 向当前画布添加连线 * @param controls 要添加的控件 * @param applyRatio 应用缩放 * @param notify 通知刷新 */ addLines(controls2, calPoints = true, applyRatio = true, notify = true) { let stage2 = this.ddInstance.stage; let layer2 = stage2 == null ? void 0 : stage2.layers[stage2 == null ? void 0 : stage2.layerIndex]; let shapes = []; if (layer2) { let stageRatio1 = stage2.getStageRatio(); let stageRatio2 = !applyRatio ? 1 / stageRatio1 : 1; let moveX = (-stage2.wpv.x + this.ddInstance.render.canvas.width / this.ddInstance.render.ratio / 2) / stageRatio1; let moveY = (-stage2.wpv.y + this.ddInstance.render.canvas.height / this.ddInstance.render.ratio / 2) / stageRatio1; controls2.forEach((control) => { var _a3, _b2, _c2, _d2, _e2, _f; if (control.startPoint && control.endPoint) { let lineJson = DDeiUtil$1.getLineInitJSON(this.ddInstance, control.smodel, control.emodel); let lineDefine = (_a3 = this.controls) == null ? void 0 : _a3.get((control == null ? void 0 : control.model) ? control.model : lineJson.modelCode ? lineJson.modelCode : lineJson.model ? lineJson.model : lineJson.id ? lineJson.id : lineJson.code); let initJSON = clone(lineDefine); initJSON.modelCode = initJSON.id; initJSON.id = "line_" + ++stage2.idIdx; if (!lineJson.type) { initJSON.type = 2; } else { initJSON.type = lineJson.type; } if (initJSON.img) { initJSON.fill = { type: 2, image: initJSON.img }; delete initJSON.img; } if (initJSON.define) { for (let i2 in initJSON == null ? void 0 : initJSON.define) { initJSON[i2] = initJSON.define[i2]; } delete initJSON.define; } delete initJSON.attrDefineMap; delete initJSON.filters; delete initJSON.icon; delete initJSON.groups; delete initJSON.name; delete initJSON.def; delete initJSON.code; delete initJSON.desc; delete initJSON.attrs; (_b2 = initJSON.composes) == null ? void 0 : _b2.forEach((comp) => { if (comp) { delete comp.attrs; } }); let sx, sy, ex, ey; if (control.startPoint.offsetX || control.startPoint.offsetX == 0) { sx = moveX + control.startPoint.offsetX * stageRatio2; } else if (control.startPoint.x || control.startPoint.x == 0) { sx = control.startPoint.x * stageRatio2; } if (control.startPoint.offsetY || control.startPoint.offsetY == 0) { sy = moveY + control.startPoint.offsetY * stageRatio2; } else if (control.startPoint.y || control.startPoint.y == 0) { sy = control.startPoint.y * stageRatio2; } if (control.endPoint.offsetX || control.endPoint.offsetX == 0) { ex = moveX + control.endPoint.offsetX * stageRatio2; } else if (control.endPoint.x || control.endPoint.x == 0) { ex = control.endPoint.x * stageRatio2; } if (control.endPoint.offsetY || control.endPoint.offsetY == 0) { ey = moveY + control.endPoint.offsetY * stageRatio2; } else if (control.endPoint.y || control.endPoint.y == 0) { ey = control.endPoint.y * stageRatio2; } if (!calPoints && ((_c2 = control.pvs) == null ? void 0 : _c2.length) >= 2) { initJSON.pvs = []; control.pvs.forEach((pv) => { let pvx, pvy; if (pv.offsetX || pv.offsetX == 0) { pvx = moveX + pv.offsetX * stageRatio2; } else if (pv.x || pv.x == 0) { pvx = pv.x * stageRatio2; } if (pv.offsetY || pv.offsetY == 0) { pvy = moveY + pv.offsetY * stageRatio2; } else if (pv.y || pv.y == 0) { pvy = pv.y * stageRatio2; } initJSON.pvs.push(new Vector3(pvx - sx, pvy - sy, 1)); }); } else { initJSON.pvs = [new Vector3(0, 0, 1), new Vector3(ex - sx, ey - sx, 1)]; } (_d2 = control.spvs) == null ? void 0 : _d2.forEach((spv) => { spv.x = (spv.x - sx) * stageRatio2; spv.y = (spv.y - sy) * stageRatio2; }); initJSON.cpv = initJSON.pvs[0]; let moveMatrix2 = new Matrix3( 1, 0, sx, 0, 1, sy, 0, 0, 1 ); let cc = DDeiLine.initByJSON(initJSON, { currentStage: stage2, currentLayer: layer2, currentContainer: layer2 }); for (let i2 in control) { if (i2 != "startPoint" && i2 != "endPoint" && i2 != "pvs" && i2 != "spv" && i2 != "hpv" && i2 != "cpv" && i2 != "x" && i2 != "y" && i2 != "width" && i2 != "height" && (control[i2] || control[i2] == 0 || control[i2] == false)) { cc[i2] = control[i2]; } } cc.transVectors(moveMatrix2); let smodel, emodel; if (control.smodel) { smodel = this.getControlById(control.smodel.id); let id = "_" + DDeiUtil$1.getUniqueCode(); smodel.exPvs[id] = new Vector3(sx, sy, 1); smodel.exPvs[id].rate = control.smodel.rate; smodel.exPvs[id].sita = control.smodel.sita; smodel.exPvs[id].index = control.smodel.index; smodel.exPvs[id].id = id; let link2 = new DDeiLink({ sm: smodel, dm: cc, smpath: "exPvs." + id, dmpath: "startPoint", stage: stage2 }); stage2.addLink(link2); smodel.transVectors(new Matrix3()); } if (control.emodel) { emodel = this.getControlById(control.emodel.id); let id = "_" + DDeiUtil$1.getUniqueCode(); emodel.exPvs[id] = new Vector3(ex, ey, 1); emodel.exPvs[id].rate = control.emodel.rate; emodel.exPvs[id].sita = control.emodel.sita; emodel.exPvs[id].index = control.emodel.index; emodel.exPvs[id].id = id; let link2 = new DDeiLink({ sm: emodel, dm: cc, smpath: "exPvs." + id, dmpath: "endPoint", stage: stage2 }); stage2.addLink(link2); emodel.transVectors(new Matrix3()); } if (!control.isShadowControl) { cc.refreshLinkModels(); layer2.addModel(cc, false); cc.initRender(); } else { layer2.shadowControls.push(cc); cc.initRender(); } if (calPoints) { smodel == null ? void 0 : smodel.updateLinkModels(); emodel == null ? void 0 : emodel.updateLinkModels(); } (_e2 = smodel == null ? void 0 : smodel.render) == null ? void 0 : _e2.enableRefreshShape(); (_f = emodel == null ? void 0 : emodel.render) == null ? void 0 : _f.enableRefreshShape(); shapes.push(cc); } }); if (notify) { this.notifyChange(); } } return shapes; } notifyChange() { this.bus.push(DDeiEnumBusCommandType.UpdatePaperArea); this.bus.push(DDeiEnumBusCommandType.NodifyChange); this.bus.push(DDeiEnumBusCommandType.RefreshShape); this.bus.push(DDeiEnumBusCommandType.AddHistroy); this.changeState(DDeiEditorState.DESIGNING); this.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts); this.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); this.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); this.bus.executeAll(); } /** * 移除当前画布控件 */ removeControls(ids, notify = true) { var _a3; (_a3 = this.ddInstance.stage) == null ? void 0 : _a3.removeModelById(ids); if (notify) { this.notifyChange(); } } /** * 清除当前画布所有控件 */ clearModels(destroy = false, notify = true) { var _a3; (_a3 = this.ddInstance.stage) == null ? void 0 : _a3.clearModels(destroy); if (notify) { this.notifyChange(); } } /** * 根据ID获取控件 */ getControlById(id) { var _a3; return (_a3 = this.ddInstance.stage) == null ? void 0 : _a3.getModelById(id, true); } /** * 设置是否可以编辑 */ setEditable(editable) { if (!editable) { this.ddInstance["AC_DESIGN_CREATE"] = false; this.ddInstance["AC_DESIGN_EDIT"] = false; this.ddInstance["AC_DESIGN_DRAG"] = false; this.ddInstance["AC_DESIGN_LINK"] = false; this.ddInstance["AC_DESIGN_DEL"] = false; this.ddInstance["AC_DESIGN_ROTATE"] = false; this.ddInstance["AC_DESIGN_SCALE"] = false; this.ddInstance["AC_DESIGN_COMPOSE"] = false; } else { this.ddInstance["AC_DESIGN_CREATE"] = true; this.ddInstance["AC_DESIGN_EDIT"] = true; this.ddInstance["AC_DESIGN_DRAG"] = true; this.ddInstance["AC_DESIGN_SELECT"] = true; this.ddInstance["AC_DESIGN_LINK"] = true; this.ddInstance["AC_DESIGN_DEL"] = true; this.ddInstance["AC_DESIGN_ROTATE"] = true; this.ddInstance["AC_DESIGN_SCALE"] = true; this.ddInstance["AC_DESIGN_COMPOSE"] = true; } } setAccessInfo(config2) { if (config2) { for (let i2 in config2) { if (config2[i2] == true || config2[i2] == false) { this.ddInstance["AC_" + this.MODE_NAME + "_" + i2] = config2[i2]; } } } } /** * 将模型转换为JSON */ toJSON() { let jsonArray = new Array(); this.files.forEach((file) => { jsonArray.push(file.toJSON()); }); return jsonArray; } /** * 根据属性搜索控件 * @param keywords 关键字/正则表达式 * @param attr 搜索的属性 * @param isReg 是否正则表达式 * @param area 搜索范围,1本页/2本文档/3所有打开文件 * @param matchCase 区分大小写 * @param matchAll 全字匹配 */ searchModels(keywords, attr, isReg = false, area = 1, matchCase = false, matchAll = false) { let resultArray = new Array(); if (keywords && attr) { switch (area) { case 1: { for (let i2 = 0; i2 < this.files.length; i2++) { for (let j2 = 0; j2 < this.files[i2].sheets.length; j2++) { if (this.files[i2].sheets[j2].stage == this.ddInstance.stage) { let rs = this.ddInstance.stage.searchModels(keywords, attr, isReg, matchCase, matchAll); rs == null ? void 0 : rs.forEach((r) => { r.fileIndex = i2; r.sheetIndex = j2; resultArray.push(r); }); return resultArray; } } } } case 2: { let rs = this.files[this.currentFileIndex].searchModels(keywords, attr, isReg, matchCase, matchAll); rs == null ? void 0 : rs.forEach((r) => { r.fileIndex = this.currentFileIndex; resultArray.push(r); }); } case 3: { for (let i2 = 0; i2 < this.files.length; i2++) { let rs = this.files[i2].searchModels(keywords, attr, isReg, matchCase, matchAll); rs == null ? void 0 : rs.forEach((r) => { r.fileIndex = i2; resultArray.push(r); }); } } break; } } return resultArray; } /** * 将舞台可视区域的中心点移动到控件的外接矩形中心 * @param modelIds */ centerModels(stage2, ...modelIds) { if (!stage2) { stage2 = this.ddInstance.stage; } if ((modelIds == null ? void 0 : modelIds.length) > 0) { let models = new Array(); for (let i2 = 0; i2 < modelIds.length; i2++) { if (modelIds[i2]) { let model = stage2.getModelById(modelIds[i2], true); if (model) { models.push(model); } } } if (models.length > 0) { let stageRatio2 = stage2.getStageRatio(); let outRect = DDeiAbstractShape.getOutRectByPV(models, stageRatio2); stage2.wpv.x = -(outRect.x + outRect.width / 2) + stage2.ddInstance.render.canvas.width / stage2.ddInstance.render.ratio / 2; stage2.wpv.y = -(outRect.y + outRect.height / 2) + stage2.ddInstance.render.canvas.height / stage2.ddInstance.render.ratio / 2; } } } /** * 切换文件 * @param file */ changeFile(fileIndex, sheetIndex = -1) { let ddInstance = this == null ? void 0 : this.ddInstance; let file = null; if (fileIndex || fileIndex == 0) { file = this.files[fileIndex]; } if (file) { this.files.forEach((item) => { item.active = DDeiActiveType.NONE; }); file.active = DDeiActiveType.ACTIVE; this.currentFileIndex = fileIndex; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { if (sheetIndex >= 0) { file.changeSheet(sheetIndex); } ddInstance.stage.destroyRender(); let stage2 = sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance; ddInstance.stage = stage2; stage2.initRender(); } } } /** * 替换模型数据 * @param models 被替换的模型 * @param attr 属性 * @param sIdx 开始下标 * @param eIdx 结束下标 * @param data 数据 */ replaceModelsData(models, attr, sIdx = -1, eIdx = -1, data = "", notify = true) { if ((models == null ? void 0 : models.length) > 0 && attr && sIdx != -1 && eIdx != -1 && eIdx >= sIdx) { models.forEach((model) => { let oldValue = model[attr]; if (oldValue && typeof oldValue == "string") { let sStr = oldValue.substring(0, sIdx); let eStr = oldValue.substring(eIdx, oldValue.length); let newValue = sStr + data + eStr; model[attr] = newValue; } }); } if (notify) { this.notifyChange(); } } /** * 返回画布图片 * @models 选中控件模型,如果不传入则返回整个画布 */ toImageDataUrl(models = null) { return this.ddInstance.stage.toImageDataUrl(models); } }; __publicField2(_DDeiEditor, "INSTANCE_POOL", /* @__PURE__ */ new Map()); __publicField2(_DDeiEditor, "HISTROY_LEVEL", "file"); __publicField2(_DDeiEditor, "ACTIVE_INSTANCE", null); let DDeiEditor = _DDeiEditor; const DDeiEditor$1 = DDeiEditor; const _DDeiEditorUtil = class _DDeiEditorUtil2 { /** * 读取最近工具栏 */ static readRecentlyToolGroups() { let groups = localStorage.getItem("ddei-recently-tool-groups"); if (groups) { try { _DDeiEditorUtil2.recentlyToolGroups = JSON.parse(groups); } catch (e) { } } } /** * 写入最近工具栏 */ static whiteRecentlyToolGroups(groups) { _DDeiEditorUtil2.recentlyToolGroups = []; groups.forEach((group2) => { if (group2.display) { _DDeiEditorUtil2.recentlyToolGroups.push({ id: group2.id, expand: group2.expand }); } }); localStorage.setItem("ddei-recently-tool-groups", JSON.stringify(_DDeiEditorUtil2.recentlyToolGroups)); } /** * 获取线的初始化JSON定义 */ static getLineInitJSON(ddInstance, smodel, emodel) { if (!_DDeiEditorUtil2.lineInitJSON) { _DDeiEditorUtil2.lineInitJSON = { modelCode: "100401" }; } return _DDeiEditorUtil2.lineInitJSON; } /** * 获取控件的初始化JSON定义 */ static getModelInitJSON(ddInstance, beginModel, models) { return models; } /** * 获取业务数据 */ static getBusiData(ddInstance) { let editor = _DDeiEditorUtil2.getEditorInsByDDei(ddInstance); if (editor) { let file = editor.files[editor.currentFileIndex]; return file == null ? void 0 : file.busiData; } } /** * 获取快捷编辑文本框 */ static getEditorText() { let editor = DDeiEditor$1.ACTIVE_INSTANCE; if (editor) { if (!editor.quickEditorInput) { let inputId = editor.id + "_quickeditor"; let inputEle = document.getElementById(inputId); if (!inputEle) { inputEle = document.createElement("textarea"); inputEle.setAttribute("id", inputId); inputEle.setAttribute("style", "width:100px;filter: opacity(0);user-select: none;pointer-events: none;border:none;resize:none;padding:0;z-index:9999;position:fixed;left:0;top:0;display:none;outline:none;"); let editorEle = document.getElementById(editor.id); editorEle.appendChild(inputEle); editor.quickEditorInput = inputEle; inputEle.enterValue = function() { var _a3, _b2, _c2; let editor2 = DDeiEditor$1.ACTIVE_INSTANCE; let ddInstance = editor2 == null ? void 0 : editor2.ddInstance; delete ddInstance.stage.brushDataText; if (editor2.quickEditorModel) { editor2.quickEditorModel.sptStyle = ddInstance.stage.render.editorShadowControl.sptStyle; if ((_a3 = ddInstance.stage.render.editorShadowControl) == null ? void 0 : _a3.isShadowControl) { ddInstance.stage.render.editorShadowControl.destroyed(); } ddInstance.stage.render.editorShadowControl = null; if ((_b2 = editor2.quickEditorModel) == null ? void 0 : _b2.depModel) { let depModel = editor2.quickEditorModel.depModel; setTimeout(() => { var _a22; depModel.refreshLinkModels(); editor2.bus.push(DDeiEnumBusCommandType.RefreshShape); editor2.bus.push(DDeiEnumBusCommandType.AddHistroy); (_a22 = editor2.bus) == null ? void 0 : _a22.executeAll(); }, 50); editor2.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { models: [editor2.quickEditorModel], paths: ["text"], value: inputEle.value }, null, true); editor2.bus.push(DDeiEnumBusCommandType.NodifyChange); editor2.bus.push(DDeiEnumBusCommandType.RefreshShape); } else { editor2.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { models: [editor2.quickEditorModel], paths: ["text"], value: inputEle.value }, null, true); editor2.bus.push(DDeiEnumBusCommandType.NodifyChange); editor2.bus.push(DDeiEnumBusCommandType.RefreshShape); editor2.bus.push(DDeiEnumBusCommandType.AddHistroy); } } inputEle.value = ""; editor2.changeState(DDeiEditorState.DESIGNING); editor2.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); editor2.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); editor2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); editor2.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); (_c2 = editor2.bus) == null ? void 0 : _c2.executeAll(); }; inputEle.onkeyup = function(evt) { let editor2 = DDeiEditor$1.ACTIVE_INSTANCE; editor2.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); editor2.bus.push(DDeiEnumBusCommandType.RefreshShape); editor2.bus.executeAll(); }; inputEle.addEventListener("compositionend", function() { let editor2 = DDeiEditor$1.ACTIVE_INSTANCE; let ddInstance = editor2 == null ? void 0 : editor2.ddInstance; if (ddInstance.stage.render.editorShadowControl) { _DDeiEditorUtil2.quickEditorToControl(); } }); inputEle.addEventListener("input", () => { let editor2 = DDeiEditor$1.ACTIVE_INSTANCE; let ddInstance = editor2 == null ? void 0 : editor2.ddInstance; if (ddInstance.stage.render.editorShadowControl) { _DDeiEditorUtil2.quickEditorToControl(); } }); } } return editor.quickEditorInput; } } /** * 获取样式属性值 * @param name 属性名称 * @param ddInstance ddei实例 */ static getStyleValue(name, ddInstance) { let editor = _DDeiEditorUtil2.getEditorInsByDDei(ddInstance); let element = document.getElementById(editor.containerid); let styles2 = getComputedStyle(element); let cssVariable = styles2.getPropertyValue("--" + name); return cssVariable; } static getEditorId(ddInstance) { let editor = _DDeiEditorUtil2.getEditorInsByDDei(ddInstance); return editor.id; } static getEditorInsByDDei(ddInstance) { let editor; if (ddInstance) { DDeiEditor$1.INSTANCE_POOL.forEach((editorIns) => { var _a3; if (editorIns.ddInstance == ddInstance || ((_a3 = editorIns.ddInstance) == null ? void 0 : _a3.id) == (ddInstance == null ? void 0 : ddInstance.id)) { editor = editorIns; } }); } if (!editor) { editor = DDeiEditor$1.ACTIVE_INSTANCE; } return editor; } static notifyChange(ddInstance) { let editor = _DDeiEditorUtil2.getEditorInsByDDei(ddInstance); editor == null ? void 0 : editor.notifyChange(); } /** * 判断element是否为editor的子控件 * @param element dom元素 * @param editor 编辑器 */ static isEditorSubElement(element, editor) { if (!editor || !element) { return false; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return false; } if (element == editor.htmlElement) { return true; } else { return _DDeiEditorUtil2.isEditorSubElement(element.parentElement, editor); } } //钩子函数,判断当前实例是否可以在后台激活,允许后台激活的实例,在当前实例为非ACTIVE_INSTANCE时,依然能够执行部分后台操作 static isBackActive(ddInstance) { if (!ddInstance) { return false; } else { let editor = _DDeiEditorUtil2.getEditorInsByDDei(ddInstance); if (!editor) { return false; } else { return DDeiEditor$1.ACTIVE_INSTANCE && editor.id == DDeiEditor$1.ACTIVE_INSTANCE.id || editor.GLOBAL_ALLOW_BACK_ACTIVE; } } } /** * 设置编辑器值到控件 */ static quickEditorToControl(inputEle) { let editorInput = _DDeiEditorUtil2.getEditorText(); if (!inputEle) { inputEle = editorInput; } if (inputEle != editorInput) { editorInput.value = inputEle.value; editorInput.selectionStart = inputEle.selectionStart; editorInput.selectionEnd = inputEle.selectionEnd; } let editor = DDeiEditor$1.ACTIVE_INSTANCE; let ddInstance = editor == null ? void 0 : editor.ddInstance; let oldStr = ddInstance.stage.render.editorShadowControl.text; let newStr = inputEle.value; let curstrIdx = Math.min(ddInstance.stage.render.editorShadowControl.tempCursorStart, inputEle.selectionStart); let beforeStr = oldStr.substring(0, curstrIdx); let beforeSPT = {}; for (let i2 = 0; i2 < curstrIdx; i2++) { if (ddInstance.stage.render.editorShadowControl.sptStyle[i2]) { beforeSPT[i2] = ddInstance.stage.render.editorShadowControl.sptStyle[i2]; } } let sptIndex = curstrIdx; let afterStr = oldStr.substring(ddInstance.stage.render.editorShadowControl.tempCursorEnd); let afterSPT = {}; for (let i2 = ddInstance.stage.render.editorShadowControl.tempCursorEnd; i2 < oldStr.length; i2++) { if (ddInstance.stage.render.editorShadowControl.sptStyle[i2]) { afterSPT[i2] = ddInstance.stage.render.editorShadowControl.sptStyle[i2]; } } let bIndex = newStr.indexOf(beforeStr) + beforeStr.length; let appendStr = null; if (afterStr) { appendStr = newStr.substring(bIndex, newStr.lastIndexOf(afterStr)); } else { appendStr = newStr.substring(bIndex); } let oriStyle = bIndex == 0 ? afterSPT[bIndex] : beforeSPT[bIndex - 1]; if (oriStyle && appendStr) { let cloneSPTStr = JSON.stringify(oriStyle); for (let i2 = 0; i2 < appendStr.length; i2++, sptIndex++) { beforeSPT[sptIndex] = JSON.parse(cloneSPTStr); } } let appendStrLen = newStr.length - oldStr.length; for (let i2 in afterSPT) { beforeSPT[parseInt(i2) + appendStrLen] = afterSPT[i2]; } ddInstance.stage.render.editorShadowControl.sptStyle = beforeSPT; ddInstance.stage.render.editorShadowControl.tempCursorStart = inputEle.selectionStart; ddInstance.stage.render.editorShadowControl.tempCursorEnd = inputEle.selectionEnd; ddInstance.stage.render.editorShadowControl.text = inputEle.value; ddInstance.stage.render.editorShadowControl.render.setCachedValue("text", inputEle.value); editor.bus.push(DDeiEnumBusCommandType.RefreshShape); editor.bus.executeAll(); } /** * 获取子元素定义的json信息 */ static getSubControlJSON(modelCode, ddInstance) { var _a3, _b2, _c2; let editor = _DDeiEditorUtil2.getEditorInsByDDei(ddInstance); let controlDefine = (_a3 = editor.controls) == null ? void 0 : _a3.get(modelCode); if (controlDefine.subcontrol) { let subControlDefine = (_b2 = editor.controls) == null ? void 0 : _b2.get(controlDefine.subcontrol); let configAtrs = _DDeiEditorUtil2.getAttrValueByConfig(subControlDefine, [ "layout" ]); if (subControlDefine) { let subControlJSON = { modelCode: subControlDefine.id, layout: (_c2 = configAtrs.get("layout")) == null ? void 0 : _c2.data }; return subControlJSON; } } } /** * 获取菜单控件ID * @returns 控件ID */ static getMenuControlId(editor) { return editor.id + "_menu_dialog"; } /** * 显示菜单 */ static showContextMenu(control, ddInstance, evt) { let editor = _DDeiEditorUtil2.getEditorInsByDDei(ddInstance); let menuJSON = DDeiUtil$1.getMenuConfig(control, editor); if ((menuJSON == null ? void 0 : menuJSON.length) > 0 && (editor == null ? void 0 : editor.setCurrentMenu)) { let stage2 = ddInstance.stage; if (stage2) { stage2.render.currentMenuShape = control; editor.setCurrentMenu(menuJSON); let menuDialogId = DDeiUtil$1.getMenuControlId(editor); let menuEle = document.getElementById(menuDialogId); let elePos = DDeiUtil$1.getDomAbsPosition(evt.currentTarget, editor); if (menuEle) { if (elePos.left + 200 > document.body.clientWidth) { menuEle.style.left = document.body.clientWidth - 200 + "px"; } else { menuEle.style.left = elePos.left + "px"; } if (elePos.top + menuJSON.length * 40 > document.body.clientHeight) { menuEle.style.top = document.body.clientHeight - menuJSON.length * 40 + "px"; } else { menuEle.style.top = elePos.top + "px"; } setTimeout(() => { menuEle.style.display = "block"; }, 10); } } } } /** * 获取菜单配置 */ static getMenuConfig(model, editor) { if (editor == null ? void 0 : editor.menuMapping) { let menus2 = editor == null ? void 0 : editor.menuMapping[model == null ? void 0 : model.modelType]; if ((menus2 == null ? void 0 : menus2.length) > 0) { return menus2; } } } /** * 从配置定义中获取属性值,优先从code中获取,其次从mapping获取 * @param configModel 配置模型,如果包含了attrDefineMap等数据,则直接获取数据,如果只包含id则通过id取原始数据 * @param paths 属性路径,支持传入多个 * @return 由构成的属性的实际路径和配置中对应的值组成的Map */ static getAttrValueByConfig(configModel, paths, editor) { var _a3, _b2; if (!editor) { if (configModel.modelType == "DDeiStage") { editor = _DDeiEditorUtil2.getEditorInsByDDei(configModel.ddInstance); } else { editor = _DDeiEditorUtil2.getEditorInsByDDei((_a3 = configModel.stage) == null ? void 0 : _a3.ddInstance); } } let returnDatas = /* @__PURE__ */ new Map(); if (configModel && paths) { let searchPaths = null; if (typeof paths == "string") { searchPaths = paths.split(","); } else { searchPaths = paths; } let searchMap = null; if (configModel.attrDefineMap && configModel.attrDefineMap.size > 0) { searchMap = configModel.attrDefineMap; } else if (configModel.id || configModel.modelCode) { let id = configModel.modelCode ? configModel.modelCode : configModel.id; if (id.indexOf("_shadow") != -1) { id = id.substring(id, id.lastIndexOf("_shadow")); } let control = (_b2 = editor.controls) == null ? void 0 : _b2.get(id); if (control) { searchMap = control.attrDefineMap; } } if (searchMap) { let noCodeMatchPaths = []; searchPaths.forEach((searchPath) => { if (searchMap.has(searchPath)) { let attrDefine = searchMap.get(searchPath); if (!attrDefine.mapping || attrDefine.mapping.length == 0) { returnDatas.set(searchPath, { "overwrite": attrDefine.overwrite ? attrDefine.overwrite : false, "data": attrDefine.getParser().getDefaultValue() }); } else { noCodeMatchPaths.push(searchPath); } } else { noCodeMatchPaths.push(searchPath); } }); let hasMappingAttrs = Array.from(searchMap.values()); for (let i2 = 0; i2 < noCodeMatchPaths.length; i2++) { let searchPath = noCodeMatchPaths[i2]; for (let j2 = 0; j2 < hasMappingAttrs.length; j2++) { let attrDefine = hasMappingAttrs[j2]; if (attrDefine.mapping && attrDefine.mapping.indexOf(searchPath) != -1) { returnDatas.set(searchPath, { "overwrite": attrDefine.overwrite ? attrDefine.overwrite : false, "data": attrDefine.getParser().getDefaultValue() }); break; } } } } } return returnDatas; } /** * 返回控件原始定义 * @param modelCode model或id */ static getControlDefine(configModel) { var _a3, _b2; let editor = _DDeiEditorUtil2.getEditorInsByDDei((_a3 = configModel.stage) == null ? void 0 : _a3.ddInstance); let id = configModel.modelCode ? configModel.modelCode : configModel.id; return (_b2 = editor.controls) == null ? void 0 : _b2.get(id); } /** * 获取数据源数据 */ static getDataSource(editor, attrDefine, searchText = null) { if (attrDefine.dataSource) { let dsDefine = attrDefine.dataSource; let dataSource = null; if (Array.isArray(dsDefine)) { dataSource = dsDefine; } else { let type = dsDefine.type; if (!type || type == "static") { dataSource = dsDefine.data; } else if (type == "config") { dataSource = []; let configData = dsDefine.data; let data = editor[configData]; if (!data) { data = DDeiConfig$1[configData]; } if (data) { let textKey = dsDefine.text; let valueKey = dsDefine.value; let boldKey = dsDefine.bold; let descKey = dsDefine.desc; let underlineKey = dsDefine.underline; let disabledKey = dsDefine.disabled; let deletedKey = dsDefine.deleted; let searchTextKey = dsDefine.searchText; let fontFamilyKey = dsDefine.fontFamily; data.forEach((item) => { let text2 = item[textKey]; let value = item[valueKey]; let bold = item[boldKey]; let desc = item[descKey]; let underline = item[underlineKey]; let disabled = item[disabledKey]; let deleted = item[deletedKey]; let searchText2 = item[searchTextKey]; let fontFamily = item[fontFamilyKey]; let rowData = { "text": text2, "searchText": searchText2, "value": value, "bold": bold, "desc": desc, "underline": underline, "disabled": disabled, "deleted": deleted, "fontFamily": fontFamily }; dataSource.push(rowData); }); dsDefine.type = "static"; dsDefine.data = dataSource; } } } let returnDatas = []; if (dataSource) { dataSource.forEach((item) => { item.text = editor.i18n(item.text); }); dataSource.forEach((item) => { if (item.img) { if (_DDeiEditorUtil2.ICONS && _DDeiEditorUtil2.ICONS[item.img]) { item.img = _DDeiEditorUtil2.ICONS[item.img].default; } } if (searchText) { if (item.text.indexOf(searchText) != -1 || item.value.indexOf(searchText) != -1 || item.searchText && item.searchText.indexOf(searchText) != -1) { returnDatas.push(item); } } else { returnDatas.push(item); } }); } return returnDatas; } return []; } /** * 获取配置属性值 * @param key key */ static getConfigValue(key, editor) { if (editor && (editor[key] || editor[key] == false || editor[key] == 0)) { return editor[key]; } else { return DDeiEditor$1[key]; } } /** * 打开弹出框 * @param id 弹出框ID * @param data 数据以及回调函数等选项 * @param pos 位置信息 * @param el 事件的元素 */ static showDialog(editor, id, data, pos, el, isPop = false, keepState = false) { var _a3, _b2; if (!isPop && !editor.tempDialogData) { editor.tempDialogData = {}; } else if (isPop && !editor.tempPopData) { editor.tempPopData = {}; } if (data.group) { let loopData; if (isPop) { loopData = editor.tempPopData; } else { loopData = editor.tempDialogData; } for (let oid in loopData) { if (oid != id) { let otherDialogData = loopData[oid]; if (otherDialogData && otherDialogData.group == data.group) { _DDeiEditorUtil2.closeDialog(editor, oid); } } } } if (data) { data.keepState = keepState; } if (isPop) { editor.tempPopData[id] = data; } else { editor.tempDialogData[id] = data; if (!keepState) { editor.changeState(DDeiEditorState.PROPERTY_EDITING); } } (_b2 = (_a3 = editor == null ? void 0 : editor.dialogs[id]) == null ? void 0 : _a3.viewer) == null ? void 0 : _b2.forceRefreshView(); setTimeout(() => { if (!(pos == null ? void 0 : pos.hiddenMask)) { let backEle = document.getElementById(editor.id + "_dialog_background_div"); if (data.background) { backEle.style.background = data.background; backEle.style.display = "block"; if (data.opacity) { backEle.style.opacity = data.opacity; } } if (data.event == -1) { backEle.style.pointerEvents = "auto"; } else { backEle.style.pointerEvents = ""; } } let dialog = document.getElementById(editor.id + "_" + id); if (dialog) { dialog.style.display = "block"; let msgEle = dialog.getElementsByClassName("msg")[0]; if (msgEle) { msgEle.innerHTML = ""; if (data.msg) { msgEle.innerHTML = data.msg; } } if (pos == null ? void 0 : pos.type) { let left, top; switch (pos.type) { case 99: { left = pos.left; top = pos.top; } break; case 2: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) - scrollData.left; top = absPos.top - (dialog == null ? void 0 : dialog.clientHeight) + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 3: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left - (dialog.clientWidth / 2 - el.clientWidth / 2) + (pos.dx ? pos.dx : 0) - scrollData.left; top = absPos.top - (dialog == null ? void 0 : dialog.clientHeight) + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 4: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) - scrollData.left; top = absPos.top + el.clientHeight + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 5: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left - (dialog.clientWidth / 2 - el.clientWidth / 2) + (pos.dx ? pos.dx : 0) - scrollData.left; top = absPos.top + el.clientHeight + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 6: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) - dialog.clientWidth - scrollData.left; top = absPos.top + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 7: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) - dialog.clientWidth - scrollData.left; top = absPos.top - (dialog.clientHeight - el.clientHeight) / 2 + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 8: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) + el.clientWidth - scrollData.left; top = absPos.top + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 9: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) + el.clientWidth - scrollData.left; top = absPos.top - (dialog.clientHeight - el.clientHeight) / 2 + (pos.dy ? pos.dy : 0) - scrollData.top; } break; } if (!pos || pos.ignoreOutSide != 1) { if (left + (dialog == null ? void 0 : dialog.clientWidth) > document.body.scrollWidth) { left = document.body.scrollWidth - (dialog == null ? void 0 : dialog.clientWidth) - 10; } if (top + (dialog == null ? void 0 : dialog.clientHeight) > document.body.scrollHeight) { top = document.body.scrollHeight - (dialog == null ? void 0 : dialog.clientHeight) - 10; } } dialog.style.left = left + "px"; dialog.style.top = top + "px"; } } }, 50); } /** * 初始化弹出框,但不显示 * @param id 弹出框ID * @param data 数据以及回调函数等选项 * @param el 事件的元素 */ static initDialog(editor, id, data, isPop = false, keepState = false) { var _a3, _b2; if (!isPop && !editor.tempDialogData) { editor.tempDialogData = {}; } else if (isPop && !editor.tempPopData) { editor.tempPopData = {}; } if (data.group) { let loopData; if (isPop) { loopData = editor.tempPopData; } else { loopData = editor.tempDialogData; } for (let oid in loopData) { if (oid != id) { let otherDialogData = loopData[oid]; if (otherDialogData && otherDialogData.group == data.group) { _DDeiEditorUtil2.closeDialog(editor, oid); } } } } if (data) { data.keepState = keepState; } if (isPop) { editor.tempPopData[id] = data; } else { editor.tempDialogData[id] = data; if (!keepState) { editor.changeState(DDeiEditorState.PROPERTY_EDITING); } } (_b2 = (_a3 = editor == null ? void 0 : editor.dialogs[id]) == null ? void 0 : _a3.viewer) == null ? void 0 : _b2.forceRefreshView(); } /** * 显示弹出框 * @param id 弹出框ID * @param pos 位置信息 * @param el 事件的元素 */ static displayDialog(editor, id, data, pos, el) { if (!(pos == null ? void 0 : pos.hiddenMask)) { let backEle = document.getElementById(editor.id + "_dialog_background_div"); if (data.background) { backEle.style.background = data.background; backEle.style.display = "block"; if (data.opacity) { backEle.style.opacity = data.opacity; } } if (data.event == -1) { backEle.style.pointerEvents = "auto"; } else { backEle.style.pointerEvents = ""; } } let dialog = document.getElementById(editor.id + "_" + id); if (dialog) { dialog.style.display = "block"; if (pos == null ? void 0 : pos.type) { let left, top; switch (pos.type) { case 99: { left = pos.left; top = pos.top; } break; case 2: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) - scrollData.left; top = absPos.top - (dialog == null ? void 0 : dialog.clientHeight) + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 3: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left - (dialog.clientWidth / 2 - el.clientWidth / 2) + (pos.dx ? pos.dx : 0) - scrollData.left; top = absPos.top - (dialog == null ? void 0 : dialog.clientHeight) + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 4: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) - scrollData.left; top = absPos.top + el.clientHeight + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 5: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left - (dialog.clientWidth / 2 - el.clientWidth / 2) + (pos.dx ? pos.dx : 0) - scrollData.left; top = absPos.top + el.clientHeight + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 6: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) - dialog.clientWidth - scrollData.left; top = absPos.top + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 7: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) - dialog.clientWidth - scrollData.left; top = absPos.top - (dialog.clientHeight - el.clientHeight) / 2 + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 8: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) + el.clientWidth - scrollData.left; top = absPos.top + (pos.dy ? pos.dy : 0) - scrollData.top; } break; case 9: { let absPos = DDeiUtil$1.getDomAbsPosition(el, editor); let scrollData = DDeiUtil$1.getDomScroll(el, editor); left = absPos.left + (pos.dx ? pos.dx : 0) + el.clientWidth - scrollData.left; top = absPos.top - (dialog.clientHeight - el.clientHeight) / 2 + (pos.dy ? pos.dy : 0) - scrollData.top; } break; } if (!pos || pos.ignoreOutSide != 1) { if (left + (dialog == null ? void 0 : dialog.clientWidth) > document.body.scrollWidth) { left = document.body.scrollWidth - (dialog == null ? void 0 : dialog.clientWidth) - 10; } if (top + (dialog == null ? void 0 : dialog.clientHeight) > document.body.scrollHeight) { top = document.body.scrollHeight - (dialog == null ? void 0 : dialog.clientHeight) - 10; } } dialog.style.left = left + "px"; dialog.style.top = top + "px"; } } } /** * 隐藏弹出框 * @param id 弹出框ID */ static hiddenDialog(editor, id) { let backEle = document.getElementById(editor.id + "_dialog_background_div"); if (backEle) { backEle.style.display = "none"; } let dialogEle = document.getElementById(editor.id + "_" + id); if (dialogEle) { dialogEle.style.display = "none"; } } /** * 关闭弹出框 * @param id */ static closeDialog(editor, id, isPop = false) { let dialog = document.getElementById(editor.id + "_" + id); if (dialog) { dialog.style.display = "none"; } let dialogData; if (!isPop && editor.tempDialogData) { dialogData = editor.tempDialogData[id]; editor.tempDialogData[id] = null; } else if (isPop && editor.tempPopData) { dialogData = editor.tempPopData[id]; editor.tempPopData[id] = null; } let backEle = document.getElementById(editor.id + "_dialog_background_div"); if (backEle) { backEle.style.background = "none"; backEle.style.display = "none"; } if (!dialogData || !dialogData.keepState) { editor.changeState(DDeiEditorState.DESIGNING); } } static closeDialogs(editor, groups, isPop = false) { if (isPop) { for (let oid in editor.tempPopData) { let otherDialogData = editor.tempPopData[oid]; if (otherDialogData && (groups && groups.indexOf(otherDialogData.group) != -1 || !groups || groups.length == 0)) { _DDeiEditorUtil2.closeDialog(editor, oid, isPop); } } } else { for (let oid in editor.tempDialogData) { let otherDialogData = editor.tempDialogData[oid]; if (otherDialogData && (groups && groups.indexOf(otherDialogData.group) != -1 || !groups || groups.length == 0)) { _DDeiEditorUtil2.closeDialog(editor, oid, isPop); } } } } /** * 打开或关闭弹出框 * @param id * @param data * @param pos * @param el */ static showOrCloseDialog(editor, id, data, pos, el, isPop = false, keepState = false) { if (!isPop && editor.tempDialogData && editor.tempDialogData[id]) { _DDeiEditorUtil2.closeDialog(editor, id, isPop); } else if (isPop && editor.tempPopData && editor.tempPopData[id]) { _DDeiEditorUtil2.closeDialog(editor, id, isPop); } else { _DDeiEditorUtil2.showDialog(editor, id, data, pos, el, isPop, keepState); } } /** * 获取控件的小图标 */ static getControlIcons(editor) { return new Promise((resolve, reject) => { if (editor.icons && JSON.stringify(editor.icons) != "{}") { resolve(editor.icons); } else { if (editor.ddInstance) { let promiseArr = []; let ddInstance = editor.ddInstance; editor.icons = {}; editor == null ? void 0 : editor.controls.forEach((controlDefine) => { let cacheData = localStorage.getItem("ICON-CACHE-" + controlDefine.id); if (cacheData) { editor.icons[controlDefine.id] = cacheData; return; } else { promiseArr.push(new Promise((resolve2, reject2) => { var _a3; let models = null; try { models = _DDeiEditorUtil2.createControl(controlDefine, editor); let iconPos = (_a3 = controlDefine == null ? void 0 : controlDefine.define) == null ? void 0 : _a3.iconPos; let outRect = DDeiAbstractShape.getOutRectByPV(models); outRect.width += (iconPos == null ? void 0 : iconPos.dw) ? iconPos.dw : 0; outRect.height += (iconPos == null ? void 0 : iconPos.dh) ? iconPos.dh : 0; let baseWidth = 50; let baseHeight = 50; if (outRect.width > 0 && outRect.height > 0) { if (outRect.width > outRect.height) { baseWidth *= outRect.width / outRect.height; } else { baseHeight *= outRect.height / outRect.width; } let scaleMatrix2 = new Matrix3( baseWidth / outRect.width, 0, 0, 0, baseHeight / outRect.height, 0, 0, 0, 1 ); models.forEach((model) => { model.transVectors(scaleMatrix2); }); outRect = DDeiAbstractShape.getOutRectByPV(models); } if (!outRect.height) { outRect.height = baseHeight; } if (!outRect.width) { outRect.width = baseWidth; } outRect.width += (iconPos == null ? void 0 : iconPos.dw) ? iconPos.dw : 0; outRect.height += (iconPos == null ? void 0 : iconPos.dh) ? iconPos.dh : 0; models.forEach((model) => { model.initRender(); model.render.drawShape({ weight: 3, border: { width: 1.5 } }); }); let canvas = document.createElement("canvas"); _DDeiEditorUtil2.drawModelsToCanvas(models, outRect, canvas); let dataURL = canvas.toDataURL("image/png"); localStorage.setItem("ICON-CACHE-" + controlDefine.id, dataURL); editor.icons[controlDefine.id] = dataURL; } catch (e) { if (editor.debug) { console.error(e); } } models == null ? void 0 : models.forEach((md) => { md == null ? void 0 : md.destroyed(); }); resolve2(); })); } }); Promise.all(promiseArr).then((all) => { ddInstance.render.tempCanvas = null; resolve(editor.icons); }); } } }); } /** * 将多个元素绘制到canvas上 */ static drawModelsToCanvas(models, outRect, canvas, level = 0) { var _a3; if ((models == null ? void 0 : models.length) > 0) { let stage2 = models[0].stage; let rat1 = (_a3 = stage2.ddInstance) == null ? void 0 : _a3.render.ratio; canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;zoom:" + 1 / rat1); let ctx = canvas.getContext("2d", { willReadFrequently: true }); let width = (outRect.width + 4) * rat1; let height = (outRect.height + 4) * rat1; if (level == 0) { canvas.setAttribute("width", width); canvas.setAttribute("height", height); canvas.style.width = width + "px"; canvas.style.height = height + "px"; } models.forEach((model) => { var _a22; let rendList = []; if (((_a22 = model.composes) == null ? void 0 : _a22.length) > 0) { rendList = rendList.concat(model.composes); } rendList.push(model); rendList.sort((a, b) => { if ((a.cIndex || a.cIndex == 0) && (b.cIndex || b.cIndex == 0)) { return a.cIndex - b.cIndex; } else if ((a.cIndex || a.cIndex == 0) && !(b.cIndex || b.cIndex == 0)) { return 1; } else if (!(a.cIndex || a.cIndex == 0) && (b.cIndex || b.cIndex == 0)) { return -1; } else { return 0; } }); rendList == null ? void 0 : rendList.forEach((mc) => { if (mc == model) { if (mc.render.tempCanvas) { if (mc.baseModelType != "DDeiLine") { ctx.drawImage(mc.render.tempCanvas, 0, 0, mc.render.tempCanvas.width, mc.render.tempCanvas.height, ((mc.essBounds ? mc.essBounds.x : mc.cpv.x) - outRect.x) * rat1, ((mc.essBounds ? mc.essBounds.y : mc.cpv.y) - outRect.y - 2) * rat1, mc.essBounds.width * rat1, mc.essBounds.height * rat1); } else { ctx.drawImage(mc.render.tempCanvas, 0, 0, mc.render.tempCanvas.width, mc.render.tempCanvas.height, (mc.cpv.x - outRect.x) * rat1, (mc.cpv.y - outRect.y) * rat1, outRect.width * rat1, outRect.height * rat1); } } if (model.baseModelType == "DDeiContainer") { _DDeiEditorUtil2.drawModelsToCanvas(Array.from(model.models.values()), outRect, canvas, level + 1); } } else { _DDeiEditorUtil2.drawModelsToCanvas([mc], outRect, canvas, level + 1); } }); }); } } /** * 清空控件小图标 */ static clearControlIcons(editor) { editor.icons = {}; editor == null ? void 0 : editor.controls.forEach((controlDefine) => { localStorage.removeItem("ICON-CACHE-" + controlDefine.id); }); } /** * 创建控件 */ static createControl(control, editor) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; let ddInstance = editor.ddInstance; ddInstance.render.inEdge = 0; let stage2 = ddInstance.stage; let layer2 = stage2.layers[stage2.layerIndex]; let models = []; let cc = control; let searchPaths = [ "width", "height", "text", "subcontrol", "layout" ]; let configAtrs = _DDeiEditorUtil2.getAttrValueByConfig( cc, searchPaths ); stage2.idIdx++; let dataJson = { id: cc.code + "_" + stage2.idIdx, modelCode: cc.id }; searchPaths.forEach((key) => { if (configAtrs.get(key)) { dataJson[key] = configAtrs.get(key).data; } if (cc[key] != void 0 && cc[key] != null) { dataJson[key] = cc[key]; } }); if (cc.img) { dataJson.fill = { type: 2, image: cc.img }; } for (let i2 in cc == null ? void 0 : cc.define) { dataJson[i2] = cloneDeep(cc.define[i2]); } for (let i2 in dataJson) { let value = dataJson[i2]; if (typeof value == "string") { dataJson[i2] = editor.i18n(value); } } (_a3 = dataJson.composes) == null ? void 0 : _a3.forEach((compose) => { for (let i2 in compose) { let value = compose[i2]; if (typeof value == "string") { compose[i2] = editor.i18n(value); } } }); delete dataJson.ovs; let model = editor.controlModelClasses[cc.type].initByJSON( dataJson, { currentStage: stage2, currentLayer: layer2, currentDdInstance: ddInstance } ); models.push(model); (_b2 = control.others) == null ? void 0 : _b2.forEach((oc) => { for (let i2 in oc) { let value = oc[i2]; if (typeof value == "string") { oc[i2] = editor.i18n(value); } } let otherModels = _DDeiEditorUtil2.createControl(oc, editor); if ((otherModels == null ? void 0 : otherModels.length) > 0) { models = models.concat(otherModels); } }); if (((_c2 = control == null ? void 0 : control.define) == null ? void 0 : _c2.create) == false) { models.splice(0, 1); } if ((_d2 = control == null ? void 0 : control.define) == null ? void 0 : _d2.iLinkModels) { for (let ilk in (_e2 = control == null ? void 0 : control.define) == null ? void 0 : _e2.iLinkModels) { let linkData = (_f = control == null ? void 0 : control.define) == null ? void 0 : _f.iLinkModels[ilk]; let cIndex = parseInt(ilk); if (cIndex != -1) { cIndex++; let linkControl = models[cIndex]; let lineLink = new DDeiModelLink({ depModel: cc, type: linkData.type, dm: linkControl, dx: linkData.dx, dy: linkData.dy }); linkControl.depModel = cc; models[0].linkModels.set(linkControl.id, lineLink); } } } if ((_g = control == null ? void 0 : control.define) == null ? void 0 : _g.initMerges) { let mergeControls = [models[0]]; for (let m in (_h = control == null ? void 0 : control.define) == null ? void 0 : _h.initMerges) { let mIndex = (_i = control == null ? void 0 : control.define) == null ? void 0 : _i.initMerges[m]; if (mIndex != -1) { mIndex++; let mControl = models[mIndex]; if (mergeControls.indexOf(mControl) == -1) { mergeControls.push(mControl); } } } if (mergeControls.length > 1) { ddInstance.stage.layers[ddInstance.stage.layerIndex]; (_j = ddInstance.stage) == null ? void 0 : _j.getStageRatio(); let outRect = DDeiAbstractShape.getOutRectByPV(mergeControls); let controlDefine = DDeiUtil$1.getControlDefine({ modelCode: "100202" }); let container2 = DDeiUtil$1.createControl(controlDefine, DDeiUtil$1.getEditorInsByDDei(ddInstance))[0]; container2.layout = "compose"; container2.layoutManager = DDeiLayoutManagerFactory.getLayoutInstance("compose"); container2.layoutManager.container = container2; container2.fill = { type: 0 }; container2.border = { type: 0 }; let m12 = new Matrix3(); let scaleMatrix2 = new Matrix3( outRect.width / container2.essBounds.width, 0, 0, 0, outRect.height / container2.essBounds.height, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); let moveMatrix2 = new Matrix3( 1, 0, outRect.x + outRect.width / 2, 0, 1, outRect.y + outRect.height / 2, 0, 0, 1 ); m12.premultiply(moveMatrix2); container2.transVectors(m12); mergeControls.forEach((mc) => { if (mc) { container2.addModel(mc, false); mc.pModel = container2; } }); container2 == null ? void 0 : container2.changeParentsBounds(); ddInstance.stage.idIdx++; models.splice(0, mergeControls.length, container2); } } return models; } /** * 执行调用回调函数 * @param ddInstance ddeis实例 * @param editor 设计器对象实例 */ static invokeCallbackFunc(name, operate, data, ddInstance, evt) { let result = 0; let editor = _DDeiEditorUtil2.getEditorInsByDDei(ddInstance); let selectAfter = DDeiUtil$1.getConfigValue(name, ddInstance); let funcArr = editor.funcIndex.get(name); let callResult = new DDeiFuncCallResult(); if (selectAfter) { let cr = selectAfter(operate, data, ddInstance, evt); callResult = cr ? cr : callResult; } if ((callResult == null ? void 0 : callResult.state) > 0) { result = 1; } else if ((callResult == null ? void 0 : callResult.state) < 0) { result = -1; } if (callResult.state == 0 || callResult.state == 1 || callResult.state == -1) { if ((funcArr == null ? void 0 : funcArr.length) > 0) { for (let fa = 0; fa < funcArr.length; fa++) { let func = funcArr[fa]["func"]; if (func) { callResult = func(operate, data, ddInstance, evt); if (callResult) { if (callResult.state > 0) { result = 1; } else if (callResult.state < 0) { result = -1; } if (!(callResult.state == 0 || callResult.state == 1 || callResult.state == -1)) { break; } } } } } } return result; } }; __publicField2(_DDeiEditorUtil, "recentlyToolGroups", null); __publicField2(_DDeiEditorUtil, "ICONS", null); let DDeiEditorUtil = _DDeiEditorUtil; const DDeiEditorUtil$1 = DDeiEditorUtil; class DDeiBusCommandChangeCursor extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { if ((data == null ? void 0 : data.passIndex) || (data == null ? void 0 : data.cursor) || (data == null ? void 0 : data.image)) { if (data.image) { document.body.style.cursor = "url(" + DDeiEditorUtil$1.ICONS[data.image] + "),auto"; } if (data.cursor) { document.body.style.cursor = data.cursor; } else if (data.passIndex) { if (bus.ddInstance.state != DDeiEnumState.IN_ACTIVITY) { let type = data == null ? void 0 : data.type; switch (type) { case "line": { switch (data.passIndex) { case 1: document.body.style.cursor = "grab"; break; case 2: document.body.style.cursor = "grab"; break; case 3: document.body.style.cursor = (data == null ? void 0 : data.direct) == 1 ? "ns-resize" : "ew-resize"; break; case 4: document.body.style.cursor = "grab"; break; default: document.body.style.cursor = "all-scroll"; break; } } break; default: { switch (data.passIndex) { case 1: document.body.style.cursor = "ns-resize"; break; case 2: document.body.style.cursor = "nesw-resize"; break; case 3: document.body.style.cursor = "ew-resize"; break; case 4: document.body.style.cursor = "nwse-resize"; break; case 5: document.body.style.cursor = "ns-resize"; break; case 6: document.body.style.cursor = "nesw-resize"; break; case 7: document.body.style.cursor = "ew-resize"; break; case 8: document.body.style.cursor = "nwse-resize"; break; case 9: document.body.style.cursor = "alias"; break; case 10: document.body.style.cursor = "all-scroll"; break; case 11: document.body.style.cursor = "alias"; break; case 13: document.body.style.cursor = "all-scroll"; break; default: document.body.style.cursor = "default"; break; } } } } } } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandChangeCursor({ code: DDeiEnumBusCommandType.ChangeCursor, name: "", desc: "" }); } } const __vite_glob_0_3$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandChangeCursor, default: DDeiBusCommandChangeCursor }, Symbol.toStringTag, { value: "Module" })); class DDeiCommandChangeEditMode extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let ddInstance = bus.ddInstance; if (ddInstance && (data == null ? void 0 : data.mode)) { ddInstance.changeEditMode(data.mode); } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiCommandChangeEditMode({ code: DDeiEnumBusCommandType.ChangeEditMode, name: "", desc: "" }); } } const __vite_glob_0_4$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiCommandChangeEditMode, default: DDeiCommandChangeEditMode }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandChangeLayout extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { var _a3; let stage2 = bus.ddInstance.stage; if (stage2 && ((_a3 = data == null ? void 0 : data.mids) == null ? void 0 : _a3.length) > 0) { let mids = data.mids; let value = data.value; let attrDefine = data.attrDefine; if (attrDefine.modelCode == "DDeiTableCell") { let modelId = mids[0]; let table2 = stage2 == null ? void 0 : stage2.getModelById(modelId); if (table2) { let cells = table2.getSelectedCells(); for (let i2 = 0; i2 < cells.length; i2++) { let cell = cells[i2]; let oldLayout = cell.layout; if (value != oldLayout) { let newLayoutManager = DDeiLayoutManagerFactory.getLayoutInstance(value); newLayoutManager.container = cell; let canConvert = newLayoutManager.canConvertLayout(oldLayout); if (!canConvert) { return false; } } } } } else { for (let i2 = 0; i2 < mids.length; i2++) { let modelId = mids[i2]; if (modelId) { let model = stage2 == null ? void 0 : stage2.getModelById(modelId); if (model) { let oldLayout = model.layout; if (value != oldLayout) { let newLayoutManager = DDeiLayoutManagerFactory.getLayoutInstance(value); newLayoutManager.container = model; let canConvert = newLayoutManager.canConvertLayout(oldLayout); if (!canConvert) { return false; } } } } } } return true; } } /** * 具体行为,设置属性值 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2; let stage2 = bus.ddInstance.stage; if (stage2 && ((_a3 = data == null ? void 0 : data.mids) == null ? void 0 : _a3.length) > 0 && ((_b2 = data == null ? void 0 : data.paths) == null ? void 0 : _b2.length) > 0) { let mids = data.mids; let value = data.value; let attrDefine = data.attrDefine; if (attrDefine.modelCode == "DDeiTableCell") { let modelId = mids[0]; let table2 = stage2 == null ? void 0 : stage2.getModelById(modelId); if (table2) { let cells = table2.getSelectedCells(); for (let i2 = 0; i2 < cells.length; i2++) { let cell = cells[i2]; let oldLayout = cell.layout; cell.layout = value; (_c2 = cell.render) == null ? void 0 : _c2.setCachedValue("layout", value); cell.layoutManager = DDeiLayoutManagerFactory.getLayoutInstance(value); cell.layoutManager.container = cell; cell.layoutManager.convertLayout(oldLayout); cell.layoutManager.changeSubModelBounds(); } bus.insert(DDeiEnumBusCommandType.NodifyChange, null, evt, 0); bus.insert(DDeiEnumBusCommandType.AddHistroy, null, evt, 1); } } else { mids.forEach((modelId) => { var _a22; if (modelId) { let model = stage2 == null ? void 0 : stage2.getModelById(modelId); if (model) { let oldLayout = model.layout; model.layout = value; (_a22 = model.render) == null ? void 0 : _a22.setCachedValue("layout", value); model.layoutManager = DDeiLayoutManagerFactory.getLayoutInstance(value); model.layoutManager.container = model; model.layoutManager.convertLayout(oldLayout); model.layoutManager.changeSubModelBounds(); } } }); bus.insert(DDeiEnumBusCommandType.NodifyChange, null, evt, 0); bus.insert(DDeiEnumBusCommandType.AddHistroy, null, evt, 1); } return true; } return false; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandChangeLayout({ code: DDeiEnumBusCommandType.ChangeLayout, name: "", desc: "" }); } } const __vite_glob_0_5$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandChangeLayout, default: DDeiBusCommandChangeLayout }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandChangeLinePoint extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,重绘所有图形 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3; let stage2 = bus.ddInstance.stage; let stageRender = stage2 == null ? void 0 : stage2.render; let ex = (data == null ? void 0 : data.ex) ? data.ex : 0; let ey = (data == null ? void 0 : data.ey) ? data.ey : 0; if ((stageRender == null ? void 0 : stageRender.dragObj) && ((_a3 = stageRender.dragObj) == null ? void 0 : _a3.model) && (ex || ey)) { let lineModel = stageRender.dragObj.model; let passIndex = stageRender.dragObj.passIndex; let opvsIndex = stageRender.dragObj.opvsIndex; let opvs = stageRender.dragObj.opvs; let pvs2 = lineModel.pvs; let create = stageRender.dragObj.create; switch (lineModel.type) { case 1: { if (passIndex == 1 && opvsIndex == 0) { lineModel.setLineType1PointPosition(0, ex, ey); } else if (passIndex == 1 && opvsIndex == opvs.length - 1) { lineModel.setLineType1PointPosition(1, ex, ey); } } break; case 2: { if (passIndex == 1 && opvsIndex == 0) { if (pvs2.length > 2) { let otherP = pvs2[1]; if (Math.abs(pvs2[0].x - otherP.x) <= 1) { otherP.x = ex; } else { otherP.y = ey; } } pvs2[0].x = ex; pvs2[0].y = ey; } else if (passIndex == 1 && opvsIndex == opvs.length - 1) { if (create) { pvs2[pvs2.length - 1].x = ex; pvs2[pvs2.length - 1].y = ey; } else { if (pvs2.length > 2) { let otherP = pvs2[pvs2.length - 2]; if (Math.abs(pvs2[pvs2.length - 1].x - otherP.x) <= 1) { otherP.x = ex; } else { otherP.y = ey; } } pvs2[pvs2.length - 1].x = ex; pvs2[pvs2.length - 1].y = ey; } } else if (passIndex == 2) { let cIndex = parseInt(opvsIndex / 2); let cp = pvs2[cIndex]; let bp = pvs2[cIndex - 1]; let ap = pvs2[cIndex + 1]; let startPoint = lineModel.startPoint; if (Math.abs(cp.x - bp.x) <= 1) { bp.x = ex; bp.x = ex; lineModel.spvs[cIndex] = { x: ex - startPoint.x, y: 0 }; } else { bp.y = ey; bp.y = ey; lineModel.spvs[cIndex] = { x: 0, y: ey - startPoint.y }; } if (Math.abs(cp.x - ap.x) <= 1) { ap.x = ex; ap.x = ex; lineModel.spvs[cIndex + 1] = { x: ex - startPoint.x, y: 0 }; } else { ap.y = ey; ap.y = ey; lineModel.spvs[cIndex + 1] = { x: 0, y: ey - startPoint.y }; } cp.x = ex; cp.y = ey; } else if (passIndex == 3) { let startPoint = lineModel.startPoint; let sIndex = parseInt(opvsIndex / 2); let sp = pvs2[sIndex]; let ep = pvs2[sIndex + 1]; if (sp && ep) { if (Math.abs(sp.x - ep.x) <= 1) { sp.x = ex; ep.x = ex; lineModel.spvs[sIndex + 1] = { x: ex - startPoint.x, y: 0 }; } else { sp.y = ey; ep.y = ey; lineModel.spvs[sIndex + 1] = { x: 0, y: ey - startPoint.y }; } } } } break; case 3: { if (passIndex == 1) { if (opvsIndex == 0) { pvs2[0].x = ex; pvs2[0].y = ey; } else { pvs2[pvs2.length - 1].x = ex; pvs2[pvs2.length - 1].y = ey; } lineModel.freeze = 0; } else if (passIndex == 4) { let lineIndex = parseInt(opvsIndex / 3); let oitype = opvsIndex % 2; let i0 = lineIndex * 3; let i1 = i0 + 1; let i2 = i0 + 2; let i3 = i0 + 3; if (opvs.length > 4) { if (opvsIndex % 3 == 0) { oitype = 2; } else { oitype = opvsIndex % 3 % 2; } } if (oitype == 1) { pvs2[i1].x = -(pvs2[i0].x * DDeiUtil$1.p331t3 + DDeiUtil$1.p33t21t3 * pvs2[i2].x + DDeiUtil$1.p33t3 * pvs2[i3].x - ex) / DDeiUtil$1.p331t2t3; pvs2[i1].y = -(pvs2[i0].y * DDeiUtil$1.p331t3 + DDeiUtil$1.p33t21t3 * pvs2[i2].y + DDeiUtil$1.p33t3 * pvs2[i3].y - ey) / DDeiUtil$1.p331t2t3; lineModel.spvs[i1] = true; } else if (oitype == 2) { let dx = ex - pvs2[opvsIndex].x; let dy = ey - pvs2[opvsIndex].y; pvs2[opvsIndex].x = ex; pvs2[opvsIndex].y = ey; pvs2[opvsIndex - 1].x += dx; pvs2[opvsIndex - 1].y += dy; pvs2[opvsIndex + 1].x += dx; pvs2[opvsIndex + 1].y += dy; } else { pvs2[i2].x = -(pvs2[i0].x * DDeiUtil$1.p661t3 + DDeiUtil$1.p661t2t3 * pvs2[i1].x + DDeiUtil$1.p66t3 * pvs2[i3].x - ex) / DDeiUtil$1.p66t21t3; pvs2[i2].y = -(pvs2[i0].y * DDeiUtil$1.p661t3 + DDeiUtil$1.p661t2t3 * pvs2[i1].y + DDeiUtil$1.p66t3 * pvs2[i3].y - ey) / DDeiUtil$1.p66t21t3; lineModel.spvs[i2] = true; } lineModel.freeze = 1; } } break; } lineModel.calPoints(); return true; } } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { var _a3, _b2; (_b2 = (_a3 = bus.ddInstance) == null ? void 0 : _a3.bus) == null ? void 0 : _b2.insert(DDeiEnumBusCommandType.ChangeCursor, { cursor: "default" }, evt); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandChangeLinePoint({ code: DDeiEnumBusCommandType.ChangeLinePoint, name: "", desc: "" }); } } const __vite_glob_0_6$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandChangeLinePoint, default: DDeiBusCommandChangeLinePoint }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandChangeSelectorPassIndex extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let stage2 = bus.ddInstance.stage; if (stage2 && stage2.render.selector && (data == null ? void 0 : data.passIndex)) { stage2.render.selector.setPassIndex(data == null ? void 0 : data.type, data == null ? void 0 : data.passIndex, data == null ? void 0 : data.opvsIndex); } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.ChangeCursor, { type: data == null ? void 0 : data.type, passIndex: data == null ? void 0 : data.passIndex, direct: data == null ? void 0 : data.direct }, evt); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandChangeSelectorPassIndex({ code: DDeiEnumBusCommandType.ChangeSelectorPassIndex, name: "", desc: "" }); } } const __vite_glob_0_7$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandChangeSelectorPassIndex, default: DDeiBusCommandChangeSelectorPassIndex }, Symbol.toStringTag, { value: "Module" })); const _DDeiBusCommandChangeStageRatio = class _DDeiBusCommandChangeStageRatio2 extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,重绘所有图形 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3; if (DDeiUtil$1.getConfigValue("GLOBAL_ALLOW_STAGE_RATIO", bus.ddInstance)) { let stage2 = bus.ddInstance.stage; if (stage2 && data.oldValue && data.newValue && data.oldValue != data.newValue) { let scaleSize = data.newValue / data.oldValue; (/* @__PURE__ */ new Date()).getTime(); stage2.layers.forEach((layer2) => { var _a22; layer2.opPoints = []; delete layer2.opLine; (_a22 = layer2.shadowControls) == null ? void 0 : _a22.forEach((c) => { c.destroyed(); }); layer2.shadowControls = []; layer2.midList.forEach((mid) => { var _a32, _b2, _c2; let model = layer2.models.get(mid); if (model.baseModelType == "DDeiLine") { model.updateLooseCanvas(); } (_b2 = (_a32 = model.getTopContainer()) == null ? void 0 : _a32.render) == null ? void 0 : _b2.enableRefreshShape(); (_c2 = model.render) == null ? void 0 : _c2.enableRefreshShape(); }); (/* @__PURE__ */ new Date()).getTime(); }); let oldWidth = stage2.width; let oldHeight = stage2.height; stage2.width = stage2.width * scaleSize; stage2.height = stage2.height * scaleSize; let dw = stage2.width - oldWidth; let dh = stage2.height - oldHeight; let wpvX = -stage2.wpv.x; let wpvY = -stage2.wpv.y; let ex = null, ey = null; if (((_a3 = window.event) == null ? void 0 : _a3.type) == "wheel") { let evt2 = window.event; ex = evt2.offsetX; ey = evt2.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= stage2.wpv.x; ey -= stage2.wpv.y; } let ox = dw / 2; let oy = dh / 2; if (ex && ey) { ox = dw * ex / oldWidth; oy = dh * ey / oldHeight; } let w = stage2.ddInstance.render.canvas.width / stage2.ddInstance.render.ratio; let h = stage2.ddInstance.render.canvas.height / stage2.ddInstance.render.ratio; if (w < stage2.width) { stage2.wpv.x = -wpvX - ox; } else { stage2.wpv.x = 0; } if (h < stage2.height) { stage2.wpv.y = -wpvY - oy; } else { stage2.wpv.y = 0; } DDeiEditorUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "CHANGE_RATIO", null, stage2.ddInstance, evt); DDeiEditorUtil$1.invokeCallbackFunc("EVENT_STAGE_CHANGE_RATIO", "CHANGE_RATIO", data, stage2.ddInstance, evt); return true; } } return false; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus.insert(DDeiEnumBusCommandType.UpdateSelectorBounds, null, evt, 0); bus.insert(DDeiEnumBusCommandType.RefreshShape, null, evt, 1); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new _DDeiBusCommandChangeStageRatio2({ code: DDeiEnumBusCommandType.ChangeStageRatio, name: "", desc: "" }); } }; _DDeiBusCommandChangeStageRatio.calLineCross = debounce(DDeiLine.calLineCross, 30); let DDeiBusCommandChangeStageRatio = _DDeiBusCommandChangeStageRatio; const __vite_glob_0_8$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandChangeStageRatio, default: DDeiBusCommandChangeStageRatio }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandChangeStageWPV extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,重绘所有图形 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2, _d2; let stage2 = bus.ddInstance.stage; if (stage2) { let rat1 = stage2.ddInstance.render.ratio; let stageRatio2 = stage2.getStageRatio(); let ratio = rat1 * stageRatio2; let hScrollWidth = ((_a3 = stage2.render.hScroll) == null ? void 0 : _a3.width) ? (_b2 = stage2.render.hScroll) == null ? void 0 : _b2.width : 0; let vScrollHeight = ((_c2 = stage2.render.vScroll) == null ? void 0 : _c2.height) ? (_d2 = stage2.render.vScroll) == null ? void 0 : _d2.height : 0; let oldWPV = clone(stage2.wpv); let x2 = data.x; let y2 = data.y; let dragObj = data.dragObj; if (hScrollWidth) { stage2.wpv.x += (x2 - dragObj.dx) / ratio; } if (vScrollHeight) { stage2.wpv.y += (y2 - dragObj.dy) / ratio; } if (stage2.wpv.x > 0) { stage2.wpv.x = 0; } else if (stage2.wpv.x < -stage2.width + hScrollWidth) { stage2.wpv.x = -stage2.width + hScrollWidth; } if (stage2.wpv.y > 0) { stage2.wpv.y = 0; } else if (stage2.wpv.y < -stage2.height + vScrollHeight) { stage2.wpv.y = -stage2.height + vScrollHeight; } DDeiEditorUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "CHANGE_WPV", null, stage2.ddInstance, evt); DDeiEditorUtil$1.invokeCallbackFunc("EVENT_STAGE_CHANGE_WPV", "CHANGE_WPV", { oldWPV, wpv: stage2.wpv }, stage2.ddInstance, evt); return true; } else { return false; } } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "grabbing" }); bus.push(DDeiEnumBusCommandType.RefreshShape); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandChangeStageWPV({ code: DDeiEnumBusCommandType.ChangeStageWPV, name: "", desc: "" }); } } const __vite_glob_0_9$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandChangeStageWPV, default: DDeiBusCommandChangeStageWPV }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandClearTemplateVars extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let stage2 = bus.ddInstance.stage; if (stage2) { stage2.render.currentOperateShape = null; stage2.render.operateState = DDeiEnumOperateState.NONE; stage2.render.dragObj = null; stage2.render.isHAds = false; stage2.render.isVAds = false; stage2.render.vAdsX = Infinity; stage2.render.hAdsY = Infinity; stage2.render.tempSX = null; stage2.render.tempSY = null; stage2.ddInstance.render.inEdge = 0; stage2.render.selector.setPassIndex("", -1, -1); delete stage2.tempStartOPpoint; delete stage2.tempCursorOPpoint; delete stage2.render.linePathData; delete stage2.ddInstance.render.inAreaControls; } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandClearTemplateVars({ code: DDeiEnumBusCommandType.ClearTemplateVars, name: "", desc: "" }); } } const __vite_glob_0_10$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandClearTemplateVars, default: DDeiBusCommandClearTemplateVars }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandCreateDepLinkModel extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,重绘所有图形 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let ddInstance = bus.ddInstance; let stage2 = ddInstance.stage; let text2 = data.text; let model = data.model ? data.model : stage2.selectedModels.size == 1 ? Array.from(stage2.selectedModels.values())[0] : null; DDeiUtil$1.createDepLinkModel(model, text2); return true; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandCreateDepLinkModel({ code: DDeiEnumBusCommandType.CreateDepLinkModel, name: "", desc: "" }); } } const __vite_glob_0_11$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandCreateDepLinkModel, default: DDeiBusCommandCreateDepLinkModel }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelAlign extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置属性值 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3; let stage2 = bus.ddInstance.stage; if (stage2 && ((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0 && (data == null ? void 0 : data.value)) { let models = data.models; let filtedModels = []; models.forEach((m) => { if (m.baseModelType != "DDeiLine") { filtedModels.push(m); } }); if ((filtedModels == null ? void 0 : filtedModels.length) > 1) { let baseModel = filtedModels[0]; let baseOutRect = DDeiAbstractShape.getOutRectByPV([baseModel]); let hasChange = false; for (let i2 = 1; i2 < filtedModels.length; i2++) { let model = filtedModels[i2]; let moveMatrix2 = null; let outRect = DDeiAbstractShape.getOutRectByPV([model]); if (data.value == "left") { moveMatrix2 = new Matrix3( 1, 0, baseOutRect.x - outRect.x, 0, 1, 0, 0, 0, 1 ); } else if (data.value == "center") { moveMatrix2 = new Matrix3( 1, 0, baseOutRect.x + baseOutRect.width / 2 - outRect.x - outRect.width / 2, 0, 1, 0, 0, 0, 1 ); } else if (data.value == "right") { moveMatrix2 = new Matrix3( 1, 0, baseOutRect.x + baseOutRect.width - outRect.x - outRect.width, 0, 1, 0, 0, 0, 1 ); } else if (data.value == "top") { moveMatrix2 = new Matrix3( 1, 0, 0, 0, 1, baseOutRect.y - outRect.y, 0, 0, 1 ); } else if (data.value == "middle") { moveMatrix2 = new Matrix3( 1, 0, 0, 0, 1, baseOutRect.y + baseOutRect.height / 2 - outRect.y - outRect.height / 2, 0, 0, 1 ); } else if (data.value == "bottom") { moveMatrix2 = new Matrix3( 1, 0, 0, 0, 1, baseOutRect.y + baseOutRect.height - outRect.y - outRect.height, 0, 0, 1 ); } if (moveMatrix2) { model.transVectors(moveMatrix2); model.updateLinkModels(); hasChange = true; } } if (hasChange) { bus.push(DDeiEnumBusCommandType.NodifyChange); bus.insert(DDeiEnumBusCommandType.AddHistroy); } bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); bus.push(DDeiEnumBusCommandType.RefreshShape); return true; } } return false; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelAlign({ code: DDeiEnumBusCommandType.ModelAlign, name: "", desc: "" }); } } const __vite_glob_0_12$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelAlign, default: DDeiBusCommandModelAlign }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelAutoPos extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置属性值 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3; let stage2 = bus.ddInstance.stage; if (stage2 && ((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0 && (data == null ? void 0 : data.value)) { let models = data.models; let filtedModels = []; models.forEach((m) => { if (m.baseModelType != "DDeiLine") { filtedModels.push(m); } }); if ((filtedModels == null ? void 0 : filtedModels.length) > 1) { let weight = 0; let hasChange = false; let startValue = -Infinity; let ourRects = []; for (let i2 = 0; i2 < filtedModels.length; i2++) { let model = filtedModels[i2]; let outRect = DDeiAbstractShape.getOutRectByPV([model]); outRect.model = model; ourRects.push(outRect); } if (data.value == 1) { ourRects.sort((m12, m2) => { return m12.model.x - m2.model.x; }); } else if (data.value == 2) { ourRects.sort((m12, m2) => { return m12.model.y - m2.model.y; }); } let sumWeight = 0; for (let i2 = 0; i2 < ourRects.length - 1; i2++) { let m12 = ourRects[i2]; let m2 = ourRects[i2 + 1]; if (data.value == 1) { sumWeight += m2.x - (m12.x + m12.width); } else if (data.value == 2) { sumWeight += m2.y - (m12.y + m12.height); } } weight = sumWeight / (ourRects.length - 1); for (let i2 = 1; i2 < ourRects.length; i2++) { let outRect = ourRects[i2]; let model = outRect.model; if (data.value == 1) { if (startValue == -Infinity) { startValue = ourRects[0].x1; } startValue += weight; if (outRect.x != startValue) { let dx = startValue - outRect.x; let moveMatrix2 = new Matrix3( 1, 0, dx, 0, 1, 0, 0, 0, 1 ); model.transVectors(moveMatrix2); model.updateLinkModels(); hasChange = true; } startValue += outRect.width; } else if (data.value == 2) { if (startValue == -Infinity) { startValue = ourRects[0].y1; } startValue += weight; if (outRect.y != startValue) { let dy = startValue - outRect.y; let moveMatrix2 = new Matrix3( 1, 0, 0, 0, 1, dy, 0, 0, 1 ); model.transVectors(moveMatrix2); model.updateLinkModels(); hasChange = true; } startValue += outRect.height; } } if (hasChange) { bus.push(DDeiEnumBusCommandType.NodifyChange); bus.insert(DDeiEnumBusCommandType.AddHistroy); } bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); bus.push(DDeiEnumBusCommandType.RefreshShape); return true; } } return false; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelAutoPos({ code: DDeiEnumBusCommandType.ModelAutoPos, name: "", desc: "" }); } } const __vite_glob_0_13$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelAutoPos, default: DDeiBusCommandModelAutoPos }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelCancelMerge extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置属性值 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let ddInstance = bus.ddInstance; if (ddInstance && ddInstance.stage) { let layer2 = ddInstance.stage.layers[ddInstance.stage.layerIndex]; let selectedModels = layer2.getSelectedModels(); if (selectedModels.size > 0) { let models = Array.from(selectedModels.values()); let insertIndex = 0; models.forEach((item) => { if (item.baseModelType == "DDeiContainer") { if (item.models && item.models.size > 0) { ddInstance.bus.insert(DDeiEnumBusCommandType.ModelChangeContainer, { oldContainer: layer2, models: [item], skpiValid: true }, evt, insertIndex); insertIndex++; ddInstance.bus.insert(DDeiEnumBusCommandType.ModelChangeSelect, { models: [item], value: DDeiEnumControlState.DEFAULT }, evt, insertIndex); insertIndex++; let models2 = Array.from(item.models.values()); ddInstance.bus.insert(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: layer2, oldContainer: item, models: models2, skpiValid: true }, evt, insertIndex); insertIndex++; ddInstance.bus.insert(DDeiEnumBusCommandType.ModelChangeSelect, { models: models2, value: DDeiEnumControlState.SELECTED }, evt, insertIndex); insertIndex++; ddInstance.bus.insert(DDeiEnumBusCommandType.StageChangeSelectModels, null, evt, insertIndex); insertIndex++; ddInstance.bus.insert(DDeiEnumBusCommandType.ModelRemove, { models: [item], destroy: true }, evt, insertIndex); insertIndex++; } } }); ddInstance.bus.insert(DDeiEnumBusCommandType.ClearTemplateVars, null, evt, insertIndex); insertIndex++; ddInstance.bus.insert(DDeiEnumBusCommandType.AddHistroy, null, evt, insertIndex); ddInstance.bus.insert(DDeiEnumBusCommandType.NodifyChange, null, evt, insertIndex); insertIndex++; ddInstance.bus.insert(DDeiEnumBusCommandType.RefreshShape, null, evt, insertIndex); return true; } } return false; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelCancelMerge({ code: DDeiEnumBusCommandType.ModelCancelMerge, name: "", desc: "" }); } } const __vite_glob_0_14$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelCancelMerge, default: DDeiBusCommandModelCancelMerge }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelChangeBounds extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3; if (((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0) { DDeiEditorUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "CHANGE_BOUNDS", data, bus.ddInstance, evt); DDeiAbstractShape.changeModelBoundByRect(data.models, data.selector, data); return true; } return false; } /** * 后置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { var _a3; let stage2 = bus.ddInstance.stage; bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.UpdateSelectorBounds, { models: (_a3 = stage2 == null ? void 0 : stage2.layers[stage2 == null ? void 0 : stage2.layerIndex]) == null ? void 0 : _a3.shadowControls }, evt); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelChangeBounds({ code: DDeiEnumBusCommandType.ModelChangeBounds, name: "", desc: "" }); } } const __vite_glob_0_15$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelChangeBounds, default: DDeiBusCommandModelChangeBounds }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelChangeContainer extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2; if (data == null ? void 0 : data.models) { let oldContainer = data.oldContainer; let newContainer = data.newContainer; if (newContainer) { let models = data.models; let operateModels = []; models.forEach((item, key) => { if (item.id.lastIndexOf("_shadow") != -1) { let id = item.id.substring(item.id, item.id.lastIndexOf("_shadow")); item = bus.ddInstance.stage.getModelById(id); } operateModels.push(item); }); if (operateModels.length > 0) { if (!oldContainer && operateModels[0].pModel) { oldContainer = operateModels[0].pModel; } if (oldContainer) { let sortOperateModels = []; let appendTailModels = []; operateModels.forEach((md) => { let index = oldContainer == null ? void 0 : oldContainer.midList.indexOf(md.id); if (index != -1) { sortOperateModels[index] = md; } else { appendTailModels.push(md); } }); appendTailModels.forEach((m) => { sortOperateModels.push(m); }); operateModels = sortOperateModels; } if (newContainer.baseModelType == "DDeiLayer" && !newContainer.layoutManager) { let freeLayoutManager = DDeiLayoutManagerFactory.getLayoutInstance("free"); freeLayoutManager.container = newContainer; newContainer.layoutManager = freeLayoutManager; } if (data.skipValid || ((_a3 = newContainer.layoutManager) == null ? void 0 : _a3.canAppend(evt == null ? void 0 : evt.offsetX, evt == null ? void 0 : evt.offsetY, operateModels))) { let successAppend = (_b2 = newContainer.layoutManager) == null ? void 0 : _b2.append(evt == null ? void 0 : evt.offsetX, evt == null ? void 0 : evt.offsetY, operateModels); if (successAppend) { if (oldContainer) { oldContainer.changeParentsBounds(); } newContainer == null ? void 0 : newContainer.changeParentsBounds(); (_c2 = newContainer == null ? void 0 : newContainer.layoutManager) == null ? void 0 : _c2.updateLayout(evt == null ? void 0 : evt.offsetX, evt == null ? void 0 : evt.offsetY, operateModels); } } } } return true; } return false; } /** * 后置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.UpdateSelectorBounds, null, evt); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelChangeContainer({ code: DDeiEnumBusCommandType.ModelChangeContainer, name: "", desc: "" }); } } const __vite_glob_0_16$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelChangeContainer, default: DDeiBusCommandModelChangeContainer }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelChangePosition extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { var _a3; if (((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0) { let models = data.models; for (let i2 = 0; i2 < models.length; i2++) { let parentContainer = data == null ? void 0 : data.models[i2].pModel; if (parentContainer == null ? void 0 : parentContainer.layoutManager) { if (!parentContainer.layoutManager.canChangePosition(data.x, data.y, models, data.isAlt)) { bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.ChangeCursor, { cursor: "not-allowed" }, evt); return false; } } } } return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; if (((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0) { let x2 = data.x ? data.x : 0; let y2 = data.y ? data.y : 0; let dragObj = data.dragObj; let changeContainer = data.changeContainer ? data.changeContainer : false; let newContainer = data.newContainer; let oldContainer = data.oldContainer; let sample = data.sample; let models = data.models; let stage2 = bus.ddInstance.stage; let stageRatio2 = stage2 == null ? void 0 : stage2.getStageRatio(); let fModel = null; if (models[0].id.lastIndexOf("_shadow") != -1) { fModel = stage2 == null ? void 0 : stage2.getModelById(models[0].id.substring(models[0].id, models[0].id.lastIndexOf("_shadow"))); } else { fModel = models[0]; } let hAds = ((_b2 = fModel.stage.render.helpLines) == null ? void 0 : _b2.hAds) || ((_c2 = fModel.stage.render.helpLines) == null ? void 0 : _c2.hAds) == 0 ? (_d2 = fModel.stage.render.helpLines) == null ? void 0 : _d2.hAds : Infinity; let vAds = ((_e2 = fModel.stage.render.helpLines) == null ? void 0 : _e2.vAds) || ((_f = fModel.stage.render.helpLines) == null ? void 0 : _f.vAds) == 0 ? (_g = fModel.stage.render.helpLines) == null ? void 0 : _g.vAds : Infinity; let hAdsValue = Infinity; let vAdsValue = Infinity; if (hAds != Infinity) { if (stage2.render.isHAds && Math.abs(stage2.render.hAdsY - y2) > bus.ddInstance.GLOBAL_ADV_WEIGHT) { stage2.render.isHAds = false; stage2.render.hAdsY = Infinity; } else if (stage2.render.isHAds) { hAdsValue = 0; } else { stage2.render.isHAds = true; hAdsValue = -hAds; stage2.render.hAdsY = y2; } } if (vAds != Infinity) { if (stage2.render.isVAds && Math.abs(stage2.render.vAdsX - x2) > bus.ddInstance.GLOBAL_ADV_WEIGHT) { stage2.render.isVAds = false; stage2.render.vAdsX = Infinity; } else if (stage2.render.isVAds) { vAdsValue = 0; } else { stage2.render.isVAds = true; vAdsValue = -vAds; stage2.render.vAdsX = x2; } } let ignoreModelIds = []; models.forEach((model) => { var _a22, _b22, _c22, _d22, _e22, _f2; ignoreModelIds.push(model.id); let dx = 0; let dy = 0; if (dragObj && dragObj[model.id]) { dx = ((_a22 = dragObj[model.id]) == null ? void 0 : _a22.dx) ? (_b22 = dragObj[model.id]) == null ? void 0 : _b22.dx : 0; dy = ((_c22 = dragObj[model.id]) == null ? void 0 : _c22.dy) ? (_d22 = dragObj[model.id]) == null ? void 0 : _d22.dy : 0; } let xm = x2 / stageRatio2 - model.cpv.x + dx; let ym = y2 / stageRatio2 - model.cpv.y + dy; if (hAdsValue != Infinity) { ym = hAdsValue; } if (vAdsValue != Infinity) { xm = vAdsValue; } let moveMatrix2 = new Matrix3( 1, 0, xm, 0, 1, ym, 0, 0, 1 ); model.transVectors(moveMatrix2, { skipSample: sample == 1 ? false : true }); (_f2 = (_e22 = model.pModel) == null ? void 0 : _e22.render) == null ? void 0 : _f2.enableRefreshShape(); }); let rsState = DDeiUtil$1.invokeCallbackFunc("EVENT_CONTROL_DRAGING", DDeiEnumOperateType.DRAG, { models }, stage2.ddInstance, evt); if (rsState == 0 || rsState == 1) { DDeiUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "DRAG", { models }, stage2.ddInstance, evt); models[0].layer.dragInPoints = []; models[0].layer.dragOutPoints = []; if (oldContainer && newContainer && oldContainer != newContainer) { (_h = oldContainer == null ? void 0 : oldContainer.layoutManager) == null ? void 0 : _h.calDragOutPVS(data.x, data.y, models); (_i = newContainer == null ? void 0 : newContainer.layoutManager) == null ? void 0 : _i.calDragInPVS(data.x, data.y, models); } else if (oldContainer) { (_j = oldContainer == null ? void 0 : oldContainer.layoutManager) == null ? void 0 : _j.calDragOutPVS(data.x, data.y, models); (_k = oldContainer == null ? void 0 : oldContainer.layoutManager) == null ? void 0 : _k.calDragInPVS(data.x, data.y, models); } if (stage2.render.selector.passIndex == 10 || stage2.render.selector.passIndex == 13 || stage2.render.selector.passIndex == 11) { if (changeContainer) { if (newContainer.baseModelType == "DDeiLayer" && !newContainer.layoutManager) { let freeLayoutManager = DDeiLayoutManagerFactory.getLayoutInstance("free"); freeLayoutManager.container = newContainer; newContainer.layoutManager = freeLayoutManager; } if (newContainer.id != oldContainer.id) { if ((_l = newContainer == null ? void 0 : newContainer.layoutManager) == null ? void 0 : _l.canAppend(data.x, data.y, models)) { bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 11 }, evt); } else { bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.ChangeCursor, { cursor: "not-allowed" }, evt); } } else { bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 10 }, evt); } } else { bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: stage2.render.selector.passIndex }, evt); } } } return true; } return false; } /** * 后置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelChangePosition({ code: DDeiEnumBusCommandType.ModelChangePosition, name: "", desc: "" }); } } const __vite_glob_0_17$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelChangePosition, default: DDeiBusCommandModelChangePosition }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelChangeRotate extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { var _a3; if ((data.ex || data.ey) && ((_a3 = data.models) == null ? void 0 : _a3.length) > 0) { return true; } return false; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2; let stage2 = bus.ddInstance.stage; let selector = stage2.render.selector; let x2 = data.ex ? data.ex : 0, y2 = data.ey ? data.ey : 0; let pContainerModel = data.container; let ratio = stage2 == null ? void 0 : stage2.getStageRatio(); let models = data.models; DDeiEditorUtil$1.invokeCallbackFunc("EVENT_MOUSE_OPERATING", "CHANGE_ROTATE", { models }, bus.ddInstance, evt); let scx = selector.x * ratio + selector.width / 2 * ratio; let scy = selector.y * ratio + selector.height / 2 * ratio; let selectorAngle = Math.round(DDeiUtil$1.getLineAngle(scx, scy, x2, y2)); let rotate2 = selectorAngle + 90; let selectorRotate = selector.rotate; let angle2 = -DDeiUtil$1.preciseTimes(rotate2 - selectorRotate, DDeiConfig$1.ROTATE_UNIT); let move1Matrix = new Matrix3( 1, 0, -scx, 0, 1, -scy, 0, 0, 1 ); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); let move2Matrix = new Matrix3( 1, 0, scx, 0, 1, scy, 0, 0, 1 ); let m12 = new Matrix3().premultiply(move1Matrix).premultiply(rotateMatrix).premultiply(move2Matrix); for (let i2 = 0; i2 < models.length; i2++) { let item = models[i2]; item.transVectors(m12); item.updateLinkModels(); (_b2 = (_a3 = item.getTopContainer()) == null ? void 0 : _a3.render) == null ? void 0 : _b2.enableRefreshShape(); (_c2 = item.render) == null ? void 0 : _c2.enableRefreshShape(); } selector.transVectors(m12); pContainerModel.changeParentsBounds(); stage2.render.helpLines = { rect: { x: scx, y: scy, rotate: rotate2 < 0 ? 360 + rotate2 : rotate2 } }; return true; } /** * 后置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelChangeRotate({ code: DDeiEnumBusCommandType.ModelChangeRotate, name: "", desc: "" }); } } const __vite_glob_0_18$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelChangeRotate, default: DDeiBusCommandModelChangeRotate }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelChangeSelect extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2; if (Array.isArray(data)) { let models = data; let stage2 = bus.ddInstance.stage; for (let i2 = 0; i2 < models.length; i2++) { if (models[i2]) { let newData = models[i2]; let newValue = newData.value; let model = stage2 == null ? void 0 : stage2.getModelById(newData.id); if (model) { if (model.state != newValue) { model.state = newValue; (_b2 = (_a3 = model.getTopContainer()) == null ? void 0 : _a3.render) == null ? void 0 : _b2.enableRefreshShape(); (_c2 = model.render) == null ? void 0 : _c2.enableRefreshShape(); } } } } return true; } else if (typeof data == "object") { let models = data.models; let state = data.value; if (models) { models.forEach((item) => { var _a22, _b22, _c22; item.state = state; (_b22 = (_a22 = item.getTopContainer()) == null ? void 0 : _a22.render) == null ? void 0 : _b22.enableRefreshShape(); (_c22 = item.render) == null ? void 0 : _c22.enableRefreshShape(); }); } return true; } else { return false; } } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus.insert(DDeiEnumBusCommandType.UpdateSelectorBounds, {}, evt, 1); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelChangeSelect({ code: DDeiEnumBusCommandType.ModelChangeSelect, name: "", desc: "" }); } } const __vite_glob_0_19$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelChangeSelect, default: DDeiBusCommandModelChangeSelect }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelChangeValue extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { var _a3, _b2, _c2; let stage2 = bus.ddInstance.stage; if (stage2 && (((_a3 = data == null ? void 0 : data.mids) == null ? void 0 : _a3.length) > 0 || ((_b2 = data == null ? void 0 : data.models) == null ? void 0 : _b2.length) > 0) && ((_c2 = data == null ? void 0 : data.paths) == null ? void 0 : _c2.length) > 0) { let attrDefine = data.attrDefine; if (attrDefine == null ? void 0 : attrDefine.readonly) { return false; } } return true; } /** * 具体行为,设置属性值 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2, _d2; let stage2 = bus.ddInstance.stage; if (stage2 && (((_a3 = data == null ? void 0 : data.mids) == null ? void 0 : _a3.length) > 0 || ((_b2 = data == null ? void 0 : data.models) == null ? void 0 : _b2.length) > 0) && ((_c2 = data == null ? void 0 : data.paths) == null ? void 0 : _c2.length) > 0) { let mids = data.mids; let models = data.models; let paths = data.paths; let value = data.value; let attrDefine = data.attrDefine; if (((_d2 = data == null ? void 0 : data.paths) == null ? void 0 : _d2.indexOf("layout")) != -1) ; else { if ((mids == null ? void 0 : mids.length) > 0) { models = []; mids.forEach((modelId) => { if (modelId) { if (modelId == "DDeiStage") { models.push(stage2); } else if (modelId == "DDeiLayer") { models.push(stage2 == null ? void 0 : stage2.layers[stage2 == null ? void 0 : stage2.layerIndex]); } else { let model = stage2 == null ? void 0 : stage2.getModelById(modelId); if (model) { models.push(model); } } } }); } if ((models == null ? void 0 : models.length) > 0) { models.forEach((model) => { var _a22, _b22, _c22, _d22, _e2, _f, _g, _h, _i, _j, _k; if (model) { if (model.baseModelType == "DDeiTable") { if ((attrDefine == null ? void 0 : attrDefine.modelCode) == "DDeiTable") { DDeiUtil$1.setAttrValueByPath(model, paths, value); } else { let cells = model.getSelectedCells(); cells.forEach((cell) => { paths.forEach((path) => { var _a32; DDeiUtil$1.setAttrValueByPath(cell, [path], value); (_a32 = cell.render) == null ? void 0 : _a32.setCachedValue(path, value); }); }); } } else if (model.baseModelType == "DDeiLine") { model.clps = []; model.stage.render.refreshJumpLine = false; DDeiUtil$1.setAttrValueByPath(model, paths, value); (_a22 = model.render) == null ? void 0 : _a22.setCachedValue(paths, value); } else { DDeiUtil$1.setAttrValueByPath(model, paths, value); (_b22 = model.render) == null ? void 0 : _b22.setCachedValue(paths, value); } let modelDefine = DDeiUtil$1.getControlDefine(model); if ((_d22 = (_c22 = modelDefine == null ? void 0 : modelDefine.define) == null ? void 0 : _c22.sample) == null ? void 0 : _d22.depProps) { let depProps = modelDefine.define.sample.depProps; for (let type in depProps) { let property = depProps[type]; let rmdms = []; let hasTypeModel = false; let modelPropValue = model[property]; (_e2 = model.linkModels) == null ? void 0 : _e2.forEach((lm) => { var _a32, _b3; if (lm.type == type && lm.dm) { hasTypeModel = true; if (modelPropValue) { DDeiUtil$1.setAttrValueByPath(lm.dm, "text", modelPropValue); (_a32 = lm.dm.render) == null ? void 0 : _a32.setCachedValue("text", modelPropValue); (_b3 = lm.dm.render) == null ? void 0 : _b3.enableRefreshShape(); } else { rmdms.push(lm); } } }); if (hasTypeModel) { rmdms.forEach((lm) => { model.removeLinkModel(lm.dm.id, true, false); }); } else if (modelPropValue) { bus.insert(DDeiEnumBusCommandType.CreateDepLinkModel, { model, text: modelPropValue }, null, 0); } } model.refreshLinkModels(); } if (model.depModel) { let modelDefine2 = DDeiUtil$1.getControlDefine(model.depModel); if ((_g = (_f = modelDefine2 == null ? void 0 : modelDefine2.define) == null ? void 0 : _f.sample) == null ? void 0 : _g.depProps) { let depProps = modelDefine2.define.sample.depProps; let depLinkModel = (_h = model.depModel.linkModels) == null ? void 0 : _h.get(model.id); let property = depProps[depLinkModel.type]; if (property && depLinkModel) { DDeiUtil$1.setAttrValueByPath(model.depModel, property, model.text); (_i = model.depModel.render) == null ? void 0 : _i.setCachedValue(property, model.text); (_j = model.depModel.render) == null ? void 0 : _j.enableRefreshShape(); } } } (_k = model.render) == null ? void 0 : _k.enableRefreshShape(); } }); bus.executeAll(); } } return true; } return false; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { var _a3; if (((_a3 = data == null ? void 0 : data.paths) == null ? void 0 : _a3.indexOf("layout")) != -1) { bus == null ? void 0 : bus.insert(DDeiEnumBusCommandType.ChangeLayout, data, evt); } else { bus.push(DDeiEnumBusCommandType.NodifyChange); bus.insert(DDeiEnumBusCommandType.AddHistroy); } return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelChangeValue({ code: DDeiEnumBusCommandType.ModelChangeValue, name: "", desc: "" }); } } const __vite_glob_0_20$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelChangeValue, default: DDeiBusCommandModelChangeValue }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelCopyStyle extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置属性值 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3; let stage2 = bus.ddInstance.stage; if (stage2 && ((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0 && (data == null ? void 0 : data.brushData)) { let models = data.models; if ((models == null ? void 0 : models.length) > 0) { models.forEach((model) => { if (model) { let hasChange = false; if (model.baseModelType == "DDeiTable") { if (Array.isArray(data.brushData) && !Array.isArray(data.brushData[0]) && data.brushData.length == 1) { let cells = model.getSelectedCells(); cells.forEach((cell) => { var _a22; this.cloneStyle(cell, data.brushData[0]); (_a22 = cell.render) == null ? void 0 : _a22.renderCacheData.clear(); hasChange = true; }); } else if (Array.isArray(data.brushData) && Array.isArray(data.brushData[0])) { this.copyTableStyleToTableCell(model, data.brushData); hasChange = true; } } else { if (Array.isArray(data.brushData) && !Array.isArray(data.brushData[0]) && data.brushData.length == 1) { this.cloneStyle(model, data.brushData[0]); hasChange = true; } else if (Array.isArray(data.brushData) && Array.isArray(data.brushData[0])) { this.cloneStyle(model, data.brushData[0][0]); hasChange = true; } } if (hasChange) { bus.push(DDeiEnumBusCommandType.NodifyChange); bus.insert(DDeiEnumBusCommandType.AddHistroy, null, evt); } } }); } return true; } return false; } /** * 复制表格样式到另外一个表格的单元格中 * @param table 表格 * @param tableJson 单元格样式 */ copyTableStyleToTableCell(table2, tableJson) { let distCells = table2.getSelectedCells(); if (distCells && distCells.length > 0 && tableJson) { let sourceTable = tableJson; let distTable = table2; let sourceMinMaxRow = { minRow: 0, minCol: 0, maxRow: sourceTable.length - 1, maxCol: sourceTable[0].length - 1 }; let distMinMaxRow = distTable.getMinMaxRowAndCol(distCells); let distAreaAllSelected = distTable.isAllSelected(distMinMaxRow.minRow, distMinMaxRow.minCol, distMinMaxRow.maxRow, distMinMaxRow.maxCol); if (!distAreaAllSelected) { console.log("表格粘贴目标不是一个有效的连续区域"); return; } let rowNum = 1; let colNum = 1; let sourceRowNum = sourceMinMaxRow.maxRow - sourceMinMaxRow.minRow + 1; let distRowNum = distMinMaxRow.maxRow - distMinMaxRow.minRow + 1; let sourceColNum = sourceMinMaxRow.maxCol - sourceMinMaxRow.minCol + 1; let distColNum = distMinMaxRow.maxCol - distMinMaxRow.minCol + 1; if (distRowNum == sourceRowNum) { rowNum = sourceRowNum; } else if (distRowNum > sourceRowNum) { rowNum = distRowNum - distRowNum % sourceRowNum; } else if (distRowNum < sourceRowNum) { rowNum = sourceRowNum; } if (distColNum == sourceColNum) { colNum = sourceColNum; } else if (distColNum > sourceColNum) { colNum = distColNum - distColNum % sourceColNum; } else if (distColNum < sourceColNum) { colNum = sourceColNum; } if (distTable.hasMergeCell(distMinMaxRow.minRow, distMinMaxRow.minCol, distMinMaxRow.minRow + rowNum - 1, distMinMaxRow.minCol + colNum - 1)) { console.log("表格复制样式区域存在合并单元格"); return; } if (distTable.rows.length <= distMinMaxRow.minRow + rowNum - 1 || distTable.cols.length <= distMinMaxRow.minCol + colNum - 1) { console.log("表格复制样式区域超出表格所在最大区域"); return; } for (let i2 = 0; i2 < rowNum && distMinMaxRow.minRow + i2 < distTable.rows.length; i2++) { let offsetI = i2 % sourceRowNum; for (let j2 = 0; j2 < colNum && distMinMaxRow.minCol + j2 < distTable.cols.length; j2++) { let offsetJ = j2 % sourceColNum; let sourceCell = sourceTable[sourceMinMaxRow.minRow + offsetI][sourceMinMaxRow.minCol + offsetJ]; let targetCell = distTable.rows[distMinMaxRow.minRow + i2][distMinMaxRow.minCol + j2]; this.cloneStyle(targetCell, sourceCell); } } } } /** * 复制控件样式 * @param model * @param sourceModel */ cloneStyle(model, sourceModel) { var _a3; if (model.baseModelType == "DDeiLine") { if (sourceModel.fill) { model.fill = cloneDeep(sourceModel.fill); } else { delete model.fill; } if (sourceModel.color) { model.color = sourceModel.color; } else { delete model.color; } if (sourceModel.dash) { model.dash = sourceModel.dash; } else { delete model.dash; } if (sourceModel.opacity) { model.opacity = sourceModel.opacity; } else { delete model.opacity; } if (sourceModel.weight) { model.weight = sourceModel.weight; } else { delete model.weight; } } else { if (sourceModel.font) { model.font = cloneDeep(sourceModel.font); } else { delete model.font; } if (sourceModel.textStyle) { model.textStyle = cloneDeep(sourceModel.textStyle); } else { delete model.textStyle; } if (sourceModel.fill) { model.fill = cloneDeep(sourceModel.fill); } else { delete model.fill; } if (sourceModel.border) { model.border = cloneDeep(sourceModel.border); } else { delete model.border; } } (_a3 = model.render) == null ? void 0 : _a3.renderCacheData.clear(); } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelCopyStyle({ code: DDeiEnumBusCommandType.CopyStyle, name: "", desc: "" }); } } const __vite_glob_0_21$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelCopyStyle, default: DDeiBusCommandModelCopyStyle }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelEdgePosition extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2, _d2, _e2, _f; if (((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0) { let dx = data.dx ? data.dx : 0; let dy = data.dy ? data.dy : 0; let models = data.models; let stage2 = bus.ddInstance.stage; let ddInstance = stage2 == null ? void 0 : stage2.ddInstance; if (models[0].id.lastIndexOf("_shadow") != -1) { stage2 == null ? void 0 : stage2.getModelById(models[0].id.substring(models[0].id, models[0].id.lastIndexOf("_shadow"))); } else { models[0]; } if (dx || dy) { stage2.wpv.x -= dx; stage2.wpv.y -= dy; let extW = 0; let moveW = 0; let hScrollWidth = ((_b2 = stage2.render.hScroll) == null ? void 0 : _b2.width) ? (_c2 = stage2.render.hScroll) == null ? void 0 : _c2.width : 0; let vScrollHeight = ((_d2 = stage2.render.vScroll) == null ? void 0 : _d2.height) ? (_e2 = stage2.render.vScroll) == null ? void 0 : _e2.height : 0; if (stage2.wpv.x > 0) { if (ddInstance.EXT_STAGE_WIDTH) { extW = stage2.wpv.x; moveW = extW; } else { dx = 0; } stage2.wpv.x = 0; } else if (stage2.wpv.x < -stage2.width + hScrollWidth) { if (ddInstance.EXT_STAGE_WIDTH) { extW = -stage2.width + hScrollWidth - stage2.wpv.x; } else { dx = 0; stage2.wpv.x = -stage2.width + hScrollWidth; } } else if (!ddInstance.EXT_STAGE_WIDTH && hScrollWidth == 0) { dx = 0; } let extH = 0; let moveH = 0; if (stage2.wpv.y > 0) { if (ddInstance.EXT_STAGE_HEIGHT) { extH = stage2.wpv.y; moveH = extH; } else { dy = 0; } stage2.wpv.y = 0; } else if (stage2.wpv.y < -stage2.height + vScrollHeight) { if (ddInstance.EXT_STAGE_HEIGHT) { extH = -stage2.height + vScrollHeight - stage2.wpv.y; } else { dy = 0; stage2.wpv.y = -stage2.height + vScrollHeight; } } else if (!ddInstance.EXT_STAGE_HEIGHT && vScrollHeight == 0) { dy = 0; } let ignoreModelIds = []; let stageRatio2 = stage2 == null ? void 0 : stage2.getStageRatio(); if (dx || dy) { models.forEach((model) => { ignoreModelIds.push(model.id); let moveMatrix2 = new Matrix3( 1, 0, dx / stageRatio2, 0, 1, dy / stageRatio2, 0, 0, 1 ); model.transVectors(moveMatrix2); }); } if (extW || extH) { stage2.width += extW; stage2.height += extH; if (moveW || moveH) { let moveMatrix2 = new Matrix3( 1, 0, extW / stageRatio2, 0, 1, extH / stageRatio2, 0, 0, 1 ); stage2 == null ? void 0 : stage2.spv.applyMatrix3(moveMatrix2); let mds = stage2.getLayerModels(ignoreModelIds); mds.forEach((item) => { item.transVectors(moveMatrix2); }); models.forEach((item) => { item.transVectors(moveMatrix2); }); (_f = stage2.render.selector) == null ? void 0 : _f.transVectors(moveMatrix2); } } } return true; } return false; } /** * 后置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelEdgePosition({ code: DDeiEnumBusCommandType.ModelEdgePosition, name: "", desc: "" }); } } const __vite_glob_0_22$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelEdgePosition, default: DDeiBusCommandModelEdgePosition }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelMerge extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { let ddInstance = bus.ddInstance; if (ddInstance && ddInstance.stage) { let layer2 = ddInstance.stage.layers[ddInstance.stage.layerIndex]; let selectedModels = layer2.getSelectedModels(); if (selectedModels.size > 1) { return true; } } return false; } /** * 具体行为,设置属性值 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let ddInstance = bus.ddInstance; if (ddInstance && ddInstance.stage) { ddInstance.stage.getStageRatio(); let layer2 = ddInstance.stage.layers[ddInstance.stage.layerIndex]; let selectedModels = layer2.getSelectedModels(); if (selectedModels.size > 1) { let models = Array.from(selectedModels.values()); let outRect = DDeiAbstractShape.getOutRectByPV(models); let controlDefine = DDeiUtil$1.getControlDefine({ modelCode: "100202" }); let container2 = DDeiUtil$1.createControl(controlDefine, DDeiUtil$1.getEditorInsByDDei(ddInstance))[0]; container2.layout = "compose"; container2.layoutManager = DDeiLayoutManagerFactory.getLayoutInstance("compose"); container2.layoutManager.container = container2; container2.fill = { type: 0 }; container2.border = { type: 0 }; let m12 = new Matrix3(); let scaleMatrix2 = new Matrix3( outRect.width / container2.essBounds.width, 0, 0, 0, outRect.height / container2.essBounds.height, 0, 0, 0, 1 ); m12.premultiply(scaleMatrix2); let moveMatrix2 = new Matrix3( 1, 0, outRect.x + outRect.width / 2, 0, 1, outRect.y + outRect.height / 2, 0, 0, 1 ); m12.premultiply(moveMatrix2); container2.transVectors(m12); ddInstance.bus.insert(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: ddInstance.stage.layers[ddInstance.stage.layerIndex], models: [container2], skipValid: true }, evt, 0); ddInstance.bus.insert(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: container2, oldContainer: layer2, models, skipValid: true }, evt, 1); ddInstance.bus.insert(DDeiEnumBusCommandType.ModelChangeSelect, { models: [container2], value: DDeiEnumControlState.SELECTED }, evt, 2); ddInstance.bus.insert(DDeiEnumBusCommandType.ClearTemplateVars, null, evt, 3); ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); ddInstance.bus.insert(DDeiEnumBusCommandType.AddHistroy, null, evt, 4); ddInstance.bus.insert(DDeiEnumBusCommandType.StageChangeSelectModels, null, evt, 5); ddInstance.bus.insert(DDeiEnumBusCommandType.RefreshShape, null, evt, 6); return true; } } return false; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelMerge({ code: DDeiEnumBusCommandType.ModelMerge, name: "", desc: "" }); } } const __vite_glob_0_23$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelMerge, default: DDeiBusCommandModelMerge }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelPush extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { if ((data == null ? void 0 : data.container) && (data == null ? void 0 : data.type)) { if ((data == null ? void 0 : data.type) == "top" || (data == null ? void 0 : data.type) == "bottom" || (data == null ? void 0 : data.type) == "up" || (data == null ? void 0 : data.type) == "down") { let selectedModels = data == null ? void 0 : data.container.getSelectedModels(); if ((selectedModels == null ? void 0 : selectedModels.size) > 0) { return true; } } } return false; } /** * 具体行为,重绘所有图形 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let selectedModels = data == null ? void 0 : data.container.getSelectedModels(); let hasChange = false; if ((data == null ? void 0 : data.type) == "top") { data.container.pushTop(Array.from(selectedModels.values())); hasChange = true; } else if ((data == null ? void 0 : data.type) == "bottom") { data.container.pushBottom(Array.from(selectedModels.values())); hasChange = true; } else if ((data == null ? void 0 : data.type) == "up") { data.container.pushUp(Array.from(selectedModels.values())); hasChange = true; } else if ((data == null ? void 0 : data.type) == "down") { data.container.pushDown(Array.from(selectedModels.values())); hasChange = true; } if (hasChange) { bus.push(DDeiEnumBusCommandType.NodifyChange); bus.insert(DDeiEnumBusCommandType.AddHistroy, null, evt); } return true; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelPush({ code: DDeiEnumBusCommandType.ModelPush, name: "", desc: "" }); } } const __vite_glob_0_24$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelPush, default: DDeiBusCommandModelPush }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandModelRemove extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let models = data == null ? void 0 : data.models; let destroy = (data == null ? void 0 : data.destroy) || (data == null ? void 0 : data.destroy) == false ? data.destroy : true; if ((models == null ? void 0 : models.length) > 0) { models.forEach((model) => { model.pModel.removeModel(model, destroy); }); return true; } return false; } /** * 后置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandModelRemove({ code: DDeiEnumBusCommandType.ModelRemove, name: "", desc: "" }); } } const __vite_glob_0_25$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandModelRemove, default: DDeiBusCommandModelRemove }, Symbol.toStringTag, { value: "Module" })); class DDeiCommandChangeNodifyChange extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiCommandChangeNodifyChange({ code: DDeiEnumBusCommandType.NodifyChange, name: "", desc: "" }); } } const __vite_glob_0_26$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiCommandChangeNodifyChange, default: DDeiCommandChangeNodifyChange }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandNodifyControlCreated extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { if (data == null ? void 0 : data.models) { DDeiEditorUtil$1.invokeCallbackFunc("EVENT_CONTROL_CREATE_AFTER", DDeiEnumOperateType.CREATE, data, bus.ddInstance, evt); } return true; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandNodifyControlCreated({ code: DDeiEnumBusCommandType.NodifyControlCreated, name: "", desc: "" }); } } const __vite_glob_0_27$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandNodifyControlCreated, default: DDeiBusCommandNodifyControlCreated }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandOVSChangePosition extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2; let stage2 = bus.ddInstance.stage; let stageRender = stage2 == null ? void 0 : stage2.render; let x2 = (data == null ? void 0 : data.x) ? data.x : 0; let y2 = (data == null ? void 0 : data.y) ? data.y : 0; if ((x2 || y2) && stageRender.dragObj) { let dragObj = stageRender.dragObj; let model = dragObj.model; let opPoint = dragObj.opPoint; let modelPointIdx = model.ovs.indexOf(opPoint); let ovsDefine = (_b2 = (_a3 = DDeiUtil$1.getControlDefine(model)) == null ? void 0 : _a3.define) == null ? void 0 : _b2.ovs; let point2 = null; if ((ovsDefine == null ? void 0 : ovsDefine.length) > modelPointIdx) { point2 = ovsDefine[modelPointIdx]; } if (point2) { let m12 = new Matrix3(); let mr = null; let dx = x2 - opPoint.x, dy = y2 - opPoint.y; if (point2.constraint) { switch (point2.constraint.type) { case 0: { return true; } case 1: { let pathPvs = []; let pvsStr = point2.constraint.pvs; if ((pvsStr == null ? void 0 : pvsStr.length) > 0) { pvsStr.forEach((pvsS) => { let pvsData = DDeiUtil$1.getDataByPathList(model, pvsS); if (Array.isArray(pvsData)) { pvsData.forEach((pvsD) => { pathPvs.push(pvsD); }); } else { pathPvs.push(pvsData); } }); } if (pathPvs.length > 1) { let proPoints = DDeiAbstractShape.getProjPointDists(pathPvs, x2, y2, false, 1); if ((proPoints == null ? void 0 : proPoints.length) > 0) { opPoint.index = proPoints[0].index; let distance = DDeiUtil$1.getPointDistance(pathPvs[proPoints[0].index].x, pathPvs[proPoints[0].index].y, pathPvs[proPoints[0].index + 1].x, pathPvs[proPoints[0].index + 1].y); let sita = DDeiUtil$1.getLineAngle(pathPvs[proPoints[0].index].x, pathPvs[proPoints[0].index].y, pathPvs[proPoints[0].index + 1].x, pathPvs[proPoints[0].index + 1].y); let pointDistance = DDeiUtil$1.getPointDistance(pathPvs[proPoints[0].index].x, pathPvs[proPoints[0].index].y, proPoints[0].x, proPoints[0].y); let rate = pointDistance / distance; let ovSita = opPoint.sita; if (!ovSita) { ovSita = 0; } opPoint.rate = rate > 1 ? rate : rate; opPoint.sita = sita; dx = proPoints[0].x - opPoint.x; dy = proPoints[0].y - opPoint.y; if (sita != ovSita) { mr = new Matrix3(); let move1Matrix = new Matrix3( 1, 0, -proPoints[0].x, 0, 1, -proPoints[0].y, 0, 0, 1 ); let angle2 = (-(sita - ovSita) * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); let move2Matrix = new Matrix3( 1, 0, proPoints[0].x, 0, 1, proPoints[0].y, 0, 0, 1 ); mr.premultiply(move1Matrix).premultiply(rotateMatrix).premultiply(move2Matrix); } } else { dx = 0; dy = 0; } } break; } case 2: { let rotate2 = model.rotate; if (!rotate2) { rotate2 = 0; } let angle2 = (-rotate2 * DDeiConfig$1.ROTATE_UNIT).toFixed(4); let moveMatrix22 = new Matrix3( 1, 0, model.cpv.x, 0, 1, model.cpv.y, 0, 0, 1 ); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); let bpv2 = DDeiUtil$1.pointsToZero([model.bpv], model.cpv, rotate2)[0]; let scaleX2 = Math.abs(bpv2.x / 100); let scaleY2 = Math.abs(bpv2.y / 100); let scaleMatrix2 = new Matrix3( scaleX2, 0, 0, 0, scaleY2, 0, 0, 0, 1 ); let pv1 = new Vector3(point2.constraint.x0, point2.constraint.y0, 1); let pv2 = new Vector3(point2.constraint.x1, point2.constraint.y1, 1); let outPVS = DDeiAbstractShape.outRectToPV(DDeiAbstractShape.pvsToOutRect([pv1, pv2])); let m122 = new Matrix3().premultiply(scaleMatrix2).premultiply(rotateMatrix).premultiply(moveMatrix22); outPVS.forEach((pv) => { pv.applyMatrix3(m122); }); if (!DDeiAbstractShape.isInsidePolygon(outPVS, { x: x2, y: y2 })) { let proPoints = DDeiAbstractShape.getProjPointDists(outPVS, x2, y2, false, 1); if ((proPoints == null ? void 0 : proPoints.length) > 0) { dx = proPoints[0].x - opPoint.x; dy = proPoints[0].y - opPoint.y; } else { dx = 0; dy = 0; } } break; } case 3: { let distance = DDeiUtil$1.getPointDistance(x2, y2, model.cpv.x, model.cpv.y); let rotate2 = model.rotate; if (!rotate2) { rotate2 = 0; } let bpv2 = DDeiUtil$1.pointsToZero([model.bpv], model.cpv, rotate2)[0]; let scaleX2 = Math.abs(bpv2.x / 100); let r = point2.constraint.r * scaleX2; if (Math.abs(distance) > r) { let pointAngle = DDeiUtil$1.getLineAngle(model.cpv.x, model.cpv.y, x2, y2); let pointRad = pointAngle * DDeiConfig$1.ROTATE_UNIT; let fx = model.cpv.x + r * Math.cos(pointRad); let fy = model.cpv.y + r * Math.sin(pointRad); dx = fx - opPoint.x, dy = fy - opPoint.y; } break; } } } let moveMatrix2 = new Matrix3( 1, 0, dx, 0, 1, dy, 0, 0, 1 ); m12.premultiply(moveMatrix2); if (mr) { m12.premultiply(mr); } opPoint.applyMatrix3(moveMatrix2); model.updateOVSLink(opPoint, point2, m12); model.initPVS(); (_c2 = model.render) == null ? void 0 : _c2.enableRefreshShape(); return true; } } return false; } /** * 后置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds, data, evt); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandOVSChangePosition({ code: DDeiEnumBusCommandType.OVSChangePosition, name: "", desc: "" }); } } const __vite_glob_0_28$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandOVSChangePosition, default: DDeiBusCommandOVSChangePosition }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandRefreshShape extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,重绘所有图形 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let stage2 = bus.ddInstance.stage; if (stage2) { stage2.render.refresh = true; return true; } else { return false; } } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandRefreshShape({ code: DDeiEnumBusCommandType.RefreshShape, name: "", desc: "" }); } } const __vite_glob_0_29$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandRefreshShape, default: DDeiBusCommandRefreshShape }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandResetSelectorState extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let stage2 = bus.ddInstance.stage; if (stage2 && stage2.render.selector) { stage2.render.selector.resetState(data == null ? void 0 : data.x, data == null ? void 0 : data.y); } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandResetSelectorState({ code: DDeiEnumBusCommandType.ResetSelectorState, name: "", desc: "" }); } } const __vite_glob_0_30$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandResetSelectorState, default: DDeiBusCommandResetSelectorState }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandSetHelpLine extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2; let stage2 = bus.ddInstance.stage; if (stage2) { let layer2 = data.layer; if (!layer2) { layer2 = stage2.layers[stage2.layerIndex]; } if (((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0 || ((_b2 = data == null ? void 0 : data.models) == null ? void 0 : _b2.size) > 0 || (data == null ? void 0 : data.container)) { let models = data == null ? void 0 : data.models; if (!models && (data == null ? void 0 : data.container)) { models = data == null ? void 0 : data.container.getSelectedModels(); } if (models.set) { models = Array.from(models.values()); } if ((models == null ? void 0 : models.length) > 0) { let outRect = null; let rotate2 = null; let apvs2 = []; models.forEach((model) => { let modelAPVS = model.getAPVS(); if ((modelAPVS == null ? void 0 : modelAPVS.length) > 0) { apvs2 = apvs2.concat(modelAPVS); } }); if (models.length == 1) { rotate2 = models[0].rotate; } else { rotate2 = stage2.render.selector.rotate; } outRect = DDeiAbstractShape.getOutRectByPV(models); let { hpoint, vpoint, hAds, vAds } = stage2.getAlignData({ pvs: apvs2, rotate: rotate2 }, data == null ? void 0 : data.models, data == null ? void 0 : data.points); stage2.render.helpLines = { hpoint, vpoint, rect: outRect, hAds, vAds }; return true; } else { stage2.render.helpLines = null; return true; } } else { stage2.render.helpLines = null; return true; } } return false; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandSetHelpLine({ code: DDeiEnumBusCommandType.SetHelpLine, name: "", desc: "" }); } } const __vite_glob_0_31$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandSetHelpLine, default: DDeiBusCommandSetHelpLine }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandStageChangeSelectModels extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { if (bus.ddInstance.disabled) { return false; } return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3; let stage2 = bus.ddInstance.stage; let editor = bus.invoker; if (stage2) { let optContainer = stage2.render.currentOperateContainer; if (!optContainer) { optContainer = stage2.layers[stage2.layerIndex]; } let selectedModels = optContainer.getSelectedModels(); let oldSelectModels = stage2.selectedModels; stage2.changeSelecetdModels(selectedModels); let hasChange = false; let newSelectModels = stage2.selectedModels; if ((oldSelectModels == null ? void 0 : oldSelectModels.size) !== (newSelectModels == null ? void 0 : newSelectModels.size)) { hasChange = true; } if (!hasChange) { for (let key of oldSelectModels == null ? void 0 : oldSelectModels.keys()) { if ((oldSelectModels == null ? void 0 : oldSelectModels.get(key)) !== (newSelectModels == null ? void 0 : newSelectModels.get(key))) { hasChange = false; break; } } } if ((selectedModels == null ? void 0 : selectedModels.size) > 0) { let models = Array.from(selectedModels.values()); let firstModel = models[0]; let firstControlDefine = cloneDeep( editor.controls.get(firstModel == null ? void 0 : firstModel.modelCode) ); if (firstControlDefine) { let removeKeys = []; for (let i2 = 0; i2 < models.length; i2++) { let curModel = models[i2]; let curDefine = editor.controls.get(curModel.modelCode); firstControlDefine.attrDefineMap.forEach( (firstAttrDefine, attrKey) => { if (!curDefine.attrDefineMap.has(attrKey)) { removeKeys.push(attrKey); firstAttrDefine.model = curModel; } else if (!firstAttrDefine.visiable) { removeKeys.push(attrKey); firstAttrDefine.model = curModel; } else { let curAttrDefine = curDefine.attrDefineMap.get(attrKey); if (i2 == 0) { firstAttrDefine.value = DDeiUtil$1.getDataByPathList( firstModel, curAttrDefine.code, curAttrDefine.mapping ); firstAttrDefine.model = firstModel; } let curAttrValue = DDeiUtil$1.getDataByPathList( curModel, curAttrDefine.code, curAttrDefine.mapping ); if (firstAttrDefine.value != curAttrValue) { firstAttrDefine.diffValues.push(curAttrValue); } } } ); } this.deleteAttrDefineByKeys(firstControlDefine, removeKeys); if (((_a3 = firstControlDefine.groups) == null ? void 0 : _a3.length) > 0) { editor.currentControlDefine = firstControlDefine; } else { editor.currentControlDefine = null; } } } else { editor.currentControlDefine = null; } selectedModels == null ? void 0 : selectedModels.forEach((model) => { var _a22; (_a22 = model.render) == null ? void 0 : _a22.clearCachedValue(); }); oldSelectModels == null ? void 0 : oldSelectModels.forEach((model) => { var _a22; (_a22 = model.render) == null ? void 0 : _a22.clearCachedValue(); }); DDeiEditorUtil$1.invokeCallbackFunc("EVENT_CONTROL_SELECT_AFTER", DDeiEnumOperateType.SELECT, { models: Array.from(selectedModels.values()) }, bus.ddInstance, evt); return true; } } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); return true; } /** * 移除属性定义中的属性 * @param firstControlDefine * @param removeKeys */ deleteAttrDefineByKeys(firstControlDefine, removeKeys) { removeKeys.forEach((item) => { var _a3; firstControlDefine.attrDefineMap.delete(item); (_a3 = firstControlDefine.groups) == null ? void 0 : _a3.forEach((group2) => { this.deleteGroupAttrsByKey(group2, item); }); }); } deleteGroupAttrsByKey(pData, key) { let rmglist = []; pData.subGroups.forEach((group2) => { let rmlist = []; for (let gci = 0; gci < group2.children.length; gci++) { if (group2.children[gci].code == key) { rmlist.push(group2.children[gci]); } } rmlist.forEach((rm) => { let index = group2.children.indexOf(rm); if (index > -1) { group2.children.splice(index, 1); } }); if (group2.children.length == 0) { rmglist.push(group2); } }); rmglist.forEach((rmg) => { let index = pData.subGroups.indexOf(rmg); if (index > -1) { pData.subGroups.splice(index, 1); } }); } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandStageChangeSelectModels({ code: DDeiEnumBusCommandType.StageChangeSelectModels, name: "", desc: "" }); } } const __vite_glob_0_32$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandStageChangeSelectModels, default: DDeiBusCommandStageChangeSelectModels }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandTextEditorChangeSelectPos extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { return true; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandTextEditorChangeSelectPos({ code: DDeiEnumBusCommandType.TextEditorChangeSelectPos, name: "", desc: "" }); } } const __vite_glob_0_33$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandTextEditorChangeSelectPos, default: DDeiBusCommandTextEditorChangeSelectPos }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandUpdateDragObj extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let stage2 = bus.ddInstance.stage; if (stage2) { if (data == null ? void 0 : data.dragObj) { stage2.render.dragObj = data.dragObj; } else { if (data.deltaX) { stage2.render.dragObj.x += data.deltaX; } if (data.deltaY) { stage2.render.dragObj.y += data.deltaY; } } } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandUpdateDragObj({ code: DDeiEnumBusCommandType.UpdateDragObj, name: "", desc: "" }); } } const __vite_glob_0_34$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandUpdateDragObj, default: DDeiBusCommandUpdateDragObj }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandUpdatePaperArea extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 更新纸张,确保有效纸张位置在整个画布的正中央 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2; let stage2 = bus.ddInstance.stage; let paperType; if ((_a3 = stage2.paper) == null ? void 0 : _a3.type) { paperType = stage2.paper.type; } else if (stage2.ddInstance.paper) { if (typeof stage2.ddInstance.paper == "string") { paperType = stage2.ddInstance.paper; } else { paperType = stage2.ddInstance.paper.type; } } else { paperType = DDeiModelArrtibuteValue.getAttrValueByState(stage2, "paper.type", true); } let paperConfig = DDeiConfig$1.PAPER[paperType]; let stageRatio2 = stage2 == null ? void 0 : stage2.getStageRatio(); let paperWidth, paperHeight; let mds; if (paperConfig) { let paperSize = DDeiUtil$1.getPaperSize(stage2, paperType, false); paperWidth = paperSize.width; paperHeight = paperSize.height; } else { mds = stage2 == null ? void 0 : stage2.getLayerModels(null, 100); let outRect = DDeiAbstractShape.getOutRectByPV(mds); paperWidth = outRect.width * stageRatio2; paperHeight = outRect.height * stageRatio2; } let wpv = stage2.wpv; if (!stage2.spv) { let sx = stage2.width / 2 - paperWidth / stageRatio2 / 2; let sy = stage2.height / 2 - paperHeight / stageRatio2 / 2; stage2.spv = new Vector3(sx, sy, 1); } let startPaperX = stage2.spv.x * stageRatio2; let startPaperY = stage2.spv.y * stageRatio2; let maxOutRect = DDeiAbstractShape.getOutRectByPV(stage2.getLayerModels()); maxOutRect.x = maxOutRect.x * stageRatio2; maxOutRect.x1 = maxOutRect.x1 * stageRatio2; maxOutRect.y = maxOutRect.y * stageRatio2; maxOutRect.y1 = maxOutRect.y1 * stageRatio2; maxOutRect.width = maxOutRect.width * stageRatio2; maxOutRect.height = maxOutRect.height * stageRatio2; let leftExtNum = 0, rightExtNum = 0, topExtNum = 0, bottomExtNum = 0; if (maxOutRect.width > 0 && maxOutRect.height > 0) { if (maxOutRect.x < startPaperX) { leftExtNum = parseInt((startPaperX - maxOutRect.x) / paperWidth); if (Math.abs((startPaperX - maxOutRect.x) % paperWidth) > 1) { leftExtNum++; } } if (maxOutRect.x1 > startPaperX + paperWidth) { rightExtNum = parseInt((maxOutRect.x1 - startPaperX - paperWidth) / paperWidth); if (Math.abs((maxOutRect.x1 - startPaperX - paperWidth) % paperWidth) > 1) { rightExtNum++; } } if (maxOutRect.y < startPaperY) { topExtNum = parseInt((startPaperY - maxOutRect.y) / paperHeight); if (Math.abs((startPaperY - maxOutRect.y) % paperHeight) > 1) { topExtNum++; } } if (maxOutRect.y1 > startPaperY + paperHeight) { bottomExtNum = parseInt((maxOutRect.y1 - startPaperY - paperHeight) / paperHeight); if (Math.abs((maxOutRect.y1 - startPaperY - paperHeight) % paperHeight) > 1) { bottomExtNum++; } } } let leftPaperWidth = (leftExtNum + 0.5) * paperWidth; let rightPaperWidth = (rightExtNum + 1.5) * paperWidth; let leftSpace = stage2.spv.x * stageRatio2; let rightSpace = stage2.width - stage2.spv.x * stageRatio2; let topPaperWidth = (topExtNum + 0.5) * paperHeight; let bottomPaperWidth = (bottomExtNum + 1.5) * paperHeight; let topSpace = stage2.spv.y * stageRatio2; let bottomSpace = stage2.height - stage2.spv.y * stageRatio2; let extW = 0, extH = 0; let needMoveX = false, needMoveY = false; if (rightPaperWidth > rightSpace) { extW = rightPaperWidth - rightSpace; } else if (rightSpace - rightPaperWidth >= paperWidth) { extW = -parseInt((rightSpace - rightPaperWidth) / paperWidth) * paperWidth; } if (leftPaperWidth > leftSpace) { extW = leftPaperWidth - leftSpace; needMoveX = true; } else if (parseFloat((leftSpace - leftPaperWidth).toFixed(2)) > parseFloat(paperWidth.toFixed(2))) { extW = -parseInt((leftSpace - leftPaperWidth) / paperWidth) * paperWidth; needMoveX = true; } if (bottomPaperWidth > bottomSpace) { extH = bottomPaperWidth - bottomSpace; } else if (bottomSpace - bottomPaperWidth >= paperHeight) { extH = -parseInt((bottomSpace - bottomPaperWidth) / paperHeight) * paperHeight; } if (topPaperWidth > topSpace) { extH = topPaperWidth - topSpace; needMoveY = true; } else if (parseFloat((topSpace - topPaperWidth).toFixed(2)) > parseFloat(paperHeight.toFixed(2))) { extH = -parseInt((topSpace - topPaperWidth) / paperHeight) * paperHeight; needMoveY = true; } if (!bus.ddInstance.EXT_STAGE_WIDTH) { extW = 0; } if (!bus.ddInstance.EXT_STAGE_HEIGHT) { extH = 0; } if (extW || extH) { stage2.width += extW; stage2.height += extH; let mx = 0, my = 0; if (needMoveX) { mx = extW; } if (needMoveY) { my = extH; } if (mx || my) { let moveMatrix2 = new Matrix3( 1, 0, mx / stageRatio2, 0, 1, my / stageRatio2, 0, 0, 1 ); stage2.spv.x += mx / stageRatio2; stage2.spv.y += my / stageRatio2; if (!mds) { mds = stage2.getLayerModels(); } mds.forEach((item) => { item.transVectors(moveMatrix2); }); (_b2 = stage2.render.selector) == null ? void 0 : _b2.transVectors(moveMatrix2); wpv.x -= mx; wpv.y -= my; } } return true; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandUpdatePaperArea({ code: DDeiEnumBusCommandType.UpdatePaperArea, name: "", desc: "" }); } } const __vite_glob_0_35$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandUpdatePaperArea, default: DDeiBusCommandUpdatePaperArea }, Symbol.toStringTag, { value: "Module" })); class DDeiBusCommandUpdateSelectorBounds extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let stage2 = bus.ddInstance.stage; if (stage2) { let optContainer = stage2.render.currentOperateContainer; if (!optContainer) { optContainer = stage2.layers[stage2.layerIndex]; } if (optContainer) { let selector = stage2.render.selector; if (selector) { if ((data == null ? void 0 : data.operateState) == DDeiEnumOperateState.SELECT_WORKING) { let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= stage2.wpv.x; ey -= stage2.wpv.y; let stageRatio2 = stage2.getStageRatio(); ex = ex / stageRatio2; ey = ey / stageRatio2; let x2 = selector.startX; let y2 = selector.startY; let width, height; if (ex < x2) { width = x2 - ex; x2 = ex; } else { width = ex - x2; } if (ey < y2) { height = y2 - ey; y2 = ey; } else { height = ey - y2; } selector.updatePVSByRect(x2, y2, width, height); } else { let models = data == null ? void 0 : data.models; if (!(models == null ? void 0 : models.length) > 0 && !(models == null ? void 0 : models.size) > 0) { models = stage2.selectedModels; } if (!(models == null ? void 0 : models.length) > 0 && !(models == null ? void 0 : models.size) > 0) { models = optContainer.getSelectedModels(); } selector.updatePVSByModels(models); } } } } return true; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiBusCommandUpdateSelectorBounds({ code: DDeiEnumBusCommandType.UpdateSelectorBounds, name: "", desc: "" }); } } const __vite_glob_0_36$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiBusCommandUpdateSelectorBounds, default: DDeiBusCommandUpdateSelectorBounds }, Symbol.toStringTag, { value: "Module" })); const COMMANDS = /* @__PURE__ */ new Map(); const addCommand = function(code, command) { COMMANDS.set(code, command); }; const control_ctx$2 = /* @__PURE__ */ Object.assign({ "./bus/commands/add-histroy.ts": __vite_glob_0_0$3$1, "./bus/commands/cancel-curlevel-selected-models.ts": __vite_glob_0_1$3$1, "./bus/commands/center-stage-wpv.ts": __vite_glob_0_2$3, "./bus/commands/change-cursor.ts": __vite_glob_0_3$1$1, "./bus/commands/change-edit-mode.ts": __vite_glob_0_4$1$1, "./bus/commands/change-layout.ts": __vite_glob_0_5$1$1, "./bus/commands/change-line-point.ts": __vite_glob_0_6$1$1, "./bus/commands/change-selector-passindex.ts": __vite_glob_0_7$2, "./bus/commands/change-stage-ratio.ts": __vite_glob_0_8$2, "./bus/commands/change-stage-wpv.ts": __vite_glob_0_9$2, "./bus/commands/clear-template-vars.ts": __vite_glob_0_10$2, "./bus/commands/create-dep-linkmodel.ts": __vite_glob_0_11$2, "./bus/commands/model-align.ts": __vite_glob_0_12$2, "./bus/commands/model-auto-pos.ts": __vite_glob_0_13$2, "./bus/commands/model-cancel-merge.ts": __vite_glob_0_14$2, "./bus/commands/model-change-bounds.ts": __vite_glob_0_15$2, "./bus/commands/model-change-container.ts": __vite_glob_0_16$2, "./bus/commands/model-change-position.ts": __vite_glob_0_17$2, "./bus/commands/model-change-rotate.ts": __vite_glob_0_18$2, "./bus/commands/model-change-select.ts": __vite_glob_0_19$2, "./bus/commands/model-change-value.ts": __vite_glob_0_20$2, "./bus/commands/model-copy-style.ts": __vite_glob_0_21$2, "./bus/commands/model-edge-position.ts": __vite_glob_0_22$2, "./bus/commands/model-merge.ts": __vite_glob_0_23$2, "./bus/commands/model-push.ts": __vite_glob_0_24$2, "./bus/commands/model-remove.ts": __vite_glob_0_25$2, "./bus/commands/nodify-change.ts": __vite_glob_0_26$2, "./bus/commands/nodify-control-created.ts": __vite_glob_0_27$2, "./bus/commands/ovs-change-position.ts": __vite_glob_0_28$2, "./bus/commands/refresh-shape.ts": __vite_glob_0_29$2, "./bus/commands/reset-selector-state.ts": __vite_glob_0_30$2, "./bus/commands/set-helpline.ts": __vite_glob_0_31$2, "./bus/commands/stage-change-select-models.ts": __vite_glob_0_32$2, "./bus/commands/texteditor-change-select-pos.ts": __vite_glob_0_33$2, "./bus/commands/update-drawobj.ts": __vite_glob_0_34$2, "./bus/commands/update-paper-area.ts": __vite_glob_0_35$2, "./bus/commands/update-selector-bounds.ts": __vite_glob_0_36$2 }); let loadArray = []; for (const path in control_ctx$2) { loadArray.push(control_ctx$2[path]); } loadArray.forEach((item) => { let command = item.default; if (command) { let cmdInst = command.newInstance(); if (cmdInst == null ? void 0 : cmdInst.code) { addCommand(cmdInst.code, cmdInst); } } }); class DDeiBus { // ============================ 构造函数 ============================ constructor(props) { __publicField2(this, "ddInstance"); __publicField2(this, "invoker"); __publicField2(this, "drawQueue", []); __publicField2(this, "queue", []); __publicField2(this, "interceptor", {}); this.ddInstance = props.ddInstance; this.invoker = props.invoker; } // ============================ 方法 ============================ /** * 插入事件进入总线指定位置,默认最前方 * @param actionType 类型 * @param data 承载数据 * @param evt 事件 */ insert(actionType, data, evt, index = 0, parallel = false) { if (actionType) { this.queue.splice(index, 0, { type: actionType, data, evt, parallel }); } } /** * 推送事件进入总线 * @param actionType 类型 * @param data 承载数据 * @param evt 事件 */ push(actionType, data, evt, parallel = false) { parallel = false; if (actionType) { this.queue.push({ type: actionType, data, evt, parallel }); } } /** * 推送多个事件进入总线 * @param actions 多个action * @param evt 事件 */ pushMulit(actions, evt) { if (actions) { actions.forEach((item) => { this.push(item.actionType, item.data, evt); }); } } /** * 延迟执行 * @param time 延迟执行时间 */ executeAllDelay(time) { setTimeout(() => { this.executeAll(); }, time); } /** * 按照先进先出的顺序执行所有action */ executeAll() { var _a3, _b2; let result = true; this.tempExecQueue = clone(this.queue); while (((_a3 = this == null ? void 0 : this.queue) == null ? void 0 : _a3.length) > 0 && result) { let paralCommands = []; let firstActionData = this.queue[0]; if (firstActionData.parallel == true) { for (let i2 = 0; i2 < this.queue.length; i2++) { let command = this.queue[i2]; if (command.parallel == true) { let commandAction = new Promise((resolve, reject) => { this.execute(command); }); paralCommands.push(commandAction); } else { break; } } this.queue.splice(0, paralCommands.length); Promise.all(paralCommands); } else { result = this.execute(); } } if (((_b2 = this == null ? void 0 : this.drawQueue) == null ? void 0 : _b2.length) > 0 && result) { result = this.executeDraw(); this.drawQueue = []; } } restoreQueue() { var _a3; if (((_a3 = this.tempExecQueue) == null ? void 0 : _a3.length) > 0) { this.queue = this.tempExecQueue; } } /** * 取出队列并执行 */ execute(command) { var _a3, _b2, _c2, _d2, _e2, _f; if (this.queue && this.queue.length > 0) { let firstActionData = null; if (!command) { firstActionData = this.queue[0]; this.queue.splice(0, 1); } else { firstActionData = command; } let action = null; if (firstActionData) { if (firstActionData.type == DDeiEnumBusCommandType.RefreshShape) { this.drawQueue.push(firstActionData); return true; } action = COMMANDS.get(firstActionData.type); if (action) { if ((_a3 = this.interceptor[firstActionData.type]) == null ? void 0 : _a3.before) { let interActions = (_b2 = this.interceptor[firstActionData.type]) == null ? void 0 : _b2.before; for (let ii = 0; ii < interActions.length; ii++) { let result = interActions[ii](firstActionData.data, this, firstActionData.evt); if (!result) { return false; } } } let validResult = action.before(firstActionData.data, this, firstActionData.evt); if (validResult) { if ((_c2 = this.interceptor[firstActionData.type]) == null ? void 0 : _c2.execute) { let interActions = (_d2 = this.interceptor[firstActionData.type]) == null ? void 0 : _d2.execute; for (let ii = 0; ii < interActions.length; ii++) { let result = interActions[ii](firstActionData.data, this, firstActionData.evt); if (!result) { return false; } } } let actionResult = action.action(firstActionData.data, this, firstActionData.evt); if (actionResult) { if ((_e2 = this.interceptor[firstActionData.type]) == null ? void 0 : _e2.after) { let interActions = (_f = this.interceptor[firstActionData.type]) == null ? void 0 : _f.after; for (let ii = 0; ii < interActions.length; ii++) { let result = interActions[ii](firstActionData.data, this, firstActionData.evt); if (!result) { return false; } } } return action.after(firstActionData.data, this, firstActionData.evt); } else { return false; } } else { return false; } } } } return true; } /** * 执行绘图队列 * @param command * @returns */ executeDraw(command) { var _a3, _b2, _c2, _d2, _e2, _f; if (this.drawQueue && this.drawQueue.length > 0) { let firstActionData = null; if (!command) { firstActionData = this.drawQueue[0]; this.drawQueue.splice(0, 1); } else { firstActionData = command; } let action = null; if (firstActionData) { action = COMMANDS.get(firstActionData.type); if (action) { if ((_a3 = this.interceptor[firstActionData.type]) == null ? void 0 : _a3.before) { let interActions = (_b2 = this.interceptor[firstActionData.type]) == null ? void 0 : _b2.before; for (let ii = 0; ii < interActions.length; ii++) { let result = interActions[ii](firstActionData.data, this, firstActionData.evt); if (!result) { return false; } } } let validResult = action.before(firstActionData.data, this, firstActionData.evt); if (validResult) { if ((_c2 = this.interceptor[firstActionData.type]) == null ? void 0 : _c2.execute) { let interActions = (_d2 = this.interceptor[firstActionData.type]) == null ? void 0 : _d2.execute; for (let ii = 0; ii < interActions.length; ii++) { let result = interActions[ii](firstActionData.data, this, firstActionData.evt); if (!result) { return false; } } } let actionResult = action.action(firstActionData.data, this, firstActionData.evt); if (actionResult) { if ((_e2 = this.interceptor[firstActionData.type]) == null ? void 0 : _e2.after) { let interActions = (_f = this.interceptor[firstActionData.type]) == null ? void 0 : _f.after; for (let ii = 0; ii < interActions.length; ii++) { let result = interActions[ii](firstActionData.data, this, firstActionData.evt); if (!result) { return false; } } } return action.after(firstActionData.data, this, firstActionData.evt); } else { return false; } } else { return false; } } } } return true; } } const DDeiBus$1 = DDeiBus; var DDeiEnumAttributeType = /* @__PURE__ */ ((DDeiEnumAttributeType2) => { DDeiEnumAttributeType2[DDeiEnumAttributeType2["GRAPHICS"] = 1] = "GRAPHICS"; DDeiEnumAttributeType2[DDeiEnumAttributeType2["EVENT"] = 3] = "EVENT"; DDeiEnumAttributeType2[DDeiEnumAttributeType2["BUSINESS"] = 2] = "BUSINESS"; return DDeiEnumAttributeType2; })(DDeiEnumAttributeType || {}); var DDeiEnumStoreType = /* @__PURE__ */ ((DDeiEnumStoreType2) => { DDeiEnumStoreType2[DDeiEnumStoreType2["LOCAL"] = 1] = "LOCAL"; DDeiEnumStoreType2[DDeiEnumStoreType2["URL"] = 2] = "URL"; DDeiEnumStoreType2[DDeiEnumStoreType2["FILE"] = 3] = "FILE"; return DDeiEnumStoreType2; })(DDeiEnumStoreType || {}); class DDeiStore { } class DDeiAbstractArrtibuteParser { // ============================ 构造函数 =============================== constructor(model, define2) { __publicField2(this, "model"); __publicField2(this, "define"); this.model = model; this.define = define2; } } class DDeiArrtibuteParserString extends DDeiAbstractArrtibuteParser { // ============================ 构造函数 =============================== // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 转换一个外部值到正确的值 * 根据dataType返回不同的结果 */ parseValue(value) { if (value) { if (this.define.isArray) { if (Array.isArray(value)) { return value; } } else { return value.toString(); } } else { return null; } } /** * 获取缺省值 * 根据dataType返回不同的结果 */ getDefaultValue() { let value = this.define.defaultValue; if (value) { if (this.define.isArray) { if (Array.isArray(value)) { return value; } } else { return value.toString(); } } else { return null; } } } class DDeiArrtibuteParserNumber extends DDeiAbstractArrtibuteParser { // ============================ 构造函数 =============================== // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 转换一个外部值到正确的值 * 根据dataType返回不同的结果 */ parseValue(value) { if (value != null && value != void 0) { if (this.define.isArray) { if (Array.isArray(value)) { for (let i2 = 0; i2 < value.length; i2++) { try { value[i2] = parseFloat(value[i2]); } catch (e) { } } return value; } } else { try { return parseFloat(value); } catch (e) { return null; } } } else { return null; } } /** * 获取缺省值 * 根据dataType返回不同的结果 */ getDefaultValue() { let value = this.define.defaultValue; if (value) { if (this.define.isArray) { if (Array.isArray(value)) { for (let i2 = 0; i2 < value.length; i2++) { try { value[i2] = parseFloat(value[i2]); } catch (e) { } } return value; } } else { try { return parseFloat(value); } catch (e) { return null; } } } else { return null; } } } class DDeiArrtibuteParserBool extends DDeiAbstractArrtibuteParser { // ============================ 构造函数 =============================== // ============================ 属性 =============================== /** * 转换一个外部值到正确的值 * 根据dataType返回不同的结果 */ parseValue(value) { if (value) { if (this.define.isArray) { if (Array.isArray(value)) { return value; } } else if (value == true || value.toLocaleLowerCase() == "true") { return true; } else { return false; } } else { return null; } } /** * 获取缺省值 * 根据dataType返回不同的结果 */ getDefaultValue() { let value = this.define.defaultValue; if (value) { if (this.define.isArray) { if (Array.isArray(value)) { return value; } } else if (value == true || value.toLocaleLowerCase() == "true") { return true; } else { return false; } } else { return false; } } } class DDeiArrtibuteDefine { // ============================ 构造函数 =============================== constructor(props) { __publicField2(this, "id"); __publicField2(this, "mapping"); __publicField2(this, "type"); __publicField2(this, "code"); __publicField2(this, "name"); __publicField2(this, "desc"); __publicField2(this, "dataType"); __publicField2(this, "dataSource"); __publicField2(this, "defaultValue"); __publicField2(this, "notNull"); __publicField2(this, "readonly"); __publicField2(this, "isArray"); __publicField2(this, "overwrite"); __publicField2(this, "min"); __publicField2(this, "max"); this.id = props.id; this.mapping = props.mapping; this.type = props.type; this.code = props.code; this.name = props.name; this.desc = props.desc; this.dataType = props.dataType ? props.dataType : "string"; this.dataSource = props.dataSource; this.defaultValue = props.defaultValue; this.notNull = props.notNull ? props.notNull : false; this.readonly = props.readonly ? props.readonly : false; this.isArray = props.isArray ? props.isArray : false; this.overwrite = props.overwrite ? props.overwrite : false; this.min = props.min ? props.min : 0; this.max = props.max ? props.max : 100; } // ============================ 方法 =============================== /** * 初始化解析器 */ getParser() { if (!this.dataType || this.dataType.toLocaleLowerCase() == "string") { return new DDeiArrtibuteParserString(null, this); } else if (this.dataType.toLocaleLowerCase() == "integer" || this.dataType.toLocaleLowerCase() == "float" || this.dataType.toLocaleLowerCase() == "number") { return new DDeiArrtibuteParserNumber(null, this); } else if (this.dataType.toLocaleLowerCase() == "boolean" || this.dataType.toLocaleLowerCase() == "bool") { return new DDeiArrtibuteParserBool(null, this); } return null; } } class DDeiConverterBase extends DDeiPluginBase { // ============================ 方法 =============================== /** * 判定是否生效 */ isEnable(fileData) { return true; } /** * 输入 */ input(fileData) { return fileData; } /** * 输出 */ output(fileData) { return fileData; } getConverters(editor) { return [this]; } } class DDeiMenuBase extends DDeiPluginBase { constructor() { super(...arguments); __publicField2(this, "label"); __publicField2(this, "icon"); __publicField2(this, "disabled"); } getMenus(editor) { let option = this.getOptions(); if (option) { for (let i2 in option) { if (i2 != "name") { this[i2] = option[i2]; } } } return [this]; } } const ov_link_v_split_point = `(model, ov, ovd,link){ //根据ov与圆心基准控件的大小,计算控件位置 //获取Y轴的缩放比例 let bpv = DDeiUtil.pointsToZero([model.bpv], model.cpv, model.rotate)[0] let scaleY = Math.abs(bpv.y / 100) let scaleX = Math.abs(bpv.x / 100) //获取当前ov的index,当前index与compose的index必须对应 let ovs = DDeiUtil.getOVSByType(model,1); let ovIndex = ovs.indexOf(ov); let novIndex = ovIndex + 1 //得到当前控制点,还原到基准坐标的大小 let oar = [ov] //如果是第一个点,则开始点为-50 if(novIndex < ovs.length){ oar.push(ovs[novIndex]) } let opv = DDeiUtil.pointsToZero(oar, model.cpv, model.rotate) let opvY0 = opv[0].y / scaleY let sy,ey if(ovIndex == 0){ sy = -50 }else{ let bopv = DDeiUtil.pointsToZero([ovs[ovIndex-1]], model.cpv, model.rotate) sy = bopv[0].y/scaleY } if(novIndex < ovs.length){ let opvY1 = opv[1].y / scaleY ey = opvY1 }else{ ey = 50 } let comp0HeightBase = opvY0-sy let comp1HeightBase = ey - opvY0 let comp0CY = sy + comp0HeightBase / 2 let comp1CY = sy + comp0HeightBase + comp1HeightBase / 2 let models = link.models let comps0 = [] let compsCPVS0 = [] models?.forEach(comp0Path => { let comp0 = DDeiUtil.getDataByPathList(model, comp0Path) compsCPVS0.push(comp0.cpv) comps0.push(comp0) }); let compCPVS0 = DDeiUtil.pointsToZero(compsCPVS0, model.cpv, model.rotate) let vs0 = [] compCPVS0?.forEach(vs => { vs0.push(new Vector3(vs.x/scaleX, comp0CY, 1)) }); let cpvs = DDeiUtil.zeroToPoints(vs0, model.cpv, model.rotate, scaleX, scaleY) for(let i = 0;i < comps0.length;i++){ let comp0 = comps0[i] //composes的cpv归零0坐标,如果compse的X坐标不为0,则需要考虑旋转后X增量带来的Y变化 //实际位移量=中心点位移量 X 2 let comp0DeltaBPVX = (cpvs[i].x - comp0.cpv.x) * 2 let comp0DeltaBPVY = (cpvs[i].y - comp0.cpv.y) * 2 //计算位移量在原始大小中的比例 let comp0DeltaBPVXRate = comp0DeltaBPVX / (comp0.bpv.x - comp0.cpv.x) let comp0DeltaBPVYRate = comp0DeltaBPVY / (comp0.bpv.y - comp0.cpv.y) comp0.bpv.x = (comp0.bpv.x - comp0.cpv.x) * (1 + comp0DeltaBPVXRate) + cpvs[i].x comp0.bpv.y = (comp0.bpv.y - comp0.cpv.y) * (1 + comp0DeltaBPVYRate) + cpvs[i].y comp0.cpv.x = cpvs[i].x comp0.cpv.y = cpvs[i].y //重新初始化并采样 comp0.initPVS(); } let nextModels = link.nextModels let comps1 = [] let compsCPVS1 = [] nextModels?.forEach(comp1Path => { let comp1 = DDeiUtil.getDataByPathList(model, comp1Path) compsCPVS1.push(comp1.cpv) comps1.push(comp1) }); let compCPVS1 = DDeiUtil.pointsToZero(compsCPVS1, model.cpv, model.rotate) let vs1 = [] compCPVS1?.forEach(vs => { vs1.push(new Vector3(vs.x/scaleX, comp1CY, 1)) }); cpvs = DDeiUtil.zeroToPoints(vs1, model.cpv, model.rotate, scaleX, scaleY) for(let i = 0;i < comps1.length;i++){ let comp1 = comps1[i] //composes的cpv归零0坐标,如果compse的X坐标不为0,则需要考虑旋转后X增量带来的Y变化 let compCPVS = DDeiUtil.pointsToZero([comp1.cpv], model.cpv, model.rotate) let comp1DeltaBPVX = (cpvs[i].x - comp1.cpv.x) * 2 let comp1DeltaBPVY = (cpvs[i].y - comp1.cpv.y) * 2 //计算位移量在原始大小中的比例 let comp1DeltaBPVXRate = comp1DeltaBPVX / (comp1.bpv.x - comp1.cpv.x) let comp1DeltaBPVYRate = comp1DeltaBPVY / (comp1.bpv.y - comp1.cpv.y) comp1.bpv.x = (comp1.bpv.x - comp1.cpv.x) * (1 - comp1DeltaBPVXRate) + cpvs[i].x comp1.bpv.y = (comp1.bpv.y - comp1.cpv.y) * (1 - comp1DeltaBPVYRate) + cpvs[i].y comp1.cpv.x = cpvs[i].x comp1.cpv.y = cpvs[i].y //重新初始化并采样 comp1.initPVS(); } }`; const ov_link_h_split_point = `(model, ov, ovd, link){ //根据ov与圆心基准控件的大小,计算控件位置 //获取Y轴的缩放比例 let bpv = DDeiUtil.pointsToZero([model.bpv], model.cpv, model.rotate)[0] let scaleY = Math.abs(bpv.y / 100) let scaleX = Math.abs(bpv.x / 100) //获取当前ov的index,当前index与compose的index必须对应 let ovs = DDeiUtil.getOVSByType(model,2); let ovIndex = ovs.indexOf(ov); let novIndex = ovIndex + 1 //得到当前控制点,还原到基准坐标的大小 let oar = [ov] //如果是第一个点,则开始点为-50 if(novIndex < ovs.length){ oar.push(ovs[novIndex]) } let opv = DDeiUtil.pointsToZero(oar, model.cpv, model.rotate) let opvX0 = opv[0].x / scaleX let sx,ex if(ovIndex == 0){ sx = -50 }else{ let bopv = DDeiUtil.pointsToZero([ovs[ovIndex-1]], model.cpv, model.rotate) sx = bopv[0].x/scaleX } if(novIndex < ovs.length){ let opvX1 = opv[1].x / scaleX ex = opvX1 }else{ ex = 50 } let comp0Base = opvX0-sx let comp1Base = ex - opvX0 let comp0CX = sx + comp0Base / 2 let comp1CX = sx + comp0Base + comp1Base / 2 let models = link.models let comps0 = [] let compsCPVS0 = [] models?.forEach(comp0Path => { let comp0 = DDeiUtil.getDataByPathList(model, comp0Path) compsCPVS0.push(comp0.cpv) comps0.push(comp0) }); let compCPVS0 = DDeiUtil.pointsToZero(compsCPVS0, model.cpv, model.rotate) let vs0 = [] compCPVS0?.forEach(vs => { vs0.push(new Vector3(comp0CX, vs.y/scaleY , 1)) }); let cpvs = DDeiUtil.zeroToPoints(vs0, model.cpv, model.rotate, scaleX, scaleY) for(let i = 0;i < comps0.length;i++){ let comp0 = comps0[i] //composes的cpv归零0坐标,如果compse的X坐标不为0,则需要考虑旋转后X增量带来的Y变化 //实际位移量=中心点位移量 X 2 let comp0DeltaBPVX = (cpvs[i].x - comp0.cpv.x) * 2 let comp0DeltaBPVY = (cpvs[i].y - comp0.cpv.y) * 2 //计算位移量在原始大小中的比例 let comp0DeltaBPVXRate = comp0DeltaBPVX / (comp0.bpv.x - comp0.cpv.x) let comp0DeltaBPVYRate = comp0DeltaBPVY / (comp0.bpv.y - comp0.cpv.y) comp0.bpv.x = (comp0.bpv.x - comp0.cpv.x) * (1 + comp0DeltaBPVXRate) + cpvs[i].x comp0.bpv.y = (comp0.bpv.y - comp0.cpv.y) * (1 + comp0DeltaBPVYRate) + cpvs[i].y comp0.cpv.x = cpvs[i].x comp0.cpv.y = cpvs[i].y //重新初始化并采样 comp0.initPVS(); } let nextModels = link.nextModels let comps1 = [] let compsCPVS1 = [] nextModels?.forEach(comp1Path => { let comp1 = DDeiUtil.getDataByPathList(model, comp1Path) compsCPVS1.push(comp1.cpv) comps1.push(comp1) }); let compCPVS1 = DDeiUtil.pointsToZero(compsCPVS1, model.cpv, model.rotate) let vs1 = [] compCPVS1?.forEach(vs => { vs1.push(new Vector3(comp1CX,vs.y/scaleY, 1)) }); cpvs = DDeiUtil.zeroToPoints(vs1, model.cpv, model.rotate, scaleX, scaleY) for(let i = 0;i < comps1.length;i++){ let comp1 = comps1[i] //composes的cpv归零0坐标,如果compse的X坐标不为0,则需要考虑旋转后X增量带来的Y变化 let compCPVS = DDeiUtil.pointsToZero([comp1.cpv], model.cpv, model.rotate) let comp1DeltaBPVX = (cpvs[i].x - comp1.cpv.x) * 2 let comp1DeltaBPVY = (cpvs[i].y - comp1.cpv.y) * 2 //计算位移量在原始大小中的比例 let comp1DeltaBPVXRate = comp1DeltaBPVX / (comp1.bpv.x - comp1.cpv.x) let comp1DeltaBPVYRate = comp1DeltaBPVY / (comp1.bpv.y - comp1.cpv.y) comp1.bpv.x = (comp1.bpv.x - comp1.cpv.x) * (1 - comp1DeltaBPVXRate) + cpvs[i].x comp1.bpv.y = (comp1.bpv.y - comp1.cpv.y) * (1 - comp1DeltaBPVYRate) + cpvs[i].y comp1.cpv.x = cpvs[i].x comp1.cpv.y = cpvs[i].y //重新初始化并采样 comp1.initPVS(); } }`; class DDeiThemeBase extends DDeiPluginBase { constructor() { super(...arguments); __publicField2(this, "label"); __publicField2(this, "icon"); __publicField2(this, "css"); } // ============================ 方法 =============================== getThemes(editor) { let option = this.getOptions(); if (option) { for (let i2 in option) { if (i2 != "name") { this[i2] = option[i2]; } } } return [this]; } } const _DDeiEditorCommandAddHistroy = class _DDeiEditorCommandAddHistroy2 extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let editor = bus.invoker; if ((editor == null ? void 0 : editor.files.length) > 0 && (editor.currentFileIndex == 0 || editor.currentFileIndex)) { let file = editor == null ? void 0 : editor.files[editor.currentFileIndex]; if ((file == null ? void 0 : file.active) == DDeiActiveType.ACTIVE) { let data2 = JSON.stringify(file.toJSON()); let lastData = null; if (file.histroyIdx != -1) { lastData = file.histroy[file.histroyIdx]; } if (data2 != lastData) { _DDeiEditorCommandAddHistroy2.addHistroy(file, data2); } } } return true; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new _DDeiEditorCommandAddHistroy2({ code: DDeiEditorEnumBusCommandType.AddFileHistroy, name: "", desc: "" }); } static addHistroy(file, data) { file.addHistroy(data); } }; _DDeiEditorCommandAddHistroy.addHistroy = debounce(_DDeiEditorCommandAddHistroy.addHistroy, 200, { trailing: true, leading: false }); let DDeiEditorCommandAddHistroy = _DDeiEditorCommandAddHistroy; const __vite_glob_0_0$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiEditorCommandAddHistroy, default: DDeiEditorCommandAddHistroy }, Symbol.toStringTag, { value: "Module" })); class DDeiEditorCommandChangeEditMode extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let editor = bus.invoker; if (data == null ? void 0 : data.mode) { editor.changeEditMode(data.mode); } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { bus.insert(DDeiEnumBusCommandType.ChangeEditMode, data, evt); return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiEditorCommandChangeEditMode({ code: DDeiEditorEnumBusCommandType.ChangeEditMode, name: "", desc: "" }); } } const __vite_glob_0_1$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiEditorCommandChangeEditMode, default: DDeiEditorCommandChangeEditMode }, Symbol.toStringTag, { value: "Module" })); class DDeiEditorCommandClearTemplateUI extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { { let ele = document.getElementById(bus.invoker.containerid); let dialogs = []; for (let i2 = 0; i2 < ele.children.length; i2++) { if (ele.children[i2].className == "ddei-combox-show-dialog") { dialogs.push(ele.children[i2]); } } dialogs.forEach((dialog) => { dialog.style.display = "none"; }); } { DDeiEditorUtil$1.closeDialogs(bus.invoker, ["bottom-dialog", "property-dialog", "top-dialog", "toolbox-dialog"]); } { let menuDialogId = DDeiUtil$1.getMenuControlId(bus.invoker); let menuEle = document.getElementById(menuDialogId); if (menuEle) { menuEle.style.display = "none"; } } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiEditorCommandClearTemplateUI({ code: DDeiEditorEnumBusCommandType.ClearTemplateUI, name: "", desc: "" }); } } const __vite_glob_0_2$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiEditorCommandClearTemplateUI, default: DDeiEditorCommandClearTemplateUI }, Symbol.toStringTag, { value: "Module" })); class DDeiEditorCommandFileDirty extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let editor = bus.invoker; if ((data == null ? void 0 : data.state) && (editor == null ? void 0 : editor.files.length) > 0 && (editor.currentFileIndex == 0 || editor.currentFileIndex)) { let file = editor == null ? void 0 : editor.files[editor.currentFileIndex]; if ((file == null ? void 0 : file.active) == DDeiActiveType.ACTIVE) { file.modelNumber = file.calModelNumber(); file.state = data == null ? void 0 : data.state; } } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiEditorCommandFileDirty({ code: DDeiEditorEnumBusCommandType.RefreshEditorParts, name: "", desc: "" }); } } const __vite_glob_0_3$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiEditorCommandFileDirty, default: DDeiEditorCommandFileDirty }, Symbol.toStringTag, { value: "Module" })); class DDeiEditorCommandLoadFile extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let editor = bus.invoker; let ddInstance = editor.ddInstance; let loadFile = DDeiEditorUtil$1.getConfigValue( "EVENT_LOAD_FILE", editor ); if (loadFile) { loadFile().then((fileData) => { let converters = editor.getEnabledConverters(fileData, 1); converters == null ? void 0 : converters.forEach((converter) => { fileData = converter.input(fileData); }); if (fileData) { let file = null; for (let x2 = 0; x2 < editor.files.length; x2++) { if (editor.files[x2].id == fileData.id) { file = editor.files[x2]; } editor.files[x2].active = DDeiActiveType.NONE; } if (!file) { if (fileData == null ? void 0 : fileData.content) { file = DDeiFile.loadFromJSON(JSON.parse(fileData == null ? void 0 : fileData.content), { currentDdInstance: editor.ddInstance }); file.id = fileData.id; file.publish = fileData.publish; file.name = fileData.name; file.path = fileData.path; file.desc = fileData.desc; file.version = fileData.version; file.extData = fileData.extData; file.busiData = fileData.busiData; } else { file = new DDeiFile({ id: fileData.id, publish: fileData.publish, name: fileData.name, path: fileData.path, desc: fileData.desc, version: fileData.version, extData: fileData.extData, busiData: fileData.busiData, sheets: [ new DDeiSheet({ name: "新建页面", desc: "新建页面", stage: DDeiStage.initByJSON( { id: "stage_1" }, { currentDdInstance: ddInstance } ), active: DDeiActiveType.ACTIVE }) ], currentSheetIndex: 0, state: DDeiFileState.NEW, active: DDeiActiveType.ACTIVE }); } editor.addFile(file); file.state = DDeiFileState.NONE; } editor.currentFileIndex = editor.files.indexOf(file); file.active = DDeiActiveType.ACTIVE; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { file.changeSheet(file.currentSheetIndex); let stage2 = sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance; file.initHistroy(); ddInstance.stage = stage2; stage2.initRender(); editor.changeState(DDeiEditorState.DESIGNING); ddInstance.bus.insert(DDeiEditorEnumBusCommandType.ClearTemplateUI, 0); ddInstance.bus.insert(DDeiEnumBusCommandType.RefreshShape, 1); ddInstance.bus.insert(DDeiEditorEnumBusCommandType.RefreshEditorParts, 2); ddInstance.bus.executeAll(); } } }); } else { let fileText = editor.i18n("ddei.file"); let newText = editor.i18n("ddei.new"); let pageText = editor.i18n("ddei.page"); let file = DDeiFile.loadFromJSON( { name: newText + fileText + "_NEW", path: "/" + newText + fileText + "_NEW", sheets: [ new DDeiSheet({ name: pageText + "-1", desc: pageText + "-1", stage: DDeiStage.initByJSON({ id: "stage_1" }, { currentDdInstance: ddInstance }), active: DDeiActiveType.ACTIVE }) ], currentSheetIndex: 0, state: DDeiFileState.NEW, active: DDeiActiveType.ACTIVE }, { currentDdInstance: ddInstance } ); if (editor.currentFileIndex != -1) { editor.files[editor.currentFileIndex].active = DDeiActiveType.NONE; } editor.addFile(file); editor.currentFileIndex = editor.files.indexOf(file); file.active = DDeiActiveType.ACTIVE; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { file.changeSheet(file.currentSheetIndex); let stage2 = sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance; file.initHistroy(); ddInstance.stage = stage2; stage2.initRender(); editor.changeState(DDeiEditorState.DESIGNING); ddInstance.bus.insert(DDeiEditorEnumBusCommandType.ClearTemplateUI, 0); ddInstance.bus.insert(DDeiEnumBusCommandType.RefreshShape, 1); ddInstance.bus.insert(DDeiEditorEnumBusCommandType.RefreshEditorParts, 2); ddInstance.bus.executeAll(); } } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiEditorCommandLoadFile({ code: DDeiEditorEnumBusCommandType.LoadFile, name: "", desc: "" }); } } const __vite_glob_0_4$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiEditorCommandLoadFile, default: DDeiEditorCommandLoadFile }, Symbol.toStringTag, { value: "Module" })); class DDeiEditorCommandRefreshEditorParts extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { var _a3, _b2, _c2; let editor = bus.invoker; if (((_a3 = data == null ? void 0 : data.parts) == null ? void 0 : _a3.length) > 0) { (_b2 = editor.layoutViewer) == null ? void 0 : _b2.forceRefreshParts(data == null ? void 0 : data.parts); } else { (_c2 = editor.layoutViewer) == null ? void 0 : _c2.forceRefreshParts(); } return true; } /** * 后置行为,分发 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiEditorCommandRefreshEditorParts({ code: DDeiEditorEnumBusCommandType.RefreshEditorParts, name: "", desc: "" }); } } const __vite_glob_0_5$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiEditorCommandRefreshEditorParts, default: DDeiEditorCommandRefreshEditorParts }, Symbol.toStringTag, { value: "Module" })); class DDeiEditorCommandSaveFile extends DDeiBusCommand { // ============================ 构造函数 ============================ // ============================ 静态方法 ============================ // ============================ 属性 =============================== // ============================ 方法 =============================== /** * 前置行为,用于校验,本Command无需校验 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ before(data, bus, evt) { return true; } /** * 具体行为,设置当前控件的选中状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ action(data, bus, evt) { let editor = bus.invoker; if ((editor == null ? void 0 : editor.files.length) > 0 && (editor.currentFileIndex == 0 || editor.currentFileIndex)) { let file = editor == null ? void 0 : editor.files[editor.currentFileIndex]; if ((file == null ? void 0 : file.active) == DDeiActiveType.ACTIVE) { if ((file == null ? void 0 : file.state) == DDeiFileState.NEW || (file == null ? void 0 : file.state) == DDeiFileState.MODIFY || data.publish == 1) { let oldState = file.state; file.lastUpdateTime = (/* @__PURE__ */ new Date()).getTime(); let json = file.toJSON(); if (json) { let converters = editor.getEnabledConverters(json, 2); converters == null ? void 0 : converters.forEach((converter) => { json = converter.output(json); }); json.state = DDeiFileState.NONE; if (data.publish == 1) { file.state = DDeiFileState.PUBLISHING; let publishFile = DDeiEditorUtil$1.getConfigValue( "EVENT_PUBLISH_FILE", editor ); if (publishFile) { DDeiUtil$1.stageScreenToImage(bus.ddInstance, 400, 240).then((thumbBase64) => { if (thumbBase64) { json.thumb = thumbBase64; } publishFile(json).then((data2) => { if (data2.result == 1) { file.state = DDeiFileState.NONE; file.histroy.forEach((his) => { if (his.isNew == true) { delete his.isNew; } }); file.histroy[file.histroyIdx].isNew = true; } else if (data2.result != 4) { file.state = oldState; } }); }); } } else { file.state = DDeiFileState.SAVING; let saveFile = DDeiEditorUtil$1.getConfigValue( "EVENT_SAVE_FILE", editor ); if (saveFile) { DDeiUtil$1.stageScreenToImage(bus.ddInstance, 400, 240).then((thumbBase64) => { if (thumbBase64) { json.thumb = thumbBase64; } saveFile(json, file).then((data2) => { if (data2.result == 1) { file.state = DDeiFileState.NONE; file.histroy.forEach((his) => { if (his.isNew == true) { delete his.isNew; } }); file.histroy[file.histroyIdx].isNew = true; bus == null ? void 0 : bus.insert(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["openfiles"] }, evt); bus.executeAll(); } else if (data2.result != 4) { file.state = oldState; } }); }); } } } } } } return true; } /** * 后置行为,分发,修改当前editor的状态 * @param data bus分发后,当前承载的数据 * @param bus 总线对象引用 * @param evt 事件对象引用 */ after(data, bus, evt) { return true; } /** * 返回当前实例 * @returns */ static newInstance() { return new DDeiEditorCommandSaveFile({ code: DDeiEditorEnumBusCommandType.SaveFile, name: "", desc: "" }); } } const __vite_glob_0_6$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DDeiEditorCommandSaveFile, default: DDeiEditorCommandSaveFile }, Symbol.toStringTag, { value: "Module" })); const autoLoadCommand = function() { const control_ctx2 = /* @__PURE__ */ Object.assign({ "./bus/commands/add-histroy.ts": __vite_glob_0_0$7, "./bus/commands/change-edit-mode.ts": __vite_glob_0_1$4, "./bus/commands/clear-template-ui.ts": __vite_glob_0_2$4, "./bus/commands/file-dirty.ts": __vite_glob_0_3$4, "./bus/commands/load-file.ts": __vite_glob_0_4$3, "./bus/commands/refresh-editor-parts.ts": __vite_glob_0_5$3, "./bus/commands/save-file.ts": __vite_glob_0_6$3 }); let loadArray2 = []; for (const path in control_ctx2) { loadArray2.push(control_ctx2[path]); } loadArray2.forEach((item) => { let command = item.default; if (command) { let cmdInst = command.newInstance(); if (cmdInst == null ? void 0 : cmdInst.code) { addCommand(cmdInst.code, cmdInst); } } }); }; class DDeiEditorArrtibute extends DDeiArrtibuteDefine { // ============================ 构造函数 =============================== constructor(props) { super(props); __publicField2(this, "group"); __publicField2(this, "controlType"); __publicField2(this, "orderNo"); __publicField2(this, "visiable"); __publicField2(this, "diffValues", []); __publicField2(this, "hiddenTitle"); __publicField2(this, "display"); __publicField2(this, "value", null); __publicField2(this, "exmapping"); __publicField2(this, "itemStyle", null); __publicField2(this, "canSearch", false); __publicField2(this, "step", 1); __publicField2(this, "cascadeDisplay", null); this.group = props.group; this.controlType = props.controlType ? props.controlType : "text"; this.orderNo = props.orderNo; this.visiable = props.visiable == false ? false : true; this.value = props.value ? props.value : null; this.display = props.display ? props.display : "row"; this.hiddenTitle = props.hiddenTitle ? props.hiddenTitle : false; this.step = props.step ? props.step : 1; this.itemStyle = props.itemStyle ? props.itemStyle : null; this.canSearch = props.canSearch ? props.canSearch : false; this.exmapping = props.exmapping; this.cascadeDisplay = props.cascadeDisplay; } // ============================ 方法 =============================== /** * 根据当前的值,更新配置信息 */ doCascadeDisplayByValue() { var _a3, _b2; let cascadeDisplayConfig = null; if (this.cascadeDisplay) { if (this.cascadeDisplay[this.value]) { cascadeDisplayConfig = this.cascadeDisplay[this.value]; } else { if (this.value && this.value != "" && this.value != "0" && this.value != 0) { cascadeDisplayConfig = this.cascadeDisplay["notempty"]; } else if (this.value == null && this.defaultValue) { cascadeDisplayConfig = this.cascadeDisplay["default"]; } else { cascadeDisplayConfig = this.cascadeDisplay["empty"]; } } } if (((_a3 = cascadeDisplayConfig == null ? void 0 : cascadeDisplayConfig.show) == null ? void 0 : _a3.length) > 0) { DDeiEditorArrtibute.showAttributesByCode( this.topGroup, cascadeDisplayConfig.show ); } if (((_b2 = cascadeDisplayConfig == null ? void 0 : cascadeDisplayConfig.hidden) == null ? void 0 : _b2.length) > 0) { DDeiEditorArrtibute.hiddenAttributesByCode( this.topGroup, cascadeDisplayConfig.hidden ); } } /** * * @param propTopGroup 隐藏属性 * @param paths */ static hiddenAttributesByCode(propTopGroup, ...paths) { var _a3; if (((_a3 = propTopGroup == null ? void 0 : propTopGroup.subGroups) == null ? void 0 : _a3.length) > 0 && paths) { propTopGroup.subGroups.forEach((group2) => { var _a22; if (((_a22 = group2 == null ? void 0 : group2.children) == null ? void 0 : _a22.length) > 0) { group2.children.forEach((item) => { paths.forEach((path) => { if (path.indexOf(item.code) != -1) { item.visiable = false; } }); }); } }); } } /** * 显示属性 * @param propTopGroup * @param paths */ static showAttributesByCode(propTopGroup, ...paths) { var _a3; if (((_a3 = propTopGroup == null ? void 0 : propTopGroup.subGroups) == null ? void 0 : _a3.length) > 0 && paths) { propTopGroup.subGroups.forEach((group2) => { var _a22; if (((_a22 = group2 == null ? void 0 : group2.children) == null ? void 0 : _a22.length) > 0) { group2.children.forEach((item) => { paths.forEach((path) => { if (path.indexOf(item.code) != -1) { item.visiable = true; } }); }); } }); } } } class DDeiLifeCycle extends DDeiPluginBase { constructor() { super(...arguments); __publicField2(this, "EVENT_CONTROL_SELECT_BEFORE", null); __publicField2(this, "EVENT_CONTROL_DBL_CLICK", null); __publicField2(this, "EVENT_CONTROL_SELECT_AFTER", null); __publicField2(this, "EVENT_CONTROL_CREATE_BEFORE", null); __publicField2(this, "EVENT_MOUSE_OPERATING", null); __publicField2(this, "EVENT_CONTROL_CREATE_AFTER", null); __publicField2(this, "EVENT_CONTROL_DRAG_BEFORE", null); __publicField2(this, "EVENT_CONTROL_DRAGING", null); __publicField2(this, "EVENT_CONTROL_DRAG_AFTER", null); __publicField2(this, "EVENT_LINE_DRAG_BEFORE", null); __publicField2(this, "EVENT_LINE_DRAG_AFTER", null); __publicField2(this, "EVENT_CONTROL_DEL_BEFORE", null); __publicField2(this, "EVENT_CONTROL_DEL_AFTER", null); __publicField2(this, "EVENT_CONTROL_EDIT_BEFORE", null); __publicField2(this, "EVENT_CONTROL_EDIT_AFTER", null); __publicField2(this, "EVENT_CONTROL_VIEW_BEFORE", null); __publicField2(this, "EVENT_CONTROL_VIEW", null); __publicField2(this, "EVENT_CONTROL_VIEW_AFTER", null); __publicField2(this, "EVENT_STAGE_CHANGE_WPV", null); __publicField2(this, "EVENT_STAGE_CHANGE_RATIO", null); __publicField2(this, "EVENT_MOUSE_MOVE_IN_CONTROL", null); __publicField2(this, "EVENT_MOUSE_MOVE_IN_LAYER", null); __publicField2(this, "EVENT_MOUSE_IN_AREA", null); __publicField2(this, "EVENT_CLOSE_FILE_AFTER", null); __publicField2(this, "EVENT_CHANGE_FILE_AFTER", null); __publicField2(this, "EVENT_CHANGE_SHEET_AFTER", null); __publicField2(this, "EVENT_DEL_SHEET_AFTER", null); __publicField2(this, "EVENT_CLOSE_FILE_BEFORE", null); __publicField2(this, "EVENT_CHANGE_FILE_BEFORE", null); __publicField2(this, "EVENT_CHANGE_SHEET_BEFORE", null); __publicField2(this, "EVENT_DEL_SHEET_BEFORE", null); __publicField2(this, "EVENT_ADD_FILE_AFTER", null); __publicField2(this, "EVENT_ADD_SHEET_AFTER", null); __publicField2(this, "EVENT_ADD_FILE_BEFORE", null); __publicField2(this, "EVENT_ADD_SHEET_BEFORE", null); __publicField2(this, "EVENT_CONTROL_ROTATE_BEFORE", null); __publicField2(this, "EVENT_CONTROL_ROTATE_AFTER", null); } // ============================ 方法 =============================== getLifeCyclies(editor) { let option = this.getOptions(); if (option) { for (let i2 in option) { if (i2 != "name") { this[i2] = option[i2]; } } } return [this]; } } const _sfc_main$1g = { name: "DDei-Editor-Menu-Dialog", extends: null, mixins: [], props: { editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { /** * 执行菜单的Action */ execMenuAction(menu, evt) { var _a3, _b2, _c2; let stage2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage; let menuAction = this.editor.menus[menu.name]; if (menuAction && stage2) { let menuShape = (_c2 = stage2.render) == null ? void 0 : _c2.currentMenuShape; menuAction.action(menuShape, evt); } this.$refs.menuDialog.style.display = "none"; stage2.render.operateState = DDeiEnumOperateState.NONE; this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); this.editor.bus.executeAll(); }, /** * 判断菜单是否显示 */ isVisiable(menu) { var _a3, _b2, _c2; try { let stage2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage; let menuAction = this.editor.menus[menu.name]; if (menuAction && stage2) { let menuShape = (_c2 = stage2.render) == null ? void 0 : _c2.currentMenuShape; return menuAction.isVisiable(menuShape); } } catch (e) { console.error(e); } return false; } } }; const MenuDialog_vue_vue_type_style_index_0_scoped_1cde0d47_lang = ""; const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; const _hoisted_1$1e = ["id"]; const _hoisted_2$V = ["onClick"]; const _hoisted_3$R = { key: 0, class: "ddei-editor-menu-dialog-item-icon" }; const _hoisted_4$G = { key: 0, class: "icon", "aria-hidden": "true" }; const _hoisted_5$y = ["xlink:href"]; const _hoisted_6$s = { key: 1, class: "ddei-editor-menu-dialog-item-content" }; const _hoisted_7$p = { key: 2, class: "ddei-editor-menu-dialog-item-desc" }; function _sfc_render$1g(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2; return vue.openBlock(), vue.createElementBlock("div", { id: ((_a3 = $props.editor) == null ? void 0 : _a3.id) + "_menu_dialog", ref: "menuDialog", class: "ddei-editor-menu-dialog" }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_b2 = $props.editor) == null ? void 0 : _b2.currentMenuData, (menu) => { return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-editor-menu-dialog-hr": menu.code == "split", "ddei-editor-menu-dialog-item": menu.code != "split" }), onClick: ($event) => $options.execMenuAction(menu, $event) }, [ menu.code != "split" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$R, [ menu.icon ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4$G, [ vue.createElementVNode("use", { "xlink:href": menu.icon }, null, 8, _hoisted_5$y) ])) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true), menu.code != "split" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$s, vue.toDisplayString($props.editor.i18n(menu.label)), 1)) : vue.createCommentVNode("", true), menu.code != "split" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$p, vue.toDisplayString($props.editor.i18n(menu.desc)), 1)) : vue.createCommentVNode("", true) ], 10, _hoisted_2$V)), [ [vue.vShow, $options.isVisiable(menu)] ]); }), 256)) ], 8, _hoisted_1$1e); } const MenuDialog = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["render", _sfc_render$1g], ["__scopeId", "data-v-1cde0d47"]]); const en_US$1 = { ddei: { file: "File", new: "New", open: "Open", save: "Save", abort: "Abort", publish: "Publish", download: "Download", export: "Export", import: "Import", clear: "Clear", close: "Close", collection: "Collection", confirm: "Confirm", cancel: "Cancel", cutBoard: "CutBoard", textEdit: "TextEdit", tools: "Tools", sortAndAlign: "Sort", scale: "Scale", style: "Style", fill: "Fill", border: "Border", line: "Line", layout: "Layout", text: "Text", code: "Code", name: "Name", desc: "Description", format: "Format", data: "Data", database: "DataBase", setting: "Setting", cut: "Cut", copy: "Copy", delete: "Delete", paste: "Paste", more: "More", page: "Page", shapesCount: "Shapes:", shapes: "Shapes:", layerName: "Layer", newLayer: "New", background: "Back Ground", backgroundColor: "BGColor", position: "Position", align: "Align", combina: "Combina", cancelCombina: "Spread", sort: "Sort", flip: "Flap", rotate: "Rotate", mirror: "Mirror", choose: "Choose", moveStage: "Move", linkLine: "Line", search: "Search", replace: "Replace", fileDescription: "DDei Design File", wholePage: "Whole Page", precent: "Pre", chooseShapeGroups: "Choose Shapes", basicSubject: "Basic", umlSubject: "UML", brush: "Brush", startPoint: "Start", endPoint: "End", lineType: "Type", lineColor: "Color", lineWeight: "Weight", lineDash: "Dash", pushUp: "Up", pushDown: "Down", pushTop: "Top", pushBottom: "Bottom", assistant: "Assistant", mark: "Mark", paper: "Paper", propertyName: "Property", searchResult: "Search Result", property: { id: "id", code: "Code", text: "Text", format: "Format", width: "Width", height: "Height", weight: "Weight", borderType: "Border Type", fillType: "Fill Type", startPointType: "Start", endPointType: "End", type: "Type", color: "Color", opacity: "Opacity", dash: "Dash", round: "Round", image: "Image", font: "Font", size: "Size", align: "Align", feed: "Wrap", outSize: "Out of Range", lockWidth: "Lock Width", paddingWeight: "Padding", hollow: "Hollow", bold: "Bold", italic: "Italic", underline: "Underline", deleteline: "Strike Through", topline: "Top Line", textbg: "Text Background", subtype: "Annotation Type", textAlign: "Text Align", textValign: "Vertical Align", hspace: "Horizontal Space", vspace: "Vertical Space", dateType: "Date Type", nscale: "Decimal", tmark: "Thousands Separator", mmark: "Currency Symbol", moneyUnit: "Currency Unit", moneyUpCase: "Currency in Uppercase", paperType: "Paper", unit: "Unit", direct: "Direction", markType: "Watermark", mark: "Watermark", markDirect: "Direction", ruler: "Ruler", grid: "Grid", jumpline: "JumpLine", background: "Back Ground", backgroundColor: "BG Color", backgroundImage: "BG Image", bgImageMode: "Mode", bgImageScale: "Scale", bgImagePosition: "Position", code001: "code001", linePointType: "Point Type", ds: { none: "None", color: "Color", image: "Image", yes: "Yes", no: "No", global: "Global", hidden: "Hidden", ellipsis: "Ellipsis", narrow: "Narrow", ext: "Extend", subType: "Normal", subType1: "Superscript", subType2: "Subscript", subType3: "Strike", text: "Text", decimal: "Decimal", money: "Currency", time: "Time", custom: "Custom", money1: "CNY", money2: "USD", money3: "EUR", money4: "GBP", money5: "JPY", money6: "RUB", money7: "CHF", line: "Solid Line", point: "Dotted", pos1: "TLeft", pos2: "TCenter", pos3: "TRight", pos4: "MLeft", pos5: "Center", pos6: "MRight", pos7: "BLeft", pos8: "BCenter", pos9: "BRight", mm: "mm", cm: "cm", m: "m", inch: "in", px: "px", transverse: "Landscape", portrait: "Portrait", ltrd: "Left-Right", rtld: "Right-Left", horizontal: "Horizontal", fill: "Fill", scale: "Scale", original: "Original", lineType1: "Straight", lineType2: "Broken", lineType3: "Curve", pointType1: "Arrow", pointType2: "Circle", pointType21: "FillCir", pointType3: "Rect", pointType31: "FillRect", pointType4: "Diamond", pointType41: "FillDiam", pointType5: "Triangle", pointType51: "FillTria", pointType6: "HalfCir", pointType61: "FillHalfCir" }, description: {} }, control: { groups: { basic: "Basic Shapes", flow: "Flow Shapes" }, controltran: "CtrlTran", pageref: "PageRef", display: "Display", delay: "Delay", prepare: "Prepare", card: "Card", manualoperate: "Manual", manualinput: "ManualIn", looparea: "LoopArea", "store-data": "StoreData", "seq-data": "SeqData", "direct-data": "DictData", "defined-flow": "DefFlow", "small-bracket": "Parenthes", "middle-bracket": "Square", "big-bracket": "Curly", comment: "Comment", document: "Document", polygon: "Polygon", stage: "Stage", text: "Text", square: "Square", rectangle: "Rectangle", circle: "Circle", squareRound: "Square", rectangleRound: "Rectangle", ellipse: "Ellipse", cube: "Cube", line: "Line", triangle: "Triangle", hexstar: "Hexstar", "triangle-left-90": "Triangle", "triangle-right-90": "Triangle", fivestar: "Fivestar", diamond: "Diamond", paralgram: "Paralgram", "triangle-left-90-round": "Triangle", hexagon: "Hexagon", "half-circle": "HalfCir", "rectangle-split": "SplitRect", "circle-split": "SplitCir", trapezoid: "Trapezoid", "arrow-left": "ArrowLeft", "arrow-right": "ArrowRight", pentagon: "Pentagon", angle: "Angle", bidfunnel: "BidFunnel", ptap: "PaperTape", human: "Human", start: "Start", end: "End", task: "Task", "start-or-end": "StartEnd", switch: "Switch", subflow: "SubFlow", description: {} }, selectColor: { "standard": "Standard", "recently": "Recent", "choosed": "Selected" } } }; const __vite_glob_0_0$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: en_US$1 }, Symbol.toStringTag, { value: "Module" })); const zh_CN$1 = { ddei: { file: "文件", new: "新建", open: "打开", save: "保存", abort: "放弃", publish: "发布", download: "下载", export: "导出", import: "导入", clear: "清空", close: "关闭", collection: "收藏", confirm: "确定", cancel: "取消", cutBoard: "剪切板", textEdit: "文本编辑", tools: "工具", sortAndAlign: "排列与对齐", sort: "排列", scale: "缩放", style: "样式", fill: "填充", border: "边框", line: "线条", layout: "布局", text: "文本", code: "编码", name: "名称", desc: "备注", format: "格式", data: "数据", database: "数据库", setting: "设置", cut: "剪切", copy: "复制", delete: "删除", paste: "粘贴", more: "更多", page: "页面", shapesCount: "形状数:", shapes: "形状", layerName: "图层", newLayer: "新建图层", background: "背景", backgroundColor: "背景颜色", position: "位置", align: "对齐", combina: "组合", cancelCombina: "取消组合", flip: "翻转", rotate: "旋转", mirror: "镜像", choose: "选择", moveStage: "移动画布", linkLine: "连接线", search: "搜索", replace: "替换", fileDescription: "DDei设计文件", wholePage: "整页", precent: "百分比", chooseShapeGroups: "选择图形", basicSubject: "基本", umlSubject: "UML", brush: "格式刷", startPoint: "起点", endPoint: "终点", lineType: "类型", lineColor: "颜色", lineWeight: "粗细", lineDash: "虚线", pushUp: "上移一层", pushDown: "下移一层", pushTop: "置于顶层", pushBottom: "置于底层", assistant: "辅助功能", mark: "水印", paper: "纸张", propertyName: "属性", searchResult: "搜索结果", property: { id: "id", code: "编码", text: "文本", format: "格式化", width: "宽度", weight: "大小", height: "高度", borderType: "边框类型", fillType: "填充类型", startPointType: "起点", endPointType: "终点", type: "类型", color: "颜色", opacity: "透明度", dash: "虚线", round: "圆角", image: "图片", font: "字体", size: "大小", align: "对齐", feed: "换行", outSize: "超出范围", lockWidth: "锁定宽度", paddingWeight: "间隔大小", hollow: "镂空", bold: "加粗", italic: "倾斜", underline: "下划线", deleteline: "删除线", topline: "顶部线", textbg: "文字背景", subtype: "标注类型", textAlign: "水平对齐", textValign: "垂直对齐", hspace: "水平间距", vspace: "垂直间距", dateType: "日期类型", nscale: "小数", tmark: "千分符", mmark: "货币符号", moneyUnit: "货币单位", moneyUpCase: "人民币大写", paperType: "纸张类型", unit: "单位", direct: "方向", markType: "水印类型", mark: "水印", markDirect: "水印方向", ruler: "标尺", grid: "网格", jumpline: "自动跳线", background: "背景", backgroundColor: "背景颜色", backgroundImage: "背景图片", bgImageMode: "图片模式", bgImageScale: "缩放", bgImagePosition: "位置", code001: "编码001", linePointType: "端点类型", ds: { none: "无", color: "纯色", image: "图片", yes: "是", no: "否", global: "全局", hidden: "隐藏", ellipsis: "省略", narrow: "缩小", ext: "扩展", subType: "正常", subType1: "上标", subType2: "中标", subType3: "下标", text: "文本", decimal: "数字", money: "金额", time: "时间", custom: "自定义", money1: "人民币", money2: "美元", money3: "欧元", money4: "英镑", money5: "日元", money6: "卢布", money7: "法郎", line: "实线", point: "点阵", pos1: "左上", pos2: "中上", pos3: "右上", pos4: "左中", pos5: "正中", pos6: "右中", pos7: "左下", pos8: "中下", pos9: "右下", mm: "毫米", cm: "厘米", m: "米", inch: "英寸", px: "像素", transverse: "横向", portrait: "纵向", ltrd: "左上右下", rtld: "右上左下", horizontal: "水平显示", fill: "填充", scale: "缩放", original: "原始", lineType1: "直线", lineType2: "折线", lineType3: "曲线", pointType1: "箭头", pointType2: "圆", pointType21: "实心圆", pointType3: "方形", pointType31: "实心方形", pointType4: "菱形", pointType41: "实心菱形", pointType5: "三角", pointType51: "实心三角", pointType6: "半圆", pointType61: "实心半圆" }, description: {} }, control: { groups: { basic: "基础图形", flow: "流程图形" }, controltran: "控制传递", pageref: "跨页引用", display: "显示内容", delay: "推迟", prepare: "准备", card: "卡片", manualoperate: "手动操作", manualinput: "手动输入", looparea: "循环界限", "store-data": "存储数据", "seq-data": "顺序数据", "direct-data": "直接数据", "defined-flow": "预定义流程", "small-bracket": "小括号", "middle-bracket": "中括号", "big-bracket": "大括号", comment: "注释", document: "文档", polygon: "多边形", stage: "画布", text: "文本", square: "正方形", rectangle: "长方形", circle: "圆", ellipse: "椭圆", cube: "正方体", line: "连接线", triangle: "三角形", hexstar: "六角形", "triangle-left-90": "直角三角形", "triangle-right-90": "直角三角形", fivestar: "五角星", diamond: "菱形", paralgram: "平行四边形", hexagon: "六边形", "half-circle": "半圆", "rectangle-split": "长方形-切割", "circle-split": "圆-切割", trapezoid: "梯形", "arrow-left": "左箭头", "arrow-right": "右箭头", pentagon: "五边形", angle: "角", bidfunnel: "双向漏斗", ptap: "纸带", human: "人", start: "开始", end: "结束", task: "任务", "start-or-end": "开始/结束", switch: "分支", subflow: "子流程", description: {} }, selectColor: { "standard": "标准颜色", "recently": "最近使用", "choosed": "已选颜色" }, "confirm-save-file": "是否保存文件?" } }; const __vite_glob_0_1$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: zh_CN$1 }, Symbol.toStringTag, { value: "Module" })); const _sfc_main$1f = { name: "ddei-core-panel-topmenu", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { file: null, forceRefresh: true }; }, //注册组件 components: {}, computed: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { //强制刷新当前以及下层组件 forceRefreshParts(parts) { if (!parts || parts == "topmenu" || parts.indexOf("topmenu") != -1) { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); } }, refreshData() { var _a3, _b2; this.editor.topMenuViewer = this; let file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; this.file = file; }, /** * 焦点进入当前区域 */ changeEditorFocus() { if (this.editor.state != DDeiEditorState.TOP_MENU_OPERATING && this.editor.state != DDeiEditorState.QUICK_EDITING) { this.editor.changeState(DDeiEditorState.TOP_MENU_OPERATING); } this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); } } }; const TopMenu_vue_vue_type_style_index_0_scoped_fefbc1f9_lang = ""; const _hoisted_1$1d = { class: "ddei-core-panel-topmenu-quickbox" }; function _sfc_render$1f(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "ddei-core-panel-topmenu", onMousedown: _cache[0] || (_cache[0] = (...args) => $options.changeEditorFocus && $options.changeEditorFocus(...args)) }, [ vue.createElementVNode("div", _hoisted_1$1d, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_a3 = $props.editor) == null ? void 0 : _a3.getPartPanels($props.options, "panels"), (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ editor: $props.editor, controlDefine: $props.editor.currentControlDefine, options: item.options, ref_for: true }, item.options), null, 16, ["editor", "controlDefine", "options"]); }), 256)) ]) ], 32)) : vue.createCommentVNode("", true); } const TopMenu = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["render", _sfc_render$1f], ["__scopeId", "data-v-fefbc1f9"]]); const _DDeiCoreTopMenuPanel = class _DDeiCoreTopMenuPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", TopMenu.name); __publicField3(this, "defaultOptions", { "panels": [ "ddei-core-panel-fileinfo", "ddei-core-panel-operate", "ddei-core-panel-fontandtext", "ddei-core-panel-tool", "ddei-core-panel-sort" ] }); __publicField3(this, "plugins", [TopMenu]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[TopMenu.name]) { for (let i2 in options[TopMenu.name]) { newOptions[i2] = options[TopMenu.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreTopMenuPanel(newOptions); return panels; } } return _DDeiCoreTopMenuPanel; } static modify(fn) { return _DDeiCoreTopMenuPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreTopMenuPanel, "defaultIns", new _DDeiCoreTopMenuPanel()); let DDeiCoreTopMenuPanel = _DDeiCoreTopMenuPanel; const _sfc_main$1e = { name: "ddei-core-panel-toolbox", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, //是否允许自定义控件工具箱 custom: { type: Boolean, default: true }, //是否允许搜索控件 search: { type: Boolean, default: true }, //定义分组 customGroups: { type: Array, default: null }, //是否允许展开收折 expand: { type: Boolean, default: true } }, data() { return { //分组数据 groups: [], //用于搜索时保存原始的groups searchOriginGroups: null, //搜索控件时用的文本 searchText: "", forceRefresh: true }; }, computed: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { //强制刷新当前以及下层组件 forceRefreshParts(parts) { if (!parts || parts == "toolbox" || parts.indexOf("toolbox") != -1) { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); } }, refreshData() { var _a3; this.editor.needControlIcon = true; this.editor.toolBarViewer = this; if (this.editor.ddInstance && !this.editor.ddInstance.render) { this.editor.ddInstance.initRender(); } DDeiEditorUtil.readRecentlyToolGroups(); let hisGroups = DDeiEditorUtil.recentlyToolGroups; if ((hisGroups == null ? void 0 : hisGroups.length) > 0) { let groups = []; hisGroups.forEach((hg) => { let group2 = null; for (let i2 = 0; i2 < this.editor.groups.length; i2++) { if (this.editor.groups[i2].id == hg.id) { group2 = this.editor.groups[i2]; break; } } if (group2) { group2.expand = hg.expand; groups.push(group2); } }); this.groups = groups; } else { this.groups = clone(this.editor.groups); DDeiEditorUtil.whiteRecentlyToolGroups(this.groups); } if (this.customGroups) { let newGroups = []; (_a3 = this.customGroups) == null ? void 0 : _a3.forEach((cg) => { for (let i2 = 0; i2 < this.groups.length; i2++) { if (this.groups[i2].id == cg) { newGroups.push(this.groups[i2]); break; } } }); this.groups = newGroups; } this.searchOriginGroups = this.groups; }, mouseWheel(evt) { if (evt.currentTarget.clientHeight < evt.currentTarget.scrollHeight) { evt.cancelBubble = true; return false; } }, cancelCreateControl(e) { if (this.editor.state == DDeiEditorState.CONTROL_CREATING) { if (this.editor.creatingControls) { let ddInstance = this.editor.ddInstance; let layer2 = ddInstance.stage.layers[ddInstance.stage.layerIndex]; layer2.removeModels(this.editor.creatingControls, true, false); this.editor.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, e); } this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.changeState(DDeiEditorState.TOOLBOX_ACTIVE); this.editor.bus.executeAll(); e.preventDefault(); e.cancelBubble = true; } }, /** * 弹出选择控件Dialog */ showChooseDialog(evt) { let srcElement = evt.currentTarget; let selectGroups = []; this.groups.forEach((group2) => { if (group2.display) { selectGroups.push(group2.id); } }); DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-choosecontrolgroup", { selectGroups, callback: { select: this.groupBoxChoose }, group: "toolbox-dialog" }, { type: 4 }, srcElement); }, /** * 隐藏工具栏 */ hiddenToolBox() { window.leftWidth = this.editor.leftWidth; this.editor.leftWidth = 0; this.editor.changeState(DDeiEditorState.DESIGNING); }, /** * 展开或收折groupbox */ groupBoxExpand(group2) { if (group2) { group2.expand = !group2.expand; DDeiEditorUtil.whiteRecentlyToolGroups(this.groups); } }, /** * 关闭groupbox */ groupBoxClose(group2) { if (group2) { group2.display = false; if (this.groups.indexOf(group2) != -1) { this.groups.splice(this.groups.indexOf(group2), 1); } DDeiEditorUtil.whiteRecentlyToolGroups(this.groups); } }, /** * 关闭groupbox */ groupBoxOpen(group2) { if (group2) { group2.display = true; if (this.groups.indexOf(group2) == -1) { this.groups.push(group2); } DDeiEditorUtil.whiteRecentlyToolGroups(this.groups); } }, /** * 选择groupBox */ groupBoxChoose(groupid, choose) { let group2 = null; for (let i2 = 0; i2 < this.editor.groups.length; i2++) { if (this.editor.groups[i2].id == groupid) { group2 = this.editor.groups[i2]; break; } } if (choose) { this.groupBoxOpen(group2); } else { this.groupBoxClose(group2); } }, /** * 搜索按钮按下时,检测是否按下enter,按下后执行搜索 * @param evt */ searchInputEnter(evt) { if (evt.keyCode == 13) { this.searchControl(); } }, /** * 焦点进入当前区域 */ changeEditorFocus() { this.editor.changeState(DDeiEditorState.TOOLBOX_ACTIVE); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); }, /** * 准备创建 */ createControlPrepare(control, e) { var _a3, _b2, _c2, _d2, _e2; let ddInstance = this.editor.ddInstance; ddInstance.render.inEdge = 0; let stage2 = ddInstance.stage; let layer2 = stage2.layers[stage2.layerIndex]; if (layer2.display == 0 && !layer2.tempDisplay || layer2.lock) { return; } let controlInitJSON = DDeiEditorUtil.getModelInitJSON(this.editor.ddInstance, null, [control]); if (!controlInitJSON) { return; } let models = DDeiEditorUtil.createControl(controlInitJSON[0], this.editor); let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", DDeiEnumOperateType.CREATE, { models }, ddInstance, e); if (rsState == 0 || rsState == 1) { DDeiUtil.invokeCallbackFunc("EVENT_MOUSE_OPERATING", DDeiEnumOperateType.CREATE, null, ddInstance, e); let stageRatio2 = stage2.getStageRatio(); let moveMatrix2 = new Matrix3( 1, 0, -stage2.wpv.x * stageRatio2, 0, 1, -stage2.wpv.y * stageRatio2, 0, 0, 1 ); models.forEach((model) => { model.transVectors(moveMatrix2); model.setState(DDeiEnumControlState.CREATING); }); if ((models == null ? void 0 : models.length) > 0) { let ddInstance2 = this.editor.ddInstance; let stage22 = ddInstance2.stage; if (((_a3 = stage22 == null ? void 0 : stage22.render) == null ? void 0 : _a3.operateState) == DDeiEnumOperateState.QUICK_EDITING && ((_b2 = stage22 == null ? void 0 : stage22.render) == null ? void 0 : _b2.editorShadowControl)) { (_c2 = DDeiUtil.getEditorText()) == null ? void 0 : _c2.enterValue(); } this.editor.changeState(DDeiEditorState.CONTROL_CREATING); this.editor.creatingControls = models; (_d2 = this.editor.bus) == null ? void 0 : _d2.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); (_e2 = this.editor.bus) == null ? void 0 : _e2.executeAll(); } e.preventDefault(); e.cancelBubble = true; } }, /** * 搜索控件 */ searchControl() { let text2 = trim(this.searchText); if (text2 == "") { this.groups = this.searchOriginGroups; } else { let searchControls = []; let gp = {}; gp.name = this.editor.i18n("ddei.searchResult"); this.searchOriginGroups.forEach((group2) => { if (group2.controls) { group2.controls.forEach((control) => { if (control.code.indexOf(text2) != -1 || this.editor.i18n(control.name).indexOf(text2) != -1) { searchControls.push(control); } }); } }); gp.controls = cloneDeep(searchControls); gp.display = true; gp.expand = true; gp.cannotClose = true; this.groups = [gp]; } } } }; const Toolbox_vue_vue_type_style_index_0_scoped_ea668126_lang = ""; const _hoisted_1$1c = { class: "ddei-core-panel-toolbox-header" }; const _hoisted_2$U = { key: 0, class: "icon icon1", "aria-hidden": "true" }; const _hoisted_3$Q = { key: 1, class: "header-3" }; const _hoisted_4$F = { class: "header-4" }; const _hoisted_5$x = { key: 0, class: "ddei-core-panel-toolbox-searchbox" }; const _hoisted_6$r = { class: "ddei-core-panel-toolbox-searchbox-group" }; const _hoisted_7$o = ["title"]; const _hoisted_8$k = ["placeholder"]; const _hoisted_9$i = { class: "ddei-core-panel-toolbox-groups-group" }; const _hoisted_10$c = ["onClick"]; const _hoisted_11$c = { class: "title" }; const _hoisted_12$9 = ["onClick", "title"]; const _hoisted_13$8 = { key: 0, class: "ddei-core-panel-toolbox-groups-group-itempanel" }; const _hoisted_14$7 = ["title", "onMousedown"]; const _hoisted_15$6 = ["src"]; const _hoisted_16$4 = ["innerHTML"]; const _hoisted_17$3 = { class: "text" }; function _sfc_render$1e(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, onMousedown: _cache[6] || (_cache[6] = (...args) => $options.changeEditorFocus && $options.changeEditorFocus(...args)), onMouseup: _cache[7] || (_cache[7] = ($event) => $options.cancelCreateControl($event)), ref: "toolbox", class: "ddei-core-panel-toolbox" }, [ vue.createElementVNode("div", _hoisted_1$1c, [ _cache[12] || (_cache[12] = vue.createElementVNode("div", { class: "header-1" }, null, -1)), $props.custom ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2$U, _cache[8] || (_cache[8] = [ vue.createElementVNode("use", { "xlink:href": "#icon-control-icon" }, null, -1) ]))) : vue.createCommentVNode("", true), $props.custom ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$Q)) : vue.createCommentVNode("", true), $props.custom ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, class: "ddei-core-panel-toolbox-header-morecontrol", onClick: _cache[0] || (_cache[0] = ($event) => $options.showChooseDialog($event)) }, [ vue.createElementVNode("div", _hoisted_4$F, vue.toDisplayString($props.editor.i18n("ddei.more")), 1), _cache[9] || (_cache[9] = vue.createElementVNode("div", { class: "header-3" }, null, -1)), _cache[10] || (_cache[10] = vue.createElementVNode("svg", { class: "icon icon2", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1)) ])) : vue.createCommentVNode("", true), _cache[13] || (_cache[13] = vue.createElementVNode("div", { style: { "flex": "1" } }, null, -1)), $props.expand ? (vue.openBlock(), vue.createElementBlock("svg", { key: 3, class: "icon header-7", "aria-hidden": "true", onClick: _cache[1] || (_cache[1] = (...args) => $options.hiddenToolBox && $options.hiddenToolBox(...args)) }, _cache[11] || (_cache[11] = [ vue.createElementVNode("use", { "xlink:href": "#icon-expand3" }, null, -1) ]))) : vue.createCommentVNode("", true) ]), $props.search ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$x, [ vue.createElementVNode("div", _hoisted_6$r, [ (vue.openBlock(), vue.createElementBlock("svg", { class: "icon", "aria-hidden": "true", onClick: _cache[2] || (_cache[2] = (...args) => $options.searchControl && $options.searchControl(...args)), title: $props.editor.i18n("ddei.search") }, _cache[14] || (_cache[14] = [ vue.createElementVNode("use", { "xlink:href": "#icon-search" }, null, -1) ]), 8, _hoisted_7$o)), vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.searchText = $event), class: "input", onKeypress: _cache[4] || (_cache[4] = (...args) => $options.searchInputEnter && $options.searchInputEnter(...args)), placeholder: $props.editor.i18n("ddei.search"), autocomplete: "off", name: "ddei_toolbox_search_input" }, null, 40, _hoisted_8$k), [ [vue.vModelText, $data.searchText] ]) ]) ])) : vue.createCommentVNode("", true), vue.createElementVNode("div", { class: "ddei-core-panel-toolbox-groups", onMousewheel: _cache[5] || (_cache[5] = ($event) => $options.mouseWheel($event)), style: vue.normalizeStyle({ height: "calc(100vh - " + (((_a3 = $props.editor) == null ? void 0 : _a3.topHeight) + ((_b2 = $props.editor) == null ? void 0 : _b2.bottomHeight) + 90) + "px" }) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.groups, (group2) => { return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_9$i, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-core-panel-toolbox-groups-group-box": true, "ddei-core-panel-toolbox-groups-group--expanded": group2.expand }), onClick: ($event) => $options.groupBoxExpand(group2) }, [ vue.createElementVNode("span", _hoisted_11$c, vue.toDisplayString($props.editor.i18n(group2.name)), 1), $props.custom && !group2.cannotClose ? (vue.openBlock(), vue.createElementBlock("svg", { key: 0, class: "icon close", "aria-hidden": "true", onClick: ($event) => $options.groupBoxClose(group2), title: $props.editor.i18n("ddei.close") }, _cache[15] || (_cache[15] = [ vue.createElementVNode("use", { "xlink:href": "#icon-close" }, null, -1) ]), 8, _hoisted_12$9)) : vue.createCommentVNode("", true) ], 10, _hoisted_10$c), group2.expand == true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$8, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(group2.controls, (control) => { var _a4; return vue.openBlock(), vue.createElementBlock("div", { class: "ddei-core-panel-toolbox-groups-group-itempanel-item", title: control.desc, onMousedown: ($event) => $options.createControlPrepare(control, $event) }, [ !control.icon ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, class: "icon", src: (_a4 = $props.editor) == null ? void 0 : _a4.icons[control.id] }, null, 8, _hoisted_15$6)) : vue.createCommentVNode("", true), control.icon ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, innerHTML: control.icon }, null, 8, _hoisted_16$4)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_17$3, vue.toDisplayString($props.editor.i18n(control.name)), 1) ], 40, _hoisted_14$7); }), 256)) ])) : vue.createCommentVNode("", true) ], 512)), [ [vue.vShow, group2.display == true] ]); }), 256)) ], 36) ], 544)) : vue.createCommentVNode("", true); } const Toolbox = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["render", _sfc_render$1e], ["__scopeId", "data-v-ea668126"]]); const _DDeiCoreToolboxPanel = class _DDeiCoreToolboxPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Toolbox.name); __publicField3(this, "plugins", [Toolbox]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[Toolbox.name]) { for (let i2 in options[Toolbox.name]) { newOptions[i2] = options[Toolbox.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreToolboxPanel(newOptions); return panels; } } return _DDeiCoreToolboxPanel; } static modify(fn) { return _DDeiCoreToolboxPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreToolboxPanel, "defaultIns", new _DDeiCoreToolboxPanel()); let DDeiCoreToolboxPanel = _DDeiCoreToolboxPanel; const _DDeiCoreToolboxPanels = class _DDeiCoreToolboxPanels extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [DDeiCoreToolboxPanel]); } getPanels(editor) { var _a3; let panels = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getPanels(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getPanels(editor); } if ((ls == null ? void 0 : ls.length) > 0) { panels = panels.concat(ls); } }); return panels; } static configuration(options) { var _a3; if (options) { let panels = new _DDeiCoreToolboxPanels(options); for (let i2 = 0; i2 < ((_a3 = panels.plugins) == null ? void 0 : _a3.length); i2++) { panels.plugins[i2] = panels.plugins[i2].configuration(options, true); } return panels; } return _DDeiCoreToolboxPanels; } static modify(fn) { return _DDeiCoreToolboxPanels.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreToolboxPanels, "defaultIns", new _DDeiCoreToolboxPanels(null)); let DDeiCoreToolboxPanels = _DDeiCoreToolboxPanels; const _sfc_main$1d = { name: "ddei-core-panel-quickcolorview", extends: null, mixins: [], props: { options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { colors: [], //当前编辑的模式,1填充,2边框,3字体 mode: 1, dataSource: [ { value: 1, text: "填充", img: "#icon-fill" }, { value: 2, text: "边框", img: "#icon-border-pencil" }, { value: 3, text: "字体", img: "#icon-font" } ] }; }, computed: {}, watch: {}, created() { }, mounted() { this.colors = [ "#FFB6C1", "#FFC0CB", "#DC143C", "#FF0F55", "#DB7093", "#FF69B4", "#FF1493", "#C71585", "#DA70D6", "#D8BFD8", "#DDA0DD", "#EE82EE", "#FF00FF", "#FF00FF", "#8B008B", "#800080", "#BA55D3", "#9400D3", "#9932CC", "#4B0082", "#8A2BE2", "#9370DB", "#7B68EE", "#6A5ACD", "#483D8B", "#E6E6FA", "#F8F8FF", "#0000FF", "#0000FF", "#0000CD", "#191970", "#00008B", "#000080", "#4169E1", "#6495ED", "#B0C4DE", "#778899", "#708090", "#1E90FF", "#F0F8FF", "#4682B4", "#87CEFA", "#87CEEB", "#00BFFF", "#ADD8E6", "#B0E0E6", "#5F9EA0", "#F0FFFF", "#E1FFFF", "#AFEEEE", "#00FFFF", "#00FFFF", "#00CED1", "#2F4F4F", "#008B8B", "#008080", "#48D1CC", "#20B2AA", "#40E0D0", "#7FFFAA", "#00FA9A", "#00FF7F", "#F5FFFA", "#3CB371", "#2E8B57", "#F0FFF0", "#90EE90", "#98FB98", "#8FBC8F", "#32CD32", "#00FF00", "#228B22", "#008000", "#006400", "#7FFF00", "#7CFC00", "#ADFF2F", "#556B2F", "#F5F5DC", "#FAFAD2", "#FFFFF0", "#FFFFE0", "#FFFF00", "#808000", "#BDB76B", "#FFFACD", "#EEE8AA", "#F0E68C", "#FFD700", "#FFF8DC" ]; }, methods: { changeMode(m) { this.mode = m.value; }, //打开弹出框 showDialog(evt) { let dataSource = []; this.dataSource.forEach((ds) => { if (ds.value != this.mode) { dataSource.push(ds); } }); let el = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog( this.editor, "ddei-core-dialog-qcview", { dataSource, callback: { ok: this.changeMode } }, { type: 2 }, el ); }, /** * 改变模型颜色 */ changeModelColor(color, evt) { let stage2 = this.editor.ddInstance.stage; if (stage2 && color) { let selectedModels = stage2.selectedModels; if ((selectedModels == null ? void 0 : selectedModels.size) > 0) { let mds = Array.from(selectedModels.values()); let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds }, this.editor.ddInstance); if (rsState != -1) { switch (this.mode) { case 1: selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: ["fill.color"], value: color }, evt, true ); }); break; case 2: selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: [ "border.color", "border.top.color", "border.bottom.color", "border.left.color", "border.right.color" ], value: color }, evt, true ); }); break; case 3: selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: ["font.color"], value: color }, evt, true ); }); break; } this.editor.bus.push( DDeiEnumBusCommandType.StageChangeSelectModels, null, evt ); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); this.editor.bus.executeAll(); } } } } } }; const QuickColorView_vue_vue_type_style_index_0_scoped_f305cac8_lang = ""; const _hoisted_1$1b = { class: "ddei-editor-qcview" }; const _hoisted_2$T = ["title"]; const _hoisted_3$P = { class: "icon", "aria-hidden": "true" }; const _hoisted_4$E = ["xlink:href"]; const _hoisted_5$w = ["onClick"]; function _sfc_render$1d(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1b, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { class: "ddei-editor-qcview-type", onClick: _cache[0] || (_cache[0] = ($event) => $options.showDialog($event)), title: item.text }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_3$P, [ vue.createElementVNode("use", { "xlink:href": item.img }, null, 8, _hoisted_4$E) ])), _cache[1] || (_cache[1] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1)) ], 8, _hoisted_2$T)), [ [vue.vShow, item.value == $data.mode] ]); }), 256)), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.colors, (color) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-editor-qcview-color": true }), style: vue.normalizeStyle({ "background-color": "" + color }), onClick: ($event) => { var _a3, _b2, _c2, _d2; return ((_d2 = (_c2 = (_b2 = (_a3 = $props.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0 && $options.changeModelColor(color, $event); } }, null, 12, _hoisted_5$w); }), 256)) ]); } const QuickColorView = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["render", _sfc_render$1d], ["__scopeId", "data-v-f305cac8"]]); const _DDeiCoreQuickColorViewPanel = class _DDeiCoreQuickColorViewPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QuickColorView.name); __publicField3(this, "plugins", [QuickColorView]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QuickColorView.name]) { for (let i2 in options[QuickColorView.name]) { newOptions[i2] = options[QuickColorView.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreQuickColorViewPanel(newOptions); return panels; } } return _DDeiCoreQuickColorViewPanel; } static modify(fn) { return _DDeiCoreQuickColorViewPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreQuickColorViewPanel, "defaultIns", new _DDeiCoreQuickColorViewPanel(null)); let DDeiCoreQuickColorViewPanel = _DDeiCoreQuickColorViewPanel; const _sfc_main$1c = { name: "ddei-core-panel-propertyview", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, //是否允许展开收折 expand: { type: Boolean, default: true } }, data() { return { //当前被选中控件的引用 selectedModels: null, //属性定义的引用 controlDefine: null, //当前的顶级group topGroups: null, currentTopGroup: null, currentSubGroup: null, reFresh: true, propertyDisabled: false, propertyViewShow: true, pvGroupWidth: 0, rightRate: 0, //右边部分所占的比例 forceRefresh: true }; }, computed: {}, watch: { currentSubGroup() { this.forceRefreshSub(); } }, components: {}, created() { this.$watch("editor.ddInstance.stage.selectedModels", this.refreshAttrs); this.$watch("editor.maxWidth", function(newVal, oldVal) { if (this.rightRate == 0) { this.rightRate = this.editor.rightWidth / document.body.clientWidth; } }); }, mounted() { }, methods: { //强制刷新当前以及下层组件 forceRefreshParts(parts) { if (!parts || parts == "property" || parts.indexOf("property") != -1) { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); } }, refreshData() { this.editor.properyViewer = this; this.refreshAttrs(); }, mouseWheel(evt) { if (evt.currentTarget.clientHeight < evt.currentTarget.scrollHeight) { evt.cancelBubble = true; return false; } }, forceRefreshSub() { this.reFresh = false; this.propertyDisabled = false; this.$nextTick(() => { this.propertyDisabled = this.editor.state == DDeiEditorState.QUICK_EDITING; this.reFresh = true; }); }, refreshAttrs(newVal, oldVal) { var _a3, _b2, _c2, _d2, _e2, _f; let firstControlDefine; let firstModel; if (!this.editor.currentControlDefine) { let models = [this.editor.ddInstance.stage]; firstModel = models[0]; this.selectedModels = models; firstControlDefine = cloneDeep( this.editor.controls.get(firstModel == null ? void 0 : firstModel.modelCode) ); } else { this.selectedModels = this.editor.ddInstance.stage.selectedModels; if (((_a3 = this.selectedModels) == null ? void 0 : _a3.size) > 0) { firstModel = Array.from(this.selectedModels.values()); firstControlDefine = this.editor.currentControlDefine; } } if (firstControlDefine) { let topGroups = null; if (firstControlDefine.type == "DDeiStage") { firstControlDefine.attrDefineMap.forEach((attrDefine, attrKey) => { attrDefine.value = DDeiUtil.getDataByPathList( firstModel, attrDefine.code, attrDefine.mapping ); attrDefine.model = firstModel; }); let layerControlDefine = cloneDeep( this.editor.controls.get("DDeiLayer") ); let layer2 = firstModel.layers[firstModel.layerIndex]; layerControlDefine.attrDefineMap.forEach((attrDefine, attrKey) => { attrDefine.value = DDeiUtil.getDataByPathList( layer2, attrDefine.code, attrDefine.mapping ); attrDefine.model = layer2; }); firstControlDefine.groups.forEach((topGroup) => { topGroup.img = topGroup.icon; }); layerControlDefine.groups.forEach((topGroup) => { topGroup.img = topGroup.icon; }); topGroups = layerControlDefine.groups.concat(firstControlDefine.groups); } else { firstControlDefine.groups.forEach((topGroup) => { topGroup.img = topGroup.icon; }); topGroups = firstControlDefine.groups; } if ((topGroups == null ? void 0 : topGroups.length) > 0) { let upName = (_b2 = this.currentTopGroup) == null ? void 0 : _b2.name; let currentTopGroup = null; if (upName) { for (let x2 = 0; x2 < firstControlDefine.groups.length; x2++) { let topGroup = topGroups[x2]; if (!topGroup.empty && upName == topGroup.name) { topGroup.selected = true; currentTopGroup = topGroup; break; } } } if (!currentTopGroup) { topGroups[0].selected = true; currentTopGroup = topGroups[0]; } this.currentTopGroup = currentTopGroup; this.controlDefine = firstControlDefine; this.topGroups = topGroups; let upSubGroupName = (_c2 = this.currentSubGroup) == null ? void 0 : _c2.name; let currentSubGroup = null; if (upSubGroupName) { for (let sgi = 0; sgi < (currentTopGroup == null ? void 0 : currentTopGroup.subGroups.length); sgi++) { if (!((_d2 = currentTopGroup == null ? void 0 : currentTopGroup.subGroups[sgi]) == null ? void 0 : _d2.empty) && upSubGroupName == ((_e2 = currentTopGroup == null ? void 0 : currentTopGroup.subGroups[sgi]) == null ? void 0 : _e2.name)) { currentSubGroup = currentTopGroup == null ? void 0 : currentTopGroup.subGroups[sgi]; break; } } } if (!currentSubGroup) { for (let sgi = 0; sgi < (currentTopGroup == null ? void 0 : currentTopGroup.subGroups.length); sgi++) { if (!((_f = currentTopGroup == null ? void 0 : currentTopGroup.subGroups[sgi]) == null ? void 0 : _f.empty)) { currentSubGroup = currentTopGroup == null ? void 0 : currentTopGroup.subGroups[sgi]; break; } } } this.changeSubGroup(currentSubGroup); } else { this.controlDefine = null; this.topGroups = null; if (this.currentTopGroup) { this.currentTopGroup.subGroups = null; } if (this.currentSubGroup) { this.currentSubGroup.children = null; } this.editor.currentControlDefine = null; } } }, getFirstChildAttrsGroup(control) { var _a3, _b2; if (((_a3 = control.models) == null ? void 0 : _a3.size) > 0) { let firstControl = control.models.get(control.midList[0]); let curDefine = this.editor.controls.get(firstControl.modelCode); if (((_b2 = curDefine.groups) == null ? void 0 : _b2.length) > 0) { let returnGroups = curDefine.groups; returnGroups.forEach((group2) => { group2 == null ? void 0 : group2.subGroups.forEach((subGroup) => { var _a4; (_a4 = subGroup.children) == null ? void 0 : _a4.forEach((attrDefine) => { attrDefine.value = DDeiUtil.getDataByPathList( firstControl, attrDefine.code, attrDefine.mapping ); attrDefine.model = firstControl; }); }); }); return returnGroups; } else if (firstControl.baseModelType == "DDeiContainer" && firstControl.layout == "compose") { return this.getFirstChildAttrsGroup(firstControl); } } return null; }, /** * 展开顶级属性,收起其他顶级层级 */ changeTopGroup(pData) { var _a3, _b2, _c2, _d2; if (this.currentTopGroup != pData) { this.topGroups.forEach((group2) => { if (group2 != pData) { group2.selected = false; } }); pData.selected = true; this.currentTopGroup = pData; let upSubGroupName = (_a3 = this.currentSubGroup) == null ? void 0 : _a3.name; let currentSubGroup = null; if (upSubGroupName) { for (let sgi = 0; sgi < (pData == null ? void 0 : pData.subGroups.length); sgi++) { if (!((_b2 = pData == null ? void 0 : pData.subGroups[sgi]) == null ? void 0 : _b2.empty) && upSubGroupName == ((_c2 = pData == null ? void 0 : pData.subGroups[sgi]) == null ? void 0 : _c2.name)) { currentSubGroup = pData == null ? void 0 : pData.subGroups[sgi]; break; } } } if (!currentSubGroup) { for (let sgi = 0; sgi < (pData == null ? void 0 : pData.subGroups.length); sgi++) { if (!((_d2 = pData == null ? void 0 : pData.subGroups[sgi]) == null ? void 0 : _d2.empty)) { currentSubGroup = pData == null ? void 0 : pData.subGroups[sgi]; break; } } } this.changeSubGroup(currentSubGroup); } }, /** * 展开次级属性,收起其他次级层级 */ changeSubGroup(pData) { var _a3, _b2; if (this.currentSubGroup != pData) { this.currentTopGroup.subGroups.forEach((group2) => { if (group2 != pData) { group2.selected = false; } }); pData.selected = true; this.selectedModels = this.editor.ddInstance.stage.selectedModels; let models = null; if (((_a3 = this.selectedModels) == null ? void 0 : _a3.size) > 0) { models = Array.from(this.selectedModels.values()); } else { models = [this.editor.ddInstance.stage]; } (_b2 = pData == null ? void 0 : pData.children) == null ? void 0 : _b2.forEach((attd) => { let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_VIEW_BEFORE", DDeiEnumOperateType.VIEW, { models, propName: attd == null ? void 0 : attd.code }, this.editor.ddInstance, null); if (rsState == 0 || rsState == 1) { attd.forceHidden = false; } else { attd.forceHidden = true; } }); this.currentSubGroup = pData; } setTimeout(() => { this.$forceUpdate(); }, 100); }, syncAttrsToGroup(firstControlDefine, pData) { var _a3, _b2; let newChildren = []; if (((_a3 = pData == null ? void 0 : pData.groups) == null ? void 0 : _a3.length) > 0) { (_b2 = pData == null ? void 0 : pData.groups) == null ? void 0 : _b2.forEach((group2) => { var _a4; let newGroupChildren = []; (_a4 = group2.children) == null ? void 0 : _a4.forEach((curAttr) => { var _a5; let mapObj = (_a5 = firstControlDefine == null ? void 0 : firstControlDefine.attrDefineMap) == null ? void 0 : _a5.get(curAttr.code); if (mapObj && mapObj.visiable != false) { mapObj.topGroup = pData; mapObj.modelCode = firstControlDefine.type; newGroupChildren.push(mapObj); newChildren.push(mapObj); } }); group2.children = newGroupChildren; if (newGroupChildren.length == 0) { group2.empty = true; } }); } pData.children = newChildren; if (newChildren.length == 0) { pData.empty = true; } }, /** * 隐藏or展示属性编辑器 */ hidOrShowPV() { this.propertyViewShow = !this.propertyViewShow; let pvFullWidth = document.body.clientWidth * this.rightRate; let pvGroupViewEle = this.$refs.propertyviewGroupview; this.pvGroupWidth = pvGroupViewEle.clientWidth; if (this.editor.rightWidth > this.pvGroupWidth) { let deltaX = pvFullWidth - this.pvGroupWidth; this.editor.rightWidth = this.pvGroupWidth; this.editor.middleWidth += deltaX; } else { let deltaX = pvFullWidth - this.pvGroupWidth; this.editor.rightWidth = pvFullWidth; this.editor.middleWidth -= deltaX; } this.editor.changeState(DDeiEditorState.DESIGNING); }, /** * 焦点进入当前区域 */ changeEditorFocus() { if (this.editor.state != DDeiEditorState.PROPERTY_EDITING && this.editor.state != DDeiEditorState.QUICK_EDITING) { this.editor.changeState(DDeiEditorState.PROPERTY_EDITING); } this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); } } }; const PropertyView_vue_vue_type_style_index_0_scoped_156d5ed6_lang = ""; const _hoisted_1$1a = { class: "propertyview-header" }; const _hoisted_2$S = { key: 0, "xlink:href": "#icon-expand4" }; const _hoisted_3$O = { key: 1, "xlink:href": "#icon-expand3" }; const _hoisted_4$D = { key: 1, class: "icon ding", "aria-hidden": "true" }; const _hoisted_5$v = { class: "content" }; const _hoisted_6$q = { class: "propertyview-subgroup" }; const _hoisted_7$n = { class: "propertyview-subgroup-tabtitle" }; const _hoisted_8$j = ["title", "onMouseup"]; const _hoisted_9$h = ["title"]; const _hoisted_10$b = { key: 0, class: "title" }; const _hoisted_11$b = { key: 0 }; const _hoisted_12$8 = { key: 1, class: "editor" }; const _hoisted_13$7 = { class: "propertyview-groupview", ref: "propertyviewGroupview" }; const _hoisted_14$6 = { class: "propertyview-groupview-items" }; const _hoisted_15$5 = ["onClick", "title"]; const _hoisted_16$3 = { class: "icon img", "aria-hidden": "true" }; const _hoisted_17$2 = ["xlink:href"]; function _sfc_render$1c(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, ref: "propertyView", class: vue.normalizeClass({ "propertyview": true, "propertyview--disabled": $data.propertyDisabled }), onMousedown: _cache[2] || (_cache[2] = (...args) => $options.changeEditorFocus && $options.changeEditorFocus(...args)) }, [ vue.createElementVNode("div", _hoisted_1$1a, [ $props.expand ? (vue.openBlock(), vue.createElementBlock("svg", { key: 0, "aria-hidden": "true", class: vue.normalizeClass({ "icon": true, "header-7": $data.propertyViewShow, "header-7-expand": !$data.propertyViewShow }), onClick: _cache[0] || (_cache[0] = (...args) => $options.hidOrShowPV && $options.hidOrShowPV(...args)) }, [ $data.propertyViewShow ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_2$S)) : vue.createCommentVNode("", true), !$data.propertyViewShow ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_3$O)) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true), _cache[4] || (_cache[4] = vue.createElementVNode("div", { style: { "flex": "1" } }, null, -1)), $data.propertyViewShow ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4$D, _cache[3] || (_cache[3] = [ vue.createElementVNode("use", { "xlink:href": "#icon-ding" }, null, -1) ]))) : vue.createCommentVNode("", true) ]), vue.createElementVNode("div", _hoisted_5$v, [ vue.withDirectives(vue.createElementVNode("div", _hoisted_6$q, [ vue.createElementVNode("div", _hoisted_7$n, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_a3 = $data.currentTopGroup) == null ? void 0 : _a3.subGroups, (subGroup) => { var _a4; return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass(((_a4 = $data.currentTopGroup) == null ? void 0 : _a4.subGroups.length) > 1 && subGroup.selected ? "propertyview-subgroup-tabtitle-item--selected" : "propertyview-subgroup-tabtitle-item"), title: subGroup.name, onMouseup: ($event) => $options.changeSubGroup(subGroup) }, vue.toDisplayString($props.editor.i18n(subGroup.name)), 43, _hoisted_8$j)), [ [vue.vShow, !subGroup.empty] ]); }), 256)) ]), vue.createElementVNode("div", { class: "propertyview-subgroup-tabpanel", onMousewheel: _cache[1] || (_cache[1] = ($event) => $options.mouseWheel($event)) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_b2 = $data.currentSubGroup) == null ? void 0 : _b2.children, (attrDefine) => { var _a4; return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "propertyview-subgroup-tabpanel-editors-column": attrDefine.display == "column", "propertyview-subgroup-tabpanel-editors-row": attrDefine.display != "column", "empty-value": attrDefine.value ? false : true }), title: attrDefine.desc }, [ !attrDefine.hiddenTitle && (attrDefine == null ? void 0 : attrDefine.visiable) != false ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$b, [ vue.createTextVNode(vue.toDisplayString($props.editor.i18n(attrDefine.name)), 1), attrDefine.notNull ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_11$b, "*")) : vue.createCommentVNode("", true), _cache[5] || (_cache[5] = vue.createTextVNode(": ")) ])) : vue.createCommentVNode("", true), attrDefine.visiable != false ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$8, [ $data.reFresh && (attrDefine == null ? void 0 : attrDefine.visiable) != false ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_a4 = $props.editor) == null ? void 0 : _a4.getPropEditor(attrDefine.controlType)), { key: 0, editor: $props.editor, controlDefine: $data.controlDefine, attrDefine }, null, 8, ["editor", "controlDefine", "attrDefine"])) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true) ], 10, _hoisted_9$h)), [ [vue.vShow, (attrDefine == null ? void 0 : attrDefine.visiable) && !(attrDefine == null ? void 0 : attrDefine.forceHidden)] ]); }), 256)) ], 32) ], 512), [ [vue.vShow, ((_c2 = $props.editor) == null ? void 0 : _c2.rightWidth) > $data.pvGroupWidth] ]), vue.createElementVNode("div", _hoisted_13$7, [ vue.createElementVNode("div", _hoisted_14$6, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.topGroups, (topGroup) => { return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass(topGroup.selected ? "propertyview-groupview-items-item--selected" : "propertyview-groupview-items-item"), onClick: ($event) => $options.changeTopGroup(topGroup), title: topGroup.name }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_16$3, [ vue.createElementVNode("use", { "xlink:href": "#" + topGroup.img }, null, 8, _hoisted_17$2) ])) ], 10, _hoisted_15$5)), [ [vue.vShow, !(topGroup == null ? void 0 : topGroup.empty)] ]); }), 256)) ]) ], 512) ]) ], 34)) : vue.createCommentVNode("", true); } const PropertyView = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["render", _sfc_render$1c], ["__scopeId", "data-v-156d5ed6"]]); const _DDeiCorePropertyViewPanel = class _DDeiCorePropertyViewPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", PropertyView.name); __publicField3(this, "plugins", [PropertyView]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[PropertyView.name]) { for (let i2 in options[PropertyView.name]) { newOptions[i2] = options[PropertyView.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCorePropertyViewPanel(newOptions); return panels; } } return _DDeiCorePropertyViewPanel; } static modify(fn) { return _DDeiCorePropertyViewPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCorePropertyViewPanel, "defaultIns", new _DDeiCorePropertyViewPanel()); let DDeiCorePropertyViewPanel = _DDeiCorePropertyViewPanel; const _sfc_main$1b = { name: "ddei-core-panel-openfilesview", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, //是否允许展开收折 expand: { type: Boolean, default: false }, create: { type: Boolean, default: true }, close: { type: Boolean, default: true }, rename: { type: Boolean, default: true }, drag: { type: Boolean, default: true }, max: { type: Number, default: 0 }, beforeCloseFile: { type: Function, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { //当前打开的页的开始下标 openIndex: 0, //最大可以打开的数量 maxOpenSize: 1, // tempFile: null, unitFileWidth: 160, // user: null, forceRefresh: true }; }, computed: {}, watch: {}, created() { this.$watch("editor.files.length", function(newVal, oldVal) { setTimeout(() => { let activeIndex = -1; for (let i2 = 0; i2 < this.editor.files.length; i2++) { if (this.editor.files[i2].active == DDeiActiveType.ACTIVE) { activeIndex = i2; this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["toolbox", "property"] }); this.editor.bus.executeAll(); break; } } this.openIndex = activeIndex + 1 - this.maxOpenSize; if (this.openIndex < 0) { this.openIndex = 0; } }, 10); }); }, mounted() { const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { let { width, height } = entry.contentRect; if (width == 0 || height == 0) { width = this.$refs.openFilesView.clientWidth; height = this.$refs.openFilesView.clientHeight; } if (width != 0 && height != 0) { let fileEles = this.$refs.openFilesView.getElementsByClassName("ddei-core-panel-openfilesview-item"); let fileWidth = 0; if (fileEles.length > 0) { fileWidth = fileEles[0].clientWidth; } if (!fileWidth) { fileWidth = 160; } this.unitFileWidth = fileWidth; let size = parseInt((width - 120) / fileWidth); if (size > this.maxOpenSize && this.openIndex > 0) { this.openIndex--; } this.maxOpenSize = size; this.width = width; } } }); resizeObserver.observe(this.$refs.openFilesView); this.refreshData(); }, methods: { //强制刷新当前以及下层组件 forceRefreshParts(parts) { if (!parts || parts == "openfiles" || parts.indexOf("openfiles") != -1) { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); } }, refreshData() { this.editor.openFilesViewer = this; }, /** * 新建文件 * @param evt */ newFile(evt) { var _a3, _b2; if ((_a3 = this.editor) == null ? void 0 : _a3.ddInstance) { let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_FILE_BEFORE", "ADD_FILE", null, this.editor.ddInstance, null); if (rsState != -1) { let ddInstance = this.editor.ddInstance; let fileText = this.editor.i18n("ddei.file"); let newText = this.editor.i18n("ddei.new"); let pageText = this.editor.i18n("ddei.page"); let file = DDeiFile.loadFromJSON( { name: newText + fileText + "_NEW", path: "/" + newText + fileText + "_NEW", sheets: [ new DDeiSheet({ name: pageText + "-1", desc: pageText + "-1", stage: DDeiStage.initByJSON({ id: "stage_1" }, { currentDdInstance: ddInstance }), active: DDeiActiveType.ACTIVE }) ], currentSheetIndex: 0, state: DDeiFileState.NEW, active: DDeiActiveType.ACTIVE }, { currentDdInstance: ddInstance } ); file.local = 1; if (this.editor.currentFileIndex != -1) { this.editor.files[this.editor.currentFileIndex].active = DDeiActiveType.NONE; } this.editor.addFile(file); this.editor.currentFileIndex = this.editor.files.length - 1; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { ddInstance.stage.destroyRender(); let stage2 = sheets[0].stage; stage2.ddInstance = ddInstance; ddInstance.stage = stage2; file.initHistroy(); if (!stage2.wpv) { stage2.wpv = { x: -(stage2.width - ddInstance.render.canvas.width / ddInstance.render.ratio) / 2, y: -(stage2.height - ddInstance.render.canvas.height / ddInstance.render.ratio) / 2, z: 0 }; } stage2.initRender(); ddInstance.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu", "topmenu"] }); this.editor.changeState(DDeiEditorState.DESIGNING); (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.executeAll(); } DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_FILE_AFTER", "ADD_FILE", null, this.editor.ddInstance, null); if (this.editor.files.length == 0) { ddInstance.disabled = true; } else { ddInstance.disabled = false; } } } }, /** * 修改文件标题 */ startChangeFileName(file, evt) { let ele = evt.target; let domPos = DDeiUtil.getDomAbsPosition(ele); let editor = DDeiEditor.ACTIVE_INSTANCE; let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let input = document.getElementById(editor.id + "_change_file_name_input"); if (!input) { input = document.createElement("input"); input.setAttribute("id", editor.id + "_change_file_name_input"); input.style.position = "absolute"; input.style.fontSize = "16px"; editorEle.appendChild(input); input.onblur = function() { var _a3; if (input.value) { let editor2 = DDeiEditor.ACTIVE_INSTANCE; let file2 = editor2 == null ? void 0 : editor2.files[editor2 == null ? void 0 : editor2.currentFileIndex]; if (input.value != file2.name) { file2.name = input.value; if (file2.path) { if (file2.path.indexOf("/") != -1) { file2.path = file2.path.substring(0, file2.path.lastIndexOf("/")) + "/" + file2.name; } else { file2.path = file2.name; } } (_a3 = editor2.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); editor2.bus.push(DDeiEditorEnumBusCommandType.AddFileHistroy); editor2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["openfiles"] }); editor2.bus.executeAll(); editor2.changeState(DDeiEditorState.DESIGNING); } input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; } }; input.onkeydown = function(e) { var _a3; if (e.keyCode == 13) { let editor2 = DDeiEditor.ACTIVE_INSTANCE; let file2 = editor2 == null ? void 0 : editor2.files[editor2 == null ? void 0 : editor2.currentFileIndex]; if (input.value != file2.name) { file2.name = input.value; if (file2.path) { if (file2.path.indexOf("/") != -1) { file2.path = file2.path.substring(0, file2.path.lastIndexOf("/")) + "/" + file2.name; } else { file2.path = file2.name; } } (_a3 = editor2.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); editor2.bus.push(DDeiEditorEnumBusCommandType.AddFileHistroy); editor2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["openfiles"] }); editor2.bus.executeAll(); editor2.changeState(DDeiEditorState.DESIGNING); } input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; } else if (e.keyCode == 27) { let editor2 = DDeiEditor.ACTIVE_INSTANCE; input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; editor2.changeState(DDeiEditorState.DESIGNING); } }; } input.style.width = ele.offsetWidth + "px"; input.style.height = ele.offsetHeight - 3 + "px"; input.style.left = domPos.left - editorDomPos.left + "px"; input.style.top = domPos.top + 2 - editorDomPos.top + "px"; input.style.border = "none"; input.style.outline = "none"; input.style.borderBottom = "1px solid #1F72FF"; input.style.borderRadius = "1px"; input.value = file.name; input.style.display = "block"; input.selectionStart = 0; input.selectionEnd = input.value.length; input.style.background = "var(--background)"; input.style.color = "var(--text)"; input.focus(); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); if (this.editor.state != DDeiEditorState.PROPERTY_EDITING && this.editor.state != DDeiEditorState.QUICK_EDITING) { this.editor.changeState(DDeiEditorState.PROPERTY_EDITING); } }, /** * file开始拖拽移动 */ fileDragStart(fileEle, evt) { this.dragFileEle = evt.currentTarget; }, /** * 拖拽元素移动 */ fileDragOver(e) { if (this.dragFileEle) { if (e.currentTarget.className.indexOf("ddei-core-panel-openfilesview-item") != -1) { let parentDiv = this.dragFileEle.parentElement; let sourceIndex = -1; let targetIndex = -1; let children = parentDiv.children; for (let i2 = 1; i2 < children.length - 4; i2++) { children[i2].style.borderLeft = ""; children[i2].style.borderRight = ""; if (children[i2] == this.dragFileEle) { sourceIndex = i2; } else if (e.currentTarget == children[i2]) { targetIndex = i2; } } if (sourceIndex != -1 && targetIndex != -1) { this.sourceFileIndex = sourceIndex - 1; if (targetIndex == children.length - 5) { let pos = DDeiUtil.getDomAbsPosition(children[targetIndex]); let halfPos = pos.left + children[targetIndex].offsetWidth / 2; if (halfPos <= e.clientX && e.clientX <= pos.left + children[targetIndex].offsetWidth) { this.changeFileIndex = targetIndex; children[targetIndex].style.borderRight = "2px solid #1F72FF"; } else { this.changeFileIndex = targetIndex - 1; children[targetIndex].style.borderLeft = "2px solid #1F72FF"; } } else { this.changeFileIndex = targetIndex - 1; children[targetIndex].style.borderLeft = "2px solid #1F72FF"; } } e.preventDefault(); } } }, /** * 拖拽元素放开 */ fileDragDrop(e) { if ((this.sourceFileIndex || this.sourceFileIndex == 0) && (this.changeFileIndex || this.changeFileIndex == 0)) { let files = this.editor.files; let sourceFile = this.editor.files[this.sourceFileIndex]; let currentFile = this.editor.files[this.editor.currentFileIndex]; files[this.sourceFileIndex] = null; files.splice(this.changeFileIndex, 0, sourceFile); for (let j2 = files.length; j2 >= 0; j2--) { if (files[j2] == null) { files.splice(j2, 1); } } for (let j2 = files.length; j2 >= 0; j2--) { if (currentFile == files[j2]) { this.editor.currentFileIndex = j2; } } let parentDiv = this.dragFileEle.parentElement; let children = parentDiv.children; for (let i2 = 1; i2 < children.length - 4; i2++) { children[i2].style.borderLeft = ""; children[i2].style.borderRight = ""; } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["openfiles"] }); this.editor.bus.executeAll(); } this.dragFileEle = null; this.sourceFileIndex = null; this.changeFileIndex = null; }, /** * 变更实例 * @param instance */ changeFile(file) { var _a3; let ddInstance = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance; if (!file) { ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); } else { if (this.editor.files.indexOf(file) != this.editor.currentFileIndex) { let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_CHANGE_FILE_BEFORE", "CHANGE_FILE", null, ddInstance, null); if (rsState != -1) { this.editor.changeFile(this.editor.files.indexOf(file)); DDeiEditorUtil.invokeCallbackFunc("EVENT_CHANGE_FILE_AFTER", "CHANGE_FILE", null, ddInstance, null); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); } } } if (this.editor.files.length == 0) { ddInstance.disabled = true; } else { ddInstance.disabled = false; } }, // /** // * 放弃并关闭确认弹框 // */ // abortAndCloseFileConfirmDialog() { // this.tempFile.state = DDeiFileState.NONE; // this.closeFile(this.tempFile); // }, // /** // * 保存 // * @param evt // */ // saveAndCloseFileConfirmDialog() { // if (this.tempFile) { // //获取json信息 // let file = this.tempFile; // if (file) { // let json = file.toJSON(); // if (json) { // //执行保存 // let storeIns = new DDeiStoreLocal(); // json.state = DDeiFileState.NONE; // storeIns.save(file.id, json).then((data) => { // //回写ID // file.id = data; // file.state = DDeiFileState.NONE; // this.closeFile(this.tempFile); // }); // } // } // } // }, /** * 关闭文件 * @param instance */ closeFile(file, evt) { var _a3; let canClose = true; if (this.beforeCloseFile) { canClose = this.beforeCloseFile(file); } if (canClose) { let ddInstance = this.editor.ddInstance; let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_CLOSE_FILE_BEFORE", "CLOSE_FILE", null, ddInstance, evt); if (rsState != -1) { let index = this.editor.files.indexOf(file); this.editor.removeFile(file); if (index < this.editor.currentFileIndex) { this.editor.currentFileIndex--; } else if (index == this.editor.currentFileIndex) { if (index > 0) { this.changeFile( this.editor.files[this.editor.currentFileIndex - 1] ); } else if (this.editor.files.length > 0) { this.changeFile(this.editor.files[0]); } } if (this.editor.files.length == 0) { this.changeFile(null); this.editor.currentFileIndex = -1; } if (index > this.openIndex) { this.openIndex--; if (this.openIndex < 0) { this.openIndex = 0; } } DDeiEditorUtil.invokeCallbackFunc("EVENT_CLOSE_FILE_AFTER", "CLOSE_FILE", null, ddInstance, evt); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu", "topmenu"] }); this.editor.changeState(DDeiEditorState.DESIGNING); (_a3 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _a3.executeAll(); } } }, /** * 在存在显示隐藏的情况下移动tab */ moveItem(index = 0) { if (index != 0) { this.openIndex += index; if (this.openIndex > this.editor.files.length - this.maxOpenSize) { this.openIndex = this.editor.files.length - this.maxOpenSize; } else if (this.openIndex < 0) { this.openIndex = 0; } } }, /** * 展开工具栏 */ expandToolBox() { this.editor.leftWidth = window.leftWidth; this.editor.middleWidth -= window.leftWidth; delete window.leftWidth; this.editor.changeState(DDeiEditorState.DESIGNING); }, /** * 焦点进入当前区域 */ changeEditorFocus() { this.editor.changeState(DDeiEditorState.DESIGNING); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); } } }; const OpenFilesView_vue_vue_type_style_index_0_scoped_cf0859cc_lang = ""; const _hoisted_1$19 = { key: 0, class: "ddei-core-panel-openfilesview-item" }; const _hoisted_2$R = ["onClick", "title"]; const _hoisted_3$N = { class: "textcontent" }; const _hoisted_4$C = ["onDblclick"]; const _hoisted_5$u = { class: "dirty" }; const _hoisted_6$p = ["onClick"]; function _sfc_render$1b(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, onMousedown: _cache[6] || (_cache[6] = ($event) => $options.changeEditorFocus()), onMouseup: _cache[7] || (_cache[7] = ($event) => $props.drag && $options.fileDragDrop($event)), ref: "openFilesView", class: "ddei-core-panel-openfilesview" }, [ vue.withDirectives(vue.createElementVNode("div", { class: "ddei-core-panel-openfilesview-expandbox", onClick: _cache[0] || (_cache[0] = (...args) => $options.expandToolBox && $options.expandToolBox(...args)) }, _cache[8] || (_cache[8] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-expand4" }) ], -1) ]), 512), [ [vue.vShow, ((_a3 = this.editor) == null ? void 0 : _a3.leftWidth) == 0] ]), !((_b2 = $props.editor) == null ? void 0 : _b2.files) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$19)) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_c2 = $props.editor) == null ? void 0 : _c2.files, (item, i2) => { return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass(item.active == 1 ? "ddei-core-panel-openfilesview-item ddei-core-panel-openfilesview-item--selected" : "ddei-core-panel-openfilesview-item"), onClick: ($event) => $options.changeFile(item), onMousedown: _cache[1] || (_cache[1] = ($event) => $props.drag && $options.fileDragStart(_ctx.index, $event)), onMousemove: _cache[2] || (_cache[2] = ($event) => $props.drag && $options.fileDragOver($event)), title: item.name }, [ _cache[10] || (_cache[10] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-file" }) ], -1)), vue.createElementVNode("span", _hoisted_3$N, [ vue.createElementVNode("div", { class: "text", onDblclick: ($event) => $props.rename && $options.startChangeFileName(item, $event) }, vue.toDisplayString(item.name), 41, _hoisted_4$C), vue.withDirectives(vue.createElementVNode("div", _hoisted_5$u, "ꔷ", 512), [ [vue.vShow, item.state != 0] ]) ]), $props.close ? (vue.openBlock(), vue.createElementBlock("svg", { key: 0, onClick: vue.withModifiers(($event) => $options.closeFile(item, $event), ["prevent", "stop"]), class: "icon close", "aria-hidden": "true" }, _cache[9] || (_cache[9] = [ vue.createElementVNode("use", { "xlink:href": "#icon-close" }, null, -1) ]), 8, _hoisted_6$p)) : vue.createCommentVNode("", true) ], 42, _hoisted_2$R)), [ [vue.vShow, i2 >= $data.openIndex && (i2 - $data.openIndex + 1) * $data.unitFileWidth + 120 <= _ctx.width] ]); }), 256)), $props.create && (!$props.max || ((_e2 = (_d2 = $props.editor) == null ? void 0 : _d2.files) == null ? void 0 : _e2.length) < $props.max) ? (vue.openBlock(), vue.createElementBlock("svg", { key: 1, class: "icon addfile", "aria-hidden": "true", onClick: _cache[3] || (_cache[3] = (...args) => $options.newFile && $options.newFile(...args)) }, _cache[11] || (_cache[11] = [ vue.createElementVNode("use", { "xlink:href": "#icon-add" }, null, -1) ]))) : vue.createCommentVNode("", true), _cache[14] || (_cache[14] = vue.createElementVNode("div", { style: { "flex": "1 1 1px" } }, null, -1)), vue.withDirectives(vue.createElementVNode("div", { class: "ddei-core-panel-openfilesview-movebox", onClick: _cache[4] || (_cache[4] = ($event) => $options.moveItem(-1)) }, _cache[12] || (_cache[12] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-left" }) ], -1) ]), 512), [ [vue.vShow, ((_g = (_f = $props.editor) == null ? void 0 : _f.files) == null ? void 0 : _g.length) > $data.maxOpenSize] ]), vue.withDirectives(vue.createElementVNode("div", { class: "ddei-core-panel-openfilesview-movebox", onClick: _cache[5] || (_cache[5] = ($event) => $options.moveItem(1)) }, _cache[13] || (_cache[13] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-right" }) ], -1) ]), 512), [ [vue.vShow, ((_i = (_h = $props.editor) == null ? void 0 : _h.files) == null ? void 0 : _i.length) > $data.maxOpenSize] ]) ], 544)) : vue.createCommentVNode("", true); } const OpenFilesView = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["render", _sfc_render$1b], ["__scopeId", "data-v-cf0859cc"]]); const _DDeiCoreOpenFilesViewPanel = class _DDeiCoreOpenFilesViewPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", OpenFilesView.name); __publicField3(this, "plugins", [OpenFilesView]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[OpenFilesView.name]) { for (let i2 in options[OpenFilesView.name]) { newOptions[i2] = options[OpenFilesView.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreOpenFilesViewPanel(newOptions); return panels; } } return _DDeiCoreOpenFilesViewPanel; } static modify(fn) { return _DDeiCoreOpenFilesViewPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreOpenFilesViewPanel, "defaultIns", new _DDeiCoreOpenFilesViewPanel(null)); let DDeiCoreOpenFilesViewPanel = _DDeiCoreOpenFilesViewPanel; const _sfc_main$1a = { name: "ddei-core-panel-canvasview", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, computed: {}, watch: {}, created() { this.mouseWheelThrottle = throttle(this.mouseWheelThrottle, 10); this.mouseMove = throttle(this.mouseMove, 20); }, mounted() { let ddInstance = this.editor.ddInstance; ddInstance.initRender(); if (!ddInstance.stage.wpv) { ddInstance.stage.wpv = { x: -(ddInstance.stage.width - ddInstance.render.container.clientWidth) / 2, y: -(ddInstance.stage.height - ddInstance.render.container.clientHeight) / 2, z: 0 }; } ddInstance.render.drawShape(); ddInstance.bus.push(DDeiEditorEnumBusCommandType.LoadFile); ddInstance.bus.executeAll(); }, methods: { /** * 画布双击 */ canvasDBClick(evt) { var _a3, _b2; let middleCanvas = this.$refs.middleCanvas; let middleCanvasPos = DDeiUtil.getDomAbsPosition(middleCanvas); if (middleCanvasPos.left + 5 <= evt.clientX && middleCanvasPos.left + middleCanvas.offsetWidth - 5 >= evt.clientX) { let ddInstance = this.editor.ddInstance; let stage2 = ddInstance.stage; let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= stage2.wpv.x; ey -= stage2.wpv.y; let stageRatio2 = stage2.getStageRatio(); let ex2 = ex / stageRatio2; let ey2 = ey / stageRatio2; let operateControls = DDeiAbstractShape.findBottomModelsByArea(stage2.layers[stage2.layerIndex], ex2, ey2, true, true); if (operateControls != null && operateControls.length > 0) { let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DBL_CLICK", "DBL_CLICK", { models: operateControls, ex, ey }, ddInstance, null); if (rsState == 0 || rsState == 1) { (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.hotkeys["ddei-core-keyaction-quickedit-start"]) == null ? void 0 : _b2.action(evt, this.editor.ddInstance); } } } }, /** * 焦点进入当前区域 */ changeEditorFocus() { this.editor.changeState(DDeiEditorState.DESIGNING); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); return true; }, /** * 触控板滑动事件 */ mouseWheel(evt) { if (this.editor.state == DDeiEditorState.DESIGNING) { this.mouseWheelThrottle(evt); evt.preventDefault(); evt.cancelBubble = true; return false; } }, mouseWheelThrottle(evt) { this.editor.ddInstance.render.mouseWheel(evt); }, mouseDown(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; let middleCanvas = this.$refs.middleCanvas; let middleCanvasPos = DDeiUtil.getDomAbsPosition(middleCanvas); if (middleCanvasPos.left + 5 <= evt.clientX && middleCanvasPos.left + middleCanvas.offsetWidth - 5 >= evt.clientX) { if (this.editor.state == DDeiEditorState.QUICK_EDITING) { if ((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.render) == null ? void 0 : _d2.editorShadowControl) { let stage2 = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage; let rat1 = stage2.ddInstance.render.ratio; let stageRatio2 = stage2.getStageRatio(); let scaleSize = DDeiUtil.DRAW_TEMP_CANVAS && rat1 < 2 ? 2 / rat1 : 1; let ex = evt.offsetX; let ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= stage2.wpv.x; ey -= stage2.wpv.y; let ex2 = ex / stageRatio2; let ey2 = ey / stageRatio2; let shadowControl = (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.render) == null ? void 0 : _j.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.isInTextArea(ex2, ey2)) { let cx = (ex2 - shadowControl.cpv.x) * rat1 * stageRatio2; let cy = (ey2 - shadowControl.cpv.y) * rat1 * stageRatio2; let startIndex = 0; let sx = 0; let i2 = 0; for (; i2 < shadowControl.render.textUsedArea.length; i2++) { let rowData = shadowControl.render.textUsedArea[i2]; let ry = rowData.y / scaleSize; let rh = rowData.height / scaleSize; let rx = rowData.x / scaleSize; let rw = rowData.width / scaleSize; if (cy >= ry && cy <= ry + rh) { if (cx >= rx && cx <= rx + rw) { let endI = startIndex + rowData.text.length; for (let x2 = startIndex; x2 < endI; x2++) { let fx = shadowControl.render.textUsedArea[0].textPosCache[x2].x / scaleSize; let lx = x2 < endI - 1 ? shadowControl.render.textUsedArea[0].textPosCache[x2 + 1].x / scaleSize : rx + rw; let halfW = (lx - fx) / 2; if (cx >= fx && cx < lx) { if (cx > fx + halfW) { sx = x2 + 1; } else { sx = x2; } break; } } } if (!sx) { if (ex < shadowControl.cpv.x) { sx = startIndex; } else { sx = startIndex + rowData.text.length; } } break; } startIndex += rowData.text.length; } if (!sx) { if (ex < shadowControl.cpv.x) { sx = 0; } else { sx = startIndex + shadowControl.render.textUsedArea[i2 - 1].text.length; } } let editorText = DDeiUtil.getEditorText(); editorText.selectionStart = sx; editorText.selectionEnd = sx; setTimeout(() => { editorText.focus(); }, 10); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); this.editor.ddInstance.stage.render.tempTextStart = editorText.selectionStart; this.editor.ddInstance.stage.render.operateState = DDeiEnumOperateState.QUICK_EDITING_TEXT_SELECTING; return; } } } let isDialogOpen = false; for (let oid in DDeiEditor.ACTIVE_INSTANCE.tempDialogData) { if (DDeiEditor.ACTIVE_INSTANCE.tempDialogData[oid]) { isDialogOpen = true; break; } } this.changeEditorFocus(); this.editor.ddInstance.state = DDeiEnumState.NONE; if (!isDialogOpen) { this.editor.ddInstance.render.mouseDown(evt); } } }, /** * 拖拽元素移动 */ mouseMove(e) { var _a3, _b2, _c2, _d2, _e2; if (this.editor.state == DDeiEditorState.CONTROL_CREATING) { DDeiKeyAction.updateKeyState(e); let ddInstance = this.editor.ddInstance; let stage2 = ddInstance.stage; let ex = e.offsetX; let ey = e.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= stage2.wpv.x; ey -= stage2.wpv.y; if (this.editor.creatingControls) { let layer2 = stage2.layers[stage2.layerIndex]; if (layer2) { stage2.render.currentOperateContainer = layer2; stage2.render.operateState = DDeiEnumOperateState.CONTROL_CREATING; let controls2 = this.editor.creatingControls; stage2.render.currentOperateShape = controls2[0]; if (!layer2.models.has(controls2[0].id)) { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: layer2, models: controls2 }, e ); let dragObj = { x: ex, y: ey, model: controls2[0], num: 0 }; controls2.forEach((c) => { dragObj[c.id] = { dx: c.cpv.x - controls2[0].cpv.x, //鼠标在控件中心坐标的增量位置 dy: c.cpv.y - controls2[0].cpv.y }; }); this.editor.bus.push( DDeiEnumBusCommandType.UpdateDragObj, { dragObj }, e ); this.editor.bus.push( DDeiEnumBusCommandType.ModelChangePosition, { models: controls2, x: ex, y: ey, sample: 1, dragObj }, e ); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); } else { let ex1 = e.offsetX / window.remRatio; let ey1 = e.offsetY / window.remRatio; let rat1 = (_a3 = ddInstance.render) == null ? void 0 : _a3.ratio; let canvasWidth = ddInstance.render.canvas.width / rat1; let canvasHeight = ddInstance.render.canvas.height / rat1; let edgeWeight = 25; if (ex1 < edgeWeight) { ddInstance.render.inEdge = 4; } else if (ex1 > canvasWidth - edgeWeight) { ddInstance.render.inEdge = 2; } else if (ey1 < edgeWeight) { ddInstance.render.inEdge = 1; } else if (ey1 > canvasHeight - edgeWeight) { ddInstance.render.inEdge = 3; } else { ddInstance.render.inEdge = 0; } if (!ddInstance.render.inEdge) { let selectedModels = /* @__PURE__ */ new Map(); controls2.forEach((control) => { selectedModels.set(control.id, control); }); (_c2 = (_b2 = this.editor) == null ? void 0 : _b2.bus) == null ? void 0 : _c2.push( DDeiEnumBusCommandType.SetHelpLine, { models: selectedModels }, e ); this.editor.bus.push( DDeiEnumBusCommandType.ModelChangePosition, { models: controls2, x: ex, y: ey, dx: 0, dy: 0, sample: 1, dragObj: ddInstance.stage.render.dragObj }, e ); let isAlt = DDei.KEY_DOWN_STATE.get("alt"); this.editor.bus.push( DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 10 }, e ); let lastOnContainer = layer2; if (isAlt) { let stageRatio2 = stage2.getStageRatio(); let ex2 = ex / stageRatio2; let ey2 = ey / stageRatio2; let mouseOnContainers = DDeiAbstractShape.findBottomContainersByArea( layer2, ex2, ey2 ); if (mouseOnContainers && mouseOnContainers.length > 0) { lastOnContainer = mouseOnContainers[mouseOnContainers.length - 1]; } if (lastOnContainer != layer2) { this.editor.bus.push( DDeiEnumBusCommandType.ChangeSelectorPassIndex, { passIndex: 11 }, e ); } } (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.bus) == null ? void 0 : _e2.push(DDeiEnumBusCommandType.RefreshShape); } } this.editor.bus.executeAll(); e.preventDefault(); } } } else if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.STAGE_SCROLL_WORKING) { this.editor.ddInstance.render.mouseMove(e); } else if (this.editor.dragPart) { this.editor.dragPart.boxDraging(e); } else { this.editor.ddInstance.render.mouseMove(e); } }, /** * 拖拽元素放开 */ mouseUp(e) { if (this.editor.state == DDeiEditorState.CONTROL_CREATING) { let ddInstance = this.editor.ddInstance; let stage2 = ddInstance.stage; let ex = e.offsetX / window.remRatio; let ey = e.offsetY / window.remRatio; ex -= stage2.wpv.x; ey -= stage2.wpv.y; let stageRatio2 = stage2.getStageRatio(); ex /= stageRatio2; ey /= stageRatio2; if (this.editor.creatingControls) { let ddInstance2 = this.editor.ddInstance; let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DRAG_AFTER", DDeiEnumOperateType.CREATE, { models: this.editor.creatingControls, ex, ey }, ddInstance2, null); if (rsState == 0 || rsState == 1) { let isAlt = DDei.KEY_DOWN_STATE.get("alt"); ddInstance2.stage.idIdx++; let layer2 = ddInstance2.stage.layers[ddInstance2.stage.layerIndex]; if (isAlt) { let mouseOnContainers = DDeiAbstractShape.findBottomContainersByArea(layer2, ex, ey); let lastOnContainer = layer2; if (mouseOnContainers && mouseOnContainers.length > 0) { lastOnContainer = mouseOnContainers[mouseOnContainers.length - 1]; } if (lastOnContainer != layer2) { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: lastOnContainer, oldContainer: layer2, models: this.editor.creatingControls } ); } } this.editor.creatingControls.forEach((model) => { var _a3, _b2; let controlDefine = this.editor.controls.get(model.modelCode); if ((_b2 = (_a3 = controlDefine == null ? void 0 : controlDefine.define) == null ? void 0 : _a3.sample) == null ? void 0 : _b2.depProps) { let depProps = controlDefine.define.sample.depProps; for (let type in depProps) { let property = depProps[type]; let modelPropValue = model[property]; if (modelPropValue) { DDeiUtil.createDepLinkModel(model, modelPropValue, type); } } } model.refreshLinkModels(); }); this.editor.bus.push( DDeiEnumBusCommandType.CancelCurLevelSelectedModels, { container: layer2, curLevel: true } ); this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeSelect, [{ id: this.editor.creatingControls[0].id, value: DDeiEnumControlState.SELECTED }] ); this.editor.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); this.editor.bus.push(DDeiEnumBusCommandType.UpdatePaperArea); let mds = { models: this.editor.creatingControls }; this.editor.bus.push(DDeiEnumBusCommandType.NodifyControlCreated, mds); this.editor.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); this.editor.bus.push(DDeiEnumBusCommandType.NodifyChange); this.editor.bus.push(DDeiEnumBusCommandType.AddHistroy); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.creatingControls = null; this.editor.state = DDeiEditorState.DESIGNING; this.editor.bus.executeAll(); } } e.preventDefault(); } else if (this.editor.dragPart) { this.editor.dragPart.boxDragEnd(e); this.editor.changeState(DDeiEditorState.DESIGNING); } else if (this.editor.state == DDeiEditorState.DESIGNING || this.editor.state == DDeiEditorState.QUICK_EDITING) { this.editor.ddInstance.render.mouseUp(e); } } } }; const CanvasView_vue_vue_type_style_index_0_lang = ""; const _hoisted_1$18 = ["id"]; function _sfc_render$1a(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return vue.openBlock(), vue.createElementBlock("div", { id: ((_a3 = $props.editor) == null ? void 0 : _a3.id) + "_canvas", ref: "middleCanvas", class: "ddei-editor-canvasview", onMousedown: _cache[0] || (_cache[0] = ($event) => $options.mouseDown($event)), ondragstart: "return false;", onWheel: _cache[1] || (_cache[1] = ($event) => $options.mouseWheel($event)), onMousemove: _cache[2] || (_cache[2] = ($event) => $options.mouseMove($event)), onMouseup: _cache[3] || (_cache[3] = ($event) => $options.mouseUp($event)), onDblclick: _cache[4] || (_cache[4] = (...args) => $options.canvasDBClick && $options.canvasDBClick(...args)), onContextmenu: _cache[5] || (_cache[5] = vue.withModifiers(() => { }, ["prevent"])) }, null, 40, _hoisted_1$18); } const CanvasView = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["render", _sfc_render$1a]]); const _DDeiCoreCanvasViewPanel = class _DDeiCoreCanvasViewPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", CanvasView.name); __publicField3(this, "plugins", [CanvasView]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[CanvasView.name]) { for (let i2 in options[CanvasView.name]) { newOptions[i2] = options[CanvasView.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreCanvasViewPanel(newOptions); return panels; } } return _DDeiCoreCanvasViewPanel; } static modify(fn) { return _DDeiCoreCanvasViewPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreCanvasViewPanel, "defaultIns", new _DDeiCoreCanvasViewPanel(null)); let DDeiCoreCanvasViewPanel = _DDeiCoreCanvasViewPanel; const _sfc_main$19 = { name: "ddei-core-panel-bottommenu", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { forceRefresh: true }; }, computed: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { //强制刷新当前以及下层组件 forceRefreshParts(parts) { if (!parts || parts == "bottommenu" || parts.indexOf("bottommenu") != -1) { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); } }, refreshData() { this.editor.bottomMenuViewer = this; }, /** * 焦点进入当前区域 */ changeEditorFocus() { if (this.editor.state != DDeiEditorState.BOTTOM_MENU_OPERATING && this.editor.state != DDeiEditorState.QUICK_EDITING) { this.editor.changeState(DDeiEditorState.BOTTOM_MENU_OPERATING); } this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); } } }; const BottomMenu_vue_vue_type_style_index_0_scoped_5ec138cc_lang = ""; function _sfc_render$19(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "ddei-core-panel-bottommenu", onMousedown: _cache[0] || (_cache[0] = (...args) => $options.changeEditorFocus && $options.changeEditorFocus(...args)) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_a3 = $props.editor) == null ? void 0 : _a3.getPartPanels($props.options, "panels"), (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ editor: $props.editor, options: item.options, ref_for: true }, item.options), null, 16, ["editor", "options"]); }), 256)) ], 32)) : vue.createCommentVNode("", true); } const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["render", _sfc_render$19], ["__scopeId", "data-v-5ec138cc"]]); const _DDeiCoreBottomMenuPanel = class _DDeiCoreBottomMenuPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", BottomMenu.name); __publicField3(this, "defaultOptions", { "panels": [ "ddei-core-panel-bottom-sheets", "ddei-core-panel-bottom-shapecount", "ddei-core-panel-bottom-managelayers", "ddei-core-panel-bottom-changeratio", "ddei-core-panel-bottom-suitratio" ] }); __publicField3(this, "plugins", [BottomMenu]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[BottomMenu.name]) { for (let i2 in options[BottomMenu.name]) { newOptions[i2] = options[BottomMenu.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreBottomMenuPanel(newOptions); return panels; } } return _DDeiCoreBottomMenuPanel; } static modify(fn) { return _DDeiCoreBottomMenuPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreBottomMenuPanel, "defaultIns", new _DDeiCoreBottomMenuPanel()); let DDeiCoreBottomMenuPanel = _DDeiCoreBottomMenuPanel; const _sfc_main$18 = { name: "ddei-core-panel-eimport", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { file: null }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2; this.file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; }, methods: { // showExportDialog(evt: Event) { // let srcElement = evt.currentTarget; // DDeiEditorUtil.showOrCloseDialog("ddei-core-dialog-exportoption", { // callback: { // }, // mode: 2, // group: "top-dialog", // background: "white", // opacity: "1%", // event: -1 // }, {}, srcElement) // if (this.editor.tempDialogData && this.editor.tempDialogData["ddei-core-dialog-exportoption"]) { // this.editor.changeState(DDeiEditorState.PROPERTY_EDITING); // } else { // this.editor.changeState(DDeiEditorState.DESIGNING); // } // }, /** * 下载文件 */ download(evt) { var _a3, _b2, _c2, _d2; if ((_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) { let file = (_d2 = this.editor) == null ? void 0 : _d2.files[(_c2 = this.editor) == null ? void 0 : _c2.currentFileIndex]; if (file) { let json = file.toJSON(); if (json) { let eleLink = document.createElement("a"); eleLink.download = file.name + ".dei"; eleLink.style.display = "none"; let blob = new Blob([JSON.stringify(json)]); eleLink.href = URL.createObjectURL(blob); document.body.appendChild(eleLink); eleLink.click(); document.body.removeChild(eleLink); this.editor.changeState(DDeiEditorState.DESIGNING); } } } } } }; const ExportAndImport_vue_vue_type_style_index_0_scoped_9c97ea48_lang = ""; const _hoisted_1$17 = { class: "ddei-core-panel-eimport" }; const _hoisted_2$Q = { class: "content" }; const _hoisted_3$M = { class: "part" }; const _hoisted_4$B = { class: "text" }; function _sfc_render$18(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$17, [ _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "header" }, null, -1)), vue.createElementVNode("div", _hoisted_2$Q, [ vue.createElementVNode("div", _hoisted_3$M, [ vue.createElementVNode("div", { class: "button-v", onClick: _cache[0] || (_cache[0] = (...args) => $options.download && $options.download(...args)) }, [ _cache[1] || (_cache[1] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-download" }) ], -1)), vue.createElementVNode("div", _hoisted_4$B, vue.toDisplayString($props.editor.i18n("ddei.download")), 1) ]) ]) ]), _cache[3] || (_cache[3] = vue.createElementVNode("div", { class: "tail" }, null, -1)) ]); } const ExportAndImport = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["render", _sfc_render$18], ["__scopeId", "data-v-9c97ea48"]]); const _DDeiCoreExportAndImportPanel = class _DDeiCoreExportAndImportPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ExportAndImport.name); __publicField3(this, "plugins", [ExportAndImport]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ExportAndImport.name]) { for (let i2 in options[ExportAndImport.name]) { newOptions[i2] = options[ExportAndImport.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreExportAndImportPanel(newOptions); return panels; } } return _DDeiCoreExportAndImportPanel; } static modify(fn) { return _DDeiCoreExportAndImportPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreExportAndImportPanel, "defaultIns", new _DDeiCoreExportAndImportPanel(null)); let DDeiCoreExportAndImportPanel = _DDeiCoreExportAndImportPanel; const _sfc_main$17 = { name: "ddei-core-panel-fileinfo", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { file: {}, fileNameEditing: false, fileDescEditing: false }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2; this.file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; }, methods: { /** * 保存 * @param evt */ save(evt) { this.editor.changeState(DDeiEditorState.DESIGNING); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.push(DDeiEditorEnumBusCommandType.SaveFile, {}, evt); this.editor.bus.executeAll(); }, /** * 下载文件 */ download(evt) { var _a3, _b2, _c2, _d2; if ((_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) { let file = (_d2 = this.editor) == null ? void 0 : _d2.files[(_c2 = this.editor) == null ? void 0 : _c2.currentFileIndex]; if (file) { let json = file.toJSON(); if (json) { let eleLink = document.createElement("a"); eleLink.download = file.name + ".dei"; eleLink.style.display = "none"; let blob = new Blob([JSON.stringify(json)]); eleLink.href = URL.createObjectURL(blob); document.body.appendChild(eleLink); eleLink.click(); document.body.removeChild(eleLink); this.editor.changeState(DDeiEditorState.DESIGNING); } } } }, /** * 打开文件 * @param evt */ async openFile(evt) { let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_FILE_BEFORE", "LOAD_FILE", null, this.editor.ddInstance, evt); if (rsState != -1) { let openFileHandle = await showOpenFilePicker({ description: this.editor.i18n("ddei.fileDescription"), types: [{ accept: { "text/plain": [".dei"] } }] }); let openFile = await openFileHandle[0].getFile(); let read = new FileReader(); read.readAsText(openFile); read.onload = async () => { var _a3, _b2, _c2, _d2, _e2; let result = read.result; let resultJSON = JSON.parse(result); let ddInstance = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance; let file = DDeiFile.loadFromJSON(resultJSON, { currentDdInstance: ddInstance }); let openedFiles = this.editor.files; let openedFileIndex = -1; if (!file.id) { file.id = DDeiUtil.getUniqueCode(); } for (let fi = 0; fi < openedFiles.length; fi++) { if (openedFiles[fi].id && openedFiles[fi].id == file.id) { openedFileIndex = fi; break; } } ddInstance.stage.destroyRender(); if (openedFileIndex == -1) { file.localFileHandler = openFileHandle[0]; file.local = 1; this.editor.addFile(file); for (let x2 = 0; x2 < this.editor.files.length; x2++) { this.editor.files[x2].active = DDeiActiveType.NONE; } this.editor.currentFileIndex = this.editor.files.length - 1; file.state = DDeiFileState.NONE; file.active = DDeiActiveType.ACTIVE; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { file.changeSheet(file.currentSheetIndex); let stage2 = sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance; ddInstance.disabled = false; file.initHistroy(); file.histroy[0].isNew = true; ddInstance.stage = stage2; stage2.initRender(); if (!stage2.wpv) { stage2.wpv = { x: -(stage2.width - ddInstance.render.container.clientWidth) / 2, y: -(stage2.height - ddInstance.render.container.clientHeight) / 2, z: 0 }; } this.editor.changeState(DDeiEditorState.DESIGNING); ddInstance.bus.push( DDeiEditorEnumBusCommandType.ClearTemplateUI ); ddInstance.bus.push( DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu", "topmenu"] } ); (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.push(DDeiEnumBusCommandType.RefreshShape); (_c2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _c2.executeAll(); } } else { file = this.editor.files[openedFileIndex]; if (file && ddInstance) { for (let x2 = 0; x2 < this.editor.files.length; x2++) { this.editor.files[x2].active = DDeiActiveType.NONE; } file.active = DDeiActiveType.ACTIVE; this.editor.currentFileIndex = openedFileIndex; let stage2 = file.sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance; ddInstance.stage = stage2; ddInstance.disabled = false; stage2.initRender(); this.editor.changeState(DDeiEditorState.DESIGNING); ddInstance.bus.push( DDeiEditorEnumBusCommandType.ClearTemplateUI ); ddInstance.bus.push( DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu", "topmenu"] } ); (_d2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _d2.push(DDeiEnumBusCommandType.RefreshShape); (_e2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _e2.executeAll(); } } DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_FILE_AFTER", "LOAD_FILE", { file }, this.editor.ddInstance, evt); }; } }, /** * 新建文件 * @param evt */ newFile(evt) { var _a3, _b2; if ((_a3 = this.editor) == null ? void 0 : _a3.ddInstance) { let ddInstance = this.editor.ddInstance; let fileText = this.editor.i18n("ddei.file"); let newText = this.editor.i18n("ddei.new"); let pageText = this.editor.i18n("ddei.page"); let file = DDeiFile.loadFromJSON( { name: newText + fileText + "_NEW", path: "/" + newText + fileText + "_NEW", sheets: [ new DDeiSheet({ name: pageText + "-1", desc: pageText + "-1", stage: DDeiStage.initByJSON({ id: "stage_1" }, { currentDdInstance: ddInstance }), active: DDeiActiveType.ACTIVE }) ], currentSheetIndex: 0, state: DDeiFileState.NEW, active: DDeiActiveType.ACTIVE }, { currentDdInstance: ddInstance } ); if (this.editor.currentFileIndex != -1) { this.editor.files[this.editor.currentFileIndex].active = DDeiActiveType.NONE; } this.editor.addFile(file); this.editor.currentFileIndex = this.editor.files.length - 1; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { ddInstance.stage.destroyRender(); let stage2 = sheets[0].stage; stage2.ddInstance = ddInstance; ddInstance.stage = stage2; file.initHistroy(); if (!stage2.wpv) { stage2.wpv = { x: -(stage2.width - ddInstance.render.container.clientWidth) / 2, y: -(stage2.height - ddInstance.render.container.clientHeight) / 2, z: 0 }; } stage2.initRender(); ddInstance.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu", "topmenu"] }); this.editor.changeState(DDeiEditorState.DESIGNING); (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.executeAll(); } } } } }; const FileInfo_vue_vue_type_style_index_0_scoped_b1753b91_lang = ""; const _hoisted_1$16 = { class: "ddei-core-panel-fileinfo" }; const _hoisted_2$P = { class: "content" }; const _hoisted_3$L = { class: "part" }; const _hoisted_4$A = ["title"]; const _hoisted_5$t = { class: "text" }; const _hoisted_6$o = { class: "part" }; const _hoisted_7$m = ["title"]; const _hoisted_8$i = { class: "text" }; const _hoisted_9$g = { class: "part" }; const _hoisted_10$a = ["title"]; const _hoisted_11$a = { class: "text" }; const _hoisted_12$7 = { class: "part" }; const _hoisted_13$6 = ["title"]; const _hoisted_14$5 = { class: "text" }; const _hoisted_15$4 = { class: "tail" }; function _sfc_render$17(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$16, [ _cache[8] || (_cache[8] = vue.createElementVNode("div", { class: "header" }, null, -1)), vue.createElementVNode("div", _hoisted_2$P, [ vue.createElementVNode("div", _hoisted_3$L, [ vue.createElementVNode("div", { class: "button-v", onClick: _cache[0] || (_cache[0] = (...args) => $options.newFile && $options.newFile(...args)), title: $props.editor.i18n("ddei.new") }, [ _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-new-file" }) ], -1)), vue.createElementVNode("div", _hoisted_5$t, vue.toDisplayString($props.editor.i18n("ddei.new")), 1) ], 8, _hoisted_4$A) ]), vue.createElementVNode("div", _hoisted_6$o, [ vue.createElementVNode("div", { class: "button-v", onClick: _cache[1] || (_cache[1] = (...args) => $options.openFile && $options.openFile(...args)), title: $props.editor.i18n("ddei.open") }, [ _cache[5] || (_cache[5] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-folder" }) ], -1)), vue.createElementVNode("div", _hoisted_8$i, vue.toDisplayString($props.editor.i18n("ddei.open")), 1) ], 8, _hoisted_7$m) ]), vue.createElementVNode("div", _hoisted_9$g, [ vue.createElementVNode("div", { class: "button-v", onClick: _cache[2] || (_cache[2] = (...args) => $options.save && $options.save(...args)), title: $props.editor.i18n("ddei.save") }, [ _cache[6] || (_cache[6] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-save" }) ], -1)), vue.createElementVNode("div", _hoisted_11$a, vue.toDisplayString($props.editor.i18n("ddei.save")), 1) ], 8, _hoisted_10$a) ]), vue.createElementVNode("div", _hoisted_12$7, [ vue.createElementVNode("div", { class: "button-v", onClick: _cache[3] || (_cache[3] = (...args) => $options.download && $options.download(...args)), title: $props.editor.i18n("ddei.download") }, [ _cache[7] || (_cache[7] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-download" }) ], -1)), vue.createElementVNode("div", _hoisted_14$5, vue.toDisplayString($props.editor.i18n("ddei.download")), 1) ], 8, _hoisted_13$6) ]) ]), vue.createElementVNode("div", _hoisted_15$4, vue.toDisplayString($props.editor.i18n("ddei.file")), 1) ]); } const FileInfo = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$17], ["__scopeId", "data-v-b1753b91"]]); const _DDeiCoreFileInfoPanel = class _DDeiCoreFileInfoPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", FileInfo.name); __publicField3(this, "plugins", [FileInfo]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[FileInfo.name]) { for (let i2 in options[FileInfo.name]) { newOptions[i2] = options[FileInfo.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreFileInfoPanel(newOptions); return panels; } } return _DDeiCoreFileInfoPanel; } static modify(fn) { return _DDeiCoreFileInfoPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreFileInfoPanel, "defaultIns", new _DDeiCoreFileInfoPanel(null)); let DDeiCoreFileInfoPanel = _DDeiCoreFileInfoPanel; const _sfc_main$16 = { name: "ddei-core-panel-fileoperate", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { icons: null }; }, computed: {}, watch: {}, created() { }, mounted() { }, methods: { /** * 新建文件 * @param evt */ newFile(evt) { var _a3; if ((_a3 = this.editor) == null ? void 0 : _a3.ddInstance) { let ddInstance = this.editor.ddInstance; let file = DDeiFile.loadFromJSON( { name: "新建文件_NEW", path: "/新建文件_NEW", sheets: [ new DDeiSheet({ name: "页面-1", desc: "页面-1", stage: DDeiStage.initByJSON({ id: "stage_1" }), active: DDeiActiveType.ACTIVE }) ], currentSheetIndex: 0, state: DDeiFileState.NEW, active: DDeiActiveType.ACTIVE }, { currentDdInstance: ddInstance } ); if (this.editor.currentFileIndex != -1) { this.editor.files[this.editor.currentFileIndex].active = DDeiActiveType.NONE; } this.editor.addFile(file); this.editor.currentFileIndex = this.editor.files.length - 1; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { let stage2 = sheets[0].stage; stage2.ddInstance = ddInstance; ddInstance.stage = stage2; file.initHistroy(); if (!stage2.wpv) { stage2.wpv = { x: -(stage2.width - ddInstance.render.container.clientWidth) / 2, y: -(stage2.height - ddInstance.render.container.clientHeight) / 2, z: 0 }; } stage2.initRender(); ddInstance.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu"] }); this.editor.changeState(DDeiEditorState.DESIGNING); ddInstance.bus.executeAll(); } } }, /** * 保存 * @param evt */ save(evt) { this.editor.changeState(DDeiEditorState.DESIGNING); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.push(DDeiEditorEnumBusCommandType.SaveFile, {}, evt); this.editor.bus.executeAll(); }, /** * 下载文件 */ download(evt) { var _a3, _b2, _c2, _d2; if ((_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) { let file = (_d2 = this.editor) == null ? void 0 : _d2.files[(_c2 = this.editor) == null ? void 0 : _c2.currentFileIndex]; if (file) { let json = file.toJSON(); if (json) { let eleLink = document.createElement("a"); eleLink.download = file.name + ".dei"; eleLink.style.display = "none"; let blob = new Blob([JSON.stringify(json)]); eleLink.href = URL.createObjectURL(blob); document.body.appendChild(eleLink); eleLink.click(); document.body.removeChild(eleLink); this.editor.changeState(DDeiEditorState.DESIGNING); } } } }, /** * 打开文件 * @param evt */ openFile(evt) { } } }; const FileOperate_vue_vue_type_style_index_0_scoped_891d9231_lang = ""; const _hoisted_1$15 = { class: "ddei-core-panel-fileoperate" }; const _hoisted_2$O = { class: "ddei-core-panel-fileoperate-item", style: { "grid-row": "1/3" } }; const _hoisted_3$K = ["src"]; const _hoisted_4$z = ["src"]; const _hoisted_5$s = ["src"]; const _hoisted_6$n = ["src"]; const _hoisted_7$l = { class: "ddei-core-panel-fileoperate-item" }; const _hoisted_8$h = { class: "ddei-core-panel-fileoperate-item-text" }; function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$15, [ vue.createElementVNode("div", _hoisted_2$O, [ vue.createElementVNode("div", { class: "ddei-core-panel-fileoperate-item-box", onClick: _cache[0] || (_cache[0] = (...args) => $options.newFile && $options.newFile(...args)) }, [ vue.createElementVNode("img", { width: "16px", height: "16px", src: $data.icons["icon-file"] }, null, 8, _hoisted_3$K), vue.createElementVNode("div", null, vue.toDisplayString($props.editor.i18n("ddei.new")), 1) ]), vue.createElementVNode("div", { class: "ddei-core-panel-fileoperate-item-box", onClick: _cache[1] || (_cache[1] = (...args) => $options.save && $options.save(...args)) }, [ vue.createElementVNode("img", { width: "16px", height: "16px", src: $data.icons["icon-save"] }, null, 8, _hoisted_4$z), vue.createElementVNode("div", null, vue.toDisplayString($props.editor.i18n("ddei.save")), 1) ]), vue.createElementVNode("div", { class: "ddei-core-panel-fileoperate-item-box", onClick: _cache[2] || (_cache[2] = (...args) => $options.openFile && $options.openFile(...args)) }, [ vue.createElementVNode("img", { width: "16px", height: "16px", src: $data.icons["icon-open"] }, null, 8, _hoisted_5$s), vue.createElementVNode("div", null, vue.toDisplayString($props.editor.i18n("ddei.open")), 1) ]), vue.createElementVNode("div", { class: "ddei-core-panel-fileoperate-item-box", onClick: _cache[3] || (_cache[3] = (...args) => $options.download && $options.download(...args)) }, [ vue.createElementVNode("img", { width: "16px", height: "16px", src: $data.icons["icon-download"] }, null, 8, _hoisted_6$n), vue.createElementVNode("div", null, vue.toDisplayString($props.editor.i18n("ddei.download")), 1) ]) ]), vue.createElementVNode("div", _hoisted_7$l, [ vue.createElementVNode("div", _hoisted_8$h, vue.toDisplayString($props.editor.i18n("ddei.save")), 1) ]) ]); } const FileOperate = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["render", _sfc_render$16], ["__scopeId", "data-v-891d9231"]]); const _DDeiCoreFileOperatePanel = class _DDeiCoreFileOperatePanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", FileOperate.name); __publicField3(this, "plugins", [FileOperate]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[FileOperate.name]) { for (let i2 in options[FileOperate.name]) { newOptions[i2] = options[FileOperate.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreFileOperatePanel(newOptions); return panels; } } return _DDeiCoreFileOperatePanel; } static modify(fn) { return _DDeiCoreFileOperatePanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreFileOperatePanel, "defaultIns", new _DDeiCoreFileOperatePanel(null)); let DDeiCoreFileOperatePanel = _DDeiCoreFileOperatePanel; const _sfc_main$15 = { name: "ddei-core-panel-fontandtext", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { } }; const FontAndText_vue_vue_type_style_index_0_scoped_84f4d012_lang = ""; const _hoisted_1$14 = { class: "ddei-core-panel-fontandtext" }; const _hoisted_2$N = { class: "content" }; const _hoisted_3$J = { class: "buttons" }; const _hoisted_4$y = { class: "b1" }; const _hoisted_5$r = { class: "b2" }; const _hoisted_6$m = { class: "buttons" }; const _hoisted_7$k = { class: "mg14" }; const _hoisted_8$g = { class: "mg16" }; const _hoisted_9$f = { class: "mg16" }; const _hoisted_10$9 = { class: "mg165" }; const _hoisted_11$9 = { class: "mg17" }; const _hoisted_12$6 = { class: "mg17" }; const _hoisted_13$5 = { class: "b4" }; const _hoisted_14$4 = { class: "b5" }; const _hoisted_15$3 = { class: "b6" }; const _hoisted_16$2 = { class: "tail" }; function _sfc_render$15(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s; return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$14, [ _cache[0] || (_cache[0] = vue.createElementVNode("div", { class: "header" }, null, -1)), vue.createElementVNode("div", _hoisted_2$N, [ vue.createElementVNode("div", _hoisted_3$J, [ vue.createElementVNode("div", _hoisted_4$y, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_a3 = $props.editor) == null ? void 0 : _a3.panels["ddei-core-btn-fontfamily"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_5$r, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_b2 = $props.editor) == null ? void 0 : _b2.panels["ddei-core-btn-fontsize"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", null, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_c2 = $props.editor) == null ? void 0 : _c2.panels["ddei-core-btn-addfontsize"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, addValue: 1, attrCode: "font.size", img: "icon-add-fontsize", extcls: "magtop-2" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", null, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_d2 = $props.editor) == null ? void 0 : _d2.panels["ddei-core-btn-addfontsize"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, addValue: -1, attrCode: "font.size", img: "icon-reduce-fontsize", extcls: "magtop-1" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", null, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_e2 = $props.editor) == null ? void 0 : _e2.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", supportQuickEdit: false, attrCode: "textStyle.align", img: "icon-text-align-left", extcls: "magtop-1", unSelectValue: 2 }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", null, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_f = $props.editor) == null ? void 0 : _f.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "2", supportQuickEdit: false, attrCode: "textStyle.align", img: "icon-font-align", extcls: "magtop-1", unSelectValue: 2 }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", null, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_g = $props.editor) == null ? void 0 : _g.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "3", supportQuickEdit: false, attrCode: "textStyle.align", img: "icon-text-align-right", extcls: "magtop-1", unSelectValue: 2 }, null, 8, ["editor", "controlDefine"])) ]) ]), vue.createElementVNode("div", _hoisted_6$m, [ vue.createElementVNode("div", _hoisted_7$k, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_h = $props.editor) == null ? void 0 : _h.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", attrCode: "textStyle.bold", img: "icon-bold" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_8$g, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_i = $props.editor) == null ? void 0 : _i.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", attrCode: "textStyle.italic", img: "icon-font-italic" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_9$f, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_j = $props.editor) == null ? void 0 : _j.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", attrCode: "textStyle.underline", img: "icon-text-underline", extcls: "ext-underline" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_10$9, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_k = $props.editor) == null ? void 0 : _k.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, electedValue: "1", attrCode: "textStyle.deleteline", img: "icon-font-deleteline" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_11$9, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_l = $props.editor) == null ? void 0 : _l.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", onlyQuickEdit: true, attrCode: "textStyle.subtype", img: "icon-text-subtype-1", extcls: "magtop-1" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_12$6, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_m = $props.editor) == null ? void 0 : _m.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "2", onlyQuickEdit: true, attrCode: "textStyle.subtype", img: "icon-text-subtype-2", extcls: "magtop-1" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_13$5, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_n = $props.editor) == null ? void 0 : _n.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "3", onlyQuickEdit: true, attrCode: "textStyle.subtype", img: "icon-text-subtype-3", extcls: "magtop-1" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_14$4, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_o = $props.editor) == null ? void 0 : _o.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "textStyle.bgcolor", img: "icon-fill" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_15$3, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_p = $props.editor) == null ? void 0 : _p.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "font.color", img: "icon-font" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", null, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_q = $props.editor) == null ? void 0 : _q.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", supportQuickEdit: false, attrCode: "textStyle.valign", img: "icon-text-align-left", extcls: "rotate-90", unSelectValue: 2 }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", null, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_r = $props.editor) == null ? void 0 : _r.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "2", supportQuickEdit: false, attrCode: "textStyle.valign", img: "icon-font-align", extcls: "rotate-90", unSelectValue: 2 }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", null, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_s = $props.editor) == null ? void 0 : _s.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "3", supportQuickEdit: false, attrCode: "textStyle.valign", img: "icon-text-align-right", extcls: "rotate-90", unSelectValue: 2 }, null, 8, ["editor", "controlDefine"])) ]) ]) ]), vue.createElementVNode("div", _hoisted_16$2, vue.toDisplayString($props.editor.i18n("ddei.textEdit")), 1) ]); } const FontAndText = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["render", _sfc_render$15], ["__scopeId", "data-v-84f4d012"]]); const _DDeiCoreFontAndTextPanel = class _DDeiCoreFontAndTextPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", FontAndText.name); __publicField3(this, "plugins", [FontAndText]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[FontAndText.name]) { for (let i2 in options[FontAndText.name]) { newOptions[i2] = options[FontAndText.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreFontAndTextPanel(newOptions); return panels; } } return _DDeiCoreFontAndTextPanel; } static modify(fn) { return _DDeiCoreFontAndTextPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreFontAndTextPanel, "defaultIns", new _DDeiCoreFontAndTextPanel(null)); let DDeiCoreFontAndTextPanel = _DDeiCoreFontAndTextPanel; const _sfc_main$14 = { name: "ddei-core-panel-operate", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { hasClipData: false, displayBrush: false, canEdit: true }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3; let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds }, this.editor.ddInstance); if (rsState == -1) { this.canEdit = false; } this.hasClipboard(); this.isDisplayBrush(); }, methods: { /** * 执行剪切 */ execShearAction(evt) { var _a3, _b2; (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.hotkeys["ddei-core-keyaction-cut"]) == null ? void 0 : _b2.action(evt, this.editor.ddInstance, this.editor); }, /** * 执行复制 */ execCopyAction(evt) { var _a3, _b2; (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.hotkeys["ddei-core-keyaction-copy"]) == null ? void 0 : _b2.action(evt, this.editor.ddInstance, this.editor); }, /** * 执行格式刷 */ execBrushAction(evt) { var _a3, _b2; (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.hotkeys["ddei-core-keyaction-brush-data"]) == null ? void 0 : _b2.action(evt, this.editor.ddInstance, this.editor); }, /** * 判定是否显示格式刷 */ isDisplayBrush() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; this.displayBrush = false; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) == 1) { let model = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() )[0]; if (model.baseModelType == "DDeiTable") { let selectedCells = model.getSelectedCells(); if ((selectedCells == null ? void 0 : selectedCells.length) > 0) { this.displayBrush = true; } } else { this.displayBrush = true; } } }, /** * 检查剪切板中是否有内容 */ async hasClipboard() { var _a3, _b2, _c2; this.hasClipData = false; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.copyMode) { this.hasClipData = true; } else { let hasFocus = document.hasFocus(); if (hasFocus) { try { if (!DDeiUtil.isSafari()) { if (DDeiConfig.ALLOW_CLIPBOARD) { let items = await navigator.clipboard.read(); if ((items == null ? void 0 : items.length) > 0) { this.hasClipData = true; } } } } catch (e) { } } } } } }; const Operate_vue_vue_type_style_index_0_scoped_fc2f1000_lang = ""; const _hoisted_1$13 = { class: "ddei-core-panel-operate" }; const _hoisted_2$M = { class: "content" }; const _hoisted_3$I = { class: "part" }; const _hoisted_4$x = ["title"]; const _hoisted_5$q = { class: "text" }; const _hoisted_6$l = { class: "part" }; const _hoisted_7$j = ["title"]; const _hoisted_8$f = { class: "text" }; const _hoisted_9$e = { class: "part" }; const _hoisted_10$8 = ["title"]; const _hoisted_11$8 = { class: "text" }; const _hoisted_12$5 = { class: "part" }; const _hoisted_13$4 = ["title"]; const _hoisted_14$3 = { class: "text" }; const _hoisted_15$2 = { class: "tail" }; function _sfc_render$14(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E; return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$13, [ _cache[7] || (_cache[7] = vue.createElementVNode("div", { class: "header" }, null, -1)), vue.createElementVNode("div", _hoisted_2$M, [ vue.createElementVNode("div", _hoisted_3$I, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--selected": ((_c2 = (_b2 = (_a3 = $props.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.copyMode) == "cut", "button-v": ((_g = (_f = (_e2 = (_d2 = $props.editor) == null ? void 0 : _d2.ddInstance) == null ? void 0 : _e2.stage) == null ? void 0 : _f.selectedModels) == null ? void 0 : _g.size) > 0, "button-v--disabled": !$data.canEdit || ((_k = (_j = (_i = (_h = $props.editor) == null ? void 0 : _h.ddInstance) == null ? void 0 : _i.stage) == null ? void 0 : _j.selectedModels) == null ? void 0 : _k.size) == 0 || !((_n = (_m = (_l = $props.editor) == null ? void 0 : _l.ddInstance) == null ? void 0 : _m.stage) == null ? void 0 : _n.selectedModels) }), title: $props.editor.i18n("ddei.cut"), onClick: _cache[0] || (_cache[0] = ($event) => { var _a4, _b3, _c3, _d3; return $data.canEdit && ((_d3 = (_c3 = (_b3 = (_a4 = $props.editor) == null ? void 0 : _a4.ddInstance) == null ? void 0 : _b3.stage) == null ? void 0 : _c3.selectedModels) == null ? void 0 : _d3.size) > 0 && $options.execShearAction($event); }) }, [ _cache[3] || (_cache[3] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-cut" }) ], -1)), vue.createElementVNode("div", _hoisted_5$q, vue.toDisplayString($props.editor.i18n("ddei.cut")), 1) ], 10, _hoisted_4$x) ]), vue.createElementVNode("div", _hoisted_6$l, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--selected": ((_q = (_p = (_o = $props.editor) == null ? void 0 : _o.ddInstance) == null ? void 0 : _p.stage) == null ? void 0 : _q.copyMode) == "copy", "button-v": ((_u = (_t = (_s = (_r = $props.editor) == null ? void 0 : _r.ddInstance) == null ? void 0 : _s.stage) == null ? void 0 : _t.selectedModels) == null ? void 0 : _u.size) > 0, "button-v--disabled": ((_y = (_x = (_w = (_v = $props.editor) == null ? void 0 : _v.ddInstance) == null ? void 0 : _w.stage) == null ? void 0 : _x.selectedModels) == null ? void 0 : _y.size) == 0 || !((_B = (_A = (_z = $props.editor) == null ? void 0 : _z.ddInstance) == null ? void 0 : _A.stage) == null ? void 0 : _B.selectedModels) }), title: $props.editor.i18n("ddei.new"), onClick: _cache[1] || (_cache[1] = ($event) => { var _a4, _b3, _c3, _d3; return ((_d3 = (_c3 = (_b3 = (_a4 = $props.editor) == null ? void 0 : _a4.ddInstance) == null ? void 0 : _b3.stage) == null ? void 0 : _c3.selectedModels) == null ? void 0 : _d3.size) > 0 && $options.execCopyAction($event); }) }, [ _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-copy-file" }) ], -1)), vue.createElementVNode("div", _hoisted_8$f, vue.toDisplayString($props.editor.i18n("ddei.copy")), 1) ], 10, _hoisted_7$j) ]), vue.createElementVNode("div", _hoisted_9$e, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v": $data.hasClipData, "button-v--disabled": !$data.canEdit || !$data.hasClipData }), title: $props.editor.i18n("ddei.paste") }, [ _cache[5] || (_cache[5] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-paste" }) ], -1)), vue.createElementVNode("div", _hoisted_11$8, vue.toDisplayString($props.editor.i18n("ddei.paste")), 1) ], 10, _hoisted_10$8) ]), vue.createElementVNode("div", _hoisted_12$5, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--selected": $data.canEdit && ((_E = (_D = (_C = $props.editor) == null ? void 0 : _C.ddInstance) == null ? void 0 : _D.stage) == null ? void 0 : _E.brushData), "button-v": $data.canEdit && $data.displayBrush, "button-v--disabled": !$data.canEdit || !$data.displayBrush }), title: $props.editor.i18n("ddei.brush"), onClick: _cache[2] || (_cache[2] = ($event) => { var _a4, _b3, _c3, _d3; return $data.canEdit && ((_d3 = (_c3 = (_b3 = (_a4 = $props.editor) == null ? void 0 : _a4.ddInstance) == null ? void 0 : _b3.stage) == null ? void 0 : _c3.selectedModels) == null ? void 0 : _d3.size) == 1 && $options.execBrushAction($event); }) }, [ _cache[6] || (_cache[6] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-brush" }) ], -1)), vue.createElementVNode("div", _hoisted_14$3, vue.toDisplayString($props.editor.i18n("ddei.brush")), 1) ], 10, _hoisted_13$4) ]) ]), vue.createElementVNode("div", _hoisted_15$2, vue.toDisplayString($props.editor.i18n("ddei.cutBoard")), 1) ]); } const Operate = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["render", _sfc_render$14], ["__scopeId", "data-v-fc2f1000"]]); const _DDeiCoreOperatePanel = class _DDeiCoreOperatePanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Operate.name); __publicField3(this, "plugins", [Operate]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[Operate.name]) { for (let i2 in options[Operate.name]) { newOptions[i2] = options[Operate.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreOperatePanel(newOptions); return panels; } } return _DDeiCoreOperatePanel; } static modify(fn) { return _DDeiCoreOperatePanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreOperatePanel, "defaultIns", new _DDeiCoreOperatePanel(null)); let DDeiCoreOperatePanel = _DDeiCoreOperatePanel; const _sfc_main$13 = { name: "ddei-core-panel-sort", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { dialogShow: "", canEdit: true }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3; let mds = [this.editor.currentStage]; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds }, this.editor.ddInstance); if (rsState == -1) { this.canEdit = false; } }, methods: { /** * 显示弹出框 */ showPositionDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-changeposition", { group: "top-dialog" }, { type: 5 }, srcElement); }, showAlignDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-align", { group: "top-dialog" }, { type: 5 }, srcElement); }, showMergeDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-mergecompose", { group: "top-dialog" }, { type: 5 }, srcElement); }, showRotateDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-changerotate", { group: "top-dialog" }, { type: 5 }, srcElement); }, /** * 对齐按钮是否显示 */ isButtonEnable(num = 1) { var _a3, _b2; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_b2 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _b2.size) >= num) { return true; } return false; } } }; const Sort_vue_vue_type_style_index_0_scoped_9f739241_lang = ""; const _hoisted_1$12 = { class: "ddei-core-panel-sort" }; const _hoisted_2$L = { class: "content" }; const _hoisted_3$H = { class: "part" }; const _hoisted_4$w = { class: "text" }; const _hoisted_5$p = { class: "part" }; const _hoisted_6$k = { class: "text" }; const _hoisted_7$i = { class: "part" }; const _hoisted_8$e = { class: "text" }; const _hoisted_9$d = { class: "part" }; const _hoisted_10$7 = { class: "text" }; const _hoisted_11$7 = { class: "tail" }; function _sfc_render$13(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$12, [ _cache[12] || (_cache[12] = vue.createElementVNode("div", { class: "header" }, null, -1)), vue.createElementVNode("div", _hoisted_2$L, [ vue.createElementVNode("div", _hoisted_3$H, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--disabled": !$data.canEdit || !$options.isButtonEnable(), "button-v--selected": $data.canEdit && $options.isButtonEnable() && $data.dialogShow == "ddei-core-panel-sort-ddei-core-dialog-changeposition", "button-v": $data.canEdit && $options.isButtonEnable() }), onClick: _cache[0] || (_cache[0] = ($event) => $data.canEdit && $options.isButtonEnable() && $options.showPositionDialog($event)) }, [ _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-position" }) ], -1)), vue.createElementVNode("div", _hoisted_4$w, vue.toDisplayString($props.editor.i18n("ddei.position")), 1), _cache[5] || (_cache[5] = vue.createElementVNode("svg", { class: "icon extbtn", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1)) ], 2) ]), vue.createElementVNode("div", _hoisted_5$p, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--disabled": !$data.canEdit || !$options.isButtonEnable(2), "button-v--selected": $data.canEdit && $options.isButtonEnable(2) && $data.dialogShow == "ddei-core-panel-sort-align-dialog", "button-v": $data.canEdit && $options.isButtonEnable(2) }), onClick: _cache[1] || (_cache[1] = ($event) => $data.canEdit && $options.isButtonEnable(2) && $options.showAlignDialog($event)) }, [ _cache[6] || (_cache[6] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-align" }) ], -1)), vue.createElementVNode("div", _hoisted_6$k, vue.toDisplayString($props.editor.i18n("ddei.align")), 1), _cache[7] || (_cache[7] = vue.createElementVNode("svg", { class: "icon extbtn", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1)) ], 2) ]), vue.createElementVNode("div", _hoisted_7$i, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--disabled": !$data.canEdit || !$options.isButtonEnable(), "button-v--selected": $data.canEdit && $options.isButtonEnable() && $data.dialogShow == "ddei-core-panel-sort-merge-dialog", "button-v": $data.canEdit && $options.isButtonEnable() }), onClick: _cache[2] || (_cache[2] = ($event) => $data.canEdit && $options.isButtonEnable() && $options.showMergeDialog($event)) }, [ _cache[8] || (_cache[8] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-merge1" }) ], -1)), vue.createElementVNode("div", _hoisted_8$e, vue.toDisplayString($props.editor.i18n("ddei.combina")), 1), _cache[9] || (_cache[9] = vue.createElementVNode("svg", { class: "icon extbtn", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1)) ], 2) ]), vue.createElementVNode("div", _hoisted_9$d, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--disabled": !$data.canEdit || !$options.isButtonEnable(), "button-v--selected": $data.canEdit && $options.isButtonEnable() && $data.dialogShow == "ddei-core-panel-sort-ddei-core-dialog-changerotate", "button-v": $data.canEdit && $options.isButtonEnable() }), onClick: _cache[3] || (_cache[3] = ($event) => $data.canEdit && $options.isButtonEnable() && $options.showRotateDialog($event)) }, [ _cache[10] || (_cache[10] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-flip" }) ], -1)), vue.createElementVNode("div", _hoisted_10$7, vue.toDisplayString($props.editor.i18n("ddei.flip")), 1), _cache[11] || (_cache[11] = vue.createElementVNode("svg", { class: "icon extbtn", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1)) ], 2) ]) ]), vue.createElementVNode("div", _hoisted_11$7, vue.toDisplayString($props.editor.i18n("ddei.sortAndAlign")), 1) ]); } const Sort = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["render", _sfc_render$13], ["__scopeId", "data-v-9f739241"]]); const _DDeiCoreSortPanel = class _DDeiCoreSortPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Sort.name); __publicField3(this, "plugins", [Sort]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[Sort.name]) { for (let i2 in options[Sort.name]) { newOptions[i2] = options[Sort.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreSortPanel(newOptions); return panels; } } return _DDeiCoreSortPanel; } static modify(fn) { return _DDeiCoreSortPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSortPanel, "defaultIns", new _DDeiCoreSortPanel(null)); let DDeiCoreSortPanel = _DDeiCoreSortPanel; const _sfc_main$12 = { name: "ddei-core-panel-quickstyle", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { }, mounted() { } }; const Style_vue_vue_type_style_index_0_scoped_109430c5_lang = ""; const _hoisted_1$11 = { class: "ddei-core-panel-quickstyle" }; const _hoisted_2$K = { class: "ddei-core-panel-quickstyle-item", style: { "grid-column": "1/16" } }; const _hoisted_3$G = { class: "ddei-core-panel-quickstyle-item-text" }; function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$11, [ _cache[0] || (_cache[0] = vue.createStaticVNode('
Abc
Abc
Abc
Abc
Abc
Abc
Abc
Abc
', 4)), vue.createElementVNode("div", _hoisted_2$K, [ vue.createElementVNode("div", _hoisted_3$G, vue.toDisplayString(_ctx.editor.i18n("ddei.style")), 1) ]) ]); } const Style = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$12], ["__scopeId", "data-v-109430c5"]]); const _DDeiCoreStylePanel = class _DDeiCoreStylePanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Style.name); __publicField3(this, "plugins", [Style]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[Style.name]) { for (let i2 in options[Style.name]) { newOptions[i2] = options[Style.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreStylePanel(newOptions); return panels; } } return _DDeiCoreStylePanel; } static modify(fn) { return _DDeiCoreStylePanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreStylePanel, "defaultIns", new _DDeiCoreStylePanel(null)); let DDeiCoreStylePanel = _DDeiCoreStylePanel; const _sfc_main$11 = { name: "ddei-core-panel-tool", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { canEdit: true }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3; let mds = [this.editor.currentStage]; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds }, this.editor.ddInstance); if (rsState == -1) { this.canEdit = false; } }, methods: { /** * 修改当前编辑器的编辑模式 */ changeEditMode(mode) { this.editor.bus.push(DDeiEditorEnumBusCommandType.ChangeEditMode, { mode }); this.editor.bus.executeAll(); this.editor.changeState(DDeiEditorState.DESIGNING); } } }; const Tool_vue_vue_type_style_index_0_scoped_d02823f2_lang = ""; const _hoisted_1$10 = { class: "ddei-core-panel-tool" }; const _hoisted_2$J = { class: "content" }; const _hoisted_3$F = { class: "part" }; const _hoisted_4$v = ["title"]; const _hoisted_5$o = { class: "text" }; const _hoisted_6$j = { class: "part" }; const _hoisted_7$h = ["title"]; const _hoisted_8$d = { class: "text" }; const _hoisted_9$c = { class: "part" }; const _hoisted_10$6 = ["title"]; const _hoisted_11$6 = { class: "text" }; const _hoisted_12$4 = { class: "tail" }; function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f; return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$10, [ _cache[6] || (_cache[6] = vue.createElementVNode("div", { class: "header" }, null, -1)), vue.createElementVNode("div", _hoisted_2$J, [ vue.createElementVNode("div", _hoisted_3$F, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--selected": ((_a3 = $props.editor) == null ? void 0 : _a3.editMode) == 1, "button-v": ((_b2 = $props.editor) == null ? void 0 : _b2.editMode) != 1 }), title: $props.editor.i18n("ddei.choose"), onClick: _cache[0] || (_cache[0] = ($event) => $options.changeEditMode(1)) }, [ _cache[3] || (_cache[3] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-selector" }) ], -1)), vue.createElementVNode("div", _hoisted_5$o, vue.toDisplayString($props.editor.i18n("ddei.choose")), 1) ], 10, _hoisted_4$v) ]), vue.createElementVNode("div", _hoisted_6$j, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--selected": ((_c2 = $props.editor) == null ? void 0 : _c2.editMode) == 2, "button-v": ((_d2 = $props.editor) == null ? void 0 : _d2.editMode) != 2 }), title: $props.editor.i18n("ddei.moveStage"), onClick: _cache[1] || (_cache[1] = ($event) => $options.changeEditMode(2)) }, [ _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-hand" }) ], -1)), vue.createElementVNode("div", _hoisted_8$d, vue.toDisplayString($props.editor.i18n("ddei.moveStage")), 1) ], 10, _hoisted_7$h) ]), vue.createElementVNode("div", _hoisted_9$c, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "button-v--selected": $data.canEdit && ((_e2 = $props.editor) == null ? void 0 : _e2.editMode) == 4, "button-v": $data.canEdit && ((_f = $props.editor) == null ? void 0 : _f.editMode) != 4, "button-v--disabled": !$data.canEdit }), title: $props.editor.i18n("ddei.linkLine"), onClick: _cache[2] || (_cache[2] = ($event) => $data.canEdit && $options.changeEditMode(4)) }, [ _cache[5] || (_cache[5] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-link-line" }) ], -1)), vue.createElementVNode("div", _hoisted_11$6, vue.toDisplayString($props.editor.i18n("ddei.linkLine")), 1) ], 10, _hoisted_10$6) ]) ]), vue.createElementVNode("div", _hoisted_12$4, vue.toDisplayString($props.editor.i18n("ddei.tools")), 1) ]); } const Tool = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$11], ["__scopeId", "data-v-d02823f2"]]); const _DDeiCoreToolPanel = class _DDeiCoreToolPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Tool.name); __publicField3(this, "plugins", [Tool]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[Tool.name]) { for (let i2 in options[Tool.name]) { newOptions[i2] = options[Tool.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreToolPanel(newOptions); return panels; } } return _DDeiCoreToolPanel; } static modify(fn) { return _DDeiCoreToolPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreToolPanel, "defaultIns", new _DDeiCoreToolPanel(null)); let DDeiCoreToolPanel = _DDeiCoreToolPanel; const _DDeiCoreCommonPanels = class _DDeiCoreCommonPanels extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ DDeiCoreExportAndImportPanel, DDeiCoreFileInfoPanel, DDeiCoreFileOperatePanel, DDeiCoreFontAndTextPanel, DDeiCoreOperatePanel, DDeiCoreOperatePanel, DDeiCoreSortPanel, DDeiCoreStylePanel, DDeiCoreToolPanel ]); } getPanels(editor) { var _a3; let panels = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getPanels(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getPanels(editor); } if ((ls == null ? void 0 : ls.length) > 0) { panels = panels.concat(ls); } }); return panels; } static configuration(options) { var _a3; if (options) { let panels = new _DDeiCoreCommonPanels(options); for (let i2 = 0; i2 < ((_a3 = panels.plugins) == null ? void 0 : _a3.length); i2++) { panels.plugins[i2] = panels.plugins[i2].configuration(options, true); } return panels; } return _DDeiCoreCommonPanels; } static modify(fn) { return _DDeiCoreCommonPanels.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreCommonPanels, "defaultIns", new _DDeiCoreCommonPanels(null)); let DDeiCoreCommonPanels = _DDeiCoreCommonPanels; const _sfc_main$10 = { name: "ddei-core-panel-bottom-shapecount", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { }, mounted() { } }; const ShapeCount_vue_vue_type_style_index_0_scoped_91252de3_lang = ""; const _hoisted_1$$ = { class: "ddei-core-panel-bottom-shapecount" }; function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2; return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$$, vue.toDisplayString($props.editor.i18n("ddei.shapesCount")) + " " + vue.toDisplayString((_c2 = (_b2 = $props.editor) == null ? void 0 : _b2.files[(_a3 = $props.editor) == null ? void 0 : _a3.currentFileIndex]) == null ? void 0 : _c2.modelNumber), 1); } const ShapeCount = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$10], ["__scopeId", "data-v-91252de3"]]); const _DDeiCoreShapeCountPanel = class _DDeiCoreShapeCountPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ShapeCount.name); __publicField3(this, "plugins", [ShapeCount]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ShapeCount.name]) { for (let i2 in options[ShapeCount.name]) { newOptions[i2] = options[ShapeCount.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreShapeCountPanel(newOptions); return panels; } } return _DDeiCoreShapeCountPanel; } static modify(fn) { return _DDeiCoreShapeCountPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreShapeCountPanel, "defaultIns", new _DDeiCoreShapeCountPanel(null)); let DDeiCoreShapeCountPanel = _DDeiCoreShapeCountPanel; const _sfc_main$$ = { name: "ddei-core-panel-bottom-managelayers", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { allowOpenMultLayers: true }; }, computed: {}, watch: {}, created() { }, mounted() { this.allowOpenMultLayers = DDeiEditorUtil.getConfigValue( "GLOBAL_ALLOW_OPEN_MULT_LAYERS", this.editor ); }, methods: { showLayersDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-managerlayers", { group: "bottom-dialog" }, { type: 3 }, srcElement); if (DDeiEditor.ACTIVE_INSTANCE.tempDialogData && DDeiEditor.ACTIVE_INSTANCE.tempDialogData["ddei-core-dialog-managerlayers"]) { this.editor.changeState(DDeiEditorState.PROPERTY_EDITING); } else { this.editor.changeState(DDeiEditorState.DESIGNING); } } } }; const ManageLayers_vue_vue_type_style_index_0_scoped_e3adc5da_lang = ""; function _sfc_render$$(_ctx, _cache, $props, $setup, $data, $options) { return $data.allowOpenMultLayers ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "ddei-core-panel-bottom-managelayers", onClick: _cache[0] || (_cache[0] = ($event) => $options.showLayersDialog($event)) }, _cache[1] || (_cache[1] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-layers" }) ], -1) ]))) : vue.createCommentVNode("", true); } const ManageLayers = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$$], ["__scopeId", "data-v-e3adc5da"]]); const _DDeiCoreManageLayersPanel = class _DDeiCoreManageLayersPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ManageLayers.name); __publicField3(this, "plugins", [ManageLayers]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ManageLayers.name]) { for (let i2 in options[ManageLayers.name]) { newOptions[i2] = options[ManageLayers.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreManageLayersPanel(newOptions); return panels; } } return _DDeiCoreManageLayersPanel; } static modify(fn) { return _DDeiCoreManageLayersPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreManageLayersPanel, "defaultIns", new _DDeiCoreManageLayersPanel(null)); let DDeiCoreManageLayersPanel = _DDeiCoreManageLayersPanel; const _sfc_main$_ = { name: "ddei-core-panel-bottom-play", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { }, mounted() { }, methods: {} }; const Play_vue_vue_type_style_index_0_scoped_7e2fc5b7_lang = ""; const _hoisted_1$_ = { class: "ddei-core-panel-bottom-play" }; function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$_, _cache[0] || (_cache[0] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-play" }) ], -1) ])); } const Play = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$_], ["__scopeId", "data-v-7e2fc5b7"]]); const _DDeiCorePlayPanel = class _DDeiCorePlayPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Play.name); __publicField3(this, "plugins", [Play]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[Play.name]) { for (let i2 in options[Play.name]) { newOptions[i2] = options[Play.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCorePlayPanel(newOptions); return panels; } } return _DDeiCorePlayPanel; } static modify(fn) { return _DDeiCorePlayPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCorePlayPanel, "defaultIns", new _DDeiCorePlayPanel(null)); let DDeiCorePlayPanel = _DDeiCorePlayPanel; const stage = { "id": "DDeiStage", "name": "ddei.control.stage", "code": "stage", "desc": "整体画布的属性", "type": "DDeiStage", /** * 定义组件属性 * 样式属性会影响图形的显示,修改样式属性也会刷新图形 * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 * 事件属性一般用来作为扩展用 * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) * 特殊属性: * code属性编码在统一个组中,code唯一 * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row */ attrs: [ { "code": "paper.type", "name": "ddei.property.paperType", "desc": "用来快速选择纸张的类型,以便于套用相关的样式", "controlType": "combox", "dataType": "string", "dataSource": { "type": "config", "data": "PAPER_DATASOURCE", "text": "name", "value": "code", "desc": "desc" }, "canSearch": false, "itemStyle": { width: 170, align: "left", paddingLeft: "10px", height: 25, col: 1, row: 8, imgWidth: 20, imgHeight: 20 }, "defaultValue": "A4", "cascadeDisplay": { "ddei.property.ds.none": { hidden: ["paper.direct", "paper.width", "paper.height", "paper.unit"] }, "ddei.property.ds.custom": { show: ["paper.direct", "paper.width", "paper.height", "paper.unit"] }, notempty: { show: ["paper.direct"], hidden: ["paper.width", "paper.height", "paper.unit"] }, empty: { hidden: ["paper.width", "paper.height", "paper.unit"] }, default: { hidden: ["paper.width", "paper.height", "paper.unit"] } }, "type": 1 }, { "code": "paper.width", "name": "ddei.property.width", "desc": "用来设置纸张的宽度,以便于套用相关的样式", "controlType": "text", "dataType": "integer", "defaultValue": 210, "type": 1 }, { "code": "paper.height", "name": "ddei.property.height", "desc": "用来设置纸张的高度,以便于套用相关的样式", "controlType": "text", "dataType": "integer", "defaultValue": 297, "type": 1 }, { "code": "paper.unit", "name": "ddei.property.unit", "desc": "用来设置纸张的宽高单位,以便于套用相关的样式", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.mm", "value": "mm" }, { "text": "ddei.property.ds.cm", "value": "cm" }, { "text": "ddei.property.ds.m", "value": "m" }, { "text": "ddei.property.ds.inch", "value": "inch" }, { "text": "ddei.property.ds.px", "value": "px" }], "defaultValue": "mm" }, { "code": "paper.direct", "name": "ddei.property.direct", "desc": "用来设置纸张的方向,以便于套用相关的样式", "controlType": "radio", "dataSource": [{ "text": "ddei.property.ds.transverse", "value": 1 }, { "text": "ddei.property.ds.portrait", "value": 2 }], "dataType": "integer", "defaultValue": 2, "type": 1 }, { "code": "mark.type", "name": "ddei.property.markType", "desc": "用来快速选择水印的类型,以便于套用相关的样式", "controlType": "radio", "dataSource": [{ "text": "ddei.property.ds.none", "value": 0 }, { "text": "ddei.property.ds.text", "value": 1 }, { "text": "ddei.property.ds.image", "value": 2 }], "dataType": "integer", "defaultValue": 0, "hiddenTitle": true, "display": "column", "cascadeDisplay": { 1: { show: ["mark.data", "mark.direct", "mark.opacity", "mark.font.family", "mark.font.size", "mark.font.color"] }, 2: { show: ["mark.data", "mark.direct", "mark.opacity"], hidden: ["mark.font.family", "mark.font.size", "mark.font.color"] }, empty: { hidden: ["mark.data", "mark.direct", "mark.opacity", "mark.font.family", "mark.font.size", "mark.font.color"] } }, "mapping": [], "type": 1 }, { "code": "mark.data", "name": "ddei.property.mark", "desc": "当水印类型为1时,此字段将显示文本,当类行为2时,此字段显示为图片", "controlType": "image", "dataType": "string", "defaultValue": "", "type": 1 }, { "code": "mark.direct", "name": "ddei.property.markDirect", "desc": "水印的显示方向", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.ltrd", "value": "1" }, { "text": "ddei.property.ds.rtld", "value": "2" }, { "text": "ddei.property.ds.horizontal", "value": "3" }], "defaultValue": "1", "type": 1 }, { "code": "mark.opacity", "name": "ddei.property.opacity", "desc": "透明度,0完全透明~1完全不透明", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "dataType": "float", "defaultValue": 0.25, "display": "column" }, { "code": "mark.font.family", "name": "ddei.property.font", "desc": "文本的字体名称", "controlType": "combox", "dataType": "string", "dataSource": { "type": "config", "data": "fonts", "text": "ch", "value": "en", "bold": "isSystemDefault", "fontFamily": "en" }, "itemStyle": { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, "canSearch": true, "defaultValue": "" }, { "code": "mark.font.size", "name": "ddei.property.size", "desc": "文本的字体大小", "max": 50, "min": 5, "step": 0.5, "controlType": "font-size", "dataType": "float", "defaultValue": 14 }, { "code": "mark.font.color", "name": "ddei.property.color", "desc": "文本的颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "" }, { "code": "ruler.display", "name": "ddei.property.ruler", "desc": "是否显示标尺", "controlType": "switch-checkbox", "dataType": "integer", "defaultValue": 1, "display": "column", "hiddenTitle": true, "type": 1, "cascadeDisplay": { 1: { show: ["ruler.unit"] }, default: { show: ["ruler.unit"] }, empty: { hidden: ["ruler.unit"] } } }, { "code": "ruler.unit", "name": "ddei.property.unit", "desc": "用来设置标尺单位样式", "controlType": "combox", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.mm", "value": "mm" }, { "text": "ddei.property.ds.cm", "value": "cm" }, { "text": "ddei.property.ds.m", "value": "m" }, { "text": "ddei.property.ds.inch", "value": "inch" }, { "text": "ddei.property.ds.px", "value": "px" }], "itemStyle": { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, "defaultValue": "mm", "type": 1 }, { "code": "grid.display", "name": "ddei.property.grid", "desc": "设置网格线样式", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.none", "value": "0" }, { "text": "ddei.property.ds.line", "value": "1" }, { "text": "ddei.property.ds.point", "value": "2" }], "defaultValue": "1", "type": 1 }, { "code": "global.jumpline", "name": "ddei.property.jumpline", "desc": "遇到线交叉时,展示跳线", "controlType": "switch-checkbox", "dataType": "integer", "defaultValue": 1, "type": 1, "display": "column", "hiddenTitle": true } ], /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-setting", subGroups: [ { name: "ddei.paper", attrs: ["paper.type", "paper.width", "paper.height", "paper.unit", "paper.direct"] }, { name: "ddei.mark", attrs: ["mark.type", "mark.data", "mark.direct", "mark.opacity", "mark.font.family", "mark.font.size", "mark.font.color"] }, { name: "ddei.assistant", attrs: ["ruler.display", "ruler.unit", "grid.display", "global.jumpline"] } ] } ] }; const __vite_glob_0_99$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: stage }, Symbol.toStringTag, { value: "Module" })); const _sfc_main$Z = { name: "ddei-core-panel-bottom-suitratio", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { allowStageRatio: true, currentStage: null }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2; this.allowStageRatio = DDeiEditorUtil.getConfigValue( "GLOBAL_ALLOW_STAGE_RATIO", this.editor ); let file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; this.currentStage = sheet == null ? void 0 : sheet.stage; }, methods: { /** * 自动设置页面模式, */ autoRatio(type) { if (type == 1) { let maxOutRect = DDeiAbstractShape.getOutRectByPV( this.editor.ddInstance.stage.getLayerModels() ); if (maxOutRect.width > 0 && maxOutRect.height > 0) { let canvas = this.editor.ddInstance.render.canvas; let rat1 = this.editor.ddInstance.render.ratio; let stageRatio2 = this.currentStage.getStageRatio(); let hscrollWeight = 0; let vscrollWeight = 0; if (this.editor.ddInstance.stage.render.hScroll) { hscrollWeight = 15; } if (this.editor.ddInstance.stage.render.vScroll) { vscrollWeight = 15; } let ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState( this.editor.ddInstance.stage, "ruler.display", true ); let ruleWeight = 0; if (ruleDisplay == 1 || ruleDisplay == "1") { ruleWeight = 16; } let cWidth = canvas.width / rat1 - ruleWeight - vscrollWeight; let cHeight = canvas.height / rat1 - ruleWeight - hscrollWeight; let wScale = maxOutRect.width * stageRatio2 / cWidth; let hScale = maxOutRect.height * stageRatio2 / cHeight; let scale = wScale; if (wScale < hScale) { scale = hScale; } let sc = stageRatio2 / scale; this.setRatio(sc); setTimeout(() => { var _a3, _b2, _c2, _d2; (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.bus) == null ? void 0 : _b2.push(DDeiEnumBusCommandType.CenterStageWPV); this.editor.changeState(DDeiEditorState.DESIGNING); (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.bus) == null ? void 0 : _d2.executeAll(100); }, 10); } } }, /** * 设置缩放比率 */ setRatio(ratio) { var _a3; if (ratio < this.min) { ratio = this.min; } else if (ratio > this.max) { ratio = this.max; } (_a3 = this.currentStage) == null ? void 0 : _a3.setStageRatio(ratio); } } }; const SuitRatio_vue_vue_type_style_index_0_scoped_4eeb5012_lang = ""; const _hoisted_1$Z = ["title"]; function _sfc_render$Z(_ctx, _cache, $props, $setup, $data, $options) { return $data.allowStageRatio ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "ddei-core-panel-bottom-suitratio", onClick: _cache[0] || (_cache[0] = ($event) => $options.autoRatio(1)), title: $props.editor.i18n("ddei.wholePage") }, _cache[1] || (_cache[1] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-suit-ratio" }) ], -1) ]), 8, _hoisted_1$Z)) : vue.createCommentVNode("", true); } const SuitRatio = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$Z], ["__scopeId", "data-v-4eeb5012"]]); const _DDeiCoreSuitRatioPanel = class _DDeiCoreSuitRatioPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", SuitRatio.name); __publicField3(this, "plugins", [SuitRatio]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[SuitRatio.name]) { for (let i2 in options[SuitRatio.name]) { newOptions[i2] = options[SuitRatio.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreSuitRatioPanel(newOptions); return panels; } } return _DDeiCoreSuitRatioPanel; } static modify(fn) { return _DDeiCoreSuitRatioPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSuitRatioPanel, "defaultIns", new _DDeiCoreSuitRatioPanel(null)); let DDeiCoreSuitRatioPanel = _DDeiCoreSuitRatioPanel; const _sfc_main$Y = { name: "ddei-core-panel-bottom-changeratio", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, delta: { type: Number, default: 0.05 }, min: { type: Number, default: 0.1 }, max: { type: Number, default: 4 }, dialog: { type: Boolean, default: true }, range: { type: Boolean, default: true }, editor: { type: DDeiEditor, default: null } }, data() { return { ratioInputValue: 0, stageRatio: 1, allowStageRatio: true, currentStage: null }; }, computed: {}, watch: {}, created() { this.$watch("currentStage.ratio", function(newVal, oldVal) { if (DDeiEditorUtil.getConfigValue("GLOBAL_ALLOW_STAGE_RATIO", this.editor)) { if (oldVal && oldVal != newVal) { if (!this.changeCurrentStage) { this.ratioInputValue = parseFloat(newVal) * 100; this.stageRatio = newVal; if (!this.tempSheetChange) { this.changeRatio(); } else { delete this.tempSheetChange; } } else { this.changeCurrentStage = false; } } } }); this.$watch("stageRatio", function(newVal, oldVal) { if (DDeiEditorUtil.getConfigValue("GLOBAL_ALLOW_STAGE_RATIO", this.editor)) { this.setRatio(newVal); } }); }, mounted() { var _a3, _b2; this.editor.ddInstance.ratioWatch = true; let file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; this.currentStage = sheet == null ? void 0 : sheet.stage; this.allowStageRatio = DDeiEditorUtil.getConfigValue( "GLOBAL_ALLOW_STAGE_RATIO", this.editor ); }, methods: { showChangeRatioDialog(evt) { var _a3; let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-changeratio", { ratio: (_a3 = this.currentStage) == null ? void 0 : _a3.ratio, min: this.min, max: this.max, callback: { ok: this.setRatio }, group: "bottom-dialog" }, { type: 2 }, srcElement); if (DDeiEditor.ACTIVE_INSTANCE.tempDialogData && DDeiEditor.ACTIVE_INSTANCE.tempDialogData["ddei-core-dialog-changeratio"]) { this.editor.changeState(DDeiEditorState.PROPERTY_EDITING); } else { this.editor.changeState(DDeiEditorState.DESIGNING); } }, /** * 增加缩放比率 */ addRatio(deltaRatio) { var _a3, _b2, _c2; let ratio = (_a3 = this.currentStage) == null ? void 0 : _a3.getStageRatio(); let newRatio = parseFloat((ratio + deltaRatio).toFixed(2)); if (newRatio < this.min) { newRatio = this.min; } else if (newRatio > this.max) { newRatio = this.max; } (_b2 = this.currentStage) == null ? void 0 : _b2.setStageRatio(newRatio); this.stageRatio = (_c2 = this.currentStage) == null ? void 0 : _c2.ratio; this.editor.changeState(DDeiEditorState.DESIGNING); }, /** * 设置缩放比率 */ setRatio(ratio) { var _a3, _b2; if (ratio < this.min) { ratio = this.min; } else if (ratio > this.max) { ratio = this.max; } (_a3 = this.currentStage) == null ? void 0 : _a3.setStageRatio(ratio); this.stageRatio = (_b2 = this.currentStage) == null ? void 0 : _b2.ratio; }, /** * 修改当前的全局缩放比率 */ changeRatio() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; if (((_a3 = this.currentStage) == null ? void 0 : _a3.ratio) || ((_b2 = this.currentStage) == null ? void 0 : _b2.ratio) == 0) { if (((_c2 = this.currentStage) == null ? void 0 : _c2.oldRatio) || ((_d2 = this.currentStage) == null ? void 0 : _d2.oldRatio) == 0) { (_f = (_e2 = this.editor) == null ? void 0 : _e2.bus) == null ? void 0 : _f.push( DDeiEnumBusCommandType.ChangeStageRatio, { oldValue: this.currentStage.oldRatio, newValue: this.currentStage.ratio }, null ); (_h = (_g = this.editor) == null ? void 0 : _g.bus) == null ? void 0 : _h.executeAll(); } } } } }; const ChangeRatio_vue_vue_type_style_index_0_scoped_f8d489b0_lang = ""; const _hoisted_1$Y = { key: 0, class: "ddei-core-panel-bottom-changeratio" }; const _hoisted_2$I = { key: 0, class: "icon expbtn", "aria-hidden": "true" }; const _hoisted_3$E = { key: 0, class: "icon expbtn", "aria-hidden": "true" }; const _hoisted_4$u = ["min", "max", "step"]; function _sfc_render$Y(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2; return $data.allowStageRatio ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Y, [ $props.range ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: vue.normalizeClass({ "ddei-core-panel-bottom-changeratio__combox": true, "ddei-core-panel-bottom-changeratio__combox__dialog": $props.dialog }), onClick: _cache[0] || (_cache[0] = ($event) => $props.dialog && $options.showChangeRatioDialog($event)) }, [ vue.createElementVNode("span", null, vue.toDisplayString(parseInt(((_a3 = $data.currentStage) == null ? void 0 : _a3.ratio) * 100)) + "% ", 1), $props.dialog ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2$I, _cache[5] || (_cache[5] = [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }, null, -1) ]))) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true), vue.createElementVNode("div", { onClick: _cache[1] || (_cache[1] = ($event) => $options.addRatio(-$props.delta)) }, _cache[6] || (_cache[6] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-reduce" }) ], -1) ])), !$props.range ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: vue.normalizeClass({ "ddei-core-panel-bottom-changeratio__combox": true, "ddei-core-panel-bottom-changeratio__combox__dialog": $props.dialog }), onClick: _cache[2] || (_cache[2] = ($event) => $props.dialog && $options.showChangeRatioDialog($event)) }, [ vue.createElementVNode("span", null, vue.toDisplayString(parseInt(((_b2 = $data.currentStage) == null ? void 0 : _b2.ratio) * 100)) + "% ", 1), $props.dialog ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_3$E, _cache[7] || (_cache[7] = [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }, null, -1) ]))) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true), vue.withDirectives(vue.createElementVNode("input", { type: "range", min: $props.min, max: $props.max, step: $props.delta, "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.stageRatio = $event), autocomplete: "off", name: "ddei-core-panel-bottom-changeratio__range" }, null, 8, _hoisted_4$u), [ [vue.vShow, $props.range], [vue.vModelText, $data.stageRatio] ]), vue.createElementVNode("div", { onClick: _cache[4] || (_cache[4] = ($event) => $options.addRatio($props.delta)) }, _cache[8] || (_cache[8] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-add" }) ], -1) ])) ])) : vue.createCommentVNode("", true); } const ChangeRatio$1 = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$Y], ["__scopeId", "data-v-f8d489b0"]]); const _DDeiCoreChangeRatioPanel = class _DDeiCoreChangeRatioPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ChangeRatio$1.name); __publicField3(this, "plugins", [ChangeRatio$1]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ChangeRatio$1.name]) { for (let i2 in options[ChangeRatio$1.name]) { newOptions[i2] = options[ChangeRatio$1.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreChangeRatioPanel(newOptions); return panels; } } return _DDeiCoreChangeRatioPanel; } static modify(fn) { return _DDeiCoreChangeRatioPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreChangeRatioPanel, "defaultIns", new _DDeiCoreChangeRatioPanel(null)); let DDeiCoreChangeRatioPanel = _DDeiCoreChangeRatioPanel; const _sfc_main$X = { name: "ddei-core-panel-bottom-sheets", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, max: { type: Number, default: 0 }, drag: { type: Boolean, default: true }, create: { type: Boolean, default: true }, rename: { type: Boolean, default: true }, editor: { type: DDeiEditor, default: null } }, data() { return { file: null, maxOpenSize: 0, openIndex: 0, allowEditSheet: true //是否允许编辑页签 // sslink: null, // user: null, }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2, _c2; const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { const { width, height } = entry.contentRect; if (width != 0 && height != 0) { let pagesEles = document.getElementsByClassName("ddei-core-panel-bottom-pages"); let pageEles = document.getElementsByClassName("ddei-core-panel-bottom-pages-page"); let divWidth = 0; let pagesWidth = 1e3; if (pageEles.length > 0) { divWidth = pageEles[0].clientWidth; } if (!divWidth) { divWidth = 70; } if (pagesEles.length > 0) { pagesWidth = pagesEles[0].clientWidth; } let size = parseInt(pagesWidth / divWidth); if (size > this.maxOpenSize && this.openIndex > 0) { this.openIndex--; } this.maxOpenSize = size - 1; } } }); resizeObserver.observe(this.$refs.bottomSheets); let file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; this.changeCurrentStage = true; this.editor.currentStage = sheet == null ? void 0 : sheet.stage; this.allowEditSheet = ((_c2 = this.editor.ddInstance) == null ? void 0 : _c2.AC_DESIGN_EDIT) != false ? true : false; this.file = file; }, methods: { /** * 在存在显示隐藏的情况下移动tab */ moveItem(index = 0) { var _a3, _b2; if (index != 0) { let file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; let sheets = file == null ? void 0 : file.sheets; this.openIndex += index; if (this.openIndex > sheets.length - this.maxOpenSize) { this.openIndex = sheets.length - this.maxOpenSize; } else if (this.openIndex < 0) { this.openIndex = 0; } this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); } }, /** * sheet开始拖拽移动 */ sheetDragStart(sheetEle, evt) { this.dragSheetEle = evt.currentTarget; }, /** * 拖拽元素移动 */ sheetDragOver(e) { if (this.dragSheetEle) { let parentDiv = this.dragSheetEle.parentElement; let sourceIndex = -1; let targetIndex = -1; let children = parentDiv.children; for (let i2 = 0; i2 < children.length - 2; i2++) { children[i2].style.borderLeft = ""; children[i2].style.borderRight = ""; if (children[i2] == this.dragSheetEle) { sourceIndex = i2; } else if (e.target == children[i2]) { targetIndex = i2; } } if (sourceIndex != -1 && targetIndex != -1) { this.sourceSheetIndex = sourceIndex; if (targetIndex == children.length - 3) { let pos = DDeiUtil.getDomAbsPosition(children[targetIndex]); let halfPos = pos.left + children[targetIndex].offsetWidth / 2; if (halfPos <= e.clientX && e.clientX <= pos.left + children[targetIndex].offsetWidth) { this.changeSheetIndex = targetIndex; children[targetIndex].style.borderRight = "2px solid #017fff"; } else { this.changeSheetIndex = targetIndex - 1; children[targetIndex].style.borderLeft = "2px solid #017fff"; } } else { this.changeSheetIndex = targetIndex - 1; children[targetIndex].style.borderLeft = "2px solid #017fff"; } } e.preventDefault(); } }, /** * 拖拽元素放开 */ sheetDragDrop(e) { var _a3; if ((this.sourceSheetIndex || this.sourceSheetIndex == 0) && (this.changeSheetIndex || this.changeSheetIndex == 0)) { let file = this.editor.files[this.editor.currentFileIndex]; let sheet = file.sheets[this.sourceSheetIndex]; let currentSheet = file.sheets[file.currentSheetIndex]; file.sheets[this.sourceSheetIndex] = null; file.sheets.splice(this.changeSheetIndex + 1, 0, sheet); for (let j2 = file.sheets.length; j2 >= 0; j2--) { if (file.sheets[j2] == null) { file.sheets.splice(j2, 1); } } for (let j2 = file.sheets.length; j2 >= 0; j2--) { if (currentSheet == file.sheets[j2]) { file.currentSheetIndex = j2; } } (_a3 = this.editor.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); this.editor.bus.push(DDeiEditorEnumBusCommandType.AddFileHistroy); this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu"] }); this.editor.bus.executeAll(); this.editor.changeState(DDeiEditorState.DESIGNING); } this.dragSheetEle = null; this.sourceSheetIndex = null; this.changeSheetIndex = null; }, /** * 开始修改页标题 */ startChangeSheetName(sheet, evt) { let ele = evt.target; let domPos = DDeiUtil.getDomAbsPosition(ele); let editor = DDeiEditor.ACTIVE_INSTANCE; let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let input = document.getElementById(editor.id + "_change_sheet_name_input"); if (!input) { input = document.createElement("input"); input.setAttribute("id", editor.id + "_change_sheet_name_input"); input.style.position = "absolute"; input.style.fontSize = "16px"; editorEle.appendChild(input); input.onblur = function() { var _a3; if (input.value) { let editor2 = DDeiEditor.ACTIVE_INSTANCE; let file = editor2 == null ? void 0 : editor2.files[editor2 == null ? void 0 : editor2.currentFileIndex]; let sheet2 = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; if (input.value != sheet2.name) { sheet2.name = input.value; (_a3 = editor2.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); editor2.bus.push(DDeiEditorEnumBusCommandType.AddFileHistroy); editor2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu"] }); editor2.bus.executeAll(); editor2.changeState(DDeiEditorState.DESIGNING); } input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; } }; input.onkeydown = function(e) { var _a3; if (e.keyCode == 13) { let editor2 = DDeiEditor.ACTIVE_INSTANCE; let file = editor2 == null ? void 0 : editor2.files[editor2 == null ? void 0 : editor2.currentFileIndex]; let sheet2 = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; if (input.value != sheet2.name) { sheet2.name = input.value; (_a3 = editor2.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); editor2.bus.push(DDeiEditorEnumBusCommandType.AddFileHistroy); editor2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu"] }); editor2.bus.executeAll(); editor2.changeState(DDeiEditorState.DESIGNING); } input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; } else if (e.keyCode == 27) { let editor2 = DDeiEditor.ACTIVE_INSTANCE; input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; editor2.changeState(DDeiEditorState.DESIGNING); } }; } input.style.width = ele.offsetWidth + "px"; input.style.height = ele.offsetHeight + "px"; input.style.left = domPos.left - editorDomPos.left + "px"; input.style.top = domPos.top - editorDomPos.top + "px"; input.style.outline = "1px solid #017fff"; input.style.border = "none"; input.style.borderRadius = "1px"; input.value = sheet.name; input.style.display = "block"; input.style.background = "var(--background)"; input.style.color = "var(--text)"; input.selectionStart = 0; input.selectionEnd = input.value.length; input.focus(); this.editor.changeState(DDeiEditorState.PROPERTY_EDITING); }, /** * 创建一个sheet */ newSheet() { var _a3, _b2, _c2, _d2, _e2, _f, _g; let file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; let sheets = file == null ? void 0 : file.sheets; if (this.max && sheets.length >= this.max) { return; } let ddInstance = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance; if (file && sheets && ddInstance) { let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_SHEET_BEFORE", "ADD_SHEET", null, ddInstance, null); if (rsState != -1) { let i2 = sheets.length + 1; let stage2 = DDeiStage.initByJSON( { id: "stage" }, { currentDdInstance: ddInstance } ); let pageText = this.editor.i18n("ddei.page"); sheets.push( new DDeiSheet({ name: pageText + "-" + i2, desc: pageText + "-" + i2, stage: stage2 }) ); file.changeSheet(sheets.length - 1); ddInstance.stage.destroyRender(); ddInstance.stage = stage2; this.editor.currentStage = stage2; stage2.initRender(); if (!stage2.wpv) { stage2.wpv = { x: -(stage2.width - ddInstance.render.container.clientWidth) / 2, y: -(stage2.height - ddInstance.render.container.clientHeight) / 2, z: 0 }; } DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_SHEET_AFTER", "ADD_SHEET", null, ddInstance, null); this.editor.changeState(DDeiEditorState.DESIGNING); (_d2 = this.editor.editorViewer) == null ? void 0 : _d2.changeFileModifyDirty(); (_e2 = ddInstance.bus) == null ? void 0 : _e2.push(DDeiEditorEnumBusCommandType.AddFileHistroy); (_f = ddInstance.bus) == null ? void 0 : _f.push(DDeiEnumBusCommandType.RefreshShape); (_g = ddInstance.bus) == null ? void 0 : _g.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); DDeiEditorUtil.closeDialogs(this.editor, null, true); DDeiEditorUtil.closeDialogs(this.editor, null, false); let activeIndex = sheets.length - 1; this.openIndex = activeIndex + 1 - this.maxOpenSize; if (this.openIndex < 0) { this.openIndex = 0; } } } }, /** * 切换sheet */ changeSheet(index) { var _a3, _b2, _c2; let file = (_b2 = this.editor) == null ? void 0 : _b2.files[(_a3 = this.editor) == null ? void 0 : _a3.currentFileIndex]; let sheets = file == null ? void 0 : file.sheets; let ddInstance = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance; if (file && sheets && ddInstance && (index >= 0 || index < sheets.length)) { if (index != file.currentSheetIndex) { let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_CHANGE_SHEET_BEFORE", "CHANGE_SHEET", null, ddInstance, null); if (rsState != -1) { this.tempSheetChange = true; file.changeSheet(index); let stage2 = sheets[index].stage; stage2.ddInstance = ddInstance; ddInstance.stage.destroyRender(); ddInstance.stage = stage2; this.editor.currentStage = stage2; stage2.initRender(); DDeiEditorUtil.invokeCallbackFunc("EVENT_CHANGE_SHEET_AFTER", "CHANGE_SHEET", null, ddInstance, null); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); DDeiEditorUtil.closeDialogs(this.editor, null, true); DDeiEditorUtil.closeDialogs(this.editor, null, false); this.showPopPicker(stage2); this.editor.changeState(DDeiEditorState.DESIGNING); } } } }, showPopPicker(stage2) { var _a3; if (((_a3 = stage2.selectedModels) == null ? void 0 : _a3.size) > 0) { let models = Array.from(stage2.selectedModels.values()); if ((models == null ? void 0 : models.length) > 0) { let height = 100; let modelPos = DDeiUtil.getModelsDomAbsPosition(models); let left = modelPos.left + modelPos.width / 2; let top = modelPos.top + modelPos.height / 2; if (modelPos.top - height <= modelPos.cTop) { if (modelPos.height > 400) { top = top + height + 20; } else { top = top + modelPos.height / 2 + 20; } } else { top = top - height; } if (top < 0) { top = modelPos.cTop + modelPos.cHeight / 2; } if (left < 0) { left = 0; } DDeiEditorUtil.showDialog(this.editor, "ddei-core-dialog-quickpop", { group: "canvas-pop" }, { type: 99, left, top, hiddenMask: true }, null, true, true); } } }, /** * 显示右键菜单 */ showMenu(sheet, evt) { DDeiUtil.showContextMenu(sheet, this.editor.ddInstance, evt); evt.preventDefault(); return false; } } }; const Sheets_vue_vue_type_style_index_0_scoped_d059d47d_lang = ""; const _hoisted_1$X = { key: 0, class: "ddei-core-panel-bottom-pages-page" }; const _hoisted_2$H = ["onClick", "onContextmenu", "onDblclick", "title"]; function _sfc_render$X(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ $data.allowEditSheet && $props.create && (!$props.max || ((_d2 = (_c2 = (_b2 = $props.editor) == null ? void 0 : _b2.files[(_a3 = $props.editor) == null ? void 0 : _a3.currentFileIndex]) == null ? void 0 : _c2.sheets) == null ? void 0 : _d2.length) < $props.max) ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "ddei-core-panel-bottom-addpage", onClick: _cache[0] || (_cache[0] = (...args) => $options.newSheet && $options.newSheet(...args)) }, _cache[6] || (_cache[6] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-add" }) ], -1) ]))) : vue.createCommentVNode("", true), vue.createElementVNode("div", { class: "ddei-core-panel-bottom-pages", ref: "bottomSheets", onMouseup: _cache[5] || (_cache[5] = ($event) => $props.drag && $options.sheetDragDrop($event)) }, [ $data.maxOpenSize == 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$X, _cache[7] || (_cache[7] = [ vue.createElementVNode("span", null, null, -1) ]))) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_g = (_f = $props.editor) == null ? void 0 : _f.files[(_e2 = $props.editor) == null ? void 0 : _e2.currentFileIndex]) == null ? void 0 : _g.sheets, (sheet, index) => { return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { onMousedown: _cache[1] || (_cache[1] = ($event) => $data.allowEditSheet && $props.drag && $options.sheetDragStart(null, $event)), onClick: vue.withModifiers(($event) => $options.changeSheet(index), ["left"]), onContextmenu: vue.withModifiers(($event) => $options.showMenu(sheet, $event), ["right"]), onMousemove: _cache[2] || (_cache[2] = ($event) => $props.drag && $options.sheetDragOver($event)), onDblclick: ($event) => $data.allowEditSheet && $props.rename && $options.startChangeSheetName(sheet, $event), class: vue.normalizeClass({ "ddei-core-panel-bottom-pages-page": sheet.active == 0, "ddei-core-panel-bottom-pages-page--selected": sheet.active == 1 }), title: sheet.name }, [ vue.createElementVNode("span", null, vue.toDisplayString(sheet.name), 1) ], 42, _hoisted_2$H)), [ [vue.vShow, index >= $data.openIndex && index < $data.openIndex + $data.maxOpenSize] ]); }), 256)), vue.withDirectives(vue.createElementVNode("div", { class: "ddei-core-panel-bottom-pages-movebox", onClick: _cache[3] || (_cache[3] = ($event) => $options.moveItem(-1)) }, _cache[8] || (_cache[8] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-left" }) ], -1) ]), 512), [ [vue.vShow, ((_k = (_j = (_i = $props.editor) == null ? void 0 : _i.files[(_h = $props.editor) == null ? void 0 : _h.currentFileIndex]) == null ? void 0 : _j.sheets) == null ? void 0 : _k.length) > $data.maxOpenSize] ]), vue.withDirectives(vue.createElementVNode("div", { class: "ddei-core-panel-bottom-pages-movebox", onClick: _cache[4] || (_cache[4] = ($event) => $options.moveItem(1)) }, _cache[9] || (_cache[9] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-right" }) ], -1) ]), 512), [ [vue.vShow, ((_o = (_n = (_m = $props.editor) == null ? void 0 : _m.files[(_l = $props.editor) == null ? void 0 : _l.currentFileIndex]) == null ? void 0 : _n.sheets) == null ? void 0 : _o.length) > $data.maxOpenSize] ]) ], 544) ], 64); } const Sheets = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["render", _sfc_render$X], ["__scopeId", "data-v-d059d47d"]]); const _DDeiCoreSheetsPanel = class _DDeiCoreSheetsPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Sheets.name); __publicField3(this, "plugins", [Sheets]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[Sheets.name]) { for (let i2 in options[Sheets.name]) { newOptions[i2] = options[Sheets.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreSheetsPanel(newOptions); return panels; } } return _DDeiCoreSheetsPanel; } static modify(fn) { return _DDeiCoreSheetsPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSheetsPanel, "defaultIns", new _DDeiCoreSheetsPanel(null)); let DDeiCoreSheetsPanel = _DDeiCoreSheetsPanel; const _DDeiCoreBottomPanels = class _DDeiCoreBottomPanels extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ DDeiCoreShapeCountPanel, DDeiCoreManageLayersPanel, DDeiCorePlayPanel, DDeiCoreSuitRatioPanel, DDeiCoreChangeRatioPanel, DDeiCoreSheetsPanel ]); } getPanels(editor) { var _a3; let panels = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getPanels(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getPanels(editor); } if ((ls == null ? void 0 : ls.length) > 0) { panels = panels.concat(ls); } }); return panels; } static configuration(options) { var _a3; if (options) { let panels = new _DDeiCoreBottomPanels(options); for (let i2 = 0; i2 < ((_a3 = panels.plugins) == null ? void 0 : _a3.length); i2++) { panels.plugins[i2] = panels.plugins[i2].configuration(options, true); } return panels; } return _DDeiCoreBottomPanels; } static modify(fn) { return _DDeiCoreBottomPanels.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreBottomPanels, "defaultIns", new _DDeiCoreBottomPanels(null)); let DDeiCoreBottomPanels = _DDeiCoreBottomPanels; const _sfc_main$W = { name: "ddei-core-panel-toolbox-simple", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { groups: null, forceRefresh: true, forceRefreshGroup: true }; }, computed: {}, watch: {}, created() { }, mounted() { let middleCanvas = document.getElementById(this.editor.id + "_canvas"); const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { const { width, height } = entry.contentRect; if (width != 0 && height != 0) { this.width = width; this.height = height; this.resetPosition(width, height); } } }); resizeObserver.observe(middleCanvas); this.refreshData(); }, methods: { resetPosition(width, height) { var _a3, _b2, _c2, _d2, _e2, _f, _g; if (((_a3 = this.options) == null ? void 0 : _a3.direct) == 2) { this.$refs["toolbox"].style.maxWidth = width - 80 + "px"; this.$refs["toolbox"].style.flexDirection = ""; if ((_b2 = this.options) == null ? void 0 : _b2.width) { this.$refs["toolbox"].style.width = this.options.width; } else { this.$refs["toolbox"].style.width = ""; } if ((_c2 = this.options) == null ? void 0 : _c2.height) { this.$refs["toolbox"].style.height = this.options.height; } else { this.$refs["toolbox"].style.height = "40px"; } } else { this.$refs["toolbox"].style.flexDirection = "column"; this.$refs["toolbox"].style.maxHeight = height - 80 + "px"; if ((_d2 = this.options) == null ? void 0 : _d2.width) { this.$refs["toolbox"].style.width = this.options.width; } else { this.$refs["toolbox"].style.width = "40px"; } if ((_e2 = this.options) == null ? void 0 : _e2.height) { this.$refs["toolbox"].style.height = this.options.height; } else { this.$refs["toolbox"].style.height = ""; } } let cachePos = null; if (((_f = this.options) == null ? void 0 : _f.drag) == 1) { cachePos = localStorage.getItem("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple"); } if (!cachePos) { switch ((_g = this.options) == null ? void 0 : _g.position) { case 2: this.$refs["toolbox"].style.left = (width - this.$refs["toolbox"].clientWidth) / 2 + "px"; this.$refs["toolbox"].style.top = "30px"; break; case 3: this.$refs["toolbox"].style.left = width - this.$refs["toolbox"].clientWidth - 30 + "px"; this.$refs["toolbox"].style.top = "30px"; break; case 4: this.$refs["toolbox"].style.left = width - this.$refs["toolbox"].clientWidth - 30 + "px"; this.$refs["toolbox"].style.top = (height - this.$refs["toolbox"].clientHeight) / 2 + "px"; break; case 5: this.$refs["toolbox"].style.left = width - this.$refs["toolbox"].clientWidth - 30 + "px"; this.$refs["toolbox"].style.top = height - this.$refs["toolbox"].clientHeight - 30 + "px"; break; case 6: this.$refs["toolbox"].style.left = (width - this.$refs["toolbox"].clientWidth) / 2 + "px"; this.$refs["toolbox"].style.top = height - this.$refs["toolbox"].clientHeight - 30 + "px"; break; case 7: this.$refs["toolbox"].style.left = "30px"; this.$refs["toolbox"].style.top = height - this.$refs["toolbox"].clientHeight - 30 + "px"; break; case 8: this.$refs["toolbox"].style.left = "30px"; this.$refs["toolbox"].style.top = (height - this.$refs["toolbox"].clientHeight) / 2 + "px"; break; case 9: this.$refs["toolbox"].style.left = (width - this.$refs["toolbox"].clientWidth) / 2 + "px"; this.$refs["toolbox"].style.top = (height - this.$refs["toolbox"].clientHeight) / 2 + "px"; break; default: this.$refs["toolbox"].style.left = "30px"; this.$refs["toolbox"].style.top = "30px"; break; } } else { let posJson = JSON.parse(cachePos); this.$refs["toolbox"].style.left = posJson.left + "px"; this.$refs["toolbox"].style.top = posJson.top + "px"; } this.$refs["toolbox"].style.display = "flex"; }, refreshData() { var _a3, _b2, _c2; this.editor.needControlIcon = true; this.editor.toolBarViewer = this; if (this.editor.ddInstance && !this.editor.ddInstance.render) { this.editor.ddInstance.initRender(); } if (!this.groups) { let groups = []; for (let i2 = 0; i2 < ((_b2 = (_a3 = this.options) == null ? void 0 : _a3.groups) == null ? void 0 : _b2.length); i2++) { let group2 = clone(this.options.groups[i2]); let controls2 = []; (_c2 = group2.controls) == null ? void 0 : _c2.forEach((controlid) => { let control = this.editor.controls.get(controlid); if (control) { controls2.push(control); } }); if (controls2.length > 0) { group2.controls = controls2; } groups.push(group2); } this.groups = groups; } }, //强制刷新当前以及下层组件 forceRefreshParts(parts) { if (!parts || parts == "toolbox" || parts.indexOf("toolbox") != -1) { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.$nextTick(() => { this.resetPosition(this.width, this.height); }); } }); } }, changeEditMode(editMode) { if (!editMode) { this.editor.bus.push(DDeiEditorEnumBusCommandType.ChangeEditMode, { mode: 1 }); } else { this.editor.bus.push(DDeiEditorEnumBusCommandType.ChangeEditMode, { mode: editMode }); } this.editor.bus.executeAll(); return true; }, /** * 准备创建 */ createControlPrepare(group2, e) { var _a3, _b2, _c2, _d2, _e2, _f; let control = group2.currentControl ? group2.currentControl : ((_a3 = group2.controls) == null ? void 0 : _a3.length) > 0 ? group2.controls[0] : null; let editMode = group2.editMode; let ddInstance = this.editor.ddInstance; ddInstance.render.inEdge = 0; let stage2 = ddInstance.stage; let layer2 = stage2.layers[stage2.layerIndex]; if (layer2.display == 0 && !layer2.tempDisplay || layer2.lock) { return; } if (control) { if (editMode != 4) { let controlInitJSON = DDeiEditorUtil.getModelInitJSON(this.editor.ddInstance, null, [control]); if (!controlInitJSON) { return; } let models = DDeiEditorUtil.createControl(controlInitJSON[0], this.editor); let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", DDeiEnumOperateType.CREATE, { models }, ddInstance, e); if (rsState == 0 || rsState == 1) { DDeiUtil.invokeCallbackFunc("EVENT_MOUSE_OPERATING", DDeiEnumOperateType.CREATE, null, ddInstance, e); let stageRatio2 = stage2.getStageRatio(); let moveMatrix2 = new Matrix3( 1, 0, -stage2.wpv.x * stageRatio2, 0, 1, -stage2.wpv.y * stageRatio2, 0, 0, 1 ); models.forEach((model) => { model.transVectors(moveMatrix2); model.setState(DDeiEnumControlState.CREATING); }); if ((models == null ? void 0 : models.length) > 0) { let ddInstance2 = this.editor.ddInstance; let stage22 = ddInstance2.stage; if (((_b2 = stage22 == null ? void 0 : stage22.render) == null ? void 0 : _b2.operateState) == DDeiEnumOperateState.QUICK_EDITING && ((_c2 = stage22 == null ? void 0 : stage22.render) == null ? void 0 : _c2.editorShadowControl)) { (_d2 = DDeiUtil.getEditorText()) == null ? void 0 : _d2.enterValue(); } this.editor.changeState(DDeiEditorState.CONTROL_CREATING); this.editor.creatingControls = models; (_e2 = this.editor.bus) == null ? void 0 : _e2.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); (_f = this.editor.bus) == null ? void 0 : _f.executeAll(); } e.preventDefault(); e.cancelBubble = true; } } else { DDeiEditorUtil.lineInitJSON = { modelCode: control.id }; this.editor.changeState(DDeiEditorState.DESIGNING); } } DDeiEditorUtil.hiddenDialog(this.editor, "ddei-core-dialog-choosecontrol"); }, /** * 显示组控件列表 * @param group 组 * @param e */ showGroupControlBox(group2, evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; DDeiEditorUtil.hiddenDialog(this.editor, "ddei-core-dialog-choosecontrol"); if (this.editor.state != DDeiEditorState.CONTROL_CREATING) { if (((_a3 = group2.controls) == null ? void 0 : _a3.length) > 1) { let el = evt.srcElement; let type = 99; if (((_b2 = this.options) == null ? void 0 : _b2.direct) == 2) { if (((_c2 = this.options) == null ? void 0 : _c2.position) == 1 || ((_d2 = this.options) == null ? void 0 : _d2.position) == 2 || ((_e2 = this.options) == null ? void 0 : _e2.position) == 3 || ((_f = this.options) == null ? void 0 : _f.position) == 4 || ((_g = this.options) == null ? void 0 : _g.position) == 8 || ((_h = this.options) == null ? void 0 : _h.position) == 9 || !((_i = this.options) == null ? void 0 : _i.position)) { type = 5; } else if (((_j = this.options) == null ? void 0 : _j.position) == 5 || ((_k = this.options) == null ? void 0 : _k.position) == 6 || ((_l = this.options) == null ? void 0 : _l.position) == 7) { type = 3; } } else if (((_m = this.options) == null ? void 0 : _m.direct) == 1) { if (((_n = this.options) == null ? void 0 : _n.position) == 1 || ((_o = this.options) == null ? void 0 : _o.position) == 7 || ((_p = this.options) == null ? void 0 : _p.position) == 8 || ((_q = this.options) == null ? void 0 : _q.position) == 2 || ((_r = this.options) == null ? void 0 : _r.position) == 6 || !((_s = this.options) == null ? void 0 : _s.position) || ((_t = this.options) == null ? void 0 : _t.position) == 9) { type = 9; } else if (((_u = this.options) == null ? void 0 : _u.position) == 3 || ((_v = this.options) == null ? void 0 : _v.position) == 4 || ((_w = this.options) == null ? void 0 : _w.position) == 5) { type = 7; } } DDeiEditorUtil.showDialog(this.editor, "ddei-core-dialog-choosecontrol", { controlGroup: group2, callback: { ok: this.changeGroupControl, drag: ((_x = this.options) == null ? void 0 : _x.dragCreate) == 1 ? this.dragCreateControlPrepare : null } }, { type, hiddenMask: true }, el, true, true); } } }, changeGroupControl(group2, control, evt) { var _a3; this.changeEditMode(group2 == null ? void 0 : group2.editMode); if ((group2 == null ? void 0 : group2.editMode) == 4) { DDeiEditorUtil.lineInitJSON = { modelCode: control.id }; } group2.currentControl = control; if ((_a3 = this.options) == null ? void 0 : _a3.chooseCreate) { this.createControlCenter(group2); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-choosecontrol"); this.forceRefreshGroup = false; this.$nextTick(() => { this.forceRefreshGroup = true; }); }, dragCreateControlPrepare(group2, control, evt) { var _a3; this.changeEditMode(group2 == null ? void 0 : group2.editMode); group2.currentControl = control; if ((_a3 = this.options) == null ? void 0 : _a3.dragCreate) { this.createControlPrepare(group2, evt); } this.forceRefreshGroup = false; this.$nextTick(() => { this.forceRefreshGroup = true; }); }, /** * 准备拖拽 */ prepareDragBox(e) { this.editor.dragPart = this; this.$refs["toolbox"].style.userSelect = "none"; this.$refs["toolbox"].children[0].style.backgroundColor = "var(--dot)"; this.$refs["toolbox"].style.pointerEvents = "none"; }, /** * 拖拽中 */ boxDraging(e) { var _a3; if (this.editor.dragPart) { let middleCanvas = document.getElementById(this.editor.id + "_canvas"); let posLeft = e.offsetX - 15; let posTop = e.offsetY - 5; if (((_a3 = this.options) == null ? void 0 : _a3.direct) == 2) { posLeft = e.offsetX - 5; posTop = e.offsetY - 15; } if (posLeft < 0) { posLeft = 0; } if (posLeft < 0) { posTop = 0; } if (posLeft + this.$refs["toolbox"].offsetWidth > middleCanvas.offsetWidth) { posLeft = middleCanvas.offsetWidth - this.$refs["toolbox"].offsetWidth; } if (posTop + this.$refs["toolbox"].offsetHeight > middleCanvas.offsetHeight) { posTop = middleCanvas.offsetHeight - this.$refs["toolbox"].offsetHeight; } this.$refs["toolbox"].style.left = posLeft + "px"; this.$refs["toolbox"].style.top = posTop + "px"; } }, /** * 拖拽完毕 */ boxDragEnd(e) { if (this.editor.dragPart) { let posJson = { left: this.$refs["toolbox"].offsetLeft, top: this.$refs["toolbox"].offsetTop }; localStorage.setItem("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple", JSON.stringify(posJson)); this.$refs["toolbox"].style.userSelect = ""; this.$refs["toolbox"].style.pointerEvents = ""; this.$refs["toolbox"].children[0].style.backgroundColor = ""; delete this.editor.dragPart; } }, /** * 创建控件在中心点处 */ createControlCenter(group2, e) { var _a3, _b2, _c2, _d2, _e2, _f, _g; if ((group2 == null ? void 0 : group2.editMode) != 4) { let control = group2.currentControl ? group2.currentControl : ((_a3 = group2.controls) == null ? void 0 : _a3.length) > 0 ? group2.controls[0] : null; this.editor.changeState(DDeiEditorState.DESIGNING); this.editor.creatingControls = null; if (control) { let ddInstance = this.editor.ddInstance; ddInstance.render.inEdge = 0; let stage2 = ddInstance.stage; let layer2 = stage2.layers[stage2.layerIndex]; if (layer2.display == 0 && !layer2.tempDisplay || layer2.lock) { return; } let controlInitJSON = DDeiEditorUtil.getModelInitJSON(this.editor.ddInstance, null, [{ model: control.id }]); if (controlInitJSON) { let models = this.editor.addControls(controlInitJSON); let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", DDeiEnumOperateType.CREATE, { models }, ddInstance, e); if (rsState == 0 || rsState == 1) { let pushDatas = []; models.forEach((model, key) => { pushDatas.push({ id: model.id, value: DDeiEnumControlState.SELECTED }); }); (_c2 = (_b2 = this.editor.ddInstance) == null ? void 0 : _b2.bus) == null ? void 0 : _c2.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, e); (_e2 = (_d2 = this.editor.ddInstance) == null ? void 0 : _d2.bus) == null ? void 0 : _e2.push(DDeiEnumBusCommandType.ModelChangeSelect, pushDatas, e); (_g = (_f = this.editor.ddInstance) == null ? void 0 : _f.bus) == null ? void 0 : _g.push(DDeiEnumBusCommandType.StageChangeSelectModels); this.editor.bus.executeAll(); this.editor.changeState(DDeiEditorState.DESIGNING); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_AFTER", DDeiEnumOperateType.CREATE, { models }, ddInstance, e); } } } } }, /** * 焦点进入当前区域 */ changeEditorFocus() { this.editor.changeState(DDeiEditorState.TOOLBOX_ACTIVE); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); } } }; const ToolboxSimple_vue_vue_type_style_index_0_scoped_bd214554_lang = ""; const _hoisted_1$W = ["title", "onMouseenter", "onMousedown", "onClick"]; const _hoisted_2$G = ["innerHTML"]; const _hoisted_3$D = ["src"]; const _hoisted_4$t = ["innerHTML"]; function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, onMousedown: _cache[1] || (_cache[1] = (...args) => $options.changeEditorFocus && $options.changeEditorFocus(...args)), ref: "toolbox", class: "ddei-core-panel-toolbox-simple" }, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "item-drag": ((_a3 = $props.options) == null ? void 0 : _a3.drag) == 1 && ((_b2 = $props.options) == null ? void 0 : _b2.direct) != 2, "item-drag-2": ((_c2 = $props.options) == null ? void 0 : _c2.drag) == 1 && ((_d2 = $props.options) == null ? void 0 : _d2.direct) == 2, "item-block": ((_e2 = $props.options) == null ? void 0 : _e2.drag) != 1 }), onMousedown: _cache[0] || (_cache[0] = ($event) => { var _a4; return ((_a4 = $props.options) == null ? void 0 : _a4.drag) == 1 && $options.prepareDragBox(); }) }, null, 34), $data.forceRefreshGroup ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($data.groups, (group2) => { var _a4, _b3, _c3, _d3, _e3, _f, _g, _h, _i, _j, _k; return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item-selected": group2.editMode == $props.editor.editMode }), title: ((_a4 = group2.currentControl) == null ? void 0 : _a4.desc) ? group2.currentControl.desc : ((_b3 = group2.controls) == null ? void 0 : _b3.length) > 0 && ((_c3 = group2.controls[0]) == null ? void 0 : _c3.desc) ? group2.controls[0].desc : group2.desc ? group2.desc : "", onMouseenter: ($event) => $options.showGroupControlBox(group2, $event), onMousedown: ($event) => $options.changeEditMode(group2 == null ? void 0 : group2.editMode) && $options.createControlPrepare(group2, $event), onClick: ($event) => { var _a5; return ((_a5 = group2.controls) == null ? void 0 : _a5.length) > 0 && $options.changeEditMode(group2 == null ? void 0 : group2.editMode) && $options.createControlCenter(group2, $event); } }, [ (group2 == null ? void 0 : group2.editMode) == 1 || (group2 == null ? void 0 : group2.editMode) == 2 ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, innerHTML: group2.icon }, null, 8, _hoisted_2$G)) : vue.createCommentVNode("", true), group2.currentControl && !group2.currentControl.icon || !group2.currentControl && ((_d3 = group2.controls) == null ? void 0 : _d3.length) > 0 && !((_e3 = group2.controls[0]) == null ? void 0 : _e3.icon) ? (vue.openBlock(), vue.createElementBlock("img", { key: 1, class: "icon", src: (_f = $props.editor) == null ? void 0 : _f.icons[group2.currentControl ? group2.currentControl.id : group2.controls[0].id] }, null, 8, _hoisted_3$D)) : vue.createCommentVNode("", true), group2.currentControl && group2.currentControl.icon || !group2.currentControl && ((_g = group2.controls) == null ? void 0 : _g.length) > 0 && ((_h = group2.controls[0]) == null ? void 0 : _h.icon) ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, class: "item-icon-html", innerHTML: ((_i = group2.currentControl) == null ? void 0 : _i.icon) ? group2.currentControl.icon : ((_j = group2.controls) == null ? void 0 : _j.length) > 0 ? (_k = group2.controls[0]) == null ? void 0 : _k.icon : "" }, null, 8, _hoisted_4$t)) : vue.createCommentVNode("", true) ], 42, _hoisted_1$W); }), 256)) : vue.createCommentVNode("", true), _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "item-block" }, null, -1)) ], 544)) : vue.createCommentVNode("", true); } const ToolboxSimple = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$W], ["__scopeId", "data-v-bd214554"]]); const _DDeiCoreToolboxSimplePanel = class _DDeiCoreToolboxSimplePanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ToolboxSimple.name); __publicField3(this, "plugins", [ToolboxSimple]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ToolboxSimple.name]) { for (let i2 in options[ToolboxSimple.name]) { newOptions[i2] = options[ToolboxSimple.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreToolboxSimplePanel(newOptions); return panels; } } return _DDeiCoreToolboxSimplePanel; } static modify(fn) { return _DDeiCoreToolboxSimplePanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreToolboxSimplePanel, "defaultIns", new _DDeiCoreToolboxSimplePanel({ direct: 1, //方向,1纵向,2横向 position: 8, //位置1-9顺时针,1为左上角,9为中心 drag: 1, //是否允许拖拽位置 chooseCreate: 0, //是否在选择控件时创建一个控件 dragCreate: 0, //是否在拖拽时创建控件 groups: [ { editMode: 1, desc: "选择", icon: `` }, { editMode: 2, desc: "平移画布", icon: `` }, { controls: [ "100103" ] }, { controls: [ "100001", "100002", "100003", "100004", "100005", "100006", "100007" ] }, { controls: [ "100040", "100041", "100050", "100051" ] }, { editMode: 4, desc: "连线", controls: [ "100401" ] } ] })); let DDeiCoreToolboxSimplePanel = _DDeiCoreToolboxSimplePanel; const _sfc_main$V = { name: "ddei-core-panel-topmenu-simple", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { forceRefresh: true }; }, computed: {}, watch: {}, created() { }, mounted() { let middleCanvas = document.getElementById(this.editor.id + "_canvas"); const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { const { width, height } = entry.contentRect; if (width != 0 && height != 0) { this.width = width; this.height = height; this.resetPosition(width, height); } } }); resizeObserver.observe(middleCanvas); this.refreshData(); }, methods: { internalAction(id, evt) { if (id == "ddei-core-save") { this.save(evt); } else if (id == "ddei-core-open") { this.openFile(evt); } else if (id == "ddei-core-new") { this.newFile(evt); } else if (id == "ddei-core-download") { this.download(evt); } }, /** * 保存 * @param evt */ save(evt) { this.editor.changeState(DDeiEditorState.DESIGNING); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.push(DDeiEditorEnumBusCommandType.SaveFile, {}, evt); this.editor.bus.executeAll(); }, /** * 下载文件 */ download(evt) { var _a3, _b2, _c2, _d2; if ((_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) { let file = (_d2 = this.editor) == null ? void 0 : _d2.files[(_c2 = this.editor) == null ? void 0 : _c2.currentFileIndex]; if (file) { let json = file.toJSON(); if (json) { let eleLink = document.createElement("a"); eleLink.download = file.name + ".dei"; eleLink.style.display = "none"; let blob = new Blob([JSON.stringify(json)]); eleLink.href = URL.createObjectURL(blob); document.body.appendChild(eleLink); eleLink.click(); document.body.removeChild(eleLink); this.editor.changeState(DDeiEditorState.DESIGNING); } } } }, /** * 打开文件 * @param evt */ async openFile(evt) { let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_FILE_BEFORE", "LOAD_FILE", null, this.editor.ddInstance, evt); if (rsState != -1) { let openFileHandle = await showOpenFilePicker({ description: "DDei Design File", types: [{ accept: { "text/plain": [".dei"] } }] }); let openFile = await openFileHandle[0].getFile(); let read = new FileReader(); read.readAsText(openFile); read.onload = async () => { var _a3, _b2, _c2, _d2, _e2; let result = read.result; let resultJSON = JSON.parse(result); let ddInstance = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance; let file = DDeiFile.loadFromJSON(resultJSON, { currentDdInstance: ddInstance }); let openedFiles = this.editor.files; let openedFileIndex = -1; if (!file.id) { file.id = DDeiUtil.getUniqueCode(); } for (let fi = 0; fi < openedFiles.length; fi++) { if (openedFiles[fi].id && openedFiles[fi].id == file.id) { openedFileIndex = fi; break; } } ddInstance.stage.destroyRender(); if (openedFileIndex == -1) { file.localFileHandler = openFileHandle[0]; file.local = 1; this.editor.addFile(file); for (let x2 = 0; x2 < this.editor.files.length; x2++) { this.editor.files[x2].active = DDeiActiveType.NONE; } this.editor.currentFileIndex = this.editor.files.length - 1; file.state = DDeiFileState.NONE; file.active = DDeiActiveType.ACTIVE; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { file.changeSheet(file.currentSheetIndex); let stage2 = sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance; ddInstance.disabled = false; file.initHistroy(); file.histroy[0].isNew = true; ddInstance.stage = stage2; stage2.initRender(); if (!stage2.wpv) { stage2.wpv = { x: -(stage2.width - ddInstance.render.container.clientWidth) / 2, y: -(stage2.height - ddInstance.render.container.clientHeight) / 2, z: 0 }; } this.editor.changeState(DDeiEditorState.DESIGNING); ddInstance.bus.push( DDeiEditorEnumBusCommandType.ClearTemplateUI ); ddInstance.bus.push( DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu", "topmenu"] } ); (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.push(DDeiEnumBusCommandType.RefreshShape); (_c2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _c2.executeAll(); } } else { file = this.editor.files[openedFileIndex]; if (file && ddInstance) { for (let x2 = 0; x2 < this.editor.files.length; x2++) { this.editor.files[x2].active = DDeiActiveType.NONE; } file.active = DDeiActiveType.ACTIVE; this.editor.currentFileIndex = openedFileIndex; let stage2 = file.sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance; ddInstance.stage = stage2; ddInstance.disabled = false; stage2.initRender(); this.editor.changeState(DDeiEditorState.DESIGNING); ddInstance.bus.push( DDeiEditorEnumBusCommandType.ClearTemplateUI ); ddInstance.bus.push( DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu", "topmenu"] } ); (_d2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _d2.push(DDeiEnumBusCommandType.RefreshShape); (_e2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _e2.executeAll(); } } DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_FILE_AFTER", "LOAD_FILE", { file }, this.editor.ddInstance, evt); }; } }, /** * 新建文件 * @param evt */ newFile(evt) { var _a3, _b2; if ((_a3 = this.editor) == null ? void 0 : _a3.ddInstance) { let ddInstance = this.editor.ddInstance; let file = DDeiFile.loadFromJSON( { name: "新建文件_NEW", path: "/新建文件_NEW", sheets: [ new DDeiSheet({ name: "页面-1", desc: "页面-1", stage: DDeiStage.initByJSON({ id: "stage_1" }, { currentDdInstance: ddInstance }), active: DDeiActiveType.ACTIVE }) ], currentSheetIndex: 0, state: DDeiFileState.NEW, active: DDeiActiveType.ACTIVE }, { currentDdInstance: ddInstance } ); if (this.editor.currentFileIndex != -1) { this.editor.files[this.editor.currentFileIndex].active = DDeiActiveType.NONE; } this.editor.addFile(file); this.editor.currentFileIndex = this.editor.files.length - 1; let sheets = file == null ? void 0 : file.sheets; if (file && sheets && ddInstance) { ddInstance.stage.destroyRender(); let stage2 = sheets[0].stage; stage2.ddInstance = ddInstance; ddInstance.stage = stage2; file.initHistroy(); if (!stage2.wpv) { stage2.wpv = { x: -(stage2.width - ddInstance.render.container.clientWidth) / 2, y: -(stage2.height - ddInstance.render.container.clientHeight) / 2, z: 0 }; } stage2.initRender(); ddInstance.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu", "topmenu"] }); this.editor.changeState(DDeiEditorState.DESIGNING); (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.executeAll(); } } }, resetPosition(width, height) { var _a3, _b2, _c2, _d2, _e2, _f, _g; if (((_a3 = this.options) == null ? void 0 : _a3.direct) == 2) { this.$refs["topmenu"].style.maxWidth = width - 80 + "px"; this.$refs["topmenu"].style.flexDirection = ""; if ((_b2 = this.options) == null ? void 0 : _b2.width) { this.$refs["topmenu"].style.width = this.options.width; } else { this.$refs["topmenu"].style.width = ""; } if ((_c2 = this.options) == null ? void 0 : _c2.height) { this.$refs["topmenu"].style.height = this.options.height; } else { this.$refs["topmenu"].style.height = "32px"; } } else { this.$refs["topmenu"].style.flexDirection = "column"; this.$refs["topmenu"].style.maxHeight = height - 80 + "px"; if ((_d2 = this.options) == null ? void 0 : _d2.width) { this.$refs["topmenu"].style.width = this.options.width; } else { this.$refs["topmenu"].style.width = "32px"; } if ((_e2 = this.options) == null ? void 0 : _e2.height) { this.$refs["topmenu"].style.height = this.options.height; } else { this.$refs["topmenu"].style.height = ""; } } let cachePos = null; if (((_f = this.options) == null ? void 0 : _f.drag) == 1) { cachePos = localStorage.getItem("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple"); } if (!cachePos) { switch ((_g = this.options) == null ? void 0 : _g.position) { case 2: this.$refs["topmenu"].style.left = (width - this.$refs["topmenu"].clientWidth) / 2 + "px"; this.$refs["topmenu"].style.top = "30px"; break; case 3: this.$refs["topmenu"].style.left = width - this.$refs["topmenu"].clientWidth - 30 + "px"; this.$refs["topmenu"].style.top = "30px"; break; case 4: this.$refs["topmenu"].style.left = width - this.$refs["topmenu"].clientWidth - 30 + "px"; this.$refs["topmenu"].style.top = (height - this.$refs["topmenu"].clientHeight) / 2 + "px"; break; case 5: this.$refs["topmenu"].style.left = width - this.$refs["topmenu"].clientWidth - 30 + "px"; this.$refs["topmenu"].style.top = height - this.$refs["topmenu"].clientHeight - 30 + "px"; break; case 6: this.$refs["topmenu"].style.left = (width - this.$refs["topmenu"].clientWidth) / 2 + "px"; this.$refs["topmenu"].style.top = height - this.$refs["topmenu"].clientHeight - 30 + "px"; break; case 7: this.$refs["topmenu"].style.left = "30px"; this.$refs["topmenu"].style.top = height - this.$refs["topmenu"].clientHeight - 30 + "px"; break; case 8: this.$refs["topmenu"].style.left = "30px"; this.$refs["topmenu"].style.top = (height - this.$refs["topmenu"].clientHeight) / 2 + "px"; break; case 9: this.$refs["topmenu"].style.left = (width - this.$refs["topmenu"].clientWidth) / 2 + "px"; this.$refs["topmenu"].style.top = (height - this.$refs["topmenu"].clientHeight) / 2 + "px"; break; default: this.$refs["topmenu"].style.left = "30px"; this.$refs["topmenu"].style.top = "30px"; break; } } else { let posJson = JSON.parse(cachePos); this.$refs["topmenu"].style.left = posJson.left + "px"; this.$refs["topmenu"].style.top = posJson.top + "px"; } this.$refs["topmenu"].style.display = "flex"; }, refreshData() { }, //强制刷新当前以及下层组件 forceRefreshParts(parts) { if (!parts || parts == "topmenu" || parts.indexOf("topmenu") != -1) { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); this.$nextTick(() => { this.resetPosition(this.width, this.height); }); } }); } }, /** * 准备拖拽 */ prepareDragBox(e) { this.editor.dragPart = this; this.$refs["topmenu"].style.userSelect = "none"; this.$refs["topmenu"].children[0].style.backgroundColor = "var(--dot)"; this.$refs["topmenu"].style.pointerEvents = "none"; }, /** * 拖拽中 */ boxDraging(e) { var _a3; if (this.editor.dragPart) { let middleCanvas = document.getElementById(this.editor.id + "_canvas"); let posLeft = e.offsetX - 15; let posTop = e.offsetY - 5; if (((_a3 = this.options) == null ? void 0 : _a3.direct) == 2) { posLeft = e.offsetX - 5; posTop = e.offsetY - 15; } if (posLeft < 0) { posLeft = 0; } if (posLeft < 0) { posTop = 0; } if (posLeft + this.$refs["topmenu"].offsetWidth > middleCanvas.offsetWidth) { posLeft = middleCanvas.offsetWidth - this.$refs["topmenu"].offsetWidth; } if (posTop + this.$refs["topmenu"].offsetHeight > middleCanvas.offsetHeight) { posTop = middleCanvas.offsetHeight - this.$refs["topmenu"].offsetHeight; } this.$refs["topmenu"].style.left = posLeft + "px"; this.$refs["topmenu"].style.top = posTop + "px"; } }, /** * 拖拽完毕 */ boxDragEnd(e) { if (this.editor.dragPart) { let posJson = { left: this.$refs["topmenu"].offsetLeft, top: this.$refs["topmenu"].offsetTop }; localStorage.setItem("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple", JSON.stringify(posJson)); this.$refs["topmenu"].style.userSelect = ""; this.$refs["topmenu"].style.pointerEvents = ""; this.$refs["topmenu"].children[0].style.backgroundColor = ""; delete this.editor.dragPart; } }, /** * 焦点进入当前区域 */ changeEditorFocus() { this.editor.changeState(DDeiEditorState.TOP_MENU_OPERATING); this.editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); this.editor.bus.executeAll(); } } }; const TopMenuSimple_vue_vue_type_style_index_0_scoped_52f75ccc_lang = ""; const _hoisted_1$V = { class: "item" }; const _hoisted_2$F = ["onClick"]; const _hoisted_3$C = ["onClick"]; function _sfc_render$V(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, onMousedown: _cache[5] || (_cache[5] = (...args) => $options.changeEditorFocus && $options.changeEditorFocus(...args)), ref: "topmenu", class: "ddei-core-panel-topmenu-simple" }, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "item-drag": ((_a3 = $props.options) == null ? void 0 : _a3.drag) == 1 && ((_b2 = $props.options) == null ? void 0 : _b2.direct) != 2, "item-drag-2": ((_c2 = $props.options) == null ? void 0 : _c2.drag) == 1 && ((_d2 = $props.options) == null ? void 0 : _d2.direct) == 2, "item-block": ((_e2 = $props.options) == null ? void 0 : _e2.drag) != 1 }), onMousedown: _cache[0] || (_cache[0] = ($event) => { var _a4; return ((_a4 = $props.options) == null ? void 0 : _a4.drag) == 1 && $options.prepareDragBox(); }) }, null, 34), !((_f = $props.options) == null ? void 0 : _f.items) ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "item", onClick: _cache[1] || (_cache[1] = (...args) => $options.newFile && $options.newFile(...args)) }, vue.toDisplayString($props.editor.i18n("ddei.new")), 1)) : vue.createCommentVNode("", true), !((_g = $props.options) == null ? void 0 : _g.items) ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "item", onClick: _cache[2] || (_cache[2] = (...args) => $options.openFile && $options.openFile(...args)) }, vue.toDisplayString($props.editor.i18n("ddei.open")), 1)) : vue.createCommentVNode("", true), !((_h = $props.options) == null ? void 0 : _h.items) ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, class: "item", onClick: _cache[3] || (_cache[3] = (...args) => $options.save && $options.save(...args)) }, vue.toDisplayString($props.editor.i18n("ddei.save")), 1)) : vue.createCommentVNode("", true), !((_i = $props.options) == null ? void 0 : _i.items) ? (vue.openBlock(), vue.createElementBlock("div", { key: 3, class: "item", onClick: _cache[4] || (_cache[4] = (...args) => $options.download && $options.download(...args)) }, vue.toDisplayString($props.editor.i18n("ddei.download")), 1)) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_j = $props.options) == null ? void 0 : _j.items, (menu) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$V, [ menu && !menu.viewer && menu.id ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, onClick: ($event) => $options.internalAction(menu.id, $event) }, vue.toDisplayString($props.editor.i18n(menu.name)), 9, _hoisted_2$F)) : vue.createCommentVNode("", true), menu && !menu.viewer && !menu.id ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, onClick: ($event) => menu.action($props.editor, $event) }, vue.toDisplayString($props.editor.i18n(menu.name)), 9, _hoisted_3$C)) : vue.createCommentVNode("", true), menu && menu.viewer ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(menu.viewer), { key: 2, options: $props.options, editor: $props.editor }, null, 8, ["options", "editor"])) : vue.createCommentVNode("", true) ]); }), 256)), _cache[6] || (_cache[6] = vue.createElementVNode("div", { class: "item-block" }, null, -1)) ], 544)) : vue.createCommentVNode("", true); } const TopMenuSimple = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$V], ["__scopeId", "data-v-52f75ccc"]]); const _DDeiCoreTopMenuSimplePanel = class _DDeiCoreTopMenuSimplePanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", TopMenuSimple.name); __publicField3(this, "plugins", [TopMenuSimple]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[TopMenuSimple.name]) { for (let i2 in options[TopMenuSimple.name]) { newOptions[i2] = options[TopMenuSimple.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreTopMenuSimplePanel(newOptions); return panels; } } return _DDeiCoreTopMenuSimplePanel; } static modify(fn) { return DDeiCoreToolboxSimplePanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreTopMenuSimplePanel, "defaultIns", new _DDeiCoreTopMenuSimplePanel({ direct: 2, //方向,1纵向,2横向 position: 2, //位置1-9顺时针,1为左上角,9为中心 drag: 1 //是否允许拖拽位置 })); let DDeiCoreTopMenuSimplePanel = _DDeiCoreTopMenuSimplePanel; const _DDeiCoreSimplePanels = class _DDeiCoreSimplePanels extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [DDeiCoreToolboxSimplePanel, DDeiCoreTopMenuSimplePanel]); } getPanels(editor) { var _a3; let panels = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getPanels(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getPanels(editor); } if ((ls == null ? void 0 : ls.length) > 0) { panels = panels.concat(ls); } }); return panels; } static configuration(options) { var _a3; if (options) { let panels = new _DDeiCoreSimplePanels(options); for (let i2 = 0; i2 < ((_a3 = panels.plugins) == null ? void 0 : _a3.length); i2++) { panels.plugins[i2] = panels.plugins[i2].configuration(options, true); } return panels; } return _DDeiCoreSimplePanels; } static modify(fn) { return _DDeiCoreSimplePanels.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSimplePanels, "defaultIns", new _DDeiCoreSimplePanels(null)); let DDeiCoreSimplePanels = _DDeiCoreSimplePanels; const _DDeiCorePanels = class _DDeiCorePanels extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ DDeiCoreTopMenuPanel, DDeiCoreToolboxPanels, DDeiCoreQuickColorViewPanel, DDeiCorePropertyViewPanel, DDeiCoreOpenFilesViewPanel, DDeiCoreCanvasViewPanel, DDeiCoreBottomMenuPanel, DDeiCoreCommonPanels, DDeiCoreBottomPanels, DDeiCoreSimplePanels ]); } getPanels(editor) { var _a3; let panels = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getPanels(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getPanels(editor); } if ((ls == null ? void 0 : ls.length) > 0) { panels = panels.concat(ls); } }); return panels; } static configuration(options) { var _a3; if (options) { let panels = new _DDeiCorePanels(options); for (let i2 = 0; i2 < ((_a3 = panels.plugins) == null ? void 0 : _a3.length); i2++) { panels.plugins[i2] = panels.plugins[i2].configuration(options, true); } return panels; } return _DDeiCorePanels; } static modify(fn) { return _DDeiCorePanels.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCorePanels, "defaultIns", new _DDeiCorePanels(null)); let DDeiCorePanels = _DDeiCorePanels; const _sfc_main$U = { name: "ddei-core-btn-addfontsize", extends: null, mixins: [], components: {}, props: { attrCode: { type: String, default: null }, addValue: { type: Number, default: null }, img: { type: String, default: null }, extcls: { type: String, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, value: 0 }; }, computed: {}, watch: {}, created() { this.$watch("editor.textEditorSelectedChange", function(newVal, oldVal) { if (newVal) { this.refreshEditor(); } }); }, mounted() { this.refreshEditor(); }, methods: { refreshEditor() { var _a3; this.value = 0; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get(this.attrCode); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; let valueDefine = this.getDataValue(); if (valueDefine) { this.value = valueDefine.value; } } } else { this.attrDefine = null; } }, //获取数据值 getDataValue() { var _a3, _b2, _c2; if (this.attrDefine) { if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths); if (value === void 0) { value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true); } return { value }; } } } let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_c2 = this.attrDefine) == null ? void 0 : _c2.getParser().getDefaultValue() }; }, valueChange(evt) { var _a3, _b2; let value = this.value + this.addValue; this.value = value; this.attrDefine.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue); this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); setTimeout(() => { editorText.focus(); }, 20); hasEditSetted = true; } } } if (!hasEditSetted) { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, evt, true); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.executeAll(); if (this.editor.state != DDeiEditorState.QUICK_EDITING) { this.editor.changeState(DDeiEditorState.DESIGNING); } } } }; const QBTEditAddFontSize_vue_vue_type_style_index_0_scoped_4ef00c85_lang = ""; const _hoisted_1$U = ["xlink:href"]; function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-editor-quickifat-item-box": true, "ddei-editor-quickifat-item-box--disabled": !$data.attrDefine }), onClick: _cache[0] || (_cache[0] = ($event) => $data.attrDefine && $options.valueChange($event)) }, [ (vue.openBlock(), vue.createElementBlock("svg", { class: vue.normalizeClass("icon " + ($props.extcls ? $props.extcls : "")), "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#" + $props.img }, null, 8, _hoisted_1$U) ], 2)) ], 2); } const QBTEditAddFontSize = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$U], ["__scopeId", "data-v-4ef00c85"]]); const _DDeiCoreAddFontSizeButton = class _DDeiCoreAddFontSizeButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTEditAddFontSize.name); __publicField3(this, "plugins", [QBTEditAddFontSize]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTEditAddFontSize.name]) { for (let i2 in options[QBTEditAddFontSize.name]) { newOptions[i2] = options[QBTEditAddFontSize.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreAddFontSizeButton(newOptions); return panels; } } return _DDeiCoreAddFontSizeButton; } static modify(fn) { return _DDeiCoreAddFontSizeButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreAddFontSizeButton, "defaultIns", new _DDeiCoreAddFontSizeButton(null)); let DDeiCoreAddFontSizeButton = _DDeiCoreAddFontSizeButton; const _sfc_main$T = { name: "ddei-core-btn-borderdash", extends: null, mixins: [], components: {}, props: { attrCode: { type: String, default: null }, hiddenCombo: { type: String, default: "0" }, extcls: { type: String, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, value: null }; }, computed: {}, watch: {}, created() { }, mounted() { this.refreshEditor(); }, methods: { refreshEditor() { var _a3; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get(this.attrCode); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; let valueDefine = this.getDataValue(); if (valueDefine && !valueDefine.isDefault) { this.value = valueDefine.value; } } } else { this.attrDefine = null; } }, //打开弹出框 showDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectborderdash", { value: this.attrDefine.value, dataSource: this.attrDefine.dataSource, callback: { ok: this.valueChange }, group: "property-dialog" }, { type: 5 }, srcElement, false, true); }, //获取数据值 getDataValue() { var _a3, _b2, _c2; if (this.attrDefine) { if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths); if (value === void 0) { value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true); } return { value }; } } } let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_c2 = this.attrDefine) == null ? void 0 : _c2.getParser().getDefaultValue() }; }, valueChange(value) { var _a3, _b2; this.value = value; this.attrDefine.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue); this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); setTimeout(() => { editorText.focus(); }, 20); hasEditSetted = true; } } } if (!hasEditSetted) { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, null, true); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } } }; const QBTBorderDash_vue_vue_type_style_index_0_scoped_8ff63c75_lang = ""; const _hoisted_1$T = { class: "div_input" }; const _hoisted_2$E = ["stroke-dasharray"]; const _hoisted_3$B = { key: 0, style: { "display": "flex", "justify-content": "center", "align-items": "center" } }; function _sfc_render$T(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-border-dash-combox": true, "ddei-pv-border-dash-combox--disabled": !$data.attrDefine || $data.attrDefine.readonly }) }, [ vue.createElementVNode("div", { class: "textinput", onClick: _cache[0] || (_cache[0] = ($event) => $data.attrDefine && !$data.attrDefine.readonly && $options.showDialog($event)) }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$T, [ vue.createElementVNode("line", { x1: "0", y1: "0", x2: "100%", y2: "0", stroke: "black", fill: "white", "stroke-width": "3", "stroke-dasharray": (_a3 = $data.attrDefine) == null ? void 0 : _a3.value }, null, 8, _hoisted_2$E) ])), $props.hiddenCombo != "1" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$B, _cache[1] || (_cache[1] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1) ]))) : vue.createCommentVNode("", true) ]) ], 2); } const QBTBorderDash = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$T], ["__scopeId", "data-v-8ff63c75"]]); const _DDeiCoreBorderDashButton = class _DDeiCoreBorderDashButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTBorderDash.name); __publicField3(this, "plugins", [QBTBorderDash]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTBorderDash.name]) { for (let i2 in options[QBTBorderDash.name]) { newOptions[i2] = options[QBTBorderDash.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreBorderDashButton(newOptions); return panels; } } return _DDeiCoreBorderDashButton; } static modify(fn) { return _DDeiCoreBorderDashButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreBorderDashButton, "defaultIns", new _DDeiCoreBorderDashButton(null)); let DDeiCoreBorderDashButton = _DDeiCoreBorderDashButton; const _sfc_main$S = { name: "ddei-core-btn-borderweight", extends: null, mixins: [], components: {}, props: { attrCode: { type: String, default: null }, hiddenCombo: { type: String, default: "0" }, extcls: { type: String, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, value: null }; }, computed: {}, watch: {}, created() { }, mounted() { this.refreshEditor(); }, methods: { refreshEditor() { var _a3; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get(this.attrCode); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; let valueDefine = this.getDataValue(); if (valueDefine && !valueDefine.isDefault) { this.value = valueDefine.value; } } } else { this.attrDefine = null; } }, //打开弹出框 showDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectboderweight", { value: this.attrDefine.value, dataSource: [ { value: "0.1" }, { value: "0.5" }, { value: "1" }, { value: "2" }, { value: "3" }, { value: "4" }, { value: "5" }, { value: "6" }, { value: "8" }, { value: "10" }, { value: "12" } ], callback: { ok: this.valueChange }, group: "property-dialog" }, { type: 5 }, srcElement, false, true); }, //获取数据值 getDataValue() { var _a3; if (this.attrDefine) { let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_a3 = this.attrDefine) == null ? void 0 : _a3.getParser().getDefaultValue() }; }, valueChange(value) { var _a3, _b2; this.value = value; this.attrDefine.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue); this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); setTimeout(() => { editorText.focus(); }, 20); hasEditSetted = true; } } } if (!hasEditSetted) { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, null, true); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } } }; const QBTBorderWeight_vue_vue_type_style_index_0_scoped_e7c6034b_lang = ""; const _hoisted_1$S = { class: "div_input" }; const _hoisted_2$D = ["stroke-width"]; const _hoisted_3$A = { key: 0, style: { "display": "flex", "justify-content": "center", "align-items": "center" } }; function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei_pv_border_weight_combox": true, "ddei_pv_border_weight_combox_disabled": !$data.attrDefine || $data.attrDefine.readonly }) }, [ vue.createElementVNode("div", { class: "textinput", onClick: _cache[0] || (_cache[0] = ($event) => $data.attrDefine && !$data.attrDefine.readonly && $options.showDialog($event)) }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$S, [ vue.createElementVNode("line", { x1: "0", y1: "0", x2: "100%", y2: "0", stroke: "black", fill: "white", "stroke-width": (_a3 = $data.attrDefine) == null ? void 0 : _a3.value }, null, 8, _hoisted_2$D) ])), $props.hiddenCombo != "1" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$A, _cache[1] || (_cache[1] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1) ]))) : vue.createCommentVNode("", true) ]) ], 2); } const QBTBorderWeight = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$S], ["__scopeId", "data-v-e7c6034b"]]); const _DDeiCoreBorderWeightButton = class _DDeiCoreBorderWeightButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTBorderWeight.name); __publicField3(this, "plugins", [QBTBorderWeight]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTBorderWeight.name]) { for (let i2 in options[QBTBorderWeight.name]) { newOptions[i2] = options[QBTBorderWeight.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreBorderWeightButton(newOptions); return panels; } } return _DDeiCoreBorderWeightButton; } static modify(fn) { return _DDeiCoreBorderWeightButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreBorderWeightButton, "defaultIns", new _DDeiCoreBorderWeightButton(null)); let DDeiCoreBorderWeightButton = _DDeiCoreBorderWeightButton; const _sfc_main$R = { name: "ddei-core-btn-editbox", extends: null, mixins: [], components: {}, props: { attrCode: { type: String, default: null }, unSelectValue: { default: null }, supportQuickEdit: { type: Boolean, default: true }, onlyQuickEdit: { type: Boolean, default: false }, selectedValue: { default: null }, img: { type: String, default: null }, extcls: { type: String, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, value: false }; }, computed: {}, watch: {}, created() { this.$watch("editor.textEditorSelectedChange", function(newVal, oldVal) { if (newVal) { this.refreshEditor(); } }); }, mounted() { this.refreshEditor(); }, methods: { refreshEditor() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; if (!this.supportQuickEdit && ((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.render) == null ? void 0 : _d2.operateState) == DDeiEnumOperateState.QUICK_EDITING) { this.attrDefine = null; return; } if (this.onlyQuickEdit && ((_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.render) == null ? void 0 : _h.operateState) != DDeiEnumOperateState.QUICK_EDITING) { this.attrDefine = null; return; } this.value = false; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get(this.attrCode); let mds = []; if (((_i = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _i.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; let valueDefine = this.getDataValue(); if (valueDefine && !valueDefine.isDefault && valueDefine.value + "" == this.selectedValue + "") { this.value = true; } } } else { this.attrDefine = null; } }, //获取数据值 getDataValue() { var _a3, _b2, _c2; if (this.attrDefine) { if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths); if (value === void 0) { value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true); } return { value }; } } } let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList( this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping ); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_c2 = this.attrDefine) == null ? void 0 : _c2.getParser().getDefaultValue() }; }, valueChange(evt) { var _a3, _b2; if (this.value == true) { this.value = false; } else { this.value = true; } let value = this.unSelectValue; if (this.value == true) { value = this.selectedValue; } this.attrDefine.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue); this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); setTimeout(() => { editorText.focus(); }, 20); hasEditSetted = true; } } } if (!hasEditSetted) { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, evt, true ); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.executeAll(); if (this.editor.state != DDeiEditorState.QUICK_EDITING) { this.editor.changeState(DDeiEditorState.DESIGNING); } } } }; const QBTEditBox_vue_vue_type_style_index_0_scoped_b43b0371_lang = ""; const _hoisted_1$R = ["xlink:href"]; function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-editor-quick-fat-item-box": true, "ddei-editor-quick-fat-item-box--selected": $data.value, "ddei-editor-quick-fat-item-box--disabled": !$data.attrDefine }), onClick: _cache[0] || (_cache[0] = ($event) => $data.attrDefine && $options.valueChange($event)) }, [ (vue.openBlock(), vue.createElementBlock("svg", { class: vue.normalizeClass("icon " + ($props.extcls ? $props.extcls : "")), "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#" + $props.img }, null, 8, _hoisted_1$R) ], 2)) ], 2); } const QBTEditBox = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$R], ["__scopeId", "data-v-b43b0371"]]); const _DDeiCoreEditBoxButton = class _DDeiCoreEditBoxButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTEditBox.name); __publicField3(this, "plugins", [QBTEditBox]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTEditBox.name]) { for (let i2 in options[QBTEditBox.name]) { newOptions[i2] = options[QBTEditBox.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreEditBoxButton(newOptions); return panels; } } return _DDeiCoreEditBoxButton; } static modify(fn) { return _DDeiCoreEditBoxButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreEditBoxButton, "defaultIns", new _DDeiCoreEditBoxButton(null)); let DDeiCoreEditBoxButton = _DDeiCoreEditBoxButton; const _sfc_main$Q = { name: "ddei-core-btn-color", extends: null, mixins: [], components: {}, props: { attrCode: { type: String, default: null }, img: { type: String, default: null }, extcls: { type: String, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, value: null }; }, computed: {}, watch: {}, created() { this.$watch("editor.textEditorSelectedChange", function(newVal, oldVal) { if (newVal) { this.refreshEditor(); } }); }, mounted() { this.refreshEditor(); }, methods: { refreshEditor() { var _a3; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get(this.attrCode); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; let valueDefine = this.getDataValue(); if (valueDefine && !valueDefine.isDefault) { this.value = valueDefine.value; } } } else { this.attrDefine = null; } }, showColor(evt) { let editorState = this.editor.state; let colorInput = this.$refs.colorInput; let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectcolor", { value: colorInput.value, callback: { ok: this.valueChange }, group: "property-dialog" }, { type: 5 }, srcElement, false, true); this.editor.state = editorState; }, //获取数据值 getDataValue() { var _a3, _b2, _c2; if (this.attrDefine) { if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths); if (value === void 0) { value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true); } return { value }; } } } let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_c2 = this.attrDefine) == null ? void 0 : _c2.getParser().getDefaultValue() }; }, valueChange(value) { var _a3, _b2; this.value = value; this.attrDefine.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue); this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); setTimeout(() => { editorText.focus(); }, 20); hasEditSetted = true; } } } if (!hasEditSetted) { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, null, true); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } } }; const QBTEditColor_vue_vue_type_style_index_0_scoped_019ae087_lang = ""; const _hoisted_1$Q = ["xlink:href"]; function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-editor-quick-fat-item-box": true, "ddei-editor-quick-fat-item-box--disabled": !$data.attrDefine }), onClick: _cache[1] || (_cache[1] = ($event) => $data.attrDefine && $options.showColor($event)) }, [ (vue.openBlock(), vue.createElementBlock("svg", { class: vue.normalizeClass("icon " + ($props.extcls ? $props.extcls : "")), "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#" + $props.img }, null, 8, _hoisted_1$Q) ], 2)), vue.createElementVNode("div", { class: "colorbar", style: vue.normalizeStyle({ "background-color": $data.value ? $data.value : "black" }) }, null, 4), vue.withDirectives(vue.createElementVNode("input", { ref: "colorInput", type: "color", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.value = $event), class: "colinput", autocomplete: "off" }, null, 512), [ [vue.vModelText, $data.value] ]) ], 2); } const QBTEditColor = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$Q], ["__scopeId", "data-v-019ae087"]]); const _DDeiCoreEditColorButton = class _DDeiCoreEditColorButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTEditColor.name); __publicField3(this, "plugins", [QBTEditColor]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTEditColor.name]) { for (let i2 in options[QBTEditColor.name]) { newOptions[i2] = options[QBTEditColor.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreEditColorButton(newOptions); return panels; } } return _DDeiCoreEditColorButton; } static modify(fn) { return _DDeiCoreEditColorButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreEditColorButton, "defaultIns", new _DDeiCoreEditColorButton(null)); let DDeiCoreEditColorButton = _DDeiCoreEditColorButton; const _sfc_main$P = { name: "ddei-core-btn-fontfamily", extends: null, mixins: [], components: {}, props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, dataSource: null, value: null, text: null, defaultText: null, expanded: false, canSearch: true }; }, computed: {}, watch: {}, created() { this.search = debounce(this.search, 200); this.$watch("editor.textEditorSelectedChange", function(newVal, oldVal) { if (newVal) { this.refreshEditor(); } }); }, mounted() { this.refreshEditor(); }, methods: { refreshEditor() { var _a3; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get("font.family"); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; } } else { this.attrDefine = null; } this.getDataSource(this.attrDefine); let type = this.getDataValue(); let define2 = this.getDataDefine(type.value); if (!type.isDefault) { this.attrDefine.value = type.value; this.text = define2.text; if (define2.img) { this.$refs.combox.img = define2.img; } } else { this.defaultText = define2.text; } this.value = type.value; }, search() { this.searchText = this.text; this.getDataSource(this.attrDefine); this.showDialog(); }, //打开弹出框 showDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectfont", { dataSource: this.dataSource, value: this.attrDefine.value, group: "property-dialog", callback: { ok: this.valueChange } }, { type: 5 }, srcElement, false, true); }, /** * 根据值获取选项定义 * @param value 值 */ getDataDefine(value) { if (this.dataSource && value) { for (let i2 = 0; i2 < this.dataSource.length; i2++) { if (this.dataSource[i2].value.toString() == value.toString()) { return this.dataSource[i2]; } } } return { text: "" }; }, //获取数据值 getDataValue() { var _a3, _b2, _c2; if (this.attrDefine) { if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths); if (value === void 0) { value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true); } return { value }; } } } let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList( this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping ); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_c2 = this.attrDefine) == null ? void 0 : _c2.getParser().getDefaultValue() }; }, /** * 获取数据源数据 */ getDataSource(attrDefine) { if (this.attrDefine) { let dataSources = DDeiEditorUtil.getDataSource( this.editor, this.attrDefine, this.searchText ); this.dataSource = dataSources; return this.dataSource; } }, valueChange(value, evt) { var _a3, _b2; this.attrDefine.value = value; let itemDefine = this.getDataDefine(value); let text2 = itemDefine.text; this.text = text2; this.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue); this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); setTimeout(() => { editorText.focus(); }, 20); hasEditSetted = true; } } } if (!hasEditSetted) { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, evt, true ); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); this.editor.bus.executeAll(); } } }; const QBTFontFamily_vue_vue_type_style_index_0_scoped_ec936992_lang = ""; const _hoisted_1$P = ["readonly", "placeholder"]; function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", null, [ vue.createElementVNode("div", { id: "ddei-editor-quick-fat-item-fontfamily", class: vue.normalizeClass({ "ddei-editor-quick-fat-item-fontfamily": true, "ddei-editor-quick-fat-item-fontfamily--disabled": !$data.attrDefine }) }, [ vue.withDirectives(vue.createElementVNode("input", { class: "ddei-editor-quick-fat-item-fontfamily_input", readonly: !$data.attrDefine || $data.attrDefine && ($data.attrDefine.readonly || !$data.canSearch), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.text = $event), placeholder: $data.defaultText, onClick: _cache[1] || (_cache[1] = ($event) => $data.attrDefine && !$data.attrDefine.readonly && !$data.canSearch && $options.showDialog($event)), onKeydown: _cache[2] || (_cache[2] = ($event) => $options.search($event)), autocomplete: "off" }, null, 40, _hoisted_1$P), [ [vue.vModelText, $data.text] ]), vue.createElementVNode("div", { class: "ddei-editor-quick-fat-item-fontfamily_combox", onClick: _cache[3] || (_cache[3] = ($event) => $data.attrDefine && !$data.attrDefine.readonly && $options.showDialog($event)) }, _cache[4] || (_cache[4] = [ vue.createElementVNode("svg", { class: "icon iconfont-45", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-expand2" }) ], -1) ])) ], 2) ]); } const QBTFontFamily = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$P], ["__scopeId", "data-v-ec936992"]]); const _DDeiCoreEditFontFamilyButton = class _DDeiCoreEditFontFamilyButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTFontFamily.name); __publicField3(this, "plugins", [QBTFontFamily]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTFontFamily.name]) { for (let i2 in options[QBTFontFamily.name]) { newOptions[i2] = options[QBTFontFamily.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreEditFontFamilyButton(newOptions); return panels; } } return _DDeiCoreEditFontFamilyButton; } static modify(fn) { return _DDeiCoreEditFontFamilyButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreEditFontFamilyButton, "defaultIns", new _DDeiCoreEditFontFamilyButton(null)); let DDeiCoreEditFontFamilyButton = _DDeiCoreEditFontFamilyButton; const _sfc_main$O = { name: "ddei-core-btn-fontsize", extends: null, mixins: [], components: {}, props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, dataSource: null, value: null, text: null, defaultText: null, expanded: false, canSearch: true }; }, computed: {}, watch: {}, created() { this.$watch("editor.textEditorSelectedChange", function(newVal, oldVal) { if (newVal) { this.refreshEditor(); } }); }, mounted() { this.refreshEditor(); }, methods: { refreshEditor() { var _a3; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get("font.size"); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; } } else { this.attrDefine = null; } if (this.attrDefine) { this.getDataSource(this.attrDefine); let type = this.getDataValue(); let define2 = this.getDataDefine(type.value); if (!type.isDefault) { this.attrDefine.value = type.value; this.text = define2.text; } else { this.defaultText = define2.text; } if (this.attrDefine.value) { this.value = this.attrDefine.value; this.text = this.attrDefine.value; } else { this.value = type.value; } } }, inputValue(value) { var _a3, _b2; let dialogSet = false; if (value) { dialogSet = true; this.attrDefine.value = value; let itemDefine = this.getDataDefine(value); let text2 = itemDefine.text; this.text = text2; this.value = value; } else { value = this.text; this.attrDefine.value = value; this.value = value; let itemDefine = this.getDataDefine(value); if (itemDefine == null ? void 0 : itemDefine.text) { this.text = itemDefine.text; } } let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); parsedValue = isNaN(parsedValue) || parsedValue <= 0 ? null : parsedValue; parsedValue = parsedValue > 300 ? 300 : parsedValue; let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue); this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); if (dialogSet) { setTimeout(() => { editorText.focus(); }, 20); } hasEditSetted = true; } } } if (!hasEditSetted) { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, null, true ); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); }, //打开弹出框 showDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectfontsize", { dataSource: this.dataSource, value: this.attrDefine.value, group: "property-dialog", callback: { ok: this.inputValue } }, { type: 5 }, srcElement, false, true); }, /** * 根据值获取选项定义 * @param value 值 */ getDataDefine(value) { if (this.dataSource && value) { for (let i2 = 0; i2 < this.dataSource.length; i2++) { if (this.dataSource[i2].value.toString() == value.toString()) { return this.dataSource[i2]; } } } return { text: "" }; }, //获取数据值 getDataValue() { var _a3, _b2, _c2; if (this.attrDefine) { if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths); if (value === void 0) { value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true); return { isDefault: true, value }; } else { return { value }; } } } } let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList( this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping ); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_c2 = this.attrDefine) == null ? void 0 : _c2.getParser().getDefaultValue() }; }, /** * 获取数据源数据 */ getDataSource(attrDefine) { if (this.attrDefine) { this.attrDefine.dataSource = [ { text: "9", value: 9 }, { text: "10", value: 10 }, { text: "10.5", value: 10.5 }, { text: "11", value: 11 }, { text: "12", value: 12 }, { text: "13", value: 13 }, { text: "14", value: 14 }, { text: "18", value: 18 }, { text: "24", value: 24 }, { text: "36", value: 36 }, { text: "48", value: 48 }, { text: "64", value: 64 }, { text: "72", value: 72 }, { text: "96", value: 96 }, { text: "144", value: 144 }, { text: "288", value: 288 } ]; let dataSources = DDeiEditorUtil.getDataSource( this.editor, this.attrDefine, this.searchText ); this.dataSource = dataSources; return this.dataSource; } } } }; const QBTFontSize_vue_vue_type_style_index_0_scoped_4fcf2a95_lang = ""; const _hoisted_1$O = ["readonly", "placeholder"]; function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", null, [ vue.createElementVNode("div", { id: "ddei-editor-quick-fat-item-fontsize", class: vue.normalizeClass({ "ddei-editor-quick-fat-item-fontsize": true, "ddei-editor-quick-fat-item-fontsize--disabled": !$data.attrDefine }) }, [ vue.withDirectives(vue.createElementVNode("input", { class: "ddei-editor-quick-fat-item-fontsize_input", readonly: !$data.attrDefine || $data.attrDefine && $data.attrDefine.readonly, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.text = $event), onInput: _cache[1] || (_cache[1] = ($event) => $options.inputValue()), placeholder: $data.defaultText, autocomplete: "off" }, null, 40, _hoisted_1$O), [ [vue.vModelText, $data.text] ]), vue.createElementVNode("div", { class: "ddei-editor-quick-fat-item-fontsize_combox", onClick: _cache[2] || (_cache[2] = ($event) => $data.attrDefine && !$data.attrDefine.readonly && $options.showDialog($event)) }, _cache[3] || (_cache[3] = [ vue.createElementVNode("svg", { class: "icon iconfont-45", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-expand2" }) ], -1) ])) ], 2) ]); } const QBTFontSize = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$O], ["__scopeId", "data-v-4fcf2a95"]]); const _DDeiCoreEditFontSizeButton = class _DDeiCoreEditFontSizeButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTFontSize.name); __publicField3(this, "plugins", [QBTFontSize]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTFontSize.name]) { for (let i2 in options[QBTFontSize.name]) { newOptions[i2] = options[QBTFontSize.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreEditFontSizeButton(newOptions); return panels; } } return _DDeiCoreEditFontSizeButton; } static modify(fn) { return _DDeiCoreEditFontSizeButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreEditFontSizeButton, "defaultIns", new _DDeiCoreEditFontSizeButton(null)); let DDeiCoreEditFontSizeButton = _DDeiCoreEditFontSizeButton; const _sfc_main$N = { name: "ddei-core-btn-linepointtype", extends: null, mixins: [], components: {}, props: { attrCode: { type: String, default: null }, extcls: { type: String, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, value: null, text: "" }; }, computed: {}, watch: {}, created() { }, mounted() { this.refreshEditor(); }, methods: { refreshText() { var _a3; let text2 = ""; if ((_a3 = this.attrDefine) == null ? void 0 : _a3.dataSource) { for (let i2 = 0; i2 < this.attrDefine.dataSource.length; i2++) { if (this.attrDefine.dataSource[i2].value == this.value) { text2 = this.attrDefine.dataSource[i2].text; break; } } } this.text = text2; }, refreshEditor() { var _a3; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get(this.attrCode); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; let valueDefine = this.getDataValue(); if (valueDefine && !valueDefine.isDefault) { this.value = valueDefine.value; } } } else { this.attrDefine = null; } this.refreshText(); }, //打开弹出框 showDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-linepointtype", { value: this.attrDefine.value, dataSource: this.attrDefine.dataSource, callback: { ok: this.valueChange }, group: "property-dialog" }, { type: 5 }, srcElement, false, true); }, //获取数据值 getDataValue() { var _a3; if (this.attrDefine) { let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_a3 = this.attrDefine) == null ? void 0 : _a3.getParser().getDefaultValue() }; }, valueChange(value) { var _a3, _b2; this.value = value; this.attrDefine.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, null, true); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); this.refreshText(); } } }; const QBTLinePointType_vue_vue_type_style_index_0_scoped_5b25a083_lang = ""; const _hoisted_1$N = { class: "div_input" }; function _sfc_render$N(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei_pv_line_point_combox": true, "ddei_pv_line_point_combox_disabled": !$data.attrDefine || $data.attrDefine.readonly }) }, [ vue.createElementVNode("div", { class: "textinput", onClick: _cache[0] || (_cache[0] = ($event) => $data.attrDefine && !$data.attrDefine.readonly && $options.showDialog($event)) }, [ vue.createElementVNode("div", _hoisted_1$N, vue.toDisplayString($data.text), 1), _cache[1] || (_cache[1] = vue.createElementVNode("div", { style: { "display": "flex", "justify-content": "center", "align-items": "center" } }, [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ]) ], -1)) ]) ], 2); } const QBTLinePointType = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$N], ["__scopeId", "data-v-5b25a083"]]); const _DDeiCoreEditLinePointTypeButton = class _DDeiCoreEditLinePointTypeButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTLinePointType.name); __publicField3(this, "plugins", [QBTLinePointType]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTLinePointType.name]) { for (let i2 in options[QBTLinePointType.name]) { newOptions[i2] = options[QBTLinePointType.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreEditLinePointTypeButton(newOptions); return panels; } } return _DDeiCoreEditLinePointTypeButton; } static modify(fn) { return _DDeiCoreEditLinePointTypeButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreEditLinePointTypeButton, "defaultIns", new _DDeiCoreEditLinePointTypeButton(null)); let DDeiCoreEditLinePointTypeButton = _DDeiCoreEditLinePointTypeButton; const _sfc_main$M = { name: "ddei-core-btn-linetype", extends: null, mixins: [], components: {}, props: { attrCode: { type: String, default: null }, extcls: { type: String, default: null }, img: { type: String, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, value: null }; }, computed: {}, watch: {}, created() { }, mounted() { this.refreshEditor(); }, methods: { refreshEditor() { var _a3; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get(this.attrCode); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; let valueDefine = this.getDataValue(); if (valueDefine && !valueDefine.isDefault) { this.value = valueDefine.value; } } } else { this.attrDefine = null; } }, //打开弹出框 showDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-linetype", { value: this.attrDefine.value, dataSource: this.attrDefine.dataSource, callback: { ok: this.valueChange }, group: "property-dialog" }, { type: 5 }, srcElement, false, true); }, //获取数据值 getDataValue() { var _a3, _b2, _c2; if (this.attrDefine) { if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths); if (value === void 0) { value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true); } return { value }; } } } let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_c2 = this.attrDefine) == null ? void 0 : _c2.getParser().getDefaultValue() }; }, valueChange(value) { var _a3, _b2; this.value = value; this.attrDefine.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue); this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); setTimeout(() => { editorText.focus(); }, 20); hasEditSetted = true; } } } if (!hasEditSetted) { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue }, null, true); }); } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } } }; const QBTLineType_vue_vue_type_style_index_0_scoped_739c83c3_lang = ""; const _hoisted_1$M = ["xlink:href"]; function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { onClick: _cache[0] || (_cache[0] = ($event) => $data.attrDefine && $options.showDialog($event)), class: vue.normalizeClass({ "ddei-pv-line-type-combox": true, "ddei-pv-line-type-combox--disabled": !$data.attrDefine || $data.attrDefine.readonly }) }, [ (vue.openBlock(), vue.createElementBlock("svg", { class: vue.normalizeClass("icon " + ($props.extcls ? $props.extcls : "")), "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#" + $props.img }, null, 8, _hoisted_1$M) ], 2)) ], 2); } const QBTLineType = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$M], ["__scopeId", "data-v-739c83c3"]]); const _DDeiCoreEditLineTypeButton = class _DDeiCoreEditLineTypeButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTLineType.name); __publicField3(this, "plugins", [QBTLineType]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTLineType.name]) { for (let i2 in options[QBTLineType.name]) { newOptions[i2] = options[QBTLineType.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreEditLineTypeButton(newOptions); return panels; } } return _DDeiCoreEditLineTypeButton; } static modify(fn) { return _DDeiCoreEditLineTypeButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreEditLineTypeButton, "defaultIns", new _DDeiCoreEditLineTypeButton(null)); let DDeiCoreEditLineTypeButton = _DDeiCoreEditLineTypeButton; const _sfc_main$L = { name: "ddei-core-btn-textalign", extends: null, mixins: [], components: {}, props: { img: { type: String, default: null }, extcls: { type: String, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null }, controlDefine: { type: Object, default: null } }, data() { return { attrDefine: null, valignAttrDefine: null, value: false }; }, computed: {}, watch: {}, created() { }, mounted() { this.refreshEditor(); }, methods: { showTextAlignDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-textalign", { group: "top-dialog", align: this.attrDefine.value, valign: this.valignAttrDefine.value, callback: { ok: this.valueChange } }, { type: 5 }, srcElement, false, true); }, refreshEditor() { var _a3; if (this.controlDefine) { let attrD = this.controlDefine.attrDefineMap.get("textStyle.align"); let mds = []; if (((_a3 = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { mds = Array.from(this.editor.ddInstance.stage.selectedModels.values()); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD == null ? void 0 : attrD.code }, this.editor.ddInstance); if (rsState != -1) { this.attrDefine = attrD; this.valignAttrDefine = this.controlDefine.attrDefineMap.get( "textStyle.valign" ); } } else { this.attrDefine = null; this.valignAttrDefine = null; } }, valueChange(value = 5) { switch (value) { case 1: this.attrDefine.value = 1; this.valignAttrDefine.value = 1; break; case 2: this.attrDefine.value = 2; this.valignAttrDefine.value = 1; break; case 3: this.attrDefine.value = 3; this.valignAttrDefine.value = 1; break; case 4: this.attrDefine.value = 1; this.valignAttrDefine.value = 2; break; case 5: this.attrDefine.value = 2; this.valignAttrDefine.value = 2; break; case 6: this.attrDefine.value = 3; this.valignAttrDefine.value = 2; break; case 7: this.attrDefine.value = 1; this.valignAttrDefine.value = 3; break; case 8: this.attrDefine.value = 2; this.valignAttrDefine.value = 3; break; case 9: this.attrDefine.value = 3; this.valignAttrDefine.value = 3; break; } this.editor.ddInstance.stage.selectedModels.forEach((element) => { var _a3, _b2, _c2, _d2; let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.mapping) == null ? void 0 : _b2.forEach((element2) => { paths.push(element2); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let paths1 = []; (_d2 = (_c2 = this.valignAttrDefine) == null ? void 0 : _c2.mapping) == null ? void 0 : _d2.forEach((element2) => { paths1.push(element2); }); if (!((paths1 == null ? void 0 : paths1.length) > 0)) { paths1 = [this.valignAttrDefine.code]; } this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: this.attrDefine.value }, null, true ); this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: paths1, value: this.valignAttrDefine.value }, null, true ); }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.executeAll(); } } }; const QBTEditTextAlign_vue_vue_type_style_index_0_scoped_781d8566_lang = ""; const _hoisted_1$L = ["xlink:href"]; function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-editor-quick-fat-item-box": true, "ddei-editor-quick-fat-item-box--disabled": !($data.attrDefine || $data.valignAttrDefine) }), onClick: _cache[0] || (_cache[0] = ($event) => ($data.attrDefine || $data.valignAttrDefine) && $options.showTextAlignDialog($event)) }, [ (vue.openBlock(), vue.createElementBlock("svg", { class: vue.normalizeClass("icon " + ($props.extcls ? $props.extcls : "")), "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#" + $props.img }, null, 8, _hoisted_1$L) ], 2)) ], 2); } const QBTEditTextAlign = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$L], ["__scopeId", "data-v-781d8566"]]); const _DDeiCoreEditTextAlignButton = class _DDeiCoreEditTextAlignButton extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QBTEditTextAlign.name); __publicField3(this, "plugins", [QBTEditTextAlign]); } getComponents(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QBTEditTextAlign.name]) { for (let i2 in options[QBTEditTextAlign.name]) { newOptions[i2] = options[QBTEditTextAlign.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreEditTextAlignButton(newOptions); return panels; } } return _DDeiCoreEditTextAlignButton; } static modify(fn) { return _DDeiCoreEditTextAlignButton.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreEditTextAlignButton, "defaultIns", new _DDeiCoreEditTextAlignButton(null)); let DDeiCoreEditTextAlignButton = _DDeiCoreEditTextAlignButton; const _DDeiCoreComponents = class _DDeiCoreComponents extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ DDeiCoreAddFontSizeButton, DDeiCoreBorderDashButton, DDeiCoreBorderWeightButton, DDeiCoreEditBoxButton, DDeiCoreEditColorButton, DDeiCoreEditFontFamilyButton, DDeiCoreEditFontSizeButton, DDeiCoreEditLinePointTypeButton, DDeiCoreEditLineTypeButton, DDeiCoreEditTextAlignButton ]); } getComponents(editor) { var _a3; let components = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getComponents(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getComponents(editor); } if ((ls == null ? void 0 : ls.length) > 0) { components = components.concat(ls); } }); return components; } static configuration(options) { var _a3; if (options) { let components = new _DDeiCoreComponents(options); for (let i2 = 0; i2 < ((_a3 = components.plugins) == null ? void 0 : _a3.length); i2++) { components.plugins[i2] = components.plugins[i2].configuration(options, true); } return components; } return _DDeiCoreComponents; } static modify(fn) { return _DDeiCoreComponents.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreComponents, "defaultIns", new _DDeiCoreComponents(null)); let DDeiCoreComponents = _DDeiCoreComponents; const _sfc_main$K = { name: "ddei-core-layout-standard", extends: null, mixins: [], props: { options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { dragObj: null, changeIndex: -1, allowOpenMultFiles: true, allowQuickColor: true, initLeftWidth: 0, initRightWidth: 0, toolboxShow: true, propertyViewShow: true, leftComponents: [], rightComponents: [], topComponents: [], bottomComponents: [], middleComponents: [] }; }, //注册组件 components: {}, computed: {}, watch: {}, created() { this.$watch("editor.leftWidth", function(newVal, oldVal) { this.$refs.left.style.flexBasis = newVal + "px"; }); this.$watch("editor.rightWidth", function(newVal, oldVal) { this.$refs.right.style.flexBasis = newVal + "px"; }); this.$watch("editor.topHeight", function(newVal, oldVal) { this.$refs.top.style.flexBasis = newVal + "px"; }); this.$watch("editor.bottomHeight", function(newVal, oldVal) { this.$refs.bottom.style.flexBasis = newVal + "px"; }); this.leftComponents = vue.markRaw(this.editor.getPartPanels(this.options, "left")); this.rightComponents = vue.markRaw(this.editor.getPartPanels(this.options, "right")); this.topComponents = vue.markRaw(this.editor.getPartPanels(this.options, "top")); this.bottomComponents = vue.markRaw(this.editor.getPartPanels(this.options, "bottom")); this.middleComponents = vue.markRaw(this.editor.getPartPanels(this.options, "middle")); }, mounted() { this.editor.layoutViewer = this; let middleCanvas = document.getElementById(this.editor.id + "_canvas"); const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { const { width, height } = entry.contentRect; if (width != 0 && height != 0) { this.editor.ddInstance.render.setSize( width, height, 0, 0 ); this.editor.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.ddInstance.bus.executeAll(); } } }); resizeObserver.observe(middleCanvas); this.editor.leftWidth = this.$refs.left.offsetWidth; this.editor.rightWidth = this.$refs.right.offsetWidth; this.editor.topHeight = this.$refs.top.offsetHeight; this.editor.bottomHeight = this.$refs.bottom.offsetHeight; this.editor.middleWidth = this.$refs.middle.offsetWidth; this.editor.middleHeight = this.$refs.middle.offsetHeight; this.initLeftWidth = this.$refs.left.offsetWidth; this.initRightWidth = this.$refs.right.offsetWidth; this.editor.maxWidth = this.editor.leftWidth + this.editor.rightWidth + this.editor.middleWidth; let ddInstance = this.editor.ddInstance; if (ddInstance) { let modeName = DDeiUtil.getConfigValue("MODE_NAME", ddInstance); let accessCreate = DDeiUtil.isAccess( DDeiEnumOperateType.CREATE, null, null, modeName, ddInstance ); this.toolboxShow = accessCreate; let accessEdit = DDeiUtil.isAccess( DDeiEnumOperateType.EDIT, null, null, modeName, ddInstance ); this.propertyViewShow = accessEdit; } }, methods: { //强制刷新下层组件 forceRefreshParts(parts) { let arr = [this.$refs.topComponents, this.$refs.leftComponents, this.$refs.middleComponents, this.$refs.rightComponents, this.$refs.bottomComponents]; arr.forEach((comps) => { if (comps) { if (Array.isArray(comps)) { comps.forEach((comp) => { if (comp && comp.forceRefreshParts) { comp.forceRefreshParts(parts); } }); } else if (comps.forceRefreshParts) { comps.forceRefreshParts(parts); } } }); } // resetSize() { // let layoutRoot = this.$refs.layoutRoot; // let width = layoutRoot.scrollWidth // let height = layoutRoot.scrollHeight // if (!window.upSizeWidth || !window.upSizeHeight) { // window.upSizeWidth = width; // window.upSizeHeight = height; // } else { // let deltaWidth = width - window.upSizeWidth; // let deltaHeight = height - window.upSizeHeight; // if (this.editor.middleWidth + deltaWidth >= 305) { // window.upSizeWidth = width; // this.editor.middleWidth += deltaWidth; // this.editor.maxWidth = // this.editor.leftWidth + // this.editor.rightWidth + // this.editor.middleWidth; // } // if (this.editor.middleHeight + deltaHeight >= 305) { // window.upSizeHeight = height; // this.editor.middleHeight += deltaHeight; // this.editor.maxHeight = // this.editor.leftHeight + // this.editor.rightHeight + // this.editor.middleHeight; // } // this.editor.ddInstance.render.setSize( // this.editor.middleWidth, // this.editor.middleHeight, // 0, // 0 // ); // this.editor.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); // this.editor.ddInstance.bus.executeAll(); // } // }, } }; const StandardLayout_vue_vue_type_style_index_0_scoped_43088579_lang = ""; const StandardLayout_vue_vue_type_style_index_1_lang = ""; const _hoisted_1$K = { class: "ddei-editor-layout-standrad", ref: "layoutRoot" }; const _hoisted_2$C = { class: "top", ref: "top" }; const _hoisted_3$z = { class: "body" }; const _hoisted_4$s = { class: "left", ref: "left" }; const _hoisted_5$n = { class: "middle", ref: "middle" }; const _hoisted_6$i = { class: "right", ref: "right" }; const _hoisted_7$g = { class: "bottom", ref: "bottom" }; function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2; return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$K, [ vue.withDirectives(vue.createElementVNode("div", _hoisted_2$C, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.topComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "topComponents", editor: $props.editor }, item.options, { options: item.options }), null, 16, ["editor", "options"]); }), 256)) ], 512), [ [vue.vShow, ((_a3 = $data.topComponents) == null ? void 0 : _a3.length) > 0] ]), vue.createElementVNode("div", _hoisted_3$z, [ vue.withDirectives(vue.createElementVNode("div", _hoisted_4$s, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.leftComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "leftComponents", editor: $props.editor, options: item.options }, item.options), null, 16, ["editor", "options"]); }), 256)) ], 512), [ [vue.vShow, $data.toolboxShow && ((_b2 = $data.leftComponents) == null ? void 0 : _b2.length) > 0] ]), vue.withDirectives(vue.createElementVNode("div", _hoisted_5$n, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.middleComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "middleComponents", editor: $props.editor, options: item.options }, item.options), null, 16, ["editor", "options"]); }), 256)) ], 512), [ [vue.vShow, ((_c2 = $data.middleComponents) == null ? void 0 : _c2.length) > 0] ]), vue.withDirectives(vue.createElementVNode("div", _hoisted_6$i, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.rightComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "rightComponents", editor: $props.editor, options: item.options }, item.options), null, 16, ["editor", "options"]); }), 256)) ], 512), [ [vue.vShow, $data.propertyViewShow && ((_d2 = $data.rightComponents) == null ? void 0 : _d2.length) > 0] ]) ]), vue.withDirectives(vue.createElementVNode("div", _hoisted_7$g, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.bottomComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "bottomComponents", editor: $props.editor, options: item.options }, item.options), null, 16, ["editor", "options"]); }), 256)) ], 512), [ [vue.vShow, ((_e2 = $data.bottomComponents) == null ? void 0 : _e2.length) > 0] ]) ], 512); } const Layout$1 = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$K], ["__scopeId", "data-v-43088579"]]); const _DDeiCoreStandLayout = class _DDeiCoreStandLayout extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Layout$1.name); __publicField3(this, "defaultOptions", { top: ["ddei-core-panel-topmenu"], left: ["ddei-core-panel-toolbox"], middle: ["ddei-core-panel-canvasview"], right: ["ddei-core-panel-propertyview"], bottom: ["ddei-core-panel-bottommenu"] }); __publicField3(this, "plugins", [Layout$1]); } getLayouts(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreStandLayout.defaultIns.defaultOptions); if (fullConfig) { if (fullConfig) { if (options[Layout$1.name]) { for (let i2 in options[Layout$1.name]) { newOptions[i2] = options[Layout$1.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreStandLayout(newOptions); return layouts; } } return _DDeiCoreStandLayout; } static modify(fn) { return _DDeiCoreStandLayout.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreStandLayout, "defaultIns", new _DDeiCoreStandLayout()); let DDeiCoreStandLayout = _DDeiCoreStandLayout; const _sfc_main$J = { name: "ddei-core-layout-simple", extends: null, mixins: [], props: { options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { otherComponents: [], topComponents: [], bottomComponents: [], middleComponents: [] }; }, //注册组件 components: {}, computed: {}, watch: {}, created() { this.otherComponents = vue.markRaw(this.editor.getPartPanels(this.options, "other")); this.topComponents = vue.markRaw(this.editor.getPartPanels(this.options, "top")); this.bottomComponents = vue.markRaw(this.editor.getPartPanels(this.options, "bottom")); this.middleComponents = vue.markRaw(this.editor.getPartPanels(this.options, "middle")); }, mounted() { this.editor.layoutViewer = this; let middleCanvas = document.getElementById(this.editor.id + "_canvas"); const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { const { width, height } = entry.contentRect; if (width != 0 && height != 0) { this.editor.ddInstance.render.setSize( width, height, 0, 0 ); this.editor.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.ddInstance.bus.executeAll(); } } }); resizeObserver.observe(middleCanvas); this.editor.topHeight = this.$refs.top.offsetHeight; this.editor.bottomHeight = this.$refs.bottom.offsetHeight; this.editor.middleWidth = this.$refs.middle.offsetWidth; this.editor.middleHeight = this.$refs.middle.offsetHeight; let ddInstance = this.editor.ddInstance; if (ddInstance) { let modeName = DDeiUtil.getConfigValue("MODE_NAME", ddInstance); let accessCreate = DDeiUtil.isAccess( DDeiEnumOperateType.CREATE, null, null, modeName, ddInstance ); this.toolboxShow = accessCreate; let accessEdit = DDeiUtil.isAccess( DDeiEnumOperateType.EDIT, null, null, modeName, ddInstance ); this.propertyViewShow = accessEdit; } }, methods: { //强制刷新下层组件 forceRefreshParts(parts) { let arr = [this.$refs.topComponents, this.$refs.middleComponents, this.$refs.otherComponents, this.$refs.bottomComponents]; arr.forEach((comps) => { if (comps) { if (Array.isArray(comps)) { comps.forEach((comp) => { if (comp && comp.forceRefreshParts) { comp.forceRefreshParts(parts); } }); } else if (comps.forceRefreshParts) { comps.forceRefreshParts(parts); } } }); } } }; const SimpleLayout_vue_vue_type_style_index_0_scoped_4920d2e1_lang = ""; const SimpleLayout_vue_vue_type_style_index_1_lang = ""; const _hoisted_1$J = { class: "ddei-editor-layout-simple", ref: "layoutRoot" }; const _hoisted_2$B = { class: "top", ref: "top" }; const _hoisted_3$y = { class: "middle", ref: "middle" }; const _hoisted_4$r = { class: "bottom", ref: "bottom" }; function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$J, [ vue.createElementVNode("div", _hoisted_2$B, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.topComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "topComponents", editor: $props.editor }, item.options, { options: item.options }), null, 16, ["editor", "options"]); }), 256)) ], 512), vue.createElementVNode("div", _hoisted_3$y, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.middleComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "middleComponents", editor: $props.editor, options: item.options }, item.options), null, 16, ["editor", "options"]); }), 256)), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.otherComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "otherComponents", editor: $props.editor, options: item.options }, item.options), null, 16, ["editor", "options"]); }), 256)) ], 512), vue.createElementVNode("div", _hoisted_4$r, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.bottomComponents, (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.comp), vue.mergeProps({ ref_for: true, ref: "bottomComponents", editor: $props.editor, options: item.options }, item.options), null, 16, ["editor", "options"]); }), 256)) ], 512) ], 512); } const Layout = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$J], ["__scopeId", "data-v-4920d2e1"]]); const _DDeiCoreSimpleLayout = class _DDeiCoreSimpleLayout extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", Layout.name); __publicField3(this, "defaultOptions", { other: ["ddei-core-panel-toolbox-simple", "ddei-core-panel-topmenu-simple"], middle: ["ddei-core-panel-canvasview"], top: [], bottom: [] }); __publicField3(this, "plugins", [Layout]); } getLayouts(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreSimpleLayout.defaultIns.defaultOptions); if (fullConfig) { if (fullConfig) { if (options[Layout.name]) { for (let i2 in options[Layout.name]) { newOptions[i2] = options[Layout.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreSimpleLayout(newOptions); return layouts; } } return _DDeiCoreSimpleLayout; } static modify(fn) { return _DDeiCoreSimpleLayout.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSimpleLayout, "defaultIns", new _DDeiCoreSimpleLayout()); let DDeiCoreSimpleLayout = _DDeiCoreSimpleLayout; const _DDeiCoreLayouts = class _DDeiCoreLayouts extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [DDeiCoreStandLayout, DDeiCoreSimpleLayout]); } getLayouts(editor) { var _a3; let layouts = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getLayouts(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getLayouts(editor); } if ((ls == null ? void 0 : ls.length) > 0) { layouts = layouts.concat(ls); } }); return layouts; } static configuration(options) { var _a3; let layouts = new _DDeiCoreLayouts(options); for (let i2 = 0; i2 < ((_a3 = layouts.plugins) == null ? void 0 : _a3.length); i2++) { layouts.plugins[i2] = layouts.plugins[i2].configuration(options, true); } return layouts; } static modify(fn) { return _DDeiCoreLayouts.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreLayouts, "defaultIns", new _DDeiCoreLayouts(null)); let DDeiCoreLayouts = _DDeiCoreLayouts; const DialogBase$2 = { props: { editor: { type: DDeiEditor, default: null } }, data: function() { return { forceRefresh: false }; }, methods: { forceRefreshView: function() { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); } }, mounted() { this.editor.dialogs[this.dialogId].viewer = this; } }; const _sfc_main$I = { name: "ddei-core-dialog-align", extends: null, mixins: [DialogBase$2], props: { options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-align" }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { /** * 修改对齐方式 */ changeAlign(v) { var _a3; let file = this.editor.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_a3 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _a3.size) > 0) { this.editor.bus.push(DDeiEnumBusCommandType.ModelAlign, { models: Array.from(stage2.selectedModels.values()), value: v }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } }, /** * 自动分布 */ doAutoPos(type) { var _a3; let file = this.editor.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_a3 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _a3.size) > 0) { this.editor.bus.push(DDeiEnumBusCommandType.ModelAutoPos, { models: Array.from(stage2.selectedModels.values()), value: type }); this.editor.bus.executeAll(); } } } }; const AlignDialog_vue_vue_type_style_index_0_scoped_6574182d_lang = ""; const _hoisted_1$I = ["id"]; const _hoisted_2$A = { class: "content" }; const _hoisted_3$x = { class: "title" }; const _hoisted_4$q = { class: "group" }; const _hoisted_5$m = { class: "title" }; const _hoisted_6$h = { class: "group_content" }; const _hoisted_7$f = { class: "group" }; const _hoisted_8$c = { class: "title" }; const _hoisted_9$b = { class: "group_content" }; function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-align" }, [ vue.createElementVNode("div", _hoisted_2$A, [ vue.createElementVNode("div", _hoisted_3$x, vue.toDisplayString(_ctx.editor.i18n("ddei.align")), 1), vue.createElementVNode("div", _hoisted_4$q, [ vue.createElementVNode("div", _hoisted_5$m, vue.toDisplayString(_ctx.editor.i18n("ddei.align")) + ":", 1), vue.createElementVNode("div", _hoisted_6$h, [ vue.createElementVNode("div", { class: "item", onClick: _cache[0] || (_cache[0] = ($event) => $options.changeAlign("left")) }, _cache[8] || (_cache[8] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shape-align-left" }) ], -1) ])), vue.createElementVNode("div", { class: "item", onClick: _cache[1] || (_cache[1] = ($event) => $options.changeAlign("center")) }, _cache[9] || (_cache[9] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shape-align-v" }) ], -1) ])), vue.createElementVNode("div", { class: "item", onClick: _cache[2] || (_cache[2] = ($event) => $options.changeAlign("right")) }, _cache[10] || (_cache[10] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shape-align-right" }) ], -1) ])), vue.createElementVNode("div", { class: "item", onClick: _cache[3] || (_cache[3] = ($event) => $options.changeAlign("top")) }, _cache[11] || (_cache[11] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shape-align-top" }) ], -1) ])), vue.createElementVNode("div", { class: "item", onClick: _cache[4] || (_cache[4] = ($event) => $options.changeAlign("middle")) }, _cache[12] || (_cache[12] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shape-align-h" }) ], -1) ])), vue.createElementVNode("div", { class: "item", onClick: _cache[5] || (_cache[5] = ($event) => $options.changeAlign("bottom")) }, _cache[13] || (_cache[13] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shape-align-bottom" }) ], -1) ])) ]) ]), vue.createElementVNode("div", _hoisted_7$f, [ vue.createElementVNode("div", _hoisted_8$c, vue.toDisplayString(_ctx.editor.i18n("ddei.sort")) + ":", 1), vue.createElementVNode("div", _hoisted_9$b, [ vue.createElementVNode("div", { class: "item", onClick: _cache[6] || (_cache[6] = ($event) => $options.doAutoPos(2)) }, _cache[14] || (_cache[14] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shape-equ-dist-v" }) ], -1) ])), vue.createElementVNode("div", { class: "item", onClick: _cache[7] || (_cache[7] = ($event) => $options.doAutoPos(1)) }, _cache[15] || (_cache[15] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shape-equ-dist-h" }) ], -1) ])) ]) ]) ]) ], 8, _hoisted_1$I)) : vue.createCommentVNode("", true); } const AlignDialog$1 = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$I], ["__scopeId", "data-v-6574182d"]]); const _DDeiCoreAlignDialog = class _DDeiCoreAlignDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", AlignDialog$1.name); __publicField3(this, "plugins", [AlignDialog$1]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[AlignDialog$1.name]) { for (let i2 in options[AlignDialog$1.name]) { newOptions[i2] = options[AlignDialog$1.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreAlignDialog(newOptions); return panels; } } return _DDeiCoreAlignDialog; } static modify(fn) { return _DDeiCoreAlignDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreAlignDialog, "defaultIns", new _DDeiCoreAlignDialog(null)); let DDeiCoreAlignDialog = _DDeiCoreAlignDialog; const _sfc_main$H = { name: "ddei-core-dialog-changeratio", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, input: { type: Boolean, default: true }, min: { type: Number, default: 0.1 }, max: { type: Number, default: 10 }, dataSource: { type: Array, default: [ { text: "400%", value: 4 }, { text: "200%", value: 2 }, { text: "150%", value: 1.5 }, { text: "125%", value: 1.25 }, { text: "100%", value: 1 }, { text: "75%", value: 0.75 }, { text: "50%", value: 0.5 }, { text: "25%", value: 0.25 } ] } }, data() { return { dialogId: "ddei-core-dialog-changeratio", ratioInputValue: 100, iMin: 0.1, iMax: 10 }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId])) { if (this.editor.tempDialogData[this.dialogId].min || this.editor.tempDialogData[this.dialogId].min == 0) { this.iMin = this.editor.tempDialogData[this.dialogId].min; } else if (this.min || this.min == 0) { this.iMin = this.min; } if (this.editor.tempDialogData[this.dialogId].max || this.editor.tempDialogData[this.dialogId].max == 0) { this.iMax = this.editor.tempDialogData[this.dialogId].max; } else if (this.max || this.max == 0) { this.iMax = this.max; } if (this.editor.tempDialogData[this.dialogId].ratio > this.iMax) { this.ratioInputValue = this.iMax * 100; } else if (this.editor.tempDialogData[this.dialogId].ratio < this.iMin) { this.ratioInputValue = this.iMin * 100; } else { this.ratioInputValue = this.editor.tempDialogData[this.dialogId].ratio * 100; } } }, ok(data) { var _a3, _b2, _c2, _d2, _e2, _f; if (!data) { data = 1; } this.ratioInputValue = data * 100; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(data); } }, ratioInputChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f; if (!evt || evt.keyCode == 13) { if (this.ratioInputValue > this.max * 100) { this.ratioInputValue = this.max * 100; } else if (this.ratioInputValue < this.min * 100) { this.ratioInputValue = this.min * 100; } if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.ratioInputValue / 100); } } } } }; const ChangeRatioDialog_vue_vue_type_style_index_0_scoped_561a0908_lang = ""; const _hoisted_1$H = ["id"]; const _hoisted_2$z = { class: "content" }; const _hoisted_3$w = { class: "title" }; const _hoisted_4$p = { class: "group" }; const _hoisted_5$l = { class: "group_content" }; const _hoisted_6$g = ["onClick"]; const _hoisted_7$e = { key: 0, class: "item", style: { "flex": "1", "border-top": "1px solid var(--panel-border)" } }; const _hoisted_8$b = ["min", "max"]; function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-changeratio" }, [ vue.createElementVNode("div", _hoisted_2$z, [ vue.createElementVNode("div", _hoisted_3$w, vue.toDisplayString(_ctx.editor.i18n("ddei.scale")), 1), vue.createElementVNode("div", _hoisted_4$p, [ vue.createElementVNode("div", _hoisted_5$l, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.dataSource, (data) => { return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item_selected": $data.ratioInputValue / 100 == data.value }), onClick: ($event) => $options.ok(data.value) }, vue.toDisplayString(data.text), 11, _hoisted_6$g)), [ [vue.vShow, (data == null ? void 0 : data.value) >= $data.iMin && (data == null ? void 0 : data.value) <= $data.iMax] ]); }), 256)), $props.input ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$e, [ vue.createTextVNode(vue.toDisplayString(_ctx.editor.i18n("ddei.precent")) + ":", 1), vue.withDirectives(vue.createElementVNode("input", { type: "number", min: $data.iMin * 100, max: $data.iMax * 100, onKeydown: _cache[0] || (_cache[0] = ($event) => $options.ratioInputChange($event)), "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.ratioInputValue = $event), onBlur: _cache[2] || (_cache[2] = ($event) => $options.ratioInputChange()), autocomplete: "off", name: "ddei_bottom_input" }, null, 40, _hoisted_8$b), [ [vue.vModelText, $data.ratioInputValue] ]), _cache[3] || (_cache[3] = vue.createTextVNode("% ")) ])) : vue.createCommentVNode("", true) ]) ]) ]) ], 8, _hoisted_1$H)) : vue.createCommentVNode("", true); } const ChangeRatioDialog = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$H], ["__scopeId", "data-v-561a0908"]]); const _DDeiCoreChangeRatioDialog = class _DDeiCoreChangeRatioDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ChangeRatioDialog.name); __publicField3(this, "plugins", [ChangeRatioDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ChangeRatioDialog.name]) { for (let i2 in options[ChangeRatioDialog.name]) { newOptions[i2] = options[ChangeRatioDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreChangeRatioDialog(newOptions); return panels; } } return _DDeiCoreChangeRatioDialog; } static modify(fn) { return _DDeiCoreChangeRatioDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreChangeRatioDialog, "defaultIns", new _DDeiCoreChangeRatioDialog(null)); let DDeiCoreChangeRatioDialog = _DDeiCoreChangeRatioDialog; const _sfc_main$G = { name: "ddei-core-dialog-choosecontrolgroup", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-choosecontrolgroup", subGroups: null, menuId: null, selectGroups: [] }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2; this.menuId = null; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId]) == null ? void 0 : _c2.selectGroups)) { this.selectGroups = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId].selectGroups; } }, expandSubMenu(menuid, evt) { if (this.menuId != menuid) { let groups = []; this.editor.groups.forEach((group2) => { if (group2.subject == menuid) { let ginfo = { id: group2.id, name: group2.name }; if (this.selectGroups.indexOf(group2.id) != -1) { ginfo.selected = true; } else { ginfo.selected = false; } groups.push(ginfo); } }); this.subGroups = groups; this.menuId = menuid; let srcElement = evt.currentTarget; setTimeout(() => { let dialogEle = document.getElementById(this.editor.id + "_ddei-core-dialog-choosecontrolgroup"); let subContentEle = document.getElementById(this.editor.id + "_ddei-core-dialog-choosecontrolgroup_subcontent"); subContentEle.style.display = "block"; let dialogDomPos = DDeiUtil.getDomAbsPosition(dialogEle); let domPos = DDeiUtil.getDomAbsPosition(srcElement); subContentEle.style.left = domPos.left - dialogDomPos.left + srcElement.clientWidth + "px"; subContentEle.style.top = domPos.top - dialogDomPos.top + "px"; }, 50); } }, chooseGroup(groupid) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let ginfo = null; for (let i2 = 0; i2 < this.subGroups.length; i2++) { if (this.subGroups[i2].id == groupid) { ginfo = this.subGroups[i2]; break; } } if (ginfo) { ginfo.selected = !ginfo.selected; if (ginfo.selected) { if (this.selectGroups.indexOf(ginfo.id) == -1) { this.selectGroups.push(ginfo.id); if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.select) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.select(ginfo.id, true); } } } else { if (this.selectGroups.indexOf(ginfo.id) != -1) { this.selectGroups.splice(this.selectGroups.indexOf(ginfo.id), 1); if ((_i = (_h = (_g = this.editor) == null ? void 0 : _g.tempDialogData[this.dialogId]) == null ? void 0 : _h.callback) == null ? void 0 : _i.select) { (_l = (_k = (_j = this.editor) == null ? void 0 : _j.tempDialogData[this.dialogId]) == null ? void 0 : _k.callback) == null ? void 0 : _l.select(ginfo.id, false); } } } } } } }; const ChooseControlGroupDialog_vue_vue_type_style_index_0_scoped_d0e0cfd9_lang = ""; const _hoisted_1$G = ["id"]; const _hoisted_2$y = { class: "content" }; const _hoisted_3$v = { class: "title" }; const _hoisted_4$o = { class: "group" }; const _hoisted_5$k = { class: "groupname" }; const _hoisted_6$f = { class: "groupname" }; const _hoisted_7$d = ["id"]; const _hoisted_8$a = { class: "group" }; const _hoisted_9$a = ["onClick"]; const _hoisted_10$5 = ["onUpdate:modelValue", "name"]; const _hoisted_11$5 = { class: "groupname" }; function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-choosecontrolgroup" }, [ vue.createElementVNode("div", _hoisted_2$y, [ vue.createElementVNode("div", _hoisted_3$v, vue.toDisplayString(_ctx.editor.i18n("ddei.chooseShapeGroups")), 1), vue.createElementVNode("div", _hoisted_4$o, [ vue.createElementVNode("div", { class: "item", onMousemove: _cache[0] || (_cache[0] = ($event) => $options.expandSubMenu("basic", $event)) }, [ _cache[2] || (_cache[2] = vue.createElementVNode("svg", { class: "icon groupicon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shapes-catalogy" }) ], -1)), vue.createElementVNode("div", _hoisted_5$k, vue.toDisplayString(_ctx.editor.i18n("ddei.basicSubject")), 1), _cache[3] || (_cache[3] = vue.createElementVNode("svg", { class: "icon expand", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-right" }) ], -1)) ], 32), vue.createElementVNode("div", { class: "item", onMousemove: _cache[1] || (_cache[1] = ($event) => $options.expandSubMenu("uml", $event)) }, [ _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon groupicon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-groups" }) ], -1)), vue.createElementVNode("div", _hoisted_6$f, vue.toDisplayString(_ctx.editor.i18n("ddei.umlSubject")), 1), _cache[5] || (_cache[5] = vue.createElementVNode("svg", { class: "icon expand", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-right" }) ], -1)) ], 32) ]) ]), vue.withDirectives(vue.createElementVNode("div", { class: "subcontent", id: ((_b2 = _ctx.editor) == null ? void 0 : _b2.id) + "_ddei-core-dialog-choosecontrolgroup_subcontent" }, [ vue.createElementVNode("div", _hoisted_8$a, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.subGroups, (group2) => { return vue.openBlock(), vue.createElementBlock("div", { class: "item", onClick: ($event) => $options.chooseGroup(group2.id) }, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": ($event) => group2.selected = $event, style: { "pointer-events": "none" }, name: group2.id, autocomplete: "off" }, null, 8, _hoisted_10$5), [ [vue.vModelCheckbox, group2.selected] ]), vue.createElementVNode("div", _hoisted_11$5, vue.toDisplayString(_ctx.editor.i18n(group2.name)), 1) ], 8, _hoisted_9$a); }), 256)) ]) ], 8, _hoisted_7$d), [ [vue.vShow, ((_c2 = $data.subGroups) == null ? void 0 : _c2.length) > 0] ]) ], 8, _hoisted_1$G)) : vue.createCommentVNode("", true); } const ChooseControlGroupDialog = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$G], ["__scopeId", "data-v-d0e0cfd9"]]); const _DDeiCoreChooseControlGroupDialog = class _DDeiCoreChooseControlGroupDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ChooseControlGroupDialog.name); __publicField3(this, "plugins", [ChooseControlGroupDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ChooseControlGroupDialog.name]) { for (let i2 in options[ChooseControlGroupDialog.name]) { newOptions[i2] = options[ChooseControlGroupDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreChooseControlGroupDialog(newOptions); return panels; } } return _DDeiCoreChooseControlGroupDialog; } static modify(fn) { return _DDeiCoreChooseControlGroupDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreChooseControlGroupDialog, "defaultIns", new _DDeiCoreChooseControlGroupDialog(null)); let DDeiCoreChooseControlGroupDialog = _DDeiCoreChooseControlGroupDialog; const _sfc_main$F = { name: "ddei-core-dialog-closefile", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-closefile" }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { ok() { var _a3, _b2, _c2, _d2, _e2, _f; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-closefile"); }, cancel() { var _a3, _b2, _c2; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.cancel) { this.editor.tempDialogData[this.dialogId].callback.cancel(); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-closefile"); }, abort() { var _a3, _b2, _c2; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.abort) { this.editor.tempDialogData[this.dialogId].callback.abort(); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-closefile"); } } }; const CloseFileConfirmDialog_vue_vue_type_style_index_0_scoped_929ef917_lang = ""; const _hoisted_1$F = ["id"]; const _hoisted_2$x = { class: "content" }; const _hoisted_3$u = { class: "header" }; const _hoisted_4$n = { class: "tail" }; function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-closefile" }, [ vue.createElementVNode("div", _hoisted_2$x, [ vue.createElementVNode("div", _hoisted_3$u, [ _cache[5] || (_cache[5] = vue.createElementVNode("svg", { class: "icon warn", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-warn" }) ], -1)), vue.createElementVNode("span", null, vue.toDisplayString(_ctx.editor.i18n("ddei.confirm-save-file")), 1), _cache[6] || (_cache[6] = vue.createElementVNode("div", { style: { "flex": "1" } }, null, -1)), (vue.openBlock(), vue.createElementBlock("svg", { class: "icon close", "aria-hidden": "true", onClick: _cache[0] || (_cache[0] = (...args) => $options.cancel && $options.cancel(...args)) }, _cache[4] || (_cache[4] = [ vue.createElementVNode("use", { "xlink:href": "#icon-close" }, null, -1) ]))) ]), _cache[7] || (_cache[7] = vue.createElementVNode("div", { class: "msg" }, null, -1)), vue.createElementVNode("div", _hoisted_4$n, [ vue.createElementVNode("div", { class: "button button-main", onClick: _cache[1] || (_cache[1] = (...args) => $options.ok && $options.ok(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.save")), 1), vue.createElementVNode("div", { class: "button", onClick: _cache[2] || (_cache[2] = (...args) => $options.abort && $options.abort(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.abort")), 1), vue.createElementVNode("div", { class: "button", onClick: _cache[3] || (_cache[3] = (...args) => $options.cancel && $options.cancel(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.cancel")), 1) ]) ]) ], 8, _hoisted_1$F)) : vue.createCommentVNode("", true); } const CloseFileConfirmDialog = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$F], ["__scopeId", "data-v-929ef917"]]); const _DDeiCoreCloseFileConfirmDialog = class _DDeiCoreCloseFileConfirmDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", CloseFileConfirmDialog.name); __publicField3(this, "plugins", [CloseFileConfirmDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[CloseFileConfirmDialog.name]) { for (let i2 in options[CloseFileConfirmDialog.name]) { newOptions[i2] = options[CloseFileConfirmDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreCloseFileConfirmDialog(newOptions); return panels; } } return _DDeiCoreCloseFileConfirmDialog; } static modify(fn) { return _DDeiCoreCloseFileConfirmDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreCloseFileConfirmDialog, "defaultIns", new _DDeiCoreCloseFileConfirmDialog(null)); let DDeiCoreCloseFileConfirmDialog = _DDeiCoreCloseFileConfirmDialog; const _sfc_main$E = { name: "ddei-core-dialog-collfile", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-collfile" }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { ok() { var _a3, _b2, _c2, _d2, _e2, _f; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-collfile"); }, cancel() { var _a3, _b2, _c2; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.cancel) { this.editor.tempDialogData[this.dialogId].callback.cancel(); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-collfile"); } } }; const CollFileConfirmDialog_vue_vue_type_style_index_0_scoped_068f2102_lang = ""; const _hoisted_1$E = ["id"]; const _hoisted_2$w = { class: "content" }; const _hoisted_3$t = { class: "header" }; const _hoisted_4$m = { class: "tail" }; function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-collfile" }, [ vue.createElementVNode("div", _hoisted_2$w, [ vue.createElementVNode("div", _hoisted_3$t, [ _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon warn", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shoucang" }) ], -1)), vue.createElementVNode("span", null, vue.toDisplayString(_ctx.editor.i18n("ddei.collection")), 1), _cache[5] || (_cache[5] = vue.createElementVNode("div", { style: { "flex": "1" } }, null, -1)), (vue.openBlock(), vue.createElementBlock("svg", { class: "icon close", "aria-hidden": "true", onClick: _cache[0] || (_cache[0] = (...args) => $options.cancel && $options.cancel(...args)) }, _cache[3] || (_cache[3] = [ vue.createElementVNode("use", { "xlink:href": "#icon-close" }, null, -1) ]))) ]), _cache[6] || (_cache[6] = vue.createElementVNode("div", { class: "msg" }, null, -1)), vue.createElementVNode("div", _hoisted_4$m, [ vue.createElementVNode("div", { class: "button button-main", onClick: _cache[1] || (_cache[1] = (...args) => $options.ok && $options.ok(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.confirm")), 1), vue.createElementVNode("div", { class: "button", onClick: _cache[2] || (_cache[2] = (...args) => $options.cancel && $options.cancel(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.cancel")), 1) ]) ]) ], 8, _hoisted_1$E)) : vue.createCommentVNode("", true); } const CollFileConfirmDialog = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$E], ["__scopeId", "data-v-068f2102"]]); const _DDeiCoreCollFileConfirmDialog = class _DDeiCoreCollFileConfirmDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", CollFileConfirmDialog.name); __publicField3(this, "plugins", [CollFileConfirmDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[CollFileConfirmDialog.name]) { for (let i2 in options[CollFileConfirmDialog.name]) { newOptions[i2] = options[CollFileConfirmDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreCollFileConfirmDialog(newOptions); return panels; } } return _DDeiCoreCollFileConfirmDialog; } static modify(fn) { return _DDeiCoreCollFileConfirmDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreCollFileConfirmDialog, "defaultIns", new _DDeiCoreCollFileConfirmDialog(null)); let DDeiCoreCollFileConfirmDialog = _DDeiCoreCollFileConfirmDialog; const _sfc_main$D = { name: "ddei-core-dialog-linepointtype", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-linepointtype", value: [], dataSource: null }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId]) == null ? void 0 : _c2.value)) { this.value = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId].value; } if (((_e2 = this.editor) == null ? void 0 : _e2.tempDialogData) && ((_g = (_f = this.editor) == null ? void 0 : _f.tempDialogData[this.dialogId]) == null ? void 0 : _g.dataSource)) { this.dataSource = (_h = this.editor) == null ? void 0 : _h.tempDialogData[this.dialogId].dataSource; } }, select(value) { var _a3, _b2, _c2, _d2, _e2, _f; this.value = value; if (this.value) { if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.value); } } }, selectAndConfirm(value) { var _a3, _b2, _c2, _d2, _e2, _f; this.value = value; if (this.value) { if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.value); } } this.ok(); }, ok() { DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-linepointtype"); } } }; const LinePointTypeDialog_vue_vue_type_style_index_0_scoped_ec516138_lang = ""; const _hoisted_1$D = ["id"]; const _hoisted_2$v = { class: "content" }; const _hoisted_3$s = { class: "group" }; const _hoisted_4$l = { class: "title" }; const _hoisted_5$j = { class: "group_content" }; const _hoisted_6$e = ["onClick", "onDblclick"]; function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-linepointtype" }, [ vue.createElementVNode("div", _hoisted_2$v, [ vue.createElementVNode("div", _hoisted_3$s, [ vue.createElementVNode("div", _hoisted_4$l, vue.toDisplayString(_ctx.editor.i18n("ddei.property.linePointType")), 1), vue.createElementVNode("div", _hoisted_5$j, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (data) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item-selected": JSON.stringify($data.value) == JSON.stringify(data.value) }), onClick: ($event) => $options.select(data.value), onDblclick: ($event) => $options.selectAndConfirm(data.value) }, vue.toDisplayString(_ctx.editor.i18n(data.text)), 43, _hoisted_6$e); }), 256)) ]) ]) ]) ], 8, _hoisted_1$D)) : vue.createCommentVNode("", true); } const LinePointTypeDialog = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$D], ["__scopeId", "data-v-ec516138"]]); const _DDeiCoreLinePointTypeDialog = class _DDeiCoreLinePointTypeDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", LinePointTypeDialog.name); __publicField3(this, "plugins", [LinePointTypeDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[LinePointTypeDialog.name]) { for (let i2 in options[LinePointTypeDialog.name]) { newOptions[i2] = options[LinePointTypeDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreLinePointTypeDialog(newOptions); return panels; } } return _DDeiCoreLinePointTypeDialog; } static modify(fn) { return _DDeiCoreLinePointTypeDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreLinePointTypeDialog, "defaultIns", new _DDeiCoreLinePointTypeDialog(null)); let DDeiCoreLinePointTypeDialog = _DDeiCoreLinePointTypeDialog; const _sfc_main$C = { name: "ddei-core-dialog-linetype", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-linetype", value: 1 //当前选中值 }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2; let value = 1; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId])) { value = (_c2 = this.editor) == null ? void 0 : _c2.tempDialogData[this.dialogId].value; } this.value = value; }, /** * 修改文本对齐方式 */ changeType(v) { var _a3, _b2, _c2, _d2, _e2, _f; this.value = v; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.value); } }, /** * 修改文本对齐方式 */ ok(v) { this.changeType(v); DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-linetype"); } } }; const LineTypeDialog_vue_vue_type_style_index_0_scoped_5fc9eaad_lang = ""; const _hoisted_1$C = ["id"]; const _hoisted_2$u = { class: "content" }; const _hoisted_3$r = { class: "title" }; const _hoisted_4$k = { class: "group" }; const _hoisted_5$i = { class: "group_content" }; function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-linetype" }, [ vue.createElementVNode("div", _hoisted_2$u, [ vue.createElementVNode("div", _hoisted_3$r, vue.toDisplayString(_ctx.editor.i18n("ddei.lineType")), 1), vue.createElementVNode("div", _hoisted_4$k, [ vue.createElementVNode("div", _hoisted_5$i, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 1 }), onClick: _cache[0] || (_cache[0] = ($event) => $options.changeType(1)), onDblclick: _cache[1] || (_cache[1] = ($event) => $options.ok(1)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.lineType1")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 2 }), onClick: _cache[2] || (_cache[2] = ($event) => $options.changeType(2)), onDblclick: _cache[3] || (_cache[3] = ($event) => $options.ok(2)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.lineType2")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 3 }), onClick: _cache[4] || (_cache[4] = ($event) => $options.changeType(3)), onDblclick: _cache[5] || (_cache[5] = ($event) => $options.ok(3)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.lineType3")), 35) ]) ]) ]) ], 8, _hoisted_1$C)) : vue.createCommentVNode("", true); } const LineTypeDialog = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$C], ["__scopeId", "data-v-5fc9eaad"]]); const _DDeiCoreLineTypeDialog = class _DDeiCoreLineTypeDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", LineTypeDialog.name); __publicField3(this, "plugins", [LineTypeDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[LineTypeDialog.name]) { for (let i2 in options[LineTypeDialog.name]) { newOptions[i2] = options[LineTypeDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreLineTypeDialog(newOptions); return panels; } } return _DDeiCoreLineTypeDialog; } static modify(fn) { return _DDeiCoreLineTypeDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreLineTypeDialog, "defaultIns", new _DDeiCoreLineTypeDialog(null)); let DDeiCoreLineTypeDialog = _DDeiCoreLineTypeDialog; const _sfc_main$B = { name: "ddei-core-dialog-managerlayers", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-managerlayers", allowAddLayer: true, allowEditLayes: true, //是否允许编辑多图层 allowOpenMultLayers: true, currentStage: null, file: null }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2; this.allowOpenMultLayers = DDeiEditorUtil.getConfigValue( "GLOBAL_ALLOW_OPEN_MULT_LAYERS", this.editor ); this.allowEditLayes = ((_a3 = this.editor.ddInstance) == null ? void 0 : _a3.AC_DESIGN_EDIT) != false ? true : false; this.allowAddLayer = this.allowEditLayes && DDeiUtil.isAccess( DDeiEnumOperateType.CREATE, { modelType: "DDeiLayer" }, DDeiUtil.getConfigValue("MODE_NAME", this.editor.ddInstance), this.editor.ddInstance ); let file = (_c2 = this.editor) == null ? void 0 : _c2.files[(_b2 = this.editor) == null ? void 0 : _b2.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; this.currentStage = sheet == null ? void 0 : sheet.stage; this.file = file; }, /** * layer开始拖拽移动 */ layerDragStart(layerEle, evt) { this.dragLayerEle = evt.target; }, /** * 拖拽layer移动 */ layerDragOver(e) { if (this.dragLayerEle) { let parentDiv = this.dragLayerEle.parentElement; let sourceIndex = -1; let targetIndex = -1; let children = parentDiv.children; for (let i2 = 1; i2 < children.length; i2++) { children[i2].style.borderTop = ""; children[i2].style.borderBottom = ""; if (children[i2] == this.dragLayerEle) { sourceIndex = i2; } else if (e.target.parentElement == children[i2]) { targetIndex = i2; } } if (sourceIndex != -1 && targetIndex != -1) { this.sourceLayerIndex = sourceIndex - 1; if (targetIndex == children.length - 1) { let pos = DDeiUtil.getDomAbsPosition(children[targetIndex]); let halfPos = pos.top + children[targetIndex].offsetHeight / 2; if (halfPos <= e.clientY && e.clientY <= pos.top + children[targetIndex].offsetHeight) { this.changeLayerIndex = targetIndex; children[targetIndex].style.borderBottom = "2px solid #017fff"; } else { this.changeLayerIndex = targetIndex - 1; children[targetIndex].style.borderTop = "2px solid #017fff"; } } else { this.changeLayerIndex = targetIndex - 1; children[targetIndex].style.borderTop = "2px solid #017fff"; } } e.preventDefault(); } }, /** * 拖拽layer放开 */ layerDragDrop(e) { var _a3; if ((this.sourceLayerIndex || this.sourceLayerIndex == 0) && (this.changeLayerIndex || this.changeLayerIndex == 0)) { let layers = this.currentStage.layers; let sourceLayer = this.currentStage.layers[this.sourceLayerIndex]; let currentLayer = this.currentStage.layers[this.currentStage.layerIndex]; layers[this.sourceLayerIndex] = null; layers.splice(this.changeLayerIndex, 0, sourceLayer); for (let j2 = layers.length; j2 >= 0; j2--) { if (layers[j2] == null) { layers.splice(j2, 1); } } for (let j2 = layers.length; j2 >= 0; j2--) { if (currentLayer == layers[j2]) { this.currentStage.layerIndex = j2; } } (_a3 = this.editor.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); this.editor.bus.push(DDeiEditorEnumBusCommandType.AddFileHistroy); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); this.editor.changeState(DDeiEditorState.DESIGNING); } let children = this.dragLayerEle.parentElement.children; for (let i2 = 1; i2 < children.length; i2++) { children[i2].style.borderTop = ""; children[i2].style.borderBottom = ""; } this.dragLayerEle = null; this.sourceLayerIndex = null; this.changeLayerIndex = null; }, /** * 拖拽layer离开 */ layerDragCancel(e) { if (this.dragLayerEle) { let children = this.dragLayerEle.parentElement.children; for (let i2 = 1; i2 < children.length; i2++) { children[i2].style.borderTop = ""; children[i2].style.borderBottom = ""; } this.sourceLayerIndex = null; this.changeLayerIndex = null; } }, //创建新图层 createNewLayer(index) { var _a3; if (this.allowAddLayer) { let newLayer = this.currentStage.addLayer(null, index); newLayer.initRender(); this.editor.bus.push( DDeiEnumBusCommandType.CancelCurLevelSelectedModels ); this.editor.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); this.editor.bus.push(DDeiEnumBusCommandType.AddHistroy); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); (_a3 = this.editor.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); this.editor.changeState(DDeiEditorState.DESIGNING); } }, //移除图层 removeLayer(index) { var _a3; this.currentStage.removeLayer(index); this.editor.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels); this.editor.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); this.editor.bus.push(DDeiEnumBusCommandType.AddHistroy); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); (_a3 = this.editor.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); this.editor.changeState(DDeiEditorState.DESIGNING); }, //设置图层显示或隐藏 displayOrShowLayer(layer2) { var _a3; if (layer2.display == 0) { layer2.display = 1; } else { layer2.display = 0; } this.editor.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels); this.editor.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); this.editor.bus.push(DDeiEnumBusCommandType.AddHistroy); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); (_a3 = this.editor.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); this.editor.changeState(DDeiEditorState.DESIGNING); }, //设置图层锁定和解锁 lockOrUnLockLayer(layer2) { layer2.lock = !layer2.lock; }, //设置图层打印或不打印 printOrNoPrintLayer(layer2) { layer2.print = !layer2.print; }, //切换当前图层 changeLayer(index, evt) { var _a3; this.currentStage.changeLayer(index); this.currentStage.displayLayer(null, true); if (evt.target.className == "not_temp_display") { this.currentStage.layers[index].tempDisplay = true; } else { this.currentStage.layers[index].tempDisplay = false; } this.editor.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels); this.editor.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); (_a3 = this.editor.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); this.editor.changeState(DDeiEditorState.DESIGNING); }, /** * 开始修改图层名称 */ startChangeLayerName(layer2, evt) { let ele = evt.target; let domPos = DDeiUtil.getDomAbsPosition(ele); let editor = DDeiEditor.ACTIVE_INSTANCE; let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let input = document.getElementById(editor.id + "_change_layer_name_input"); this.currentChangeLayer = layer2; if (!input) { input = document.createElement("input"); input.setAttribute("id", editor.id + "_change_layer_name_input"); input.style.position = "absolute"; input.style.fontSize = "14px"; input.style.zIndex = 999; editorEle.appendChild(input); const that = this; input.onblur = () => { var _a3; if (input.value) { let editor2 = this.editor; if (input.value != that.currentChangeLayer.name) { that.currentChangeLayer.name = input.value; (_a3 = editor2.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); editor2.bus.push(DDeiEditorEnumBusCommandType.AddFileHistroy); editor2.bus.executeAll(); } input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; } }; input.onkeydown = (e) => { var _a3; if (e.keyCode == 13) { let editor2 = this.editor; if (input.value != that.currentChangeLayer.name) { that.currentChangeLayer.name = input.value; (_a3 = editor2.editorViewer) == null ? void 0 : _a3.changeFileModifyDirty(); editor2.bus.push(DDeiEditorEnumBusCommandType.AddFileHistroy); editor2.bus.executeAll(); } input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; } else if (e.keyCode == 27) { input.style.display = "none"; input.style.left = "0px"; input.style.top = "0px"; input.value = ""; } }; } input.style.width = ele.offsetWidth + "px"; input.style.height = ele.offsetHeight + "px"; input.style.left = domPos.left - editorDomPos.left + "px"; input.style.top = domPos.top - editorDomPos.top + "px"; input.style.outline = "1px solid #017fff"; input.style.border = "none"; input.style.borderRadius = "1px"; input.value = layer2.name; input.style.display = "block"; input.selectionStart = 0; input.selectionEnd = input.value.length; input.style.background = "var(--background)"; input.style.color = "var(--text)"; input.focus(); this.editor.changeState(DDeiEditorState.PROPERTY_EDITING); } } }; const ManageLayersDialog_vue_vue_type_style_index_0_scoped_f8156347_lang = ""; const _hoisted_1$B = ["id"]; const _hoisted_2$t = { class: "content" }; const _hoisted_3$q = { class: "title" }; const _hoisted_4$j = { class: "group" }; const _hoisted_5$h = { class: "group_content" }; const _hoisted_6$d = { style: { "grid-column": "1/8" } }; const _hoisted_7$c = ["draggable", "onDragstart"]; const _hoisted_8$9 = ["onDblclick"]; const _hoisted_9$9 = ["onClick"]; const _hoisted_10$4 = { style: { "grid-column": "1/4", "font-weight": "normal" } }; const _hoisted_11$4 = ["onClick"]; const _hoisted_12$3 = ["onClick"]; const _hoisted_13$3 = { key: 0, "xlink:href": "#icon-close-eye" }; const _hoisted_14$2 = { key: 1, "xlink:href": "#icon-open-eye" }; const _hoisted_15$1 = ["onClick"]; const _hoisted_16$1 = { key: 0, "xlink:href": "#icon-lock" }; const _hoisted_17$1 = { key: 1, "xlink:href": "#icon-unlock" }; const _hoisted_18$1 = ["value", "onMousedown", "checked"]; const _hoisted_19$1 = ["onClick"]; const _hoisted_20$1 = { key: 0, "xlink:href": "#icon-print-disabled" }; const _hoisted_21$1 = { key: 1, "xlink:href": "#icon-print" }; function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2; return _ctx.forceRefresh && $data.allowOpenMultLayers ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-managerlayers" }, [ vue.createElementVNode("div", _hoisted_2$t, [ vue.createElementVNode("div", _hoisted_3$q, vue.toDisplayString(_ctx.editor.i18n("ddei.layerName")), 1), vue.createElementVNode("div", _hoisted_4$j, [ vue.createElementVNode("div", _hoisted_5$h, [ vue.withDirectives(vue.createElementVNode("div", { class: "item", onClick: _cache[0] || (_cache[0] = ($event) => $options.createNewLayer(0)) }, [ vue.createElementVNode("span", _hoisted_6$d, vue.toDisplayString(_ctx.editor.i18n("ddei.newLayer")), 1), _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon extbtn", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-add-layer" }) ], -1)) ], 512), [ [vue.vShow, $data.allowAddLayer] ]), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_b2 = $data.currentStage) == null ? void 0 : _b2.layers, (layer2, index) => { var _a4, _b3; return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "current": ((_a4 = $data.currentStage) == null ? void 0 : _a4.layerIndex) === index }), draggable: $data.allowEditLayes, onDragstart: ($event) => $options.layerDragStart(index, $event), onDragover: _cache[1] || (_cache[1] = ($event) => $options.layerDragOver($event)), onDrop: _cache[2] || (_cache[2] = ($event) => $options.layerDragDrop($event)), onDragleave: _cache[3] || (_cache[3] = ($event) => $options.layerDragCancel($event)) }, [ vue.createElementVNode("span", { style: { "grid-column": "1/8" }, onDblclick: ($event) => $data.allowEditLayes && $options.startChangeLayerName(layer2, $event) }, vue.toDisplayString(layer2.name ? layer2.name : _ctx.editor.i18n("ddei.layerName")), 41, _hoisted_8$9), vue.withDirectives((vue.openBlock(), vue.createElementBlock("svg", { class: "icon", "aria-hidden": "true", onClick: ($event) => $options.removeLayer(index) }, _cache[5] || (_cache[5] = [ vue.createElementVNode("use", { "xlink:href": "#icon-remove" }, null, -1) ]), 8, _hoisted_9$9)), [ [vue.vShow, $data.allowEditLayes] ]), vue.createElementVNode("span", _hoisted_10$4, vue.toDisplayString(_ctx.editor.i18n("ddei.shapes")) + ":" + vue.toDisplayString(layer2.modelNumber), 1), vue.withDirectives((vue.openBlock(), vue.createElementBlock("svg", { class: "icon", "aria-hidden": "true", onClick: ($event) => $options.createNewLayer(index) }, _cache[6] || (_cache[6] = [ vue.createElementVNode("use", { "xlink:href": "#icon-add-layer" }, null, -1) ]), 8, _hoisted_11$4)), [ [vue.vShow, $data.allowAddLayer] ]), (vue.openBlock(), vue.createElementBlock("svg", { class: "icon", onClick: ($event) => $options.displayOrShowLayer(layer2) }, [ layer2.display == 0 && !layer2.tempDisplay ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_13$3)) : vue.createCommentVNode("", true), !(layer2.display == 0 && !layer2.tempDisplay) ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_14$2)) : vue.createCommentVNode("", true) ], 8, _hoisted_12$3)), (vue.openBlock(), vue.createElementBlock("svg", { class: "icon", onClick: ($event) => $options.lockOrUnLockLayer(layer2) }, [ layer2.lock ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_16$1)) : vue.createCommentVNode("", true), !layer2.lock ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_17$1)) : vue.createCommentVNode("", true) ], 8, _hoisted_15$1)), vue.createElementVNode("input", { type: "radio", class: vue.normalizeClass({ "not_temp_display": !layer2.tempDisplay }), name: "rdo_layers", value: layer2.id, onMousedown: ($event) => $options.changeLayer(index, $event), checked: ((_b3 = $data.currentStage) == null ? void 0 : _b3.layerIndex) === index, autocomplete: "off" }, null, 42, _hoisted_18$1), (vue.openBlock(), vue.createElementBlock("svg", { class: "icon", onClick: ($event) => $options.printOrNoPrintLayer(layer2) }, [ !layer2.print ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_20$1)) : vue.createCommentVNode("", true), layer2.print ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_21$1)) : vue.createCommentVNode("", true) ], 8, _hoisted_19$1)) ], 42, _hoisted_7$c); }), 256)) ]) ]) ]) ], 8, _hoisted_1$B)) : vue.createCommentVNode("", true); } const ManageLayersDialog = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$B], ["__scopeId", "data-v-f8156347"]]); const _DDeiCoreManageLayersDialog = class _DDeiCoreManageLayersDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ManageLayersDialog.name); __publicField3(this, "plugins", [ManageLayersDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ManageLayersDialog.name]) { for (let i2 in options[ManageLayersDialog.name]) { newOptions[i2] = options[ManageLayersDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreManageLayersDialog(newOptions); return panels; } } return _DDeiCoreManageLayersDialog; } static modify(fn) { return _DDeiCoreManageLayersDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreManageLayersDialog, "defaultIns", new _DDeiCoreManageLayersDialog(null)); let DDeiCoreManageLayersDialog = _DDeiCoreManageLayersDialog; const _sfc_main$A = { name: "ddei-core-dialog-mergecompose", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-mergecompose" }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { //是否可以取消组合 canCancelMerge() { var _a3, _b2; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_b2 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _b2.size) > 0) { let models = Array.from(stage2 == null ? void 0 : stage2.selectedModels.values()); if (models[0].baseModelType == "DDeiContainer" && models[0].layout == "compose") { return true; } } return false; }, //是否可以组合 canMerge() { var _a3, _b2; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_b2 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _b2.size) > 1) { return true; } return false; }, /** * 执行组合 */ doMerge() { var _a3, _b2; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_b2 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _b2.size) > 1) { this.editor.bus.push(DDeiEnumBusCommandType.ModelMerge); this.editor.bus.executeAll(); } }, /** * 执行取消组合 */ doCancelMerge() { var _a3, _b2; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_b2 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _b2.size) > 0) { this.editor.bus.push(DDeiEnumBusCommandType.ModelCancelMerge); this.editor.bus.executeAll(); } } } }; const MergeComposeDialog_vue_vue_type_style_index_0_scoped_eb54102e_lang = ""; const _hoisted_1$A = ["id"]; const _hoisted_2$s = { class: "content" }; const _hoisted_3$p = { class: "title" }; const _hoisted_4$i = { class: "group" }; const _hoisted_5$g = { class: "group_content" }; const _hoisted_6$c = { class: "text" }; const _hoisted_7$b = { class: "text" }; function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-mergecompose" }, [ vue.createElementVNode("div", _hoisted_2$s, [ vue.createElementVNode("div", _hoisted_3$p, vue.toDisplayString(_ctx.editor.i18n("ddei.combina")), 1), vue.createElementVNode("div", _hoisted_4$i, [ vue.createElementVNode("div", _hoisted_5$g, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "item_disabled": !$options.canMerge(), "item": $options.canMerge() }), onClick: _cache[0] || (_cache[0] = ($event) => $options.canMerge() && $options.doMerge()) }, [ _cache[2] || (_cache[2] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-merge" }) ], -1)), vue.createElementVNode("div", _hoisted_6$c, vue.toDisplayString(_ctx.editor.i18n("ddei.combina")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "item_disabled": !$options.canCancelMerge(), "item": $options.canCancelMerge() }), onClick: _cache[1] || (_cache[1] = ($event) => $options.canCancelMerge() && $options.doCancelMerge()) }, [ _cache[3] || (_cache[3] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-cancel-merge" }) ], -1)), vue.createElementVNode("div", _hoisted_7$b, vue.toDisplayString(_ctx.editor.i18n("ddei.cancelCombina")), 1) ], 2) ]) ]) ]) ], 8, _hoisted_1$A)) : vue.createCommentVNode("", true); } const MergeComposeDialog = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$A], ["__scopeId", "data-v-eb54102e"]]); const _DDeiCoreMergeComposeDialog = class _DDeiCoreMergeComposeDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", MergeComposeDialog.name); __publicField3(this, "plugins", [MergeComposeDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[MergeComposeDialog.name]) { for (let i2 in options[MergeComposeDialog.name]) { newOptions[i2] = options[MergeComposeDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreMergeComposeDialog(newOptions); return panels; } } return _DDeiCoreMergeComposeDialog; } static modify(fn) { return _DDeiCoreMergeComposeDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreMergeComposeDialog, "defaultIns", new _DDeiCoreMergeComposeDialog(null)); let DDeiCoreMergeComposeDialog = _DDeiCoreMergeComposeDialog; const _sfc_main$z = { name: "ddei-core-dialog-changeposition", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-changeposition" }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { //是否置于上层 canPush(type) { return true; }, //修改图形层次 doPush(v) { var _a3; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; let stageRender = stage2 == null ? void 0 : stage2.render; let optContainer = stageRender == null ? void 0 : stageRender.currentOperateContainer; if (optContainer) { this.editor.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: v }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } } } }; const PositionDialog_vue_vue_type_style_index_0_scoped_70a473a4_lang = ""; const _hoisted_1$z = ["id"]; const _hoisted_2$r = { class: "content" }; const _hoisted_3$o = { class: "title" }; const _hoisted_4$h = { class: "group" }; const _hoisted_5$f = { class: "group_content" }; const _hoisted_6$b = { class: "text" }; const _hoisted_7$a = { class: "text" }; const _hoisted_8$8 = { class: "text" }; const _hoisted_9$8 = { class: "text" }; function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-changeposition" }, [ vue.createElementVNode("div", _hoisted_2$r, [ vue.createElementVNode("div", _hoisted_3$o, vue.toDisplayString(_ctx.editor.i18n("ddei.position")), 1), vue.createElementVNode("div", _hoisted_4$h, [ vue.createElementVNode("div", _hoisted_5$f, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "item_disabled": !$options.canPush("top"), "item": $options.canPush("top") }), onClick: _cache[0] || (_cache[0] = ($event) => $options.canPush("top") && $options.doPush("top")) }, [ _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-move-top" }) ], -1)), vue.createElementVNode("div", _hoisted_6$b, vue.toDisplayString(_ctx.editor.i18n("ddei.pushTop")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "item_disabled": !$options.canPush("bottom"), "item": $options.canPush("bottom") }), onClick: _cache[1] || (_cache[1] = ($event) => $options.canPush("top") && $options.doPush("bottom")) }, [ _cache[5] || (_cache[5] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-move-bottom" }) ], -1)), vue.createElementVNode("div", _hoisted_7$a, vue.toDisplayString(_ctx.editor.i18n("ddei.pushBottom")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "item_disabled": !$options.canPush("up"), "item": $options.canPush("up") }), onClick: _cache[2] || (_cache[2] = ($event) => $options.canPush("up") && $options.doPush("up")) }, [ _cache[6] || (_cache[6] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-move-up" }) ], -1)), vue.createElementVNode("div", _hoisted_8$8, vue.toDisplayString(_ctx.editor.i18n("ddei.pushUp")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "item_disabled": !$options.canPush("down"), "item": $options.canPush("down") }), onClick: _cache[3] || (_cache[3] = ($event) => $options.canPush("down") && $options.doPush("down")) }, [ _cache[7] || (_cache[7] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-move-down" }) ], -1)), vue.createElementVNode("div", _hoisted_9$8, vue.toDisplayString(_ctx.editor.i18n("ddei.pushDown")), 1) ], 2) ]) ]) ]) ], 8, _hoisted_1$z)) : vue.createCommentVNode("", true); } const PositionDialog = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$z], ["__scopeId", "data-v-70a473a4"]]); const _DDeiCorePositionDialog = class _DDeiCorePositionDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", PositionDialog.name); __publicField3(this, "plugins", [PositionDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[PositionDialog.name]) { for (let i2 in options[PositionDialog.name]) { newOptions[i2] = options[PositionDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCorePositionDialog(newOptions); return panels; } } return _DDeiCorePositionDialog; } static modify(fn) { return _DDeiCorePositionDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCorePositionDialog, "defaultIns", new _DDeiCorePositionDialog(null)); let DDeiCorePositionDialog = _DDeiCorePositionDialog; const _sfc_main$y = { name: "ddei-core-dialog-publishfile", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-publishfile" }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { ok() { var _a3, _b2, _c2, _d2, _e2, _f; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-publishfile"); }, cancel() { var _a3, _b2, _c2; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.cancel) { this.editor.tempDialogData[this.dialogId].callback.cancel(); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-publishfile"); } } }; const PublishFileConfirmDialog_vue_vue_type_style_index_0_scoped_251feafa_lang = ""; const _hoisted_1$y = ["id"]; const _hoisted_2$q = { class: "content" }; const _hoisted_3$n = { class: "header" }; const _hoisted_4$g = { class: "tail" }; function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-publishfile" }, [ vue.createElementVNode("div", _hoisted_2$q, [ vue.createElementVNode("div", _hoisted_3$n, [ _cache[4] || (_cache[4] = vue.createElementVNode("svg", { class: "icon warn", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-publish" }) ], -1)), vue.createElementVNode("span", null, vue.toDisplayString(_ctx.editor.i18n("ddei.publish")) + vue.toDisplayString(_ctx.editor.i18n("ddei.file")), 1), _cache[5] || (_cache[5] = vue.createElementVNode("div", { style: { "flex": "1" } }, null, -1)), (vue.openBlock(), vue.createElementBlock("svg", { class: "icon close", "aria-hidden": "true", onClick: _cache[0] || (_cache[0] = (...args) => $options.cancel && $options.cancel(...args)) }, _cache[3] || (_cache[3] = [ vue.createElementVNode("use", { "xlink:href": "#icon-close" }, null, -1) ]))) ]), _cache[6] || (_cache[6] = vue.createElementVNode("div", { class: "msg" }, null, -1)), vue.createElementVNode("div", _hoisted_4$g, [ vue.createElementVNode("div", { class: "button button-main", onClick: _cache[1] || (_cache[1] = (...args) => $options.ok && $options.ok(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.publish")), 1), vue.createElementVNode("div", { class: "button", onClick: _cache[2] || (_cache[2] = (...args) => $options.cancel && $options.cancel(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.cancel")), 1) ]) ]) ], 8, _hoisted_1$y)) : vue.createCommentVNode("", true); } const PublishFileConfirmDialog = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$y], ["__scopeId", "data-v-251feafa"]]); const _DDeiCorePublishFileConfirmDialog = class _DDeiCorePublishFileConfirmDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", PublishFileConfirmDialog.name); __publicField3(this, "plugins", [PublishFileConfirmDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[PublishFileConfirmDialog.name]) { for (let i2 in options[PublishFileConfirmDialog.name]) { newOptions[i2] = options[PublishFileConfirmDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCorePublishFileConfirmDialog(newOptions); return panels; } } return _DDeiCorePublishFileConfirmDialog; } static modify(fn) { return _DDeiCorePublishFileConfirmDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCorePublishFileConfirmDialog, "defaultIns", new _DDeiCorePublishFileConfirmDialog(null)); let DDeiCorePublishFileConfirmDialog = _DDeiCorePublishFileConfirmDialog; const _sfc_main$x = { name: "ddei-core-dialog-qcview", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-qcview", dataSource: null, //强制刷新控制变量 forceRefresh: false }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2, _e2; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId]) == null ? void 0 : _c2.dataSource)) { this.dataSource = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.dataSource; } }, ok(item) { var _a3, _b2, _c2, _d2, _e2, _f; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(item); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-qcview"); }, cancel() { var _a3, _b2, _c2; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.cancel) { this.editor.tempDialogData[this.dialogId].callback.cancel(); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-qcview"); } } }; const QCViewDialog_vue_vue_type_style_index_0_scoped_6bab58c9_lang = ""; const _hoisted_1$x = ["id"]; const _hoisted_2$p = { class: "items" }; const _hoisted_3$m = ["title", "onClick"]; const _hoisted_4$f = { class: "icon", "aria-hidden": "true" }; const _hoisted_5$e = ["xlink:href"]; function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-qcview" }, [ vue.createElementVNode("div", _hoisted_2$p, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { return vue.openBlock(), vue.createElementBlock("div", { class: "item", title: item.text, onClick: ($event) => $options.ok(item) }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4$f, [ vue.createElementVNode("use", { "xlink:href": item.img }, null, 8, _hoisted_5$e) ])), vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1) ], 8, _hoisted_3$m); }), 256)) ]) ], 8, _hoisted_1$x)) : vue.createCommentVNode("", true); } const QCViewDialog = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$x], ["__scopeId", "data-v-6bab58c9"]]); const _DDeiCoreQCViewDialog = class _DDeiCoreQCViewDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QCViewDialog.name); __publicField3(this, "plugins", [QCViewDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QCViewDialog.name]) { for (let i2 in options[QCViewDialog.name]) { newOptions[i2] = options[QCViewDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreQCViewDialog(newOptions); return panels; } } return _DDeiCoreQCViewDialog; } static modify(fn) { return _DDeiCoreQCViewDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreQCViewDialog, "defaultIns", new _DDeiCoreQCViewDialog(null)); let DDeiCoreQCViewDialog = _DDeiCoreQCViewDialog; const _sfc_main$w = { name: "ddei-core-dialog-setstyle", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-setstyle", ds: [ { border: DDeiUtil.rgb2hex("rgb(78,215,197)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(70,125,254)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(66,185,198)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(255,126,121)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(255,204,83)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(78,215,197)"), fill: DDeiUtil.rgb2hex("rgb(233,248,245)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(70,125,254)"), fill: DDeiUtil.rgb2hex("rgb(233,236,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(66,185,198)"), fill: DDeiUtil.rgb2hex("rgb(232,233,245)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(255,126,121)"), fill: DDeiUtil.rgb2hex("rgb(255,236,236)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(255,204,83)"), fill: DDeiUtil.rgb2hex("rgb(255,246,233)"), round: 4 }, { fill: DDeiUtil.rgb2hex("rgb(233,248,245)"), round: 4 }, { fill: DDeiUtil.rgb2hex("rgb(233,236,255)"), round: 4 }, { fill: DDeiUtil.rgb2hex("rgb(232,233,245)"), round: 4 }, { fill: DDeiUtil.rgb2hex("rgb(255,236,236)"), round: 4 }, { fill: DDeiUtil.rgb2hex("rgb(255,246,233)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(68,189,173)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(61,109,224)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(66,74,174)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(225,110,106)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 }, { border: DDeiUtil.rgb2hex("rgb(225,179,72)"), fill: DDeiUtil.rgb2hex("rgb(255,255,255)"), round: 4 } ] }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { /** * 修改样式 */ select(data) { if (this.editor.currentControlDefine) { let controlDefine = this.editor.currentControlDefine; if (controlDefine) { let selectedModels = this.editor.ddInstance.stage.selectedModels; selectedModels == null ? void 0 : selectedModels.forEach((model) => { if (data.border) { let borderType = controlDefine.attrDefineMap.get("border.type"); borderType.value = 1; let borderColor = controlDefine.attrDefineMap.get("border.color"); borderColor.value = data.border; let paths2 = ["border.color"]; this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths: paths2, value: data.border }, null, true ); this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths: ["border.type"], value: 1 }, null, true ); } else { let borderType = controlDefine.attrDefineMap.get("border.type"); borderType.value = 0; let paths2 = ["border.type"]; this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths: paths2, value: 0 }, null, true ); } if (data.fill) { let fillType = controlDefine.attrDefineMap.get("fill.type"); fillType.value = 1; let fillColor = controlDefine.attrDefineMap.get("fill.color"); fillColor.value = data.fill; let paths2 = ["fill.color"]; this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths: paths2, value: data.fill }, null, true ); this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths: ["fill.type"], value: 1 }, null, true ); } else { let fillType = controlDefine.attrDefineMap.get("fill.type"); fillType.value = 0; let paths2 = ["fill.type"]; this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths: paths2, value: 0 }, null, true ); } if (data.round) { let borderRound = controlDefine.attrDefineMap.get("borderRound"); borderRound.value = data.round; let paths2 = ["border.round"]; this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths: paths2, value: data.round }, null, true ); } else { let borderRound = controlDefine.attrDefineMap.get("borderRound"); borderRound.value = 0; let paths2 = ["border.round"]; this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths: paths2, value: 0 }, null, true ); } let fontColor = "black"; if (data.color) { fontColor = data.color; } let fontColorDefine = controlDefine.attrDefineMap.get("font.color"); fontColorDefine.value = fontColor; let paths = ["font.color"]; this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [model.id], paths, value: data.round }, null, true ); }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } } }, /** * 修改文本对齐方式 */ ok(data) { this.select(data); DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-setstyle"); } } }; const QuickSetStyleDialog_vue_vue_type_style_index_0_scoped_a2a1cbf5_lang = ""; const _hoisted_1$w = ["id"]; const _hoisted_2$o = { class: "content" }; const _hoisted_3$l = { class: "title" }; const _hoisted_4$e = { class: "group" }; const _hoisted_5$d = { class: "group_content" }; const _hoisted_6$a = ["onClick", "onDblclick"]; function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-setstyle" }, [ vue.createElementVNode("div", _hoisted_2$o, [ vue.createElementVNode("div", _hoisted_3$l, vue.toDisplayString(_ctx.editor.i18n("ddei.style")), 1), vue.createElementVNode("div", _hoisted_4$e, [ vue.createElementVNode("div", _hoisted_5$d, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.ds, (data) => { return vue.openBlock(), vue.createElementBlock("div", { class: "item", style: vue.normalizeStyle({ "color": data.text ? data.text : "black", "border-radius": data.round ? data.round + "px" : "", "border-color": data.border ? data.border : "transparent", "background-color": data.fill ? data.fill : "transparent" }), onClick: ($event) => $options.select(data), onDblclick: ($event) => $options.ok(data) }, vue.toDisplayString(_ctx.editor.i18n("ddei.text")), 45, _hoisted_6$a); }), 256)) ]) ]) ]) ], 8, _hoisted_1$w)) : vue.createCommentVNode("", true); } const QuickSetStyleDialog = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$w], ["__scopeId", "data-v-a2a1cbf5"]]); const _DDeiCoreQuickSetStyleDialog = class _DDeiCoreQuickSetStyleDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QuickSetStyleDialog.name); __publicField3(this, "plugins", [QuickSetStyleDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QuickSetStyleDialog.name]) { for (let i2 in options[QuickSetStyleDialog.name]) { newOptions[i2] = options[QuickSetStyleDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreQuickSetStyleDialog(newOptions); return panels; } } return _DDeiCoreQuickSetStyleDialog; } static modify(fn) { return _DDeiCoreQuickSetStyleDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreQuickSetStyleDialog, "defaultIns", new _DDeiCoreQuickSetStyleDialog(null)); let DDeiCoreQuickSetStyleDialog = _DDeiCoreQuickSetStyleDialog; const _sfc_main$v = { name: "ddei-core-dialog-changerotate", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-changerotate" }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { }, methods: { //是否可以镜像 canMirror() { var _a3, _b2, _c2; let models = null; if (((_b2 = (_a3 = this.editor.ddInstance.stage) == null ? void 0 : _a3.selectedModels) == null ? void 0 : _b2.size) > 0) { models = Array.from((_c2 = this.editor.ddInstance.stage) == null ? void 0 : _c2.selectedModels.values()); } let canMirror = DDei.beforeOperateValid(DDeiEnumOperateType.MIRROR, { models }, this.editor.ddInstance, null); if (!(canMirror == 0 || canMirror == 1)) { return true; } else { return false; } }, canRotate() { var _a3, _b2, _c2; let models = null; if (((_b2 = (_a3 = this.editor.ddInstance.stage) == null ? void 0 : _a3.selectedModels) == null ? void 0 : _b2.size) > 0) { models = Array.from((_c2 = this.editor.ddInstance.stage) == null ? void 0 : _c2.selectedModels.values()); } let canRotate = DDei.beforeOperateValid(DDeiEnumOperateType.ROTATE, { models }, this.editor.ddInstance, null); if (!(canRotate == 0 || canRotate == 1)) { return true; } else { return false; } }, doRotate(rotate2) { var _a3; let file = this.editor.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_a3 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _a3.size) > 0) { stage2.selectedModels.forEach((model) => { var _a4; let oldRotate = model.rotate ? model.rotate : 0; let newRotate = (oldRotate ? oldRotate : 0) + rotate2; if (rotate2 == -1) { newRotate = 0; } if (oldRotate != newRotate) { let m12 = new Matrix3(); let move1Matrix = new Matrix3( 1, 0, -model.cpv.x, 0, 1, -model.cpv.y, 0, 0, 1 ); m12.premultiply(move1Matrix); if (oldRotate) { let angle2 = (oldRotate * DDeiConfig.ROTATE_UNIT).toFixed(4); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); m12.premultiply(rotateMatrix); } if (newRotate != 0) { let angle1 = (-newRotate * DDeiConfig.ROTATE_UNIT).toFixed(4); let rotate1Matrix = new Matrix3( Math.cos(angle1), Math.sin(angle1), 0, -Math.sin(angle1), Math.cos(angle1), 0, 0, 0, 1 ); m12.premultiply(rotate1Matrix); } let move2Matrix = new Matrix3( 1, 0, model.cpv.x, 0, 1, model.cpv.y, 0, 0, 1 ); m12.premultiply(move2Matrix); model.transVectors(m12); } (_a4 = model.render) == null ? void 0 : _a4.enableRefreshShape(); }); this.editor.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); this.editor.bus.push(DDeiEnumBusCommandType.NodifyChange); this.editor.bus.push(DDeiEnumBusCommandType.AddHistroy); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } }, doMirror(mirrorType) { var _a3; let file = this.editor.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_a3 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _a3.size) > 0) { stage2.selectedModels.forEach((model) => { var _a4; if (mirrorType == 1) { if (!model.mirrorX) { model.mirrorX = true; } else { delete model.mirrorX; } } else if (mirrorType == 2) { if (!model.mirrorY) { model.mirrorY = true; } else { delete model.mirrorY; } } (_a4 = model.render) == null ? void 0 : _a4.enableRefreshShape(); }); this.editor.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); this.editor.bus.push(DDeiEnumBusCommandType.NodifyChange); this.editor.bus.push(DDeiEnumBusCommandType.AddHistroy); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } } } }; const RotateDialog_vue_vue_type_style_index_0_scoped_2fcc5441_lang = ""; const _hoisted_1$v = ["id"]; const _hoisted_2$n = { class: "content" }; const _hoisted_3$k = { class: "title" }; const _hoisted_4$d = { class: "group" }; const _hoisted_5$c = { class: "title" }; const _hoisted_6$9 = { class: "group_content" }; const _hoisted_7$9 = { class: "group" }; const _hoisted_8$7 = { class: "title" }; const _hoisted_9$7 = { class: "group_content" }; function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-changerotate" }, [ vue.createElementVNode("div", _hoisted_2$n, [ vue.createElementVNode("div", _hoisted_3$k, vue.toDisplayString(_ctx.editor.i18n("ddei.flip")), 1), vue.createElementVNode("div", _hoisted_4$d, [ vue.createElementVNode("div", _hoisted_5$c, vue.toDisplayString(_ctx.editor.i18n("ddei.mirror")) + ":", 1), vue.createElementVNode("div", _hoisted_6$9, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "item": $options.canMirror(), "item_disabled": !$options.canMirror() }), onClick: _cache[0] || (_cache[0] = ($event) => $options.canMirror() && $options.doMirror(1)) }, _cache[5] || (_cache[5] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-mirror-v" }) ], -1) ]), 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": $options.canMirror(), "item_disabled": !$options.canMirror() }), onClick: _cache[1] || (_cache[1] = ($event) => $options.canMirror() && $options.doMirror(2)) }, _cache[6] || (_cache[6] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-mirror-h" }) ], -1) ]), 2) ]) ]), vue.createElementVNode("div", _hoisted_7$9, [ vue.createElementVNode("div", _hoisted_8$7, vue.toDisplayString(_ctx.editor.i18n("ddei.rotate")) + ":", 1), vue.createElementVNode("div", _hoisted_9$7, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "item": $options.canRotate(), "item_disabled": !$options.canRotate() }), onClick: _cache[2] || (_cache[2] = ($event) => $options.canRotate() && $options.doRotate(90)) }, _cache[7] || (_cache[7] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-rotate-90" }) ], -1) ]), 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": $options.canRotate(), "item_disabled": !$options.canRotate() }), onClick: _cache[3] || (_cache[3] = ($event) => $options.canRotate() && $options.doRotate(-90)) }, _cache[8] || (_cache[8] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-rotate-270" }) ], -1) ]), 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": $options.canRotate(), "item_disabled": !$options.canRotate() }), onClick: _cache[4] || (_cache[4] = ($event) => $options.canRotate() && $options.doRotate(-1)) }, _cache[9] || (_cache[9] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-rotate-0" }) ], -1) ]), 2) ]) ]) ]) ], 8, _hoisted_1$v)) : vue.createCommentVNode("", true); } const RotateDialog = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v], ["__scopeId", "data-v-2fcc5441"]]); const _DDeiCoreRotateDialog = class _DDeiCoreRotateDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", RotateDialog.name); __publicField3(this, "plugins", [RotateDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[RotateDialog.name]) { for (let i2 in options[RotateDialog.name]) { newOptions[i2] = options[RotateDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreRotateDialog(newOptions); return panels; } } return _DDeiCoreRotateDialog; } static modify(fn) { return _DDeiCoreRotateDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreRotateDialog, "defaultIns", new _DDeiCoreRotateDialog(null)); let DDeiCoreRotateDialog = _DDeiCoreRotateDialog; const _sfc_main$u = { name: "ddei-core-dialog-selectborderdash", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-selectborderdash", value: [], //最近使用的颜色 dataSource: null }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId]) == null ? void 0 : _c2.value)) { this.value = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId].value; } if (((_e2 = this.editor) == null ? void 0 : _e2.tempDialogData) && ((_g = (_f = this.editor) == null ? void 0 : _f.tempDialogData[this.dialogId]) == null ? void 0 : _g.dataSource)) { this.dataSource = (_h = this.editor) == null ? void 0 : _h.tempDialogData[this.dialogId].dataSource; } }, select(value) { this.value = value; }, selectAndConfirm(value) { this.value = value; this.ok(); }, ok() { var _a3, _b2, _c2, _d2, _e2, _f; if (this.value) { if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.value); } } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-selectborderdash"); }, cancel() { DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-selectborderdash"); } } }; const SelectBorderDashDialog_vue_vue_type_style_index_0_scoped_143dc703_lang = ""; const _hoisted_1$u = ["id"]; const _hoisted_2$m = { class: "content" }; const _hoisted_3$j = { class: "group" }; const _hoisted_4$c = { class: "title" }; const _hoisted_5$b = { class: "group_content" }; const _hoisted_6$8 = ["onClick", "onDblclick"]; const _hoisted_7$8 = { class: "div_input" }; const _hoisted_8$6 = ["stroke-dasharray"]; const _hoisted_9$6 = { class: "tail" }; function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-selectborderdash" }, [ vue.createElementVNode("div", _hoisted_2$m, [ vue.createElementVNode("div", _hoisted_3$j, [ vue.createElementVNode("div", _hoisted_4$c, vue.toDisplayString(_ctx.editor.i18n("ddei.lineDash")), 1), vue.createElementVNode("div", _hoisted_5$b, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (data) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item-selected": JSON.stringify($data.value) == JSON.stringify(data.value) }), onClick: ($event) => $options.select(data.value), onDblclick: ($event) => $options.selectAndConfirm(data.value) }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_7$8, [ vue.createElementVNode("line", { x1: "0", y1: "0", x2: "100%", y2: "0", "stroke-width": "3", "stroke-dasharray": data.value }, null, 8, _hoisted_8$6) ])) ], 42, _hoisted_6$8); }), 256)) ]) ]), vue.createElementVNode("div", _hoisted_9$6, [ vue.createElementVNode("div", { class: "button button-main", onClick: _cache[0] || (_cache[0] = (...args) => $options.ok && $options.ok(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.confirm")), 1), vue.createElementVNode("div", { class: "button", onClick: _cache[1] || (_cache[1] = (...args) => $options.cancel && $options.cancel(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.cancel")), 1) ]) ]) ], 8, _hoisted_1$u)) : vue.createCommentVNode("", true); } const SelectBorderDashDialog = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$u], ["__scopeId", "data-v-143dc703"]]); const _DDeiCoreSelectBorderDashDialog = class _DDeiCoreSelectBorderDashDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", SelectBorderDashDialog.name); __publicField3(this, "plugins", [SelectBorderDashDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[SelectBorderDashDialog.name]) { for (let i2 in options[SelectBorderDashDialog.name]) { newOptions[i2] = options[SelectBorderDashDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreSelectBorderDashDialog(newOptions); return panels; } } return _DDeiCoreSelectBorderDashDialog; } static modify(fn) { return _DDeiCoreSelectBorderDashDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSelectBorderDashDialog, "defaultIns", new _DDeiCoreSelectBorderDashDialog(null)); let DDeiCoreSelectBorderDashDialog = _DDeiCoreSelectBorderDashDialog; const _sfc_main$t = { name: "ddei-core-dialog-selectboderweight", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-selectboderweight", value: [], //最近使用的颜色 dataSource: null, dash: [] }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId]) == null ? void 0 : _c2.value)) { this.value = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId].value; } if (((_e2 = this.editor) == null ? void 0 : _e2.tempDialogData) && ((_g = (_f = this.editor) == null ? void 0 : _f.tempDialogData[this.dialogId]) == null ? void 0 : _g.dataSource)) { this.dataSource = (_h = this.editor) == null ? void 0 : _h.tempDialogData[this.dialogId].dataSource; } if (((_i = this.editor) == null ? void 0 : _i.tempDialogData) && ((_k = (_j = this.editor) == null ? void 0 : _j.tempDialogData[this.dialogId]) == null ? void 0 : _k.dash)) { this.dash = (_l = this.editor) == null ? void 0 : _l.tempDialogData[this.dialogId].dash; } }, select(value) { this.value = value; }, selectAndConfirm(value) { this.value = value; this.ok(); }, ok() { var _a3, _b2, _c2, _d2, _e2, _f; if (this.value) { if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.value); } } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-selectboderweight"); }, cancel() { DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-selectboderweight"); } } }; const SelectBorderWeightDialog_vue_vue_type_style_index_0_scoped_b939438e_lang = ""; const _hoisted_1$t = ["id"]; const _hoisted_2$l = { class: "content" }; const _hoisted_3$i = { class: "group" }; const _hoisted_4$b = { class: "title" }; const _hoisted_5$a = { class: "group_content" }; const _hoisted_6$7 = ["onClick", "onDblclick"]; const _hoisted_7$7 = { class: "div_input" }; const _hoisted_8$5 = ["stroke-width", "stroke-dasharray"]; const _hoisted_9$5 = { class: "tail" }; function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-selectboderweight" }, [ vue.createElementVNode("div", _hoisted_2$l, [ vue.createElementVNode("div", _hoisted_3$i, [ vue.createElementVNode("div", _hoisted_4$b, vue.toDisplayString(_ctx.editor.i18n("ddei.lineWeight")), 1), vue.createElementVNode("div", _hoisted_5$a, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (data) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item-selected": JSON.stringify($data.value) == JSON.stringify(data.value) }), onClick: ($event) => $options.select(data.value), onDblclick: ($event) => $options.selectAndConfirm(data.value) }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_7$7, [ vue.createElementVNode("line", { x1: "0", y1: "50%", x2: "100%", y2: "50%", "stroke-width": data.value, "stroke-dasharray": $data.dash }, null, 8, _hoisted_8$5) ])) ], 42, _hoisted_6$7); }), 256)) ]) ]), vue.createElementVNode("div", _hoisted_9$5, [ vue.createElementVNode("div", { class: "button button-main", onClick: _cache[0] || (_cache[0] = (...args) => $options.ok && $options.ok(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.confirm")), 1), vue.createElementVNode("div", { class: "button", onClick: _cache[1] || (_cache[1] = (...args) => $options.cancel && $options.cancel(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.cancel")), 1) ]) ]) ], 8, _hoisted_1$t)) : vue.createCommentVNode("", true); } const SelectBorderWeightDialog = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$t], ["__scopeId", "data-v-b939438e"]]); const _DDeiCoreSelectBorderWeightDialog = class _DDeiCoreSelectBorderWeightDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", SelectBorderWeightDialog.name); __publicField3(this, "plugins", [SelectBorderWeightDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[SelectBorderWeightDialog.name]) { for (let i2 in options[SelectBorderWeightDialog.name]) { newOptions[i2] = options[SelectBorderWeightDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreSelectBorderWeightDialog(newOptions); return panels; } } return _DDeiCoreSelectBorderWeightDialog; } static modify(fn) { return _DDeiCoreSelectBorderWeightDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSelectBorderWeightDialog, "defaultIns", new _DDeiCoreSelectBorderWeightDialog(null)); let DDeiCoreSelectBorderWeightDialog = _DDeiCoreSelectBorderWeightDialog; const _sfc_main$s = { name: "ddei-core-dialog-selectcolor", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-selectcolor", dataSource: null, value: "#000000", //最近使用的颜色 ds1: [ DDeiUtil.rgb2hex("rgb(255,255,255)"), "#000000", DDeiUtil.rgb2hex("rgb(78,215,197)"), DDeiUtil.rgb2hex("rgb(70,125,254)"), DDeiUtil.rgb2hex("rgb(66,185,198)"), DDeiUtil.rgb2hex("rgb(255,126,121)"), DDeiUtil.rgb2hex("rgb(255,204,83)"), DDeiUtil.rgb2hex("rgb(141,192,255)"), DDeiUtil.rgb2hex("rgb(121,145,255)"), DDeiUtil.rgb2hex("rgb(254,157,23)") ], //备选色 ds2: [ DDeiUtil.rgb2hex("rgb(255,255,255)"), "#000000", DDeiUtil.rgb2hex("rgb(78,215,197)"), DDeiUtil.rgb2hex("rgb(70,125,254)"), DDeiUtil.rgb2hex("rgb(66,185,198)"), DDeiUtil.rgb2hex("rgb(255,126,121)"), DDeiUtil.rgb2hex("rgb(255,204,83)"), DDeiUtil.rgb2hex("rgb(141,192,255)"), DDeiUtil.rgb2hex("rgb(121,145,255)"), DDeiUtil.rgb2hex("rgb(254,157,23)"), DDeiUtil.rgb2hex("rgb(235,235,235)"), DDeiUtil.rgb2hex("rgb(126,126,126)"), DDeiUtil.rgb2hex("rgb(233,248,245)"), DDeiUtil.rgb2hex("rgb(233,236,255)"), DDeiUtil.rgb2hex("rgb(232,233,245)"), DDeiUtil.rgb2hex("rgb(255,236,236)"), DDeiUtil.rgb2hex("rgb(255,246,233)"), DDeiUtil.rgb2hex("rgb(238,244,255)"), DDeiUtil.rgb2hex("rgb(236,238,255)"), DDeiUtil.rgb2hex("rgb(255,240,231)"), DDeiUtil.rgb2hex("rgb(215,215,215)"), DDeiUtil.rgb2hex("rgb(105,105,105)"), DDeiUtil.rgb2hex("rgb(208,240,234)"), DDeiUtil.rgb2hex("rgb(207,215,255)"), DDeiUtil.rgb2hex("rgb(207,209,234)"), DDeiUtil.rgb2hex("rgb(255,216,215)"), DDeiUtil.rgb2hex("rgb(255,236,209)"), DDeiUtil.rgb2hex("rgb(219,232,255)"), DDeiUtil.rgb2hex("rgb(215,220,255)"), DDeiUtil.rgb2hex("rgb(255,223,204)"), DDeiUtil.rgb2hex("rgb(195,195,195)"), DDeiUtil.rgb2hex("rgb(89,89,89)"), DDeiUtil.rgb2hex("rgb(178,232,223)"), DDeiUtil.rgb2hex("rgb(176,191,254)"), DDeiUtil.rgb2hex("rgb(176,180,223)"), DDeiUtil.rgb2hex("rgb(255,192,190)"), DDeiUtil.rgb2hex("rgb(255,226,179)"), DDeiUtil.rgb2hex("rgb(197,220,255)"), DDeiUtil.rgb2hex("rgb(190,199,255)"), DDeiUtil.rgb2hex("rgb(254,204,171)"), DDeiUtil.rgb2hex("rgb(175,175,175)"), DDeiUtil.rgb2hex("rgb(69,69,69)"), DDeiUtil.rgb2hex("rgb(140,224,210)"), DDeiUtil.rgb2hex("rgb(137,163,254)"), DDeiUtil.rgb2hex("rgb(135,143,211)"), DDeiUtil.rgb2hex("rgb(255,163,160)"), DDeiUtil.rgb2hex("rgb(255,215,142)"), DDeiUtil.rgb2hex("rgb(172,207,255)"), DDeiUtil.rgb2hex("rgb(160,175,255)"), DDeiUtil.rgb2hex("rgb(254,182,106)"), DDeiUtil.rgb2hex("rgb(155,155,155)"), DDeiUtil.rgb2hex("rgb(48,48,48)"), DDeiUtil.rgb2hex("rgb(68,189,173)"), DDeiUtil.rgb2hex("rgb(61,109,224)"), DDeiUtil.rgb2hex("rgb(66,74,174)"), DDeiUtil.rgb2hex("rgb(225,110,106)"), DDeiUtil.rgb2hex("rgb(225,179,72)"), DDeiUtil.rgb2hex("rgb(123,169,225)"), DDeiUtil.rgb2hex("rgb(106,127,225)"), DDeiUtil.rgb2hex("rgb(224,138,19)"), DDeiUtil.rgb2hex("rgb(135,135,135)"), DDeiUtil.rgb2hex("rgb(25,25,25)"), DDeiUtil.rgb2hex("rgb(55,158,144)"), DDeiUtil.rgb2hex("rgb(49,90,187)"), DDeiUtil.rgb2hex("rgb(45,60,145)"), DDeiUtil.rgb2hex("rgb(188,91,87)"), DDeiUtil.rgb2hex("rgb(188,149,59)"), DDeiUtil.rgb2hex("rgb(102,140,188)"), DDeiUtil.rgb2hex("rgb(87,105,188)"), DDeiUtil.rgb2hex("rgb(187,114,14)") ], //常用标准色 ds3: [ DDeiUtil.rgb2hex("rgb(192,0,0)"), DDeiUtil.rgb2hex("rgb(255,0,0)"), DDeiUtil.rgb2hex("rgb(255,192,0)"), DDeiUtil.rgb2hex("rgb(255,255,0)"), DDeiUtil.rgb2hex("rgb(146,208,80)"), DDeiUtil.rgb2hex("rgb(0,176,80)"), DDeiUtil.rgb2hex("rgb(0,146,240)"), DDeiUtil.rgb2hex("rgb(0,112,192)"), DDeiUtil.rgb2hex("rgb(0,32,96)"), DDeiUtil.rgb2hex("rgb(112,48,160)") ] }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId]) == null ? void 0 : _c2.dataSource)) { this.dataSource = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId].dataSource; } if (((_e2 = this.editor) == null ? void 0 : _e2.tempDialogData) && ((_g = (_f = this.editor) == null ? void 0 : _f.tempDialogData[this.dialogId]) == null ? void 0 : _g.value)) { this.value = (_h = this.editor) == null ? void 0 : _h.tempDialogData[this.dialogId].value; } DDeiUtil.readRecentlyChooseColors(); for (let i2 = (_i = DDeiUtil.recentlyChooseColors) == null ? void 0 : _i.length; i2 >= 0; i2--) { this.ds1.splice(0, 0, DDeiUtil.recentlyChooseColors[i2]); if (this.ds1.length > 10) { this.ds1.splice(10, 1); } } }, selectColor(evt) { let srcElement = evt.currentTarget; this.value = DDeiUtil.rgb2hex(srcElement.style.backgroundColor); }, selectConfirmColor(evt) { let srcElement = evt.currentTarget; this.value = DDeiUtil.rgb2hex(srcElement.style.backgroundColor); this.ok(); }, ok() { var _a3, _b2, _c2, _d2, _e2, _f; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.value); } if (this.value) { DDeiUtil.whiteRecentlyChooseColors(this.value); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-selectcolor"); }, clear() { this.value = null; }, cancel() { DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-selectcolor"); } } }; const SelectColorDialog_vue_vue_type_style_index_0_scoped_cd291105_lang = ""; const _hoisted_1$s = ["id"]; const _hoisted_2$k = { class: "content" }; const _hoisted_3$h = { class: "group" }; const _hoisted_4$a = { class: "title" }; const _hoisted_5$9 = { class: "group_content color1" }; const _hoisted_6$6 = { class: "group" }; const _hoisted_7$6 = { class: "group_content color2" }; const _hoisted_8$4 = { class: "group" }; const _hoisted_9$4 = { class: "title" }; const _hoisted_10$3 = { class: "group_content color1" }; const _hoisted_11$3 = { class: "group" }; const _hoisted_12$2 = { class: "title" }; const _hoisted_13$2 = { class: ".group_content color3" }; const _hoisted_14$1 = { class: "tail" }; function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-selectcolor" }, [ vue.createElementVNode("div", _hoisted_2$k, [ vue.createElementVNode("div", _hoisted_3$h, [ vue.createElementVNode("div", _hoisted_4$a, vue.toDisplayString(_ctx.editor.i18n("ddei.selectColor.recently")), 1), vue.createElementVNode("div", _hoisted_5$9, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.ds1, (color) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item-selected": color == $data.value }), onClick: _cache[0] || (_cache[0] = ($event) => $options.selectColor($event)), style: vue.normalizeStyle({ "background": color }), onDblclick: _cache[1] || (_cache[1] = ($event) => $options.selectConfirmColor($event)) }, null, 38); }), 256)) ]) ]), vue.createElementVNode("div", _hoisted_6$6, [ vue.createElementVNode("div", _hoisted_7$6, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.ds2, (color) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item-selected": color == $data.value }), onClick: _cache[2] || (_cache[2] = ($event) => $options.selectColor($event)), style: vue.normalizeStyle({ "background": color }), onDblclick: _cache[3] || (_cache[3] = ($event) => $options.selectConfirmColor($event)) }, null, 38); }), 256)) ]) ]), vue.createElementVNode("div", _hoisted_8$4, [ vue.createElementVNode("div", _hoisted_9$4, vue.toDisplayString(_ctx.editor.i18n("ddei.selectColor.standard")), 1), vue.createElementVNode("div", _hoisted_10$3, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.ds3, (color) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item-selected": color == $data.value }), onClick: _cache[4] || (_cache[4] = ($event) => $options.selectColor($event)), style: vue.normalizeStyle({ "background": color }), onDblclick: _cache[5] || (_cache[5] = ($event) => $options.selectConfirmColor($event)) }, null, 38); }), 256)) ]) ]), vue.createElementVNode("div", _hoisted_11$3, [ vue.createElementVNode("div", _hoisted_12$2, vue.toDisplayString(_ctx.editor.i18n("ddei.selectColor.choosed")), 1), vue.createElementVNode("div", _hoisted_13$2, [ vue.withDirectives(vue.createElementVNode("input", { type: "color", "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.value = $event), class: "colorinput", autocomplete: "off" }, null, 512), [ [vue.vModelText, $data.value] ]), vue.withDirectives(vue.createElementVNode("input", { type: "text", "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.value = $event), autocomplete: "off" }, null, 512), [ [vue.vModelText, $data.value] ]), vue.createElementVNode("div", { class: "button button-small", onClick: _cache[8] || (_cache[8] = (...args) => $options.clear && $options.clear(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.clear")), 1) ]) ]), vue.createElementVNode("div", _hoisted_14$1, [ vue.createElementVNode("div", { class: "button button-main", onClick: _cache[9] || (_cache[9] = (...args) => $options.ok && $options.ok(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.confirm")), 1), vue.createElementVNode("div", { class: "button", onClick: _cache[10] || (_cache[10] = (...args) => $options.cancel && $options.cancel(...args)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.cancel")), 1) ]) ]) ], 8, _hoisted_1$s)) : vue.createCommentVNode("", true); } const SelectColorDialog = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$s], ["__scopeId", "data-v-cd291105"]]); const _DDeiCoreSelectColorDialog = class _DDeiCoreSelectColorDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", SelectColorDialog.name); __publicField3(this, "plugins", [SelectColorDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[SelectColorDialog.name]) { for (let i2 in options[SelectColorDialog.name]) { newOptions[i2] = options[SelectColorDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreSelectColorDialog(newOptions); return panels; } } return _DDeiCoreSelectColorDialog; } static modify(fn) { return _DDeiCoreSelectColorDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSelectColorDialog, "defaultIns", new _DDeiCoreSelectColorDialog(null)); let DDeiCoreSelectColorDialog = _DDeiCoreSelectColorDialog; const _sfc_main$r = { name: "ddei-core-dialog-selectfont", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-selectfont", dataSource: null, value: null }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId]) == null ? void 0 : _c2.dataSource)) { this.dataSource = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId].dataSource; } if (((_e2 = this.editor) == null ? void 0 : _e2.tempDialogData) && ((_g = (_f = this.editor) == null ? void 0 : _f.tempDialogData[this.dialogId]) == null ? void 0 : _g.value)) { this.value = (_h = this.editor) == null ? void 0 : _h.tempDialogData[this.dialogId].value; } }, ok(data) { var _a3, _b2, _c2, _d2, _e2, _f; this.value = data; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(data); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-selectfont"); }, select(data) { var _a3, _b2, _c2, _d2, _e2, _f; this.value = data; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(data); } } } }; const SelectFontDialog_vue_vue_type_style_index_0_scoped_64fcb708_lang = ""; const _hoisted_1$r = ["id"]; const _hoisted_2$j = { class: "content" }; const _hoisted_3$g = { class: "group" }; const _hoisted_4$9 = { class: "group_content" }; const _hoisted_5$8 = ["onDblclick", "onClick", "title"]; function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-selectfont" }, [ vue.createElementVNode("div", _hoisted_2$j, [ vue.createElementVNode("div", _hoisted_3$g, [ vue.createElementVNode("div", _hoisted_4$9, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "item": true, "item_selected": item.value == $data.value, "item_deleted": item.deleted, "item_disabled": item.disabled, "item_underline": item.underline, "item_bold": item.bold }), onDblclick: ($event) => !item.disabled && $options.ok(item.value), onClick: ($event) => !item.disabled && $options.select(item.value), title: item.desc }, [ item.text ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "text", style: vue.normalizeStyle({ "font-family": item.fontFamily }) }, vue.toDisplayString(item.text), 5)) : vue.createCommentVNode("", true) ], 42, _hoisted_5$8); }), 256)) ]) ]) ]) ], 8, _hoisted_1$r)) : vue.createCommentVNode("", true); } const SelectFontDialog = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$r], ["__scopeId", "data-v-64fcb708"]]); const _DDeiCoreSelectFontDialog = class _DDeiCoreSelectFontDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", SelectFontDialog.name); __publicField3(this, "plugins", [SelectFontDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[SelectFontDialog.name]) { for (let i2 in options[SelectFontDialog.name]) { newOptions[i2] = options[SelectFontDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreSelectFontDialog(newOptions); return panels; } } return _DDeiCoreSelectFontDialog; } static modify(fn) { return _DDeiCoreSelectFontDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSelectFontDialog, "defaultIns", new _DDeiCoreSelectFontDialog(null)); let DDeiCoreSelectFontDialog = _DDeiCoreSelectFontDialog; const _sfc_main$q = { name: "ddei-core-dialog-selectfontsize", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-selectfontsize", dataSource: null, value: null }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId]) == null ? void 0 : _c2.dataSource)) { this.dataSource = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId].dataSource; } if (((_e2 = this.editor) == null ? void 0 : _e2.tempDialogData) && ((_g = (_f = this.editor) == null ? void 0 : _f.tempDialogData[this.dialogId]) == null ? void 0 : _g.value)) { this.value = (_h = this.editor) == null ? void 0 : _h.tempDialogData[this.dialogId].value; } }, ok(data) { var _a3, _b2, _c2, _d2, _e2, _f; this.value = data; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(data); } DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-selectfontsize"); }, select(data) { var _a3, _b2, _c2, _d2, _e2, _f; this.value = data; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(data); } } } }; const SelectFontSizeDialog_vue_vue_type_style_index_0_scoped_9fc02a16_lang = ""; const _hoisted_1$q = ["id"]; const _hoisted_2$i = { class: "content" }; const _hoisted_3$f = { class: "group" }; const _hoisted_4$8 = { class: "group_content" }; const _hoisted_5$7 = ["onDblclick", "onClick", "title"]; function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-selectfontsize" }, [ vue.createElementVNode("div", _hoisted_2$i, [ vue.createElementVNode("div", _hoisted_3$f, [ vue.createElementVNode("div", _hoisted_4$8, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "itembox": true, "itembox_selected": item.value == $data.value, "itembox_deleted": item.deleted, "itembox_disabled": item.disabled, "itembox_underline": item.underline, "itembox_bold": item.bold }), onDblclick: ($event) => !item.disabled && $options.ok(item.value), onClick: ($event) => !item.disabled && $options.select(item.value), title: item.desc }, [ item.text ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "itembox_text", style: vue.normalizeStyle({ "font-family": item.fontFamily }) }, vue.toDisplayString(item.text), 5)) : vue.createCommentVNode("", true) ], 42, _hoisted_5$7); }), 256)) ]) ]) ]) ], 8, _hoisted_1$q)) : vue.createCommentVNode("", true); } const SelectFontSizeDialog = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-9fc02a16"]]); const _DDeiCoreSelectFontSizeDialog = class _DDeiCoreSelectFontSizeDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", SelectFontSizeDialog.name); __publicField3(this, "plugins", [SelectFontSizeDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[SelectFontSizeDialog.name]) { for (let i2 in options[SelectFontSizeDialog.name]) { newOptions[i2] = options[SelectFontSizeDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreSelectFontSizeDialog(newOptions); return panels; } } return _DDeiCoreSelectFontSizeDialog; } static modify(fn) { return _DDeiCoreSelectFontSizeDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSelectFontSizeDialog, "defaultIns", new _DDeiCoreSelectFontSizeDialog(null)); let DDeiCoreSelectFontSizeDialog = _DDeiCoreSelectFontSizeDialog; const _sfc_main$p = { name: "ddei-core-dialog-textalign", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-textalign", value: 5 //当前选中值 }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2; let align = 2; let valign = 2; if (((_a3 = this.editor) == null ? void 0 : _a3.tempDialogData) && ((_b2 = this.editor) == null ? void 0 : _b2.tempDialogData[this.dialogId])) { align = (_c2 = this.editor) == null ? void 0 : _c2.tempDialogData[this.dialogId].align; valign = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId].valign; } let value = 5; switch (align) { case 1: switch (valign) { case 1: value = 1; break; case 2: value = 4; break; case 3: value = 7; break; } break; case 2: switch (valign) { case 1: value = 2; break; case 2: value = 5; break; case 3: value = 8; break; } break; case 3: switch (valign) { case 1: value = 3; break; case 2: value = 6; break; case 3: value = 9; break; } break; } this.value = value; }, /** * 修改文本对齐方式 */ changeAlign(v) { var _a3, _b2, _c2, _d2, _e2, _f; this.value = v; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempDialogData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempDialogData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.value); } }, /** * 修改文本对齐方式 */ ok(v) { this.changeAlign(v); DDeiEditorUtil.closeDialog(this.editor, "ddei-core-dialog-textalign"); } } }; const TextAlignDialog_vue_vue_type_style_index_0_scoped_fe33bdea_lang = ""; const _hoisted_1$p = ["id"]; const _hoisted_2$h = { class: "content" }; const _hoisted_3$e = { class: "title" }; const _hoisted_4$7 = { class: "group" }; const _hoisted_5$6 = { class: "group_content" }; function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-textalign" }, [ vue.createElementVNode("div", _hoisted_2$h, [ vue.createElementVNode("div", _hoisted_3$e, vue.toDisplayString(_ctx.editor.i18n("ddei.align")), 1), vue.createElementVNode("div", _hoisted_4$7, [ vue.createElementVNode("div", _hoisted_5$6, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 1 }), onClick: _cache[0] || (_cache[0] = ($event) => $options.changeAlign(1)), onDblclick: _cache[1] || (_cache[1] = ($event) => $options.ok(1)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos1")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 2 }), onClick: _cache[2] || (_cache[2] = ($event) => $options.changeAlign(2)), onDblclick: _cache[3] || (_cache[3] = ($event) => $options.ok(2)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos2")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 3 }), onClick: _cache[4] || (_cache[4] = ($event) => $options.changeAlign(3)), onDblclick: _cache[5] || (_cache[5] = ($event) => $options.ok(3)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos3")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 4 }), onClick: _cache[6] || (_cache[6] = ($event) => $options.changeAlign(4)), onDblclick: _cache[7] || (_cache[7] = ($event) => $options.ok(4)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos4")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 5 }), onClick: _cache[8] || (_cache[8] = ($event) => $options.changeAlign(5)), onDblclick: _cache[9] || (_cache[9] = ($event) => $options.ok(5)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos5")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 6 }), onClick: _cache[10] || (_cache[10] = ($event) => $options.changeAlign(6)), onDblclick: _cache[11] || (_cache[11] = ($event) => $options.ok(6)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos6")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 7 }), onClick: _cache[12] || (_cache[12] = ($event) => $options.changeAlign(7)), onDblclick: _cache[13] || (_cache[13] = ($event) => $options.ok(7)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos7")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 8 }), onClick: _cache[14] || (_cache[14] = ($event) => $options.changeAlign(8)), onDblclick: _cache[15] || (_cache[15] = ($event) => $options.ok(8)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos8")), 35), vue.createElementVNode("div", { class: vue.normalizeClass({ "item": true, "selected": $data.value == 9 }), onClick: _cache[16] || (_cache[16] = ($event) => $options.changeAlign(9)), onDblclick: _cache[17] || (_cache[17] = ($event) => $options.ok(9)) }, vue.toDisplayString(_ctx.editor.i18n("ddei.property.ds.pos9")), 35) ]) ]) ]) ], 8, _hoisted_1$p)) : vue.createCommentVNode("", true); } const TextAlignDialog = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p], ["__scopeId", "data-v-fe33bdea"]]); const _DDeiCoreTextAlignDialog = class _DDeiCoreTextAlignDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", TextAlignDialog.name); __publicField3(this, "plugins", [TextAlignDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[TextAlignDialog.name]) { for (let i2 in options[TextAlignDialog.name]) { newOptions[i2] = options[TextAlignDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreTextAlignDialog(newOptions); return panels; } } return _DDeiCoreTextAlignDialog; } static modify(fn) { return _DDeiCoreTextAlignDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreTextAlignDialog, "defaultIns", new _DDeiCoreTextAlignDialog(null)); let DDeiCoreTextAlignDialog = _DDeiCoreTextAlignDialog; const _sfc_main$o = { name: "ddei-core-dialog-choosecontrol", extends: null, mixins: [DialogBase$2], props: { //外部传入的插件扩展参数 options: { type: Object, default: null } }, data() { return { dialogId: "ddei-core-dialog-choosecontrol", group: null }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2; if (((_a3 = this.editor) == null ? void 0 : _a3.tempPopData) && ((_c2 = (_b2 = this.editor) == null ? void 0 : _b2.tempPopData[this.dialogId]) == null ? void 0 : _c2.controlGroup)) { this.group = (_d2 = this.editor) == null ? void 0 : _d2.tempPopData[this.dialogId].controlGroup; } }, ok(control, evt) { var _a3, _b2, _c2, _d2, _e2, _f; delete this.isDrag; delete this.dragControl; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempPopData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.ok) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempPopData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.ok(this.group, control, evt); } }, prepareDrag(control, evt) { var _a3, _b2, _c2; if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempPopData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.drag) { this.isDrag = true; this.dragControl = control; } }, dragMove(evt) { var _a3, _b2, _c2, _d2, _e2, _f; if (this.isDrag) { if ((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.tempPopData[this.dialogId]) == null ? void 0 : _b2.callback) == null ? void 0 : _c2.drag) { (_f = (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.tempPopData[this.dialogId]) == null ? void 0 : _e2.callback) == null ? void 0 : _f.drag(this.group, this.dragControl, evt); delete this.isDrag; delete this.dragControl; } } } } }; const ChooseControlDialog_vue_vue_type_style_index_0_scoped_5962d4b2_lang = ""; const _hoisted_1$o = ["id"]; const _hoisted_2$g = { class: "ddei-core-dialog-choosecontrol-content" }; const _hoisted_3$d = { key: 0, class: "ddei-core-dialog-choosecontrol-content-itempanel" }; const _hoisted_4$6 = ["onClick", "onMousedown", "title"]; const _hoisted_5$5 = ["src"]; const _hoisted_6$5 = ["innerHTML"]; const _hoisted_7$5 = { class: "text" }; function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-core-dialog-choosecontrol" }, [ vue.createElementVNode("div", _hoisted_2$g, [ $data.group ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$d, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.group.controls, (control) => { var _a4; return vue.openBlock(), vue.createElementBlock("div", { onClick: ($event) => $options.ok(control, $event), onMousedown: ($event) => $options.prepareDrag(control, $event), onMousemove: _cache[0] || (_cache[0] = ($event) => $options.dragMove($event)), class: vue.normalizeClass({ "ddei-core-dialog-choosecontrol-content-itempanel-item": true }), title: control.desc }, [ !control.icon ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, class: "icon", src: (_a4 = _ctx.editor) == null ? void 0 : _a4.icons[control.id] }, null, 8, _hoisted_5$5)) : vue.createCommentVNode("", true), control.icon ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "icon-html", innerHTML: control.icon }, null, 8, _hoisted_6$5)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_7$5, vue.toDisplayString(_ctx.editor.i18n(control.name)), 1) ], 40, _hoisted_4$6); }), 256)) ])) : vue.createCommentVNode("", true) ]) ], 8, _hoisted_1$o)) : vue.createCommentVNode("", true); } const ChooseControlDialog = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$o], ["__scopeId", "data-v-5962d4b2"]]); const _DDeiCoreChooseControlDialog = class _DDeiCoreChooseControlDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", ChooseControlDialog.name); __publicField3(this, "plugins", [ChooseControlDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ChooseControlDialog.name]) { for (let i2 in options[ChooseControlDialog.name]) { newOptions[i2] = options[ChooseControlDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreChooseControlDialog(newOptions); return panels; } } return _DDeiCoreChooseControlDialog; } static modify(fn) { return _DDeiCoreChooseControlDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreChooseControlDialog, "defaultIns", new _DDeiCoreChooseControlDialog(null)); let DDeiCoreChooseControlDialog = _DDeiCoreChooseControlDialog; const _DDeiCoreDialogs = class _DDeiCoreDialogs extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ DDeiCoreAlignDialog, DDeiCoreChangeRatioDialog, DDeiCoreChooseControlGroupDialog, DDeiCoreCloseFileConfirmDialog, DDeiCoreCollFileConfirmDialog, DDeiCoreLinePointTypeDialog, DDeiCoreLineTypeDialog, DDeiCoreManageLayersDialog, DDeiCoreMergeComposeDialog, DDeiCorePositionDialog, DDeiCorePublishFileConfirmDialog, DDeiCoreQCViewDialog, DDeiCoreQuickSetStyleDialog, DDeiCoreRotateDialog, DDeiCoreSelectBorderDashDialog, DDeiCoreSelectBorderWeightDialog, DDeiCoreSelectColorDialog, DDeiCoreSelectFontDialog, DDeiCoreSelectFontSizeDialog, DDeiCoreTextAlignDialog, DDeiCoreChooseControlDialog ]); } getDialogs(editor) { var _a3; let panels = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getDialogs(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getDialogs(editor); } if ((ls == null ? void 0 : ls.length) > 0) { panels = panels.concat(ls); } }); return panels; } static configuration(options) { var _a3; if (options) { let panels = new _DDeiCoreDialogs(options); for (let i2 = 0; i2 < ((_a3 = panels.plugins) == null ? void 0 : _a3.length); i2++) { panels.plugins[i2] = panels.plugins[i2].configuration(options, true); } return panels; } return _DDeiCoreDialogs; } static modify(fn) { return _DDeiCoreDialogs.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreDialogs, "defaultIns", new _DDeiCoreDialogs(null)); let DDeiCoreDialogs = _DDeiCoreDialogs; const _sfc_main$n = { name: "pv-text", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { this.$watch("attrDefine.value", function(newVal, oldVal) { this.valueChange(); }); }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, evt, true ); }); } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVTextEditor_vue_vue_type_style_index_0_scoped_48447048_lang = ""; const _hoisted_1$n = ["type", "disabled", "placeholder"]; function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2; return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-text": true, "ddei-pv-editor-text--disabled": $props.attrDefine.readonly }) }, [ vue.withDirectives(vue.createElementVNode("input", { type: ((_b2 = (_a3 = $props.attrDefine) == null ? void 0 : _a3.itemStyle) == null ? void 0 : _b2.type) ? (_d2 = (_c2 = $props.attrDefine) == null ? void 0 : _c2.itemStyle) == null ? void 0 : _d2.type : "input", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event), disabled: $props.attrDefine.readonly, placeholder: $props.editor.i18n($props.attrDefine.defaultValue), autocomplete: "off" }, null, 8, _hoisted_1$n), [ [vue.vModelDynamic, $props.attrDefine.value] ]) ], 2); } const PVTextEditor = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-48447048"]]); const _DDeiCoreTextPropEditor = class _DDeiCoreTextPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", PVTextEditor.name); __publicField3(this, "type", "plugin"); __publicField3(this, "plugins", [PVTextEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreTextPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVTextEditor.name]) { for (let i2 in options[PVTextEditor.name]) { newOptions[i2] = options[PVTextEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreTextPropEditor(newOptions); return layouts; } } return _DDeiCoreTextPropEditor; } static modify(fn) { return _DDeiCoreTextPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreTextPropEditor, "defaultIns", new _DDeiCoreTextPropEditor(null)); let DDeiCoreTextPropEditor = _DDeiCoreTextPropEditor; const _sfc_main$m = { name: "pv-basecombox", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, canSearch: { type: Boolean, default: false }, searchMethod: { type: Function, defaut: null }, //当前控件定义 controlDefine: { type: Object, default: null }, options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { //是否展开 expanded: false, //值 value: null, //文本 text: null, //图片 img: null, defaultText: "" }; }, computed: {}, watch: {}, created() { this.search = debounce(this.search, 200); }, mounted() { this.destroyDialog(); }, methods: { getShowDialogId(id) { return "ddei_attr_editor_dialog_" + id; }, getEditorId(id) { return "ddei_attr_editor_" + id; }, search(evt) { if (this.searchMethod) { this.searchMethod(this.text, evt); } }, //打开弹出框 showDialog(show = false, evt) { var _a3; if (!((_a3 = this.editor) == null ? void 0 : _a3.containerid)) { return; } let dialogId = this.getShowDialogId(this.attrDefine.code); let dialog = document.getElementById(dialogId); let haveElement = false; let ele = document.getElementById(this.editor.containerid); for (let i2 = 0; i2 < ele.children.length; i2++) { if (ele.children[i2] == dialog) { haveElement = true; } } if (!haveElement) { let ele2 = document.getElementById(this.editor.containerid); ele2.appendChild(dialog); } if (!this.expanded || haveElement) { dialog.style.display = "block"; let attrEditor = document.getElementById( this.getEditorId(this.attrDefine.code) ); let position = DDeiUtil.getDomAbsPosition(attrEditor, this.editor); let tabPanelEles = this.editor.htmlElement.getElementsByClassName("propertyview-subgroup-tabpanel"); let tabPanelTop = 0; if ((tabPanelEles == null ? void 0 : tabPanelEles.length) > 0) { tabPanelTop = tabPanelEles[0].scrollTop; } dialog.style.left = position.left - dialog.offsetWidth + attrEditor.offsetWidth - 9.5 + "px"; dialog.style.top = position.top + attrEditor.offsetHeight - tabPanelTop + "px"; this.expanded = true; if (!DDeiEditor.ACTIVE_INSTANCE.tempDialogData) { DDeiEditor.ACTIVE_INSTANCE.tempDialogData = {}; } DDeiEditor.ACTIVE_INSTANCE.tempDialogData[dialogId] = { group: "property-dialog" }; } else { dialog.style.display = "none"; this.expanded = false; if (DDeiEditor.ACTIVE_INSTANCE.tempDialogData) { DDeiEditor.ACTIVE_INSTANCE.tempDialogData[dialogId] = null; } } }, //移除弹出框 destroyDialog() { var _a3; if ((_a3 = this.editor) == null ? void 0 : _a3.containerid) { let dialogs = []; let ele = document.getElementById(this.editor.containerid); for (let i2 = 0; i2 < ele.children.length; i2++) { if (ele.children[i2].className == "ddei-combox-show-dialog") { dialogs.push(ele.children[i2]); } } dialogs.forEach((dialog) => { dialog.remove(); }); } }, closeDialog(evt) { this.expanded = false; let dialog = document.getElementById( this.getShowDialogId(this.attrDefine.code) ); dialog.style.display = "none"; } } }; const PVBaseCombox_vue_vue_type_style_index_0_scoped_b36dc5e7_lang = ""; const _hoisted_1$m = ["id"]; const _hoisted_2$f = ["readonly", "placeholder"]; const _hoisted_3$c = ["id"]; const _hoisted_4$5 = { class: "ddei-combox-show-dialog-content" }; function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; return vue.openBlock(), vue.createElementBlock("div", { id: $options.getEditorId((_a3 = $props.attrDefine) == null ? void 0 : _a3.code), class: vue.normalizeClass({ "ddei-pv-base-combox": true, "ddei-pv-base-combox--disabled": !$props.attrDefine || $props.attrDefine.readonly }) }, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "textinput": true, "textinput_expanded": $data.expanded, "display_img": $data.img && ((_c2 = (_b2 = $props.attrDefine) == null ? void 0 : _b2.itemStyle) == null ? void 0 : _c2.display) == "img", "display_img_text": $data.img && ((_e2 = (_d2 = $props.attrDefine) == null ? void 0 : _d2.itemStyle) == null ? void 0 : _e2.display) == "img-text" }) }, [ $data.img && (((_g = (_f = $props.attrDefine) == null ? void 0 : _f.itemStyle) == null ? void 0 : _g.display) == "img-text" || ((_i = (_h = $props.attrDefine) == null ? void 0 : _h.itemStyle) == null ? void 0 : _i.display) == "img") ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, class: vue.normalizeClass($data.img), onClick: _cache[0] || (_cache[0] = ($event) => $props.attrDefine && !$props.attrDefine.readonly && !$props.canSearch && $options.showDialog()) }, null, 2)) : vue.createCommentVNode("", true), !((_k = (_j = $props.attrDefine) == null ? void 0 : _j.itemStyle) == null ? void 0 : _k.display) || ((_m = (_l = $props.attrDefine) == null ? void 0 : _l.itemStyle) == null ? void 0 : _m.display) == "img-text" || ((_o = (_n = $props.attrDefine) == null ? void 0 : _n.itemStyle) == null ? void 0 : _o.display) == "text" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", { key: 1, type: "text", autocomplete: "off", readonly: $props.attrDefine && ($props.attrDefine.readonly || !$props.canSearch), "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.text = $event), placeholder: $data.defaultText, onClick: _cache[2] || (_cache[2] = ($event) => $props.attrDefine && !$props.attrDefine.readonly && !$props.canSearch && $options.showDialog()), onKeydown: _cache[3] || (_cache[3] = ($event) => $options.search($event)) }, null, 40, _hoisted_2$f)), [ [vue.vModelText, $data.text] ]) : vue.createCommentVNode("", true), vue.createElementVNode("div", { style: { "display": "flex", "justify-content": "center", "align-items": "center" }, onClick: _cache[4] || (_cache[4] = ($event) => $props.attrDefine && !$props.attrDefine.readonly && $options.showDialog()) }, _cache[5] || (_cache[5] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ], -1) ])) ], 2), vue.createElementVNode("div", { id: $options.getShowDialogId((_p = $props.attrDefine) == null ? void 0 : _p.code), class: vue.normalizeClass({ "ddei-combox-show-dialog": true }) }, [ vue.createElementVNode("div", _hoisted_4$5, [ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ]) ], 8, _hoisted_3$c) ], 10, _hoisted_1$m); } const PVBaseCombox = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-b36dc5e7"]]); const _sfc_main$l = { name: "pv-align-type", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { //临时选择的值 value: null }; }, computed: {}, components: { PVBaseCombox }, watch: {}, created() { }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n; let type = this.getTypeValue(); let text2 = this.getTypeText(type.value); if (!type.isDefault) { this.attrDefine.value = type.value; } this.$refs.combox.text = text2; this.$refs.combox.value = type.value; this.value = type.value; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { let mds = []; if (((_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.size) > 0) { mds = Array.from( (_l = (_k = (_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage) == null ? void 0 : _k.selectedModels) == null ? void 0 : _l.values() ); } if (((_m = this.attrDefine) == null ? void 0 : _m.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_n = this.attrDefine) == null ? void 0 : _n.code }, this.editor.ddInstance, null); this.attrDefine.readonly = rsState == -1; } }, methods: { getTypeText(type) { return this.editor.i18n("ddei.property.ds.pos" + type); }, getTypeValue() { let align = DDeiUtil.getDataByPathList( this.attrDefine.model, "textStyle.align" ); let valign = DDeiUtil.getDataByPathList( this.attrDefine.model, "textStyle.valign" ); if (align == 1 && valign == 1) { return { value: 1 }; } else if (align == 2 && valign == 1) { return { value: 2 }; } else if (align == 3 && valign == 1) { return { value: 3 }; } else if (align == 1 && valign == 2) { return { value: 4 }; } else if (align == 2 && valign == 2) { return { value: 5 }; } else if (align == 3 && valign == 2) { return { value: 6 }; } else if (align == 1 && valign == 3) { return { value: 7 }; } else if (align == 2 && valign == 3) { return { value: 8 }; } else if (align == 3 && valign == 3) { return { value: 9 }; } return { isDefault: true, value: 5 }; }, valueChange(type, evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let align = 2; let valign = 2; switch (type) { case 1: align = 1; valign = 1; break; case 2: align = 2; valign = 1; break; case 3: align = 3; valign = 1; break; case 4: align = 1; valign = 2; break; case 5: align = 2; valign = 2; break; case 6: align = 3; valign = 2; break; case 7: align = 1; valign = 3; break; case 8: align = 2; valign = 3; break; case 9: align = 3; valign = 3; break; } this.attrDefine.value = type; let text2 = this.getTypeText(type); this.$refs.combox.text = text2; this.$refs.combox.value = type; this.value = type; let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let alignValue = parser.parseValue(align); let valignValue = parser.parseValue(valign); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, this.value); this.attrDefine.doCascadeDisplayByValue(); this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: this.value, attrDefine: this.attrDefine }, evt, true ); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, this.value); this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: ["textStyle.align"], value: alignValue, attrDefine: this.attrDefine }, evt, true ); this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: ["textStyle.valign"], value: valignValue, attrDefine: this.attrDefine }, evt, true ); DDeiUtil.setAttrValueByPath( this.attrDefine.model, ["textStyle.align"], alignValue ); DDeiUtil.setAttrValueByPath( this.attrDefine.model, ["textStyle.valign"], valignValue ); }); this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVAlignTypeEditor_vue_vue_type_style_index_0_scoped_135fda87_lang = ""; const _hoisted_1$l = { class: "ddei-pv-editor-aligntype" }; const _hoisted_2$e = { class: "ddei-pv-editor-aligntype-items" }; const _hoisted_3$b = { style: { "vertical-align": "top" } }; const _hoisted_4$4 = { style: { "vertical-align": "top" } }; const _hoisted_5$4 = { style: { "vertical-align": "top" } }; const _hoisted_6$4 = { style: { "vertical-align": "middle" } }; const _hoisted_7$4 = { style: { "vertical-align": "middle" } }; const _hoisted_8$3 = { style: { "vertical-align": "middle" } }; const _hoisted_9$3 = { style: { "vertical-align": "bottom" } }; const _hoisted_10$2 = { style: { "vertical-align": "bottom" } }; const _hoisted_11$2 = { style: { "vertical-align": "bottom" } }; function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) { const _component_PVBaseCombox = vue.resolveComponent("PVBaseCombox"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [ vue.createVNode(_component_PVBaseCombox, { editor: $props.editor, controlDefine: $props.controlDefine, attrDefine: $props.attrDefine, ref: "combox", canSearch: false }, { default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_2$e, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 1 }), style: { "text-align": "left" }, onClick: _cache[0] || (_cache[0] = ($event) => $options.valueChange(1, $event)) }, [ vue.createElementVNode("div", _hoisted_3$b, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos1")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 2 }), style: { "text-align": "center" }, onClick: _cache[1] || (_cache[1] = ($event) => $options.valueChange(2, $event)) }, [ vue.createElementVNode("div", _hoisted_4$4, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos2")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 3 }), style: { "text-align": "right" }, onClick: _cache[2] || (_cache[2] = ($event) => $options.valueChange(3, $event)) }, [ vue.createElementVNode("div", _hoisted_5$4, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos3")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 4 }), style: { "text-align": "left" }, onClick: _cache[3] || (_cache[3] = ($event) => $options.valueChange(4, $event)) }, [ vue.createElementVNode("div", _hoisted_6$4, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos4")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 5 }), style: { "text-align": "center" }, onClick: _cache[4] || (_cache[4] = ($event) => $options.valueChange(5, $event)) }, [ vue.createElementVNode("div", _hoisted_7$4, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos5")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 6 }), style: { "text-align": "right" }, onClick: _cache[5] || (_cache[5] = ($event) => $options.valueChange(6, $event)) }, [ vue.createElementVNode("div", _hoisted_8$3, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos6")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 7 }), style: { "text-align": "left" }, onClick: _cache[6] || (_cache[6] = ($event) => $options.valueChange(7, $event)) }, [ vue.createElementVNode("div", _hoisted_9$3, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos7")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 8 }), style: { "text-align": "center" }, onClick: _cache[7] || (_cache[7] = ($event) => $options.valueChange(8, $event)) }, [ vue.createElementVNode("div", _hoisted_10$2, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos8")), 1) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-pv-editor-aligntype-item": true, "ddei-pv-editor-aligntype-item--selected": $data.value == 9 }), style: { "text-align": "right" }, onClick: _cache[8] || (_cache[8] = ($event) => $options.valueChange(9, $event)) }, [ vue.createElementVNode("div", _hoisted_11$2, vue.toDisplayString($props.editor.i18n("ddei.property.ds.pos9")), 1) ], 2) ]) ]), _: 1 }, 8, ["editor", "controlDefine", "attrDefine"]) ]); } const PVAlignTypeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$l], ["__scopeId", "data-v-135fda87"]]); const _DDeiCoreAlignTypePropEditor = class _DDeiCoreAlignTypePropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVAlignTypeEditor.name); __publicField3(this, "plugins", [PVAlignTypeEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreAlignTypePropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVAlignTypeEditor.name]) { for (let i2 in options[PVAlignTypeEditor.name]) { newOptions[i2] = options[PVAlignTypeEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreAlignTypePropEditor(newOptions); return layouts; } } return _DDeiCoreAlignTypePropEditor; } static modify(fn) { return _DDeiCoreAlignTypePropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreAlignTypePropEditor, "defaultIns", new _DDeiCoreAlignTypePropEditor(null)); let DDeiCoreAlignTypePropEditor = _DDeiCoreAlignTypePropEditor; const _sfc_main$k = { name: "pv-border-dash", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { //值 value: null }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { getEditorId(id) { return "ddei_attr_editor_" + id; }, //打开弹出框 showDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectborderdash", { value: this.attrDefine.value, dataSource: this.attrDefine.dataSource, callback: { ok: this.valueChange }, group: "property-dialog" }, { type: 5 }, srcElement); }, valueChange(value) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } this.attrDefine.getParser(); this.attrDefine.value = value; let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, value); hasEditSetted = true; } } } if (!hasEditSetted) { DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, null, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, null, true ); }); } } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVBorderDashComboEditor_vue_vue_type_style_index_0_scoped_2e01e102_lang = ""; const _hoisted_1$k = ["id"]; const _hoisted_2$d = { class: "div_input" }; const _hoisted_3$a = ["stroke-dasharray"]; function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return vue.openBlock(), vue.createElementBlock("div", { id: $options.getEditorId((_a3 = $props.attrDefine) == null ? void 0 : _a3.code), class: vue.normalizeClass({ "ddei-pv-border-dash-combox": true, "ddei-pv-border-dash-combox--disabled": !$props.attrDefine || $props.attrDefine.readonly }) }, [ vue.createElementVNode("div", { class: "textinput", onClick: _cache[0] || (_cache[0] = ($event) => $props.attrDefine && !$props.attrDefine.readonly && $options.showDialog($event)) }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2$d, [ vue.createElementVNode("line", { x1: "0", y1: "0", x2: "100%", y2: "0", "stroke-width": "3", "stroke-dasharray": $props.attrDefine.value }, null, 8, _hoisted_3$a) ])), _cache[1] || (_cache[1] = vue.createElementVNode("div", { style: { "display": "flex", "justify-content": "center", "align-items": "center" } }, [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ]) ], -1)) ]) ], 10, _hoisted_1$k); } const PVBorderDashComboEditor = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-2e01e102"]]); const _DDeiCoreBorderDashComboPropEditor = class _DDeiCoreBorderDashComboPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVBorderDashComboEditor.name); __publicField3(this, "plugins", [PVBorderDashComboEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreBorderDashComboPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVBorderDashComboEditor.name]) { for (let i2 in options[PVBorderDashComboEditor.name]) { newOptions[i2] = options[PVBorderDashComboEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreBorderDashComboPropEditor(newOptions); return layouts; } } return _DDeiCoreBorderDashComboPropEditor; } static modify(fn) { return _DDeiCoreBorderDashComboPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreBorderDashComboPropEditor, "defaultIns", new _DDeiCoreBorderDashComboPropEditor(null)); let DDeiCoreBorderDashComboPropEditor = _DDeiCoreBorderDashComboPropEditor; const _sfc_main$j = { name: "pv-border-type", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { dataSource: null }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; this.getDataSource(this.attrDefine); let type = this.getTypeValue(); if (type) { this.attrDefine.value = type.value; this.showOrHiddenOtherAttrs(this.attrDefine.value); } let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { /** * 根据值获取选项定义 * @param value 值 */ getDataDefine(value) { if (this.dataSource && value) { for (let i2 = 0; i2 < this.dataSource.length; i2++) { if (this.dataSource[i2].value.toString() == value.toString()) { return this.dataSource[i2]; } } } return { text: "" }; }, /** * 选中radio */ checkRadioValue(attrDefine, evt) { let targetElement = evt.target; if (targetElement.tagName == "DIV" && targetElement.className == "itembox") { targetElement = targetElement.children[0]; } else if (targetElement.tagName == "DIV") { targetElement = targetElement.parentElement.children[0]; } if (attrDefine.value == targetElement.value) { attrDefine.value = null; } else { attrDefine.value = targetElement.value; } this.valueChange(); }, /** * 获取数据源数据 */ getDataSource(attrDefine) { let dataSources = DDeiEditorUtil.getDataSource(this.editor, this.attrDefine); this.dataSource = dataSources; return this.dataSource; }, showOrHiddenOtherAttrs(value) { if (value == "0") { this.controlDefine.groups.forEach((group2) => { DDeiEditorArrtibute.hiddenAttributesByCode( group2, "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound" ); }); } else if (value == "1") { this.controlDefine.groups.forEach((group2) => { DDeiEditorArrtibute.showAttributesByCode( group2, "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound" ); }); } }, getTypeValue() { var _a3, _b2; let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.exmapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = DDeiUtil.getDataByPathList(this.attrDefine.model, paths); if (!value) { return { value: "1" }; } else if (value == "true" || value == true) { return { value: "0" }; } return { isDefault: true, value: this.attrDefine.getParser().getDefaultValue() }; }, valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.exmapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); this.showOrHiddenOtherAttrs(value); this.editor.ddInstance.stage.selectedModels.forEach((element) => { if (value == "0") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: true, attrDefine: this.attrDefine }, evt, true ); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, true); } else if (value == "1") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: false, attrDefine: this.attrDefine }, evt, true ); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, false); } }); this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVBorderTypeEditor_vue_vue_type_style_index_0_scoped_ea9f8fdd_lang = ""; const _hoisted_1$j = ["disabled", "name", "value"]; function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei_pv_editor_bordertype": true, "ddei_pv_editor_bordertype_disabled": $props.attrDefine.readonly }), style: vue.normalizeStyle({ "pointer-events": $props.attrDefine.readonly ? "none" : "" }) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { return vue.openBlock(), vue.createElementBlock("div", { class: "itembox", onClick: _cache[1] || (_cache[1] = ($event) => $options.checkRadioValue($props.attrDefine, $event)) }, [ vue.withDirectives(vue.createElementVNode("input", { type: "radio", disabled: $props.attrDefine.readonly, name: $props.attrDefine.id, value: item.value, autocomplete: "off", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event) }, null, 8, _hoisted_1$j), [ [vue.vModelRadio, $props.attrDefine.value] ]), vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1) ]); }), 256)) ], 6); } const PVBorderTypeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$j], ["__scopeId", "data-v-ea9f8fdd"]]); const _DDeiCoreBorderTypePropEditor = class _DDeiCoreBorderTypePropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVBorderTypeEditor.name); __publicField3(this, "plugins", [PVBorderTypeEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreBorderTypePropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVBorderTypeEditor.name]) { for (let i2 in options[PVBorderTypeEditor.name]) { newOptions[i2] = options[PVBorderTypeEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreBorderTypePropEditor(newOptions); return layouts; } } return _DDeiCoreBorderTypePropEditor; } static modify(fn) { return _DDeiCoreBorderTypePropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreBorderTypePropEditor, "defaultIns", new _DDeiCoreBorderTypePropEditor(null)); let DDeiCoreBorderTypePropEditor = _DDeiCoreBorderTypePropEditor; const _sfc_main$i = { name: "pv-color-combo", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { //值 value: null }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { getEditorId(id) { return "ddei_attr_editor_" + id; }, //打开弹出框 showDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectcolor", { value: this.attrDefine.value, callback: { ok: this.valueChange }, group: "property-dialog" }, { type: 5 }, srcElement); }, valueChange(value) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } this.attrDefine.getParser(); this.attrDefine.value = value; let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, value); hasEditSetted = true; } } } if (!hasEditSetted) { DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, null, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, null, true ); }); } } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVColorComboEditor_vue_vue_type_style_index_0_scoped_22680f1e_lang = ""; const _hoisted_1$i = ["id"]; const _hoisted_2$c = ["readonly"]; function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return vue.openBlock(), vue.createElementBlock("div", { id: $options.getEditorId((_a3 = $props.attrDefine) == null ? void 0 : _a3.code), class: vue.normalizeClass({ "ddei-pv-color-combox": true, "ddei-pv-color-combox--disabled": !$props.attrDefine || $props.attrDefine.readonly }) }, [ vue.createElementVNode("div", { class: "textinput", onClick: _cache[1] || (_cache[1] = ($event) => $props.attrDefine && !$props.attrDefine.readonly && $options.showDialog($event)) }, [ vue.withDirectives(vue.createElementVNode("input", { type: "color", readonly: $props.attrDefine && $props.attrDefine.readonly, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event), autocomplete: "off" }, null, 8, _hoisted_2$c), [ [vue.vModelText, $props.attrDefine.value] ]), _cache[2] || (_cache[2] = vue.createElementVNode("div", { style: { "display": "flex", "justify-content": "center", "align-items": "center" } }, [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-btn-down" }) ]) ], -1)) ]) ], 10, _hoisted_1$i); } const PVColorComboEditor = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$i], ["__scopeId", "data-v-22680f1e"]]); const _DDeiCoreColorComboPropEditor = class _DDeiCoreColorComboPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVColorComboEditor.name); __publicField3(this, "plugins", [PVColorComboEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreColorComboPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVColorComboEditor.name]) { for (let i2 in options[PVColorComboEditor.name]) { newOptions[i2] = options[PVColorComboEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreColorComboPropEditor(newOptions); return layouts; } } return _DDeiCoreColorComboPropEditor; } static modify(fn) { return _DDeiCoreColorComboPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreColorComboPropEditor, "defaultIns", new _DDeiCoreColorComboPropEditor(null)); let DDeiCoreColorComboPropEditor = _DDeiCoreColorComboPropEditor; const _sfc_main$h = { name: "pv-color", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { this.valueChange = throttle(this.valueChange, 40); this.$watch("attrDefine.value", function(newVal, oldVal) { this.valueChange(); }); }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, value); hasEditSetted = true; } } } if (!hasEditSetted) { DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, evt, true ); }); } } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVColorEditor_vue_vue_type_style_index_0_scoped_ec0fa5a7_lang = ""; const _hoisted_1$h = ["step", "disabled"]; const _hoisted_2$b = { class: "textinput" }; const _hoisted_3$9 = ["disabled", "placeholder"]; function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-color": true, "ddei-pv-editor-color--disabled": $props.attrDefine.readonly }) }, [ vue.withDirectives(vue.createElementVNode("input", { type: "color", step: $props.attrDefine.step, class: "color", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event), autocomplete: "off", disabled: $props.attrDefine.readonly }, null, 8, _hoisted_1$h), [ [vue.vModelText, $props.attrDefine.value] ]), vue.createElementVNode("div", _hoisted_2$b, [ vue.withDirectives(vue.createElementVNode("input", { type: "text", "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.attrDefine.value = $event), disabled: $props.attrDefine.readonly, autocomplete: "off", placeholder: $props.attrDefine.defaultValue }, null, 8, _hoisted_3$9), [ [vue.vModelText, $props.attrDefine.value] ]) ]) ], 2); } const PVColorEditor = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-ec0fa5a7"]]); const _DDeiCoreColorPropEditor = class _DDeiCoreColorPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVColorEditor.name); __publicField3(this, "plugins", [PVColorEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreColorPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVColorEditor.name]) { for (let i2 in options[PVColorEditor.name]) { newOptions[i2] = options[PVColorEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreColorPropEditor(newOptions); return layouts; } } return _DDeiCoreColorPropEditor; } static modify(fn) { return _DDeiCoreColorPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreColorPropEditor, "defaultIns", new _DDeiCoreColorPropEditor(null)); let DDeiCoreColorPropEditor = _DDeiCoreColorPropEditor; const _sfc_main$g = { name: "pv-combox", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { //临时选择的值 value: null, //已加载的数据源 dataSource: null, width: 0, height: 0, col: 1, gridTemplateColumns: "1fr", gridTemplateRows: "", searchText: "" }; }, computed: {}, components: { PVBaseCombox }, watch: {}, created() { }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B; let itemWidth = ((_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.itemStyle) == null ? void 0 : _b2.width) ? (_d2 = (_c2 = this.attrDefine) == null ? void 0 : _c2.itemStyle) == null ? void 0 : _d2.width : 100; let itemCols = ((_f = (_e2 = this.attrDefine) == null ? void 0 : _e2.itemStyle) == null ? void 0 : _f.col) ? (_h = (_g = this.attrDefine) == null ? void 0 : _g.itemStyle) == null ? void 0 : _h.col : 1; let itemHeight = ((_j = (_i = this.attrDefine) == null ? void 0 : _i.itemStyle) == null ? void 0 : _j.height) ? (_l = (_k = this.attrDefine) == null ? void 0 : _k.itemStyle) == null ? void 0 : _l.height : 30; let itemRows = ((_n = (_m = this.attrDefine) == null ? void 0 : _m.itemStyle) == null ? void 0 : _n.row) ? (_p = (_o = this.attrDefine) == null ? void 0 : _o.itemStyle) == null ? void 0 : _p.row : 0; this.width = (itemWidth + 5) * itemCols + 10; this.col = itemCols; this.height = (itemHeight + 5) * itemRows; let gridTemplateColumns = this.gridTemplateColumns; if (this.col > 1) { for (let i2 = 2; i2 <= this.col; i2++) { gridTemplateColumns += " 1fr"; } this.gridTemplateColumns = gridTemplateColumns; } if (itemRows) { let gridTemplateRows = ""; for (let i2 = 1; i2 <= itemRows; i2++) { gridTemplateRows += itemHeight + "px "; } this.gridTemplateRows = gridTemplateRows; } this.getDataSource(this.attrDefine); let type = this.getDataValue(); let define2 = this.getDataDefine(type.value); if (!type.isDefault) { this.attrDefine.value = type.value; this.$refs.combox.text = define2.text; if (define2.img) { this.$refs.combox.img = define2.img; } } else { this.$refs.combox.defaultText = define2.text; this.$refs.combox.img = define2.img; } this.$refs.combox.value = type.value; this.value = type.value; this.attrDefine.doCascadeDisplayByValue(); let mds; if (((_t = (_s = (_r = (_q = this.editor) == null ? void 0 : _q.ddInstance) == null ? void 0 : _r.stage) == null ? void 0 : _s.selectedModels) == null ? void 0 : _t.size) > 0) { mds = Array.from( (_x = (_w = (_v = (_u = this.editor) == null ? void 0 : _u.ddInstance) == null ? void 0 : _v.stage) == null ? void 0 : _w.selectedModels) == null ? void 0 : _x.values() ); } else { mds = [(_z = (_y = this.editor) == null ? void 0 : _y.ddInstance) == null ? void 0 : _z.stage]; } if (((_A = this.attrDefine) == null ? void 0 : _A.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_B = this.attrDefine) == null ? void 0 : _B.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { /** * 根据值获取选项定义 * @param value 值 */ getDataDefine(value) { if (this.dataSource && value) { for (let i2 = 0; i2 < this.dataSource.length; i2++) { if (this.dataSource[i2].value.toString() == value.toString()) { return this.dataSource[i2]; } } } return { text: "" }; }, doSearch(text2, evt) { this.searchText = text2; this.getDataSource(this.attrDefine); this.$refs.combox.showDialog(true, evt); }, //获取数据值 getDataValue() { var _a3; if (this.attrDefine) { let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList( this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping ); } if (dataValue) { return { value: dataValue }; } } return { isDefault: true, value: (_a3 = this.attrDefine) == null ? void 0 : _a3.getParser().getDefaultValue() }; }, valueChange(value, evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } this.attrDefine.value = value; let itemDefine = this.getDataDefine(value); let text2 = itemDefine.text; this.$refs.combox.text = text2; if (itemDefine.img) { this.$refs.combox.img = itemDefine.img; } this.$refs.combox.value = value; this.value = value; let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(value); let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, value); hasEditSetted = true; } } } if (!hasEditSetted) { DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, parsedValue); this.attrDefine.doCascadeDisplayByValue(); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { (_o = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _o.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue, attrDefine: this.attrDefine }, evt, true ); }); } } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_p = this.attrDefine) == null ? void 0 : _p.code }, this.editor.ddInstance, null); }, /** * 获取数据源数据 */ getDataSource(attrDefine) { if (this.attrDefine) { let dataSources = DDeiEditorUtil.getDataSource( this.editor, this.attrDefine, this.searchText ); this.dataSource = dataSources; return this.dataSource; } } } }; const PVComboxEditor_vue_vue_type_style_index_0_scoped_e318138d_lang = ""; const _hoisted_1$g = ["onClick", "title"]; const _hoisted_2$a = { key: 0, class: "itembox_img" }; const _hoisted_3$8 = ["src"]; function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) { var _a3; const _component_PVBaseCombox = vue.resolveComponent("PVBaseCombox"); return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-combox": true, "ddei-pv-editor-combox--disabled": !$props.attrDefine || $props.attrDefine.readonly }), style: vue.normalizeStyle({ "pointer-events": $props.attrDefine.readonly ? "none" : "" }) }, [ vue.createVNode(_component_PVBaseCombox, { editor: $props.editor, controlDefine: $props.controlDefine, attrDefine: $props.attrDefine, searchMethod: $options.doSearch, ref: "combox", canSearch: (_a3 = $props.attrDefine) == null ? void 0 : _a3.canSearch }, { default: vue.withCtx(() => [ vue.createElementVNode("div", { class: "itemboxs", style: vue.normalizeStyle({ width: $data.width ? $data.width + "px" : "", height: $data.height ? $data.height + "px" : "", "grid-template-columns": $data.gridTemplateColumns, "grid-template-rows": $data.gridTemplateRows }) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { var _a4, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n; return vue.openBlock(), vue.createElementBlock("div", { style: vue.normalizeStyle({ width: ((_b2 = (_a4 = $props.attrDefine) == null ? void 0 : _a4.itemStyle) == null ? void 0 : _b2.width) + "px", height: ((_d2 = (_c2 = $props.attrDefine) == null ? void 0 : _c2.itemStyle) == null ? void 0 : _d2.height) + "px" }), class: vue.normalizeClass({ "itembox": true, "itembox--selected": item.value == $props.attrDefine.value, "itembox--deleted": item.deleted, "itembox--disabled": item.disabled, "itembox--underline": item.underline, "itembox--bold": item.bold }), onClick: ($event) => !item.disabled && $options.valueChange(item.value, $event), title: item.desc }, [ item.img ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [ vue.createElementVNode("img", { style: vue.normalizeStyle({ width: ((_f = (_e2 = $props.attrDefine) == null ? void 0 : _e2.itemStyle) == null ? void 0 : _f.imgWidth) + "px", height: ((_h = (_g = $props.attrDefine) == null ? void 0 : _g.itemStyle) == null ? void 0 : _h.imgHeight) + "px" }), src: item.img }, null, 12, _hoisted_3$8) ])) : vue.createCommentVNode("", true), item.text ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "itembox_text", style: vue.normalizeStyle({ "font-family": item.fontFamily, "text-align": (_j = (_i = $props.attrDefine) == null ? void 0 : _i.itemStyle) == null ? void 0 : _j.align, "padding-left": (_l = (_k = $props.attrDefine) == null ? void 0 : _k.itemStyle) == null ? void 0 : _l.paddingLeft }) }, vue.toDisplayString(item.text), 5)) : vue.createCommentVNode("", true), item.desc ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, class: "itembox_desc", style: vue.normalizeStyle({ "font-family": item.fontFamily, "text-align": (_n = (_m = $props.attrDefine) == null ? void 0 : _m.itemStyle) == null ? void 0 : _n.align }) }, vue.toDisplayString(item.desc), 5)) : vue.createCommentVNode("", true) ], 14, _hoisted_1$g); }), 256)) ], 4) ]), _: 1 }, 8, ["editor", "controlDefine", "attrDefine", "searchMethod", "canSearch"]) ], 6); } const PVComboxEditor = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__scopeId", "data-v-e318138d"]]); const _DDeiCoreComboxPropEditor = class _DDeiCoreComboxPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVComboxEditor.name); __publicField3(this, "plugins", [PVComboxEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreComboxPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVComboxEditor.name]) { for (let i2 in options[PVComboxEditor.name]) { newOptions[i2] = options[PVComboxEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreComboxPropEditor(newOptions); return layouts; } } return _DDeiCoreComboxPropEditor; } static modify(fn) { return _DDeiCoreComboxPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreComboxPropEditor, "defaultIns", new _DDeiCoreComboxPropEditor(null)); let DDeiCoreComboxPropEditor = _DDeiCoreComboxPropEditor; const _sfc_main$f = { name: "pv-excheckbox", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { //临时选择的值 value: null, //已加载的数据源 dataSource: null, width: 0, height: 0, col: 1, gridTemplateColumns: "1fr", gridTemplateRows: "", searchText: "" }; }, computed: {}, components: { PVBaseCombox }, watch: {}, created() { }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B; let itemWidth = ((_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.itemStyle) == null ? void 0 : _b2.width) ? (_d2 = (_c2 = this.attrDefine) == null ? void 0 : _c2.itemStyle) == null ? void 0 : _d2.width : 100; let itemCols = ((_f = (_e2 = this.attrDefine) == null ? void 0 : _e2.itemStyle) == null ? void 0 : _f.col) ? (_h = (_g = this.attrDefine) == null ? void 0 : _g.itemStyle) == null ? void 0 : _h.col : 1; let itemHeight = ((_j = (_i = this.attrDefine) == null ? void 0 : _i.itemStyle) == null ? void 0 : _j.height) ? (_l = (_k = this.attrDefine) == null ? void 0 : _k.itemStyle) == null ? void 0 : _l.height : 30; let itemRows = ((_n = (_m = this.attrDefine) == null ? void 0 : _m.itemStyle) == null ? void 0 : _n.row) ? (_p = (_o = this.attrDefine) == null ? void 0 : _o.itemStyle) == null ? void 0 : _p.row : 0; this.width = (itemWidth + 5) * itemCols + 10; this.col = itemCols; this.height = (itemHeight + 5) * itemRows; let gridTemplateColumns = this.gridTemplateColumns; if (this.col > 1) { for (let i2 = 2; i2 <= this.col; i2++) { gridTemplateColumns += " 1fr"; } this.gridTemplateColumns = gridTemplateColumns; } if (itemRows) { let gridTemplateRows = ""; for (let i2 = 1; i2 <= itemRows; i2++) { gridTemplateRows += itemHeight + "px "; } this.gridTemplateRows = gridTemplateRows; } this.getDataSource(this.attrDefine); let type = this.getDataValue(); let itemDefine = this.getDataDefine(type.value); if ((itemDefine == null ? void 0 : itemDefine.length) > 0) { let text2 = itemDefine[0].text; for (let x2 = 1; x2 < itemDefine.length; x2++) { text2 += "," + itemDefine[x2].text; } this.$refs.combox.text = text2; if (itemDefine.img) { this.$refs.combox.img = itemDefine[0].img; } this.$refs.combox.value = itemDefine[0].value; this.attrDefine.value = type.value; this.value = type.value; } this.attrDefine.doCascadeDisplayByValue(); let mds; if (((_t = (_s = (_r = (_q = this.editor) == null ? void 0 : _q.ddInstance) == null ? void 0 : _r.stage) == null ? void 0 : _s.selectedModels) == null ? void 0 : _t.size) > 0) { mds = Array.from( (_x = (_w = (_v = (_u = this.editor) == null ? void 0 : _u.ddInstance) == null ? void 0 : _v.stage) == null ? void 0 : _w.selectedModels) == null ? void 0 : _x.values() ); } else { mds = [(_z = (_y = this.editor) == null ? void 0 : _y.ddInstance) == null ? void 0 : _z.stage]; } if (((_A = this.attrDefine) == null ? void 0 : _A.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_B = this.attrDefine) == null ? void 0 : _B.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { /** * 根据值获取选项定义 * @param value 值 */ getDataDefine(value) { let returnList = []; if (this.dataSource && value) { for (let i2 = 0; i2 < this.dataSource.length; i2++) { for (let j2 = 0; j2 < value.length; j2++) { if (this.dataSource[i2].value.toString() == value[j2].toString()) { if (returnList.indexOf(this.getDataSource[i2]) == -1) { returnList.push(this.dataSource[i2]); } } } } } return returnList; }, doSearch(text2, evt) { this.searchText = text2; this.getDataSource(this.attrDefine); this.$refs.combox.showDialog(true, evt); }, //获取数据值 getDataValue() { let dataValue = this.attrDefine.value; if (!dataValue) { dataValue = DDeiUtil.getDataByPathList( this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping ); } if (dataValue) { return { value: dataValue }; } return { isDefault: true, value: this.attrDefine.getParser().getDefaultValue() }; }, valueChange(value, evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } if (this.attrDefine.dataType.toLocaleLowerCase() == "integer" || this.attrDefine.dataType.toLocaleLowerCase() == "float" || this.attrDefine.dataType.toLocaleLowerCase() == "number") { if (!value && value != 0) { return; } } else if (!value) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } if (!this.value) { this.value = []; } let strValue = value; if (this.value.indexOf(strValue) == -1) { this.value.push(strValue); } else { let index = this.value.indexOf(strValue); if (index != -1) { this.value.splice(index, 1); } } this.attrDefine.value = this.value; let itemDefine = this.getDataDefine(this.value); if ((itemDefine == null ? void 0 : itemDefine.length) > 0) { let text2 = itemDefine[0].text; for (let x2 = 1; x2 < itemDefine.length; x2++) { text2 += "," + itemDefine[x2].text; } this.$refs.combox.text = text2; if (itemDefine.img) { this.$refs.combox.img = itemDefine[0].img; } this.$refs.combox.value = itemDefine[0].value; } else { this.$refs.combox.text = null; this.$refs.combox.value = null; this.$refs.combox.img = null; } let parser = this.attrDefine.getParser(); let parsedValue = parser.parseValue(this.value); let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, parsedValue); this.attrDefine.doCascadeDisplayByValue(); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: parsedValue, attrDefine: this.attrDefine }, evt, true ); }); } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); }, /** * 获取数据源数据 */ getDataSource(attrDefine) { let dataSources = DDeiEditorUtil.getDataSource( this.editor, this.attrDefine, this.searchText ); this.dataSource = dataSources; return this.dataSource; } } }; const PVExCheckboxEditor_vue_vue_type_style_index_0_scoped_4960d25a_lang = ""; const _hoisted_1$f = ["onClick", "title"]; const _hoisted_2$9 = { key: 0, class: "itembox_img" }; const _hoisted_3$7 = ["src"]; function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) { const _component_PVBaseCombox = vue.resolveComponent("PVBaseCombox"); return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-excheckbox": true, "ddei-pv-editor-excheckbox--disabled": $props.attrDefine.readonly }), style: vue.normalizeStyle({ "pointer-events": $props.attrDefine.readonly ? "none" : "" }) }, [ vue.createVNode(_component_PVBaseCombox, { editor: $props.editor, controlDefine: $props.controlDefine, attrDefine: $props.attrDefine, searchMethod: $options.doSearch, ref: "combox", canSearch: $props.attrDefine.canSearch }, { default: vue.withCtx(() => [ vue.createElementVNode("div", { class: "itemboxs", style: vue.normalizeStyle({ width: $data.width ? $data.width + "px" : "", height: $data.height ? $data.height + "px" : "", "grid-template-columns": $data.gridTemplateColumns, "grid-template-rows": $data.gridTemplateRows }) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s; return vue.openBlock(), vue.createElementBlock("div", { style: vue.normalizeStyle({ width: ((_b2 = (_a3 = $props.attrDefine) == null ? void 0 : _a3.itemStyle) == null ? void 0 : _b2.width) + "px", height: ((_d2 = (_c2 = $props.attrDefine) == null ? void 0 : _c2.itemStyle) == null ? void 0 : _d2.height) + "px" }), class: vue.normalizeClass({ "itembox": true, "itembox--selected": ((_e2 = $props.attrDefine) == null ? void 0 : _e2.value) && ((_g = (_f = $props.attrDefine) == null ? void 0 : _f.value) == null ? void 0 : _g.indexOf(item.value)) != -1, "itembox--deleted": item.deleted, "itembox--disabled": item.disabled || ((_i = (_h = $props.attrDefine) == null ? void 0 : _h.itemStyle) == null ? void 0 : _i.maxSelect) && ((_k = (_j = $props.attrDefine) == null ? void 0 : _j.itemStyle) == null ? void 0 : _k.maxSelect) <= ((_m = (_l = $props.attrDefine) == null ? void 0 : _l.value) == null ? void 0 : _m.length) && ((_o = (_n = $props.attrDefine) == null ? void 0 : _n.value) == null ? void 0 : _o.indexOf(item.value)) == -1, "itembox--underline": item.underline, "itembox--bold": item.bold }), onClick: ($event) => { var _a4, _b3, _c3, _d3, _e3, _f2, _g2, _h2; return !item.disabled && (!((_b3 = (_a4 = $props.attrDefine) == null ? void 0 : _a4.itemStyle) == null ? void 0 : _b3.maxSelect) || ((_d3 = (_c3 = $props.attrDefine) == null ? void 0 : _c3.itemStyle) == null ? void 0 : _d3.maxSelect) > ((_f2 = (_e3 = $props.attrDefine) == null ? void 0 : _e3.value) == null ? void 0 : _f2.length) || ((_h2 = (_g2 = $props.attrDefine) == null ? void 0 : _g2.value) == null ? void 0 : _h2.indexOf(item.value)) != -1) && $options.valueChange(item.value, $event); }, title: item.desc }, [ item.img ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [ vue.createElementVNode("img", { style: vue.normalizeStyle({ width: ((_q = (_p = $props.attrDefine) == null ? void 0 : _p.itemStyle) == null ? void 0 : _q.imgWidth) + "px", height: ((_s = (_r = $props.attrDefine) == null ? void 0 : _r.itemStyle) == null ? void 0 : _s.imgHeight) + "px" }), src: item.img }, null, 12, _hoisted_3$7) ])) : vue.createCommentVNode("", true), item.text ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "itembox_text", style: vue.normalizeStyle({ "font-family": item.fontFamily }) }, vue.toDisplayString(item.text), 5)) : vue.createCommentVNode("", true) ], 14, _hoisted_1$f); }), 256)) ], 4) ]), _: 1 }, 8, ["editor", "controlDefine", "attrDefine", "searchMethod", "canSearch"]) ], 6); } const PVExCheckboxEditor = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f], ["__scopeId", "data-v-4960d25a"]]); const _DDeiCoreExCheckboxPropEditor = class _DDeiCoreExCheckboxPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVExCheckboxEditor.name); __publicField3(this, "plugins", [PVExCheckboxEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreExCheckboxPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVExCheckboxEditor.name]) { for (let i2 in options[PVExCheckboxEditor.name]) { newOptions[i2] = options[PVExCheckboxEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreExCheckboxPropEditor(newOptions); return layouts; } } return _DDeiCoreExCheckboxPropEditor; } static modify(fn) { return _DDeiCoreExCheckboxPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreExCheckboxPropEditor, "defaultIns", new _DDeiCoreExCheckboxPropEditor(null)); let DDeiCoreExCheckboxPropEditor = _DDeiCoreExCheckboxPropEditor; const _sfc_main$e = { name: "pv-fill-type", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { dataSource: null }; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; this.getDataSource(this.attrDefine); let type = this.getTypeValue(); if (type) { this.attrDefine.value = type.value; } let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { /** * 根据值获取选项定义 * @param value 值 */ getDataDefine(value) { if (this.dataSource && value) { for (let i2 = 0; i2 < this.dataSource.length; i2++) { if (this.dataSource[i2].value.toString() == value.toString()) { return this.dataSource[i2]; } } } return { text: "" }; }, /** * 选中radio */ checkRadioValue(attrDefine, evt) { let targetElement = evt.target; if (targetElement.tagName == "DIV" && targetElement.className == "itembox") { targetElement = targetElement.children[0]; } else if (targetElement.tagName == "DIV") { targetElement = targetElement.parentElement.children[0]; } if (attrDefine.value == targetElement.value) { attrDefine.value = null; } else { attrDefine.value = targetElement.value; } this.valueChange(); }, /** * 获取数据源数据 */ getDataSource(attrDefine) { let dataSources = DDeiEditorUtil.getDataSource(this.editor, this.attrDefine); this.dataSource = dataSources; return this.dataSource; }, getTypeValue() { var _a3, _b2; let paths = []; (_b2 = (_a3 = this.attrDefine) == null ? void 0 : _a3.exmapping) == null ? void 0 : _b2.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let value = DDeiUtil.getDataByPathList(this.attrDefine.model, paths); if (!value) { return { value: "1" }; } else if (value == "true" || value == true) { return { value: "0" }; } return { isDefault: true, value: this.attrDefine.getParser().getDefaultValue() }; }, valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.exmapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); if (value == "0") { DDeiEditorArrtibute.hiddenAttributesByCode( this.controlDefine.styles, "fill.color", "fill.opacity" ); if (this.controlDefine.subStyles) { DDeiEditorArrtibute.hiddenAttributesByCode( this.controlDefine.subStyles, "fill.color", "fill.opacity" ); } } else if (value == "1") { DDeiEditorArrtibute.showAttributesByCode( this.controlDefine.styles, "fill.color", "fill.opacity" ); if (this.controlDefine.subStyles) { DDeiEditorArrtibute.showAttributesByCode( this.controlDefine.subStyles, "fill.color", "fill.opacity" ); } } this.editor.ddInstance.stage.selectedModels.forEach((element) => { if (value == "0") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: true, attrDefine: this.attrDefine }, evt, true ); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, true); } else if (value == "1") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value: false, attrDefine: this.attrDefine }, evt, true ); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, false); } }); this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVFillTypeEditor_vue_vue_type_style_index_0_scoped_64114ba5_lang = ""; const _hoisted_1$e = ["disabled", "name", "value"]; function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-filltype": true, "ddei-pv-editor-filltype--disabled": $props.attrDefine.readonly }), style: vue.normalizeStyle({ "pointer-events": $props.attrDefine.readonly ? "none" : "" }) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { return vue.openBlock(), vue.createElementBlock("div", { class: "itembox", onClick: _cache[1] || (_cache[1] = ($event) => $options.checkRadioValue($props.attrDefine, $event)) }, [ vue.withDirectives(vue.createElementVNode("input", { type: "radio", disabled: $props.attrDefine.readonly, name: $props.attrDefine.id, value: item.value, autocomplete: "off", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event) }, null, 8, _hoisted_1$e), [ [vue.vModelRadio, $props.attrDefine.value] ]), vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1) ]); }), 256)) ], 6); } const PVFillTypeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e], ["__scopeId", "data-v-64114ba5"]]); const _DDeiCoreFillTypePropEditor = class _DDeiCoreFillTypePropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVFillTypeEditor.name); __publicField3(this, "plugins", [PVFillTypeEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreFillTypePropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVFillTypeEditor.name]) { for (let i2 in options[PVFillTypeEditor.name]) { newOptions[i2] = options[PVFillTypeEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreFillTypePropEditor(newOptions); return layouts; } } return _DDeiCoreFillTypePropEditor; } static modify(fn) { return _DDeiCoreFillTypePropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreFillTypePropEditor, "defaultIns", new _DDeiCoreFillTypePropEditor(null)); let DDeiCoreFillTypePropEditor = _DDeiCoreFillTypePropEditor; const _sfc_main$d = { name: "pv-font-size", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { this.$watch("attrDefine.value", function(newVal, oldVal) { this.valueChange(); }); }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); value = isNaN(value) || value <= 0 ? null : value; value = value > 300 ? 300 : value; let hasEditSetted = false; if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) { let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) { shadowControl.setSptStyle(curSIdx, curEIdx, paths, value); hasEditSetted = true; } } } if (!hasEditSetted) { DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, evt, true ); }); } } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVFontSizeEditor_vue_vue_type_style_index_0_scoped_b2ded6b2_lang = ""; const _hoisted_1$d = ["step", "min", "max", "disabled"]; const _hoisted_2$8 = { class: "textinput" }; const _hoisted_3$6 = ["step", "min", "max", "disabled", "placeholder"]; function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-fontsize": true, "ddei-pv-editor-fontsize--disabled": $props.attrDefine.readonly }), style: vue.normalizeStyle({ "pointer-events": $props.attrDefine.readonly ? "none" : "" }) }, [ vue.withDirectives(vue.createElementVNode("input", { type: "range", step: $props.attrDefine.step, class: "range", min: $props.attrDefine.min, max: $props.attrDefine.max, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event), disabled: $props.attrDefine.readonly, autocomplete: "off" }, null, 8, _hoisted_1$d), [ [vue.vModelText, $props.attrDefine.value] ]), vue.createElementVNode("div", _hoisted_2$8, [ vue.withDirectives(vue.createElementVNode("input", { type: "number", step: $props.attrDefine.step, min: $props.attrDefine.min, max: $props.attrDefine.max, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.attrDefine.value = $event), disabled: $props.attrDefine.readonly, placeholder: $props.attrDefine.defaultValue, autocomplete: "off" }, null, 8, _hoisted_3$6), [ [vue.vModelText, $props.attrDefine.value] ]), _cache[2] || (_cache[2] = vue.createElementVNode("div", { style: { "float": "left" } }, "px", -1)) ]) ], 6); } const PVFontSizeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-b2ded6b2"]]); const _DDeiCoreFontSizePropEditor = class _DDeiCoreFontSizePropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVFontSizeEditor.name); __publicField3(this, "plugins", [PVFontSizeEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreFontSizePropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVFontSizeEditor.name]) { for (let i2 in options[PVFontSizeEditor.name]) { newOptions[i2] = options[PVFontSizeEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreFontSizePropEditor(newOptions); return layouts; } } return _DDeiCoreFontSizePropEditor; } static modify(fn) { return _DDeiCoreFontSizePropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreFontSizePropEditor, "defaultIns", new _DDeiCoreFontSizePropEditor(null)); let DDeiCoreFontSizePropEditor = _DDeiCoreFontSizePropEditor; const _sfc_main$c = { name: "pv-image", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { this.$watch("attrDefine.value", function(newVal, oldVal) { this.valueChange(); }); }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { async chooseFile() { const arrFileHandle = await showOpenFilePicker({ types: [{ accept: { "image/*": [".png", ".gif", ".jpeg", ".jpg", ".webp"] } }] }); let file = await arrFileHandle[0].getFile(); let read = new FileReader(); read.readAsDataURL(file); read.onload = () => { let result = read.result; if (result.indexOf("data:image") != -1) { this.attrDefine.value = result; } }; }, valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, evt, true ); if (element.render) { element.render.imgObj = null; } }); } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVImageEditor_vue_vue_type_style_index_0_scoped_d7cc496a_lang = ""; const _hoisted_1$c = { class: "textinput" }; const _hoisted_2$7 = ["disabled", "placeholder", "name"]; function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-image": true, "ddei-pv-editor-image--disabled": $props.attrDefine.readonly }) }, [ vue.createElementVNode("div", _hoisted_1$c, [ vue.withDirectives(vue.createElementVNode("input", { type: "text", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event), disabled: $props.attrDefine.readonly, placeholder: $props.attrDefine.defaultValue, name: "ddei-pv-editor-image-" + $props.attrDefine.code, autocomplete: "off" }, null, 8, _hoisted_2$7), [ [vue.vModelText, $props.attrDefine.value] ]), (vue.openBlock(), vue.createElementBlock("svg", { onClick: _cache[1] || (_cache[1] = ($event) => $props.attrDefine && !$props.attrDefine.readonly && $options.chooseFile()), class: "icon", "aria-hidden": "true" }, _cache[2] || (_cache[2] = [ vue.createElementVNode("use", { "xlink:href": "#icon-link" }, null, -1) ]))) ]) ], 2); } const PVImageEditor = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-d7cc496a"]]); const _DDeiCoreImagePropEditor = class _DDeiCoreImagePropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVImageEditor.name); __publicField3(this, "plugins", [PVImageEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreImagePropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVImageEditor.name]) { for (let i2 in options[PVImageEditor.name]) { newOptions[i2] = options[PVImageEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreImagePropEditor(newOptions); return layouts; } } return _DDeiCoreImagePropEditor; } static modify(fn) { return _DDeiCoreImagePropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreImagePropEditor, "defaultIns", new _DDeiCoreImagePropEditor(null)); let DDeiCoreImagePropEditor = _DDeiCoreImagePropEditor; const _sfc_main$b = { name: "pv-radio", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { dataSource: null, editBefore: null, editAfter: null }; }, computed: {}, watch: {}, created() { this.$watch("attrDefine.value", function(newVal, oldVal) { this.valueChange(); }); }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; this.getDataSource(this.attrDefine); this.attrDefine.doCascadeDisplayByValue(); let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { /** * 选中radio */ checkRadioValue(attrDefine, evt) { let targetElement = evt.target; if (targetElement.tagName == "DIV" && targetElement.className == "itembox") { targetElement = targetElement.children[0]; } else if (targetElement.tagName == "DIV") { targetElement = targetElement.parentElement.children[0]; } if (attrDefine.value == targetElement.value) { attrDefine.value = null; } else { attrDefine.value = targetElement.value; } }, /** * 获取数据源数据 */ getDataSource(attrDefine) { let dataSources = DDeiEditorUtil.getDataSource(this.editor, this.attrDefine); this.dataSource = dataSources; return this.dataSource; }, valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); this.attrDefine.doCascadeDisplayByValue(); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, evt, true ); }); } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVRadioEditor_vue_vue_type_style_index_0_scoped_d06209f3_lang = ""; const _hoisted_1$b = ["disabled", "name", "value"]; function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-radio": true, "ddei-pv-editor-radio--disabled": $props.attrDefine.readonly }), style: vue.normalizeStyle({ "pointer-events": $props.attrDefine.readonly ? "none" : "" }) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.dataSource, (item) => { return vue.openBlock(), vue.createElementBlock("div", { class: "itembox", onClick: _cache[1] || (_cache[1] = ($event) => $options.checkRadioValue($props.attrDefine, $event)) }, [ vue.withDirectives(vue.createElementVNode("input", { type: "radio", disabled: $props.attrDefine.readonly, name: $props.attrDefine.id, value: item.value, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event), autocomplete: "off" }, null, 8, _hoisted_1$b), [ [vue.vModelRadio, $props.attrDefine.value] ]), vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1) ]); }), 256)) ], 6); } const PVRadioEditor = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-d06209f3"]]); const _DDeiCoreRadioPropEditor = class _DDeiCoreRadioPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVRadioEditor.name); __publicField3(this, "plugins", [PVRadioEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreRadioPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVRadioEditor.name]) { for (let i2 in options[PVRadioEditor.name]) { newOptions[i2] = options[PVRadioEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreRadioPropEditor(newOptions); return layouts; } } return _DDeiCoreRadioPropEditor; } static modify(fn) { return _DDeiCoreRadioPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreRadioPropEditor, "defaultIns", new _DDeiCoreRadioPropEditor(null)); let DDeiCoreRadioPropEditor = _DDeiCoreRadioPropEditor; const _sfc_main$a = { name: "pv-range", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { this.valueChange = throttle(this.valueChange, 50); this.$watch("attrDefine.value", function(newVal, oldVal) { this.valueChange(); }); }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from((_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values()); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, evt, true ); }); } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVRangeEditor_vue_vue_type_style_index_0_scoped_713ecc9b_lang = ""; const _hoisted_1$a = ["step", "min", "max", "disabled"]; const _hoisted_2$6 = { class: "textinput" }; const _hoisted_3$5 = ["step", "min", "max", "disabled", "placeholder", "name"]; function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-range": true, "ddei-pv-editor-range--disabled": $props.attrDefine.readonly }) }, [ vue.withDirectives(vue.createElementVNode("input", { type: "range", step: $props.attrDefine.step, class: "range", min: $props.attrDefine.min, max: $props.attrDefine.max, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event), disabled: $props.attrDefine.readonly }, null, 8, _hoisted_1$a), [ [vue.vModelText, $props.attrDefine.value] ]), vue.createElementVNode("div", _hoisted_2$6, [ vue.withDirectives(vue.createElementVNode("input", { type: "number", step: $props.attrDefine.step, min: $props.attrDefine.min, max: $props.attrDefine.max, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.attrDefine.value = $event), disabled: $props.attrDefine.readonly, placeholder: $props.attrDefine.defaultValue, name: "ddei-pv-editor-range-" + $props.attrDefine.code, autocomplete: "off" }, null, 8, _hoisted_3$5), [ [vue.vModelText, $props.attrDefine.value] ]) ]) ], 2); } const PVRangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-713ecc9b"]]); const _DDeiCoreRangePropEditor = class _DDeiCoreRangePropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVRangeEditor.name); __publicField3(this, "plugins", [PVRangeEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreRangePropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVRangeEditor.name]) { for (let i2 in options[PVRangeEditor.name]) { newOptions[i2] = options[PVRangeEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreRangePropEditor(newOptions); return layouts; } } return _DDeiCoreRangePropEditor; } static modify(fn) { return _DDeiCoreRangePropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreRangePropEditor, "defaultIns", new _DDeiCoreRangePropEditor(null)); let DDeiCoreRangePropEditor = _DDeiCoreRangePropEditor; const _sfc_main$9 = { name: "pv-switch-checkbox", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; this.attrDefine.doCascadeDisplayByValue(); let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { doCheck(attrDefine, evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if (attrDefine == null ? void 0 : attrDefine.readonly) { return; } let mds = []; if (((_e2 = (_d2 = (_c2 = (_b2 = this.editor) == null ? void 0 : _b2.ddInstance) == null ? void 0 : _c2.stage) == null ? void 0 : _d2.selectedModels) == null ? void 0 : _e2.size) > 0) { mds = Array.from( (_i = (_h = (_g = (_f = this.editor) == null ? void 0 : _f.ddInstance) == null ? void 0 : _g.stage) == null ? void 0 : _h.selectedModels) == null ? void 0 : _i.values() ); } if (((_j = this.attrDefine) == null ? void 0 : _j.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_k = this.attrDefine) == null ? void 0 : _k.code, this.editor.ddInstance, null )) { return; } let paths = []; (_m = (_l = this.attrDefine) == null ? void 0 : _l.mapping) == null ? void 0 : _m.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } if (attrDefine.value == null) { if (attrDefine.defaultValue == 1) { attrDefine.value = 0; } else { attrDefine.value = 1; } } else if (!attrDefine.value) { attrDefine.value = 1; } else { attrDefine.value = 0; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); this.attrDefine.doCascadeDisplayByValue(); (_n = this.editor.ddInstance.stage.selectedModels) == null ? void 0 : _n.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, evt, true ); }); this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVSwitchCheckboxEditor_vue_vue_type_style_index_0_scoped_5a394c0d_lang = ""; const _hoisted_1$9 = { class: "title" }; function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-switch-excheckbox": true, "ddei-pv-editor-switch-excheckbox--disabled": $props.attrDefine.readonly }), onClick: _cache[0] || (_cache[0] = ($event) => $options.doCheck($props.attrDefine, $event)), style: vue.normalizeStyle({ "pointer-events": $props.attrDefine.readonly ? "none" : "" }) }, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "chk_state": $props.attrDefine.value != 1, "chk_state_checked": $props.attrDefine.value == 1 || $props.attrDefine.value == null && $props.attrDefine.defaultValue == 1 }) }, [ vue.createElementVNode("span", null, vue.toDisplayString($props.attrDefine.value == 1 || $props.attrDefine.value == null && $props.attrDefine.defaultValue == 1 ? "✓" : ""), 1) ], 2), vue.createElementVNode("div", _hoisted_1$9, vue.toDisplayString($props.editor.i18n($props.attrDefine.name)), 1) ], 6); } const PVSwitchCheckboxEditor = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-5a394c0d"]]); const _DDeiCoreSwitchCheckboxPropEditor = class _DDeiCoreSwitchCheckboxPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "plugin"); __publicField3(this, "name", PVSwitchCheckboxEditor.name); __publicField3(this, "plugins", [PVSwitchCheckboxEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreSwitchCheckboxPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVSwitchCheckboxEditor.name]) { for (let i2 in options[PVSwitchCheckboxEditor.name]) { newOptions[i2] = options[PVSwitchCheckboxEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreSwitchCheckboxPropEditor(newOptions); return layouts; } } return _DDeiCoreSwitchCheckboxPropEditor; } static modify(fn) { return _DDeiCoreSwitchCheckboxPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreSwitchCheckboxPropEditor, "defaultIns", new _DDeiCoreSwitchCheckboxPropEditor(null)); let DDeiCoreSwitchCheckboxPropEditor = _DDeiCoreSwitchCheckboxPropEditor; const _sfc_main$8 = { name: "pv-textarea", extends: null, mixins: [], props: { //当前属性定义 attrDefine: { type: DDeiEditorArrtibute, default: null }, //当前控件定义 controlDefine: { type: Object, default: null }, //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return {}; }, computed: {}, watch: {}, created() { this.$watch("attrDefine.value", function(newVal, oldVal) { this.valueChange(); }); }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l; let mds; if (((_d2 = (_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.selectedModels) == null ? void 0 : _d2.size) > 0) { mds = Array.from( (_h = (_g = (_f = (_e2 = this.editor) == null ? void 0 : _e2.ddInstance) == null ? void 0 : _f.stage) == null ? void 0 : _g.selectedModels) == null ? void 0 : _h.values() ); } else { mds = [(_j = (_i = this.editor) == null ? void 0 : _i.ddInstance) == null ? void 0 : _j.stage]; } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: (_l = this.attrDefine) == null ? void 0 : _l.code }, this.editor.ddInstance); this.attrDefine.readonly = rsState == -1; }, methods: { valueChange(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; if (!((_a3 = this.attrDefine) == null ? void 0 : _a3.model)) { return; } if ((_b2 = this.attrDefine) == null ? void 0 : _b2.readonly) { return; } let mds = []; if (((_f = (_e2 = (_d2 = (_c2 = this.editor) == null ? void 0 : _c2.ddInstance) == null ? void 0 : _d2.stage) == null ? void 0 : _e2.selectedModels) == null ? void 0 : _f.size) > 0) { mds = Array.from( (_j = (_i = (_h = (_g = this.editor) == null ? void 0 : _g.ddInstance) == null ? void 0 : _h.stage) == null ? void 0 : _i.selectedModels) == null ? void 0 : _j.values() ); } if (((_k = this.attrDefine) == null ? void 0 : _k.model) && mds.indexOf(this.attrDefine.model) == -1) { mds.push(this.attrDefine.model); } if (this.editBefore && !this.editBefore( DDeiEnumOperateType.EDIT, mds, (_l = this.attrDefine) == null ? void 0 : _l.code, this.editor.ddInstance, null )) { return; } let paths = []; (_n = (_m = this.attrDefine) == null ? void 0 : _m.mapping) == null ? void 0 : _n.forEach((element) => { paths.push(element); }); if (!((paths == null ? void 0 : paths.length) > 0)) { paths = [this.attrDefine.code]; } let parser = this.attrDefine.getParser(); let value = parser.parseValue(this.attrDefine.value); DDeiUtil.setAttrValueByPath(this.attrDefine.model, paths, value); if (this.attrDefine.model.modelType == "DDeiStage" || this.attrDefine.model.modelType == "DDeiLayer") { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [this.attrDefine.model.modelType], paths, value, attrDefine: this.attrDefine }, evt, true ); } else { this.editor.ddInstance.stage.selectedModels.forEach((element) => { this.editor.bus.push( DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths, value, attrDefine: this.attrDefine }, evt, true ); }); } this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_AFTER", DDeiEnumOperateType.EDIT, { models: mds, propName: (_o = this.attrDefine) == null ? void 0 : _o.code }, this.editor.ddInstance, null); } } }; const PVTextAreaEditor_vue_vue_type_style_index_0_scoped_ac742ab1_lang = ""; const _hoisted_1$8 = ["disabled", "placeholder"]; function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass({ "ddei-pv-editor-textarea": true, "ddei-pv-editor-textarea--disabled": $props.attrDefine.readonly }) }, [ vue.withDirectives(vue.createElementVNode("textarea", { ref: "pvTextArea", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attrDefine.value = $event), disabled: $props.attrDefine.readonly, placeholder: $props.attrDefine.defaultValue }, null, 8, _hoisted_1$8), [ [vue.vModelText, $props.attrDefine.value] ]) ], 2); } const PVTextAreaEditor = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-ac742ab1"]]); const _DDeiCoreTextAreaPropEditor = class _DDeiCoreTextAreaPropEditor extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", PVTextAreaEditor.name); __publicField3(this, "plugins", [PVTextAreaEditor]); } getPropEditors(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = Object.assign({}, {}, _DDeiCoreTextAreaPropEditor.defaultIns.options); if (fullConfig) { if (fullConfig) { if (options[PVTextAreaEditor.name]) { for (let i2 in options[PVTextAreaEditor.name]) { newOptions[i2] = options[PVTextAreaEditor.name][i2]; } } } } else { for (let i2 in options) { newOptions[i2] = options[i2]; } } if (newOptions && Object.keys(newOptions).length !== 0) { let layouts = new _DDeiCoreTextAreaPropEditor(newOptions); return layouts; } } return _DDeiCoreTextAreaPropEditor; } static modify(fn) { return _DDeiCoreTextAreaPropEditor.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreTextAreaPropEditor, "defaultIns", new _DDeiCoreTextAreaPropEditor(null)); let DDeiCoreTextAreaPropEditor = _DDeiCoreTextAreaPropEditor; const _DDeiCorePVEditors = class _DDeiCorePVEditors extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ DDeiCoreTextPropEditor, DDeiCoreAlignTypePropEditor, DDeiCoreBorderDashComboPropEditor, DDeiCoreBorderTypePropEditor, DDeiCoreColorComboPropEditor, DDeiCoreColorPropEditor, DDeiCoreComboxPropEditor, DDeiCoreExCheckboxPropEditor, DDeiCoreFillTypePropEditor, DDeiCoreFontSizePropEditor, DDeiCoreImagePropEditor, DDeiCoreRadioPropEditor, DDeiCoreRangePropEditor, DDeiCoreSwitchCheckboxPropEditor, DDeiCoreTextAreaPropEditor ]); } getPropEditors(editor) { var _a3; let pves = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getPropEditors(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getPropEditors(editor); } if ((ls == null ? void 0 : ls.length) > 0) { pves = pves.concat(ls); } }); return pves; } static configuration(options) { var _a3; if (options) { let pves = new _DDeiCorePVEditors(options); for (let i2 = 0; i2 < ((_a3 = pves.plugins) == null ? void 0 : _a3.length); i2++) { pves.plugins[i2] = pves.plugins[i2].configuration(options, true); } return pves; } return _DDeiCorePVEditors; } static modify(fn) { return _DDeiCorePVEditors.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCorePVEditors, "defaultIns", new _DDeiCorePVEditors(null)); let DDeiCorePVEditors = _DDeiCorePVEditors; const _DDeiKeyActionAllSelect = class _DDeiKeyActionAllSelect extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-all-select"); __publicField3(this, "defaultOptions", { "keys": [ { ctrl: 1, keys: "65", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionAllSelect.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionAllSelect.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionAllSelect.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionAllSelect(newOptions); return panels; } } return _DDeiKeyActionAllSelect; } static modify(fn) { return _DDeiKeyActionAllSelect.defaultIns.modify(fn); } // ============================ 方法 =============================== isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } action(evt, ddInstance) { var _a3, _b2, _c2, _d2, _e2, _f; if (ddInstance && ddInstance.stage) { if (this.isActive(document.activeElement)) { let models = []; if (((_a3 = ddInstance.stage.selectedModels) == null ? void 0 : _a3.size) > 0) { models = Array.from((_b2 = ddInstance.stage.selectedModels) == null ? void 0 : _b2.values()); } if ((models == null ? void 0 : models.length) == 1 && models[0].baseModelType == "DDeiTable" && models[0].curRow != -1 && models[0].curCol != -1) { for (let i2 = 0; i2 < models[0].rows.length; i2++) { let rowObj = models[0].rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { rowObj[j2].setState(DDeiEnumControlState.SELECTED); } } } else { let layer2 = ddInstance.stage.layers[ddInstance.stage.layerIndex]; let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_SELECT_BEFORE", DDeiEnumOperateType.SELECT, { models: Array.from(layer2.models.values()) }, ddInstance, evt); if (rsState == 0 || rsState == 1) { (_c2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _c2.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: layer2.models, value: DDeiEnumControlState.SELECTED }, evt); (_d2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _d2.push(DDeiEnumBusCommandType.StageChangeSelectModels, {}, evt); } } (_e2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _e2.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_f = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _f.executeAll(); return true; } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionAllSelect, "defaultIns", new _DDeiKeyActionAllSelect()); let DDeiKeyActionAllSelect = _DDeiKeyActionAllSelect; const _DDeiKeyActionBrushData = class _DDeiKeyActionBrushData extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-brush-data"); __publicField3(this, "defaultOptions", { "keys": [ { ctrl: 1, shift: 1, keys: "67", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionBrushData.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionBrushData.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionBrushData.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionBrushData(newOptions); return panels; } } return _DDeiKeyActionBrushData; } static modify(fn) { return _DDeiKeyActionBrushData.defaultIns.modify(fn); } // ============================ 方法 =============================== isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } action(evt, ddInstance) { var _a3, _b2, _c2, _d2, _e2, _f; if (ddInstance && ddInstance.stage) { if (this.isActive(document.activeElement)) { let stage2 = ddInstance.stage; let editor = DDeiEditor.ACTIVE_INSTANCE; let models = Array.from((_a3 = ddInstance.stage.selectedModels) == null ? void 0 : _a3.values()); stage2.brushData = null; if ((models == null ? void 0 : models.length) == 1) { if (models[0].baseModelType == "DDeiTable") { let table2 = models[0]; let selectedCells = table2.getSelectedCells(); let minMaxColRow = table2.getMinMaxRowAndCol(selectedCells); stage2.brushData = []; for (let i2 = minMaxColRow.minRow; i2 <= minMaxColRow.maxRow; i2++) { let rowObj = table2.rows[i2]; let rowData = []; for (let j2 = minMaxColRow.minCol; j2 <= minMaxColRow.maxCol; j2++) { let cellObj = rowObj[j2]; rowData.push(cellObj); } stage2.brushData.push(rowData); } if (stage2.brushData.length > 0) { editor.changeState(DDeiEditorState.DESIGNING); editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); editor.bus.executeAll(); } } else { if (editor.state == DDeiEditorState.QUICK_EDITING) { let shadowControl = editor.ddInstance.stage.render.editorShadowControl; if (shadowControl == null ? void 0 : shadowControl.render.isEditoring) { let editorText = DDeiUtil.getEditorText(); let curSIdx = -1; let curEIdx = -1; if (editorText) { curSIdx = editorText.selectionStart; curEIdx = editorText.selectionEnd; } stage2.brushDataText = cloneDeep(shadowControl.getSptAllStyles(curSIdx, curEIdx)); } delete stage2.brushData; (_b2 = editor.bus) == null ? void 0 : _b2.push(DDeiEnumBusCommandType.ChangeCursor, { image: "cursor-brush" }); (_c2 = editor.bus) == null ? void 0 : _c2.executeAll(); } else { let model = models[0]; stage2.brushData = [model]; delete stage2.brushDataText; editor.changeState(DDeiEditorState.DESIGNING); (_d2 = editor.bus) == null ? void 0 : _d2.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); (_e2 = editor.bus) == null ? void 0 : _e2.push(DDeiEnumBusCommandType.ChangeCursor, { image: "cursor-brush" }); (_f = editor.bus) == null ? void 0 : _f.executeAll(); } return true; } } } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionBrushData, "defaultIns", new _DDeiKeyActionBrushData()); let DDeiKeyActionBrushData = _DDeiKeyActionBrushData; const _DDeiKeyActionCancelCompose = class _DDeiKeyActionCancelCompose extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-cancel-compose"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "71", ctrl: 1, shift: 1, editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCancelCompose.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCancelCompose.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCancelCompose.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCancelCompose(newOptions); return panels; } } return _DDeiKeyActionCancelCompose; } static modify(fn) { return _DDeiKeyActionCancelCompose.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { if (ddInstance && ddInstance.stage) { let layer2 = ddInstance.stage.layers[ddInstance.stage.layerIndex]; let selectedModels = layer2.getSelectedModels(); if ((selectedModels == null ? void 0 : selectedModels.size) > 0) { ddInstance.bus.push(DDeiEnumBusCommandType.ModelCancelMerge); ddInstance.bus.executeAll(); } } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCancelCompose, "defaultIns", new _DDeiKeyActionCancelCompose()); let DDeiKeyActionCancelCompose = _DDeiKeyActionCancelCompose; const _DDeiKeyActionCancelControlCreate = class _DDeiKeyActionCancelControlCreate extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-cancel-control-create"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "27", editorState: DDeiEditorState.CONTROL_CREATING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCancelControlCreate.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCancelControlCreate.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCancelControlCreate.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCancelControlCreate(newOptions); return panels; } } return _DDeiKeyActionCancelControlCreate; } static modify(fn) { return _DDeiKeyActionCancelControlCreate.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance, editor) { var _a3; if (editor.state == DDeiEditorState.CONTROL_CREATING) { if (editor.creatingControls) { let layer2 = ddInstance.stage.layers[ddInstance.stage.layerIndex]; layer2.removeModels(editor.creatingControls); editor.creatingControls = null; layer2.opPoints = []; if ((_a3 = layer2.opLine) == null ? void 0 : _a3.render) { layer2.opLine.render.enableRefreshShape(); } delete layer2.opLine; editor.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); editor.bus.push(DDeiEnumBusCommandType.RefreshShape); editor.bus.executeAll(); } } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCancelControlCreate, "defaultIns", new _DDeiKeyActionCancelControlCreate()); let DDeiKeyActionCancelControlCreate = _DDeiKeyActionCancelControlCreate; const _DDeiKeyActionCancelCurrentAction = class _DDeiKeyActionCancelCurrentAction extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-cancel-current-action"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "27", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCancelCurrentAction.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCancelCurrentAction.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCancelCurrentAction.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCancelCurrentAction(newOptions); return panels; } } return _DDeiKeyActionCancelCurrentAction; } static modify(fn) { return _DDeiKeyActionCancelCurrentAction.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance, editor) { var _a3, _b2; if (editor.state == DDeiEditorState.DESIGNING) { let stage2 = ddInstance.stage; let layer2 = stage2.layers[stage2 == null ? void 0 : stage2.layerIndex]; if (layer2) { layer2.opPoints = []; if ((_a3 = layer2.opLine) == null ? void 0 : _a3.render) { layer2.opLine.render.enableRefreshShape(); } delete layer2.opLine; (_b2 = layer2.shadowControls) == null ? void 0 : _b2.forEach((c) => { c.destroyed(); }); layer2.shadowControls = []; stage2.render.operateState = DDeiEnumOperateState.NONE; ddInstance.bus.push(DDeiEnumBusCommandType.ClearTemplateVars, null, evt); ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds, null, evt); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); ddInstance.bus.executeAll(); } } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCancelCurrentAction, "defaultIns", new _DDeiKeyActionCancelCurrentAction()); let DDeiKeyActionCancelCurrentAction = _DDeiKeyActionCancelCurrentAction; const _DDeiKeyActionCancelQuickEdit = class _DDeiKeyActionCancelQuickEdit extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-quickedit-cancel"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "27", editorState: DDeiEditorState.QUICK_EDITING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCancelQuickEdit.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCancelQuickEdit.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCancelQuickEdit.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCancelQuickEdit(newOptions); return panels; } } return _DDeiKeyActionCancelQuickEdit; } static modify(fn) { return _DDeiKeyActionCancelQuickEdit.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { var _a3; if (ddInstance.stage.brushDataText) { delete ddInstance.stage.brushDataText; } else { let editor = DDeiEditor.ACTIVE_INSTANCE; let inputEle = editor.quickEditorInput; inputEle.value = ""; if ((_a3 = ddInstance.stage.render.editorShadowControl) == null ? void 0 : _a3.isShadowControl) { ddInstance.stage.render.editorShadowControl.destroyed(); } ddInstance.stage.render.editorShadowControl = null; editor.quickEditorModel = null; delete ddInstance.stage.brushDataText; editor.changeState(DDeiEditorState.DESIGNING); editor.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); editor.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); editor.bus.push(DDeiEnumBusCommandType.RefreshShape); editor.bus.executeAll(); } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCancelQuickEdit, "defaultIns", new _DDeiKeyActionCancelQuickEdit()); let DDeiKeyActionCancelQuickEdit = _DDeiKeyActionCancelQuickEdit; const _DDeiKeyActionCancelSelect = class _DDeiKeyActionCancelSelect extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-cancel-select"); __publicField3(this, "defaultOptions", { "keys": [ //取消全选,500毫秒内,连续按两下esc键 { keys: "27", times: 2, interval: 500, editorState: DDeiEditorState.DESIGNING, operateState: DDeiEnumOperateState.NONE } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCancelSelect.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCancelSelect.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCancelSelect.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCancelSelect(newOptions); return panels; } } return _DDeiKeyActionCancelSelect; } static modify(fn) { return _DDeiKeyActionCancelSelect.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { var _a3, _b2, _c2, _d2, _e2, _f; if (ddInstance && ddInstance.stage) { let models = Array.from((_a3 = ddInstance.stage.selectedModels) == null ? void 0 : _a3.values()); if ((models == null ? void 0 : models.length) == 1 && models[0].baseModelType == "DDeiTable" && models[0].curRow != -1 && models[0].curCol != -1) { for (let i2 = 0; i2 < models[0].rows.length; i2++) { let rowObj = models[0].rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { rowObj[j2].setState(DDeiEnumControlState.DEFAULT); } } models[0].curRow = -1; models[0].curCol = -1; models[0].tempDragCell = null; } else { let layer2 = ddInstance.stage.layers[ddInstance.stage.layerIndex]; (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, { container: layer2, curLevel: true }, evt); (_c2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _c2.push(DDeiEnumBusCommandType.StageChangeSelectModels, {}, evt); (_d2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _d2.push(DDeiEnumBusCommandType.UpdateSelectorBounds, null, evt); } (_e2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _e2.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_f = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _f.executeAll(); } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCancelSelect, "defaultIns", new _DDeiKeyActionCancelSelect()); let DDeiKeyActionCancelSelect = _DDeiKeyActionCancelSelect; const _DDeiKeyActionClearBrushData = class _DDeiKeyActionClearBrushData extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-clear-brushdata"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "27", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionClearBrushData.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionClearBrushData.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionClearBrushData.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionClearBrushData(newOptions); return panels; } } return _DDeiKeyActionClearBrushData; } static modify(fn) { return _DDeiKeyActionClearBrushData.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { var _a3, _b2; if (ddInstance && ddInstance.stage) { let stage2 = ddInstance.stage; if (stage2) { stage2.brushData = null; (_a3 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _a3.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: "default" }); (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.executeAll(); } } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionClearBrushData, "defaultIns", new _DDeiKeyActionClearBrushData()); let DDeiKeyActionClearBrushData = _DDeiKeyActionClearBrushData; const _DDeiKeyActionCloseDialog = class _DDeiKeyActionCloseDialog extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-close-dialog"); __publicField3(this, "defaultOptions", { "keys": [ //ESC关闭弹出框 { keys: "27", editorState: DDeiEditorState.PROPERTY_EDITING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCloseDialog.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCloseDialog.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCloseDialog.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCloseDialog(newOptions); return panels; } } return _DDeiKeyActionCloseDialog; } static modify(fn) { return _DDeiKeyActionCloseDialog.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { DDeiEditorUtil.closeDialogs(DDeiEditorUtil.getEditorInsByDDei(ddInstance), ["bottom-dialog", "property-dialog", "top-dialog", "toolbox-dialog"]); } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCloseDialog, "defaultIns", new _DDeiKeyActionCloseDialog()); let DDeiKeyActionCloseDialog = _DDeiKeyActionCloseDialog; const _DDeiKeyActionCompose = class _DDeiKeyActionCompose extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-compose"); __publicField3(this, "defaultOptions", { "keys": [ //组合 { keys: "71", ctrl: 1, editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCompose.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCompose.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCompose.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCompose(newOptions); return panels; } } return _DDeiKeyActionCompose; } static modify(fn) { return _DDeiKeyActionCompose.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { if (ddInstance) { ddInstance.bus.push(DDeiEnumBusCommandType.ModelMerge, null, evt); ddInstance.bus.executeAll(); } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCompose, "defaultIns", new _DDeiKeyActionCompose()); let DDeiKeyActionCompose = _DDeiKeyActionCompose; const _DDeiKeyActionCopy = class _DDeiKeyActionCopy extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-copy"); __publicField3(this, "defaultOptions", { "keys": [ { ctrl: 1, keys: "67", editorState: DDeiEditorState.DESIGNING } ] }); } isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCopy.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCopy.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCopy.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCopy(newOptions); return panels; } } return _DDeiKeyActionCopy; } static modify(fn) { return _DDeiKeyActionCopy.defaultIns.modify(fn); } // ============================ 方法 =============================== async action(evt, ddInstance, editor) { var _a3, _b2, _c2; if (ddInstance && ddInstance.stage && this.isActive(document.activeElement)) { let selectedControls = ddInstance.stage.selectedModels; let rsState = DDeiUtil.invokeCallbackFunc("EVENT_COPY_BEFORE", "COPY", { models: selectedControls }, ddInstance); if (rsState == 0 || rsState == 1) { if ((selectedControls == null ? void 0 : selectedControls.size) > 0) { let models = Array.from(selectedControls.values()); let sortedModels = []; let modelLines = []; let selectedSubAllModels = /* @__PURE__ */ new Map(); models[0].pModel.midList.forEach((mid) => { models.forEach((item) => { if (item.id == mid) { sortedModels.push(item); if (item.baseModelType == "DDeiContainer") { let subLines = item.getModelsByBaseType("DDeiLine"); let subModels = item.getSubModels(null, 100); if ((subModels == null ? void 0 : subModels.length) > 0) { subModels.forEach((element) => { selectedSubAllModels.set(element.id, element); }); } if ((subLines == null ? void 0 : subLines.length) > 0) { modelLines.push(...subLines); } } else if (item.baseModelType == "DDeiLine") { modelLines.push(item); } } }); }); let copyHtml = ""; copyHtml += ''; let jsonStr = "["; let jsonLinksStr = "["; let innerHTML = ""; sortedModels == null ? void 0 : sortedModels.forEach((model, key) => { var _a4; if ((selectedControls == null ? void 0 : selectedControls.size) == 1) { if (model.baseModelType == "DDeiTable") { if (model.curRow == -1 && model.curCol == -1) { let json = model.toJSON(); jsonStr += JSON.stringify(json) + ","; } let html = model.render.getHTML(); if (html) { innerHTML += html; } } else { let json = model.toJSON(); jsonStr += JSON.stringify(json) + ","; } } else { let json = model.toJSON(); jsonStr += JSON.stringify(json) + ","; } (_a4 = model.linkModels) == null ? void 0 : _a4.forEach((lineLM) => { if (lineLM.dm) { if (!selectedControls.has(lineLM.dm.id) && !selectedSubAllModels.has(lineLM.dm.id)) { let json = lineLM.dm.toJSON(); jsonStr += JSON.stringify(json) + ","; } } }); }); modelLines.forEach((line2) => { var _a4; let distModelLinks = (_a4 = ddInstance.stage) == null ? void 0 : _a4.getDistModelLinks(line2.id); distModelLinks == null ? void 0 : distModelLinks.forEach((link2) => { var _a5, _b3; if ((selectedControls == null ? void 0 : selectedControls.has((_a5 = link2 == null ? void 0 : link2.sm) == null ? void 0 : _a5.id)) || (selectedSubAllModels == null ? void 0 : selectedSubAllModels.has((_b3 = link2 == null ? void 0 : link2.sm) == null ? void 0 : _b3.id))) { jsonLinksStr += JSON.stringify(link2) + ","; } }); }); if (jsonStr.length > 1) { jsonStr = jsonStr.substring(0, jsonStr.length - 1); jsonStr += "]"; ddInstance.stage.copyMode = "copy"; jsonStr = '{"mode":"copy","data":' + jsonStr; if (jsonLinksStr.length > 1) { jsonLinksStr = jsonLinksStr.substring(0, jsonLinksStr.length - 1); jsonLinksStr += "]"; jsonStr += ' , "links":' + jsonLinksStr; } let ruleDisplay; let ruleInit; if (((_a3 = ddInstance.stage.ruler) == null ? void 0 : _a3.display) || ((_b2 = ddInstance.stage.ruler) == null ? void 0 : _b2.display) == 0 || ((_c2 = ddInstance.stage.ruler) == null ? void 0 : _c2.display) == false) { ruleDisplay = ddInstance.stage.ruler.display; } else if (ddInstance.ruler != null && ddInstance.ruler != void 0) { if (typeof ddInstance.ruler == "boolean") { ruleDisplay = ddInstance.ruler ? 1 : 0; } else { ruleInit = ddInstance.ruler; ruleDisplay = ruleInit.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(ddInstance.stage, "ruler.display", true); } if (ruleDisplay) { let unit = DDeiModelArrtibuteValue.getAttrValueByState(ddInstance.stage, "ruler.unit", true, ruleInit); jsonStr += ',"unit":"' + unit + '"'; } jsonStr += "}"; } else { jsonStr = ""; } copyHtml += jsonStr + ''; copyHtml += "" + innerHTML + ""; let blob = new Blob([copyHtml], { type: "text/html" }); if (DDeiConfig.ALLOW_CLIPBOARD || DDeiConfig.ALLOW_CLIPBOARD == void 0) { try { let writeDatas = []; writeDatas.push(new ClipboardItem({ "text/html": blob })); let cbData = navigator.clipboard; cbData.write(writeDatas).then(function() { editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); editor.bus.executeAll(); editor.changeState(DDeiEditorState.DESIGNING); }, function(e) { console.error("复制失败" + e); }); } catch (e) { DDeiConfig.ALLOW_CLIPBOARD = false; } } if (!DDeiConfig.ALLOW_CLIPBOARD) { window.DDEI_CLIPBOARD = blob; } return true; } } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCopy, "defaultIns", new _DDeiKeyActionCopy()); let DDeiKeyActionCopy = _DDeiKeyActionCopy; const _DDeiKeyActionCopyImage = class _DDeiKeyActionCopyImage extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-copy-image"); __publicField3(this, "defaultOptions", { "keys": [ { ctrl: 1, keys: "73", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCopyImage.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCopyImage.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCopyImage.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCopyImage(newOptions); return panels; } } return _DDeiKeyActionCopyImage; } static modify(fn) { return _DDeiKeyActionCopyImage.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance, editor) { if (DDeiConfig.ALLOW_CLIPBOARD || DDeiConfig.ALLOW_CLIPBOARD == void 0) { if (ddInstance && ddInstance.stage) { let selectedControls = ddInstance.stage.selectedModels; let models = null; if ((selectedControls == null ? void 0 : selectedControls.size) > 0) { models = Array.from(selectedControls == null ? void 0 : selectedControls.values()); } this.copyToImage(editor, ddInstance, models); } } } copyToImage(editor, ddInstance, models) { try { let dataURL = ddInstance.stage.toImageDataUrl(models); let blob = DDeiUtil.dataURLtoBlob(dataURL); let cbData = navigator.clipboard; let writeDatas = [new ClipboardItem({ [blob.type]: blob })]; cbData.write(writeDatas).then(function() { editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); editor.bus.executeAll(); editor.changeState(DDeiEditorState.DESIGNING); }); } catch (e) { console.error(e); DDeiConfig.ALLOW_CLIPBOARD = false; } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCopyImage, "defaultIns", new _DDeiKeyActionCopyImage()); let DDeiKeyActionCopyImage = _DDeiKeyActionCopyImage; const _DDeiKeyActionCut = class _DDeiKeyActionCut extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-cut"); __publicField3(this, "defaultOptions", { "keys": [ { ctrl: 1, keys: "88", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionCut.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionCut.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionCut.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionCut(newOptions); return panels; } } return _DDeiKeyActionCut; } static modify(fn) { return _DDeiKeyActionCut.defaultIns.modify(fn); } // ============================ 方法 =============================== async action(evt, ddInstance, editor) { var _a3, _b2, _c2; if (ddInstance && ddInstance.stage) { let selectedControls = ddInstance.stage.selectedModels; if ((selectedControls == null ? void 0 : selectedControls.size) > 0) { let models = Array.from(selectedControls.values()); let sortedModels = []; let modelLines = []; let selectedSubAllModels = /* @__PURE__ */ new Map(); models[0].pModel.midList.forEach((mid) => { models.forEach((item) => { if (item.id == mid) { sortedModels.push(item); if (item.baseModelType == "DDeiContainer") { let subLines = item.getModelsByBaseType("DDeiLine"); let subModels = item.getSubModels(null, 100); if ((subModels == null ? void 0 : subModels.length) > 0) { subModels.forEach((element) => { selectedSubAllModels.set(element.id, element); }); } if ((subLines == null ? void 0 : subLines.length) > 0) { modelLines.push(...subLines); } } else if (item.baseModelType == "DDeiLine") { modelLines.push(item); } } }); }); let copyHtml = ""; copyHtml += ''; let jsonStr = "["; let jsonLinksStr = "["; let innerHTML = ""; sortedModels == null ? void 0 : sortedModels.forEach((model, key) => { if ((selectedControls == null ? void 0 : selectedControls.size) == 1) { if (model.baseModelType == "DDeiTable") { if (model.curRow == -1 && model.curCol == -1) { let json = model.toJSON(); jsonStr += JSON.stringify(json) + ","; } let html = model.render.getHTML(); if (html) { innerHTML += html; } } else { let json = model.toJSON(); jsonStr += JSON.stringify(json) + ","; } } else { let json = model.toJSON(); jsonStr += JSON.stringify(json) + ","; } }); modelLines.forEach((line2) => { var _a4, _b3; let distModelLinks = (_a4 = ddInstance.stage) == null ? void 0 : _a4.getDistModelLinks(line2.id); distModelLinks == null ? void 0 : distModelLinks.forEach((link2) => { var _a5, _b4; if ((selectedControls == null ? void 0 : selectedControls.has((_a5 = link2 == null ? void 0 : link2.sm) == null ? void 0 : _a5.id)) || (selectedSubAllModels == null ? void 0 : selectedSubAllModels.has((_b4 = link2 == null ? void 0 : link2.sm) == null ? void 0 : _b4.id))) { jsonLinksStr += JSON.stringify(link2) + ","; } }); (_b3 = line2.linkModels) == null ? void 0 : _b3.forEach((lineLM) => { if (lineLM.dm) { if (!selectedControls.has(lineLM.dm.id) && !selectedSubAllModels.has(lineLM.dm.id)) { let json = lineLM.dm.toJSON(); jsonStr += JSON.stringify(json) + ","; } } }); }); if (jsonStr.length > 1) { jsonStr = jsonStr.substring(0, jsonStr.length - 1); jsonStr += "]"; ddInstance.stage.copyMode = "cut"; jsonStr = '{"mode":"cut","data":' + jsonStr; if (jsonLinksStr.length > 1) { jsonLinksStr = jsonLinksStr.substring(0, jsonLinksStr.length - 1); jsonLinksStr += "]"; jsonStr += ' , "links":' + jsonLinksStr; } let ruleDisplay; let ruleInit; if (((_a3 = ddInstance.stage.ruler) == null ? void 0 : _a3.display) || ((_b2 = ddInstance.stage.ruler) == null ? void 0 : _b2.display) == 0 || ((_c2 = ddInstance.stage.ruler) == null ? void 0 : _c2.display) == false) { ruleDisplay = ddInstance.stage.ruler.display; } else if (ddInstance.ruler != null && ddInstance.ruler != void 0) { if (typeof ddInstance.ruler == "boolean") { ruleDisplay = ddInstance.ruler ? 1 : 0; } else { ruleInit = ddInstance.ruler; ruleDisplay = ruleInit.display; } } else { ruleDisplay = DDeiModelArrtibuteValue.getAttrValueByState(ddInstance.stage, "ruler.display", true); } if (ruleDisplay) { let unit = DDeiModelArrtibuteValue.getAttrValueByState(ddInstance.stage, "ruler.unit", true, ruleInit); jsonStr += ',"unit":"' + unit + '"'; } jsonStr += "}"; } else { jsonStr = ""; } copyHtml += jsonStr + ''; copyHtml += "" + innerHTML + ""; let blob = new Blob([copyHtml], { type: "text/html" }); if (DDeiConfig.ALLOW_CLIPBOARD || DDeiConfig.ALLOW_CLIPBOARD == void 0) { try { let writeDatas = []; writeDatas.push(new ClipboardItem({ "text/html": blob })); let cbData = navigator.clipboard; cbData.write(writeDatas).then(function() { editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); editor.bus.executeAll(); editor.changeState(DDeiEditorState.DESIGNING); }, function(e) { console.error("复制失败" + e); }); } catch (e) { DDeiConfig.ALLOW_CLIPBOARD = false; } } if (!DDeiConfig.ALLOW_CLIPBOARD) { window.DDEI_CLIPBOARD = blob; } } } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionCut, "defaultIns", new _DDeiKeyActionCut()); let DDeiKeyActionCut = _DDeiKeyActionCut; const _DDeiKeyActionEnterQuickEdit = class _DDeiKeyActionEnterQuickEdit extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-quickedit-enter"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "13", shift: 1, editorState: DDeiEditorState.QUICK_EDITING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionEnterQuickEdit.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionEnterQuickEdit.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionEnterQuickEdit.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionEnterQuickEdit(newOptions); return panels; } } return _DDeiKeyActionEnterQuickEdit; } static modify(fn) { return _DDeiKeyActionEnterQuickEdit.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { var _a3; let editor = DDeiEditor.ACTIVE_INSTANCE; (_a3 = editor.quickEditorInput) == null ? void 0 : _a3.enterValue(); } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionEnterQuickEdit, "defaultIns", new _DDeiKeyActionEnterQuickEdit()); let DDeiKeyActionEnterQuickEdit = _DDeiKeyActionEnterQuickEdit; const _DDeiKeyActionMoveModels = class _DDeiKeyActionMoveModels extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-move-models"); __publicField3(this, "defaultOptions", { "keys": [ //上 { shift: 2, keys: "38", editorState: DDeiEditorState.DESIGNING }, //下 { shift: 2, keys: "40", editorState: DDeiEditorState.DESIGNING }, //左 { shift: 2, keys: "37", editorState: DDeiEditorState.DESIGNING }, //右 { shift: 2, keys: "39", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionMoveModels.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionMoveModels.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionMoveModels.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionMoveModels(newOptions); return panels; } } return _DDeiKeyActionMoveModels; } static modify(fn) { return _DDeiKeyActionMoveModels.defaultIns.modify(fn); } // ============================ 方法 =============================== isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } action(evt, ddInstance, editor) { var _a3; if (ddInstance && ddInstance.stage) { if (this.isActive(document.activeElement)) { let selectedModels = ddInstance.stage.selectedModels; let models = Array.from(selectedModels.values()); if (models.length == 1 && models[0].baseModelType == "DDeiTable" && models[0].curRow != -1 && models[0].curCol != -1) { if (evt.keyCode == 38) { if (models[0].curRow > 0) { if (models[0].tempDragCell) { models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT); } models[0].curRow--; models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol]; models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED); } } else if (evt.keyCode == 40) { if (models[0].curRow < models[0].rows.length - 1) { if (models[0].tempDragCell) { models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT); } models[0].curRow++; models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol]; models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED); } } else if (evt.keyCode == 37) { if (models[0].curCol > 0) { if (models[0].tempDragCell) { models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT); } models[0].curCol--; models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol]; models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED); } } else if (evt.keyCode == 39) { if (models[0].curCol < models[0].cols.length - 1) { if (models[0].tempDragCell) { models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT); } models[0].curCol++; models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol]; models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED); } } } else if (editor.GLOBAL_KEYBOARD_ALIGN_ENABLE) { let moveSize = 1; let isShift = DDei.KEY_DOWN_STATE.get("shift"); if (!isShift) { moveSize = 10; } let moveOriginLines = []; models.forEach((md) => { if (md.baseModelType == "DDeiLine") { moveOriginLines.push(md.id); } }); let outRect = DDeiAbstractShape.getOutRectByPV(models); let deltaX, deltaY; if (evt.keyCode == 38) { let mod = 0; if (!isShift) { if (outRect.y % moveSize > 0) { mod = moveSize - outRect.y % moveSize; } } deltaY = -moveSize + mod; } else if (evt.keyCode == 40) { let mod = 0; if (!isShift) { mod = Math.round(outRect.y) % moveSize; } deltaY = moveSize - mod; } else if (evt.keyCode == 37) { let mod = 0; if (!isShift) { if (outRect.x % moveSize > 0) { mod = moveSize - outRect.x % moveSize; } } deltaX = -moveSize + mod; } else if (evt.keyCode == 39) { let mod = 0; if (!isShift) { mod = Math.round(outRect.x) % moveSize; } deltaX = moveSize - mod; } let stage2 = ddInstance.stage; let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_CONTROL_DRAG_BEFORE", DDeiEnumOperateType.DRAG, { models }, ddInstance, evt); if (rsState == 0 || rsState == 1) { DDeiAbstractShape.moveModels(models, deltaX, deltaY, moveOriginLines); stage2.layers[stage2.layerIndex].opPoints = []; if ((_a3 = stage2.layers[stage2.layerIndex].opLine) == null ? void 0 : _a3.render) { stage2.layers[stage2.layerIndex].opLine.render.enableRefreshShape(); } delete stage2.layers[stage2.layerIndex].opLine; stage2.render.refreshJumpLine = false; ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); ddInstance.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); ddInstance.bus.executeAll(); DDeiEditorUtil.invokeCallbackFunc("EVENT_CONTROL_DRAG_AFTER", DDeiEnumOperateType.DRAG, { models }, ddInstance, evt); } return true; } } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionMoveModels, "defaultIns", new _DDeiKeyActionMoveModels()); let DDeiKeyActionMoveModels = _DDeiKeyActionMoveModels; const _DDeiKeyActionPaste = class _DDeiKeyActionPaste extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-paste"); __publicField3(this, "defaultOptions", { "keys": [ { ctrl: 1, keys: "86", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionPaste.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionPaste.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionPaste.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionPaste(newOptions); return panels; } } return _DDeiKeyActionPaste; } static modify(fn) { return _DDeiKeyActionPaste.defaultIns.modify(fn); } isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } // ============================ 方法 =============================== action(evt, ddInstance) { if (ddInstance && ddInstance.stage && this.isActive(document.activeElement)) { let modeName = DDeiUtil.getConfigValue("MODE_NAME", ddInstance); let accessCreate = DDeiUtil.isAccess( DDeiEnumOperateType.CREATE, null, null, modeName, ddInstance ); if (accessCreate) { this.doPaste(evt, ddInstance); return true; } } return false; } /** * 执行粘贴 */ async doPaste(evt, ddInstance) { let blobData = null; let type = null; if (DDeiConfig.ALLOW_CLIPBOARD || DDeiConfig.ALLOW_CLIPBOARD == void 0) { try { let items = await navigator.clipboard.read(); items[0].types.forEach((t) => { if (!type) { type = t; } else if (t = "text/html") { type = t; } }); blobData = await items[0].getType(type); DDeiConfig.ALLOW_CLIPBOARD = true; } catch (e) { DDeiConfig.ALLOW_CLIPBOARD = false; } } if (!DDeiConfig.ALLOW_CLIPBOARD) { type = "text/html"; blobData = window.DDEI_CLIPBOARD; } if (blobData) { switch (type) { case "text/plain": { let dataText = await new Response(blobData).text(); this.textPaste(evt, ddInstance.stage, dataText); break; } case "image/png": { this.imagePaste(evt, ddInstance.stage, blobData); break; } case "text/html": { let dataText = await new Response(blobData).text(); this.htmlPaste(evt, ddInstance.stage, dataText); } } } } /** * 粘贴图片 */ imagePaste(evt, stage2, blobData) { let that = this; let reader = new FileReader(); reader.onload = function(e) { let image = new Image(); image.onload = function() { var _a3, _b2, _c2, _d2, _e2; let imgBase64 = e.target.result; let layer2 = stage2.layers[stage2.layerIndex]; let offsetX = stage2.ddInstance.render.inAreaX; let offsetY = stage2.ddInstance.render.inAreaY; let createControl = true; let hasChange = false; if (((_a3 = stage2.selectedModels) == null ? void 0 : _a3.size) == 1) { let table2 = Array.from(stage2.selectedModels.values())[0]; if (table2.baseModelType == "DDeiTable") { let cells = table2.getSelectedCells(); if (cells.length > 0) { cells.forEach((cell) => { cell.setImgBase64(imgBase64); }); hasChange = true; createControl = false; } } else { if (!table2.fill) { table2.fill = { type: 2 }; } table2.fill.type = 2; table2.fill.image = imgBase64; hasChange = true; createControl = false; } } else if (((_b2 = stage2.selectedModels) == null ? void 0 : _b2.size) > 1) { let isSimpleControl = true; (_c2 = stage2.selectedModels) == null ? void 0 : _c2.forEach((item) => { if (isSimpleControl && (item.baseModelType == "DDeiTable" || item.baseModelType == "DDeiContainer")) { isSimpleControl = false; } }); if (isSimpleControl) { createControl = false; (_d2 = stage2.selectedModels) == null ? void 0 : _d2.forEach((item) => { if (!item.fill) { item.fill = { type: 2 }; } item.fill.type = 2; item.fill.image = imgBase64; }); hasChange = true; } } if (createControl) { that.createNewImage(image, imgBase64, offsetX, offsetY, stage2, layer2, evt); hasChange = true; } if (hasChange) { stage2.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); } stage2.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_e2 = stage2.ddInstance.bus) == null ? void 0 : _e2.executeAll(); }; image.src = e.target.result; }; reader.readAsDataURL(blobData); } /** * 粘贴文本 */ textPaste(evt, stage2, textData) { var _a3, _b2, _c2, _d2, _e2, _f; let layer2 = stage2.layers[stage2.layerIndex]; let offsetX = stage2.ddInstance.render.inAreaX; let offsetY = stage2.ddInstance.render.inAreaY; let createControl = true; let hasChange = false; if (((_a3 = stage2.selectedModels) == null ? void 0 : _a3.size) == 1) { let table2 = Array.from(stage2.selectedModels.values())[0]; if (table2.baseModelType == "DDeiTable") { let cells = table2.getSelectedCells(); if (cells.length > 0) { cells.forEach((cell) => { cell.text = textData; }); hasChange = true; createControl = false; } } else if (table2.baseModelType != "DDeiContainer") { table2.text = textData; hasChange = true; createControl = false; } } else if (((_b2 = stage2.selectedModels) == null ? void 0 : _b2.size) > 1) { let isSimpleControl = true; (_c2 = stage2.selectedModels) == null ? void 0 : _c2.forEach((item) => { if (isSimpleControl && (item.baseModelType == "DDeiTable" || item.baseModelType == "DDeiContainer")) { isSimpleControl = false; } }); if (isSimpleControl) { createControl = false; (_d2 = stage2.selectedModels) == null ? void 0 : _d2.forEach((item) => { item.text = textData; }); hasChange = true; } } if (createControl) { stage2.idIdx++; hasChange = true; let searchPaths = [ "font.size", "font.family" ]; let configAtrs = DDeiUtil.getAttrValueByConfig( { modelCode: "100002" }, searchPaths ); let size = DDeiUtil.measureTextSize(stage2.ddInstance, textData, configAtrs.get("font.family").data, configAtrs.get("font.size").data + 1); let dataJson = { id: "rect_" + stage2.idIdx, modelCode: "100002" }; let ccDefine = DDeiUtil.getControlDefine(dataJson); searchPaths.forEach((key) => { if (configAtrs.get(key)) { dataJson[key] = configAtrs.get(key).data; } if (ccDefine[key] != void 0 && ccDefine[key] != null) { dataJson[key] = ccDefine[key]; } }); for (let i2 in ccDefine == null ? void 0 : ccDefine.define) { dataJson[i2] = cloneDeep(ccDefine == null ? void 0 : ccDefine.define[i2]); } dataJson.text = textData; dataJson.border = { type: 0 }; dataJson.fill = { type: 0 }; dataJson.width = size.width; dataJson.height = size.height; delete dataJson.ovs; delete dataJson.font; let model = DDeiPolygon.initByJSON( dataJson, { currentStage: stage2 } ); model.initPVS(); let moveMatrix2 = new Matrix3( 1, 0, offsetX, 0, 1, offsetY, 0, 0, 1 ); model.transVectors(moveMatrix2); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: layer2, models: [model] }, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); (_e2 = stage2.ddInstance.bus) == null ? void 0 : _e2.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: [model], value: DDeiEnumControlState.SELECTED }, evt); } if (hasChange) { stage2.ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels, {}, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds, {}, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); } stage2.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_f = stage2.ddInstance.bus) == null ? void 0 : _f.executeAll(); } /** * 粘贴HTML */ htmlPaste(evt, stage2, textData) { var _a3, _b2, _c2, _d2; let layer2 = stage2.layers[stage2.layerIndex]; let offsetX = stage2.ddInstance.render.inAreaX; let offsetY = stage2.ddInstance.render.inAreaY; let ddeiJson = null; try { let searchText = ''; if (textData.indexOf(searchText) != -1) { let startIndex = textData.indexOf(searchText) + searchText.length; let endIndex = textData.indexOf(''); let ddeiJsonStr = textData.substring(startIndex, endIndex); if (ddeiJsonStr) { ddeiJson = JSON.parse(ddeiJsonStr); } } } catch (e) { console.error(e); } let hasChange = false; if (ddeiJson) { let mode = ddeiJson.mode; let jsonArray = ddeiJson.data; let jsonLinkArray = ddeiJson.links; if (!Array.isArray(jsonArray)) { jsonArray = [jsonArray]; } let unit = ddeiJson.unit; if (unit && unit != "px") { jsonArray.forEach((model) => { DDeiUtil.convertChildrenJsonUnit(model, stage2, unit); }); } let controlInitJSON = DDeiEditorUtil.getModelInitJSON(stage2.ddInstance, null, jsonArray); if (!controlInitJSON) { return; } let createControl = true; if (((_a3 = stage2.selectedModels) == null ? void 0 : _a3.size) == 1) { let model = Array.from(stage2.selectedModels.values())[0]; if (model.baseModelType == "DDeiTable") { let cells = model.getSelectedCells(); if (cells.length > 0) { cells.forEach((cell) => { this.createControl(controlInitJSON, jsonLinkArray, offsetX, offsetY, stage2, cell, mode, evt); }); hasChange = true; createControl = false; } } else if (model.baseModelType == "DDeiContainer") { this.createControl(controlInitJSON, jsonLinkArray, offsetX, offsetY, stage2, model, mode, evt); createControl = false; hasChange = true; } } if (createControl) { this.createControl(controlInitJSON, jsonLinkArray, offsetX, offsetY, stage2, layer2, mode, evt); hasChange = true; } if (hasChange) { stage2.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.UpdatePaperArea); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels, {}, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds, {}, evt); } stage2.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_b2 = stage2.ddInstance.bus) == null ? void 0 : _b2.executeAll(); } else { let tableJson = this.parseDomToJson(textData); let createControl = true; if (((_c2 = stage2.selectedModels) == null ? void 0 : _c2.size) == 1) { let model = Array.from(stage2.selectedModels.values())[0]; if (model.baseModelType == "DDeiTable") { this.copyTableToTableCell(model, tableJson); createControl = false; hasChange = true; } else if (model.baseModelType == "DDeiContainer") { this.createTable(tableJson, offsetX, offsetY, stage2, model, evt); createControl = false; hasChange = true; } } if (createControl) { this.createTable(tableJson, offsetX, offsetY, stage2, layer2, evt); hasChange = true; } if (hasChange) { stage2.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); } stage2.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_d2 = stage2.ddInstance.bus) == null ? void 0 : _d2.executeAll(); } } /** * 复制表格内容到另外一个表格的单元格中 * @param table 表格 * @param tableJson 表格单元格 */ copyTableToTableCell(table2, tableJson) { var _a3, _b2; let distCells = table2.getSelectedCells(); if (distCells && distCells.length > 0 && tableJson) { let sourceTable = tableJson; let distTable = table2; let sourceMinMaxRow = { minRow: 0, minCol: 0, maxRow: sourceTable.rows.length - 1, maxCol: sourceTable.rows[0].length - 1 }; let distMinMaxRow = distTable.getMinMaxRowAndCol(distCells); let distAreaAllSelected = distTable.isAllSelected(distMinMaxRow.minRow, distMinMaxRow.minCol, distMinMaxRow.maxRow, distMinMaxRow.maxCol); if (!distAreaAllSelected) { console.log("表格粘贴目标不是一个有效的连续区域"); return; } let rowNum = 1; let colNum = 1; let sourceRowNum = sourceMinMaxRow.maxRow - sourceMinMaxRow.minRow + 1; let distRowNum = distMinMaxRow.maxRow - distMinMaxRow.minRow + 1; let sourceColNum = sourceMinMaxRow.maxCol - sourceMinMaxRow.minCol + 1; let distColNum = distMinMaxRow.maxCol - distMinMaxRow.minCol + 1; if (distRowNum == sourceRowNum) { rowNum = sourceRowNum; } else if (distRowNum > sourceRowNum) { rowNum = distRowNum - distRowNum % sourceRowNum; } else if (distRowNum < sourceRowNum) { rowNum = sourceRowNum; } if (distColNum == sourceColNum) { colNum = sourceColNum; } else if (distColNum > sourceColNum) { colNum = distColNum - distColNum % sourceColNum; } else if (distColNum < sourceColNum) { colNum = sourceColNum; } if (distTable.hasMergeCell(distMinMaxRow.minRow, distMinMaxRow.minCol, distMinMaxRow.minRow + rowNum - 1, distMinMaxRow.minCol + colNum - 1)) { console.log("表格粘贴区域存在合并单元格"); return; } if (distTable.rows.length <= distMinMaxRow.minRow + rowNum - 1 || distTable.cols.length <= distMinMaxRow.minCol + colNum - 1) { console.log("表格粘贴区域超出表格所在最大区域"); return; } let mergeCells = []; for (let i2 = 0; i2 < rowNum && distMinMaxRow.minRow + i2 < distTable.rows.length; i2++) { let offsetI = i2 % sourceRowNum; for (let j2 = 0; j2 < colNum && distMinMaxRow.minCol + j2 < distTable.cols.length; j2++) { let offsetJ = j2 % sourceColNum; let sourceCell = sourceTable.rows[sourceMinMaxRow.minRow + offsetI][sourceMinMaxRow.minCol + offsetJ]; let targetCell = distTable.rows[distMinMaxRow.minRow + i2][distMinMaxRow.minCol + j2]; targetCell.text = sourceCell.text; targetCell.textStyle = sourceCell.textStyle; targetCell.font = sourceCell.font; targetCell.border = sourceCell.border; if (sourceCell.mergeRowNum > 1 || sourceCell.mergeColNum > 1) { targetCell.mergeRowNum = sourceCell.mergeRowNum; targetCell.mergeColNum = sourceCell.mergeColNum; mergeCells[mergeCells.length] = targetCell; } (_b2 = (_a3 = targetCell.render) == null ? void 0 : _a3.renderCacheData) == null ? void 0 : _b2.clear(); } } for (let i2 = 0; i2 < mergeCells.length; i2++) { let mc = mergeCells[i2]; let cells = distTable.getCellsByRect(mc.row, mc.col, mc.row + mc.mergeRowNum - 1, mc.col + mc.mergeColNum - 1); distTable.mergeCells(cells); } } } /** * 解析dom文本到json * @param textData 文本 * @returns json */ parseDomToJson(textData) { let tableJson = { rows: [], modelCode: "100301" }; let parser = new DOMParser(); let doc = parser.parseFromString(textData, "text/html"); if (doc) { let tableEle = doc.body.children[0]; let tableHeight = 0; tableJson.id = "copytable"; let tableWidth = 0; let eleRows = tableEle.rows; let mergeAreas = []; let colSize = {}; let rowSize = {}; for (let i2 = 0; i2 < eleRows.length; i2++) { let eleCells = eleRows[i2].cells; if (!tableJson.rows[i2]) { tableJson.rows[i2] = []; } let rowJson = tableJson.rows[i2]; for (let j2 = 0; j2 < eleCells.length; j2++) { let cellEle = eleCells[j2]; let cellJson = { modelCode: "100302", row: i2, col: j2, text: cellEle.innerText, domRow: i2, domCol: j2 }; rowJson.push(cellJson); if (cellEle.rowSpan > 1) { cellJson.mergeRowNum = parseInt(cellEle.rowSpan); } if (cellEle.colSpan > 1) { cellJson.mergeColNum = parseInt(cellEle.colSpan); } if (cellJson.mergeRowNum > 1 || cellJson.mergeColNum > 1) { if (!cellJson.mergeRowNum) { cellJson.mergeRowNum = 1; } if (!cellJson.mergeColNum) { cellJson.mergeColNum = 1; } mergeAreas.push(cellJson); } cellJson.font = {}; if (cellEle.style.fontSize) { cellJson.font.size = parseFloat(cellEle.style.fontSize); } if (cellEle.style.color) { cellJson.font.color = DDeiUtil.getColor(cellEle.style.color); } if (cellEle.style.fontFamily) { cellJson.font.family = cellEle.style.fontFamily; } cellJson.border = {}; cellJson.border.top = {}; cellJson.border.bottom = {}; cellJson.border.left = {}; cellJson.border.right = {}; if (cellEle.style.borderTopColor) { cellJson.border.top.color = cellEle.style.borderTopColor; if (cellJson.border.top.color == "initial") { delete cellJson.border.top.color; } } if (cellEle.style.borderTopWidth) { cellJson.border.top.width = parseFloat(cellEle.style.borderTopWidth); if (isNaN(cellJson.border.top.width) || cellJson.border.top.width == "initial") { delete cellJson.border.top.width; } } if (cellEle.style.borderTopStyle) { cellJson.border.top.style = cellEle.style.borderTopStyle; } if (cellEle.style.borderBottomColor) { cellJson.border.bottom.color = cellEle.style.borderBottomColor; if (cellJson.border.bottom.color == "initial") { delete cellJson.border.bottom.color; } } if (cellEle.style.borderBottomWidth) { cellJson.border.bottom.width = parseFloat(cellEle.style.borderBottomWidth); if (isNaN(cellJson.border.bottom.width) || cellJson.border.bottom.width == "initial") { delete cellJson.border.bottom.width; } } if (cellEle.style.borderBottomStyle) { cellJson.border.bottom.style = cellEle.style.borderBottomStyle; } if (cellEle.style.borderLeftColor) { cellJson.border.left.color = cellEle.style.borderLeftColor; if (cellJson.border.left.color == "initial") { delete cellJson.border.left.color; } } if (cellEle.style.borderLeftWidth) { cellJson.border.left.width = parseFloat(cellEle.style.borderLeftWidth); if (isNaN(cellJson.border.left.width) || cellJson.border.left.width == "initial") { delete cellJson.border.left.width; } } if (cellEle.style.borderLeftStyle) { cellJson.border.left.style = cellEle.style.borderLeftStyle; } if (cellEle.style.borderRightColor) { cellJson.border.right.color = cellEle.style.borderRightColor; if (cellJson.border.right.color == "initial") { delete cellJson.border.right.color; } } if (cellEle.style.borderRightWidth) { cellJson.border.right.width = parseFloat(cellEle.style.borderRightWidth); if (isNaN(cellJson.border.right.width) || cellJson.border.right.width == "initial") { delete cellJson.border.right.width; } } if (cellEle.style.borderRightStyle) { cellJson.border.right.style = cellEle.style.borderRightStyle; } cellJson.fill = {}; if (cellEle.style.backgroundColor) { cellJson.fill.color = cellEle.style.backgroundColor; } cellJson.textStyle = {}; if (cellEle.style.textAlign) { if (cellEle.style.textAlign == "left") { cellJson.textStyle.align = 1; } else if (cellEle.style.textAlign == "center") { cellJson.textStyle.align = 2; } else if (cellEle.style.textAlign == "right") { cellJson.textStyle.align = 3; } } if (cellEle.style.verticalAlign) { if (cellEle.style.verticalAlign == "top") { cellJson.textStyle.valign = 1; } else if (cellEle.style.verticalAlign == "middle") { cellJson.textStyle.valign = 2; } else if (cellEle.style.verticalAlign == "bottom") { cellJson.textStyle.valign = 3; } } if (cellEle.style.textDecoration == "underline") { cellJson.textStyle.underline = "1"; } if (cellEle.style.textDecoration == "line-through") { cellJson.textStyle.deleteline = "1"; } if (cellEle.style.whiteSpace == "nowrap") { cellJson.textStyle.feed = "0"; } else { cellJson.textStyle.feed = "1"; } if (cellEle.style.fontStyle == "italic") { cellJson.textStyle.italic = "1"; } if (cellEle.style.fontWeight) { if (cellEle.style.fontWeight == "bold") { cellJson.textStyle.bold = "1"; } else if (parseInt(cellEle.style.fontWeight) > 400) cellJson.textStyle.bold = "1"; } } } mergeAreas.forEach((mergeCell) => { for (let i2 = 1; i2 <= mergeCell.mergeRowNum; i2++) { for (let j2 = 1; j2 <= mergeCell.mergeColNum; j2++) { if (!(i2 == 1 && j2 == 1)) { tableJson.rows[mergeCell.row + i2 - 1].splice(mergeCell.col + j2 - 1, 0, { width: 0, height: 0, modelCode: "100302", mCell: mergeCell }); for (let k = 0; k < tableJson.rows.length; k++) { let rowObj = tableJson.rows[k]; for (let l = 0; l < rowObj.length; l++) { rowObj[l].row = k; rowObj[l].col = l; } } } } } }); for (let k = 0; k < tableJson.rows.length; k++) { let rowObj = tableJson.rows[k]; for (let l = 0; l < rowObj.length; l++) { if ((rowObj[l].domRow || rowObj[l].domRow == 0) && (!rowObj[l].mergeRowNum || rowObj[l].mergeRowNum <= 1) && (!rowObj[l].mergeColNum <= 1 || rowObj[l].mergeColNum <= 1)) { let rowHeight = null; let domRowEle = tableEle.rows[rowObj[l].domRow]; let domCellEle = tableEle.rows[rowObj[l].domRow].cells[rowObj[l].domCol]; if (!rowSize["" + k]) { if (domRowEle.style.height) { rowHeight = parseFloat(domRowEle.style.height); } else { rowHeight = parseFloat(domRowEle.getAttribute("height")); } if (!isNaN(rowHeight)) { rowSize["" + k] = rowHeight; } } let colWidth = null; if (!colSize["" + l]) { if (domCellEle.style.width) { colWidth = parseFloat(domCellEle.style.width); } else { colWidth = parseFloat(domCellEle.getAttribute("width")); } if (!isNaN(colWidth)) { colSize["" + l] = colWidth; } } } } } for (let k = 0; k < tableJson.rows.length; k++) { if (!rowSize[k]) { let mCell = null; let rowObj = tableJson.rows[k]; for (let l = 0; l < rowObj.length; l++) { if (rowObj[l].domRow || rowObj[l].domRow == 0) { let domCellEle = tableEle.rows[rowObj[l].domRow].cells[rowObj[l].domCol]; if (rowObj[l].mergeRowNum > 1 || rowObj[l].mergeColNum > 1) { mCell = rowObj[l]; } else if (!mCell && rowObj[l].mCell) { mCell = rowObj[l].mCell; } else if (!rowObj[l].mCell) { let rowHeight = 0; if (domCellEle.style.height) { rowHeight = parseFloat(domCellEle.style.height); } else { rowHeight = parseFloat(domCellEle.getAttribute("height")); } if (!isNaN(rowHeight)) { rowSize["" + k] = rowHeight; } break; } } } if (!rowSize[k] && mCell) { let domCellEle = tableEle.rows[mCell.domRow].cells[mCell.domCol]; let rowHeight = 0; if (domCellEle.style.height) { rowHeight = parseFloat(domCellEle.style.height); } else { rowHeight = parseFloat(domCellEle.getAttribute("height")); } if (!isNaN(rowHeight)) { rowSize[k] = rowHeight / mCell.mergeRowNum; } } } } for (let l = 0; l < tableJson.rows[0].length; l++) { if (!colSize[l]) { let mCell = null; for (let k = 0; k < tableJson.rows.length; k++) { if (tableJson.rows[k][l].domRow || tableJson.rows[k][l].domRow == 0) { let domCellEle = tableEle.rows[tableJson.rows[k][l].domRow].cells[tableJson.rows[k][l].domCol]; if (tableJson.rows[k][l].mergeRowNum > 1 || tableJson.rows[k][l].mergeColNum > 1) { mCell = tableJson.rows[k][l]; } else if (!mCell && tableJson.rows[k][l].mCell) { mCell = tableJson.rows[k][l].mCell; } else if (!tableJson.rows[k][l].mCell) { let colWidth = 0; if (domCellEle.style.width) { colWidth = parseFloat(domCellEle.style.width); } else { colWidth = parseFloat(domCellEle.getAttribute("width")); } if (!isNaN(colWidth)) { colSize["" + l] = colWidth; } break; } } } if (!colSize[l] && mCell) { let domCellEle = tableEle.rows[mCell.domRow].cells[mCell.domCol]; let colWidth = 0; if (domCellEle.style.width) { colWidth = parseFloat(domCellEle.style.width); } else { colWidth = parseFloat(domCellEle.getAttribute("width")); } if (!isNaN(colWidth)) { colSize[l] = colWidth / mCell.mergeColNum; } } } } for (let k = 0; k < tableJson.rows.length; k++) { let rowObj = tableJson.rows[k]; for (let l = 0; l < rowObj.length; l++) { if (k == 0) { if (isNaN(colSize["" + l])) { colSize["" + l] = 40; } tableWidth += colSize["" + l]; } if (l == 0) { if (isNaN(rowSize["" + k])) { rowSize["" + k] = 20; } tableHeight += rowSize["" + k]; } if (rowObj[l].mergeRowNum > 1 || rowObj[l].mergeColNum > 1) { let mHeight = 0; let mWidth = 0; for (let ki = 1; ki <= rowObj[l].mergeRowNum; ki++) { if (isNaN(rowSize["" + (k + ki - 1)])) { rowSize["" + (k + ki - 1)] = 20; } mHeight += rowSize["" + (k + ki - 1)]; } for (let ki = 1; ki <= rowObj[l].mergeColNum; ki++) { if (isNaN(colSize["" + (l + ki - 1)])) { colSize["" + (l + ki - 1)] = 40; } mWidth += colSize["" + (l + ki - 1)]; } rowObj[l].height = mHeight; rowObj[l].width = mWidth; rowObj[l].originWidth = colSize["" + l]; rowObj[l].originHeight = rowSize["" + k]; delete rowObj[l].domRow; delete rowObj[l].domCol; } else if (rowObj[l].mCell) { rowObj[l].originWidth = colSize["" + l]; rowObj[l].originHeight = rowSize["" + k]; delete rowObj[l].mCell; delete rowObj[l].domRow; delete rowObj[l].domCol; } else { rowObj[l].width = colSize["" + l]; rowObj[l].height = rowSize["" + k]; delete rowObj[l].domRow; delete rowObj[l].domCol; } } } tableJson.height = tableHeight; tableJson.width = tableWidth; return tableJson; } } //创建新的表格 createTable(tableJson, x2, y2, stage2, container2, evt) { let layer2 = stage2.layers[stage2.layerIndex]; let tableModel = DDeiTable.loadFromJSON(tableJson, { currentDdInstance: stage2.ddInstance, currentStage: stage2, currentLayer: layer2, currentContainer: container2 }); stage2.idIdx++; let newId = "table_" + stage2.idIdx; tableModel.id = newId; tableModel.x = x2 - tableModel.width / 2; tableModel.y = y2 - tableModel.height / 2; tableModel.resetCellData(); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: container2, models: [tableModel] }, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: [tableModel], value: DDeiEnumControlState.SELECTED }, evt); } //创建新的控件 createControl(jsonArray, jsonLinkArray = [], x2, y2, stage2, container2, mode, evt) { let layer2 = stage2.layers[stage2.layerIndex]; let models = []; let oldIdMap = {}; jsonArray.forEach((json) => { if (mode == "copy") { let copyModel = stage2.ddInstance.controlModelClasses[json.modelType].loadFromJSON(json, { currentDdInstance: stage2.ddInstance, currentStage: stage2, currentLayer: layer2, currentContainer: container2 }); models.push(copyModel); this.loadJsonModelToMap(copyModel, stage2, mode, oldIdMap); this.changeModelId(stage2, copyModel); } else if (mode == "cut") { let model = stage2.getModelById(json.id); models.push(model); this.loadJsonModelToMap(model, stage2, mode, oldIdMap); } }); let rsState = -1; if (mode == "copy") { rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", DDeiEnumOperateType.CREATE, { models, links: jsonLinkArray }, stage2.ddInstance); } else if (mode == "cut") { rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DRAG_BEFORE", DDeiEnumOperateType.DRAG, { models, links: jsonLinkArray }, stage2.ddInstance); } if (rsState != -1) { let outRect = DDeiAbstractShape.getOutRectByPV(models); outRect = { x: outRect.x + outRect.width / 2, y: outRect.y + outRect.height / 2 }; if (mode == "copy") { let appendExPvs = {}; jsonLinkArray == null ? void 0 : jsonLinkArray.forEach((lk) => { if (!lk.disabled) { let sm = lk.sm; let dm = lk.dm; if (!sm && lk.smid) { sm = oldIdMap[lk.smid]; } if (!dm && lk.dmid) { dm = oldIdMap[lk.dmid]; } if (lk.smpath) { let sourcePV = DDeiUtil.getDataByPathList(sm, lk.smpath); let newId = "_" + DDeiUtil.getUniqueCode(); sourcePV.id = newId; if (!appendExPvs[sm.id]) { appendExPvs[sm.id] = {}; } appendExPvs[sm.id][newId] = sourcePV; lk.smpath = "exPvs." + newId; } let link2 = new DDeiLink({ group: lk.group, smpath: lk.smpath, dmpath: lk.dmpath, stage: stage2, sm, dm }); stage2.links.push(link2); } }); for (let m in oldIdMap) { let item = oldIdMap[m]; item.exPvs = {}; if (appendExPvs[item.id]) { item.exPvs = appendExPvs[item.id]; } if (item.linkModels) { let linkModels = /* @__PURE__ */ new Map(); for (let key in item.linkModels) { let lkItem = item.linkModels[key]; if (lkItem == null ? void 0 : lkItem.dmid) { let dm = oldIdMap[lkItem.dmid]; if (dm) { lkItem.dm = dm; lkItem.depModel = item; dm.depModel = item; let lm = new DDeiModelLink(lkItem); linkModels.set(dm.id, lm); } } } item.linkModels = linkModels; } } stage2.refreshLinkCache(); } models.forEach((item) => { let cpx = item.cpv.x; let cpy = item.cpv.y; let dx = outRect.x - cpx; let dy = outRect.y - cpy; let moveMatrix2 = new Matrix3( 1, 0, x2 - dx - cpx, 0, 1, y2 - dy - cpy, 0, 0, 1 ); item.transVectors(moveMatrix2); }); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: container2, models }, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeSelect, { models, value: DDeiEnumControlState.SELECTED }, evt); if (mode == "copy") { stage2.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyControlCreated, { models }); } else if (mode == "cut") { DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DRAG_AFTER", DDeiEnumOperateType.DRAG, { models }, stage2.ddInstance, evt); } } } /** * 修改模型ID * @param stage 舞台 * @param item 控件 * @return 新的ID */ changeModelId(stage2, item) { let newId = ""; while (true) { stage2.idIdx++; if (item.id.indexOf("_") != -1) { newId = item.id.substring(0, item.id.lastIndexOf("_")) + "_" + stage2.idIdx; } else { newId = item.id + "_cp_" + stage2.idIdx; } if (!stage2.getModelById(newId)) { break; } } item.oldId = item.id; item.id = newId; item.unicode = DDeiUtil.getUniqueCode(); let accuContainer = item.getAccuContainer(); if ((accuContainer == null ? void 0 : accuContainer.baseModelType) == "DDeiContainer") { let midList = []; let models = /* @__PURE__ */ new Map(); accuContainer.midList.forEach((mid) => { let model = accuContainer.models.get(mid); let modelNewId = this.changeModelId(stage2, model); models.set(modelNewId, model); midList.push(modelNewId); }); accuContainer.models = models; accuContainer.midList = midList; } else if ((accuContainer == null ? void 0 : accuContainer.baseModelType) == "DDeiTable") { for (let i2 = 0; i2 < accuContainer.rows; i2++) { let rowObj = accuContainer.rows[i2]; for (let j2 = 0; j2 < rowObj.length; j2++) { let accuContainer2 = rowObj[j2].getAccuContainer(); let midList = []; let models = /* @__PURE__ */ new Map(); accuContainer2.midList.forEach((mid) => { let model = accuContainer2.models.get(mid); let modelNewId = this.changeModelId(stage2, model); models.set(modelNewId, model); midList.push(modelNewId); }); accuContainer2.models = models; accuContainer2.midList = midList; } } } return newId; } //创建新的图片控件 createNewImage(image, imgBase64, x2, y2, stage2, container2, evt) { stage2.idIdx++; let rat1 = stage2.ddInstance.render.ratio; let stageRatio2 = stage2.getStageRatio(); let dataJson = { id: "img_" + stage2.idIdx, modelCode: "100002" }; let ccDefine = DDeiUtil.getControlDefine(dataJson); for (let i2 in ccDefine == null ? void 0 : ccDefine.define) { dataJson[i2] = cloneDeep(ccDefine == null ? void 0 : ccDefine.define[i2]); } dataJson.text = ""; dataJson.border = { type: 0 }; dataJson.fill = { type: 2 }; dataJson.fill.image = imgBase64; dataJson.width = image.width / rat1 / stageRatio2; dataJson.height = image.height / rat1 / stageRatio2; delete dataJson.ovs; let model = DDeiPolygon.initByJSON( dataJson, { currentStage: stage2 } ); model.initPVS(); let moveMatrix2 = new Matrix3( 1, 0, x2, 0, 1, y2, 0, 0, 1 ); model.transVectors(moveMatrix2); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: container2, models: [model] }, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: [model], value: DDeiEnumControlState.SELECTED }, evt); stage2.ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); } loadJsonModelToMap(json, stage2, mode, map) { map[json.id] = json; if (json.baseModelType == "DDeiContainer") { json.models.forEach((item) => { this.loadJsonModelToMap(item, stage2, mode, map); }); } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionPaste, "defaultIns", new _DDeiKeyActionPaste()); let DDeiKeyActionPaste = _DDeiKeyActionPaste; const _DDeiKeyActionPushModels = class _DDeiKeyActionPushModels extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-push-models"); __publicField3(this, "defaultOptions", { "keys": [ //置于上层 { ctrl: 1, keys: "38", editorState: DDeiEditorState.DESIGNING }, //置于下层 { ctrl: 1, keys: "40", editorState: DDeiEditorState.DESIGNING }, //置于顶层 { ctrl: 1, shift: 1, keys: "38", editorState: DDeiEditorState.DESIGNING }, //置于底层 { ctrl: 1, shift: 1, keys: "40", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionPushModels.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionPushModels.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionPushModels.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionPushModels(newOptions); return panels; } } return _DDeiKeyActionPushModels; } static modify(fn) { return _DDeiKeyActionPushModels.defaultIns.modify(fn); } // ============================ 方法 =============================== isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } action(evt, ddInstance) { if (ddInstance && ddInstance.stage) { if (this.isActive(document.activeElement)) { let stageRender = ddInstance.stage.render; let optContainer = stageRender.currentOperateContainer; if (optContainer) { let isCtrl = DDei.KEY_DOWN_STATE.get("ctrl"); let isShift = DDei.KEY_DOWN_STATE.get("shift"); if (isCtrl && isShift) { if (evt.keyCode == 38) { ddInstance.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: "top" }, evt); } else if (evt.keyCode == 40) { ddInstance.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: "bottom" }, evt); } } else if (isCtrl) { if (evt.keyCode == 38) { ddInstance.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: "up" }, evt); } else if (evt.keyCode == 40) { ddInstance.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: "down" }, evt); } } } ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); ddInstance.bus.executeAll(); return true; } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionPushModels, "defaultIns", new _DDeiKeyActionPushModels()); let DDeiKeyActionPushModels = _DDeiKeyActionPushModels; const _DDeiKeyActionNewRowQuickEdit = class _DDeiKeyActionNewRowQuickEdit extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-quickedit-newrow"); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionNewRowQuickEdit.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionNewRowQuickEdit.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionNewRowQuickEdit.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionNewRowQuickEdit(newOptions); return panels; } } return _DDeiKeyActionNewRowQuickEdit; } static modify(fn) { return _DDeiKeyActionNewRowQuickEdit.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { let editor = DDeiEditor.ACTIVE_INSTANCE; editor.quickEditorInput.value += "\n"; editor.quickEditorInput.selectionEnd = editor.quickEditorInput.value.length; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionNewRowQuickEdit, "defaultIns", new _DDeiKeyActionNewRowQuickEdit()); let DDeiKeyActionNewRowQuickEdit = _DDeiKeyActionNewRowQuickEdit; const _DDeiKeyActionRemoveModels = class _DDeiKeyActionRemoveModels extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-remove-models"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "8", editorState: DDeiEditorState.DESIGNING }, { keys: "46", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionRemoveModels.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionRemoveModels.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionRemoveModels.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionRemoveModels(newOptions); return panels; } } return _DDeiKeyActionRemoveModels; } static modify(fn) { return _DDeiKeyActionRemoveModels.defaultIns.modify(fn); } isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } // ============================ 方法 =============================== action(evt, ddInstance) { var _a3; if (ddInstance && ddInstance.stage) { if (this.isActive(document.activeElement)) { let stageRender = ddInstance.stage.render; let optContainer = stageRender.currentOperateContainer; if (optContainer) { let selectedModels = optContainer.getSelectedModels(); let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DEL_BEFORE", DDeiEnumOperateType.DEL, { models: Array.from(selectedModels.values()) }, ddInstance, evt); if (rsState == 0 || rsState == 1) { let models = Array.from(selectedModels.values()); models[0].layer.opPoints = []; if ((_a3 = models[0].layer.opLine) == null ? void 0 : _a3.render) { models[0].layer.opLine.render.enableRefreshShape(); } delete models[0].layer.opLine; optContainer.removeModels(models, true); optContainer.cascadeRemoveSelf(); ddInstance.bus.push(DDeiEnumBusCommandType.UpdatePaperArea); ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy); ddInstance.bus.push(DDeiEnumBusCommandType.ChangeStageWPV, { dragObj: { dx: 0, dy: 0 }, x: 0, y: 0 }); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.executeAll(); return true; } } } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionRemoveModels, "defaultIns", new _DDeiKeyActionRemoveModels()); let DDeiKeyActionRemoveModels = _DDeiKeyActionRemoveModels; const _DDeiKeyActionReRevoke = class _DDeiKeyActionReRevoke extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-re-revoke"); __publicField3(this, "defaultOptions", { "keys": [ //反撤销 { ctrl: 1, keys: "89", editorState: DDeiEditorState.DESIGNING }, { ctrl: 1, shift: 1, keys: "90", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionReRevoke.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionReRevoke.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionReRevoke.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionReRevoke(newOptions); return panels; } } return _DDeiKeyActionReRevoke; } static modify(fn) { return _DDeiKeyActionReRevoke.defaultIns.modify(fn); } // ============================ 方法 =============================== isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } action(evt, ddInstance) { let editor = DDeiEditor.ACTIVE_INSTANCE; if (this.isActive(document.activeElement)) { let histype = DDeiEditorUtil.getConfigValue("HISTROY_LEVEL", editor); if (histype == "file") { if ((editor == null ? void 0 : editor.files.length) > 0 && (editor.currentFileIndex == 0 || editor.currentFileIndex)) { let file = editor == null ? void 0 : editor.files[editor.currentFileIndex]; if ((file == null ? void 0 : file.active) == DDeiActiveType.ACTIVE) { let hisData = file.reRevokeHistroyData(); if (hisData == null ? void 0 : hisData.data) { let jsonData = JSON.parse(hisData == null ? void 0 : hisData.data); if (jsonData) { let ddInstance2 = editor == null ? void 0 : editor.ddInstance; ddInstance2.stage.destroyRender(); let hisFile = DDeiFile.loadFromJSON(jsonData, { currentDdInstance: ddInstance2 }); if (hisData.isNew == true) { file.state = DDeiFileState.NONE; } else { file.state = DDeiFileState.MODIFY; } file.name = hisFile == null ? void 0 : hisFile.name; file.desc = hisFile == null ? void 0 : hisFile.desc; file.lastUpdateTime = hisFile == null ? void 0 : hisFile.lastUpdateTime; file.sheets = hisFile == null ? void 0 : hisFile.sheets; if (file && file.sheets && ddInstance2) { file.changeSheet(hisFile.currentSheetIndex); let stage2 = file.sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance2; ddInstance2.stage = stage2; stage2.initRender(); ddInstance2.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts); ddInstance2.bus.executeAll(); return true; } } } } } } else if (histype == "stage") { if (ddInstance && ddInstance.stage) { let hisData = ddInstance.stage.reRevokeHistroyData(); if (hisData == null ? void 0 : hisData.data) { let jsonData = JSON.parse(hisData == null ? void 0 : hisData.data); if (jsonData) { ddInstance.stage.destroyRender(); let tempData = { "currentDdInstance": ddInstance, "currentStage": ddInstance.stage }; tempData[ddInstance.stage.id] = ddInstance.stage; let layers = []; jsonData.layers.forEach((layer2) => { let model = DDeiLayer.loadFromJSON(layer2, tempData); layers.push(model); }); ddInstance.stage.idIdx = jsonData.idIdx; ddInstance.stage.layers = layers; ddInstance.stage.initRender(); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts); ddInstance.bus.executeAll(); return true; } } } } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionReRevoke, "defaultIns", new _DDeiKeyActionReRevoke()); let DDeiKeyActionReRevoke = _DDeiKeyActionReRevoke; const _DDeiKeyActionRevoke = class _DDeiKeyActionRevoke extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-revoke"); __publicField3(this, "defaultOptions", { "keys": [ //撤销 { ctrl: 1, keys: "90", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionRevoke.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionRevoke.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionRevoke.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionRevoke(newOptions); return panels; } } return _DDeiKeyActionRevoke; } static modify(fn) { return _DDeiKeyActionRevoke.defaultIns.modify(fn); } // ============================ 方法 =============================== isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } action(evt, ddInstance) { let editor = DDeiEditor.ACTIVE_INSTANCE; if (this.isActive(document.activeElement)) { let histype = DDeiEditorUtil.getConfigValue("HISTROY_LEVEL", editor); if (histype == "file") { let editor2 = DDeiEditor.ACTIVE_INSTANCE; if ((editor2 == null ? void 0 : editor2.files.length) > 0 && (editor2.currentFileIndex == 0 || editor2.currentFileIndex)) { let file = editor2 == null ? void 0 : editor2.files[editor2.currentFileIndex]; if ((file == null ? void 0 : file.active) == DDeiActiveType.ACTIVE) { let hisData = file.revokeHistroyData(); if (hisData == null ? void 0 : hisData.data) { let jsonData = JSON.parse(hisData == null ? void 0 : hisData.data); if (jsonData) { let ddInstance2 = editor2 == null ? void 0 : editor2.ddInstance; ddInstance2.stage.destroyRender(); let hisFile = DDeiFile.loadFromJSON(jsonData, { currentDdInstance: ddInstance2 }); if (hisData.isNew == true) { file.state = DDeiFileState.NONE; } else { file.state = DDeiFileState.MODIFY; } file.name = hisFile == null ? void 0 : hisFile.name; file.desc = hisFile == null ? void 0 : hisFile.desc; file.lastUpdateTime = hisFile == null ? void 0 : hisFile.lastUpdateTime; file.sheets = hisFile == null ? void 0 : hisFile.sheets; if (file && file.sheets && ddInstance2) { file.changeSheet(hisFile.currentSheetIndex); let stage2 = file.sheets[file.currentSheetIndex].stage; stage2.ddInstance = ddInstance2; ddInstance2.stage = stage2; stage2.initRender(); ddInstance2.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts); ddInstance2.bus.executeAll(); return true; } } } } } } else if (histype == "stage") { if (ddInstance && ddInstance.stage) { let hisData = ddInstance.stage.revokeHistroyData(); if (hisData == null ? void 0 : hisData.data) { let jsonData = JSON.parse(hisData == null ? void 0 : hisData.data); if (jsonData) { ddInstance.stage.destroyRender(); let tempData = { "currentDdInstance": ddInstance, "currentStage": ddInstance.stage }; tempData[ddInstance.stage.id] = ddInstance.stage; let layers = []; jsonData.layers.forEach((layer2) => { let model = DDeiLayer.loadFromJSON(layer2, tempData); layers.push(model); }); ddInstance.stage.idIdx = jsonData.idIdx; ddInstance.stage.layers = layers; ddInstance.stage.initRender(); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts); ddInstance.bus.executeAll(); return true; } } } } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionRevoke, "defaultIns", new _DDeiKeyActionRevoke()); let DDeiKeyActionRevoke = _DDeiKeyActionRevoke; const _DDeiKeyActionSaveFile = class _DDeiKeyActionSaveFile extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-save-file"); __publicField3(this, "defaultOptions", { "keys": [ //保存 { ctrl: 1, keys: "83" } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionSaveFile.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionSaveFile.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionSaveFile.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionSaveFile(newOptions); return panels; } } return _DDeiKeyActionSaveFile; } static modify(fn) { return _DDeiKeyActionSaveFile.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { var _a3, _b2; (_a3 = ddInstance.bus) == null ? void 0 : _a3.push(DDeiEditorEnumBusCommandType.SaveFile, {}, evt); (_b2 = ddInstance.bus) == null ? void 0 : _b2.executeAll(); } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionSaveFile, "defaultIns", new _DDeiKeyActionSaveFile()); let DDeiKeyActionSaveFile = _DDeiKeyActionSaveFile; const _DDeiKeyActionStartQuickEdit = class _DDeiKeyActionStartQuickEdit extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-quickedit-start"); __publicField3(this, "defaultOptions", { "keys": [ //F2快捷编辑 { keys: "113", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionStartQuickEdit.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionStartQuickEdit.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionStartQuickEdit.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionStartQuickEdit(newOptions); return panels; } } return _DDeiKeyActionStartQuickEdit; } static modify(fn) { return _DDeiKeyActionStartQuickEdit.defaultIns.modify(fn); } // ============================ 方法 =============================== isActive(element) { if (!element) { return true; } if (element.tagName == "BODY" || element.tagName == "HEAD" || element.tagName == "HTML") { return true; } return false; } action(evt, ddInstance) { var _a3, _b2, _c2, _d2, _e2, _f, _g; if (ddInstance && ddInstance.stage) { if (this.isActive(document.activeElement)) { if (((_b2 = (_a3 = ddInstance.stage) == null ? void 0 : _a3.selectedModels) == null ? void 0 : _b2.size) == 1) { let model = Array.from((_c2 = ddInstance.stage) == null ? void 0 : _c2.selectedModels.values())[0]; let editor = DDeiEditor.ACTIVE_INSTANCE; if (editor.state == DDeiEditorState.DESIGNING) { let rsState1 = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_VIEW", DDeiEnumOperateType.VIEW, { models: [model] }, ddInstance, null); if (rsState1 == 0 || rsState1 == 1) { let editState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: [model] }, ddInstance, null); if (editState == 0 || editState == 1) { let stage2 = ddInstance.stage; let stageRatio2 = stage2.getStageRatio(); if (model == null ? void 0 : model.render) { let ex = -1; let ey = -1; if (evt.offsetX || evt.offsetY) { ex = evt.offsetX; ey = evt.offsetY; ex /= window.remRatio; ey /= window.remRatio; ex -= stage2.wpv.x; ey -= stage2.wpv.y; ex = ex / stageRatio2; ey = ey / stageRatio2; } let realModel = null; let posPoint = null; let posType; let isCreateRealModel = false; let isLineLM = false; if (model.baseModelType == "DDeiLine") { posType = 3; if (evt.offsetX || evt.offsetY) { let cdist = DDeiUtil.getPointDistance(model.pvs[0].x, model.pvs[1].y, model.pvs[model.pvs.length - 1].x, model.pvs[model.pvs.length - 1].y); let sdist = DDeiUtil.getPointDistance(ex, ey, model.pvs[0].x, model.pvs[0].y); let edist = DDeiUtil.getPointDistance(ex, ey, model.pvs[model.pvs.length - 1].x, model.pvs[model.pvs.length - 1].y); if (sdist < cdist / 5) { posType = 1; } else if (edist < cdist / 5) { posType = 2; } } if (posType == 1) { posPoint = model.startPoint; } else if (posType == 2) { posPoint = model.endPoint; } else if (posType == 3) { let pi = Math.floor(model.pvs.length / 2); if (model.pvs.length % 3 == 0) { posPoint = model.pvs[pi]; } else { posPoint = { x: (model.pvs[pi - 1].x + model.pvs[pi].x) / 2, y: (model.pvs[pi - 1].y + model.pvs[pi].y) / 2 }; } } model.linkModels.forEach((lm) => { if (lm.type == posType) { realModel = lm.dm; } }); if (!realModel) { isCreateRealModel = true; isLineLM = true; } } else { model.linkModels.forEach((lm) => { posType = lm.type; realModel = lm.dm; }); if (!realModel) { let modelDefine = DDeiEditorUtil.getControlDefine(model); if ((_e2 = (_d2 = modelDefine == null ? void 0 : modelDefine.define) == null ? void 0 : _d2.sample) == null ? void 0 : _e2.depPos) { let depPos = modelDefine.define.sample.depPos; let essBounds = model.essBounds; let dmEssBounds = { width: 80, height: 18 }; posType = depPos.type; if (depPos.type == 5) { posPoint = model.cpv; } else if (depPos.type == 6) { posPoint = { x: model.cpv.x, y: essBounds.y - dmEssBounds.height / 2 }; } else if (depPos.type == 7) { posPoint = { x: essBounds.x1 + dmEssBounds.width / 2, y: model.cpv.y }; } else if (depPos.type == 8) { posPoint = { x: model.cpv.x, y: essBounds.y1 + dmEssBounds.height / 2 }; } else if (depPos.type == 9) { posPoint = { x: essBounds.x - dmEssBounds.width / 2, y: model.cpv.y }; } isCreateRealModel = true; } } } if (isCreateRealModel) { let dataJson = { modelCode: "100200" }; let controlDefine = DDeiUtil.getControlDefine(dataJson); for (let i2 in controlDefine == null ? void 0 : controlDefine.define) { dataJson[i2] = cloneDeep(controlDefine.define[i2]); } dataJson["id"] = "lsm_" + stage2.idIdx++; dataJson["width"] = 80; dataJson["height"] = 28; dataJson["font"] = { size: 12 }; dataJson["textStyle"] = { paddingWeight: 0 }; if (isLineLM) { dataJson["fill"] = { type: 1, color: "white" }; } for (let i2 in dataJson) { let value = dataJson[i2]; if (typeof value == "string") { dataJson[i2] = editor.i18n(value); } } (_f = dataJson.composes) == null ? void 0 : _f.forEach((compose) => { for (let i2 in compose) { let value = compose[i2]; if (typeof value == "string") { compose[i2] = editor.i18n(value); } } }); realModel = ddInstance.controlModelClasses["DDeiPolygon"].initByJSON( dataJson, { currentStage: stage2, currentDdInstance: ddInstance, currentContainer: model.pModel } ); let move1Matrix = new Matrix3( 1, 0, posPoint.x, 0, 1, posPoint.y, 0, 0, 1 ); realModel.transVectors(move1Matrix); model.layer.addModel(realModel, false); realModel.initRender(); let lineLink = new DDeiModelLink({ depModel: model, type: posType, dm: realModel, dx: 0, dy: 0 }); realModel.depModel = model; model.linkModels.set(realModel.id, lineLink); } if (realModel) { model = realModel; editor.quickEditorModel = model; } model = DDeiAbstractShape.findBottomComponseByArea(model, ex, ey); let fillArea = model.textArea; if ((fillArea == null ? void 0 : fillArea.length) > 0) { editor.quickEditorModel = model; let canvasPos = DDeiUtil.getDomAbsPosition(ddInstance.render.canvas); let inputEle = DDeiUtil.getEditorText(); let rotate2 = model.rotate; let stageRatio22 = ddInstance.stage.getStageRatio(); let pos = new Vector3(model.pvs[0].x, model.pvs[0].y, 1); if (rotate2 != 0) { let pvc = new Vector3(model.cpv.x, model.cpv.y, 1); let angle2 = (rotate2 * DDeiConfig.ROTATE_UNIT).toFixed(4); let move1Matrix = new Matrix3( 1, 0, -pvc.x, 0, 1, -pvc.y, 0, 0, 1 ); let rotateMatrix = new Matrix3( Math.cos(angle2), Math.sin(angle2), 0, -Math.sin(angle2), Math.cos(angle2), 0, 0, 0, 1 ); let move2Matrix = new Matrix3( 1, 0, pvc.x, 0, 1, pvc.y, 0, 0, 1 ); let m12 = new Matrix3().premultiply(move1Matrix).premultiply(rotateMatrix).premultiply(move2Matrix); pos.applyMatrix3(m12); } inputEle.value = model.text ? model.text : ""; inputEle.style.fontSize = model.render.getCachedValue("font.size") * stageRatio22 + "px"; inputEle.style.color = DDeiUtil.getColor(model.render.getCachedValue("font.color")); inputEle.style.width = fillArea.width * stageRatio22 + "px"; inputEle.style.height = fillArea.height * stageRatio22 + "px"; inputEle.style.left = canvasPos.left + pos.x + ddInstance.stage.wpv.x + 1 + "px"; inputEle.style.top = canvasPos.top + pos.y + ddInstance.stage.wpv.y + 10 + "px"; inputEle.style.display = "block"; let textAreaRect = DDeiAbstractShape.pvsToOutRect(model.textArea); inputEle.style.width = textAreaRect.width + "px"; inputEle.style.height = textAreaRect.height + "px"; ddInstance.stage.render.editorShadowControl = DDeiUtil.getShadowControl(model); model.layer.opPoints = []; if ((_g = model.layer.opLine) == null ? void 0 : _g.render) { model.layer.opLine.render.enableRefreshShape(); } delete model.layer.opLine; ddInstance.stage.render.editorShadowControl.render.isEditoring = true; inputEle.focus(); inputEle.selectionStart = 0; inputEle.selectionEnd = inputEle.value.length; editor.changeState(DDeiEditorState.QUICK_EDITING); delete ddInstance.stage.brushData; delete ddInstance.stage.brushDataText; ddInstance.stage.render.operateState = DDeiEnumOperateState.QUICK_EDITING; editor.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); editor.bus.executeAll(); return true; } } } } } } } } return false; } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionStartQuickEdit, "defaultIns", new _DDeiKeyActionStartQuickEdit()); let DDeiKeyActionStartQuickEdit = _DDeiKeyActionStartQuickEdit; const _DDeiKeyActionTableNextCol = class _DDeiKeyActionTableNextCol extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-table-next-col"); __publicField3(this, "defaultOptions", { "keys": [ //表格内部tab,往下一列 { keys: "9", modelType: "DDeiTable", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionTableNextCol.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionTableNextCol.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionTableNextCol.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionTableNextCol(newOptions); return panels; } } return _DDeiKeyActionTableNextCol; } static modify(fn) { return _DDeiKeyActionTableNextCol.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { var _a3, _b2, _c2; if (ddInstance && ddInstance.stage) { let models = Array.from((_a3 = ddInstance.stage.selectedModels) == null ? void 0 : _a3.values()); if ((models == null ? void 0 : models.length) == 1 && models[0].baseModelType == "DDeiTable" && models[0].curRow != -1 && models[0].curCol != -1) { if (models[0].curCol < models[0].cols.length - 1) { if (models[0].tempDragCell) { models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT); } models[0].curCol++; models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol]; models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED); } } (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_c2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _c2.executeAll(); } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionTableNextCol, "defaultIns", new _DDeiKeyActionTableNextCol()); let DDeiKeyActionTableNextCol = _DDeiKeyActionTableNextCol; const _DDeiKeyActionTableNextRow = class _DDeiKeyActionTableNextRow extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-table-next-row"); __publicField3(this, "defaultOptions", { "keys": [ //表格内部回车,往下一行 { keys: "13", modelType: "DDeiTable", editorState: DDeiEditorState.DESIGNING } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionTableNextRow.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionTableNextRow.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionTableNextRow.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionTableNextRow(newOptions); return panels; } } return _DDeiKeyActionTableNextRow; } static modify(fn) { return _DDeiKeyActionTableNextRow.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance) { var _a3, _b2, _c2; if (ddInstance && ddInstance.stage) { let models = Array.from((_a3 = ddInstance.stage.selectedModels) == null ? void 0 : _a3.values()); if ((models == null ? void 0 : models.length) == 1 && models[0].baseModelType == "DDeiTable" && models[0].curRow != -1 && models[0].curCol != -1) { if (models[0].curRow < models[0].rows.length - 1) { if (models[0].tempDragCell) { models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT); } models[0].curRow++; models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol]; models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED); } } (_b2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _b2.push(DDeiEnumBusCommandType.RefreshShape, null, evt); (_c2 = ddInstance == null ? void 0 : ddInstance.bus) == null ? void 0 : _c2.executeAll(); } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionTableNextRow, "defaultIns", new _DDeiKeyActionTableNextRow()); let DDeiKeyActionTableNextRow = _DDeiKeyActionTableNextRow; const _DDeiCoreHotkeys = class _DDeiCoreHotkeys extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ DDeiKeyActionAllSelect, DDeiKeyActionBrushData, DDeiKeyActionCancelCompose, DDeiKeyActionCancelControlCreate, DDeiKeyActionCancelCurrentAction, DDeiKeyActionCancelQuickEdit, DDeiKeyActionCancelSelect, DDeiKeyActionClearBrushData, DDeiKeyActionCloseDialog, DDeiKeyActionCompose, DDeiKeyActionCopy, DDeiKeyActionCopyImage, DDeiKeyActionCut, DDeiKeyActionEnterQuickEdit, DDeiKeyActionMoveModels, DDeiKeyActionReRevoke, DDeiKeyActionRevoke, DDeiKeyActionSaveFile, DDeiKeyActionStartQuickEdit, DDeiKeyActionTableNextCol, DDeiKeyActionTableNextRow, DDeiKeyActionPaste, DDeiKeyActionPushModels, DDeiKeyActionNewRowQuickEdit, DDeiKeyActionRemoveModels ]); } getHotKeys(editor) { var _a3; let hotkeys = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getHotKeys(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getHotKeys(editor); } if ((ls == null ? void 0 : ls.length) > 0) { hotkeys = hotkeys.concat(ls); } }); return hotkeys; } static configuration(options) { var _a3; let hotkeys = new _DDeiCoreHotkeys(options); for (let i2 = 0; i2 < ((_a3 = hotkeys.plugins) == null ? void 0 : _a3.length); i2++) { hotkeys.plugins[i2] = hotkeys.plugins[i2].configuration(options, true); } return hotkeys; } static modify(fn) { return _DDeiCoreHotkeys.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreHotkeys, "defaultIns", new _DDeiCoreHotkeys(null)); let DDeiCoreHotkeys = _DDeiCoreHotkeys; const composeContainer = { "id": "100202", "name": "组合容器", "code": "comp", "desc": "用于组合关系的容器", "type": "DDeiPolygonContainer", "from": "100201", "define": { ext: { groups: [] } } }; const __vite_glob_0_0$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: composeContainer }, Symbol.toStringTag, { value: "Module" })); const container = { "id": "100201", "name": "矩形容器", "code": "rectange_container", "desc": "矩形形状的容器,能够包含其他容器", "type": "DDeiPolygonContainer", "from": "100008", "define": { poly: 2 }, /** * 定义组件属性 * 样式属性会影响图形的显示,修改样式属性也会刷新图形 * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 * 事件属性一般用来作为扩展用 * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) * 特殊属性: * code属性编码在统一个组中,code唯一 * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row */ attrs: [ { "code": "layout", "name": "布局", "desc": "文本的字体名称", "controlType": "radio", "dataSource": [ { "text": "自由布局", "value": "free" }, { "text": "完全填充", "value": "full" }, { "text": "九宫格", "value": "nine" }, { "text": "表格", "value": "table" }, { "text": "圆心", "value": "cc" } ], "defaultValue": null, "hiddenTitle": true, "display": "column", "dataType": "string" }, { "code": "width", "name": "ddei.property.width", "desc": "控件的宽度", "controlType": "text", "dataSource": null, "dataType": "integer", "defaultValue": "150" }, { "code": "height", "name": "ddei.property.height", "desc": "控件的高度", "controlType": "text", "dataSource": null, "dataType": "integer", "defaultValue": "150" }, { "id": "100500003", "code": "border.type", "name": "ddei.property.borderType", "desc": "用来快速选择边框的类型,以便于套用相关的样式", "controlType": "border-type", "dataSource": [{ "text": "ddei.property.ds.none", "value": 0 }, { "text": "ddei.property.ds.line", "value": 1 }], "dataType": "string", "defaultValue": "1", "hiddenTitle": true, "display": "column" }, { "id": "100500004", "code": "border.color", "name": "ddei.property.color", "desc": "图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式", "controlType": "color-combo", "dataType": "string", "defaultValue": "black" }, { "code": "borderOpacity", "name": "ddei.property.opacity", "desc": "图形的边框的透明度,0完全透明~1完全不透明", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "mapping": ["border.opacity"], "dataType": "float", "defaultValue": 1, "display": "column" }, { "code": "borderWidth", "name": "ddei.property.width", "desc": "图形的边框的粗细,0为无边框", "controlType": "range", "min": 0, "max": 10, "step": 0.1, "mapping": ["border.width"], "dataType": "integer", "defaultValue": 1 }, { "code": "borderDash", "name": "ddei.property.dash", "desc": "图形的边框的是否为虚线样式,虚线由长短不一的线段构成", "controlType": "border-dash", "dataSource": [ { "text": "1", "value": [] }, { "text": "2", "value": [10, 5] }, { "text": "3", "value": [5, 5] }, { "text": "4", "value": [10, 4, 2, 4] }, { "text": "5", "value": [10, 4, 2, 4, 2, 4] }, { "text": "6", "value": [10, 4, 10, 4, 2, 4] }, { "text": "7", "value": [20, 5, 10, 5] }, { "text": "8", "value": [20, 5, 10, 5, 10, 5] }, { "text": "9", "value": [3, 3] }, { "text": "10", "value": [2, 2] }, { "text": "11", "value": [3, 2, 2, 2] }, { "text": "13", "value": [20, 10] } ], "mapping": ["border.dash"], "dataType": "integer", "defaultValue": [], "isArray": true }, { "code": "borderRound", "name": "ddei.property.round", "desc": "图形的边框的是否为为圆角的弧度", "controlType": "range", "mapping": ["border.round"], "min": 0, "max": 30, "step": 1, "defaultValue": 0, "dataType": "integer" }, { "code": "fill.type", "name": "ddei.property.fillType", "desc": "图形填充的类型快速设置", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.none", "value": 0 }, { "text": "ddei.property.ds.color", "value": 1 }, { "text": "ddei.property.ds.image", "value": 2 }], "defaultValue": 1, "type": 1, "orderNo": 2, "cascadeDisplay": { 1: { show: ["fill.color", "fill.opacity"], hidden: ["fill.image"] }, 2: { show: ["fill.image", "fill.opacity"], hidden: ["fill.color"] }, default: { show: ["fill.color", "fill.opacity"], hidden: ["fill.image"] }, empty: { hidden: ["fill.color", "fill.image", "fill.opacity"] } }, "hiddenTitle": true, "display": "column" }, { "code": "fill.color", "name": "ddei.property.color", "desc": "图形的填充颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "white" }, { "code": "fill.image", "name": "ddei.property.image", "desc": "图形的填充图片", "controlType": "text", "dataType": "string", "defaultValue": "", "type": 1 }, { "code": "fill.opacity", "name": "ddei.property.opacity", "desc": "图形的填充的透明度,0完全透明~1完全不透明", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "defaultValue": 1, "dataType": "float", "display": "column" }, { "code": "font.family", "name": "ddei.property.font", "desc": "文本的字体名称", "controlType": "combox", "dataType": "string", "dataSource": { "type": "config", "data": "fonts", "text": "ch", "value": "en", "bold": "isSystemDefault", "fontFamily": "en" }, "itemStyle": { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, "canSearch": true, "defaultValue": "Microsoft YaHei" }, { "code": "font.size", "name": "ddei.property.size", "desc": "文本的字体大小", "max": 50, "min": 5, "step": 0.5, "controlType": "font-size", "dataType": "float", "defaultValue": 14 }, { "code": "font.color", "name": "ddei.property.color", "desc": "文本的颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "#252525" }, { "code": "fontAlign", "name": "ddei.property.align", "desc": "文本的对齐,采用九宫格式设置", "controlType": "align-type", "mapping": [], "dataType": "string" }, { "code": "textStyle.feed", "name": "ddei.property.feed", "desc": "自动换行", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.scale", "name": "ddei.property.outSize", "desc": "文本的自动缩小字体填充", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.hollow", "name": "ddei.property.hollow", "desc": "文本的镂空显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.bold", "name": "ddei.property.bold", "desc": "文本的加粗显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.italic", "name": "ddei.property.italic", "desc": "文本的斜体显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.underline", "name": "ddei.property.underline", "desc": "文本的下划线显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.deleteline", "name": "ddei.property.deleteline", "desc": "文本的删除线显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.topline", "name": "ddei.property.topline", "desc": "文本的删除线显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.bgcolor", "name": "ddei.property.textbg", "desc": "文本的背景颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "" }, { "code": "textStyle.subtype", "name": "ddei.property.subtype", "desc": "文本的标注类型", "controlType": "radio", "dataType": "integer", "dataSource": [{ "text": "ddei.property.ds.subType", "value": 0 }, { "text": "ddei.property.ds.subType1", "value": 1 }, { "text": "ddei.property.ds.subType2", "value": 2 }, { "text": "ddei.property.ds.subType3", "value": 3 }], "defaultValue": 0 }, { "code": "textStyle.align", "name": "ddei.property.textAlign", "desc": "文本的水平对齐", "controlType": "text", "dataType": "integer", "defaultValue": 2 }, { "code": "textStyle.valign", "name": "ddei.property.textValign", "desc": "文本的垂直对齐", "controlType": "text", "dataType": "integer", "defaultValue": 2 }, { "code": "textStyle.hspace", "name": "ddei.property.hspace", "desc": "文本之间的水平间距", "controlType": "range", "min": 0, "max": 10, "step": 0.1, "dataType": "float", "defaultValue": 0.5 }, { "code": "textStyle.vspace", "name": "ddei.property.vspace", "desc": "文本之间的垂直间距", "controlType": "range", "min": 0, "max": 10, "step": 0.1, "dataType": "float", "defaultValue": 0.5 }, { "code": "borderCreatingOpacity", "name": "ddei.property.opacity", "desc": "图形的边框的透明度,0完全透明~1完全不透明", "controlType": "text", "mapping": ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"], "dataType": "float", "defaultValue": 0.5, "display": "column" }, { "code": "fillCreatingOpacity", "name": "ddei.property.opacity", "desc": "图形的填充的透明度,0完全透明~1完全不透明", "controlType": "text", "mapping": ["fill.creating.opacity"], "dataType": "float", "defaultValue": 0.5, "display": "column" }, { "code": "imageCreatingOpacity", "name": "ddei.property.opacity", "desc": "图形的填充图片的透明度,0完全透明~1完全不透明", "controlType": "text", "mapping": ["fill.creating.opacity"], "dataType": "float", "defaultValue": 0.5, "display": "column" }, { "code": "id", "name": "ddei.property.id", "desc": "控件在画布的全局唯一ID", "controlType": "text", "dataType": "string", "readonly": true }, { "code": "code", "name": "ddei.property.code", "desc": "控件在业务上的唯一编码,缺省和控件ID一致", "controlType": "text", "dataType": "string", "defaultValue": "ddei.property.code001" }, { "code": "text", "name": "ddei.property.text", "desc": "控件的主体显示文本", "controlType": "textarea", "defaultValue": "", "dataType": "string", "type": [1, 2], //类别,1图形,2业务,3事件 "readonly": true }, { "code": "fmt.type", "name": "ddei.format", "desc": "文本的显示格式", "controlType": "radio", "dataType": "integer", "dataSource": [{ "text": "ddei.property.ds.text", "value": 0 }, { "text": "ddei.property.ds.decimal", "value": 1 }, { "text": "ddei.property.ds.money", "value": 2 }, { "text": "ddei.property.ds.time", "value": 3 }], "defaultValue": 0, "type": [1, 2], "cascadeDisplay": { 1: { show: ["fmt.nscale", "fmt.tmark"], hidden: ["fmt.mmark", "fmt.munit", "fmt.dtype", "fmt.format", "fmt.mrmb"] }, 2: { show: ["fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb"], hidden: ["fmt.dtype", "fmt.format"] }, 3: { show: ["fmt.dtype", "fmt.format"], hidden: ["fmt.mrmb", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.nscale"] }, default: { hidden: ["fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.nscale", "fmt.dtype", "fmt.format", "fmt.mrmb"] }, empty: { hidden: ["fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.nscale", "fmt.dtype", "fmt.format", "fmt.mrmb"] } } }, { "code": "fmt.nscale", "name": "ddei.property.nscale", "desc": "格式化小数位数", "controlType": "range", "min": 0, "max": 5, "dataType": "integer", "defaultValue": 0, "type": [1, 2] }, { "code": "fmt.tmark", "name": "ddei.property.tmark", "desc": "显示逗号千分符", "controlType": "switch-checkbox", "dataType": "integer", "defaultValue": 0, "hiddenTitle": true, "display": "column", "type": [1, 2] }, { "code": "fmt.mmark", "name": "ddei.property.mmark", "desc": "显示货币符号", "controlType": "combox", "dataSource": [{ "text": "ddei.property.ds.none", "value": "" }, { "text": "ddei.property.ds.money1", "value": "¥" }, { "text": "ddei.property.ds.money2", "value": "$" }, { "text": "ddei.property.ds.money3", "value": "€" }, { "text": "ddei.property.ds.money4", "value": "£" }, { "text": "ddei.property.ds.money5", "value": "¥" }, { "text": "ddei.property.ds.money6", "value": "₽" }, { "text": "ddei.property.ds.money7", "value": "€" }], "defaultValue": "", "dataType": "string", "type": [1, 2], "itemStyle": { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 } }, { "code": "fmt.munit", "name": "ddei.property.moneyUnit", "desc": "显示在后方的货币单位", "controlType": "text", "defaultValue": "", "dataType": "string", "type": [1, 2] }, { "code": "fmt.mrmb", "name": "ddei.property.moneyUpCase", "desc": "显示为人民币大写", "controlType": "switch-checkbox", "dataType": "integer", "defaultValue": 0, "hiddenTitle": true, "display": "column", "type": [1, 2] }, { "code": "fmt.dtype", "name": "ddei.property.dateType", "desc": "日期和时间的格式化类型", "controlType": "radio", "dataSource": [{ "text": "2023-01-01", "value": 1 }, { "text": "23:59:59", "value": 2 }, { "text": "2023-01-01 23:59:59", "value": 3 }, { "text": "ddei.property.ds.custom", "value": 99 }], "dataType": "integer", "defaultValue": 1, "hiddenTitle": true, "display": "column", "cascadeDisplay": { 1: { show: [], hidden: ["fmt.format"] }, 2: { show: [], hidden: ["fmt.format"] }, 3: { show: [], hidden: ["fmt.format"] }, 99: { hidden: [], show: ["fmt.format"] }, default: { hidden: ["fmt.format"] }, empty: { hidden: ["fmt.format"] } } }, { "code": "fmt.format", "name": "ddei.property.format", "desc": "自定义格式化字符串", "controlType": "text", "dataType": "string" } ], /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.layout", attrs: ["layout"] }, { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] }; const __vite_glob_0_1$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: container }, Symbol.toStringTag, { value: "Module" })); const line = { "id": "100401", "name": "ddei.control.line", "code": "line", "desc": "直线、折线、曲线三种连接线", "type": "DDeiLine", /** * 定义组件属性 * 样式属性会影响图形的显示,修改样式属性也会刷新图形 * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 * 事件属性一般用来作为扩展用 * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) * 特殊属性: * code属性编码在统一个组中,code唯一 * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row */ attrs: [ { "code": "type", "name": "ddei.lineType", "desc": "用来快速连线类型,以便于套用相关的样式", "controlType": "radio", "dataSource": [{ "text": "ddei.property.ds.lineType1", "value": 1 }, { "text": "ddei.property.ds.lineType2", "value": 2 }, { "text": "ddei.property.ds.lineType3", "value": 3 }], "dataType": "integer", "defaultValue": 1, "cascadeDisplay": { 2: { show: ["round"], hidden: [] }, default: { show: [], hidden: ["round"] }, notempty: { hidden: ["round"] } }, "mapping": [], "type": 1 }, { "code": "weight", "name": "ddei.property.weight", "desc": "控件的宽度", "controlType": "range", "min": 0.1, "max": 10, "step": 0.1, "dataType": "float", "defaultValue": 1 }, { "code": "color", "name": "ddei.property.color", "desc": "线段的边框显示颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "" }, { "code": "fill.weight", "name": "ddei.fill", "desc": "填充的大小", "controlType": "range", "min": 0, "max": 30, "step": 1, "defaultValue": 0, "dataType": "integer" }, { "code": "fill.color", "name": "ddei.property.color", "desc": "线段的边框显示颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "black" }, { "code": "dash", "name": "ddei.property.dash", "desc": "图形的边框的是否为虚线样式,虚线由长短不一的线段构成", "controlType": "border-dash", "dataSource": [ { "text": "1", "value": [] }, { "text": "2", "value": [10, 5] }, { "text": "3", "value": [5, 5] }, { "text": "4", "value": [10, 4, 2, 4] }, { "text": "5", "value": [10, 4, 2, 4, 2, 4] }, { "text": "6", "value": [10, 4, 10, 4, 2, 4] }, { "text": "7", "value": [20, 5, 10, 5] }, { "text": "8", "value": [20, 5, 10, 5, 10, 5] }, { "text": "9", "value": [3, 3] }, { "text": "10", "value": [2, 2] }, { "text": "11", "value": [3, 2, 2, 2] }, { "text": "13", "value": [20, 10] } ], "dataType": "integer", "defaultValue": [], "isArray": true }, { "code": "opacity", "name": "ddei.property.opacity", "desc": "图形的边框的透明度,0完全透明~1完全不透明", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "dataType": "float", "defaultValue": 1, "display": "column" }, { "code": "sp.type", "name": "ddei.property.startPointType", "desc": "起点的样式样式", "controlType": "combox", "dataSource": [ { "text": "ddei.property.ds.none", "value": -1 }, { "text": "ddei.property.ds.pointType1", "value": 1 }, { "text": "ddei.property.ds.pointType2", "value": 2 }, { "text": "ddei.property.ds.pointType21", "value": 21 }, { "text": "ddei.property.ds.pointType3", "value": 3 }, { "text": "ddei.property.ds.pointType31", "value": 31 }, { "text": "ddei.property.ds.pointType4", "value": 4 }, { "text": "ddei.property.ds.pointType41", "value": 41 }, { "text": "ddei.property.ds.pointType5", "value": 5 }, { "text": "ddei.property.ds.pointType51", "value": 51 }, { "text": "ddei.property.ds.pointType6", "value": 6 }, { "text": "ddei.property.ds.pointType61", "value": 61 } ], "itemStyle": { width: 80, height: 25, col: 2, row: 6 }, "dataType": "integer", "cascadeDisplay": { "-1": { hidden: ["startWeidht"] }, empty: { hidden: ["startWeidht"] }, notempty: { show: ["startWeidht"] } }, "defaultValue": -1 }, { "code": "sp.weight", "name": "ddei.property.weight", "desc": "起点的箭头的宽度", "controlType": "range", "min": 1, "max": 30, "step": 1, "defaultValue": 6, "dataType": "integer" }, { "code": "ep.type", "name": "ddei.property.endPointType", "desc": "终点的样式样式", "controlType": "combox", "dataSource": [ { "text": "ddei.property.ds.none", "value": -1 }, { "text": "ddei.property.ds.pointType1", "value": 1 }, { "text": "ddei.property.ds.pointType2", "value": 2 }, { "text": "ddei.property.ds.pointType21", "value": 21 }, { "text": "ddei.property.ds.pointType3", "value": 3 }, { "text": "ddei.property.ds.pointType31", "value": 31 }, { "text": "ddei.property.ds.pointType4", "value": 4 }, { "text": "ddei.property.ds.pointType41", "value": 41 }, { "text": "ddei.property.ds.pointType5", "value": 5 }, { "text": "ddei.property.ds.pointType51", "value": 51 }, { "text": "ddei.property.ds.pointType6", "value": 6 }, { "text": "ddei.property.ds.pointType61", "value": 61 } ], "itemStyle": { width: 80, height: 25, col: 2, row: 6 }, "dataType": "integer", "cascadeDisplay": { "-1": { hidden: ["endWeidht"] }, empty: { hidden: ["endWeidht"] }, notempty: { show: ["endWeidht"] } }, "defaultValue": 5 }, { "code": "ep.weight", "name": "ddei.property.weight", "desc": "终点的箭头的宽度", "controlType": "range", "min": 1, "max": 30, "step": 1, "defaultValue": 6, "dataType": "integer" }, { "code": "round", "name": "ddei.property.round", "desc": "图形的边框的是否为为圆角的弧度", "controlType": "range", "min": 0, "max": 30, "step": 1, "defaultValue": 0, "dataType": "integer" }, { "code": "jumpline", "name": "ddei.jumpline", "desc": "用来控制当前线段的跳线类型", "controlType": "radio", "dataSource": [{ "text": "ddei.property.ds.yes", "value": 1 }, { "text": "ddei.property.ds.no", "value": 2 }, { "text": "ddei.property.ds.global", "value": 0 }], "dataType": "integer", "defaultValue": 0, "type": 1 }, { "code": "id", "name": "ddei.property.id", "desc": "控件在画布的全局唯一ID", "controlType": "text", "dataType": "string", "readonly": true }, { "code": "code", "name": "ddei.property.code", "desc": "控件在业务上的唯一编码,缺省和控件ID一致", "controlType": "text", "dataType": "string", "defaultValue": "ddei.property.code001" } ], /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: [ "type", "weight", "color", "fill.weight", "fill.color", "dash", "opacity", "sp.type", "sp.weight", "ep.type", "ep.weight", "round", "jumpline" ] } ] }, { name: "ddei.propertyName", icon: "icon-edit-properies", subGroups: [ { name: "ddei.propertyName", attrs: ["code"] } ] } ], icon: ``, filters: { LINE_OBI_FILTER: (model, params) => { return false; } } }; const __vite_glob_0_2$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: line }, Symbol.toStringTag, { value: "Module" })); const polygonContainer = { "id": "100203", "name": "多边形容器", "code": "polygon_container", "desc": "基于点采样的的容器", "type": "DDeiPolygonContainer", "from": "100201", "define": { width: 300, height: 200, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: false, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0,op2close = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: op2close = 1 pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,op2close:op2close,align:1,stroke:1,fill:1}); }` ] } } }; const __vite_glob_0_3$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: polygonContainer }, Symbol.toStringTag, { value: "Module" })); const polygon = { "id": "100500", "name": "ddei.control.polygon", "code": "polygon", "desc": "多个3-N边构成的多边形", "type": "DDeiPolygon", /** * 定义组件属性 * 样式属性会影响图形的显示,修改样式属性也会刷新图形 * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 * 事件属性一般用来作为扩展用 * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) * 特殊属性: * code属性编码在统一个组中,code唯一 * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row */ attrs: [ { "code": "width", "name": "ddei.property.width", "desc": "控件的宽度", "controlType": "text", "dataSource": null, "dataType": "integer", "defaultValue": "150" }, { "code": "height", "name": "ddei.property.height", "desc": "控件的高度", "controlType": "text", "dataSource": null, "dataType": "integer", "defaultValue": "150" }, { "code": "border.type", "name": "ddei.property.borderType", "desc": "用来快速选择边框的类型,以便于套用相关的样式", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.none", "value": 0 }, { "text": "ddei.property.ds.line", "value": 1 }], "defaultValue": 1, "hiddenTitle": true, "display": "column", "cascadeDisplay": { 1: { show: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"], hidden: [] }, default: { show: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"], hidden: [] }, empty: { hidden: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } } }, { "code": "border.color", "name": "ddei.property.color", "desc": "图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式", "controlType": "color-combo", "dataType": "string", "defaultValue": "" }, { "code": "borderOpacity", "name": "ddei.property.opacity", "desc": "图形的边框的透明度,0完全透明~1完全不透明", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "mapping": ["border.opacity"], "dataType": "float", "defaultValue": 1, "display": "column" }, { "code": "borderWidth", "name": "ddei.property.width", "desc": "图形的边框的粗细,0为无边框", "controlType": "range", "min": 0, "max": 10, "step": 0.1, "mapping": ["border.width"], "dataType": "integer", "defaultValue": 1 }, { "code": "borderDash", "name": "ddei.property.dash", "desc": "图形的边框的是否为虚线样式,虚线由长短不一的线段构成", "controlType": "border-dash", "dataSource": [ { "text": "1", "value": [] }, { "text": "2", "value": [10, 5] }, { "text": "3", "value": [5, 5] }, { "text": "4", "value": [10, 4, 2, 4] }, { "text": "5", "value": [10, 4, 2, 4, 2, 4] }, { "text": "6", "value": [10, 4, 10, 4, 2, 4] }, { "text": "7", "value": [20, 5, 10, 5] }, { "text": "8", "value": [20, 5, 10, 5, 10, 5] }, { "text": "9", "value": [3, 3] }, { "text": "10", "value": [2, 2] }, { "text": "11", "value": [3, 2, 2, 2] }, { "text": "13", "value": [20, 10] } ], "mapping": ["border.dash"], "dataType": "integer", "defaultValue": [], "isArray": true }, { "code": "borderRound", "name": "ddei.property.round", "desc": "图形的边框的是否为为圆角的弧度", "controlType": "range", "mapping": ["border.round"], "min": 0, "max": 30, "step": 1, "defaultValue": 0, "dataType": "integer" }, { "code": "fill.type", "name": "ddei.property.fillType", "desc": "图形填充的类型快速设置", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.none", "value": 0 }, { "text": "ddei.property.ds.color", "value": 1 }, { "text": "ddei.property.ds.image", "value": 2 }], "defaultValue": 1, "type": 1, "orderNo": 2, "cascadeDisplay": { 1: { show: ["fill.color", "fill.opacity"], hidden: ["fill.image"] }, 2: { show: ["fill.image", "fill.opacity"], hidden: ["fill.color"] }, default: { show: ["fill.color", "fill.opacity"], hidden: ["fill.image"] }, empty: { hidden: ["fill.color", "fill.image", "fill.opacity"] } }, "hiddenTitle": true, "display": "column" }, { "code": "fill.color", "name": "ddei.property.color", "desc": "图形的填充颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "" }, { "code": "fill.image", "name": "ddei.property.image", "desc": "图形的填充图片", "controlType": "image", "dataType": "string", "defaultValue": "", "type": 1 }, { "code": "fill.opacity", "name": "ddei.property.opacity", "desc": "图形的填充的透明度,0完全透明~1完全不透明", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "defaultValue": 1, "dataType": "float", "display": "column" }, { "code": "font.family", "name": "ddei.property.font", "desc": "文本的字体名称", "controlType": "combox", "dataType": "string", "dataSource": { "type": "config", "data": "fonts", "text": "ch", "value": "en", "bold": "isSystemDefault", "fontFamily": "en" }, "itemStyle": { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, "canSearch": true, "defaultValue": "Microsoft YaHei" }, { "code": "font.size", "name": "ddei.property.size", "desc": "文本的字体大小", "max": 50, "min": 5, "step": 0.5, "controlType": "font-size", "dataType": "float", "defaultValue": 14 }, { "code": "font.color", "name": "ddei.property.color", "desc": "文本的颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "" }, { "code": "fontAlign", "name": "ddei.property.align", "desc": "文本的对齐,采用九宫格式设置", "controlType": "align-type", "mapping": [], "dataType": "string" }, { "code": "textStyle.feed", "name": "ddei.property.feed", "desc": "自动换行", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "1" }, { "code": "textStyle.scale", "name": "ddei.property.outSize", "desc": "文本的超出范围后的策略", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.hidden", "value": "0" }, { "text": "ddei.property.ds.ellipsis", "value": "2" }, { "text": "ddei.property.ds.narrow", "value": "1" }, { "text": "ddei.property.ds.ext", "value": "3" }], "defaultValue": "0", "cascadeDisplay": { 3: { show: ["textStyle.lockWidth", "textStyle.paddingWeight"], hidden: [] }, default: { hidden: ["textStyle.lockWidth", "textStyle.paddingWeight"] }, empty: { hidden: ["textStyle.lockWidth", "textStyle.paddingWeight"] }, notempty: { hidden: ["textStyle.lockWidth", "textStyle.paddingWeight"] } } }, { "code": "textStyle.lockWidth", "name": "ddei.property.lockWidth", "desc": "超范围自动扩展的情况下锁定宽度", "controlType": "switch-checkbox", "dataType": "integer", "defaultValue": 0, "hiddenTitle": true, "display": "column", "type": [1, 2] }, { "code": "textStyle.paddingWeight", "name": "ddei.property.paddingWeight", "desc": "超范围自动扩展的情况下保留的宽度", "controlType": "text", "dataType": "integer", "defaultValue": 0, "hiddenTitle": true, "display": "column", "type": [1, 2] }, { "code": "textStyle.hollow", "name": "ddei.property.hollow", "desc": "文本的镂空显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.bold", "name": "ddei.property.bold", "desc": "文本的加粗显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.italic", "name": "ddei.property.italic", "desc": "文本的斜体显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.underline", "name": "ddei.property.underline", "desc": "文本的下划线显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.deleteline", "name": "ddei.property.deleteline", "desc": "文本的删除线显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.topline", "name": "ddei.property.topline", "desc": "文本的删除线显示", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0" }, { "code": "textStyle.bgcolor", "name": "ddei.property.textbg", "desc": "文本的背景颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "" }, { "code": "textStyle.subtype", "name": "ddei.property.subtype", "desc": "文本的标注类型", "controlType": "radio", "dataType": "integer", "dataSource": [{ "text": "ddei.property.ds.subType", "value": 0 }, { "text": "ddei.property.ds.subType1", "value": 1 }, { "text": "ddei.property.ds.subType2", "value": 2 }, { "text": "ddei.property.ds.subType3", "value": 3 }], "defaultValue": 0 }, { "code": "textStyle.align", "name": "ddei.property.textAlign", "desc": "文本的水平对齐", "controlType": "text", "dataType": "integer", "defaultValue": 2 }, { "code": "textStyle.valign", "name": "ddei.property.textValign", "desc": "文本的垂直对齐", "controlType": "text", "dataType": "integer", "defaultValue": 2 }, { "code": "textStyle.hspace", "name": "ddei.property.hspace", "desc": "文本之间的水平间距", "controlType": "range", "min": 0, "max": 10, "step": 0.1, "dataType": "float", "defaultValue": 0.5 }, { "code": "textStyle.vspace", "name": "ddei.property.vspace", "desc": "文本之间的垂直间距", "controlType": "range", "min": 0, "max": 10, "step": 0.1, "dataType": "float", "defaultValue": 0.5 }, { "code": "borderCreatingOpacity", "name": "ddei.property.opacity", "desc": "图形的边框的透明度,0完全透明~1完全不透明", "controlType": "text", "mapping": ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"], "dataType": "float", "defaultValue": 0.5, "display": "column" }, { "code": "fillCreatingOpacity", "name": "ddei.property.opacity", "desc": "图形的填充的透明度,0完全透明~1完全不透明", "controlType": "text", "mapping": ["fill.creating.opacity"], "dataType": "float", "defaultValue": 0.5, "display": "column" }, { "code": "imageCreatingOpacity", "name": "ddei.property.opacity", "desc": "图形的填充图片的透明度,0完全透明~1完全不透明", "controlType": "text", "mapping": ["fill.creating.opacity"], "dataType": "float", "defaultValue": 0.5, "display": "column" }, { "code": "id", "name": "ddei.property.id", "desc": "控件在画布的全局唯一ID", "controlType": "text", "dataType": "string", "readonly": true }, { "code": "code", "name": "ddei.property.code", "desc": "控件在业务上的唯一编码,缺省和控件ID一致", "controlType": "text", "dataType": "string", "defaultValue": "ddei.property.code001" }, { "code": "text", "name": "ddei.property.text", "desc": "控件的主体显示文本", "controlType": "textarea", "defaultValue": "", "dataType": "string", "type": [1, 2], //类别,1图形,2业务,3事件 "readonly": true }, { "code": "fmt.type", "name": "ddei.format", "desc": "文本的显示格式", "controlType": "radio", "dataType": "integer", "dataSource": [{ "text": "ddei.property.ds.text", "value": 0 }, { "text": "ddei.property.ds.decimal", "value": 1 }, { "text": "ddei.property.ds.money", "value": 2 }, { "text": "ddei.property.ds.time", "value": 3 }], "defaultValue": 0, "type": [1, 2], "cascadeDisplay": { 1: { show: ["fmt.nscale", "fmt.tmark"], hidden: ["fmt.mmark", "fmt.munit", "fmt.dtype", "fmt.format", "fmt.mrmb"] }, 2: { show: ["fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb"], hidden: ["fmt.dtype", "fmt.format"] }, 3: { show: ["fmt.dtype", "fmt.format"], hidden: ["fmt.mrmb", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.nscale"] }, default: { hidden: ["fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.nscale", "fmt.dtype", "fmt.format", "fmt.mrmb"] }, empty: { hidden: ["fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.nscale", "fmt.dtype", "fmt.format", "fmt.mrmb"] } } }, { "code": "fmt.nscale", "name": "ddei.property.nscale", "desc": "格式化小数位数", "controlType": "range", "min": 0, "max": 5, "dataType": "integer", "defaultValue": 0, "type": [1, 2] }, { "code": "fmt.tmark", "name": "ddei.property.tmark", "desc": "显示逗号千分符", "controlType": "switch-checkbox", "dataType": "integer", "defaultValue": 0, "hiddenTitle": true, "display": "column", "type": [1, 2] }, { "code": "fmt.mmark", "name": "ddei.property.mmark", "desc": "显示货币符号", "controlType": "combox", "dataSource": [{ "text": "ddei.property.ds.none", "value": "" }, { "text": "ddei.property.ds.money1", "value": "¥" }, { "text": "ddei.property.ds.money2", "value": "$" }, { "text": "ddei.property.ds.money3", "value": "€" }, { "text": "ddei.property.ds.money4", "value": "£" }, { "text": "ddei.property.ds.money5", "value": "¥" }, { "text": "ddei.property.ds.money6", "value": "₽" }, { "text": "ddei.property.ds.money7", "value": "€" }], "defaultValue": "", "dataType": "string", "type": [1, 2], "itemStyle": { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 } }, { "code": "fmt.munit", "name": "ddei.property.moneyUnit", "desc": "显示在后方的货币单位", "controlType": "text", "defaultValue": "", "dataType": "string", "type": [1, 2] }, { "code": "fmt.mrmb", "name": "ddei.property.moneyUpCase", "desc": "显示为人民币大写", "controlType": "switch-checkbox", "dataType": "integer", "defaultValue": 0, "hiddenTitle": true, "display": "column", "type": [1, 2] }, { "code": "fmt.dtype", "name": "ddei.property.dateType", "desc": "日期和时间的格式化类型", "controlType": "radio", "dataSource": [{ "text": "2023-01-01", "value": 1 }, { "text": "23:59:59", "value": 2 }, { "text": "2023-01-01 23:59:59", "value": 3 }, { "text": "ddei.property.ds.custom", "value": 99 }], "dataType": "integer", "defaultValue": 1, "hiddenTitle": true, "display": "column", "cascadeDisplay": { 1: { show: [], hidden: ["fmt.format"] }, 2: { show: [], hidden: ["fmt.format"] }, 3: { show: [], hidden: ["fmt.format"] }, 99: { hidden: [], show: ["fmt.format"] }, default: { hidden: ["fmt.format"] }, empty: { hidden: ["fmt.format"] } } }, { "code": "fmt.format", "name": "ddei.property.format", "desc": "自定义格式化字符串", "controlType": "text", "dataType": "string" } ], /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.border", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "ddei.text", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.lockWidth", "textStyle.paddingWeight", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] }, { name: "ddei.data", icon: "icon-edit-properies", subGroups: [ { name: "ddei.basic", attrs: ["code", "text", "fmt.type", "fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb", "fmt.dtype", "fmt.format"] } ] } ] }; const __vite_glob_0_4$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: polygon }, Symbol.toStringTag, { value: "Module" })); const tableCell = { "id": "100302", "name": "单元格", "code": "table-cell", "desc": "表格的单元格", "type": "DDeiTableCell" }; const styles$1 = { "name": "样式", "children": [ { "id": "100302001", "code": "width", "name": "宽度", "desc": "控件的宽度", "group": "布局", "controlType": "text", "dataSource": null, "dataType": "integer", "defaultValue": "160", "orderNo": 1, "visiable": false }, { "id": "100302002", "code": "height", "name": "高度", "desc": "控件的高度", "group": "布局", "controlType": "text", "dataSource": null, "dataType": "integer", "defaultValue": "80", "orderNo": 2, "visiable": false }, { "id": "100302003", "code": "border.type", "name": "边框类型", "desc": "用来快速选择边框的类型,以便于套用相关的样式", "group": "边框", "controlType": "border-type", "dataSource": [{ "text": "无线条", "value": "0" }, { "text": "实线", "value": "1" }], "dataType": "string", "defaultValue": "1", "hiddenTitle": true, "display": "column", "exmapping": ["border.top.disabled", "border.right.disabled", "border.bottom.disabled", "border.left.disabled"], "orderNo": 1, "visiable": true }, { "id": "100302004", "code": "border.color", "name": "颜色", "desc": "图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式", "group": "边框", "controlType": "color-combo", "mapping": ["border.top.color", "border.right.color", "border.bottom.color", "border.left.color"], "dataType": "string", "defaultValue": "rgb(219,219,233)", "orderNo": 2, "visiable": true }, { "id": "100302005", "code": "borderOpacity", "name": "透明度", "desc": "图形的边框的透明度,0完全透明~1完全不透明", "group": "边框", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "mapping": ["border.top.opacity", "border.right.opacity", "border.bottom.opacity", "border.left.opacity"], "dataType": "float", "defaultValue": 1, "display": "column", "orderNo": 3, "visiable": true }, { "id": "100302006", "code": "borderWidth", "name": "粗细", "desc": "图形的边框的粗细,0为无边框", "group": "边框", "controlType": "range", "min": 0, "max": 10, "step": 0.1, "mapping": ["border.top.width", "border.right.width", "border.bottom.width", "border.left.width"], "dataType": "integer", "defaultValue": 1, "orderNo": 4, "visiable": true }, { "id": "100302007", "code": "borderDash", "name": "虚线", "desc": "图形的边框的是否为虚线样式,虚线由长短不一的线段构成", "group": "边框", "controlType": "combox", "dataSource": [ { "img": "icon-line-00", "text": "1", "value": [] }, { "img": "icon-line-00", "text": "2", "value": [10, 5] }, { "img": "icon-line-00", "text": "3", "value": [5, 5] }, { "img": "icon-line-00", "text": "4", "value": [10, 4, 2, 4] }, { "img": "icon-line-00", "text": "5", "value": [10, 4, 2, 4, 2, 4] }, { "img": "icon-line-00", "text": "6", "value": [10, 4, 10, 4, 2, 4] }, { "img": "icon-line-00", "text": "7", "value": [20, 5, 10, 5] }, { "img": "icon-line-00", "text": "8", "value": [20, 5, 10, 5, 10, 5] }, { "img": "icon-line-00", "text": "9", "value": [3, 3] }, { "img": "icon-line-00", "text": "10", "value": [2, 2] }, { "img": "icon-line-00", "text": "11", "value": [3, 2, 2, 2] }, { "img": "icon-line-00", "text": "12", "value": [3, 2, 2, 2, 2, 2] } ], "itemStyle": { width: 80, height: 25, col: 2, row: 6, imgWidth: 60, imgHeight: 20, display: "img-text" }, "mapping": ["border.top.dash", "border.right.dash", "border.bottom.dash", "border.left.dash"], "dataType": "integer", "defaultValue": [], "isArray": true, "orderNo": 5, "visiable": true }, { "id": "100302008", "code": "borderRound", "name": "圆角", "desc": "图形的边框的是否为为圆角的弧度", "group": "边框", "controlType": "range", "mapping": ["border.top.round", "border.right.round", "border.bottom.round", "border.left.round"], "min": 0, "max": 100, "step": 1, "defaultValue": 0, "dataType": "integer", "orderNo": 6, "visiable": true }, { "id": "100302101", "code": "fillType", "name": "填充类型", "desc": "图形填充的类型快速设置", "group": "填充", "controlType": "fill-type", "dataSource": [{ "text": "无填充", "value": "0" }, { "text": "单色填充", "value": "1" }], "exmapping": ["fill.disabled"], "dataType": "string", "defaultValue": "1", "hiddenTitle": true, "display": "column", "orderNo": 1, "visiable": true }, { "id": "100302102", "code": "fill.color", "name": "颜色", "desc": "图形的填充颜色", "group": "填充", "controlType": "color-combo", "dataType": "string", "defaultValue": "white", "orderNo": 2, "visiable": true }, { "id": "100302103", "code": "fill.opacity", "name": "透明度", "desc": "图形的填充的透明度,0完全透明~1完全不透明", "group": "填充", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "defaultValue": 1, "dataType": "float", "display": "column", "orderNo": 3, "visiable": true }, { "id": "100302201", "code": "font.family", "name": "字体", "desc": "文本的字体名称", "group": "文本", "controlType": "combox", "dataType": "string", "dataSource": { "type": "config", "data": "fonts", "text": "ch", "value": "en", "bold": "isSystemDefault", "fontFamily": "en" }, "itemStyle": { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, "canSearch": true, "defaultValue": "Microsoft YaHei", "orderNo": 1, "visiable": true }, { "id": "100302202", "code": "font.size", "name": "大小", "desc": "文本的字体大小", "group": "文本", "max": 50, "min": 5, "step": 0.5, "controlType": "font-size", "dataType": "float", "defaultValue": 14, "orderNo": 2, "visiable": true }, { "id": "100302203", "code": "font.color", "name": "颜色", "desc": "文本的颜色", "group": "文本", "controlType": "color-combo", "dataType": "string", "defaultValue": "#252525", "orderNo": 3, "visiable": true }, { "id": "100302204", "code": "fontAlign", "name": "对齐", "desc": "文本的对齐,采用九宫格式设置", "group": "文本", "controlType": "align-type", "mapping": [], "dataType": "string", "orderNo": 4, "visiable": true }, { "id": "100302205", "code": "textStyle.feed", "name": "换行", "desc": "自动换行", "group": "文本", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0", "orderNo": 10, "visiable": true }, { "id": "100302206", "code": "textStyle.scale", "name": "ddei.property.outSize", "desc": "文本的自动缩小字体填充", "group": "文本", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0", "orderNo": 11, "visiable": true }, { "id": "100302207", "code": "textStyle.hollow", "name": "ddei.property.hollow", "desc": "文本的镂空显示", "group": "文本", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0", "orderNo": 9, "visiable": true }, { "id": "100302208", "code": "textStyle.bold", "name": "ddei.property.bold", "desc": "文本的加粗显示", "group": "文本", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0", "orderNo": 5, "visiable": true }, { "id": "100302209", "code": "textStyle.italic", "name": "ddei.property.italic", "desc": "文本的斜体显示", "group": "文本", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0", "orderNo": 6, "visiable": true }, { "id": "100302210", "code": "textStyle.underline", "name": "ddei.property.underline", "desc": "文本的下划线显示", "group": "文本", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0", "orderNo": 7, "visiable": true }, { "id": "100302211", "code": "textStyle.deleteline", "name": "ddei.property.deleteline", "desc": "文本的删除线显示", "group": "文本", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0", "orderNo": 8, "visiable": true }, { "id": "100302212", "code": "textStyle.topline", "name": "ddei.property.topline", "desc": "文本的删除线显示", "group": "文本", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.yes", "value": "1" }, { "text": "ddei.property.ds.no", "value": "0" }], "defaultValue": "0", "orderNo": 8, "visiable": true }, { "id": "100302303", "code": "textStyle.align", "name": "ddei.property.textAlign", "desc": "文本的水平对齐", "group": "文本", "controlType": "text", "dataType": "integer", "defaultValue": 2, "visiable": false }, { "id": "100302304", "code": "textStyle.valign", "name": "ddei.property.textValign", "desc": "文本的垂直对齐", "group": "文本", "controlType": "text", "dataType": "integer", "defaultValue": 2, "visiable": false } ], "visiable": false, "order": 1 }; const datas$1 = { "name": "数据", "children": [ { "id": "100302401", "code": "id", "name": "ddei.property.id", "desc": "控件在画布的全局唯一ID", "group": "布局与文本", "controlType": "text", "dataType": "string", "readonly": true, "orderNo": 1, "visiable": false }, { "id": "100302403", "code": "text", "name": "ddei.property.text", "desc": "控件的主体显示文本", "group": "布局与文本", "controlType": "textarea", "defaultValue": "ddei.property.text", "hiddenTitle": false, "display": "column", "dataType": "string", "type": [1, 2], //类别,1图形,2业务,3事件 "orderNo": 3, "visiable": true }, { "id": "100302404", "code": "layout", "name": "布局", "desc": "文本的字体名称", "group": "布局与文本", "controlType": "radio", "dataSource": [ { "text": "自由布局", "value": "free" }, { "text": "完全填充", "value": "full" }, { "text": "九宫格", "value": "nine" }, { "text": "表格", "value": "table" }, { "text": "圆心", "value": "cc" } ], "defaultValue": "full", "hiddenTitle": false, "display": "column", "dataType": "string", "orderNo": 2, "visiable": true } ], "visiable": true, "order": 2 }; const events$1 = { "name": "事件", "children": [], "visiable": false, "order": 3 }; const __vite_glob_0_5$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, datas: datas$1, default: tableCell, events: events$1, styles: styles$1 }, Symbol.toStringTag, { value: "Module" })); const table = { "id": "100301", "name": "表格", "code": "table", "desc": "表格控件,可以通过插入、移动、合并单元格完成复杂的布局", "type": "DDeiTable", "icon": "icon-table", "subcontrol": "100302" }; const styles = { "name": "样式", "children": [ { "id": "100301001", "code": "width", "name": "宽度", "desc": "控件的宽度", "group": "布局", "controlType": "text", "dataSource": null, "dataType": "integer", "defaultValue": "600", "orderNo": 1, "visiable": false }, { "id": "100301002", "code": "height", "name": "高度", "desc": "控件的高度", "group": "布局", "controlType": "text", "dataSource": null, "dataType": "integer", "defaultValue": "200", "orderNo": 2, "visiable": false }, { "id": "100301003", "code": "border.type", "name": "边框类型", "desc": "用来快速选择边框的类型,以便于套用相关的样式", "group": "边框", "controlType": "border-type", "dataSource": [{ "text": "无线条", "value": "0" }, { "text": "实线", "value": "1" }], "dataType": "string", "defaultValue": "1", "hiddenTitle": true, "display": "column", "exmapping": ["border.top.disabled", "border.right.disabled", "border.bottom.disabled", "border.left.disabled"], "orderNo": 1, "visiable": true }, { "id": "100301004", "code": "border.color", "name": "颜色", "desc": "图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式", "group": "边框", "controlType": "color-combo", "mapping": ["border.top.color", "border.right.color", "border.bottom.color", "border.left.color"], "dataType": "string", "defaultValue": "black", "orderNo": 2, "visiable": true }, { "id": "100301005", "code": "borderOpacity", "name": "透明度", "desc": "图形的边框的透明度,0完全透明~1完全不透明", "group": "边框", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "mapping": ["border.top.opacity", "border.right.opacity", "border.bottom.opacity", "border.left.opacity"], "dataType": "float", "defaultValue": 1, "display": "column", "orderNo": 3, "visiable": true }, { "id": "100301006", "code": "borderWidth", "name": "粗细", "desc": "图形的边框的粗细,0为无边框", "group": "边框", "controlType": "range", "min": 0, "max": 10, "step": 0.1, "mapping": ["border.top.width", "border.right.width", "border.bottom.width", "border.left.width"], "dataType": "integer", "defaultValue": 1, "orderNo": 4, "visiable": true }, { "id": "100301007", "code": "borderDash", "name": "虚线", "desc": "图形的边框的是否为虚线样式,虚线由长短不一的线段构成", "group": "边框", "controlType": "combox", "dataSource": [ { "img": "icon-line-00", "text": "1", "value": [] }, { "img": "icon-line-00", "text": "2", "value": [10, 5] }, { "img": "icon-line-00", "text": "3", "value": [5, 5] }, { "img": "icon-line-00", "text": "4", "value": [10, 4, 2, 4] }, { "img": "icon-line-00", "text": "5", "value": [10, 4, 2, 4, 2, 4] }, { "img": "icon-line-00", "text": "6", "value": [10, 4, 10, 4, 2, 4] }, { "img": "icon-line-00", "text": "7", "value": [20, 5, 10, 5] }, { "img": "icon-line-00", "text": "8", "value": [20, 5, 10, 5, 10, 5] }, { "img": "icon-line-00", "text": "9", "value": [3, 3] }, { "img": "icon-line-00", "text": "10", "value": [2, 2] }, { "img": "icon-line-00", "text": "11", "value": [3, 2, 2, 2] }, { "img": "icon-line-00", "text": "12", "value": [3, 2, 2, 2, 2, 2] } ], "itemStyle": { width: 80, height: 25, col: 2, row: 6, imgWidth: 60, imgHeight: 20, display: "img-text" }, "mapping": ["border.top.dash", "border.right.dash", "border.bottom.dash", "border.left.dash"], "dataType": "integer", "defaultValue": [], "isArray": true, "orderNo": 5, "visiable": true }, { "id": "100301008", "code": "borderRound", "name": "圆角", "desc": "图形的边框的是否为为圆角的弧度", "group": "边框", "controlType": "range", "mapping": ["border.top.round", "border.right.round", "border.bottom.round", "border.left.round"], "min": 0, "max": 100, "step": 1, "defaultValue": 0, "dataType": "integer", "orderNo": 6, "visiable": true }, { "id": "100301305", "code": "borderCreatingOpacity", "name": "透明度", "desc": "图形的边框的透明度,0完全透明~1完全不透明", "group": "边框", "controlType": "text", "mapping": ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"], "dataType": "float", "defaultValue": 0.5, "display": "column", "orderNo": 3, "visiable": false }, { "id": "100301306", "code": "fillCreatingOpacity", "name": "透明度", "desc": "图形的填充的透明度,0完全透明~1完全不透明", "group": "填充", "controlType": "text", "mapping": ["fill.creating.opacity"], "dataType": "float", "defaultValue": 0.5, "display": "column", "orderNo": 3, "visiable": false } ], "visiable": false, "order": 1 }; const datas = { "name": "数据", "children": [ { "id": "100301401", "code": "id", "name": "ddei.property.id", "desc": "控件在画布的全局唯一ID", "group": "基础信息", "controlType": "text", "dataType": "string", "readonly": true, "orderNo": 1, "visiable": false }, { "id": "100301402", "code": "code", "name": "ddei.property.code", "desc": "控件在业务上的唯一编码,缺省和控件ID一致", "group": "基础信息", "controlType": "text", "dataType": "string", "defaultValue": "ddei.property.code001", "orderNo": 2, "visiable": true } ], "visiable": true, "order": 1 }; const events = { "name": "事件", "children": [], "visiable": false, "order": 3 }; const menus = [ { "code": "insert-row", "name": "插入行", "icon": "icon-insert-row" }, { "code": "insert-col", "name": "插入列", "icon": "icon-insert-col" }, { "code": "remove-row", "name": "删除行", "icon": "icon-delete-row" }, { "code": "remove-col", "name": "删除列", "icon": "icon-delete-column" }, { "code": "split" }, { "code": "merge-cell", "name": "合并单元格", "icon": "icon-merge-cells" }, { "code": "cancel-merge-cell", "name": "取消合并单元格", "icon": "icon-merge-cells" } ]; const __vite_glob_0_6$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, datas, default: table, events, menus, styles }, Symbol.toStringTag, { value: "Module" })); const circleSplit = { "id": "100104", "name": "圆形-切割", "code": "circle", "desc": "由圆形,从中间横向/纵向切割开", "from": "100103", "define": { //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 ext: { //追加一个从中间切开的采样点,用于横向切割 sample: { direct: 1, //1横向切割,2纵向切割 pvalue: 0, //切割的坐标,横向切割时为纵坐标,纵向切割时为横坐标 rules: [ `(i, sample, pvs, model, ovs){ if(i == 0){ if(sample.direct == 1){ pvs.push({x:-50,y:sample.pvalue,stroke:1,type:1}); pvs.push({x:50,y:sample.pvalue,stroke:1,type:1}); }else{ pvs.push({x:sample.pvalue,y:-50,stroke:1,type:1}); pvs.push({x:sample.pvalue,y:50,stroke:1,type:1}); } } }` ] } } } }; const __vite_glob_0_7$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: circleSplit }, Symbol.toStringTag, { value: "Module" })); const circleText = { "id": "100003", "name": "ddei.control.circle", "code": "circle", "desc": "由极坐标系构造的圆形,带有text", "from": "100103", "define": { ext: { //采样信息 sample: { //采样的规则,多组采样返回多组规则 rules: [ //文本区域 `(i, sample, pvs, model, ovs){ pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1}); }` ] }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_8$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: circleText }, Symbol.toStringTag, { value: "Module" })); const circle = { "id": "100103", "name": "ddei.control.circle", "code": "circle", "desc": "由极坐标系构造的圆形", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); if(i == 3){ pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1}); } }` ] }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] } ] } ] } } }; const __vite_glob_0_9$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: circle }, Symbol.toStringTag, { value: "Module" })); const cube = { "id": "100501", "name": "ddei.control.cube", "code": "cube", "desc": "正方体", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: true, //只采样一次 loop: 1, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //允许文本输入 textInput: 1, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ pvs.push({begin:1,x:50,y:50,stroke:1,select:1,oppoint:2,fill:1}); pvs.push({x:-50,y:50,stroke:1,select:1,oppoint:2,fill:1}); pvs.push({x:-50,y:-50,stroke:1,select:1,oppoint:2,fill:1}); pvs.push({x:-45,y:-60,stroke:1,select:1,oppoint:1,fill:1}); pvs.push({x:55,y:-60,stroke:1,select:1,oppoint:1,fill:1}); pvs.push({end:1,x:55,y:40,stroke:1,select:1,oppoint:1,fill:1}); }`, //内部连线 `(i, sample, pvs, model, ovs){ pvs.push({begin:1,x:-50,y:-50,stroke:1}); pvs.push({x:50,y:-50,stroke:1,oppoint:2,op2close:1}); pvs.push({x:55,y:-60,stroke:1}); pvs.push({x:-50,y:-50,type:3}); pvs.push({x:50,y:-50,stroke:1}); pvs.push({x:50,y:50,stroke:1}); pvs.push({x:-50,y:-50,type:3}); }`, //文本区域 `(i, sample, pvs, model, ovs){ pvs.push({x:-48,y:48,text:sample.textInput}); pvs.push({x:-48,y:-48,text:sample.textInput}); pvs.push({x:48,y:-48,text:sample.textInput}); pvs.push({x:48,y:48,text:sample.textInput}); }` ] } } }; const __vite_glob_0_10$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: cube }, Symbol.toStringTag, { value: "Module" })); const diamondRound = { "id": "100041", "name": "ddei.control.diamond", "code": "diamond", "desc": "圆角的菱形", "from": "100040", "define": { border: { round: 5 } } }; const __vite_glob_0_11$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: diamondRound }, Symbol.toStringTag, { value: "Module" })); const diamond = { "id": "100040", "name": "ddei.control.diamond", "code": "diamond", "desc": "标准的菱形", "from": "100500", "define": { width: 160, height: 80, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: -90, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ pvs.push({begin:i==0,end:i==3,x:sample.x,y:sample.y,select:1,oppoint:1,stroke:1,fill:1,clip:1}); }`, `(i, sample, pvs, model, ovs){ let er = sample.r * Math.cos(45) let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({begin:i==0,end:i==3,x:x,y:y,text:1}); }` ] } } }; const __vite_glob_0_12$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: diamond }, Symbol.toStringTag, { value: "Module" })); const ellipse = { "id": "100006", "name": "ddei.control.ellipse", "code": "ellipse", "desc": "由极坐标系构造的椭圆形", "from": "100500", "define": { width: 160, height: 80, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); if(i == 3){ pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1}); } }`, //文本区域 `(i, sample, pvs, model, ovs){ pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1}); }` ] } } }; const __vite_glob_0_13$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: ellipse }, Symbol.toStringTag, { value: "Module" })); const fivestar = { "id": "100070", "name": "ddei.control.fivestar", "code": "fivestar", "desc": "由极坐标系构造的五角星", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { eqrat: true, //一圈10次采样 loop: 10, //初始次采样的开始角度 angle: -90, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model,ovs){ let er = i % 2 == 0 ? sample.r : sample.r / 2.7+(ovs[0].x-ovs[0].ovi.x) let x = er * sample.cos let y = er * sample.sin pvs.push({ begin:i==0,end:i==9,x: x, y: y ,fill:1,select:1,stroke:1,clip:1,oppoint:1}); }`, `(i, sample, pvs, model,ovs){ if (i == 0) { let er = sample.r / 3+(ovs[0].x-ovs[0].ovi.x) let x = er * Math.cos(45 * DDeiConfig.ROTATE_UNIT) let y = er * Math.sin(45 * DDeiConfig.ROTATE_UNIT) pvs.push({ begin:1,x: x, y: y, text:1 }); x = er * Math.cos(135 * DDeiConfig.ROTATE_UNIT) y = er * Math.sin(135 * DDeiConfig.ROTATE_UNIT) pvs.push({ x: x, y: y, text:1 }); x = er * Math.cos(225 * DDeiConfig.ROTATE_UNIT) y = er * Math.sin(225 * DDeiConfig.ROTATE_UNIT) pvs.push({ x: x, y: y, text:1 }); x = er * Math.cos(315 * DDeiConfig.ROTATE_UNIT) y = er * Math.sin(315 * DDeiConfig.ROTATE_UNIT) pvs.push({ end:1,x: x, y: y, text:1 }); } }` ] }, //操作点定义 ovs: [ { x: 10, y: 0, ix: 10, iy: 0, //约束,控制点的移动路径和位置 constraint: { type: 2, //矩形范围 x0: 0, x1: 30, y0: 0, y1: 0 } } ] } }; const __vite_glob_0_14$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: fivestar }, Symbol.toStringTag, { value: "Module" })); const halfCircle = { "id": "100110", "name": "ddei.control.half-circle", "code": "hcircle", "desc": "由极坐标系构造的半圆形", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //方向,上右下左1,2,3,4 direct: 2, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let deltaRotate = 0 switch(sample.direct){ case 1: deltaRotate = -90 break; case 3: deltaRotate = -270 break; case 4: deltaRotate = -180 break; } let rad1 = (90+deltaRotate) * DDeiConfig.ROTATE_UNIT let rad2 = (-90+deltaRotate) * DDeiConfig.ROTATE_UNIT let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT let x0 = sample.r * Math.cos(rad0) let y0 = sample.r * Math.sin(rad0) let x1 = sample.r * Math.cos(rad1) let y1 = sample.r * Math.sin(rad1) let x2 = sample.r * Math.cos(rad2) let y2 = sample.r * Math.sin(rad2) pvs.push({begin:1,x:x2,y:y2,r:sample.r,rad:rad2,stroke:1,type:2,direct:1}); pvs.push({x:x2,y:y2,r:sample.r,rad:rad1,stroke:1,type:2,direct:1}); pvs.push({x:x2,y:y2}); pvs.push({end:1,x:0,y:0}); pvs.push({x:x1,y:y1,type:0,oppoint:1}); pvs.push({x:x2,y:y2,type:0,oppoint:1}); pvs.push({x:x0,y:0,type:0,oppoint:1}); pvs.push({x:x2,y:0,type:0,oppoint:1}); pvs.push({x:x0,y:y2,type:0}); pvs.push({x:x0,y:y1,type:0}); } }`, //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }` ] }, iconPos: { dx: -50 } } }; const __vite_glob_0_15$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: halfCircle }, Symbol.toStringTag, { value: "Module" })); const hexagonRound = { "id": "100031", "name": "ddei.control.hexagon", "code": "hexagon", "desc": "由六个点构成的六边形", "from": "100030", "define": { border: { round: 5 } } }; const __vite_glob_0_16$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: hexagonRound }, Symbol.toStringTag, { value: "Module" })); const hexagon = { "id": "100030", "name": "ddei.control.hexagon", "code": "hexagon", "desc": "由六个点构成的六边形", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 6, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let x = er * sample.cos let y = er * sample.sin pvs.push({begin:i == 0,end:i == 5,op2close:i == 5 ? 1 :0,oppoint:2,x:x,y:y,select:1,clip:1,stroke:1,fill:1}); }`, `(i, sample, pvs, model, ovs){ switch(i){ case 0:; case 2:; case 3:; case 5: let er = sample.r / Math.cos(30 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+30) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) pvs.push({begin:i == 0,end:i == 5,x:x,y:y,text:1}); ; } }` ] } } }; const __vite_glob_0_17$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: hexagon }, Symbol.toStringTag, { value: "Module" })); const hexstar = { "id": "100075", "name": "ddei.control.hexstar", "code": "hexstar", "desc": "由极坐标系构造的六芒星", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈6次采样 loop: 12, //初始次采样的开始角度 angle: -90, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let er = i%2 == 0 ? sample.r : sample.r * 0.58 let x = er * sample.cos let y = er * sample.sin pvs.push({begin:i==0,end:i==11, x: x, y: y, oppoint:1,select:1,clip:1,stroke:1,fill:1 }); }`, `(i, sample, pvs, model, ovs){ if(i % 2 == 1){ let er = sample.r * 0.58 let x = er * sample.cos let y = er * sample.sin pvs.push({begin:i==1,end:i==11, x: x, y: y,stroke:1,fill:1 }); } }`, `(i, sample, pvs, model, ovs){ if(i % 2 == 0 && i != 6 && i !=0){ let er = sample.r * 0.5 let x = er * sample.cos let y = er * sample.sin pvs.push({begin:i==2,end:i==10, x: x, y: y,text:1 }); } }` ] }, textArea: [ { x: -2.5, y: 32.5, z: 1 }, { x: 102.5, y: 32.5, z: 1 }, { x: 102.5, y: 142.5, z: 1 }, { x: -2.5, y: 142.5, z: 1 } ] } }; const __vite_glob_0_18$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: hexstar }, Symbol.toStringTag, { value: "Module" })); const hexstar1 = { "id": "100076", "name": "ddei.control.hexstar", "code": "hexstar", "desc": "由极坐标系构造的六角星", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈6次采样 loop: 12, //初始次采样的开始角度 angle: -90, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let er = i%2 == 0 ? sample.r : sample.r * 0.58 let x = er * sample.cos let y = er * sample.sin pvs.push({begin:i==0,end:i==11, x: x, y: y,select:1,clip:1,stroke:1,fill:1,oppoint:1 }); }`, `(i, sample, pvs, model, ovs){ if(i % 2 == 0 && i != 6 && i !=0){ let x = sample.x * 0.5 let y = sample.y * 0.5 pvs.push({begin:i==2,end:i==10, x: x, y: y,text:1 }); } }` ] } } }; const __vite_glob_0_19$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: hexstar1 }, Symbol.toStringTag, { value: "Module" })); const hexstar2 = { "id": "100077", "name": "ddei.control.hexstar", "code": "hexstar", "desc": "由极坐标系构造的六芒星", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈6次采样 loop: 12, //初始次采样的开始角度 angle: -90, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选择范围 `(i, sample, pvs, model, ovs){ if(i % 3 == 0){ let er = (sample.r+5) / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({ begin:i==0,end:i==9,x: x, y: y,select:1 }); } }`, //第一层圈 `(i, sample, pvs, model, ovs){ if(i == 0){ let er = sample.r+5 let x = er * sample.cos let y = er * sample.sin pvs.push({begin:1,end:1, x: x, y: y,r:er,clip:1,stroke:1,fill:1 }); } }`, //第二层圈 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,end:1, x: sample.x, y: sample.y,r:sample.r,stroke:1,fill:1 }); } }`, //六边形外围 `(i, sample, pvs, model, ovs){ let er = i%2 == 0 ? sample.r : sample.r * 0.58 let x = er * sample.cos let y = er * sample.sin pvs.push({ begin:i==0,end:i==11,x: x, y: y,oppoint:1,stroke:1,fill:1 }); }`, //内部五边形 `(i, sample, pvs, model, ovs){ if(i % 2 == 1){ let x = sample.x * 0.58 let y = sample.y * 0.58 pvs.push({ begin:i==1,end:i==11,x: x, y: y,stroke:1,fill:1 }); } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i % 2 == 0 && i != 6 && i !=0){ let x = sample.x*0.5 let y = sample.y*0.5 pvs.push({ begin:i==2,end:i==10,x: x, y: y,text:1 }); } }` ] } } }; const __vite_glob_0_20$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: hexstar2 }, Symbol.toStringTag, { value: "Module" })); const leftArrow = { "id": "100121", "name": "ddei.control.arrow-left", "code": "arr-l", "desc": "指向左边的箭头", "from": "100120", "define": { //采样信息 ext: { sample: { angle: 180 } } } }; const __vite_glob_0_21$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: leftArrow }, Symbol.toStringTag, { value: "Module" })); const parallelogramRound = { "id": "100051", "name": "ddei.control.paralgram", "code": "paralgram", "desc": "由4个点组成的平行四边形", "from": "100050", "define": { border: { round: 5 } } }; const __vite_glob_0_22$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: parallelogramRound }, Symbol.toStringTag, { value: "Module" })); const parallelogram = { "id": "100050", "name": "ddei.control.paralgram", "code": "paralgram", "desc": "由4个点组成的平行四边形", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model,ovs){ switch(i){ case 0: pvs.push({begin:1,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1}); break; case 1: pvs.push({x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1}); break; case 2: pvs.push({x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1}); break; case 3: pvs.push({end:1,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,op2close:1,stroke:1,fill:1}); pvs[0].y = pvs[1].y pvs[1].x = pvs[2].x pvs[2].y = pvs[3].y pvs[3].x = pvs[0].x+(ovs[0].x-ovs[0].ovi.x) pvs[2].x = pvs[2].x+(ovs[0].x-ovs[0].ovi.x) pvs[0].x = pvs[0].x-(ovs[0].x-ovs[0].ovi.x) pvs[1].x = pvs[1].x-(ovs[0].x-ovs[0].ovi.x) break; } }`, //文本区域 `(i, sample, pvs, model,ovs){ switch(i){ case 0: pvs.push({begin:1,x:sample.x,y:sample.y,text:1}); break; case 1: pvs.push({x:sample.x,y:sample.y,text:1}); break; case 2: pvs.push({x:sample.x,y:sample.y,text:1}); break; case 3: pvs.push({end:1,x:sample.x,y:sample.y,text:1}); pvs[0].y = pvs[1].y pvs[1].x = pvs[2].x pvs[2].y = pvs[3].y pvs[3].x = pvs[0].x+(ovs[0].x-ovs[0].ovi.x) pvs[2].x = pvs[2].x+(ovs[0].x-ovs[0].ovi.x) pvs[0].x = pvs[0].x-(ovs[0].x-ovs[0].ovi.x) pvs[1].x = pvs[1].x-(ovs[0].x-ovs[0].ovi.x) let x0 = Math.max(pvs[1].x,pvs[2].x) let x1 = Math.min(pvs[3].x,pvs[0].x) pvs[0].x = x1 pvs[3].x = x1 pvs[1].x = x0 pvs[2].x = x0 break; } }` ] }, //操作点定义 ovs: [ { x: 25, y: -50, ix: 0, iy: -50, //约束,控制点的移动路径和位置 constraint: { type: 2, //矩形范围 x0: -100, x1: 100, y0: -50, y1: -50 } } ] } }; const __vite_glob_0_23$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: parallelogram }, Symbol.toStringTag, { value: "Module" })); const pentagonRound = { "id": "100021", "name": "ddei.control.pentagon", "code": "pentagon", "desc": "由五个点构成的五边形", "from": "100020", "define": { border: { round: 5 } } }; const __vite_glob_0_24$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: pentagonRound }, Symbol.toStringTag, { value: "Module" })); const pentagon = { "id": "100020", "name": "ddei.control.pentagon", "code": "pentagon", "desc": "由五个点构成的五边形", "from": "100500", "define": { width: 154, height: 154, poly: 2, //采样信息 sample: { eqrat: true, //一圈5次采样 loop: 5, //初始次采样的开始角度 angle: 198, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 4: end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,clip:1,oppoint:2,op2close:i == 4?1:0,stroke:1,fill:1}); }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:28,y:35,text:1}); pvs.push({x:-28,y:35,text:1}); pvs.push({x:-28,y:-28,text:1}); pvs.push({end:1,x:28,y:-28,text:1}); } }` ] } } }; const __vite_glob_0_25$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: pentagon }, Symbol.toStringTag, { value: "Module" })); const rectangleBorder = { "id": "100007", "name": "ddei.control.rectangle", "code": "rect", "desc": "带边框的矩形", "from": "100002", "define": { width: 160, height: 80, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let er = sample.r * 1.25 let x = er * sample.cos let y = er * sample.sin let begin = 0,end = 0,op2close = 0 switch(i){ case 0: begin = 1 break; case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: op2close = 1 pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:begin,end:end,x:x,y:y,r:er,select:1,clip:1,oppoint:2,op2close:op2close}); }`, `(i, sample, pvs, model, ovs){ let er = sample.r let x = sample.x let y = sample.y let begin = 0,end = 0 switch(i){ case 0: begin = 1 break; case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:begin,end:end,x:x,y:y,r:er,stroke:1,fill:1,text:1}); }` ] }, //组合控件 composes: [ { width: 200, height: 100, id: "100002", cIndex: 1 } ] } }; const __vite_glob_0_26$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: rectangleBorder }, Symbol.toStringTag, { value: "Module" })); const rectangleRound = { "id": "100005", "name": "ddei.control.rectangle", "code": "rect", "desc": "由4个点组成的矩形", "from": "100002", "define": { border: { round: 5 } } }; const __vite_glob_0_27$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: rectangleRound }, Symbol.toStringTag, { value: "Module" })); const rectangleSplit = { "id": "100009", "name": "ddei.control.rectangle-split", "code": "rect", "desc": "由4个点组成的长方形,从中间横向/纵向切割开", "from": "100008", "define": { //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 ext: { //追加一个从中间切开的采样点,用于横向切割 sample: { direct: 1, //1横向切割,2纵向切割 pvalue: -10, //切割的坐标,横向切割时为纵坐标,纵向切割时为横坐标 rules: [ `(i, sample, pvs, model, ovs){ if(i == 0){ if(sample.direct == 1){ pvs.push({x:-50,y:sample.pvalue,stroke:1,type:1}); pvs.push({x:50,y:sample.pvalue,stroke:1,type:1}); }else{ pvs.push({x:sample.pvalue,y:-50,stroke:1,type:1}); pvs.push({x:sample.pvalue,y:50,stroke:1,type:1}); } } }` ] } } } }; const __vite_glob_0_28$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: rectangleSplit }, Symbol.toStringTag, { value: "Module" })); const rectangleText = { "id": "100002", "name": "ddei.control.rectangle", "code": "rect", "desc": "由4个点组成的长方形", "from": "100008", "define": { ext: { sample: { //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); }` ] } } } }; const __vite_glob_0_29$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: rectangleText }, Symbol.toStringTag, { value: "Module" })); const rectangle = { "id": "100008", "name": "ddei.control.rectangle", "code": "rect", "desc": "由4个点组成的长方形", "from": "100000", "define": { width: 160, height: 80, ext: { //采样信息 sample: { eqrat: false } } } }; const __vite_glob_0_30$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: rectangle }, Symbol.toStringTag, { value: "Module" })); const rightArrow = { "id": "100120", "name": "ddei.control.arrow-right", "code": "arr-r", "desc": "指向右边的箭头", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈12次采样 loop: 12, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ if(i % 4 == 0){ let op2close = 0 if(i == 8){ op2close = 1 } pvs.push({begin:i == 0,end:i == 8,x:sample.x,y:sample.y,select:1,clip:1,oppoint:2,op2close:op2close,stroke:1,fill:1}); } }` ] } } }; const __vite_glob_0_31$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: rightArrow }, Symbol.toStringTag, { value: "Module" })); const squareRound = { "id": "100004", "name": "ddei.control.square", "code": "square", "desc": "由4个点组成的正方形", "from": "100001", "define": { border: { round: 5 } } }; const __vite_glob_0_32$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: squareRound }, Symbol.toStringTag, { value: "Module" })); const squareText = { "id": "100001", "name": "ddei.control.square", "code": "square", "desc": "由4个点组成的正方形", "from": "100000", "define": { ext: { sample: { //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); }` ] } } } }; const __vite_glob_0_33$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: squareText }, Symbol.toStringTag, { value: "Module" })); const square = { "id": "100000", "name": "ddei.control.square", "code": "square", "desc": "由4个点组成的正方形", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: true, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0,op2close = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: op2close = 1 pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,op2close:op2close,align:1,stroke:1,fill:1}); }` ] } } }; const __vite_glob_0_34$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: square }, Symbol.toStringTag, { value: "Module" })); const text = { "id": "100200", "name": "ddei.control.text", "code": "text", "desc": "跟随内容变化大小的文本", "from": "100002", "define": { borderType: 0, border: { type: 0, selected: { type: 1, dash: [5, 5], width: 1 } }, fill: { type: 0 }, text: "ddei.property.text", ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.text", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.lockWidth", "textStyle.paddingWeight", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] }, { name: "ddei.border", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] } ] }, { name: "ddei.data", icon: "icon-edit-properies", subGroups: [ { name: "ddei.basic", attrs: ["code", "text", "fmt.type", "fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb", "fmt.dtype", "fmt.format"] } ] } ], attrs: [ { "code": "textStyle.paddingWeight", "name": "ddei.property.paddingWeight", "desc": "超范围自动扩展的情况下保留的宽度", "controlType": "text", "dataType": "integer", "defaultValue": 10, "hiddenTitle": true, "display": "column", "type": [1, 2] }, { "code": "textStyle.scale", "name": "ddei.property.outSize", "desc": "文本的超出范围后的策略", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.hidden", "value": "0" }, { "text": "ddei.property.ds.ellipsis", "value": "2" }, { "text": "ddei.property.ds.narrow", "value": "1" }, { "text": "ddei.property.ds.ext", "value": "3" }], "defaultValue": 3, "cascadeDisplay": { 3: { show: ["textStyle.lockWidth", "textStyle.paddingWeight"], hidden: [] }, default: { show: ["textStyle.lockWidth", "textStyle.paddingWeight"] }, empty: { hidden: ["textStyle.lockWidth", "textStyle.paddingWeight"] }, notempty: { hidden: ["textStyle.lockWidth", "textStyle.paddingWeight"] } } } ] } } }; const __vite_glob_0_35$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: text }, Symbol.toStringTag, { value: "Module" })); const trapezoidRound = { "id": "100061", "name": "ddei.control.trapezoid", "code": "trapezoid", "desc": "由4个点组成的梯形", "from": "100060", "define": { border: { round: 5 } } }; const __vite_glob_0_36$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: trapezoidRound }, Symbol.toStringTag, { value: "Module" })); const trapezoid = { "id": "100060", "name": "ddei.control.trapezoid", "code": "trapezoid", "desc": "由4个点组成的梯形", "from": "100500", "define": { width: 160, height: 80, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: true, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0,op2close = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x sample.x+=20 break; case 3: op2close = 1 pvs[2].y=sample.y sample.x = pvs[0].x-20 end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:op2close,select:1,clip:1,stroke:1,fill:1}); }`, `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 sample.x -= 20 break; case 1: pvs[0].y=sample.y sample.x += 20 break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); }` ] } } }; const __vite_glob_0_37$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: trapezoid }, Symbol.toStringTag, { value: "Module" })); const triangleLeft90Round = { "id": "100014", "name": "ddei.control.triangle-left-90", "code": "triangle", "desc": "由三个点构成的三角形", "from": "100011", "define": { border: { round: 5 } } }; const __vite_glob_0_38$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: triangleLeft90Round }, Symbol.toStringTag, { value: "Module" })); const triangleLeft90 = { "id": "100011", "name": "ddei.control.triangle-left-90", "code": "triangle", "desc": "由三个点构成的三角形", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈1次采样 loop: 1, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ pvs.push({begin:1,x:50,y:50,select:1,clip:1}); pvs.push({x:-50,y:50,select:1,clip:1}); pvs.push({x:-50,y:-50,select:1,clip:1}); pvs.push({end:1,x:50,y:-50,select:1,clip:1}); }`, `(i, sample, pvs, model, ovs){ pvs.push({begin:1,x:50,y:50,oppoint:2,align:1,stroke:1,fill:1}); pvs.push({x:-50,y:50,oppoint:2,align:1,stroke:1,fill:1}); pvs.push({end:1,x:-50,y:-50,oppoint:2,op2close:1,align:1,stroke:1,fill:1}); }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:50,text:1}); pvs.push({x:0,y:50,text:1}); pvs.push({x:0,y:0,text:1}); pvs.push({end:1,x:-50,y:0,text:1}); } }` ] } } }; const __vite_glob_0_39$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: triangleLeft90 }, Symbol.toStringTag, { value: "Module" })); const triangleRight90Round = { "id": "100015", "name": "ddei.control.triangle-right-90", "code": "triangle", "desc": "由三个点构成的三角形", "from": "100012", "define": { border: { round: 5 } } }; const __vite_glob_0_40$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: triangleRight90Round }, Symbol.toStringTag, { value: "Module" })); const triangleRight90 = { "id": "100012", "name": "ddei.control.triangle-right-90", "code": "triangle", "desc": "由三个点构成的三角形", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈1次采样 loop: 1, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ pvs.push({begin:1,x:50,y:50,select:1,clip:1}); pvs.push({x:-50,y:50,select:1,clip:1}); pvs.push({x:-50,y:-50,select:1,clip:1}); pvs.push({end:1,x:50,y:-50,select:1,clip:1}); }`, `(i, sample, pvs, model, ovs){ pvs.push({begin:1,x:50,y:50,oppoint:2,align:1,stroke:1,fill:1}); pvs.push({x:-50,y:50,oppoint:2,align:1,stroke:1,fill:1}); pvs.push({end:1,x:50,y:-50,oppoint:2,op2close:1,align:1,stroke:1,fill:1}); }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:50,y:50,text:1}); pvs.push({x:0,y:50,text:1}); pvs.push({x:0,y:0,text:1}); pvs.push({end:1,x:50,y:0,text:1}); } }` ] } } }; const __vite_glob_0_41$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: triangleRight90 }, Symbol.toStringTag, { value: "Module" })); const triangleRound = { "id": "100013", "name": "ddei.control.triangle", "code": "triangle", "desc": "由三个点构成的三角形", "from": "100010", "define": { border: { round: 5 } } }; const __vite_glob_0_42$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: triangleRound }, Symbol.toStringTag, { value: "Module" })); const triangle = { "id": "100010", "name": "ddei.control.triangle", "code": "triangle", "desc": "由三个点构成的三角形", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { eqrat: true, //一圈12次采样 loop: 12, //初始次采样的开始角度 angle: -90, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ if(i % 4 == 0){ let op2close = 0 if(i == 8){ op2close = 1 } pvs.push({begin:i == 0,end:i == 8,x:sample.x,y:sample.y,clip:1,oppoint:2,op2close:op2close,stroke:1,fill:1}); } }`, `(i, sample, pvs, model, ovs){ if(i % 3 == 0){ let er = sample.r/2 let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({begin:i == 0,end:i == 9,x:x,y:y,text:1}); } }`, //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let sita = 45; let rad = sita * DDeiConfig.ROTATE_UNIT let cos = parseFloat(Math.cos(rad).toFixed(4)) let sin = parseFloat(Math.sin(rad).toFixed(4)) let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let x = er * cos let y = er * sin pvs.push({x:x,y:y,r:er,select:1}); sita = 135; rad = sita * DDeiConfig.ROTATE_UNIT cos = parseFloat(Math.cos(rad).toFixed(4)) sin = parseFloat(Math.sin(rad).toFixed(4)) er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) x = er * cos y = er * sin pvs.push({x:x,y:y,r:er,select:1}); sita = 225; rad = sita * DDeiConfig.ROTATE_UNIT cos = parseFloat(Math.cos(rad).toFixed(4)) sin = parseFloat(Math.sin(rad).toFixed(4)) er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) x = er * cos y = er * sin pvs.push({x:x,y:y,r:er,select:1}); sita = 315; rad = sita * DDeiConfig.ROTATE_UNIT cos = parseFloat(Math.cos(rad).toFixed(4)) sin = parseFloat(Math.sin(rad).toFixed(4)) er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) x = er * cos y = er * sin pvs.push({x:x,y:y,r:er,select:1}); } }` ] }, iconPos: { dy: 10 } } }; const __vite_glob_0_43$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: triangle }, Symbol.toStringTag, { value: "Module" })); const flowCardTab = { "id": "102053", "name": "ddei.control.card", "code": "fct", "desc": "流程的卡片", "from": "100500", "define": { width: 110, height: 70, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let weight = 20 switch(i){ case 0: pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); break; case 1: pvs[0].y=sample.y pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); break; case 2: pvs[1].x=sample.x pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); break; case 3: pvs[2].y=sample.y+weight pvs.push({x:pvs[2].x+weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); sample.x = pvs[0].x pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,fill:1,oppoint:2,op2close:1,end:1}); pvs.push({x:sample.x,y:pvs[2].y,text:1,type:0}); break; } }` ] } } }; const __vite_glob_0_44$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowCardTab }, Symbol.toStringTag, { value: "Module" })); const flowControlTransfer = { "id": "102058", "name": "ddei.control.controltran", "code": "ctran", "desc": "控制传递", "from": "100401", "define": { type: 2, ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ], cpv: { x: 0, y: 0 }, //组合控件 composes: [ { width: 30, height: 30, id: "100120", cIndex: 1, initCPV: { x: 0, y: 0, z: 1 } } ], //操作点 ovs: [ { x: 0, y: 0, ix: 0, iy: 0, //约束,控制点的移动路径和位置 constraint: { type: 1, //跟随线段 pvs: ["pvs"] //当前对象的pvs // type: 5, //不允许移动,固定路径位置,沿路径方向,固定在等比例或者等长度位置(长度不足则按照0.5比例位置) // pvs: ["pvs[0]","pvs[1]"],//定义路径 // rate:0.5, //固定比例 // len: 0 //固定长度 }, //联动,点移动后控制的其它点 links: [ { type: 1, //1施加矩阵 // type:2,//同步中心点 pvs: ["composes[0]"] } ] } ] } }; const __vite_glob_0_45$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowControlTransfer }, Symbol.toStringTag, { value: "Module" })); const flowData = { "id": "102030", "name": "ddei.data", "code": "fdata", "desc": "流程的数据节点", "from": "100500", "define": { width: 150, height: 90, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 45, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ `(i,sample, pvs, model){ let ds = i == 2 || i ==3 ? 5: -5 let x = sample.x+ds let y = sample.y let op2close = i == 3 ? 1 :0 pvs.push({begin:i==0,end:i==3, x: x, y: y,select:1,clip:1,fill:1,stroke:1,oppoint:2,op2close:op2close }); }`, `(i,sample, pvs, model){ let ds = i == 1 || i ==2 ? 5: -5 let x = sample.x+ds let y = sample.y pvs.push({ begin:i==0,end:i==3, x: x, y: y,text:1 }); }` ] } } }; const __vite_glob_0_46$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowData }, Symbol.toStringTag, { value: "Module" })); const flowData1 = { "id": "102031", "name": "ddei.data", "code": "fdata", "desc": "流程的数据节点", "from": "102030", "define": { border: { round: 5 } } }; const __vite_glob_0_47$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowData1 }, Symbol.toStringTag, { value: "Module" })); const flowData2 = { "id": "102032", "name": "ddei.control.store-data", "code": "fdata", "desc": "流程的数据节点", "from": "102030", "define": { width: 100, height: 70, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈采样次数 loop: 1, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let dr = -50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT) pvs.push({begin:1,x:-dr,y:50,select:1}) pvs.push({x:dr,y:50,select:1}) pvs.push({x:dr,y:-50,select:1}) pvs.push({end:1,x:-dr,y:-50,select:1}) }`, //操作点 `(i, sample, pvs, model, ovs){ let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT) pvs.push({x:100-dr,y:0,oppoint:1}) pvs.push({x:-dr,y:0,oppoint:1}) pvs.push({x:0,y:50,oppoint:1}) pvs.push({x:0,y:-50,oppoint:1}) }`, //主体区域 `(i, sample, pvs, model, ovs){ let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad1 = 135 * DDeiConfig.ROTATE_UNIT let rad2 = 225 * DDeiConfig.ROTATE_UNIT pvs.push({begin:1,x:50,y:50,stroke:1,fill:1,clip:1}) pvs.push({x:-50,y:50,r:dr,rad:rad1,stroke:1,fill:1,clip:1}) pvs.push({x:-50,y:-50,type:2,r:dr,rad:rad2,direct:1,stroke:1,fill:1,clip:1}) pvs.push({x:50,y:-50,r:dr,rad:rad2,stroke:1,fill:1,clip:1}) pvs.push({end:1,dx:100,type:2,r:dr,rad:rad1,direct:0,stroke:1,fill:1,clip:1}) }`, //文本区域 `(i, sample, pvs, model, ovs){ let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT) pvs.push({begin:1,x:100-dr,y:50,text:1}) pvs.push({x:-50,y:50,text:1}) pvs.push({x:-50,y:-50,text:1}) pvs.push({end:1,x:100-dr,y:-50,text:1}) }` ] }, iconPos: { dw: 15 } } }; const __vite_glob_0_48$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowData2 }, Symbol.toStringTag, { value: "Module" })); const flowData3 = { "id": "102033", "name": "ddei.control.seq-data", "code": "sqdata", "desc": "流程的顺序数据节点", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2 let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:50,y:50}); pvs.push({y:50,x:0,stroke:1,type:1,end:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,begin:1,end:1}); } }`, //文本区域 `(i, sample, pvs, model, ovs){ pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1}); }` ] } } }; const __vite_glob_0_49$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowData3 }, Symbol.toStringTag, { value: "Module" })); const flowDefflow = { "id": "102041", "name": "ddei.control.defined-flow", "code": "defflow", "desc": "流程的子流程节点", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 45, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ pvs.push({ begin:i==0,end:i==3,x: sample.x, y: sample.y,select:1,clip:1,stroke:1,fill:1 }); }`, `(i, sample, pvs, model, ovs){ let er = sample.r let x = sample.x let y = sample.y let op2close = i == 3?1:0 pvs.push({x:x,y:y,r:er,type:0,oppoint:2,op2close:op2close}); }`, `(i, sample, pvs, model, ovs){ if(i == 1){ pvs.push({begin:1, x: sample.x, y: sample.y,stroke:1}); }else if(i == 2){ pvs[3] = {end:1, x: sample.x, y: sample.y,stroke:1}; pvs[1] = { x: sample.x+10, y: sample.y,stroke:1}; pvs[2] = { x: pvs[0].x+10, y: pvs[0].y,stroke:1}; } }`, `(i, sample, pvs, model, ovs){ let ds = i == 1 || i ==2 ? 10: -10 let x = sample.x+ds let y = sample.y pvs.push({ begin:i==0,end:i==3,x: x, y: y,text:1,stroke:1 }); }` ] } } }; const __vite_glob_0_50$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowDefflow }, Symbol.toStringTag, { value: "Module" })); const flowDelay = { "id": "102055", "name": "ddei.control.delay", "code": "fdy", "desc": "数据库图标", "from": "100500", "define": { width: 80, height: 80, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:100,y:50,select:1,clip:1}) pvs.push({x:-50,y:50,select:1,clip:1}) pvs.push({x:-50,y:-50,select:1,clip:1}) pvs.push({end:1,x:100,y:-50,select:1,clip:1}) } }`, //操作点 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:100,y:0,oppoint:1}) pvs.push({x:0,y:50,oppoint:1}) pvs.push({x:-50,y:0,oppoint:1}) pvs.push({end:1,x:0,y:-50,oppoint:1}) } }`, //绘制线段区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) let rad90 = 90 * DDeiConfig.ROTATE_UNIT switch(i){ case 0: pvs.push({begin:1,x:x,y:y,fill:1,stroke:1,r:er,rad:0}); break; case 1: pvs.push({x:x,y:y,fill:1,stroke:1}); break; case 2: pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:rad90}); break; case 3: pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:-rad90}); pvs.push({r:er,dx:50,rad:rad90,stroke:1,type:4,direct:1,end:1}); pvs.push({r:sample.r}); pvs.push({r:sample.r}); break; } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:50,y:50,text:1}) pvs.push({x:-50,y:50,text:1}) pvs.push({x:-50,y:-50,text:1}) pvs.push({end:1,x:50,y:-50,text:1}) } }` ] }, iconPos: { dx: -20, dw: 10 } } }; const __vite_glob_0_51$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowDelay }, Symbol.toStringTag, { value: "Module" })); const flowDisplayContent = { "id": "102056", "name": "ddei.control.display", "code": "fdc", "desc": "显示内容", "from": "100500", "define": { width: 80, height: 80, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:135,y:50,select:1,clip:1}) pvs.push({x:-135,y:50,select:1,clip:1}) pvs.push({x:-135,y:-50,select:1,clip:1}) pvs.push({end:1,x:135,y:-50,select:1,clip:1}) } }`, //操作点 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:65,y:0,oppoint:1}) pvs.push({x:0,y:50,oppoint:1}) pvs.push({x:-135,y:0,oppoint:1}) pvs.push({end:1,x:0,y:-50,oppoint:1}) } }`, //绘制线段区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) let rad90 = 90 * DDeiConfig.ROTATE_UNIT switch(i){ case 0: pvs.push({begin:1,x:x-10,y:y,fill:1,stroke:1,r:er,rad:0}); break; case 1: pvs.push({x:x,y:y,fill:1,stroke:1}); break; case 2: pvs.push({x:-135,y:0,fill:1,stroke:1}); pvs.push({x:x,y:y,fill:1,stroke:1}); break; case 3: pvs.push({x:x-10,y:y,fill:1,stroke:1,r:er,rad:-rad90,rd:0}); pvs.push({r:er,dx:40,rad:rad90,stroke:1,type:4,direct:1,end:1}); pvs.push({r:25}); pvs.push({r:sample.r}); break; } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:50,y:50,text:1}) pvs.push({x:-50,y:50,text:1}) pvs.push({x:-50,y:-50,text:1}) pvs.push({end:1,x:50,y:-50,text:1}) } }` ] }, iconPos: { dx: 20, dw: 10 }, border: { round: 5 } } }; const __vite_glob_0_52$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowDisplayContent }, Symbol.toStringTag, { value: "Module" })); const flowEnd = { "id": "102090", "name": "ddei.control.end", "code": "end", "desc": "流程的开始节点", "from": "102001", "define": { width: 40, height: 40, fill: { color: "black" }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_53$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowEnd }, Symbol.toStringTag, { value: "Module" })); const flowEnd1 = { "id": "102091", "name": "ddei.control.end", "code": "end", "desc": "流程的开始节点", "from": "100003", "define": { width: 40, height: 40, cIndex: 1, composes: [ { id: "102090", width: 30, height: 30, cIndex: 2, attrLinks: [ { code: "fill", mapping: ["*"] }, { code: "border", mapping: ["*"] } ] } ], ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_54$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowEnd1 }, Symbol.toStringTag, { value: "Module" })); const flowEnd2 = { "id": "102092", "name": "ddei.control.end", "code": "end", "desc": "流程的开始节点", "from": "100003", "define": { width: 40, height: 40, fill: { color: "red" }, border: { type: 0 }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_55$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowEnd2 }, Symbol.toStringTag, { value: "Module" })); const flowEnd3 = { "id": "102093", "name": "ddei.control.end", "code": "end", "desc": "流程的开始节点", "from": "100003", "define": { width: 40, height: 40, cIndex: 1, composes: [ { id: "102001", width: 30, height: 30, cIndex: 2, attrLinks: [ { code: "fill", mapping: ["*"] }, { code: "border", mapping: ["*"] } ] } ], ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] } ] } ] } } }; const __vite_glob_0_56$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowEnd3 }, Symbol.toStringTag, { value: "Module" })); const flowHandInput = { "id": "102052", "name": "ddei.control.manualinput", "code": "fhi", "desc": "流程的手动输入节点", "from": "100500", "define": { width: 110, height: 70, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let weight = 20 switch(i){ case 0: pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); break; case 1: pvs[0].y=sample.y pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); break; case 2: pvs[1].x=sample.x pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); break; case 3: pvs[2].y=sample.y+weight sample.x = pvs[0].x pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,fill:1,oppoint:2,op2close:1,end:1}); pvs.push({x:sample.x,y:pvs[2].y,text:1,type:0}); break; } }` ] } } }; const __vite_glob_0_57$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowHandInput }, Symbol.toStringTag, { value: "Module" })); const flowLoopArea = { "id": "102050", "name": "ddei.control.looparea", "code": "fla", "desc": "流程的循环界限", "from": "100500", "define": { width: 110, height: 70, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let weight = 20 switch(i){ case 0: pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1}); break; case 1: pvs[0].y=sample.y pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); break; case 2: pvs[1].x=sample.x pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); break; case 3: pvs[2].y=sample.y+weight pvs.push({x:pvs[2].x+weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); sample.x = pvs[0].x pvs.push({x:sample.x-weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); pvs.push({x:sample.x,y:sample.y+weight,select:1,clip:1,text:1,stroke:1,oppoint:2,op2close:1,fill:1,end:1}); break; } }` ] } } }; const __vite_glob_0_58$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowLoopArea }, Symbol.toStringTag, { value: "Module" })); const flowManualOperate = { "id": "102057", "name": "ddei.control.manualoperate", "code": "fmo", "desc": "由人工手动完成的节点", "from": "100500", "define": { width: 140, height: 70, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: true, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 sample.x -= 20 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x = sample.x+20 break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x+20 end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 :0,select:1,clip:1,stroke:1,fill:1}); }`, `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: sample.x +=20 pvs[1].x = sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); }` ] } } }; const __vite_glob_0_59$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowManualOperate }, Symbol.toStringTag, { value: "Module" })); const flowPageRef = { "id": "102051", "name": "ddei.control.pageref", "code": "fpr", "desc": "流程的跨页引用", "from": "100500", "define": { width: 70, height: 70, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ switch(i){ case 0: pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1}); break; case 1: pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); break; case 2: pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1}); break; case 3: pvs.push({x:-pvs[0].x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1}); pvs.push({x:pvs[0].x,y:sample.y,select:1,clip:1,text:1,oppoint:2,op2close:1,stroke:1,fill:1,end:1}); break; } }` ] } } }; const __vite_glob_0_60$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowPageRef }, Symbol.toStringTag, { value: "Module" })); const flowPrepare = { "id": "102054", "name": "ddei.control.prepare", "code": "prepare", "desc": "流程的准备", "from": "100030", "define": { width: 100, height: 70 } }; const __vite_glob_0_61$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowPrepare }, Symbol.toStringTag, { value: "Module" })); const flowStart = { "id": "102001", "name": "ddei.control.start", "code": "start", "desc": "流程的开始节点", "from": "100103", "define": { width: 40, height: 40 } }; const __vite_glob_0_62$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowStart }, Symbol.toStringTag, { value: "Module" })); const flowStart1 = { "id": "102002", "name": "ddei.control.start", "code": "start", "desc": "流程的开始节点", "from": "102001", "define": { width: 100, height: 50 } }; const __vite_glob_0_63$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowStart1 }, Symbol.toStringTag, { value: "Module" })); const flowSubflow = { "id": "102040", "name": "ddei.control.subflow", "code": "subflow", "desc": "流程的子流程节点", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 45, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ pvs.push({ begin:i==0,end:i==3,x: sample.x, y: sample.y,select:1,clip:1,stroke:1,fill:1 }); }`, `(i, sample, pvs, model, ovs){ let er = sample.r let x = sample.x let y = sample.y pvs.push({x:x,y:y,r:er,type:0,oppoint:2,op2close:i == 3 ? 1: 0}); }`, `(i, sample, pvs, model, ovs){ let ds = i == 1 || i ==2 ? 10: -10 let x = sample.x+ds let y = sample.y pvs.push({ begin:i==0,end:i==3,x: x, y: y,text:1,stroke:1 }); }` ] } } }; const __vite_glob_0_64$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowSubflow }, Symbol.toStringTag, { value: "Module" })); const flowSwitch = { "id": "102020", "name": "ddei.control.switch", "code": "switch", "desc": "流程的分支节点", "from": "100040", "define": { width: 110, height: 70 } }; const __vite_glob_0_65$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowSwitch }, Symbol.toStringTag, { value: "Module" })); const flowSwitch1 = { "id": "102021", "name": "ddei.control.switch", "code": "switch", "desc": "流程的分支节点", "from": "102020", "define": { border: { round: 5 } } }; const __vite_glob_0_66$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowSwitch1 }, Symbol.toStringTag, { value: "Module" })); const flowTask = { "id": "102010", "name": "ddei.control.task", "code": "task", "desc": "流程的任务节点", "from": "100002", "define": { width: 110, height: 70 } }; const __vite_glob_0_67$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowTask }, Symbol.toStringTag, { value: "Module" })); const flowTask1 = { "id": "102011", "name": "ddei.control.task", "code": "task", "desc": "流程的任务节点", "from": "102010", "define": { border: { round: 5 } } }; const __vite_glob_0_68$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowTask1 }, Symbol.toStringTag, { value: "Module" })); const flowTask2 = { "id": "102012", "name": "ddei.control.start-or-end", "code": "flowsoe", "desc": "流程的开始或结束节点", "from": "102010", "define": { height: 60, width: 100, border: { round: 15 } } }; const __vite_glob_0_69$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: flowTask2 }, Symbol.toStringTag, { value: "Module" })); const bidfunnel = { "id": "103007", "name": "ddei.control.bindfunnel", "code": "bidfunnel", "desc": "双向漏斗", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,缺省点为原点 poly: 2, //采样信息 sample: { //一圈采样次数 loop: 6, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i !=0 && i != 3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let x = er * sample.cos let y = er * sample.sin pvs.push({begin:i == 1,end:i == 5,x:x,y:y,select:1,clip:1}); } }`, //主体图形 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let x = er * sample.cos let y = er * sample.sin switch(i){ case 1: pvs.push({begin:1,x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1}); break; case 2: pvs.push({x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1}); pvs.push({x:0,y:0,oppoint:1,clip:1,stroke:1,fill:1}); break; case 4: pvs.push({end:1,x:x,y:y,oppoint:2,op2close:1,clip:1,stroke:1,fill:1}); break; case 5: pvs.splice(3,0,{x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1}) break; } }` ] } } }; const __vite_glob_0_70$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bidfunnel }, Symbol.toStringTag, { value: "Module" })); const bracketBigLeftText = { "id": "104124", "name": "ddei.control.big-bracket", "code": "bmt", "desc": "左大括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104122", cIndex: 2, initCPV: { x: -65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 150, height: 95, id: "100002", cIndex: 1, initCPV: { x: 5, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1, align: 1 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_71$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketBigLeftText }, Symbol.toStringTag, { value: "Module" })); const bracketBigLeft = { "id": "104122", "name": "ddei.control.big-bracket", "code": "bb", "desc": "由极坐标系构造的右大括号,不带任何文本", "from": "104121", "define": { width: 50, height: 100, ext: { //采样信息 sample: { direct: 4 } } } }; const __vite_glob_0_72$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketBigLeft }, Symbol.toStringTag, { value: "Module" })); const bracketBigRightText = { "id": "104123", "name": "ddei.control.big-bracket", "code": "bbt", "desc": "右大括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104121", cIndex: 2, initCPV: { x: 65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 150, height: 95, id: "100002", cIndex: 1, initCPV: { x: -5, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1, align: 3 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_73$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketBigRightText }, Symbol.toStringTag, { value: "Module" })); const bracketBigRight = { "id": "104121", "name": "ddei.control.big-bracket", "code": "bb", "desc": "由极坐标系构造的右大括号,不带任何文本", "from": "100500", "define": { width: 50, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //方向,上右下左1,2,3,4 direct: 2, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let deltaRotate = 0 switch(sample.direct){ case 1: deltaRotate = -90 break; case 3: deltaRotate = -270 break; case 4: deltaRotate = -180 break; } let rad1 = (72+deltaRotate) * DDeiConfig.ROTATE_UNIT let rad2 = (-72+deltaRotate) * DDeiConfig.ROTATE_UNIT let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT let x0 = sample.r * Math.cos(rad0) let y0 = sample.r * Math.sin(rad0) let x1 = sample.r * Math.cos(rad1) let y1 = sample.r * Math.sin(rad1) let x2 = sample.r * Math.cos(rad2) let y2 = sample.r * Math.sin(rad2) switch(sample.direct){ case 1: pvs.push({begin:1,x:x2,y:y1+10,type:3}); pvs.push({x:x2,y:y1+10,type:5,stroke:1}); pvs.push({x:x2-2,y:y0+10}); pvs.push({x:(x2+10)/2,y:y0+25}); pvs.push({x:-10,y:y0+20}); pvs.push({x:-10,y:y0+20,type:5,stroke:1}); pvs.push({x:-3,y:y0+18}); pvs.push({x:0,y:y0+10}); pvs.push({x:0,y:y0}); pvs.push({x:0,y:y0,stroke:1,type:5}); pvs.push({x:0,y:y0+10}); pvs.push({x:3,y:y0+18}); pvs.push({x:10,y:y0+20}); pvs.push({x:10,y:y0+20,stroke:1,type:5}); pvs.push({x:(x1-10)/2,y:y0+25}); pvs.push({x:x1+2,y:y0+10}); pvs.push({x:x1,y:y2+10}); pvs.push({x:x1,y:y1+10,type:0,oppoint:1,select:1}); pvs.push({x:x2,y:y2+10,type:0,oppoint:1,select:1}); pvs.push({x:0,y:y0,type:0,oppoint:1}); pvs.push({x:0,y:y2+10,type:0,oppoint:1}); pvs.push({x:x2,y:y0,type:0,select:1}); pvs.push({x:x1,y:y0,type:0,select:1}); break; case 2: //由4段贝塞尔曲线构造 pvs.push({begin:1,x:x2-10,y:y2,type:3}); pvs.push({x:x2-10,y:y2,type:5,stroke:1}); pvs.push({x:x0-10,y:y2-2}); pvs.push({x:x0-25,y:(y2-10)/2}); pvs.push({x:x0-20,y:-10}); pvs.push({x:x0-20,y:-10,stroke:1,type:5}); pvs.push({x:x0-18,y:-3}); pvs.push({x:x0-10,y:0}); pvs.push({x:x0,y:0}); pvs.push({x:x0,y:0,stroke:1,type:5}); pvs.push({x:x0-10,y:0}); pvs.push({x:x0-18,y:3}); pvs.push({x:x0-20,y:10}); pvs.push({x:x0-20,y:10,stroke:1,type:5}); pvs.push({x:x0-25,y:(y1-10)/2}); pvs.push({x:x0-10,y:y1+2}); pvs.push({x:x2-10,y:y1}); pvs.push({x:x1-10,y:y1,type:0,oppoint:1,select:1}); pvs.push({x:x2-10,y:y2,type:0,oppoint:1,select:1}); pvs.push({x:x0,y:0,type:0,oppoint:1}); pvs.push({x:x2-10,y:0,type:0,oppoint:1}); pvs.push({x:x0,y:y2,type:0,select:1}); pvs.push({x:x0,y:y1,type:0,select:1}); break; case 3: //由4段贝塞尔曲线构造 pvs.push({begin:1,x:x1,y:y1-10,type:3}); pvs.push({x:x1,y:y1-10,type:5,stroke:1}); pvs.push({x:x1-2,y:y0-10}); pvs.push({x:(x1+10)/2,y:y0-25}); pvs.push({x:-10,y:y0-20}); pvs.push({x:-10,y:y0-20,type:5,stroke:1}); pvs.push({x:-3,y:y0-18}); pvs.push({x:0,y:y0-10}); pvs.push({x:0,y:y0}); pvs.push({x:0,y:y0,stroke:1,type:5}); pvs.push({x:0,y:y0-10}); pvs.push({x:3,y:y0-18}); pvs.push({x:10,y:y0-20}); pvs.push({x:10,y:y0-20,stroke:1,type:5}); pvs.push({x:(x2-10)/2,y:y0-25}); pvs.push({x:x2+2,y:y0-10}); pvs.push({x:x2,y:y2-10}); pvs.push({x:x1,y:y1-10,type:0,oppoint:1,select:1}); pvs.push({x:x2,y:y2-10,type:0,oppoint:1,select:1}); pvs.push({x:0,y:y0,type:0,oppoint:1}); pvs.push({x:0,y:y2-10,type:0,oppoint:1}); pvs.push({x:x2,y:y0,type:0,select:1}); pvs.push({x:x1,y:y0,type:0,select:1}); break; case 4: //由4段贝塞尔曲线构造 pvs.push({begin:1,x:x2+10,y:y1,type:3}); pvs.push({x:x2+10,y:y1,type:5,stroke:1}); pvs.push({x:x0+10,y:y1-2}); pvs.push({x:x0+25,y:(y1-10)/2}); pvs.push({x:x0+20,y:-10}); pvs.push({x:x0+20,y:-10,stroke:1,type:5}); pvs.push({x:x0+18,y:-3}); pvs.push({x:x0+10,y:0}); pvs.push({x:x0,y:0}); pvs.push({x:x0,y:0,stroke:1,type:5}); pvs.push({x:x0+10,y:0}); pvs.push({x:x0+18,y:3}); pvs.push({x:x0+20,y:10}); pvs.push({x:x0+20,y:10,stroke:1,type:5}); pvs.push({x:x0+25,y:(y2-10)/2}); pvs.push({x:x0+10,y:y2+2}); pvs.push({x:x2+10,y:y2}); pvs.push({x:x1+10,y:y2,type:0,oppoint:1,select:1}); pvs.push({x:x2+10,y:y1,type:0,oppoint:1,select:1}); pvs.push({x:x0,y:0,type:0,oppoint:1}); pvs.push({x:x2+10,y:0,type:0,oppoint:1}); pvs.push({x:x0,y:y1,type:0,select:1}); pvs.push({x:x0,y:y2,type:0,select:1}); break; } } }` ] }, ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_74$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketBigRight }, Symbol.toStringTag, { value: "Module" })); const bracketBigText = { "id": "104125", "name": "ddei.control.big-bracket", "code": "bmt", "desc": "左右大括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104122", cIndex: 2, initCPV: { x: -65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 30, height: 100, id: "104121", cIndex: 2, initCPV: { x: 65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 140, height: 95, id: "100002", cIndex: 1, initCPV: { x: 0, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_75$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketBigText }, Symbol.toStringTag, { value: "Module" })); const bracketMiddleLeftText = { "id": "104114", "name": "ddei.control.middle-bracket", "code": "bmt", "desc": "左中括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104112", cIndex: 2, initCPV: { x: -65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 150, height: 95, id: "100002", cIndex: 1, initCPV: { x: 5, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1, align: 1 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_76$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketMiddleLeftText }, Symbol.toStringTag, { value: "Module" })); const bracketMiddleLeft = { "id": "104112", "name": "ddei.control.middle-bracket", "code": "bm", "desc": "由极坐标系构造的左中括号,不带任何文本", "from": "104111", "define": { ext: { sample: { //方向,上右下左1,2,3,4 direct: 4 } } } }; const __vite_glob_0_77$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketMiddleLeft }, Symbol.toStringTag, { value: "Module" })); const bracketMiddleRightText = { "id": "104113", "name": "ddei.control.middle-bracket", "code": "bmt", "desc": "右中括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104111", cIndex: 2, initCPV: { x: 65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 150, height: 95, id: "100002", cIndex: 1, initCPV: { x: -5, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1, align: 3 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_78$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketMiddleRightText }, Symbol.toStringTag, { value: "Module" })); const bracketMiddleRight = { "id": "104111", "name": "ddei.control.middle-bracket", "code": "bm", "desc": "由极坐标系构造的右中括号,不带任何文本", "from": "100500", "define": { width: 50, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //方向,上右下左1,2,3,4 direct: 2, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let deltaRotate = 0 switch(sample.direct){ case 1: deltaRotate = -90 break; case 3: deltaRotate = -270 break; case 4: deltaRotate = -180 break; } let rad1 = (72+deltaRotate) * DDeiConfig.ROTATE_UNIT let rad2 = (-72+deltaRotate) * DDeiConfig.ROTATE_UNIT let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT let x0 = sample.r * Math.cos(rad0) let y0 = sample.r * Math.sin(rad0) let x1 = sample.r * Math.cos(rad1) let y1 = sample.r * Math.sin(rad1) let x2 = sample.r * Math.cos(rad2) let y2 = sample.r * Math.sin(rad2) pvs.push({begin:1,x:x2,y:y2}); pvs.push({x:x0,y:y2,stroke:1}); pvs.push({x:x0,y:y1,stroke:1}); pvs.push({x:x1,y:y1,stroke:1}); pvs.push({x:x1,y:y1,type:0,oppoint:1,select:1}); pvs.push({x:x2,y:y2,type:0,oppoint:1,select:1}); pvs.push({x:x0,y:0,type:0,oppoint:1}); pvs.push({x:x2,y:0,type:0,oppoint:1}); pvs.push({x:x0,y:y2,type:0,select:1}); pvs.push({x:x0,y:y1,type:0,select:1}); } }` ] }, ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_79$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketMiddleRight }, Symbol.toStringTag, { value: "Module" })); const bracketMiddleText = { "id": "104115", "name": "ddei.control.middle-bracket", "code": "bmt", "desc": "左右中括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104112", cIndex: 2, initCPV: { x: -65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 30, height: 100, id: "104111", cIndex: 2, initCPV: { x: 65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 140, height: 95, id: "100002", cIndex: 1, initCPV: { x: 0, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_80$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketMiddleText }, Symbol.toStringTag, { value: "Module" })); const bracketSmallLeftText = { "id": "104104", "name": "ddei.control.small-bracket", "code": "bst", "desc": "左小括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104102", cIndex: 2, initCPV: { x: -65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 150, height: 95, id: "100002", cIndex: 1, initCPV: { x: 5, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1, align: 1 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_81$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketSmallLeftText }, Symbol.toStringTag, { value: "Module" })); const bracketSmallLeft = { "id": "104102", "name": "ddei.control.small-bracket", "code": "bs", "desc": "由极坐标系构造的左小括号,不带任何文本", "from": "104101", "define": { ext: { sample: { //方向,上右下左1,2,3,4 direct: 4 } } } }; const __vite_glob_0_82$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketSmallLeft }, Symbol.toStringTag, { value: "Module" })); const bracketSmallRightText = { "id": "104103", "name": "ddei.control.small-bracket", "code": "bst", "desc": "右小括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104101", cIndex: 2, initCPV: { x: 65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 150, height: 95, id: "100002", cIndex: 1, initCPV: { x: -5, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1, align: 3 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_83$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketSmallRightText }, Symbol.toStringTag, { value: "Module" })); const bracketSmallRight = { "id": "104101", "name": "ddei.control.small-bracket", "code": "bs", "desc": "由极坐标系构造的右小括号,不带任何文本", "from": "100500", "define": { width: 50, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //方向,上右下左1,2,3,4 direct: 2, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let deltaRotate = 0 switch(sample.direct){ case 1: deltaRotate = -90 break; case 3: deltaRotate = -270 break; case 4: deltaRotate = -180 break; } let rad1 = (72+deltaRotate) * DDeiConfig.ROTATE_UNIT let rad2 = (-72+deltaRotate) * DDeiConfig.ROTATE_UNIT let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT let x0 = sample.r * Math.cos(rad0) let y0 = sample.r * Math.sin(rad0) let x1 = sample.r * Math.cos(rad1) let y1 = sample.r * Math.sin(rad1) let x2 = sample.r * Math.cos(rad2) let y2 = sample.r * Math.sin(rad2) pvs.push({begin:1,x:x2,y:y2,r:sample.r,rad:rad2,stroke:1,type:2,direct:1}); pvs.push({x:x2,y:y2,r:sample.r,rad:rad1,stroke:1,type:2,direct:1}); pvs.push({x:x2,y:y2}); pvs.push({end:1,x:0,y:0}); pvs.push({x:x1,y:y1,type:0,oppoint:1,select:1}); pvs.push({x:x2,y:y2,type:0,oppoint:1,select:1}); pvs.push({x:x0,y:0,type:0,oppoint:1}); pvs.push({x:x2,y:0,type:0,oppoint:1}); pvs.push({x:x0,y:y2,type:0,select:1}); pvs.push({x:x0,y:y1,type:0,select:1}); } }` ] }, ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_84$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketSmallRight }, Symbol.toStringTag, { value: "Module" })); const bracketSmallText = { "id": "104105", "name": "ddei.control.small-bracket", "code": "bst", "desc": "左右小括号,带文本编辑", "from": "100500", "define": { width: 160, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1}); }` ] }, //组合控件 composes: [ { width: 30, height: 100, id: "104102", cIndex: 2, initCPV: { x: -65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 30, height: 100, id: "104101", cIndex: 2, initCPV: { x: 65, y: 0, z: 1 }, attrLinks: [ { code: "border", mapping: ["*"] } ] }, { width: 140, height: 95, id: "100002", cIndex: 1, initCPV: { x: 0, y: 0, z: 1 }, border: { type: 0 }, fill: { type: 0 }, textStyle: { feed: 1, scale: 1 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_85$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bracketSmallText }, Symbol.toStringTag, { value: "Module" })); const comment = { "id": "103005", "name": "ddei.control.comment", "code": "comment", "desc": "注释备注", "from": "100500", "define": { width: 110, height: 70, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //允许文本输入 textInput: 1, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let weight = 20 let x=sample.x,y=sample.y switch(i){ case 0: pvs.push({begin:1,x:x,y:y,select:1,clip:1,oppoint:2,stroke:1,fill:1}); break; case 1: pvs[0].y=y pvs.push({x:x,y:y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); break; case 2: pvs[1].x=x pvs.push({x:x,y:y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); break; case 3: pvs[2].y=y x = pvs[0].x pvs.push({x:x-weight,y:y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); pvs.push({x:x,y:y+weight,select:1,clip:1,stroke:1,oppoint:2,op2close:1,fill:1,end:1}); break; } }`, `(i, sample, pvs, model, ovs){ if(i==3){ pvs.push({x:30,y:sample.y,stroke:1,type:1,begin:1}); pvs.push({x:30,y:sample.y+20,stroke:1,type:1}); pvs.push({x:50,y:sample.y+20,stroke:1,type:1}); pvs.push({x:50,y:sample.y+20,end:1}); } }`, //文本 `(i, sample, pvs, model, ovs){ if(sample.textInput){ let weight = 20 let x=sample.x,y=sample.y switch(i){ case 0: pvs.push({begin:1,x:x,y:y,text:1}); break; case 1: pvs[0].y=y pvs.push({x:x,y:y,text:1}); break; case 2: pvs[1].x=x pvs.push({x:x,y:y,text:1}); break; case 3: pvs[2].y=y+weight x = pvs[0].x pvs.push({x:x,y:pvs[2].y,text:1}); break; } } }` ] } } }; const __vite_glob_0_86$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: comment }, Symbol.toStringTag, { value: "Module" })); const comment1 = { "id": "103008", "name": "ddei.control.comment", "code": "comment", "desc": "跟随内容变化大小的注释文本", "from": "100000", "define": { borderType: 0, border: { type: 0, selected: { type: 1, dash: [5, 5], width: 1 } }, fill: { type: 0 }, text: "ddei.control.comment", sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0,op2close = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: op2close = 1 pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,op2close:op2close,align:1,stroke:1,fill:1}); }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({type:0,x:50,y:0,oppoint:1}); pvs.push({type:0,x:0,y:50,oppoint:1}); pvs.push({type:0,x:-50,y:0,oppoint:1}); pvs.push({type:0,x:0,y:-50,oppoint:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ if(model.exPvs){ let left for(let n in model.exPvs){ let ep = model.exPvs[n] if(ep.sita == 180){ left = 1 break } } if(left){ pvs.push({begin:1,x:-45,y:-50}); pvs.push({x:-50,y:-50,stroke:1,forceStroke:1}); pvs.push({x:-50,y:50,stroke:1,forceStroke:1}); pvs.push({x:-45,y:50,stroke:1,forceStroke:1}); pvs.push({end:1,x:-45,y:-50}); } } } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ if(model.exPvs){ let right for(let n in model.exPvs){ let ep = model.exPvs[n] if(ep.sita == 0){ right = 1 break; } } if(right){ pvs.push({begin:1,x:45,y:-50}); pvs.push({x:50,y:-50,stroke:1,forceStroke:1}); pvs.push({x:50,y:50,stroke:1,forceStroke:1}); pvs.push({x:45,y:50,stroke:1,forceStroke:1}); pvs.push({end:1,x:45,y:50}); } } } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ if(model.exPvs){ let top for(let n in model.exPvs){ let ep = model.exPvs[n] if(ep.sita == -90){ top = 1 break; } } if(top){ pvs.push({begin:1,x:-50,y:-45}); pvs.push({x:-50,y:-50,stroke:1,forceStroke:1}); pvs.push({x:50,y:-50,stroke:1,forceStroke:1}); pvs.push({x:50,y:-45,stroke:1,forceStroke:1}); pvs.push({end:1,x:50,y:-45}); } } } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ if(model.exPvs){ let bottom for(let n in model.exPvs){ let ep = model.exPvs[n] if(ep.sita == 90){ bottom = 1 break; } } if(bottom){ pvs.push({begin:1,x:-50,y:45}); pvs.push({x:-50,y:50,stroke:1,forceStroke:1}); pvs.push({x:50,y:50,stroke:1,forceStroke:1}); pvs.push({x:50,y:45,stroke:1,forceStroke:1}); pvs.push({end:1,x:50,y:45}); } } } }`, //文本区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); }` ] }, ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.paddingWeight", "textStyle.lockWidth", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] }, { name: "ddei.border", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] } ] }, { name: "ddei.data", icon: "icon-edit-properies", subGroups: [ { name: "ddei.basic", attrs: ["code", "text", "fmt.type", "fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb", "fmt.dtype", "fmt.format"] } ] } ], attrs: [ { "code": "textStyle.paddingWeight", "name": "ddei.property.paddingWeight", "desc": "超范围自动扩展的情况下保留的宽度", "controlType": "text", "dataType": "integer", "defaultValue": 10, "hiddenTitle": true, "display": "column", "type": [1, 2] }, { "code": "textStyle.scale", "name": "ddei.property.outSize", "desc": "文本的超出范围后的策略", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.hidden", "value": "0" }, { "text": "ddei.property.ds.ellipsis", "value": "2" }, { "text": "ddei.property.ds.narrow", "value": "1" }, { "text": "ddei.property.ds.ext", "value": "3" }], "defaultValue": 3, "cascadeDisplay": { 3: { show: ["textStyle.lockWidth", "textStyle.paddingWeight"], hidden: [] }, default: { show: ["textStyle.lockWidth", "textStyle.paddingWeight"] }, empty: { hidden: ["textStyle.lockWidth", "textStyle.paddingWeight"] }, notempty: { hidden: ["textStyle.lockWidth", "textStyle.paddingWeight"] } } } ] } } }; const __vite_glob_0_87$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: comment1 }, Symbol.toStringTag, { value: "Module" })); const database = { "id": "103010", "name": "ddei.database", "code": "database", "desc": "数据库图标", "from": "100500", "define": { width: 100, height: 60, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 12; pvs.push({begin:1,x:50,y:50+dn,select:1,clip:1}) pvs.push({x:-50,y:50+dn,select:1,clip:1}) pvs.push({x:-50,y:-50-dn,select:1,clip:1}) pvs.push({end:1,x:50,y:-50-dn,select:1,clip:1}) } }`, //操作点 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 12; pvs.push({begin:1,x:50,y:0,oppoint:1}) pvs.push({x:0,y:50+dn,oppoint:1}) pvs.push({x:-50,y:0,oppoint:1}) pvs.push({end:1,x:0,y:-50-dn,oppoint:1}) } }`, //绘制线段区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) let rad180 = 0 switch(i){ case 0: pvs.push({begin:1,x:x,y:y,fill:1,r:er,rad:0}); break; case 1: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({r:er,dy:50,rad:rad180,stroke:1,type:4,direct:1}); pvs.push({r:sample.r}); pvs.push({r:10}); pvs.push({x:pvs[0].x,y:pvs[0].y}); pvs.push({x:x,y:y}); break; case 2: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({x:x,y:y,stroke:1,rad:rad180,r:er}); break; case 3: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({r:er,dy:-50,rad:0,stroke:1,type:4,direct:1}); pvs.push({r:sample.r}); pvs.push({r:10}); pvs.push({x:pvs[0].x,y:pvs[0].y,stroke:1}); pvs.push({end:1,x:pvs[0].x,y:pvs[0].y}); break; } }`, // 上方的下半椭圆 `(i, sample, pvs, model, ovs){ if(i == 2 || i ==3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) switch(i){ case 2: let rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({begin:1,x:x,y:y,r:er,rad:rad180}); break; case 3: pvs.push({r:er,dy:-50,rad:0,stroke:1,type:4,direct:0}); pvs.push({r:sample.r}); pvs.push({r:10}); pvs.push({end:1,x:x,y:y}); break; } } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 10; pvs.push({begin:1,x:50,y:50,text:1}) pvs.push({x:-50,y:50,text:1}) pvs.push({x:-50,y:-50+dn,text:1}) pvs.push({end:1,x:50,y:-50+dn,text:1}) } }` ] } } }; const __vite_glob_0_88$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: database }, Symbol.toStringTag, { value: "Module" })); const database1 = { "id": "103011", "name": "ddei.database", "code": "database", "desc": "数据库图标", "from": "100500", "define": { width: 100, height: 60, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 12; pvs.push({begin:1,x:50,y:50+dn,select:1,clip:1}) pvs.push({x:-50,y:50+dn,select:1,clip:1}) pvs.push({x:-50,y:-50-dn,select:1,clip:1}) pvs.push({end:1,x:50,y:-50-dn,select:1,clip:1}) } }`, //操作点 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 12; pvs.push({begin:1,x:50,y:0,oppoint:1}) pvs.push({x:0,y:50+dn,oppoint:1}) pvs.push({x:-50,y:0,oppoint:1}) pvs.push({end:1,x:0,y:-50-dn,oppoint:1}) } }`, //绘制线段区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) let rad180 = 0 switch(i){ case 0: pvs.push({begin:1,x:x,y:y,fill:1,r:er,rad:0}); break; case 1: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({r:er,dy:50,rad:rad180,stroke:1,type:4,direct:1}); pvs.push({r:sample.r}); pvs.push({r:10}); pvs.push({x:pvs[0].x,y:pvs[0].y}); pvs.push({x:x,y:y}); break; case 2: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({x:x,y:y,stroke:1,rad:rad180,r:er}); break; case 3: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({r:er,dy:-50,rad:0,stroke:1,type:4,direct:1}); pvs.push({r:sample.r}); pvs.push({r:10}); pvs.push({x:pvs[0].x,y:pvs[0].y,stroke:1}); pvs.push({end:1,x:pvs[0].x,y:pvs[0].y}); break; } }`, // 上方的下半椭圆 `(i, sample, pvs, model, ovs){ if(i == 2 || i ==3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) switch(i){ case 2: let rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({begin:1,x:x,y:y,r:er,rad:rad180}); break; case 3: pvs.push({r:er,dy:-50,rad:0,stroke:1,type:4,direct:0}); pvs.push({r:sample.r}); pvs.push({r:10}); pvs.push({end:1,x:x,y:y}); break; } } }`, // 上方的下半椭圆 `(i, sample, pvs, model, ovs){ if(i == 2 || i ==3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) switch(i){ case 2: let rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({begin:1,x:x,y:y,r:er,rad:rad180}); break; case 3: pvs.push({r:er,dy:-40,rad:0,stroke:1,type:4,direct:0}); pvs.push({r:sample.r}); pvs.push({r:10}); pvs.push({end:1,x:x,y:y}); break; } } }`, // 上方的下半椭圆 `(i, sample, pvs, model, ovs){ if(i == 2 || i ==3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) switch(i){ case 2: let rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({begin:1,x:x,y:y,r:er,rad:rad180}); break; case 3: pvs.push({r:er,dy:-30,rad:0,stroke:1,type:4,direct:0}); pvs.push({r:sample.r}); pvs.push({r:10}); pvs.push({end:1,x:x,y:y}); break; } } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 10; pvs.push({begin:1,x:50,y:50,text:1}) pvs.push({x:-50,y:50,text:1}) pvs.push({x:-50,y:-30+dn,text:1}) pvs.push({end:1,x:50,y:-30+dn,text:1}) } }` ] } } }; const __vite_glob_0_89$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: database1 }, Symbol.toStringTag, { value: "Module" })); const database2 = { "id": "103012", "name": "ddei.database", "code": "database", "desc": "数据库图标", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 12; pvs.push({begin:1,x:50,y:50,select:1,clip:1}) pvs.push({x:-50,y:50,select:1,clip:1}) pvs.push({x:-50,y:-50-dn,select:1,clip:1}) pvs.push({end:1,x:50,y:-50-dn,select:1,clip:1}) } }`, //操作点 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 12; pvs.push({begin:1,x:50,y:0,oppoint:1}) pvs.push({x:0,y:56,oppoint:1}) pvs.push({x:-50,y:0,oppoint:1}) pvs.push({end:1,x:0,y:-50-dn,oppoint:1}) } }`, //绘制线段区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) let rad180 = 0 switch(i){ case 0: pvs.push({begin:1,x:x,y:y,fill:1,r:er,rad:0,strokeClear:1}); break; case 1: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({r:er,dy:35,rad:rad180,stroke:1,type:4,direct:1}); pvs.push({r:sample.r}); pvs.push({r:20}); pvs.push({x:pvs[0].x,y:pvs[0].y}); pvs.push({x:x,y:y}); break; case 2: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({x:x,y:y,stroke:1,rad:rad180,r:er}); break; case 3: rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({r:er,dy:-40,rad:0,stroke:1,type:4,direct:1}); pvs.push({r:sample.r}); pvs.push({r:25}); pvs.push({end:1,x:pvs[0].x,y:pvs[0].y,stroke:1}); break; } }`, // 上方的下半椭圆 `(i, sample, pvs, model, ovs){ if(i == 2 || i ==3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) switch(i){ case 2: let rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({begin:1,x:x,y:y,r:er,rad:rad180,strokeClear:1}); break; case 3: pvs.push({r:er,dy:-40,rad:0,stroke:1,type:4,direct:0}); pvs.push({r:sample.r}); pvs.push({r:25}); pvs.push({end:1,x:x,y:y}); break; } } }`, // 上方的下半椭圆 `(i, sample, pvs, model, ovs){ if(i == 2 || i ==3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) switch(i){ case 2: let rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({begin:1,x:x,y:y,r:er,rad:rad180,strokeClear:1}); break; case 3: pvs.push({r:er,dy:-12,rad:0,stroke:1,type:4,direct:0}); pvs.push({r:sample.r}); pvs.push({r:20}); pvs.push({end:1,x:x,y:y}); break; } } }`, // 上方的下半椭圆 `(i, sample, pvs, model, ovs){ if(i == 2 || i ==3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) switch(i){ case 2: let rad180 = 180 * DDeiConfig.ROTATE_UNIT pvs.push({begin:1,x:x,y:y,r:er,rad:rad180,strokeClear:1}); break; case 3: pvs.push({r:er,dy:12,rad:0,stroke:1,type:4,direct:0}); pvs.push({r:sample.r}); pvs.push({r:20}); pvs.push({end:1,x:x,y:y}); break; } } }` ] }, border: { width: 10 }, fill: { color: "#017fff" } } }; const __vite_glob_0_90$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: database2 }, Symbol.toStringTag, { value: "Module" })); const database3 = { "id": "103013", "name": "ddei.database", "code": "database", "desc": "数据库图标", "from": "100500", "define": { width: 110, height: 70, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 12; pvs.push({begin:1,x:50+dn,y:50,select:1,clip:1}) pvs.push({x:-50-dn,y:50,select:1,clip:1}) pvs.push({x:-50-dn,y:-50,select:1,clip:1}) pvs.push({end:1,x:50+dn,y:-50,select:1,clip:1}) } }`, //操作点 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 12; pvs.push({begin:1,x:50+dn,y:0,oppoint:1}) pvs.push({x:0,y:50,oppoint:1}) pvs.push({x:-50-dn,y:0,oppoint:1}) pvs.push({end:1,x:0,y:-50,oppoint:1}) } }`, //绘制线段区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) let rad90 = 90 * DDeiConfig.ROTATE_UNIT switch(i){ case 0: pvs.push({begin:1,x:x,y:y,fill:1,stroke:1,r:er,rad:0}); break; case 1: pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:rad90}); break; case 2: pvs.push({r:er,dx:-50,rad:-rad90,stroke:1,type:4,direct:1}); pvs.push({r:10}); pvs.push({r:sample.r}); break; case 3: pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:-rad90}); pvs.push({r:er,dx:50,rad:rad90,stroke:1,type:4,direct:1,end:1}); pvs.push({r:10}); pvs.push({r:sample.r}); break; } }`, // 右方左半椭圆 `(i, sample, pvs, model, ovs){ if(i == 3){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT let x = er * Math.cos(rad) let y = er * Math.sin(rad) let rad90 = 90 * DDeiConfig.ROTATE_UNIT pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:-rad90}); pvs.push({r:er,dx:50,rad:rad90,stroke:1,type:4,direct:0}); pvs.push({r:10}); pvs.push({r:sample.r}); pvs.push({end:1,x:50,y:-50}); } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let dn = 10; pvs.push({begin:1,x:50-dn,y:50,text:1}) pvs.push({x:-50,y:50,text:1}) pvs.push({x:-50,y:-50,text:1}) pvs.push({end:1,x:50-dn,y:-50,text:1}) } }` ] } } }; const __vite_glob_0_91$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: database3 }, Symbol.toStringTag, { value: "Module" })); const document$1 = { "id": "103003", "name": "ddei.control.document", "code": "doc", "desc": "文档", "from": "100500", "define": { width: 100, height: 60, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: sample.y += 15 pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x break; case 3: pvs[2].y=sample.y sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1}); }`, `(i, sample, pvs, model, ovs){ if(i == 0){ //从左下,左上,右上,右下,曲线:左下 pvs.push({begin:1,x:-sample.x,y:sample.x,fill:1,clip:1}); pvs.push({x:-sample.x,y:-sample.x,stroke:1,oppoint:2}); pvs.push({x:sample.x,y:-sample.x,stroke:1,oppoint:2}); pvs.push({x:sample.x,y:sample.x,stroke:1}); //贝塞尔曲线,至少需要四个点, pvs.push({x:50,y:50,stroke:1,type:5}); pvs.push({x:33,y:30}); pvs.push({x:16,y:30}); pvs.push({x:0,y:50}); pvs.push({x:0,y:50,type:5,stroke:1,stroke:1,end:1}); pvs.push({x:-17,y:70}); pvs.push({x:-34,y:70}); pvs.push({x:-50,y:50}); pvs.push({x:-sample.x,y:0,type:0,oppoint:1}); pvs.push({x:sample.x,y:0,type:0,oppoint:1}); pvs.push({x:0,y:50,type:0,oppoint:1}); } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ //从左下,左上,右上,右下,曲线:左下 pvs.push({begin:1,x:-sample.x,y:sample.x-15,text:1}); pvs.push({x:-sample.x,y:-sample.x,text:1}); pvs.push({x:sample.x,y:-sample.x,text:1}); pvs.push({x:sample.x,y:sample.x-15,end:1,text:1}); } }` ] }, iconPos: { dh: 5 } } }; const __vite_glob_0_92$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: document$1 }, Symbol.toStringTag, { value: "Module" })); const human = { "id": "103001", "name": "ddei.control.human", "code": "human", "desc": "人形图标", "from": "100500", "define": { width: 50, height: 100, //2为极坐标,缺省点为原点 poly: 2, cIndex: 1, //采样信息 sample: { //依附图形的初始化配置,如果产生依附图形,则会在配置的位置生成 depPos: { type: 8 }, depProps: { "8": "text" //映射属性 }, //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let x = sample.x let y = sample.y switch(i){ case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x break; } pvs.push({begin:i==0,end:i==3,x:x,y:y,select:1,clip:1}); }`, `(i, sample, pvs, model, ovs){ if(i == 0){ let x = 0 let y = -20 pvs.push({begin:1,x:x,y:y,stroke:1}); y = 10 pvs.push({x:x,y:y,stroke:1}); y += 10 let y1= y let x1 = x pvs.push({x:x,y:y,stroke:1}); let er = sample.r x = sample.x y = sample.y let y2 = er * Math.sin(90 * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y2,oppoint:1,stroke:1}); pvs.push({x:x1,y:y1,type:3}); let x3 = er * Math.cos(180 * DDeiConfig.ROTATE_UNIT) let y3 = er * Math.sin(180 * DDeiConfig.ROTATE_UNIT) pvs.push({x:x3,y:y2,oppoint:1,stroke:1}); pvs.push({x:x1,y:y1,type:3}); pvs.push({x:0,y:-10,type:3}); pvs.push({x:x3,y:10,oppoint:1,stroke:1}); pvs.push({x:0,y:-10,type:3}); pvs.push({x:x,y:10,oppoint:1,stroke:1}); pvs.push({x:0,y:-10,type:3}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:0,y:-50,oppoint:1,type:0}); } }` ] }, //组合控件 composes: [ { id: "100103", cIndex: 2, initCPV: { x: 0, y: -35 }, width: 30, height: 30, attrLinks: [ { code: "border", mapping: ["*"] }, { code: "fill", mapping: ["*"] } ] } ], ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] } ] }, { name: "ddei.data", icon: "icon-edit-properies", subGroups: [ { name: "ddei.basic", attrs: ["code", "text"] } ] } ] } } }; const __vite_glob_0_93$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: human }, Symbol.toStringTag, { value: "Module" })); const human1 = { "id": "103002", "name": "ddei.control.human", "code": "human", "desc": "人形图标", "from": "100500", "define": { width: 60, height: 85, //2为极坐标,缺省点为原点 poly: 2, cIndex: 1, //采样信息 sample: { //依附图形的初始化配置,如果产生依附图形,则会在配置的位置生成 depPos: { type: 8 }, //一圈 depProps: { "8": "text" //映射属性 }, //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let x = sample.x let y = sample.y switch(i){ case 1: y = y-8 pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: y = y-8 pvs[2].y=y x = pvs[0].x break; } pvs.push({begin:i==0,end:i==3,x:x,y:y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1}); }` ] }, iconPos: { dy: 20 }, depProps: { "8": "text" //映射属性 }, //组合控件 composes: [ { id: "100103", cIndex: 2, initCPV: { x: 0, y: -35 }, width: 35, height: 35, attrLinks: [ { code: "border", mapping: ["*"] }, { code: "fill", mapping: ["*"] } ] }, { id: "100008", cIndex: 1, width: 60, height: 50, attrLinks: [ { code: "border", mapping: ["*"] }, { code: "fill", mapping: ["*"] } ] } ], border: { round: 15 }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] } ] }, { name: "ddei.data", icon: "icon-edit-properies", subGroups: [ { name: "ddei.basic", attrs: ["code", "text"] } ] } ] } } }; const __vite_glob_0_94$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: human1 }, Symbol.toStringTag, { value: "Module" })); const human2 = { "id": "103006", "name": "ddei.control.human", "code": "human", "desc": "人形图标", "from": "100500", "define": { width: 50, height: 100, //2为极坐标,缺省点为原点 poly: 2, cIndex: 1, fill: { type: 0 }, //采样信息 sample: { //依附图形的初始化配置,如果产生依附图形,则会在配置的位置生成 depPos: { type: 8 }, depProps: { "8": "text" //映射属性 }, //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let x = sample.x let y = sample.y switch(i){ case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x break; } pvs.push({begin:i==0,end:i==3,x:x,y:y,select:1,clip:1}); }`, `(i, sample, pvs, model, ovs){ if(i == 0){ let x = 0 let y = -20 pvs.push({begin:1,x:x,y:y,stroke:1}); y = 10 pvs.push({x:x,y:y,stroke:1}); y += 10 let y1= y let x1 = x pvs.push({x:x,y:y,stroke:1}); let er = sample.r x = sample.x y = sample.y let y2 = er * Math.sin(90 * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y2,oppoint:1,stroke:1}); pvs.push({x:x1,y:y1,type:3}); let x3 = er * Math.cos(180 * DDeiConfig.ROTATE_UNIT) let y3 = er * Math.sin(180 * DDeiConfig.ROTATE_UNIT) pvs.push({x:x3,y:y2,oppoint:1,stroke:1}); pvs.push({x:x1,y:y1,type:3}); pvs.push({x:0,y:-10,type:3}); pvs.push({x:x3,y:-10,oppoint:1,stroke:1}); pvs.push({x:0,y:-10,type:3}); pvs.push({x:x,y:-10,oppoint:1,stroke:1}); pvs.push({x:0,y:-10,type:3}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:0,y:-50,oppoint:1,type:0}); } }` ] }, //组合控件 composes: [ { id: "100103", cIndex: 2, initCPV: { x: 0, y: -35 }, width: 30, height: 30, attrLinks: [ { code: "border", mapping: ["*"] }, { code: "fill", mapping: ["*"] } ] } ], ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] } ] }, { name: "ddei.data", icon: "icon-edit-properies", subGroups: [ { name: "ddei.basic", attrs: ["code", "text"] } ] } ] } } }; const __vite_glob_0_95$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: human2 }, Symbol.toStringTag, { value: "Module" })); const papertape = { "id": "103004", "name": "ddei.control.ptap", "code": "ptap", "desc": "纸带", "from": "100500", "define": { width: 100, height: 60, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 switch(i){ case 0: start = 1 break; case 1: sample.y += 15 pvs[0].y=sample.y break; case 2: pvs[1].x=sample.x sample.y -= 15 break; case 3: pvs[2].y=sample.y sample.y -= 15 sample.x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1}); }`, `(i, sample, pvs, model, ovs){ if(i == 0){ //从左下,左上,曲线:右上,右下,曲线:左下 pvs.push({begin:1,x:-sample.x,y:sample.x,fill:1}); pvs.push({x:-sample.x,y:-sample.x,stroke:1}); //贝塞尔曲线,至少需要四个点, pvs.push({x:-50,y:-50,stroke:1,type:5}); pvs.push({x:-33,y:-30}); pvs.push({x:-16,y:-30}); pvs.push({x:0,y:-50}); pvs.push({x:0,y:-50,type:5,stroke:1,stroke:1}); pvs.push({x:17,y:-70}); pvs.push({x:34,y:-70}); pvs.push({x:50,y:-50}); pvs.push({x:sample.x,y:sample.x,stroke:1}); //贝塞尔曲线,至少需要四个点, pvs.push({x:50,y:50,stroke:1,type:5}); pvs.push({x:33,y:30}); pvs.push({x:16,y:30}); pvs.push({x:0,y:50}); pvs.push({x:0,y:50,type:5,stroke:1,stroke:1,end:1}); pvs.push({x:-17,y:70}); pvs.push({x:-34,y:70}); pvs.push({x:-50,y:50}); } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ //从左下,左上,右上,右下,曲线:左下 pvs.push({begin:1,x:-sample.x,y:sample.x-15,text:1}); pvs.push({x:-sample.x,y:-sample.x+15,text:1}); pvs.push({x:sample.x,y:-sample.x+15,text:1}); pvs.push({x:sample.x,y:sample.x-15,end:1,text:1}); } }`, //操作点 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:-sample.x,y:0,type:0,oppoint:1}); pvs.push({x:sample.x,y:0,type:0,oppoint:1}); pvs.push({x:0,y:50,type:0,oppoint:1}); pvs.push({x:0,y:-50,type:0,oppoint:1}); } }` ] } } }; const __vite_glob_0_96$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: papertape }, Symbol.toStringTag, { value: "Module" })); const layer = { "id": "DDeiLayer", "name": "ddei.layerName", "code": "layer", "desc": "整体图层的属性", "type": "DDeiLayer", /** * 定义组件属性 * 样式属性会影响图形的显示,修改样式属性也会刷新图形 * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 * 事件属性一般用来作为扩展用 * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) * 特殊属性: * code属性编码在统一个组中,code唯一 * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row */ attrs: [ { "code": "bg.type", "name": "ddei.property.background", "desc": "背景的类型", "controlType": "radio", "dataType": "string", "dataSource": [{ "text": "ddei.property.ds.none", "value": -1 }, { "text": "ddei.property.ds.color", "value": 1 }, { "text": "ddei.property.ds.image", "value": 2 }], "defaultValue": 1, "type": 1, "cascadeDisplay": { 1: { show: ["bg.color", "bg.opacity"], hidden: ["bg.image", "bg.imageMode", "bg.imageScale", "bg.imageAlign"] }, 2: { show: ["bg.image", "bg.imageMode", "bg.imageScale", "bg.imageAlign"], hidden: ["bg.color"] }, 0: { hidden: ["bg.opacity", "bg.color", "bg.image", "bg.imageMode", "bg.imageScale", "bg.imageAlign"] }, default: { show: ["bg.color", "bg.opacity"], hidden: ["bg.image", "bg.imageMode", "bg.imageScale", "bg.imageAlign"] } }, "hiddenTitle": true, "display": "column" }, { "code": "bg.color", "name": "ddei.property.backgroundColor", "desc": "背景的颜色", "controlType": "color-combo", "dataType": "string", "defaultValue": "", "type": 1 }, { "code": "bg.image", "name": "ddei.property.backgroundImage", "desc": "背景的图片", "controlType": "image", "dataType": "string", "defaultValue": "", "type": 1 }, { "code": "bg.opacity", "name": "ddei.property.opacity", "desc": "背景的透明度", "controlType": "range", "min": 0, "max": 1, "step": 0.01, "dataType": "float", "defaultValue": 1, "display": "column", "type": 1 }, { "code": "bg.imageMode", "name": "ddei.property.bgImageMode", "desc": "背景的图片的模式", "controlType": "radio", "dataType": "integer", "dataSource": [{ "text": "ddei.property.ds.original", "value": 0 }, { "text": "ddei.property.ds.scale", "value": 1 }, { "text": "ddei.property.ds.fill", "value": 2 }], "cascadeDisplay": { 1: { show: ["bg.imageScale", "bg.imageAlign"] }, 2: { hidden: ["bg.imageScale", "bg.imageAlign"] }, empty: { hidden: ["bg.imageScale"], show: ["bg.imageAlign"] } }, "defaultValue": 2, "type": 1 }, { "code": "bg.imageScale", "name": "ddei.property.bgImageScale", "desc": "背景的图片的缩放比例", "controlType": "range", "min": 0.01, "max": 10, "step": 0.01, "dataType": "float", "defaultValue": 1, "type": 1 }, { "code": "bg.imageAlign", "name": "ddei.property.bgImagePosition", "desc": "背景的图片布局方位", "controlType": "align-type", "dataType": "string", "type": 1 } ], /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.background", icon: "icon-background", subGroups: [ { name: "ddei.background", attrs: ["bg.type", "bg.color", "bg.image", "bg.opacity", "bg.imageMode", "bg.imageScale", "bg.imageAlign"] } ] } ] }; const __vite_glob_0_97$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: layer }, Symbol.toStringTag, { value: "Module" })); const angle = { "id": "104001", "name": "ddei.control.angle", "code": "angle", "desc": "表示一个角度", "from": "100500", "define": { width: 200, height: 200, //2为极坐标,缺省点为原点 poly: 2, font: { size: 10 }, //采样信息 sample: { eqrat: true, //一圈采样次数 loop: 1, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //选择区域 `(i, sample, pvs, model, ovs){ let sita = Math.round(ovs[1].sita) let hdelta = (ovs[2].x-ovs[2].ovi.x) pvs.push({begin:1,x:hdelta,y:hdelta,select:1,clip:1}); pvs.push({x:-hdelta,y:hdelta,select:1,clip:1}); pvs.push({x:-hdelta,y:-hdelta,select:1,clip:1}); pvs.push({x:hdelta,y:-hdelta,select:1,clip:1}); }`, //下方直线 `(i, sample, pvs, model, ovs){ pvs.push({begin:1,x:0,y:0,stroke:1,oppoint:1,type:1}); pvs.push({end:1,x:(ovs[2].x-ovs[2].ovi.x),y:0,stroke:1,oppoint:1,type:1}); }`, //上方直线 `(i, sample, pvs, model, ovs){ let rad = (ovs[1].sita) * DDeiConfig.ROTATE_UNIT let hdelta = (ovs[2].x-ovs[2].ovi.x) let x = hdelta * Math.cos(rad) let y = hdelta * Math.sin(rad) pvs.push({begin:1,x:0,y:0,stroke:1,type:1}); pvs.push({end:1,x:x,y:y,stroke:1,oppoint:1,type:1}); }`, //弧线/直角线 `(i, sample, pvs, model, ovs){ let sita = ovs[1].sita if(Math.round(sita) == -90){ let ar = (ovs[0].x-ovs[0].ovi.x) pvs.push({begin:1,x:0,y:-ar,stroke:1}); pvs.push({x:ar,y:-ar,stroke:1}); pvs.push({x:ar,y:0,stroke:1}); pvs.push({end:1,x:0,y:0,stroke:1}); }else{ let rad = sita * DDeiConfig.ROTATE_UNIT let ar = (ovs[0].x-ovs[0].ovi.x) let x = ar * Math.cos(rad) let y = ar * Math.sin(rad) pvs.push({begin:1,x:ar,y:0,r:ar,rad:0,stroke:1}); pvs.push({end:1,x:x,y:y,r:ar,rad:rad,stroke:1}); } }`, //文本区域 `(i, sample, pvs, model, ovs){ let sita = ovs[1].sita let disSita //显示半径 let ar = (ovs[0].x-ovs[0].ovi.x)+7 let dtSita = sita / 2 let x = ar * Math.cos(dtSita * DDeiConfig.ROTATE_UNIT) let y = ar * Math.sin(dtSita * DDeiConfig.ROTATE_UNIT) if(sita<0 && sita >= -180){ disSita = (-sita.toFixed(1))+"" }else{ x = -x y = -y disSita = (180+(180-sita)).toFixed(1)+"" } let size = 10; pvs.push({begin:1,x:x+size,y:y+size/2,text:1}); pvs.push({x:x-size,y:y+size/2,text:1}); pvs.push({x:x-size,y:y-size/2,text:1}); pvs.push({end:1,x:x+size,y:y-size/2,text:1}); model.text = disSita model.render?.setCachedValue("text",disSita) }` ] }, iconPos: { dx: -50, dy: 50 }, //操作点定义 ovs: [ //控制角度显示位置 { x: 25, y: 0, ix: 0, iy: 0, //约束,控制点的移动路径和位置 constraint: { type: 2, //矩形范围 x0: 0, x1: 50, y0: 0, y1: 0 } }, //控制角度 { //初始化的角度 isita: 30, //约束,控制点的移动路径和位置 constraint: { type: 3, //圆形范围 r: 25 } }, { x: 50, y: 0, ix: 0, iy: 0, //约束,控制点的移动路径和位置 constraint: { type: 2, //矩形范围 x0: 5, x1: 100, y0: 0, y1: 0 } } ], ext: { /** * 定义分组,用于属性编辑 */ groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_98$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: angle }, Symbol.toStringTag, { value: "Module" })); const basicFlowShapes = { "id": "102", "name": "ddei.control.groups.flow", "code": "basic-flow-shapes", "desc": "基础的流程形状,包含了开始、结束、任务、分支等基础形状", "orderNo": 2, "subject": "basic", //当前分组下所有控件 "controls": [ { "id": "102001", "orderNo": 1 }, { "id": "102002", "orderNo": 2 }, { "id": "102010", "orderNo": 10 }, { "id": "102011", "orderNo": 11 }, { "id": "102012", "orderNo": 12 }, { "id": "102020", "orderNo": 20 }, { "id": "102021", "orderNo": 21 }, { "id": "102040", "orderNo": 25 }, { "id": "102041", "orderNo": 26 }, { "id": "103003", "orderNo": 27 }, { "id": "102030", "orderNo": 30 }, { "id": "102031", "orderNo": 31 }, { "id": "102032", "orderNo": 32 }, { "id": "102033", "orderNo": 33 }, { "id": "103013", "name": "ddei.control.direct-data", "orderNo": 34 }, { "id": "102090", "orderNo": 50 }, { "id": "102091", "orderNo": 51 }, { "id": "102092", "orderNo": 52 }, { "id": "103010", "orderNo": 60 }, { "id": "103001", "orderNo": 71 }, { "id": "103002", "orderNo": 72 }, { "id": "102050", "orderNo": 73 }, { "id": "102052", "orderNo": 74 }, { "id": "102057", "orderNo": 74 }, { "id": "102053", "orderNo": 75 }, { "id": "102054", "orderNo": 76 }, { "id": "103004", "orderNo": 77 }, { "id": "102055", "orderNo": 78 }, { "id": "102056", "orderNo": 79 }, { "id": "102051", "orderNo": 83 }, { "id": "102058", "orderNo": 84 } ] }; const __vite_glob_1_0$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: basicFlowShapes }, Symbol.toStringTag, { value: "Module" })); const basicShapes = { "id": "101", "name": "ddei.control.groups.basic", "code": "basic-shapes", "desc": "基础的绘图形状,包含了正方形、长方形、三角形、圆形、线条等基础形状", "orderNo": 1, "subject": "basic", //当前分组下所有控件 "controls": [ { "id": "100200", "orderNo": 0 }, { "id": "100001", "orderNo": 1 }, { "id": "100002", "orderNo": 2 }, { "id": "100003", "orderNo": 3 }, { "id": "100004", "orderNo": 4 }, { "id": "100005", "orderNo": 5 }, { "id": "100006", "text": "", "orderNo": 6 }, { "id": "100007", "text": "", "orderNo": 7 }, { "id": "100010", "text": "", "orderNo": 10 }, { "id": "100011", "text": "", "orderNo": 11 }, { "id": "100012", "text": "", "orderNo": 12 }, { "id": "100013", "text": "", "orderNo": 13 }, { "id": "100014", "text": "", "orderNo": 14 }, { "id": "100015", "text": "", "orderNo": 15 }, { "id": "100020", "orderNo": 20 }, { "id": "100021", "text": "", "orderNo": 21 }, { "id": "100030", "text": "", "orderNo": 30 }, { "id": "100031", "text": "", "orderNo": 31 }, { "id": "100040", "orderNo": 40 }, { "id": "100041", "text": "", "orderNo": 41 }, { "id": "100050", "text": "", "orderNo": 50 }, { "id": "100051", "text": "", "orderNo": 51 }, { "id": "100060", "text": "", "orderNo": 60 }, { "id": "100061", "text": "", "orderNo": 61 }, { "id": "100070", "text": "", "orderNo": 70 }, { "id": "100076", "text": "", "orderNo": 75 }, { "id": "100075", "text": "", "orderNo": 76 }, { "id": "100077", "text": "", "orderNo": 77 }, { "id": "104001", "text": "", "orderNo": 80 }, { "id": "104105", "text": "", "orderNo": 91 }, { "id": "104115", "text": "", "orderNo": 92 }, { "id": "104125", "text": "", "orderNo": 93 }, { "id": "100110", "text": "", "orderNo": 94 }, { "id": "103005", "orderNo": 305 }, { "id": "103008", "orderNo": 308 } ] }; const __vite_glob_1_1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: basicShapes }, Symbol.toStringTag, { value: "Module" })); const databases = { "id": "201", "name": "ddei.database", "code": "databases", "desc": "包含了数据库的各种类型", "orderNo": 21, "subject": "basic", //当前分组下所有控件 "controls": [ { "id": "103010", "orderNo": 0 }, { "id": "103011", "orderNo": 1 }, { "id": "103012", "orderNo": 2 } ] }; const __vite_glob_1_2$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: databases }, Symbol.toStringTag, { value: "Module" })); const ToDefaultPropertys = [ "fill.type", "fill.color", "fill.image", "fill.opacity", "border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound", "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ]; const parseAttrsToGroup = function(control) { var _a3; if (control.attrs) { control.attrs.forEach((curAttr) => { let attrDefine = new DDeiEditorArrtibute(curAttr); if (ToDefaultPropertys.indexOf(curAttr.code) != -1) { let defValue = DDeiUtil.getDataByPathList(control.define, curAttr.code, curAttr.mapping); if (defValue || defValue == 0) { attrDefine.defaultValue = defValue; } } if (!control.attrDefineMap) { control.attrDefineMap = /* @__PURE__ */ new Map(); } control.attrDefineMap.set(curAttr.code, attrDefine); }); } (_a3 = control.groups) == null ? void 0 : _a3.forEach((group2) => { var _a4; (_a4 = group2.subGroups) == null ? void 0 : _a4.forEach((subGroup) => { var _a5; let attrs = []; (_a5 = subGroup.attrs) == null ? void 0 : _a5.forEach((attrCode) => { let attrDefine = control.attrDefineMap.get(attrCode); if (attrDefine) { attrDefine.topGroup = group2; attrDefine.modelCode = control.id; attrs.push(attrDefine); } }); subGroup.children = attrs; }); }); }; const loadControlByFrom = function(controlOriginDefinies, control) { if (control.from && !control.def) { let fromControl = controlOriginDefinies.get(control.from); if (fromControl.from) { loadControlByFrom(controlOriginDefinies, fromControl); } control.attrs = cloneDeep(fromControl.attrs); control.groups = cloneDeep(fromControl.groups); let fromMenus = cloneDeep(fromControl.menus); let fromDefine = cloneDeep(fromControl.define); let fromFilters = cloneDeep(fromControl.filters); if (fromDefine) { if (!control.define) { control.define = {}; } for (let i2 in fromDefine) { if (!(control.define[i2] || control.define[i2] == 0)) { control.define[i2] = fromDefine[i2]; } } } if (fromFilters) { if (!control.filters) { control.filters = fromFilters; } else { for (let k in fromFilters) { if (!control.filters[k]) { control.filters[k] = fromFilters[k]; } } } } loadControlDefineExt(control); loadControlDefineComposes(controlOriginDefinies, control); loadControlOthers(controlOriginDefinies, control); if (fromMenus) { if (!control.menus) { control.menus = {}; } for (let i2 in fromMenus) { if (!(control.menus[i2] || control.menus[i2] == 0)) { control.menus[i2] = fromMenus[i2]; } } } control.menus = fromMenus; control.attrDefineMap = /* @__PURE__ */ new Map(); if (!control.type && control.type != fromControl.type) { control.type = fromControl.type; } controlOriginDefinies.set(control.id, control); } if (control.viewer) { control.viewer = vue.markRaw(control.viewer); } parseAttrsToGroup(control); control.def = true; }; const loadControlOthers = function(controlOriginDefinies, control) { if (control.others) { control.others.forEach((other) => { let otherControlDefine = controlOriginDefinies.get(other.id); if (otherControlDefine.from) { loadControlByFrom(controlOriginDefinies, otherControlDefine); } other.code = otherControlDefine.code; let otherDefine = cloneDeep(otherControlDefine.define); if (otherDefine) { for (let i2 in otherDefine) { if (!other.define) { other.define = {}; } if (!(other.define[i2] || other.define[i2] == 0)) { other.define[i2] = otherDefine[i2]; } } } other.type = otherControlDefine.type; other.others = otherControlDefine.others; loadControlOthers(controlOriginDefinies, other); }); } }; const loadAndSortGroup = function(groups, controlOriginDefinies) { let groupOriginDefinies = []; groups.forEach((group2) => { if (group2.controls) { let cos = []; group2.controls.forEach((control) => { let id = control.id; let controlDefine = controlOriginDefinies.get(id); if (controlDefine) { let c = cloneDeep(controlDefine); for (let i2 in control) { if (control[i2] != void 0 && control[i2] != null) { c[i2] = control[i2]; } } cos.push(c); } }); cos.sort((a, b) => { return a.orderNo - b.orderNo; }); group2.controls = cos; } group2.display = true; groupOriginDefinies.push(group2); }); groupOriginDefinies.sort((a, b) => { return a.orderNo - b.orderNo; }); return groupOriginDefinies; }; const loadControlDefineComposes = function(controlOriginDefinies, control) { var _a3, _b2; if ((_a3 = control.define) == null ? void 0 : _a3.composes) { (_b2 = control.define) == null ? void 0 : _b2.composes.forEach((compose) => { let composeControlDefine = controlOriginDefinies.get(compose.id); if (composeControlDefine.from) { loadControlByFrom(controlOriginDefinies, composeControlDefine); } compose.attrs = cloneDeep(composeControlDefine.attrs); let composeDefine = cloneDeep(composeControlDefine.define); if (composeDefine) { for (let i2 in composeDefine) { if (!(compose[i2] || compose[i2] == 0)) { compose[i2] = composeDefine[i2]; } } } }); } }; const loadControlDefineExt = function(control) { var _a3, _b2, _c2, _d2; if ((_a3 = control.define) == null ? void 0 : _a3.ext) { for (let i2 in control.define.ext) { switch (i2) { case "composes": { let extComps = (_b2 = control.define) == null ? void 0 : _b2.ext.composes; let defineComps = control.define.composes; for (let j2 = 0; j2 < extComps.length; j2++) { let extComp = extComps[j2]; let defComp = defineComps[j2]; if (defComp && !extComp.type) { for (let k in extComp) { defComp[k] = extComp[k]; } } } break; } case "ovs": { let extOVS = (_c2 = control.define) == null ? void 0 : _c2.ext.ovs; let defineOVS = control.define.ovs; for (let j2 = 0; j2 < extOVS.length; j2++) { let extComp = extOVS[j2]; let defComp = defineOVS[j2]; if (defComp && extComp) { for (let k in extComp) { defComp[k] = extComp[k]; } } } break; } case "sample": { if (!((_d2 = control.define) == null ? void 0 : _d2.sample)) { control.define.sample = {}; } for (let j2 in control.define.ext.sample) { if (j2 != "rules") { control.define.sample[j2] = control.define.ext.sample[j2]; } else { if (!control.define.sample.rules) { control.define.sample.rules = []; } control.define.ext.sample[j2].forEach((rule) => { control.define.sample.rules.push(rule); }); } } break; } case "attrs": { let extAttrs = control.define.ext.attrs; extAttrs == null ? void 0 : extAttrs.forEach((extAttr) => { let append = true; for (let x2 = 0; x2 < control.attrs.length; x2++) { if (control.attrs[x2].code == extAttr.code) { control.attrs[x2] = extAttr; append = false; break; } } if (append) { control.attrs.push(extAttr); } }); break; } case "groups": { let extGroups = control.define.ext.groups; control.groups = extGroups; break; } default: { control.define[i2] = control.define.ext[i2]; break; } } } delete control.define.ext; } }; const control_ctx$1 = /* @__PURE__ */ Object.assign({ "./control/base/compose-container.ts": __vite_glob_0_0$5, "./control/base/container.ts": __vite_glob_0_1$2, "./control/base/line.ts": __vite_glob_0_2$1, "./control/base/polygon-container.ts": __vite_glob_0_3$1, "./control/base/polygon.ts": __vite_glob_0_4$1, "./control/base/table-cell.ts": __vite_glob_0_5$1, "./control/base/table.ts": __vite_glob_0_6$1, "./control/basic/circle-split.ts": __vite_glob_0_7$1, "./control/basic/circle-text.ts": __vite_glob_0_8$1, "./control/basic/circle.ts": __vite_glob_0_9$1, "./control/basic/cube.ts": __vite_glob_0_10$1, "./control/basic/diamond-round.ts": __vite_glob_0_11$1, "./control/basic/diamond.ts": __vite_glob_0_12$1, "./control/basic/ellipse.ts": __vite_glob_0_13$1, "./control/basic/fivestar.ts": __vite_glob_0_14$1, "./control/basic/half-circle.ts": __vite_glob_0_15$1, "./control/basic/hexagon-round.ts": __vite_glob_0_16$1, "./control/basic/hexagon.ts": __vite_glob_0_17$1, "./control/basic/hexstar.ts": __vite_glob_0_18$1, "./control/basic/hexstar1.ts": __vite_glob_0_19$1, "./control/basic/hexstar2.ts": __vite_glob_0_20$1, "./control/basic/left-arrow.ts": __vite_glob_0_21$1, "./control/basic/parallelogram-round.ts": __vite_glob_0_22$1, "./control/basic/parallelogram.ts": __vite_glob_0_23$1, "./control/basic/pentagon-round.ts": __vite_glob_0_24$1, "./control/basic/pentagon.ts": __vite_glob_0_25$1, "./control/basic/rectangle-border.ts": __vite_glob_0_26$1, "./control/basic/rectangle-round.ts": __vite_glob_0_27$1, "./control/basic/rectangle-split.ts": __vite_glob_0_28$1, "./control/basic/rectangle-text.ts": __vite_glob_0_29$1, "./control/basic/rectangle.ts": __vite_glob_0_30$1, "./control/basic/right-arrow.ts": __vite_glob_0_31$1, "./control/basic/square-round.ts": __vite_glob_0_32$1, "./control/basic/square-text.ts": __vite_glob_0_33$1, "./control/basic/square.ts": __vite_glob_0_34$1, "./control/basic/text.ts": __vite_glob_0_35$1, "./control/basic/trapezoid-round.ts": __vite_glob_0_36$1, "./control/basic/trapezoid.ts": __vite_glob_0_37$1, "./control/basic/triangle-left-90-round.ts": __vite_glob_0_38$1, "./control/basic/triangle-left-90.ts": __vite_glob_0_39$1, "./control/basic/triangle-right-90-round.ts": __vite_glob_0_40$1, "./control/basic/triangle-right-90.ts": __vite_glob_0_41$1, "./control/basic/triangle-round.ts": __vite_glob_0_42$1, "./control/basic/triangle.ts": __vite_glob_0_43$1, "./control/basicflow/flow-card-tab.ts": __vite_glob_0_44$1, "./control/basicflow/flow-control-transfer.ts": __vite_glob_0_45$1, "./control/basicflow/flow-data.ts": __vite_glob_0_46$1, "./control/basicflow/flow-data1.ts": __vite_glob_0_47$1, "./control/basicflow/flow-data2.ts": __vite_glob_0_48$1, "./control/basicflow/flow-data3.ts": __vite_glob_0_49$1, "./control/basicflow/flow-defflow.ts": __vite_glob_0_50$1, "./control/basicflow/flow-delay.ts": __vite_glob_0_51$1, "./control/basicflow/flow-display-content.ts": __vite_glob_0_52$1, "./control/basicflow/flow-end.ts": __vite_glob_0_53$1, "./control/basicflow/flow-end1.ts": __vite_glob_0_54$1, "./control/basicflow/flow-end2.ts": __vite_glob_0_55$1, "./control/basicflow/flow-end3.ts": __vite_glob_0_56$1, "./control/basicflow/flow-hand-input.ts": __vite_glob_0_57$1, "./control/basicflow/flow-loop-area.ts": __vite_glob_0_58$1, "./control/basicflow/flow-manual-operate.ts": __vite_glob_0_59$1, "./control/basicflow/flow-page-ref.ts": __vite_glob_0_60$1, "./control/basicflow/flow-prepare.ts": __vite_glob_0_61$1, "./control/basicflow/flow-start.ts": __vite_glob_0_62$1, "./control/basicflow/flow-start1.ts": __vite_glob_0_63$1, "./control/basicflow/flow-subflow.ts": __vite_glob_0_64$1, "./control/basicflow/flow-switch.ts": __vite_glob_0_65$1, "./control/basicflow/flow-switch1.ts": __vite_glob_0_66$1, "./control/basicflow/flow-task.ts": __vite_glob_0_67$1, "./control/basicflow/flow-task1.ts": __vite_glob_0_68$1, "./control/basicflow/flow-task2.ts": __vite_glob_0_69$1, "./control/common/bidfunnel.ts": __vite_glob_0_70$1, "./control/common/bracket-big-left-text.ts": __vite_glob_0_71$1, "./control/common/bracket-big-left.ts": __vite_glob_0_72$1, "./control/common/bracket-big-right-text.ts": __vite_glob_0_73$1, "./control/common/bracket-big-right.ts": __vite_glob_0_74$1, "./control/common/bracket-big-text.ts": __vite_glob_0_75$1, "./control/common/bracket-middle-left-text.ts": __vite_glob_0_76$1, "./control/common/bracket-middle-left.ts": __vite_glob_0_77$1, "./control/common/bracket-middle-right-text.ts": __vite_glob_0_78$1, "./control/common/bracket-middle-right.ts": __vite_glob_0_79$1, "./control/common/bracket-middle-text.ts": __vite_glob_0_80$1, "./control/common/bracket-small-left-text.ts": __vite_glob_0_81$1, "./control/common/bracket-small-left.ts": __vite_glob_0_82$1, "./control/common/bracket-small-right-text.ts": __vite_glob_0_83$1, "./control/common/bracket-small-right.ts": __vite_glob_0_84$1, "./control/common/bracket-small-text.ts": __vite_glob_0_85$1, "./control/common/comment.ts": __vite_glob_0_86$1, "./control/common/comment1.ts": __vite_glob_0_87$1, "./control/common/database.ts": __vite_glob_0_88$1, "./control/common/database1.ts": __vite_glob_0_89$1, "./control/common/database2.ts": __vite_glob_0_90$1, "./control/common/database3.ts": __vite_glob_0_91$1, "./control/common/document.ts": __vite_glob_0_92$1, "./control/common/human.ts": __vite_glob_0_93$1, "./control/common/human1.ts": __vite_glob_0_94$1, "./control/common/human2.ts": __vite_glob_0_95$1, "./control/common/papertape.ts": __vite_glob_0_96$1, "./control/layer.ts": __vite_glob_0_97$1, "./control/math/angle.ts": __vite_glob_0_98$1, "./control/stage.ts": __vite_glob_0_99$1 }); const group_ctx$1 = /* @__PURE__ */ Object.assign({ "./group/basic/basic-flow-shapes.ts": __vite_glob_1_0$1, "./group/basic/basic-shapes.ts": __vite_glob_1_1$1, "./group/common/databases.ts": __vite_glob_1_2$1 }); const _DDeiCoreControls = class _DDeiCoreControls extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "controls", /* @__PURE__ */ new Map()); } getControls(editor) { let extOptions = this.getOptions(); let controls2 = /* @__PURE__ */ new Map(); let controls1 = new Map(editor.controls); for (let i2 in control_ctx$1) { let control = control_ctx$1[i2].default; if (control) { let c = cloneDeep(control); controls2.set(control.id, c); controls1.set(control.id, c); if (extOptions && extOptions[control.id]) { for (let x2 in extOptions[control.id]) { c.define[x2] = extOptions[control.id][x2]; } } } } controls2.forEach((control) => { loadControlByFrom(controls1, control); }); this.controls = controls2; return controls2; } getGroups(editor) { if (!this.controls) { this.getControls(editor); } let groups = []; for (let path in group_ctx$1) { groups.push(group_ctx$1[path].default); } loadAndSortGroup(groups, this.controls); return groups; } static configuration(options) { if (options) { let controls2 = new _DDeiCoreControls(options); return controls2; } return _DDeiCoreControls; } static modify(fn) { return _DDeiCoreControls.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreControls, "defaultIns", new _DDeiCoreControls(null)); let DDeiCoreControls = _DDeiCoreControls; const _MenuCancelMergeCell = class _MenuCancelMergeCell extends DDeiMenuBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-menu-cancel-merge-cell"); __publicField3(this, "defaultOptions", { "label": "取消合并单元格", "icon": "icon-merge-cells", "disabled": false }); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_MenuCancelMergeCell.defaultIns.name]) { for (let i2 in options[_MenuCancelMergeCell.defaultIns.name]) { newOptions[i2] = options[_MenuCancelMergeCell.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _MenuCancelMergeCell(newOptions); return panels; } } return _MenuCancelMergeCell; } static modify(fn) { return _MenuCancelMergeCell.defaultIns.modify(fn); } // ============================ 方法 =============================== /** * 执行的方法 */ action(model, evt) { if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { let table2 = model; table2.cancelSelectedMergeCells(); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); model.stage.ddInstance.bus.executeAll(); } } /** * 判定是否显示的方法 */ isVisiable(model) { if (!this.disabled && (model == null ? void 0 : model.baseModelType) == "DDeiTable") { let table2 = model; let selectedCells = table2.getSelectedCells(); if (selectedCells.length == 1 && (selectedCells[0].mergeRowNum > 1 || selectedCells[0].mergeColNum > 1)) { return true; } } return false; } }; /** * 缺省实例 */ __publicField3(_MenuCancelMergeCell, "defaultIns", new _MenuCancelMergeCell()); let MenuCancelMergeCell = _MenuCancelMergeCell; const _MenuCopySheet = class _MenuCopySheet extends DDeiMenuBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-menu-copy-sheet"); __publicField3(this, "defaultOptions", { "label": "ddei.copy", "icon": "#icon-paste", "models": ["DDeiSheet"], "disabled": false }); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_MenuCopySheet.defaultIns.name]) { for (let i2 in options[_MenuCopySheet.defaultIns.name]) { newOptions[i2] = options[_MenuCopySheet.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _MenuCopySheet(newOptions); return panels; } } return _MenuCopySheet; } static modify(fn) { return _MenuCopySheet.defaultIns.modify(fn); } /** * 执行的方法 */ action(model, evt) { var _a3, _b2, _c2, _d2, _e2; if (model.modelType == "DDeiSheet") { let editor = DDeiEditor.ACTIVE_INSTANCE; let file = editor == null ? void 0 : editor.files[editor.currentFileIndex]; let ddInstance = model.stage.ddInstance; let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_ADD_SHEET_BEFORE", "ADD_SHEET", null, ddInstance, null); if (rsState != -1) { let sheetJson = model.toJSON(); let dpi = (_a3 = ddInstance.dpi) == null ? void 0 : _a3.x; if (!sheetJson.stage.dpi) { sheetJson.stage.dpi = dpi; } let unit = sheetJson.stage.unit; if (dpi && unit && unit != "px") { (_c2 = (_b2 = sheetJson.stage) == null ? void 0 : _b2.layers) == null ? void 0 : _c2.forEach((layer2) => { DDeiUtil.convertChildrenJsonUnit(layer2, sheetJson.stage, unit); }); } let newSheet = DDeiSheet.loadFromJSON(sheetJson, { currentDdInstance: ddInstance }); let pageText = editor.i18n("ddei.page"); file.sheets.splice((file == null ? void 0 : file.currentSheetIndex) + 1, 0, newSheet); newSheet.name = pageText + "-" + file.sheets.length; file.changeSheet(file.currentSheetIndex + 1); let stage2 = newSheet.stage; stage2.ddInstance = ddInstance; ddInstance.stage = stage2; stage2.initRender(); editor.changeState(DDeiEditorState.DESIGNING); editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, null); editor.bus.push(DDeiEnumBusCommandType.AddHistroy); editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu"] }); (_d2 = editor.bus) == null ? void 0 : _d2.executeAll(); (_e2 = editor.editorViewer) == null ? void 0 : _e2.changeFileModifyDirty(); } } } /** * 判定是否显示的方法 */ isVisiable(model) { var _a3; if (model) { let allowEditSheet = ((_a3 = model.stage.ddInstance) == null ? void 0 : _a3.AC_DESIGN_EDIT) != false ? true : false; return allowEditSheet && !this.disabled; } return false; } }; /** * 缺省实例 */ __publicField3(_MenuCopySheet, "defaultIns", new _MenuCopySheet()); let MenuCopySheet = _MenuCopySheet; const _MenuInsertCol = class _MenuInsertCol extends DDeiMenuBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-menu-insert-col"); __publicField3(this, "defaultOptions", { "label": "合并单元格", "icon": "icon-merge-cells", "disabled": false }); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_MenuInsertCol.defaultIns.name]) { for (let i2 in options[_MenuInsertCol.defaultIns.name]) { newOptions[i2] = options[_MenuInsertCol.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _MenuInsertCol(newOptions); return panels; } } return _MenuInsertCol; } static modify(fn) { return _MenuInsertCol.defaultIns.modify(fn); } /** * 执行的方法 */ action(model, evt) { if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { let table2 = model; if (table2.curRow != void 0 && table2.curCol != void 0 && table2.curRow != -1 && table2.curCol != -1) { let cell = table2.rows[table2.curRow][table2.curCol]; let col = cell.col; if (col < 0) { col = -1; } else if (col > table2.cols.length - 1) { col = table2.cols.length - 1; } table2.insertCol(col, 2); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); model.stage.ddInstance.bus.executeAll(); } } } /** * 判定是否显示的方法 */ isVisiable(model) { if (!this.disabled && (model == null ? void 0 : model.baseModelType) == "DDeiTable") { return true; } return false; } }; /** * 缺省实例 */ __publicField3(_MenuInsertCol, "defaultIns", new _MenuInsertCol()); let MenuInsertCol = _MenuInsertCol; const _MenuInsertRow = class _MenuInsertRow extends DDeiMenuBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-menu-insert-row"); __publicField3(this, "defaultOptions", { "label": "插入行", "icon": "icon-insert-row", "disabled": false }); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_MenuInsertRow.defaultIns.name]) { for (let i2 in options[_MenuInsertRow.defaultIns.name]) { newOptions[i2] = options[_MenuInsertRow.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _MenuInsertRow(newOptions); return panels; } } return _MenuInsertRow; } static modify(fn) { return _MenuInsertRow.defaultIns.modify(fn); } /** * 执行的方法 */ action(model, evt) { if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { let table2 = model; if (table2.curRow != void 0 && table2.curCol != void 0 && table2.curRow != -1 && table2.curCol != -1) { let cell = table2.rows[table2.curRow][table2.curCol]; let row = cell.row; if (row - 1 < 0) { row = -1; } else { row = row - 1; } if (row < 0) { row = -1; } else if (row > table2.rows.length - 1) { row = table2.rows.length - 1; } table2.insertRow(row, 1); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); model.stage.ddInstance.bus.executeAll(); } } } /** * 判定是否显示的方法 */ isVisiable(model) { if (!this.disabled && (model == null ? void 0 : model.baseModelType) == "DDeiTable") { return true; } return false; } }; /** * 缺省实例 */ __publicField3(_MenuInsertRow, "defaultIns", new _MenuInsertRow()); let MenuInsertRow = _MenuInsertRow; const _MenuMergeCell = class _MenuMergeCell extends DDeiMenuBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-menu-merge-cell"); __publicField3(this, "defaultOptions", { "label": "插入列", "icon": "icon-insert-col", "disabled": false }); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_MenuMergeCell.defaultIns.name]) { for (let i2 in options[_MenuMergeCell.defaultIns.name]) { newOptions[i2] = options[_MenuMergeCell.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _MenuMergeCell(newOptions); return panels; } } return _MenuMergeCell; } static modify(fn) { return _MenuMergeCell.defaultIns.modify(fn); } /** * 执行的方法 */ action(model, evt) { if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { let table2 = model; table2.mergeSelectedCells(); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); model.stage.ddInstance.bus.executeAll(); } } /** * 判定是否显示的方法 */ isVisiable(model) { if (!this.disabled && (model == null ? void 0 : model.baseModelType) == "DDeiTable") { let table2 = model; let selectedCells = table2.getSelectedCells(); if (selectedCells.length >= 2) { let minMaxColRow = table2.getMinMaxRowAndCol(selectedCells); return table2.isAllSelected(minMaxColRow.minRow, minMaxColRow.minCol, minMaxColRow.maxRow, minMaxColRow.maxCol); } } return false; } }; /** * 缺省实例 */ __publicField3(_MenuMergeCell, "defaultIns", new _MenuMergeCell()); let MenuMergeCell = _MenuMergeCell; const _MenuRemoveCol = class _MenuRemoveCol extends DDeiMenuBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-menu-remove-col"); __publicField3(this, "defaultOptions", { "label": "删除列", "icon": "icon-delete-column", "disabled": false }); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_MenuRemoveCol.defaultIns.name]) { for (let i2 in options[_MenuRemoveCol.defaultIns.name]) { newOptions[i2] = options[_MenuRemoveCol.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _MenuRemoveCol(newOptions); return panels; } } return _MenuRemoveCol; } static modify(fn) { return _MenuRemoveCol.defaultIns.modify(fn); } /** * 执行的方法 */ action(model, evt) { if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { let table2 = model; if (table2.curRow != void 0 && table2.curCol != void 0 && table2.curRow != -1 && table2.curCol != -1) { let cell = table2.rows[table2.curRow][table2.curCol]; let col = cell.col; if (col < 0) { col = 0; } else if (col > table2.cols.length - 1) { col = table2.cols.length - 1; } table2.removeCol(col); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); model.stage.ddInstance.bus.executeAll(); } } } /** * 判定是否显示的方法 */ isVisiable(model) { var _a3; if (!this.disabled && (model == null ? void 0 : model.baseModelType) == "DDeiTable") { if (((_a3 = model == null ? void 0 : model.cols) == null ? void 0 : _a3.length) > 1) { return true; } } return false; } }; /** * 缺省实例 */ __publicField3(_MenuRemoveCol, "defaultIns", new _MenuRemoveCol()); let MenuRemoveCol = _MenuRemoveCol; const _MenuRemoveRow = class _MenuRemoveRow extends DDeiMenuBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-menu-remove-row"); __publicField3(this, "defaultOptions", { "label": "删除行", "icon": "icon-delete-row", "disabled": false }); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_MenuRemoveRow.defaultIns.name]) { for (let i2 in options[_MenuRemoveRow.defaultIns.name]) { newOptions[i2] = options[_MenuRemoveRow.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _MenuRemoveRow(newOptions); return panels; } } return _MenuRemoveRow; } static modify(fn) { return _MenuRemoveRow.defaultIns.modify(fn); } /** * 执行的方法 */ action(model, evt) { if ((model == null ? void 0 : model.baseModelType) == "DDeiTable") { let table2 = model; if (table2.curRow != void 0 && table2.curCol != void 0 && table2.curRow != -1 && table2.curCol != -1) { let cell = table2.rows[table2.curRow][table2.curCol]; let row = cell.row; if (row < 0) { row = 0; } else if (row > table2.rows.length - 1) { row = table2.rows.length - 1; } table2.removeRow(row); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); model.stage.ddInstance.bus.executeAll(); } } } /** * 判定是否显示的方法 */ isVisiable(model) { var _a3; if (!this.disabled && (model == null ? void 0 : model.baseModelType) == "DDeiTable") { if (((_a3 = model == null ? void 0 : model.rows) == null ? void 0 : _a3.length) > 1) { return true; } } return false; } }; /** * 缺省实例 */ __publicField3(_MenuRemoveRow, "defaultIns", new _MenuRemoveRow()); let MenuRemoveRow = _MenuRemoveRow; const _MenuRemoveSheet = class _MenuRemoveSheet extends DDeiMenuBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-menu-remove-sheet"); __publicField3(this, "defaultOptions", { "label": "ddei.delete", "icon": "#icon-remove", "models": ["DDeiSheet"], "disabled": false }); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_MenuRemoveSheet.defaultIns.name]) { for (let i2 in options[_MenuRemoveSheet.defaultIns.name]) { newOptions[i2] = options[_MenuRemoveSheet.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _MenuRemoveSheet(newOptions); return panels; } } return _MenuRemoveSheet; } static modify(fn) { return _MenuRemoveSheet.defaultIns.modify(fn); } action(model, evt) { var _a3, _b2, _c2; if (model.modelType == "DDeiSheet") { let editor = DDeiEditor.ACTIVE_INSTANCE; let file = editor == null ? void 0 : editor.files[editor.currentFileIndex]; if (file.sheets.length > 1) { let ddInstance = model.stage.ddInstance; let rsState = DDeiEditorUtil.invokeCallbackFunc("EVENT_DEL_SHEET_BEFORE", "DEL_SHEET", null, ddInstance, null); if (rsState != -1) { let currentIndex = -1; for (let i2 = 0; i2 < ((_a3 = file == null ? void 0 : file.sheets) == null ? void 0 : _a3.length); i2++) { if (file.sheets[i2].unicode == model.unicode) { currentIndex = i2; break; } } file.sheets.splice(currentIndex, 1); if (currentIndex <= file.currentSheetIndex) { file.changeSheet(file.currentSheetIndex - 1); } let stage2 = file.sheets[file == null ? void 0 : file.currentSheetIndex].stage; stage2.ddInstance = ddInstance; ddInstance.stage.destroyRender(); ddInstance.stage = stage2; stage2.initRender(); DDeiEditorUtil.invokeCallbackFunc("EVENT_DEL_SHEET_AFTER", "DEL_SHEET", null, ddInstance, null); (_b2 = editor.editorViewer) == null ? void 0 : _b2.changeFileModifyDirty(); editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, null); editor.bus.push(DDeiEnumBusCommandType.AddHistroy); editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu"] }); (_c2 = editor.bus) == null ? void 0 : _c2.executeAll(); _MenuRemoveSheet.showPopPicker(stage2); editor.changeState(DDeiEditorState.DESIGNING); } } } } static showPopPicker(stage2) { var _a3; if (((_a3 = stage2.selectedModels) == null ? void 0 : _a3.size) > 0) { let models = Array.from(stage2.selectedModels.values()); if ((models == null ? void 0 : models.length) > 0) { let height = 100; let modelPos = DDeiUtil.getModelsDomAbsPosition(models); let left = modelPos.left + modelPos.width / 2; let top = modelPos.top + modelPos.height / 2; if (modelPos.top - height <= modelPos.cTop) { if (modelPos.height > 400) { top = top + height + 20; } else { top = top + modelPos.height / 2 + 20; } } else { top = top - height; } if (top < 0) { top = modelPos.cTop + modelPos.cHeight / 2; } if (left < 0) { left = 0; } DDeiEditorUtil.showDialog(this.editor, "ddei-core-dialog-quickpop", { group: "canvas-pop" }, { type: 99, left, top, hiddenMask: true }, null, true, true); } } } /** * 判定是否显示的方法 */ isVisiable(model) { var _a3; if (model) { let allowEditSheet = ((_a3 = model.stage.ddInstance) == null ? void 0 : _a3.AC_DESIGN_EDIT) != false ? true : false; if (allowEditSheet && !this.disabled && (model == null ? void 0 : model.modelType) == "DDeiSheet") { let editor = DDeiEditor.ACTIVE_INSTANCE; let file = editor == null ? void 0 : editor.files[editor.currentFileIndex]; if (file.sheets.length > 1) { return true; } } } return false; } }; /** * 缺省实例 */ __publicField3(_MenuRemoveSheet, "defaultIns", new _MenuRemoveSheet()); let MenuRemoveSheet = _MenuRemoveSheet; const _DDeiCoreMenus = class _DDeiCoreMenus extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ MenuCancelMergeCell, MenuCopySheet, MenuInsertCol, MenuInsertRow, MenuMergeCell, MenuRemoveCol, MenuRemoveRow, MenuRemoveSheet ]); } getMenus(editor) { var _a3; let menus2 = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getMenus(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getMenus(editor); } if ((ls == null ? void 0 : ls.length) > 0) { menus2 = menus2.concat(ls); } }); return menus2; } static configuration(options) { var _a3; let menus2 = new _DDeiCoreMenus(options); for (let i2 = 0; i2 < ((_a3 = menus2.plugins) == null ? void 0 : _a3.length); i2++) { menus2.plugins[i2] = menus2.plugins[i2].configuration(options, true); } return menus2; } static modify(fn) { return _DDeiCoreMenus.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreMenus, "defaultIns", new _DDeiCoreMenus(null)); let DDeiCoreMenus = _DDeiCoreMenus; const themeDefault = ".ddei-editor[theme='ddei-core-theme-default'] {\n --background: white;\n --theme: #F5F5F5;\n --text: black;\n --dot: #176eff;\n --hover: #e7e7e7;\n --icon: #424242;\n --border:#D5D5DF;\n --placeholder: #AdAdAd;\n --scroll-background: var(--theme);\n --scroll-hover: var(--hover);\n --scroll-border: var(--border);\n\n --panel-header:var(--theme);\n --panel-background: var(--background);\n --panel-title: var(--text);\n --panel-border: var(--border);\n --panel-hover: var(--hover);\n --panel-disabled: var(--theme);\n --panel-selected: var(--hover);\n --panel-title-disabled: #AdAdAd;\n --panel-title-selected: var(--text);\n\n\n --toolbox-header:var(--theme);\n --toolbox-background:var(--background);\n --toolbox-title:var(--text);\n --toolbox-hover:var(--hover);\n --toolbox-control-hover: #EDEFFF;\n --toolbox-control-hover-outline: 2px solid #BED0EF;\n --toolbox-control-title: var(--text);\n\n\n --topmenu-background: var(--background);\n --topmenu-header: var(--theme);\n\n\n\n --canvas-rule-background: var(--background);\n --canvas-rule-border: #E0E3E9;\n --canvas-scroll-background: var(--background);\n --canvas-scroll-border: #E0E3E9;\n --canvas-grid-line: rgb(220, 220, 220);\n --canvas-grid-dot: rgb(121, 121, 121);\n --canvas-control-border: black;\n --canvas-control-background: white;\n --canvas-control-title: #252525;\n\n --canvas-mark-title: #252525;\n --canvas-text-selection: #97bdf2;\n --canvas-text-cursor: black;\n}"; const __vite_glob_0_0$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: themeDefault }, Symbol.toStringTag, { value: "Module" })); const _DDeiCoreThemeDefault = class _DDeiCoreThemeDefault extends DDeiThemeBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-theme-default"); __publicField3(this, "label", "默认"); __publicField3(this, "default", true); } getThemes(editor) { let theme_ctx = /* @__PURE__ */ Object.assign({ "./theme-default.css": __vite_glob_0_0$4 }); for (let path in theme_ctx) { let css = theme_ctx[path].default; this.css = css; } return super.getThemes(editor); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiCoreThemeDefault.defaultIns.name]) { for (let i2 in options[_DDeiCoreThemeDefault.defaultIns.name]) { newOptions[i2] = options[_DDeiCoreThemeDefault.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreThemeDefault(newOptions); return panels; } } return _DDeiCoreThemeDefault; } static modify(fn) { return _DDeiCoreThemeDefault.defaultIns.modify(fn); } }; // //背景色 // background:string = 'white'; // //主题色 // theme:string = '#F5F5F5'; // //文本色 // text:string = 'black'; // //点缀色 // dot: string = '#176eff'; // //交互色 // active:string = '#edefff'; // //图标色 // icon:string = '#424242'; /** * 缺省实例 */ __publicField3(_DDeiCoreThemeDefault, "defaultIns", new _DDeiCoreThemeDefault()); let DDeiCoreThemeDefault = _DDeiCoreThemeDefault; const themeBlack = ".ddei-editor[theme='ddei-core-theme-black'] {\n --background: #212121;\n --theme: #2c2c2c;\n --text: white;\n --dot: #176eff;\n --hover: rgb(60,60,60);\n --icon: white;\n --border: #DFDFDF;\n --placeholder: #A1A1A1;\n --scroll-background: var(--theme);\n --scroll-hover: var(--hover);\n --scroll-border: white;\n\n --panel-header: var(--theme);\n --panel-background: var(--background);\n --panel-title: var(--text);\n --panel-border: var(--border);\n --panel-hover: var(--hover);\n --panel-disabled: var(--theme);\n --panel-selected: var(--hover);\n --panel-title-disabled: #A1A1A1;\n --panel-title-selected: var(--text);\n\n\n\n --toolbox-header: var(--theme);\n --toolbox-background: var(--background);\n --toolbox-title: var(--text);\n --toolbox-hover: var(--hover);\n --toolbox-control-hover: var(--dot);\n --toolbox-control-hover-outline: 2px solid #BED0EF;\n --toolbox-control-title: var(--text);\n\n\n --canvas-rule-background: var(--theme);\n --canvas-rule-border: white;\n --canvas-scroll-background: var(--theme);\n --canvas-scroll-border: white;\n --canvas-grid-line: rgb(121, 121, 121);\n --canvas-grid-dot: rgb(121, 121, 121);\n --canvas-control-border: white;\n --canvas-control-background: var(--theme);\n --canvas-control-title: white;\n\n --canvas-mark-title: white;\n --canvas-text-selection: #97bdf2;\n --canvas-text-cursor: white;\n \n}"; const __vite_glob_0_0$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: themeBlack }, Symbol.toStringTag, { value: "Module" })); const _DDeiCoreThemeBlack = class _DDeiCoreThemeBlack extends DDeiThemeBase { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-theme-black"); __publicField3(this, "label", "黑色"); } getThemes(editor) { let theme_ctx = /* @__PURE__ */ Object.assign({ "./theme-black.css": __vite_glob_0_0$3 }); for (let path in theme_ctx) { let css = theme_ctx[path].default; this.css = css; } return super.getThemes(editor); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiCoreThemeBlack.defaultIns.name]) { for (let i2 in options[_DDeiCoreThemeBlack.defaultIns.name]) { newOptions[i2] = options[_DDeiCoreThemeBlack.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreThemeBlack(newOptions); return panels; } } return _DDeiCoreThemeBlack; } static modify(fn) { return _DDeiCoreThemeBlack.defaultIns.modify(fn); } }; // //背景色 // background:string = 'black'; // //主题色 // theme:string = 'black'; // //文本色 // text:string = 'white'; // //点缀色 // dot: string = '#176eff'; // //交互色 // active:string = '#edefff'; // //图标色 // icon:string = '#424242'; /** * 缺省实例 */ __publicField3(_DDeiCoreThemeBlack, "defaultIns", new _DDeiCoreThemeBlack()); let DDeiCoreThemeBlack = _DDeiCoreThemeBlack; const _DDeiCoreThemes = class _DDeiCoreThemes extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [DDeiCoreThemeDefault, DDeiCoreThemeBlack]); } getThemes(editor) { var _a3; let themes = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getThemes(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getThemes(editor); } if ((ls == null ? void 0 : ls.length) > 0) { themes = themes.concat(ls); } }); return themes; } static configuration(options) { var _a3; let themes = new _DDeiCoreThemes(options); for (let i2 = 0; i2 < ((_a3 = themes.plugins) == null ? void 0 : _a3.length); i2++) { themes.plugins[i2] = themes.plugins[i2].configuration(options, true); } return themes; } static modify(fn) { return _DDeiCoreThemes.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreThemes, "defaultIns", new _DDeiCoreThemes(null)); let DDeiCoreThemes = _DDeiCoreThemes; const _DDeiCoreLifeCycle = class _DDeiCoreLifeCycle extends DDeiLifeCycle { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-lifecycle"); __publicField3(this, "EVENT_MOUSE_MOVE_IN_LAYER", new DDeiFuncData("mouse-operating", 1, this.mouseOperating)); } /** * 正在进行鼠标操作 */ mouseOperating(operateType, data, ddInstance, evt) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); DDeiEditorUtil.closeDialog(editor, "ddei-core-dialog-choosecontrol"); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiCoreLifeCycle.name]) { for (let i2 in options[_DDeiCoreLifeCycle.name]) { newOptions[i2] = options[_DDeiCoreLifeCycle.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreLifeCycle(); if (newOptions.name) { panels.name = newOptions.name; } if (newOptions.sort) { panels.sort = newOptions.sort; } return panels; } } return _DDeiCoreLifeCycle; } static modify(fn) { return _DDeiCoreLifeCycle.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreLifeCycle, "defaultIns", new _DDeiCoreLifeCycle(null)); let DDeiCoreLifeCycle = _DDeiCoreLifeCycle; const _DDeiCoreLifeCycles = class _DDeiCoreLifeCycles extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "lifecyclies", DDeiCoreLifeCycle); } getLifeCyclies(editor) { if (DDeiPluginBase.isSubclass(this.lifecyclies, DDeiPluginBase)) { return this.lifecyclies.defaultIns.getLifeCyclies(editor); } else if (this.lifecyclies instanceof DDeiPluginBase) { return this.lifecyclies.getLifeCyclies(editor); } } static configuration(options) { let core = new _DDeiCoreLifeCycles(options); core.lifecyclies = core.lifecyclies.configuration(options, true); return core; } static modify(fn) { return _DDeiCoreLifeCycles.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreLifeCycles, "defaultIns", new _DDeiCoreLifeCycles(null)); let DDeiCoreLifeCycles = _DDeiCoreLifeCycles; const _DDeiCore = class _DDeiCore extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "order", 0); __publicField3(this, "layouts", DDeiCoreLayouts); __publicField3(this, "panels", DDeiCorePanels); __publicField3(this, "components", DDeiCoreComponents); __publicField3(this, "dialogs", DDeiCoreDialogs); __publicField3(this, "propeditors", DDeiCorePVEditors); __publicField3(this, "hotkeys", DDeiCoreHotkeys); __publicField3(this, "controls", DDeiCoreControls); __publicField3(this, "menus", DDeiCoreMenus); __publicField3(this, "themes", DDeiCoreThemes); __publicField3(this, "lifecycles", DDeiCoreLifeCycles); } getOptions() { let options = {}; let array = [this.layouts, this.panels, this.propeditors, this.dialogs, this.components, this.hotkeys, this.controls, this.menus, this.themes, this.lifecycles]; array.forEach((plugin) => { if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { options = Object.assign({}, options, plugin.defaultIns.getOptions()); } else if (plugin instanceof DDeiPluginBase) { options = Object.assign({}, options, plugin.getOptions()); } }); return options; } getLangs(editor) { const langModules = /* @__PURE__ */ Object.assign({ "./i18n/en_US.ts": __vite_glob_0_0$6, "./i18n/zh_CN.ts": __vite_glob_0_1$3 }); let langs = {}; for (let i2 in langModules) { let langModule = langModules[i2]; let newI = i2.substring(i2.lastIndexOf("/") + 1, i2.lastIndexOf(".")); langs[newI] = langModule.default; } return langs; } getComponents(editor) { if (DDeiPluginBase.isSubclass(this.components, DDeiPluginBase)) { return this.components.defaultIns.getComponents(editor); } else if (this.components instanceof DDeiPluginBase) { return this.components.getComponents(editor); } } getPanels(editor) { if (DDeiPluginBase.isSubclass(this.panels, DDeiPluginBase)) { return this.panels.defaultIns.getPanels(editor); } else if (this.panels instanceof DDeiPluginBase) { return this.panels.getPanels(editor); } } getLayouts(editor) { if (DDeiPluginBase.isSubclass(this.layouts, DDeiPluginBase)) { return this.layouts.defaultIns.getLayouts(editor); } else if (this.layouts instanceof DDeiPluginBase) { return this.layouts.getLayouts(editor); } } getLifeCyclies(editor) { if (DDeiPluginBase.isSubclass(this.lifecycles, DDeiPluginBase)) { return this.lifecycles.defaultIns.getLifeCyclies(editor); } else if (this.lifecycles instanceof DDeiPluginBase) { return this.lifecycles.getLifeCyclies(editor); } } getDialogs(editor) { if (DDeiPluginBase.isSubclass(this.dialogs, DDeiPluginBase)) { return this.dialogs.defaultIns.getDialogs(editor); } else if (this.dialogs instanceof DDeiPluginBase) { return this.dialogs.getDialogs(editor); } } getPropEditors(editor) { if (DDeiPluginBase.isSubclass(this.propeditors, DDeiPluginBase)) { return this.propeditors.defaultIns.getPropEditors(editor); } else if (this.propeditors instanceof DDeiPluginBase) { return this.propeditors.getPropEditors(editor); } } getHotKeys(editor) { if (DDeiPluginBase.isSubclass(this.hotkeys, DDeiPluginBase)) { return this.hotkeys.defaultIns.getHotKeys(editor); } else if (this.hotkeys instanceof DDeiPluginBase) { return this.hotkeys.getHotKeys(editor); } } getControls(editor) { if (DDeiPluginBase.isSubclass(this.controls, DDeiPluginBase)) { return this.controls.defaultIns.getControls(editor); } else if (this.controls instanceof DDeiPluginBase) { return this.controls.getControls(editor); } } getGroups(editor) { if (DDeiPluginBase.isSubclass(this.controls, DDeiPluginBase)) { return this.controls.defaultIns.getGroups(editor); } else if (this.controls instanceof DDeiPluginBase) { return this.controls.getGroups(editor); } } getMenus(editor) { if (DDeiPluginBase.isSubclass(this.menus, DDeiPluginBase)) { return this.menus.defaultIns.getMenus(editor); } else if (this.menus instanceof DDeiPluginBase) { return this.menus.getMenus(editor); } } getThemes(editor) { if (DDeiPluginBase.isSubclass(this.themes, DDeiPluginBase)) { return this.themes.defaultIns.getThemes(editor); } else if (this.themes instanceof DDeiPluginBase) { return this.themes.getThemes(editor); } } static configuration(options) { let core = new _DDeiCore(options); core.layouts = core.layouts.configuration(options, true); core.panels = core.panels.configuration(options, true); core.components = core.components.configuration(options, true); core.dialogs = core.dialogs.configuration(options, true); core.propeditors = core.propeditors.configuration(options, true); core.hotkeys = core.hotkeys.configuration(options, true); core.controls = core.controls.configuration(options, true); core.menus = core.menus.configuration(options, true); core.themes = core.themes.configuration(options, true); core.lifecycles = core.lifecycles.configuration(options, true); return core; } static modify(fn) { return _DDeiCore.defaultIns.modify(fn); } }; __publicField3(_DDeiCore, "order", 0); /** * 缺省实例 */ __publicField3(_DDeiCore, "defaultIns", new _DDeiCore(null)); let DDeiCore = _DDeiCore; const cursorBrush = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAZdJREFUOE+lk7FLHFEQxr/v7UZS6b1T8weou41wpDBgoQgphNRJE2JjYdBdtBCtRLhKBC1EeIuFkBSBFEm6kM7milRpYkize8baBH1nl+jtTVjlhMO9A73pZt7M75vHxxBdBrucR3tAWVThUXUyE6gtjFRASp5YW0CfSV44lN1sKCUWzxf8T3cC6CiZgcgEQAWiYgPvXWdAWVw9WF0h8PC6UUoC/M4AhAwAPLyqAn/tn5FtlFnP8psv9O0djam08ZHA26ZS6qjPUk8dl3zWrAkx21Dq+fn88LcWQK85euIg3bahP9XJGR3FlYZylm8BCiZ+DLJCQQq2cUdEhHCg3Mna/ND3lg2yRJvkFYApG3qv87YommRfIAc29N8331tsLJh4neClDb1NHcWr1vF28K+qtCtLNvC3tKmugSI28DZyAUUTvwH55SzwPugoPr544I7jguzB5Vcb+kPaxC+FfFoLvLl8QJQcCKQfYA1ASYQ/iUZm1iiIQ0A0BSdnoT+dC9DRr5IwLXZygXV1aheHf+QC7nNYXV/jf/ZkjxGbpARwAAAAAElFTkSuQmCC"; const __vite_glob_0_0$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: cursorBrush }, Symbol.toStringTag, { value: "Module" })); const modules = /* @__PURE__ */ Object.assign({ "./icons/cursor-brush.png": __vite_glob_0_0$2 }); const ICONS = {}; for (let i2 in modules) { let icon = modules[i2]; let newI = i2.substring(i2.lastIndexOf("/") + 1, i2.lastIndexOf(".")); ICONS[newI] = icon.default; } const ddei = ""; const iconfont = ""; window._iconfont_svg_string_4428875 = '', ((l) => { var a = (h = (h = document.getElementsByTagName("script"))[h.length - 1]).getAttribute("data-injectcss"), h = h.getAttribute("data-disable-injectsvg"); if (!h) { var t, o, i2, p, z, v = function(a2, h2) { h2.parentNode.insertBefore(a2, h2); }; if (a && !l.__iconfont__svg__cssinject__) { l.__iconfont__svg__cssinject__ = true; try { document.write(""); } catch (a2) { console && console.log(a2); } } t = function() { var a2, h2 = document.createElement("div"); h2.innerHTML = l._iconfont_svg_string_4428875, (h2 = h2.getElementsByTagName("svg")[0]) && (h2.setAttribute("aria-hidden", "true"), h2.style.position = "absolute", h2.style.width = 0, h2.style.height = 0, h2.style.overflow = "hidden", h2 = h2, (a2 = document.body).firstChild ? v(h2, a2.firstChild) : a2.appendChild(h2)); }, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(t, 0) : (o = function() { document.removeEventListener("DOMContentLoaded", o, false), t(); }, document.addEventListener("DOMContentLoaded", o, false)) : document.attachEvent && (i2 = t, p = l.document, z = false, m(), p.onreadystatechange = function() { "complete" == p.readyState && (p.onreadystatechange = null, d()); }); } function d() { z || (z = true, i2()); } function m() { try { p.documentElement.doScroll("left"); } catch (a2) { return void setTimeout(m, 50); } d(); } })(window); const _sfc_main$7 = { name: "DDei-Editor", extends: null, mixins: [], props: { //外部配置文件的定义,当传入外部配置文件时,用外部配置文件覆盖内部配置 options: { type: Object, default: null }, id: { type: String, default: "ddei_editor" } }, data() { return { editor: null, dragObj: null, changeIndex: -1, refreshMenu: false, initLeftWidth: 0, initRightWidth: 0 }; }, //注册组件 components: { MenuDialog }, computed: {}, watch: {}, created() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n; autoLoadCommand(); if (!this.options) { this.options = vue.markRaw({ //配置扩展插件 extensions: [] }); } if (!this.options.extensions) { this.options.extensions = []; } this.options.extensions.splice(0, 0, DDeiCore); let editor = DDeiEditor.newInstance(this.id, this.id, true, this.options); if ((_a3 = this.options) == null ? void 0 : _a3.i18n) { if (this.options.i18n.langs) { editor.registerLangs(this.options.i18n.langs); } } editor.setI18nLang((_c2 = (_b2 = this.options) == null ? void 0 : _b2.i18n) == null ? void 0 : _c2.lang); this.editor = editor; this.editor.createRenderViewer = this.createRenderViewer; this.editor.removeRenderViewer = this.removeRenderViewer; editor.appContext = vue.getCurrentInstance().appContext; if (this.options) { this.editor.applyConfig(this.options.config); this.editor.extConfig = this.options.config; this.editor.ddInstance.applyConfig(this.options.config); } if (((_f = (_e2 = (_d2 = this.options) == null ? void 0 : _d2.config) == null ? void 0 : _e2.controlDefines) == null ? void 0 : _f.length) > 0) { (_h = (_g = this.options) == null ? void 0 : _g.config) == null ? void 0 : _h.controlDefines.forEach((control) => { if (this.editor.controls.has(control.id)) { let oldControl = this.editor.controls.get(control.id); if (control.define) { for (let n in control.define) { if (control.define[n] || control.define[n] == 0) { oldControl.define[n] = control.define[n]; } } loadControlDefineExt(oldControl); } control = oldControl; } this.editor.controls.set(control.id, control); loadControlByFrom(this.editor.controls, control); }); } if (((_k = (_j = (_i = this.options) == null ? void 0 : _i.config) == null ? void 0 : _j.groupDefines) == null ? void 0 : _k.length) > 0) { loadAndSortGroup((_m = (_l = this.options) == null ? void 0 : _l.config) == null ? void 0 : _m.groupDefines, this.editor.controls); this.options.config.groupDefines.forEach((group2) => { let finded = false; for (let i2 = 0; i2 < this.editor.groups.length; i2++) { if (this.editor.groups[i2].id == group2.id) { this.editor.groups[i2] = group2; finded = true; break; } } if (!finded) { this.editor.groups.push(group2); } }); this.editor.groups.sort((a, b) => { return a.orderNo - b.orderNo; }); this.options.config.groupDefines.forEach((group2) => { group2.controls.forEach((control) => { delete control.attrs; }); }); } (_n = this.editor.controls) == null ? void 0 : _n.forEach((control) => { if (control.menus) { if (!editorInstance.menuMapping[control.id]) { editorInstance.menuMapping[control.id] = control.menus; } let menus2 = editorInstance.menuMapping[control.id]; for (let i2 = 0; i2 < menus2.length; i2++) { for (let j2 in editorInstance.menus) { if (editorInstance.menus[j2].name == menus2[i2].name) { menus2[i2] = editorInstance.menus[j2]; break; } } } } delete control.attrs; }); DDeiEditorUtil.ICONS = ICONS; }, mounted() { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; this.editor.editorViewer = this; this.editor.htmlElement = this.$refs.editor_div; this.editor.bindEvent(); this.editor.changeTheme(""); let options = this.editor.options; if ((_a3 = options == null ? void 0 : options.config) == null ? void 0 : _a3.width) { this.$refs.editor_div.style.width = ((_b2 = options == null ? void 0 : options.config) == null ? void 0 : _b2.width) + "px"; } if ((_c2 = options == null ? void 0 : options.config) == null ? void 0 : _c2.height) { this.$refs.editor_div.style.height = ((_d2 = options == null ? void 0 : options.config) == null ? void 0 : _d2.height) + "px"; } if ((_e2 = options == null ? void 0 : options.config) == null ? void 0 : _e2.initData) { let initData = options.config.initData; let converters = this.editor.getEnabledConverters(initData, 1); converters == null ? void 0 : converters.forEach((converter) => { initData = converter.input(initData); }); let controlInitJSON = DDeiEditorUtil.getModelInitJSON(this.editor.ddInstance, null, initData.controls); if (controlInitJSON) { this.editor.addControls(controlInitJSON); } } if ((_f = options == null ? void 0 : options.config) == null ? void 0 : _f.access) { this.editor.setAccessInfo(options.config.access); } else if (((_g = options == null ? void 0 : options.config) == null ? void 0 : _g.readonly) == true || ((_h = options == null ? void 0 : options.config) == null ? void 0 : _h.readonly) == false) { this.editor.setEditable(!options.config.readonly); } this.editor.bus.interceptor[DDeiEnumBusCommandType.NodifyChange] = { after: [this.changeFileModifyDirty] }; this.editor.bus.interceptor[DDeiEnumBusCommandType.ModelChangeValue] = { after: [this.changeFileModifyDirty] }; if (DDeiEditor.HISTROY_LEVEL == "file") { this.editor.bus.interceptor[DDeiEnumBusCommandType.AddHistroy] = { execute: [this.addFileHistroy] }; } this.editor.bus.interceptor[DDeiEnumBusCommandType.TextEditorChangeSelectPos] = { execute: [this.textEditorChangeSelectPos] }; if (!this.editor.setCurrentMenu) { this.editor.setCurrentMenu = this.setCurrentMenu; } if (this.editor.needControlIcon) { DDeiEditorUtil.getControlIcons(this.editor); } if (options == null ? void 0 : options.onMounted) { options.onMounted(this.editor); } }, methods: { mouseDown(event) { DDeiEditor.ACTIVE_INSTANCE = this.editor; }, /** * 设置当前菜单 * @returns 控件ID */ setCurrentMenu(menus2) { this.editor.currentMenuData = menus2; this.refreshMenu = false; this.$nextTick(() => { this.refreshMenu = true; }); }, changeFileModifyDirty() { let action = DDeiEditorCommandFileDirty.newInstance(); return action.action( { state: DDeiFileState.MODIFY }, this.editor.bus, null ); }, //记录文件的histroy addFileHistroy() { let action = DDeiEditorCommandAddHistroy.newInstance(); return action.action({}, this.editor.bus, null); }, textEditorChangeSelectPos() { if (!this.editor.textEditorSelectedChange) { this.editor.textEditorSelectedChange = 1; } else { this.editor.textEditorSelectedChange++; } this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); }, createRenderViewer(model, operate, tempShape, composeRender) { let editor = this.editor; let vNode = editor.viewerMap.get(model.id); if (vNode) { if (operate == "VIEW") { model.render.refreshView(editor, vNode, tempShape, composeRender); } else if (operate == "VIEW-HIDDEN") { vNode.el.style.display = "none"; } } else { let parentNode = model.layer.render.containerViewer; let div = document.createElement("div"); div.setAttribute("mid", model.id); parentNode.appendChild(div); let opts = { editor, model }; if (model.render.viewerOption) { for (let k in model.render.viewerOption) { if (k != "viewer") { opts[k] = model.render.viewerOption[k]; } } } let vNode2 = vue.createVNode(model.render.viewer, opts); let appContext = editor.appContext; vNode2.appContext = appContext; vue.render(vNode2, div); editor.viewerMap.set(model.id, vNode2); if (operate == "VIEW") { model.render.refreshView(editor, vNode2, tempShape, composeRender); } } }, removeRenderViewer(model) { let editor = this.editor; let vNode = editor.viewerMap.get(model.id); if (vNode) { vNode.component.isUnmounted = true; vNode.component.update(); vNode.el.parentElement.remove(); editor.viewerMap.delete(model.id); } } } }; const Editor_vue_vue_type_style_index_0_lang = ""; const _hoisted_1$7 = ["id"]; const _hoisted_2$5 = ["id"]; const _hoisted_3$4 = ["id"]; function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2; const _component_MenuDialog = vue.resolveComponent("MenuDialog"); return vue.openBlock(), vue.createElementBlock("div", { id: $props.id, ref: "editor_div", class: "ddei-editor", onContextmenu: _cache[0] || (_cache[0] = vue.withModifiers(() => { }, ["prevent"])), onMousedown: _cache[1] || (_cache[1] = ($event) => $options.mouseDown($event)) }, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_a3 = $data.editor) == null ? void 0 : _a3.getLayout()), { editor: $data.editor, options: (_b2 = $data.editor) == null ? void 0 : _b2.getLayoutOptions() }, null, 8, ["editor", "options"])), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_c2 = $data.editor) == null ? void 0 : _c2.getDialogs(), (item, index) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.dialog), vue.mergeProps({ editor: $data.editor, options: item.options, ref_for: true }, item.options), null, 16, ["editor", "options"]); }), 256)), vue.withDirectives(vue.createVNode(_component_MenuDialog, { editor: $data.editor }, null, 8, ["editor"]), [ [vue.vShow, !$data.refreshMenu] ]), vue.createElementVNode("div", { id: $props.id + "_dialog_background_div", class: "dialog-background-div" }, null, 8, _hoisted_2$5), vue.createElementVNode("div", { id: $props.id + "_ddei_cut_img_div", class: "ddei-cut-img-div" }, null, 8, _hoisted_3$4) ], 40, _hoisted_1$7); } const DDeiEditorView = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]); const en_US = { ddei: { uml: { active: "Active", state: "State", substate: "Substate", compstate: "Composite", initstate: "Initial", finalstate: "Final", statecontainer: "StateC", object: "Object", objname: "Object Name", life: "Lifeline", objlife: "ObjectLifeline", seqobj: "Sequence", rolelife: "RoleLifeline", hcross: "HoriCros", vcross: "VertCros", sendsignal: "SendSignal", recsignal: "ReceiveSignal", recevent: "ReceiveEvent", dot: "Dot", pause: "Pause", hlane: "HoriLane", vlane: "VertLane", matrix: "Matrix", control: "Control", controlflow: "ControlF", node: "Node", nodeins: "NodeInst", initnode: "InitialN", forknode: "ForkNode", endnode: "EndNode", startnode1: "StartN", endnode1: "EndN", flowend: "FlowEnd", invoke: "Invoke", transition: "Transition", fork: "Fork", container: "Container", case: "UseCase", ext: "Ext", extpoint: "ExtPoint", extcase: "ExtUseC", system: "System", role: "Role", syspart: "SysParti", participal: "Participant", coop: "Collab", assis: "Assoc", generalization: "Genera", include: "Include", ui: "UI", interface: "Interf", reqinte: "ReqInter", class: "Class", classname: "ClassName", simpleclass: "SimpCls", activeclass: "ActCLs", active1: "Active", activebreak: "ActBreak", muti: "Multi", enum: "Enum", datatype: "DataType", signal: "Signal", original: "Original", constraint: "Constr", collection: "Collect", package: "Package", overview: "Overvi", model: "Model", relation: "Relatio", implement: "Implem", together: "Aggr", compose: "Compos", dependent: "Depen", link: "Link", relationship: "Relatio", component: "Component", compbox: "CompBox", compins: "CompInst", direct: "Direct", msg: "Message", async: "Async", asyncmsg: "AsyncMsg", project: "Project", projins: "ProjInst", deploydes: "DeployD", depdesins: "DeployDI", sketchmap: "Sketch", communication: "Communi", extend: "Extend", manifest: "Manife", deploy: "Deploy", entity: "Entity", alternative: "Alterna", loopnative: "LoopFrag", altnative: "AltFrag", optnative: "OptFrag", paranative: "ParFrag", customnative: "CustomF", objdel: "ObjDel", edge: "Edge", switch: "Decisi", simplehistory: "SimHis", detailhistroy: "DetHis", convert: "Convert", groups: { active: "UML-Active", case: "UML-UseCase", class: "UML-Class", component: "UML-Component", cooperate: "UML-Cooperate", deploy: "UML-Deploy", sequence: "UML-Sequence", state: "UML-State" } } } }; const __vite_glob_0_0$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: en_US }, Symbol.toStringTag, { value: "Module" })); const zh_CN = { ddei: { uml: { active: "活动", state: "状态", substate: "子状态机", compstate: "复合状态", initstate: "初始状态", finalstate: "最终状态", statecontainer: "状态容器", object: "对象", objname: "对象名", life: "生命线", objlife: "对象生命线", seqobj: "序列对象", rolelife: "角色生命线", hcross: "水平交叉", vcross: "垂直交叉", sendsignal: "发送信号", recsignal: "接收信号", recevent: "接收事件", dot: "点", pause: "暂停", hlane: "水平泳道", vlane: "垂直泳道", matrix: "矩阵", control: "控制", controlflow: "控制流", node: "节点", nodeins: "节点实例", initnode: "初始节点", forknode: "分叉节点", endnode: "终止节点", startnode1: "起点", endnode1: "终点", flowend: "流终", invoke: "调用", transition: "过渡", fork: "分叉", container: "容器", case: "用例", ext: "扩展", extpoint: "扩展点", extcase: "扩展用例", system: "系统", role: "角色", syspart: "系统参与者", participal: "参与者", coop: "协作", assis: "协会", generalization: "泛化", include: "包含", ui: "界面", interface: "接口", reqinte: "需求接口", class: "类", classname: "类名", simpleclass: "简单类", activeclass: "活动类", active1: "激活", activebreak: "激活中断", muti: "多重", enum: "枚举", datatype: "数据类型", signal: "信号", original: "原始", constraint: "约束", collection: "汇聚", package: "包", overview: "概述", model: "模型", relation: "关联", implement: "实现", together: "聚合", compose: "组合", dependent: "依赖", link: "链接", relationship: "关系", component: "组件", compbox: "组件盒", compins: "组件实例", direct: "方向", msg: "消息", async: "异步", asyncmsg: "异步消息", project: "项目", projins: "项目实例", deploydes: "部署描述", depdesins: "部署描述实例", sketchmap: "示意图", communication: "通信", extend: "继承", manifest: "表明", deploy: "部署", entity: "实体", alternative: "替代片段", loopnative: "循环片段", altnative: "抉择片段", optnative: "选项片段", paranative: "并行片段", customnative: "自定义片段", objdel: "对象删除", edge: "边界", switch: "判定", simplehistory: "简略历史", detailhistroy: "详细历史", convert: "转换", groups: { active: "UML-活动", case: "UML-用例", class: "UML-类图", component: "UML-组件", cooperate: "UML-协作", deploy: "UML-部署", sequence: "UML-序列", state: "UML-状态图" } } } }; const __vite_glob_0_1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: zh_CN }, Symbol.toStringTag, { value: "Module" })); const umlActiveActive = { "id": "308001", "name": "ddei.uml.active", "code": "act", "desc": "UML的活动节点", "from": "100500", "define": { width: 110, height: 50, text: "Activity", font: { size: 14 }, border: { round: 10 }, textStyle: { align: 3, valign: 3 }, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: false, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 let x = sample.x,y = sample.y switch(i){ case 0: start = 1 break; case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:x,y:y,select:1,clip:1,stroke:1,fill:1}); }`, //下方子图标 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:35,y:30,type:1,stroke:1}); pvs.push({x:35,y:40,stroke:1,type:1,end:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:45,y:30,type:1,stroke:1}); pvs.push({x:45,y:40,stroke:1,type:1,end:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:35,y:30,type:1,stroke:1}); pvs.push({x:45,y:30,stroke:1,type:1,end:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:40,y:20,type:1,stroke:1}); pvs.push({x:40,y:40,stroke:1,type:1,end:1}); } }`, //定义锚点 `(i, sample, pvs, model, ovs){ switch(i){ case 0: pvs.push({x:sample.x,y:sample.y-25,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y+25,type:0,oppoint:1}); break; case 1: pvs.push({x:sample.x-25,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x+25,y:sample.y,type:0,oppoint:1}); break; case 2: pvs.push({x:sample.x,y:sample.y-25,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y+25,type:0,oppoint:1}); break; case 3: pvs.push({x:sample.x-25,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x+25,y:sample.y,type:0,oppoint:1}); break; } }`, //文本区域,margin:右10,下15 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 let x = sample.x,y = sample.y switch(i){ case 0: start = 1 x-=5 break; case 1: y=15 pvs[0].y=y break; case 2: x+=5 pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:x,y:y,text:1}); }` ] } } }; const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveActive }, Symbol.toStringTag, { value: "Module" })); const umlActiveBranch = { "id": "308023", "name": "ddei.uml.fork", "code": "uc", "desc": "分叉", "from": "301012", "define": { width: 50, border: { width: 1 }, fill: { type: 0 } } }; const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveBranch }, Symbol.toStringTag, { value: "Module" })); const umlActiveContainer = { "id": "308015", "name": "ddei.uml.container", "code": "uc", "desc": "容器", "from": "302003" }; const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveContainer }, Symbol.toStringTag, { value: "Module" })); const umlActiveCross = { "id": "308006", "name": "ddei.uml.hcross", "code": "cross", "desc": "水平交叉", "from": "301012" }; const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveCross }, Symbol.toStringTag, { value: "Module" })); const umlActiveCross1 = { "id": "308007", "name": "ddei.uml.vcross", "code": "cross", "desc": "垂直交叉", "from": "301012", "define": { width: 10, height: 100 } }; const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveCross1 }, Symbol.toStringTag, { value: "Module" })); const umlActiveCtrlflow = { "id": "308019", "name": "ddei.uml.recevent", "code": "ctrlflow", "desc": "接收事件", "from": "100401", "define": { type: 1, ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveCtrlflow }, Symbol.toStringTag, { value: "Module" })); const umlActiveCtrlflow1 = { "id": "308020", "name": "ddei.uml.recevent", "code": "ctrlflow", "desc": "接收事件", "from": "100401", "define": { type: 2, ep: { type: 1 }, pvs: [ { x: -75, y: -75, z: 1 }, { x: 75, y: 75, z: 1 } ] } }; const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveCtrlflow1 }, Symbol.toStringTag, { value: "Module" })); const umlActiveObject = { "id": "308005", "name": "ddei.uml.object", "code": "act", "desc": "UML的对象节点", "from": "102010", "define": { text: "Object" } }; const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveObject }, Symbol.toStringTag, { value: "Module" })); const umlActivePoint = { "id": "308012", "name": "ddei.uml.dot", "code": "point", "desc": "点", "from": "100001", "define": { width: 20, height: 20 } }; const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActivePoint }, Symbol.toStringTag, { value: "Module" })); const umlActiveRecevt = { "id": "308011", "name": "ddei.uml.recevent", "code": "recevt", "desc": "接收事件", "from": "103007", "define": { width: 70, height: 70, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveRecevt }, Symbol.toStringTag, { value: "Module" })); const umlActiveRecmsg = { "id": "308009", "name": "ddei.uml.recsignal", "code": "uarm", "desc": "接收信号", "from": "100500", "define": { width: 110, height: 70, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //绘制线段区域 `(i, sample, pvs, model, ovs){ switch(i){ case 0: pvs.push({begin:1,x:50,y:50,fill:1,clip:1,select:1,oppoint:2,stroke:1}); break; case 1: pvs.push({x:-50,y:50,fill:1,clip:1,oppoint:2,select:1,stroke:1}); break; case 2: pvs.push({x:-25,y:0,fill:1,clip:1,oppoint:2,stroke:1}); pvs.push({x:-50,y:-50,fill:1,clip:1,oppoint:2,select:1,stroke:1}); break; case 3: pvs.push({x:50,y:-50,fill:1,stroke:1,oppoint:2,op2close:1,clip:1,select:1,end:1}); break; } }`, //文本区域 `(i, sample, pvs, model, ovs){ switch(i){ case 0: pvs.push({begin:1,x:50,y:50,text:1}); break; case 1: pvs.push({x:-25,y:50,text:1}); break; case 2: pvs.push({x:-25,y:-50,text:1}); break; case 3: pvs.push({x:50,y:-50,text:1,end:1}); break; } }` ] } } }; const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveRecmsg }, Symbol.toStringTag, { value: "Module" })); const umlActiveSendmsg = { "id": "308008", "name": "ddei.uml.sendsignal", "code": "uasm", "desc": "发送信号", "from": "100500", "define": { width: 110, height: 70, //2为极坐标,缺省点为原点 poly: 2, cIndex: 2, //采样信息 sample: { //一圈采样次数 loop: 4, //半径距离 r: 50, //初始次采样的开始角度 angle: 0, //半径距离 //采样的规则,多组采样返回多组规则 rules: [ //绘制线段区域 `(i, sample, pvs, model, ovs){ switch(i){ case 0: pvs.push({begin:1,x:75,y:0,fill:1,clip:1,select:1,oppoint:2,stroke:1}); break; case 1: pvs.push({x:50,y:50,fill:1,clip:1,text:1,select:1,oppoint:2,stroke:1}); pvs.push({x:-50,y:50,fill:1,clip:1,text:1,select:1,oppoint:2,stroke:1}); break; case 2: pvs.push({x:-50,y:-50,fill:1,clip:1,text:1,select:1,oppoint:2,stroke:1}); break; case 3: pvs.push({x:50,y:-50,fill:1,stroke:1,text:1,clip:1,oppoint:2,op2close:1,select:1,end:1}); break; } }` ] }, iconPos: { dx: -20 } } }; const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveSendmsg }, Symbol.toStringTag, { value: "Module" })); const umlActiveState = { "id": "308004", "name": "ddei.uml.state", "code": "state", "desc": "UML的活动的状态节点", "from": "100009", "define": { width: 120, height: 80, border: { round: 5 }, ext: { sample: { //分割横线的纵坐标 pvalue: -20 }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 115, height: 20, cIndex: 2, id: "100002", border: { type: 0 }, fill: { type: 0 }, text: "State", initCPV: { x: 0, y: -27 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] }, { width: 115, height: 53, cIndex: 2, id: "100002", textStyle: { feed: 1 }, border: { type: 0 }, fill: { type: 0 }, text: "Action", initCPV: { x: 0, y: 12 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ] } }; const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActiveState }, Symbol.toStringTag, { value: "Module" })); const umlCaseCase = { "id": "302002", "name": "ddei.uml.case", "code": "case", "desc": "UML的用例图-用例", "from": "100006", "define": { width: 110, height: 70 } }; const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseCase }, Symbol.toStringTag, { value: "Module" })); const umlCaseCase1 = { "id": "302006", "name": "ddei.uml.extcase", "code": "case", "desc": "UML的用例节点", "from": "100009", "define": { width: 140, height: 90, ext: { sample: { //分割横线的纵坐标 pvalue: -20 }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 136, height: 24, cIndex: 2, id: "100002", border: { type: 0 }, fill: { type: 0 }, text: "ddei.uml.case", initCPV: { x: 0, y: -31.5 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 136, height: 55, cIndex: 2, id: "100002", textStyle: { valign: 1, feed: 1 }, border: { type: 0 }, fill: { type: 0 }, text: "ddei.uml.extpoint", initCPV: { x: 0, y: 16 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ] } }; const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseCase1 }, Symbol.toStringTag, { value: "Module" })); const umlCaseCase2 = { "id": "302007", "name": "ddei.uml.extcase", "code": "case", "desc": "UML的用例节点", "from": "100104", "define": { width: 140, height: 100, ext: { sample: { eqrat: false, //分割横线的纵坐标 pvalue: -10 }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 85, height: 24, cIndex: 2, id: "100002", border: { type: 0 }, fill: { type: 0 }, text: "ddei.uml.case", initCPV: { x: 0, y: -27.5 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 90, height: 45, cIndex: 2, id: "100002", textStyle: { feed: 1 }, border: { type: 0 }, fill: { type: 0 }, text: "ddei.uml.extpoint", initCPV: { x: 0, y: 13 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ] } }; const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseCase2 }, Symbol.toStringTag, { value: "Module" })); const umlCaseColl = { "id": "302010", "name": "ddei.uml.assis", "code": "assis", "desc": "协会", "from": "100401", "define": { type: 2, ep: { type: -1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseColl }, Symbol.toStringTag, { value: "Module" })); const umlCaseCoop = { "id": "302005", "name": "ddei.uml.coop", "code": "coop", "desc": "UML的用例图-协作", "from": "302002", "define": { border: { dash: [10, 5] } } }; const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseCoop }, Symbol.toStringTag, { value: "Module" })); const umlCaseExtend = { "id": "302013", "name": "ddei.uml.ext", "code": "ext", "desc": "扩展", "from": "100401", "define": { type: 2, dash: [10, 10], ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ], iLinkModels: { "0": { type: 3, dx: 0, dy: -10 } } }, //其它同时创建的平级控件 others: [ { "id": "100002", "define": { width: 100, height: 20, text: "<>", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -10 } } } ] }; const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseExtend }, Symbol.toStringTag, { value: "Module" })); const umlCaseInclude = { "id": "302012", "name": "ddei.uml.include", "code": "inc", "desc": "包含", "from": "100401", "define": { type: 2, dash: [10, 10], ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ], iLinkModels: { "0": { type: 3, dx: 0, dy: -10 } } }, //其它同时创建的平级控件 others: [ { "id": "100002", "define": { width: 100, height: 20, text: "<>", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -10 } } } ] }; const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseInclude }, Symbol.toStringTag, { value: "Module" })); const umlCaseInterface = { "id": "302014", "name": "ddei.uml.interface", "code": "inte", "desc": "接口", "from": "100401", "define": { type: 1, sp: { type: 2, weight: 20 }, ep: { type: -1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseInterface }, Symbol.toStringTag, { value: "Module" })); const umlCasePart = { "id": "302004", "name": "ddei.uml.participal", "code": "parti", "desc": "UML的用例图参与者", "from": "100009", "define": { width: 140, height: 90, ext: { sample: { //分割横线的纵坐标 pvalue: -20 }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 136, height: 24, cIndex: 2, id: "100002", border: { type: 0 }, fill: { type: 0 }, textStyle: { align: 3 }, text: "<>", initCPV: { x: 0, y: -31.5 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 136, height: 60, cIndex: 2, id: "100002", textStyle: { align: 3, feed: 1 }, border: { type: 0 }, fill: { type: 0 }, text: "ddei.uml.syspart", initCPV: { x: 0, y: 13.5 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ] } }; const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCasePart }, Symbol.toStringTag, { value: "Module" })); const umlCaseSystem = { "id": "302003", "name": "ddei.uml.system", "code": "coop", "desc": "UML的用例图-协作", "from": "100201", "define": { width: 400, height: 300, text: "系统", textStyle: { valign: 1, align: 3 }, font: { size: 15 } } }; const __vite_glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCaseSystem }, Symbol.toStringTag, { value: "Module" })); const umlClassCls = { "id": "307001", "name": "ddei.uml.class", "code": "cls", "desc": "UML的类节点", "from": "100008", "define": { width: 240, height: 160, border: { round: 5 }, //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 ext: { //追加一个从中间切开的采样点,用于横向切割 sample: { rules: [ `(i, sample, pvs, model,ovs){ if(i == 0){ pvs.push({x:-50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); pvs.push({x:50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); } }`, `(i, sample, pvs, model,ovs){ if(i == 0){ pvs.push({x:-50,y:(ovs[1].y-model.cpv.y),stroke:1,type:1}); pvs.push({x:50,y:(ovs[1].y-model.cpv.y),stroke:1,type:1}); } }` ] }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 240, height: 30, id: "100002", cIndex: 1, text: "ddei.uml.classname", textStyle: { bold: 1, scale: 1 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -65 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 240, height: 64, id: "100002", cIndex: 1, text: ` + attribute1:type = defaultValue + attribute2: type - attribute3: type`, textStyle: { align: 1, feed: 1, scale: 1, vspace: 2 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -17 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 240, height: 64, id: "100002", cIndex: 1, text: ` + operation1(params):returnType - operation2(params) - operation3()`, textStyle: { align: 1, feed: 1, scale: 1, vspace: 2 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 47 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ], //操作点定义 ovs: [ //定义标题区域的高度控制点 { x: 0, y: -31, ix: 0, iy: -50, type: 1, //纵向分割点 constraint: { type: 2, x0: 0, x1: 0, y0: -50, y1: -20 }, //联动,控制第一个和第二个composes[0]的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: ["composes[1]"] } ] }, //定义属性区的高度控制点 { x: 0, y: 9.375, ix: 0, iy: 9.375, type: 1, //纵向分割点 constraint: { type: 2, x0: 0, x1: 0, y0: -31, y1: 50 }, //联动,控制第一个和第二个composes[0]的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[1]"], nextModels: ["composes[2]"] } ] } ] } }; const __vite_glob_0_23 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassCls }, Symbol.toStringTag, { value: "Module" })); const umlClassCls1 = { "id": "307002", "name": "ddei.uml.simpleclass", "code": "cls", "desc": "UML的简单类节点", "from": "308005", "define": { width: 120, height: 80, text: "Class" } }; const __vite_glob_0_24 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassCls1 }, Symbol.toStringTag, { value: "Module" })); const umlClassCls2 = { "id": "307003", "name": "ddei.uml.activeclass", "code": "cls", "desc": "UML的活动类节点", "from": "102040", "define": { width: 180, height: 115, text: "Class" } }; const __vite_glob_0_25 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassCls2 }, Symbol.toStringTag, { value: "Module" })); const umlClassConstraint = { "id": "307011", "name": "ddei.uml.constraint", "code": "constraint", "desc": "UML的类图约束节点", "from": "104125", "define": { ext: { composes: [ {}, {}, { text: "Constraint", textStyle: { align: 3, feed: 1, scale: 1 } } ] } } }; const __vite_glob_0_26 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassConstraint }, Symbol.toStringTag, { value: "Module" })); const umlClassDt = { "id": "307008", "name": "ddei.uml.datatype", "code": "datatype", "desc": "UML的数据类型", "from": "100002", "define": { width: 110, height: 70, text: `<> Datatype`, textStyle: { valign: 1, italic: 1, feed: 1, vspace: 2 } } }; const __vite_glob_0_27 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassDt }, Symbol.toStringTag, { value: "Module" })); const umlClassEnum = { "id": "307007", "name": "ddei.uml.enum", "code": "enum", "desc": "UML的枚举", "from": "100002", "define": { width: 110, height: 70, text: `<> Enumeration`, textStyle: { valign: 1, italic: 1, feed: 1, vspace: 2 } } }; const __vite_glob_0_28 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassEnum }, Symbol.toStringTag, { value: "Module" })); const umlClassGeneralization = { "id": "307019", "name": "ddei.uml.generalization", "code": "gen", "desc": "泛化关系", "from": "100401", "define": { type: 2, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_29 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassGeneralization }, Symbol.toStringTag, { value: "Module" })); const umlClassImpl = { "id": "307020", "name": "ddei.uml.implement", "code": "impl", "desc": "实现关系", "from": "100401", "define": { type: 2, dash: [10, 10], pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_30 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassImpl }, Symbol.toStringTag, { value: "Module" })); const umlClassInterface = { "id": "307004", "name": "ddei.uml.interface", "code": "inte", "desc": "UML的接口节点", "from": "100008", "define": { width: 230, height: 100, border: { round: 5 }, //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 ext: { //追加一个从中间切开的采样点,用于横向切割 sample: { rules: [ `(i, sample, pvs, model,ovs){ if(i == 0){ pvs.push({x:-50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); pvs.push({x:50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); } }` ] }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 230, height: 30, id: "100002", cIndex: 1, text: `<> 接口名`, textStyle: { bold: 1, feed: 1, scale: 1 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -35 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 230, height: 70, id: "100002", cIndex: 1, text: ` + Operation A(int): void + Operation B(): void - Operation C(int): int`, textStyle: { align: 1, feed: 1, scale: 1, vspace: 2 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 15 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ], //操作点定义 ovs: [ //定义标题区域的高度控制点 { x: 0, y: -20, ix: 0, iy: -50, type: 1, //纵向分割点 constraint: { type: 2, x0: 0, x1: 0, y0: -50, y1: -20 }, //联动,控制第一个和第二个composes[0]的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: ["composes[1]"] } ] } ] } }; const __vite_glob_0_31 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassInterface }, Symbol.toStringTag, { value: "Module" })); const umlClassLink = { "id": "307018", "name": "ddei.uml.relation", "code": "uclink", "desc": "UML的关联", "from": "100040", "define": { width: 110, height: 70 } }; const __vite_glob_0_32 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassLink }, Symbol.toStringTag, { value: "Module" })); const umlClassModel = { "id": "307014", "name": "ddei.uml.model", "code": "model", "desc": "UML的模型节点", "from": "305003", "define": { ext: { sample: { //新增一个三角形 rules: [ `(i, sample, pvs, model, ovs){ let baseX = (ovs[1].x-ovs[1].ovi.x-50)-6 let baseY = -50+(ovs[0].y-ovs[0].ovi.y)/2-4.5 pvs.push({begin:1,x:baseX,y:baseY,stroke:1}); pvs.push({x:baseX-4,y:baseY+8,stroke:1}); pvs.push({end:1,x:baseX+4,y:baseY+8,stroke:1}); }` ] }, composes: [ { text: "ddei.uml.model", textStyle: { align: 1 } }, { text: "" } ] } } }; const __vite_glob_0_33 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassModel }, Symbol.toStringTag, { value: "Module" })); const umlClassObj = { "id": "307016", "name": "ddei.uml.object", "code": "obj", "desc": "UML的对象节点", "from": "100008", "define": { width: 230, height: 100, border: { round: 5 }, //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 ext: { //追加一个从中间切开的采样点,用于横向切割 sample: { rules: [ `(i, sample, pvs, model,ovs){ if(i == 0){ pvs.push({x:-50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); pvs.push({x:50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); } }` ] }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 230, height: 30, id: "100002", cIndex: 1, text: `ddei.uml.objname`, textStyle: { bold: 1, feed: 1, scale: 1 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -35 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 230, height: 70, id: "100002", cIndex: 1, text: ` attribute A = value A attribute B = value B`, textStyle: { align: 1, feed: 1, scale: 1, vspace: 2 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 15 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ], //操作点定义 ovs: [ //定义标题区域的高度控制点 { x: 0, y: -20, ix: 0, iy: -50, type: 1, //纵向分割点 constraint: { type: 2, x0: 0, x1: 0, y0: -50, y1: -20 }, //联动,控制第一个和第二个composes[0]的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: ["composes[1]"] } ] } ] } }; const __vite_glob_0_34 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassObj }, Symbol.toStringTag, { value: "Module" })); const umlClassOverview = { "id": "307013", "name": "ddei.uml.overview", "code": "overview", "desc": "UML的概述节点", "from": "305003", "define": { ext: { composes: [ { width: 100, height: 40, text: `<> Package`, textStyle: { feed: 1, align: 1, scale: 1 }, initCPV: { x: -50, y: -60 } }, { height: 120, text: "" } ], //操作点扩展 ovs: [ { x: -25, y: -25, ix: -25, iy: -50, constraint: { type: 2, x0: -25, x1: -25, y0: -50, y1: -20 } }, { x: 0, y: -37.5, ix: -50, iy: -37.5, constraint: { type: 2, x0: -50, x1: 50, y0: -37.5, y1: -37.5 } } ] } } }; const __vite_glob_0_35 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassOverview }, Symbol.toStringTag, { value: "Module" })); const umlClassPackage = { "id": "307012", "name": "ddei.uml.package", "code": "package", "desc": "UML的包节点", "from": "305003", "define": { ext: { composes: [ {}, { text: "" } ] } } }; const __vite_glob_0_36 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassPackage }, Symbol.toStringTag, { value: "Module" })); const umlClassPrimitive = { "id": "307010", "name": "ddei.uml.original", "code": "primitive", "desc": "UML的原始", "from": "100002", "define": { width: 110, height: 70, text: `<> Primitive`, textStyle: { valign: 1, italic: 1, feed: 1, vspace: 2 } } }; const __vite_glob_0_37 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassPrimitive }, Symbol.toStringTag, { value: "Module" })); const umlClassRel = { "id": "307024", "name": "ddei.uml.relation", "code": "erl", "desc": "UML类关联关系", "from": "100401", "define": { type: 2, ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_38 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassRel }, Symbol.toStringTag, { value: "Module" })); const umlClassSignal = { "id": "307009", "name": "ddei.uml.signal", "code": "signal", "desc": "UML的信号", "from": "100002", "define": { width: 110, height: 70, text: `<> Signal`, textStyle: { valign: 1, italic: 1, feed: 1, vspace: 2 } } }; const __vite_glob_0_39 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassSignal }, Symbol.toStringTag, { value: "Module" })); const umlClassUi = { "id": "307005", "name": "ddei.uml.ui", "code": "ui", "desc": "UML的界面节点", "from": "100002", "define": { width: 110, height: 70, text: `<> Interface`, textStyle: { valign: 1, italic: 1, feed: 1, vspace: 2 } } }; const __vite_glob_0_40 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClassUi }, Symbol.toStringTag, { value: "Module" })); const umlCompBox = { "id": "305005", "name": "ddei.uml.compbox", "code": "cbox", "desc": "UML的组件盒节点", "from": "100008", "define": { width: 160, height: 100, text: "<>", textStyle: { valign: 1, align: 3 }, ext: { sample: { rules: [ //文本区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:45,y:50,text:1}); pvs.push({x:-45,y:50,text:1}); pvs.push({x:-45,y:-17,text:1}); pvs.push({end:1,x:45,y:-17,text:1}); } }` ] } }, composes: [ { width: 20, height: 20, cIndex: 2, id: "305101", sample: { textInput: 0 }, initCPV: { x: 60, y: -32 } } ] } }; const __vite_glob_0_41 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompBox }, Symbol.toStringTag, { value: "Module" })); const umlCompComp = { "id": "305001", "name": "ddei.uml.component", "code": "cmp", "desc": "UML的组件节点", "from": "100500", "define": { width: 120, height: 75, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: false, //允许文本输入 textInput: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 let x = sample.x,y = sample.y switch(i){ case 0: start = 1 break; case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:x,y:y,select:1}); }`, //线段与填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:50,y:50,stroke:1,oppoint:2,fill:1}); pvs.push({x:-37.5,y:50,stroke:1,oppoint:2,fill:1}); pvs.push({x:-37.5,y:34,stroke:1,fill:1}); pvs.push({x:-25,y:34,stroke:1,fill:1}); pvs.push({x:-25,y:16,stroke:1,fill:1}); pvs.push({x:-37.5,y:16,stroke:1,fill:1}); pvs.push({x:-37.5,y:-16,stroke:1,fill:1}); pvs.push({x:-25,y:-16,stroke:1,fill:1}); pvs.push({x:-25,y:-34,stroke:1,fill:1}); pvs.push({x:-37.5,y:-34,stroke:1,fill:1}); pvs.push({x:-37.5,y:-50,stroke:1,fill:1,oppoint:2}); pvs.push({end:1,x:50,y:-50,stroke:1,fill:1,oppoint:2,op2close:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:34,stroke:1,fill:1}); pvs.push({x:-25,y:34,stroke:1,fill:1}); pvs.push({x:-25,y:16,stroke:1,fill:1}); pvs.push({x:-50,y:16,stroke:1,fill:1,end:1}); pvs.push({x:-50,y:25,type:0,oppoint:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:-34,stroke:1,fill:1}); pvs.push({x:-25,y:-34,stroke:1,fill:1}); pvs.push({x:-25,y:-16,stroke:1,fill:1}); pvs.push({x:-50,y:-16,stroke:1,fill:1,end:1}); pvs.push({x:-50,y:-25,type:0,oppoint:1}); } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(sample.textInput && i == 0){ pvs.push({begin:1,x:50,y:50,text:1}); pvs.push({x:-25,y:50,text:1}); pvs.push({x:-25,y:-50,text:1}); pvs.push({end:1,x:50,y:-50,text:1}); } }` ] } } }; const __vite_glob_0_42 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompComp }, Symbol.toStringTag, { value: "Module" })); const umlCompComp1 = { "id": "305101", "name": "ddei.uml.component", "code": "cmp", "desc": "UML的组件节点", "from": "100500", "define": { width: 100, height: 100, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: false, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //允许文本输入 textInput: 1, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 let x = sample.x,y = sample.y switch(i){ case 0: start = 1 break; case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:x,y:y,select:1}); }`, //线段与填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:50,y:50,stroke:1,oppoint:2,fill:1}); pvs.push({x:-25,y:50,stroke:1,oppoint:2,fill:1}); pvs.push({x:-25,y:34,stroke:1,fill:1}); pvs.push({x:0,y:34,stroke:1,fill:1}); pvs.push({x:0,y:16,stroke:1,fill:1}); pvs.push({x:-25,y:16,stroke:1,fill:1}); pvs.push({x:-25,y:-16,stroke:1,fill:1}); pvs.push({x:0,y:-16,stroke:1,fill:1}); pvs.push({x:0,y:-34,stroke:1,fill:1}); pvs.push({x:-25,y:-34,stroke:1,fill:1}); pvs.push({x:-25,y:-50,stroke:1,fill:1,oppoint:2}); pvs.push({end:1,x:50,y:-50,stroke:1,fill:1,oppoint:2,op2close:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:34,stroke:1,fill:1}); pvs.push({x:0,y:34,stroke:1,fill:1}); pvs.push({x:0,y:16,stroke:1,fill:1}); pvs.push({x:-50,y:16,stroke:1,fill:1,end:1}); pvs.push({x:-50,y:25,type:0,oppoint:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:-34,stroke:1,fill:1}); pvs.push({x:0,y:-34,stroke:1,fill:1}); pvs.push({x:0,y:-16,stroke:1,fill:1}); pvs.push({x:-50,y:-16,stroke:1,fill:1,end:1}); pvs.push({x:-50,y:-25,type:0,oppoint:1}); } }`, //文本区域 `(i, sample, pvs, model, ovs){ if(sample.textInput && i == 0){ pvs.push({begin:1,x:50,y:50,text:1}); pvs.push({x:-25,y:50,text:1}); pvs.push({x:-25,y:-50,text:1}); pvs.push({end:1,x:50,y:-50,text:1}); } }` ] } } }; const __vite_glob_0_43 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompComp1 }, Symbol.toStringTag, { value: "Module" })); const umlCompCompose = { "id": "305018", "name": "ddei.uml.compose", "code": "compose", "desc": "组合关系", "from": "305017", "define": { sp: { type: 41 } } }; const __vite_glob_0_44 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompCompose }, Symbol.toStringTag, { value: "Module" })); const umlCompDependent = { "id": "305016", "name": "ddei.uml.dependent", "code": "depen", "desc": "依赖关系", "from": "305015", "define": { dash: [10, 10] } }; const __vite_glob_0_45 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompDependent }, Symbol.toStringTag, { value: "Module" })); const umlCompDirect = { "id": "305015", "name": "ddei.uml.direct", "code": "direct", "desc": "方向关系", "from": "100401", "define": { type: 2, ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_46 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompDirect }, Symbol.toStringTag, { value: "Module" })); const umlCompInterface = { "id": "305009", "name": "ddei.uml.interface", "code": "interface", "desc": "接口", "from": "100401", "define": { type: 2, ep: { type: -1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ], //组合控件 composes: [ { width: 20, height: 20, id: "100103", cIndex: 1, initCPV: { x: 0, y: 0, z: 1 } } ], //操作点 ovs: [ { x: 0, y: 0, ix: 0, iy: 0, //约束,控制点的移动路径和位置 constraint: { type: 0 //不允许移动 }, //联动,点移动后控制的其它点 links: [ { type: 1, //1施加矩阵 pvs: ["composes[0]"] } ] } ] } }; const __vite_glob_0_47 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompInterface }, Symbol.toStringTag, { value: "Module" })); const umlCompNode = { "id": "305002", "name": "ddei.uml.node", "code": "node", "desc": "UML的组件节点", "from": "100501", "define": { width: 200, height: 160, text: "ddei.uml.node", textStyle: { align: 1, valign: 1 }, ext: { sample: { eqrat: false } } } }; const __vite_glob_0_48 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompNode }, Symbol.toStringTag, { value: "Module" })); const umlCompPackage = { "id": "305003", "name": "ddei.uml.package", "code": "pkg", "desc": "包", "from": "100500", "define": { width: 200, height: 160, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: false, //只采样一次 loop: 1, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model,ovs){ pvs.push({begin:1,x:50,y:50,stroke:1,fill:1,clip:1,oppoint:2,select:1}); pvs.push({x:-50,y:50,stroke:1,fill:1,clip:1,oppoint:2,select:1}); pvs.push({x:-50,y:(ovs[0].y-model.cpv.y),stroke:1,fill:1,clip:1,oppoint:2,select:1}); pvs.push({x:-50,y:-50,stroke:1,fill:1,clip:1,oppoint:2,select:1}); pvs.push({x:(ovs[1].x-ovs[1].ovi.x-50),y:-50,stroke:1,fill:1,clip:1,oppoint:2,select:1}); pvs.push({x:(ovs[1].x-ovs[1].ovi.x-50),y:(ovs[0].y-model.cpv.y),stroke:1,fill:1,clip:1,oppoint:2,select:1}); pvs.push({x:50,y:(ovs[0].y-model.cpv.y),stroke:1,fill:1,clip:1,oppoint:2,op2close:1,select:1,end:1}); }`, `(i, sample, pvs, model,ovs){ pvs.push({x:-50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); pvs.push({x:50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); }` ] }, // 组合控件 composes: [ { width: 80, height: 20, id: "100002", cIndex: 2, text: "Package", fill: { type: 0 }, border: { type: 0 }, textStyle: { feed: 1, scale: 1 }, initCPV: { x: -60, y: -70 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 200, height: 140, id: "100002", cIndex: 2, fill: { type: 0 }, border: { type: 0 }, text: "Attribute", textStyle: { feed: 1, scale: 1 }, initCPV: { x: 0, y: 10 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ], //操作点定义 ovs: [ //定义垂直控制点 { x: -30, y: -37.5, ix: -30, iy: -50, type: 1, //纵向分割点 constraint: { type: 2, x0: -30, x1: -30, y0: -50, y1: -20 }, //联动,控制composes的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: ["composes[1]"] } ] }, //上方标题的区域宽度控制点 { x: -10, y: -43.75, ix: -50, iy: -43.75, type: 2, //横向分割点 constraint: { type: 2, x0: -50, x1: 50, y0: -43.75, y1: -43.75 }, //联动,控制第一个和第二个composes的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_h_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: [] } ] } ], ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_49 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompPackage }, Symbol.toStringTag, { value: "Module" })); const umlCompRel = { "id": "305014", "name": "ddei.uml.dependent", "code": "erl", "desc": "依赖关系", "from": "100401", "define": { type: 2, ep: { type: -1 }, sp: { type: -1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_50 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompRel }, Symbol.toStringTag, { value: "Module" })); const umlCompReqinte = { "id": "305010", "name": "ddei.uml.reqinte", "code": "reqinte", "desc": "需求接口", "from": "100401", "define": { type: 2, ep: { type: -1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ], //组合控件 composes: [ { width: 25, height: 25, id: "100110", cIndex: 1, initCPV: { x: -75, y: 0, z: 1 } } ], //操作点 ovs: [ { x: 0, y: 0, ix: 0, iy: 0, //约束,控制点的移动路径和位置 constraint: { type: 0 //不允许移动 }, //联动,点移动后控制的其它点 links: [ { type: 1, //1施加矩阵 pvs: ["composes[0]"] } ] } ] } }; const __vite_glob_0_51 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompReqinte }, Symbol.toStringTag, { value: "Module" })); const umlCompTogether = { "id": "305017", "name": "ddei.uml.together", "code": "together", "desc": "依赖关系", "from": "100401", "define": { type: 2, ep: { type: -1 }, sp: { type: 4 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_52 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCompTogether }, Symbol.toStringTag, { value: "Module" })); const umlCopMsg = { "id": "306003", "name": "ddei.uml.msg", "code": "msg", "desc": "消息", "from": "305015", "define": { dash: [], ep: { type: -1 } } }; const __vite_glob_0_53 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCopMsg }, Symbol.toStringTag, { value: "Module" })); const umlCopMsg1 = { "id": "306004", "name": "ddei.uml.msg", "code": "msg", "desc": "消息", "from": "306003", define: { ep: { type: 51, weight: 15 }, iLinkModels: { "0": { type: 3, dx: -135, dy: 0 } } }, others: [ { "id": "100002", "define": { width: 100, height: 20, text: "Operation A()", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: -60, y: 0 } } } ] }; const __vite_glob_0_54 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCopMsg1 }, Symbol.toStringTag, { value: "Module" })); const umlCopMsg2 = { "id": "306005", "name": "ddei.uml.msg", "code": "msg", "desc": "消息", "from": "306004", define: { pvs: [ { x: 0, y: 0, z: 1 }, { x: 0, y: 50, z: 1 } ], iLinkModels: { "0": { type: 3, dx: -60, dy: 0 } }, iconPos: { dy: -50, dx: 50 } }, others: [ { "id": "100002", "define": { width: 100, height: 20, text: "Operation A()", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: -60, y: 25 } } } ] }; const __vite_glob_0_55 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCopMsg2 }, Symbol.toStringTag, { value: "Module" })); const umlCopMsg3 = { "id": "306006", "name": "ddei.uml.msg", "code": "msg", "desc": "消息", "from": "306004", define: { pvs: [ { x: 0, y: 0, z: 1 }, { x: 0, y: 50, z: 1 } ], iLinkModels: { "0": { type: 3, dx: 65, dy: 0 } }, iconPos: { dy: -50, dx: -50 } }, others: [ { "id": "100002", "define": { width: 100, height: 20, text: "Operation A()", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 65, y: 25 } } } ] }; const __vite_glob_0_56 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCopMsg3 }, Symbol.toStringTag, { value: "Module" })); const umlCopMsg4 = { "id": "306007", "name": "ddei.uml.msg", "code": "msg", "desc": "消息", "from": "306004", define: { pvs: [ { x: 0, y: 0, z: 1 }, { x: -75, y: 0, z: 1 } ], iLinkModels: { "0": { type: 3, dx: 100, dy: 0 } } }, others: [ { "id": "100002", "define": { width: 100, height: 20, text: "Operation A()", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 65, y: 0 } } } ] }; const __vite_glob_0_57 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCopMsg4 }, Symbol.toStringTag, { value: "Module" })); const umlCopMsg5 = { "id": "306008", "name": "ddei.uml.msg", "code": "msg", "desc": "消息", "from": "306004", define: { pvs: [ { x: 0, y: 0, z: 1 }, { x: 0, y: -50, z: 1 } ], iLinkModels: { "0": { type: 3, dx: -60, dy: 0 } }, iconPos: { dy: 50, dx: 50 } }, others: [ { "id": "100002", "define": { width: 100, height: 20, text: "Operation A()", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: -60, y: -25 } } } ] }; const __vite_glob_0_58 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCopMsg5 }, Symbol.toStringTag, { value: "Module" })); const umlCopMsg6 = { "id": "306009", "name": "ddei.uml.msg", "code": "msg", "desc": "消息", "from": "306004", define: { pvs: [ { x: 0, y: 0, z: 1 }, { x: 0, y: -50, z: 1 } ], iLinkModels: { "0": { type: 3, dx: 60, dy: 0 } }, iconPos: { dy: 50, dx: -50 } }, others: [ { "id": "100002", "define": { width: 100, height: 20, text: "Operation A()", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 65, y: -25 } } } ] }; const __vite_glob_0_59 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCopMsg6 }, Symbol.toStringTag, { value: "Module" })); const umlDepComm = { "id": "304018", "name": "ddei.uml.communication", "code": "comm", "desc": "通信", "from": "100401", "define": { type: 2, ep: { type: -1 }, sp: { type: -1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_60 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepComm }, Symbol.toStringTag, { value: "Module" })); const umlDepCompIns = { "id": "304005", "name": "ddei.uml.compins", "code": "compins", "desc": "UML的组件实例", "from": "305001", "define": { width: 140, height: 80, text: `Component Instance`, textStyle: { feed: 1, underline: 1, align: 3 } } }; const __vite_glob_0_61 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepCompIns }, Symbol.toStringTag, { value: "Module" })); const umlDepCompIns1 = { "id": "304007", "name": "ddei.uml.compins", "code": "compins", "desc": "UML的组件实例", "from": "304006", "define": { text: `<> Component A` } }; const __vite_glob_0_62 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepCompIns1 }, Symbol.toStringTag, { value: "Module" })); const umlDepComp = { "id": "304004", "name": "ddei.uml.component", "code": "comp", "desc": "UML的组件", "from": "305001", "define": { width: 140, height: 80, text: "Component" } }; const __vite_glob_0_63 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepComp }, Symbol.toStringTag, { value: "Module" })); const umlDepComp1 = { "id": "304006", "name": "ddei.uml.component", "code": "comp", "desc": "UML的组件", "from": "305005", "define": { textStyle: { feed: 1, valign: 1 } } }; const __vite_glob_0_64 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepComp1 }, Symbol.toStringTag, { value: "Module" })); const umlDepDepend = { "id": "304020", "name": "ddei.uml.dependent", "code": "depend", "desc": "依赖", "from": "100401", "define": { type: 2, dash: [20, 10], ep: { type: 1 }, sp: { type: -1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_65 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepDepend }, Symbol.toStringTag, { value: "Module" })); const umlDepDeploy = { "id": "304023", "name": "ddei.uml.deploy", "code": "deploy", "desc": "部署", "from": "100401", "define": { type: 2, dash: [20, 10], ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ], iLinkModels: { "0": { type: 3, dx: 0, dy: -10 } } }, //其它同时创建的平级控件 others: [ { "id": "100002", "define": { width: 100, height: 20, text: "<>", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -10 } } } ] }; const __vite_glob_0_66 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepDeploy }, Symbol.toStringTag, { value: "Module" })); const umlDepExtend = { "id": "304019", "name": "ddei.uml.extend", "code": "extend", "desc": "继承", "from": "100401", "define": { type: 2, ep: { type: 1 }, sp: { type: -1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_67 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepExtend }, Symbol.toStringTag, { value: "Module" })); const umlDepManifest = { "id": "304022", "name": "ddei.uml.manifest", "code": "manifest", "desc": "表明", "from": "100401", "define": { type: 2, dash: [20, 10], ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ], iLinkModels: { "0": { type: 3, dx: 0, dy: -10 } } }, //其它同时创建的平级控件 others: [ { "id": "100002", "define": { width: 100, height: 20, text: "<>", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -10 } } } ] }; const __vite_glob_0_68 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepManifest }, Symbol.toStringTag, { value: "Module" })); const umlDepNodeIns = { "id": "304011", "name": "ddei.uml.nodeins", "code": "nodeins", "desc": "UML的节点实例", "from": "305002", "define": { text: `Node Instance`, textStyle: { align: 2, valign: 1, feed: 1, underline: 1 } } }; const __vite_glob_0_69 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepNodeIns }, Symbol.toStringTag, { value: "Module" })); const umlDepNode = { "id": "304010", "name": "ddei.uml.node", "code": "node", "desc": "UML的节点", "from": "305002", "define": { text: `Node`, textStyle: { align: 2, valign: 1, feed: 1 } } }; const __vite_glob_0_70 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepNode }, Symbol.toStringTag, { value: "Module" })); const umlDepObj = { "id": "304003", "name": "ddei.uml.object", "code": "obj", "desc": "UML的对象节点", "from": "100008", "define": { width: 160, height: 100, //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 ext: { //追加一个从中间切开的采样点,用于横向切割 sample: { rules: [ `(i, sample, pvs, model,ovs){ if(i == 0){ pvs.push({x:-50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); pvs.push({x:50,y:(ovs[0].y-model.cpv.y),stroke:1,type:1}); } }` ] }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 160, height: 30, id: "100002", cIndex: 1, text: `ddei.uml.objname`, textStyle: { underline: 1, feed: 1, scale: 1, align: 3 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -35 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 160, height: 70, id: "100002", cIndex: 1, text: ` attribute A = value A`, textStyle: { align: 3, feed: 1, scale: 1, vspace: 2 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 15 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ], //操作点定义 ovs: [ //定义标题区域的高度控制点 { x: 0, y: -20, ix: 0, iy: -50, type: 1, //纵向分割点 constraint: { type: 2, x0: 0, x1: 0, y0: -50, y1: -20 }, //联动,控制第一个和第二个composes[0]的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: ["composes[1]"] } ] } ] } }; const __vite_glob_0_71 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepObj }, Symbol.toStringTag, { value: "Module" })); const umlDepOverviewIns = { "id": "304014", "name": "ddei.uml.depdesins", "code": "ovins", "desc": "UML的部署概述实例", "from": "100002", "define": { text: `<> Deployment Specification A`, textStyle: { feed: 1 } } }; const __vite_glob_0_72 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepOverviewIns }, Symbol.toStringTag, { value: "Module" })); const umlDepOverview = { "id": "304013", "name": "ddei.uml.deploydes", "code": "node", "desc": "UML的部署概述", "from": "100002", "define": { text: `<>` } }; const __vite_glob_0_73 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepOverview }, Symbol.toStringTag, { value: "Module" })); const umlDepTogether = { "id": "304021", "name": "ddei.uml.together", "code": "together", "desc": "聚合", "from": "100401", "define": { type: 2, ep: { type: -1 }, sp: { type: 4, weight: 10 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_74 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDepTogether }, Symbol.toStringTag, { value: "Module" })); const umlSeqActBreak = { "id": "303005", "name": "ddei.uml.activebreak", "code": "actbreak", "desc": "激活中断", "from": "100500", "define": { width: 20, height: 200, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { //一圈4次采样 loop: 1, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选择区 `(i, sample, pvs, model, ovs){ pvs.push({begin:1,x:50,y:50,clip:1,select:1}); pvs.push({x:-50,y:50,clip:1,select:1}); pvs.push({x:-50,y:-50,clip:1,select:1}); pvs.push({end:1,x:50,y:-50,clip:1,select:1}); }`, //下半部分区域 `(i, sample, pvs, model, ovs){ let bpv = DDeiUtil.pointsToZero([model.bpv], model.cpv, model.rotate)[0] let unitH = 15 * (bpv.y ? 100 / bpv.y : 1) pvs.push({begin:1,x:50,y:50,stroke:1,fill:1}); pvs.push({x:-50,y:50,stroke:1,fill:1}); pvs.push({x:-50,y:unitH,stroke:1,fill:1}); pvs.push({end:1,x:50,y:0.5*unitH,stroke:1,fill:1}); }`, //上办部分区域 `(i, sample, pvs, model, ovs){ let bpv = DDeiUtil.pointsToZero([model.bpv], model.cpv, model.rotate)[0] let unitH = 15 * (bpv.y ? 100 / bpv.y : 1) pvs.push({begin:1,x:-50,y:-50,stroke:1,fill:1}); pvs.push({x:50,y:-50,stroke:1,fill:1}); pvs.push({x:50,y:-0.5*unitH,stroke:1,fill:1}); pvs.push({end:1,x:-50,y:-unitH,stroke:1,fill:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let bpv = DDeiUtil.pointsToZero([model.bpv], model.cpv, model.rotate)[0] let unitH = 20 * (bpv.y ? 100 / bpv.y : 1) for(let i = -50; i <= 50; i+=unitH){ pvs.push({ x: -50, y: i, type: 0, oppoint: 1 }); pvs.push({ x: 50, y: i, type: 0, oppoint: 1 }); } }` ] } } }; const __vite_glob_0_75 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqActBreak }, Symbol.toStringTag, { value: "Module" })); const umlSeqAct = { "id": "303004", "name": "ddei.uml.active1", "code": "act", "desc": "激活", "from": "100008", "define": { width: 20, height: 200, ext: { sample: { rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ let bpv = DDeiUtil.pointsToZero([model.bpv], model.cpv, model.rotate)[0] let unitH = 20 * (bpv.y ? 100/bpv.y : 1) for(let i = -50;i <= 50;i+=unitH){ pvs.push({x:-50,y:i,oppoint:1}); pvs.push({x:50,y:i,oppoint:1}); } } }` ] } } } }; const __vite_glob_0_76 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqAct }, Symbol.toStringTag, { value: "Module" })); const umlSeqActorLife = { "id": "303015", "name": "ddei.uml.rolelife", "code": "actor", "desc": "角色生命线", "from": "100000", "define": { create: false, initMerges: [0, 1], ext: { //清空所有属性 groups: [] }, iconPos: { dy: -150 } }, //其它同时创建的平级控件 others: [ { "id": "303014" }, { "id": "303002", "define": { pvs: [ { x: 0, y: 30, z: 1 }, { x: 0, y: 450, z: 1 } ] } } ] }; const __vite_glob_0_77 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqActorLife }, Symbol.toStringTag, { value: "Module" })); const umlSeqActor = { "id": "303014", "name": "ddei.uml.role", "code": "actor", "desc": "角色", "from": "103006", "define": { text: "Actor", iconPos: { dy: -10 }, depPos: { type: 8 }, //一圈 depProps: { "8": "text" //映射属性 } } }; const __vite_glob_0_78 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqActor }, Symbol.toStringTag, { value: "Module" })); const umlSeqAlt = { "id": "303009", "name": "ddei.uml.altnative", "code": "alt", "desc": "抉择片段", "from": "303008", "define": { ext: { composes: [ { text: "Alt" } ] } } }; const __vite_glob_0_79 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqAlt }, Symbol.toStringTag, { value: "Module" })); const umlSeqAlternative = { "id": "303007", "name": "ddei.uml.alternative", "code": "alternative", "desc": "替代片段", "from": "100008", "define": { width: 240, height: 160, //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 ext: { sample: { rules: [ `(i, sample, pvs, model,ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:(ovs[0].y-model.cpv.y),stroke:1}); pvs.push({x:-50,y:-50,stroke:1}); pvs.push({x:(ovs[2].x-ovs[2].ovi.x-50),y:-50,stroke:1}); pvs.push({x:(ovs[2].x-ovs[2].ovi.x-50),y:(ovs[0].y-model.cpv.y)-5,stroke:1}); pvs.push({x:(ovs[2].x-ovs[2].ovi.x-50)-5,y:(ovs[0].y-model.cpv.y),stroke:1}); pvs.push({x:-50,y:(ovs[0].y-model.cpv.y),stroke:1,end:1}); } }`, //追加一个从中间切开的采样点,用于横向切割 `(i, sample, pvs, model,ovs){ if(i == 0){ pvs.push({x:-50,y:(ovs[1].y-model.cpv.y),stroke:1,type:1}); pvs.push({x:50,y:(ovs[1].y-model.cpv.y),stroke:1,type:1}); } }` ] }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 88, height: 22, id: "100002", cIndex: 1, text: "Alternative", textStyle: { scale: 1, align: 1 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: -70, y: -68 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 230, height: 65, id: "100002", cIndex: 1, text: `[Condition]`, textStyle: { align: 1, feed: 1, scale: 1, vspace: 2 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: -22.5 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 230, height: 65, id: "100002", cIndex: 1, text: `[Else]`, textStyle: { align: 1, feed: 1, scale: 1, vspace: 2 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 45 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ], //操作点定义 ovs: [ //定义标题区域的高度控制点 { x: -31.25, y: -35, ix: -31.25, iy: -50, type: 1, //纵向分割点 constraint: { type: 2, x0: -31.25, x1: -31.25, y0: -50, y1: -20 }, //联动,控制第一个和第二个composes[0]的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: ["composes[1]"] } ] }, //定义属性区的高度控制点 { x: 0, y: 6, ix: 0, iy: 6, type: 1, //纵向分割点 constraint: { type: 2, x0: 0, x1: 0, y0: -35, y1: 50 }, //联动,控制第一个和第二个composes[0]的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[1]"], nextModels: ["composes[2]"] } ] }, //上方标题的区域宽度控制点 { x: -10, y: -43.75, ix: -50, iy: -43.75, type: 2, //横向分割点 constraint: { type: 2, x0: -40, x1: 40, y0: -43.75, y1: -43.75 }, //联动,控制第一个和第二个composes的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_h_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: [] } ] } ] } }; const __vite_glob_0_80 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqAlternative }, Symbol.toStringTag, { value: "Module" })); const umlSeqAsync = { "id": "303021", "name": "ddei.uml.asyncmsg", "code": "async", "desc": "异步消息", "from": "100401", "define": { type: 2, ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_81 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqAsync }, Symbol.toStringTag, { value: "Module" })); const umlSeqControl = { "id": "303018", "name": "ddei.uml.control", "code": "control", "desc": "控制", "from": "100500", "define": { width: 60, height: 60, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2 let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); if(i == 3){ pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,begin:1,end:1}); } }`, //上方箭头 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:0,y:-50,type:1,stroke:1}); pvs.push({x:7.5,y:-56.5,type:1,stroke:1}); pvs.push({x:0,y:-50}); pvs.push({x:6.5,y:-42.5,type:1,stroke:1}); pvs.push({end:1,x:0,y:-50,type:1,stroke:1}); } }` ] }, iconPos: { dy: -10 }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } }, //其它同时创建的平级控件 others: [ { "id": "100002", "define": { width: 100, height: 25, text: "Control", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 42 } } } ] }; const __vite_glob_0_82 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqControl }, Symbol.toStringTag, { value: "Module" })); const umlSeqCustom = { "id": "303012", "name": "ddei.uml.customnative", "code": "custom", "desc": "自定义片段", "from": "303008", "define": { ext: { composes: [ { text: "Custom" } ] } } }; const __vite_glob_0_83 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqCustom }, Symbol.toStringTag, { value: "Module" })); const umlSeqEdge = { "id": "303017", "name": "ddei.uml.edge", "code": "edge", "desc": "边界", "from": "100500", "define": { width: 60, height: 60, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:50,y:50,select:1}); pvs.push({x:-65,y:50,select:1}); pvs.push({x:-65,y:-50,select:1}); pvs.push({x:50,y:-50,select:1}); } }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); if(i == 3){ pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,begin:1,end:1}); } }`, //左方线 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:0,type:1,stroke:1}); pvs.push({end:1,x:-65,y:0,type:1,stroke:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:-65,y:50,type:1,stroke:1,oppoint:2}); pvs.push({end:1,x:-65,y:-50,type:1,stroke:1,oppoint:2}); } }` ] }, iconPos: { dy: -10 }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } }, //其它同时创建的平级控件 others: [ { "id": "100002", "define": { width: 100, height: 25, text: "Boundary", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 42 } } } ] }; const __vite_glob_0_84 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqEdge }, Symbol.toStringTag, { value: "Module" })); const umlSeqEntity = { "id": "303016", "name": "ddei.uml.entity", "code": "entity", "desc": "实体", "from": "100500", "define": { width: 60, height: 60, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2 let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); if(i == 3){ pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,begin:1,end:1}); } }`, //下方横线 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:50,type:1,stroke:1}); pvs.push({end:1,x:50,y:50,type:1,stroke:1}); } }` ] }, iconPos: { dy: -10 }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } }, //其它同时创建的平级控件 others: [ { "id": "100002", "define": { width: 100, height: 25, text: "Entity", fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 42 } } } ] }; const __vite_glob_0_85 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqEntity }, Symbol.toStringTag, { value: "Module" })); const umlSeqInv = { "id": "303019", "name": "ddei.uml.invoke", "code": "inv", "desc": "调用", "from": "100401", "define": { type: 2, ep: { type: 51 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_86 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqInv }, Symbol.toStringTag, { value: "Module" })); const umlSeqLife = { "id": "303002", "name": "ddei.uml.life", "code": "life", "desc": "生命线", "from": "100401", "define": { type: 1, ep: { type: -1 }, dash: [20, 10], border: { width: 2 }, pvs: [ { x: 0, y: -225, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 0, y: 225, z: 1 } ], //线段本身的一些限制 constraint: { ep: { //只允许开始节点创建链接 link: false }, type: { //直线的情况下,开始节点和结束节点的角度限制范围(旋转后则为角度+rotate) "1": { //限制角度区间 angles: [[90, 90], [0, 0], [180, 180], [-90, -90]] } } } } }; const __vite_glob_0_87 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqLife }, Symbol.toStringTag, { value: "Module" })); const umlSeqLoop = { "id": "303008", "name": "ddei.uml.loopnative", "code": "loop", "desc": "循环片段", "from": "100008", "define": { width: 240, height: 160, //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 ext: { //追加一个从中间切开的采样点,用于横向切割 sample: { rules: [ `(i, sample, pvs, model,ovs){ if(i == 0){ pvs.push({begin:1,x:-50,y:(ovs[0].y-model.cpv.y),stroke:1}); pvs.push({x:-50,y:-50,stroke:1}); pvs.push({x:(ovs[1].x-ovs[1].ovi.x-50),y:-50,stroke:1}); pvs.push({x:(ovs[1].x-ovs[1].ovi.x-50),y:(ovs[0].y-model.cpv.y)-5,stroke:1}); pvs.push({x:(ovs[1].x-ovs[1].ovi.x-50)-5,y:(ovs[0].y-model.cpv.y),stroke:1}); pvs.push({x:-50,y:(ovs[0].y-model.cpv.y),stroke:1,end:1}); } }` ] }, groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 88, height: 22, id: "100002", cIndex: 1, text: "Loop", textStyle: { scale: 1, align: 1 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: -72, y: -68 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] }, { width: 230, height: 130, id: "100002", cIndex: 1, text: `[Parameters]`, textStyle: { align: 1, valign: 1, feed: 1, scale: 1, vspace: 2 }, fill: { type: 0 }, border: { type: 0 }, initCPV: { x: 0, y: 13 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ], //操作点定义 ovs: [ //定义标题区域的高度控制点 { x: -31.25, y: -35, ix: -31.25, iy: -50, type: 1, //纵向分割点 constraint: { type: 2, x0: -31.25, x1: -31.25, y0: -50, y1: -20 }, //联动,控制第一个和第二个composes[0]的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_v_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: ["composes[1]"] } ] }, //上方标题的区域宽度控制点 { x: -10, y: -43.75, ix: -50, iy: -43.75, type: 2, //横向分割点 constraint: { type: 2, x0: -40, x1: 40, y0: -43.75, y1: -43.75 }, //联动,控制第一个和第二个composes的大小 //这里计算较为复杂,需要用脚本来进行控制 links: [ { type: 99, //执行脚本 script: ov_link_h_split_point, //参数可以自定义,脚本中可以取到 models: ["composes[0]"], nextModels: [] } ] } ] } }; const __vite_glob_0_88 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqLoop }, Symbol.toStringTag, { value: "Module" })); const umlSeqObj = { "id": "303003", "name": "ddei.uml.seqobj", "code": "obj", "desc": "序列对象", "from": "100002", "define": { width: 120, height: 60, text: "ddei.uml.object" } }; const __vite_glob_0_89 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqObj }, Symbol.toStringTag, { value: "Module" })); const umlSeqObjdel = { "id": "303013", "name": "ddei.uml.objdel", "code": "objdel", "desc": "对象删除", "from": "100500", "define": { width: 40, height: 40, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2 let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:0,y:50,type:0,oppoint:1}); pvs.push({x:-50,y:0,type:0,oppoint:1}); pvs.push({x:0,y:-50,type:0,oppoint:1}); pvs.push({x:50,y:0,type:0,oppoint:1}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:sample.x,y:sample.y,stroke:1,begin:1,type:1}); }else if(i == 2){ pvs.push({x:sample.x,y:sample.y,stroke:1,end:1,type:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 1){ pvs.push({x:sample.x,y:sample.y,stroke:1,begin:1,type:1}); }else if(i == 3){ pvs.push({x:sample.x,y:sample.y,stroke:1,end:1,type:1}); } }` ] }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_90 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqObjdel }, Symbol.toStringTag, { value: "Module" })); const umlSeqObjlife = { "id": "303001", "name": "ddei.uml.objlife", "code": "obj", "desc": "对象生命线", "from": "100000", "define": { create: false, initMerges: [0, 1], iconPos: { dy: -150 } }, //其它同时创建的平级控件 others: [ { "id": "303003" }, { "id": "303002", "define": { pvs: [ { x: 0, y: 30, z: 1 }, { x: 0, y: 450, z: 1 } ] } } ] }; const __vite_glob_0_91 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqObjlife }, Symbol.toStringTag, { value: "Module" })); const umlSeqOpt = { "id": "303010", "name": "ddei.uml.optnative", "code": "opt", "desc": "选项片段", "from": "303008", "define": { ext: { composes: [ { text: "Opt" } ] } } }; const __vite_glob_0_92 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqOpt }, Symbol.toStringTag, { value: "Module" })); const umlSeqPackage = { "id": "303006", "name": "ddei.uml.package", "code": "pkg", "desc": "包", "from": "305003" }; const __vite_glob_0_93 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqPackage }, Symbol.toStringTag, { value: "Module" })); const umlSeqPar = { "id": "303011", "name": "ddei.uml.paranative", "code": "par", "desc": "并行片段", "from": "303008", "define": { ext: { composes: [ { text: "Par" } ] } } }; const __vite_glob_0_94 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqPar }, Symbol.toStringTag, { value: "Module" })); const umlSeqTransition = { "id": "303020", "name": "ddei.uml.transition", "code": "trans", "desc": "过渡", "from": "100401", "define": { type: 2, dash: [20, 10], ep: { type: 1 }, pvs: [ { x: 75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: -75, y: 0, z: 1 } ] } }; const __vite_glob_0_95 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSeqTransition }, Symbol.toStringTag, { value: "Module" })); const umlStateBranch = { "id": "301012", "name": "ddei.uml.fork", "code": "branch", "desc": "UML的状态的分叉", "from": "100002", "define": { width: 100, height: 10, border: { width: 0, round: 2 }, fill: { color: "#017fff" }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_96 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateBranch }, Symbol.toStringTag, { value: "Module" })); const umlStateCollect = { "id": "301013", "name": "ddei.uml.collection", "code": "coll", "desc": "UML的状态的汇聚", "from": "301012" }; const __vite_glob_0_97 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateCollect }, Symbol.toStringTag, { value: "Module" })); const umlStateConstraint = { "id": "301010", "name": "ddei.uml.constraint", "code": "constr", "desc": "UML的约束", "from": "103005", "define": { width: 140, height: 90, textStyle: { align: 3, feed: 1 }, text: ` Constraint Name : Body`, composes: [ { width: 90, height: 18, cIndex: 3, id: "100002", border: { type: 0 }, fill: { type: 0 }, textStyle: { align: 2 }, text: "<>", initCPV: { x: -15, y: -35 }, attrLinks: [ { code: "font", mapping: ["*"] }, { code: "textStyle", mapping: ["*"] } ] } ], ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] } } }; const __vite_glob_0_98 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateConstraint }, Symbol.toStringTag, { value: "Module" })); const umlStateConvert = { "id": "301014", "name": "ddei.uml.convert", "code": "conv", "desc": "转换", "from": "100401", "define": { type: 2, ep: { type: 1 }, pvs: [ { x: -75, y: 0, z: 1 }, { x: 0, y: 0, z: 1 }, { x: 75, y: 0, z: 1 } ] } }; const __vite_glob_0_99 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateConvert }, Symbol.toStringTag, { value: "Module" })); const umlStateEnd = { "id": "301006", "name": "ddei.uml.flowend", "code": "end", "desc": "UML流程终止", "from": "100500", "define": { width: 40, height: 40, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2 let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); if(i == 3){ pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:sample.x,y:sample.y,stroke:1,begin:1,type:1}); }else if(i == 2){ pvs.push({x:sample.x,y:sample.y,stroke:1,end:1,type:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 1){ pvs.push({x:sample.x,y:sample.y,stroke:1,begin:1,type:1}); }else if(i == 3){ pvs.push({x:sample.x,y:sample.y,stroke:1,end:1,type:1}); } }` ] }, ext: { groups: [ { name: "ddei.style", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } ] } ] } } }; const __vite_glob_0_100 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateEnd }, Symbol.toStringTag, { value: "Module" })); const umlStateHis = { "id": "301008", "name": "ddei.uml.simplehistory", "code": "his", "desc": "UML状态机简略历史", "from": "100003", "define": { width: 40, height: 40, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2 let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); if(i == 3){ pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:-17.5,y:-25,stroke:1,begin:1,type:1}); pvs.push({x:-17.5,y:25,stroke:1,end:1,type:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:17.5,y:-25,stroke:1,begin:1,type:1}); pvs.push({x:17.5,y:25,stroke:1,end:1,type:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:-17.5,y:0,stroke:1,begin:1,type:1}); pvs.push({x:17.5,y:0,stroke:1,end:1,type:1}); } }` ] }, ext: { groups: [ { name: "属性", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] } ] } ] } } }; const __vite_glob_0_101 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateHis }, Symbol.toStringTag, { value: "Module" })); const umlStateHis1 = { "id": "301009", "name": "ddei.uml.detailhistroy", "code": "his", "desc": "UML状态机详细历史", "from": "100003", "define": { width: 40, height: 40, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: 1, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 45, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ //选中区域 `(i, sample, pvs, model, ovs){ let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2 let x = er * sample.cos let y = er * sample.sin pvs.push({x:x,y:y,r:er,select:1}); }`, //操作点 `(i, sample, pvs, model, ovs){ let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); if(i == 3){ pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); } }`, //绘制线段、填充区域 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:-25.5,y:-25,stroke:1,begin:1,type:1}); pvs.push({x:-25.5,y:25,stroke:1,end:1,type:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:9.5,y:-25,stroke:1,begin:1,type:1}); pvs.push({x:9.5,y:25,stroke:1,end:1,type:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:-25.5,y:0,stroke:1,begin:1,type:1}); pvs.push({x:9.5,y:0,stroke:1,end:1,type:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:13,y:-15,stroke:1,begin:1,type:1}); pvs.push({x:33,y:-15,stroke:1,end:1,type:1}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({x:23,y:-25,stroke:1,begin:1,type:1}); pvs.push({x:23,y:-5,stroke:1,end:1,type:1}); } }` ] }, ext: { groups: [ { name: "属性", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] } ] } ] } } }; const __vite_glob_0_102 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateHis1 }, Symbol.toStringTag, { value: "Module" })); const umlStateState = { "id": "301001", "name": "ddei.uml.state", "code": "state", "desc": "UML的状态机节点", "from": "100500", "define": { width: 110, height: 50, text: "State", font: { size: 14 }, border: { round: 10 }, textStyle: { align: 3 }, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: false, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 let x = sample.x,y = sample.y switch(i){ case 0: start = 1 break; case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:x,y:y,select:1,clip:1,stroke:1,fill:1}); }`, //定义锚点 `(i, sample, pvs, model, ovs){ switch(i){ case 0: pvs.push({x:sample.x,y:sample.y-25,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y+25,type:0,oppoint:1}); break; case 1: pvs.push({x:sample.x-25,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x+25,y:sample.y,type:0,oppoint:1}); break; case 2: pvs.push({x:sample.x,y:sample.y-25,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y+25,type:0,oppoint:1}); break; case 3: pvs.push({x:sample.x-25,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x+25,y:sample.y,type:0,oppoint:1}); break; } }`, //文本区域,右margin:5 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 let x = sample.x,y = sample.y switch(i){ case 0: start = 1 x-=5 break; case 1: pvs[0].y=y break; case 2: x+=5 pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:x,y:y,text:1}); }` ] } } }; const __vite_glob_0_103 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateState }, Symbol.toStringTag, { value: "Module" })); const umlStateState1 = { "id": "301003", "name": "ddei.uml.state", "code": "state", "desc": "UML的状态机节点", "from": "100009", "define": { width: 140, height: 90, border: { round: 5 }, ext: { sample: { //分割横线的纵坐标 pvalue: -20 }, groups: [ { name: "属性", icon: "icon-fill", subGroups: [ { name: "ddei.style", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity", "border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] }, { name: "文本", attrs: [ "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed", "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic", "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace" ] } ] } ] }, //组合控件 composes: [ { width: 136, height: 24, cIndex: 2, id: "100002", border: { type: 0 }, fill: { type: 0 }, textStyle: { align: 3 }, text: "Name", initCPV: { x: 0, y: -31.5 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] }, { width: 136, height: 60, cIndex: 2, id: "100002", textStyle: { align: 3, feed: 1 }, border: { type: 0 }, fill: { type: 0 }, text: "Activities", initCPV: { x: 0, y: 13.5 }, attrLinks: [ { code: "textStyle", mapping: ["*"] }, { code: "font", mapping: ["*"] } ] } ] } }; const __vite_glob_0_104 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateState1 }, Symbol.toStringTag, { value: "Module" })); const umlStateSubstate = { "id": "301002", "name": "ddei.uml.substate", "code": "substate", "desc": "UML的子状态机节点", "from": "100500", "define": { width: 110, height: 50, text: "State", font: { size: 14 }, border: { round: 10 }, textStyle: { align: 3, valign: 3 }, //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 poly: 2, //采样信息 sample: { eqrat: false, //一圈4次采样 loop: 4, //初始次采样的开始角度 angle: 0, //半径距离 r: 50, //采样的规则,多组采样返回多组规则 rules: [ `(i, sample, pvs, model, ovs){ let start = 0,end = 0 let x = sample.x,y = sample.y switch(i){ case 0: start = 1 break; case 1: pvs[0].y=y break; case 2: pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:x,y:y,select:1,clip:1,stroke:1,fill:1}); }`, //下方子图标 `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:40,y:40,stroke:1,rd:0}); pvs.push({x:30,y:40,stroke:1,rd:0}); pvs.push({x:30,y:30,stroke:1,rd:0}); pvs.push({x:40,y:30,stroke:1,end:1,rd:0}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:25,y:40,stroke:1,rd:0}); pvs.push({x:15,y:40,stroke:1,rd:0}); pvs.push({x:15,y:30,stroke:1,rd:0}); pvs.push({x:25,y:30,stroke:1,end:1,rd:0}); } }`, `(i, sample, pvs, model, ovs){ if(i == 0){ pvs.push({begin:1,x:30,y:35,type:1,stroke:1}); pvs.push({x:25,y:35,stroke:1,type:1,end:1}); } }`, //定义锚点 `(i, sample, pvs, model, ovs){ switch(i){ case 0: pvs.push({x:sample.x,y:sample.y-25,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y+25,type:0,oppoint:1}); break; case 1: pvs.push({x:sample.x-25,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x+25,y:sample.y,type:0,oppoint:1}); break; case 2: pvs.push({x:sample.x,y:sample.y-25,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y+25,type:0,oppoint:1}); break; case 3: pvs.push({x:sample.x-25,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x,y:sample.y,type:0,oppoint:1}); pvs.push({x:sample.x+25,y:sample.y,type:0,oppoint:1}); break; } }`, //文本区域,margin:右10,下15 `(i, sample, pvs, model, ovs){ let start = 0,end = 0 let x = sample.x,y = sample.y switch(i){ case 0: start = 1 x-=5 break; case 1: y=15 pvs[0].y=y break; case 2: x+=5 pvs[1].x=x break; case 3: pvs[2].y=y x = pvs[0].x end = 1 break; } pvs.push({begin:start,end:end,x:x,y:y,text:1}); }` ] } } }; const __vite_glob_0_105 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateSubstate }, Symbol.toStringTag, { value: "Module" })); const umlStateSwitch = { "id": "301007", "name": "ddei.uml.switch", "code": "switch", "desc": "UML的状态分支", "from": "100040", "define": { width: 40, height: 40, ext: { groups: [ { name: "属性", icon: "icon-fill", subGroups: [ { name: "ddei.fill", attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] }, { name: "ddei.line", attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] } ] } ] } } }; const __vite_glob_0_106 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlStateSwitch }, Symbol.toStringTag, { value: "Module" })); const umlActive = { "id": "308", "name": "ddei.uml.groups.active", "code": "uml-active", "desc": "UML2.0中的活动图", "subject": "uml", "orderNo": 308, //当前分组下所有控件 "controls": [ { "id": "308001" }, { "id": "301001" }, { "id": "301002", "name": "ddei.uml.state" }, { "id": "308004" }, { "id": "308005" }, { "id": "308006" }, { "id": "308007" }, { "id": "308008" }, { "id": "308009" }, { "id": "308010", "name": "ddei.uml.pause" }, { "id": "308011" }, { "id": "308012" }, { "id": "103005" }, { "id": "308014", "name": "ddei.uml.statecontainer" }, { "id": "308016", "name": "ddei.uml.hlane" }, { "id": "308017", "name": "ddei.uml.vlane" }, { "id": "308018", "name": "ddei.uml.matrix" }, { "id": "308019", "name": "ddei.uml.controlflow" }, { "id": "308020", "name": "ddei.uml.controlflow" }, { "id": "102001", "name": "ddei.uml.initnode" }, { "id": "102093", "name": "ddei.uml.endnode" }, { "id": "308023", "name": "ddei.uml.forknode" } ] }; const __vite_glob_1_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlActive }, Symbol.toStringTag, { value: "Module" })); const umlCase = { "id": "302", "name": "ddei.uml.groups.case", "code": "uml-case", "desc": "UML2.0中的用例图", "orderNo": 302, "subject": "uml", //当前分组下所有控件 "controls": [ { "id": "103006", "name": "ddei.uml.role" }, { "id": "302002" }, { "id": "302006" }, { "id": "302007" }, { "id": "302003" }, { "id": "302004" }, { "id": "302005" }, { "id": "103005" }, { "id": "302010" }, { "id": "307019" }, { "id": "302012" }, { "id": "302013" }, { "id": "302014" } ] }; const __vite_glob_1_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCase }, Symbol.toStringTag, { value: "Module" })); const umlClass = { "id": "307", "name": "ddei.uml.groups.class", "code": "uml-class", "desc": "UML2.0中的类图", "orderNo": 307, "subject": "uml", //当前分组下所有控件 "controls": [ { "id": "307001" }, { "id": "307002" }, { "id": "307003" }, { "id": "307004" }, { "id": "307005" }, { "id": "307006", "name": "ddei.uml.muti" }, { "id": "307007" }, { "id": "307008" }, { "id": "307009" }, { "id": "307010" }, { "id": "307011" }, { "id": "307012" }, { "id": "307013" }, { "id": "307014" }, { "id": "307015", "name": "ddei.uml.container" }, { "id": "307016" }, { "id": "103005" }, { "id": "307018" }, { "id": "307019" }, { "id": "307020" }, { "id": "305017" }, { "id": "305018" }, { "id": "305016" }, { "id": "307024" }, { "id": "305014", "name": "ddei.uml.link" } ] }; const __vite_glob_1_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlClass }, Symbol.toStringTag, { value: "Module" })); const umlComponent = { "id": "305", "name": "ddei.uml.groups.component", "code": "uml-component", "desc": "UML2.0中的组件图", "orderNo": 305, "subject": "uml", //当前分组下所有控件 "controls": [ { "id": "305001" }, { "id": "305002" }, { "id": "305003" }, { "id": "305004", "name": "ddei.uml.container" }, { "id": "305005" }, { "id": "102001", "name": "ddei.uml.startnode1" }, { "id": "308012" }, { "id": "103005" }, { "id": "305009" }, { "id": "305010" }, { "id": "305012", "name": "ddei.uml.interface" }, { "id": "305013", "name": "ddei.uml.reqinte" }, { "id": "305014", "name": "ddei.uml.relationship" }, { "id": "305015" }, { "id": "305016" }, { "id": "305017" }, { "id": "305018" } ] }; const __vite_glob_1_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlComponent }, Symbol.toStringTag, { value: "Module" })); const umlCooperate = { "id": "306", "name": "ddei.uml.groups.cooperate", "code": "uml-cooperate", "desc": "UML2.0中的协作图", "orderNo": 306, "subject": "uml", //当前分组下所有控件 "controls": [ { "id": "308005" }, { "id": "303014" }, { "id": "306003" }, { "id": "306004" }, { "id": "306005" }, { "id": "306006" }, { "id": "306007" }, { "id": "306008" }, { "id": "306009" } ] }; const __vite_glob_1_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlCooperate }, Symbol.toStringTag, { value: "Module" })); const umlDeploy = { "id": "304", "name": "ddei.uml.groups.deploy", "code": "uml-deploy", "desc": "UML2.0中的部署图", "orderNo": 304, "subject": "uml", //当前分组下所有控件 "controls": [ { "id": "307012" }, { "id": "308005" }, { "id": "304003" }, { "id": "304004" }, { "id": "304005" }, { "id": "304006" }, { "id": "304007" }, { "id": "304008" }, { "id": "304009", "name": "ddei.uml.projins" }, { "id": "304010" }, { "id": "304011" }, { "id": "304012", "name": "ddei.uml.nodeins" }, { "id": "304013" }, { "id": "304014" }, { "id": "307011" }, { "id": "103005" }, { "id": "304017", "name": "ddei.uml.sketchmap" }, { "id": "304018" }, { "id": "304019" }, { "id": "304020" }, { "id": "304021" }, { "id": "304022" }, { "id": "304023" } ] }; const __vite_glob_1_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlDeploy }, Symbol.toStringTag, { value: "Module" })); const umlSequence = { "id": "303", "name": "ddei.uml.groups.sequence", "code": "uml-sequence", "desc": "UML2.0中的序列图", "orderNo": 303, "subject": "uml", //当前分组下所有控件 "controls": [ { "id": "303001" }, { "id": "303002" }, { "id": "303003" }, { "id": "303004" }, { "id": "303005" }, { "id": "303006" }, { "id": "303007" }, { "id": "303008" }, { "id": "303009" }, { "id": "303010" }, { "id": "303011" }, { "id": "303012" }, { "id": "303013" }, { "id": "303014" }, { "id": "303015" }, { "id": "303016" }, { "id": "303017" }, { "id": "303018" }, { "id": "307011" }, { "id": "102090", "name": "ddei.uml.endnode1" }, { "id": "103005" }, { "id": "303019" }, { "id": "303020" }, { "id": "303021" } ] }; const __vite_glob_1_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlSequence }, Symbol.toStringTag, { value: "Module" })); const umlState = { "id": "301", "name": "ddei.uml.groups.state", "code": "uml-state", "desc": "UML2.0中的状态图", "orderNo": 301, "subject": "uml", //当前分组下所有控件 "controls": [ { "id": "301001" }, { "id": "301002" }, { "id": "301003", "name": "ddei.uml.compstate" }, { "id": "102001", "name": "ddei.uml.initstate" }, { "id": "102091", "name": "ddei.uml.finalstate" }, { "id": "301006" }, { "id": "301007" }, { "id": "301008" }, { "id": "301009" }, { "id": "301010" }, { "id": "103005" }, { "id": "301012" }, { "id": "301013" }, { "id": "301014" } ] }; const __vite_glob_1_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: umlState }, Symbol.toStringTag, { value: "Module" })); const control_ctx = /* @__PURE__ */ Object.assign({ "./control/active/uml-active-active.ts": __vite_glob_0_0, "./control/active/uml-active-branch.ts": __vite_glob_0_1, "./control/active/uml-active-container.ts": __vite_glob_0_2, "./control/active/uml-active-cross.ts": __vite_glob_0_3, "./control/active/uml-active-cross1.ts": __vite_glob_0_4, "./control/active/uml-active-ctrlflow.ts": __vite_glob_0_5, "./control/active/uml-active-ctrlflow1.ts": __vite_glob_0_6, "./control/active/uml-active-object.ts": __vite_glob_0_7, "./control/active/uml-active-point.ts": __vite_glob_0_8, "./control/active/uml-active-recevt.ts": __vite_glob_0_9, "./control/active/uml-active-recmsg.ts": __vite_glob_0_10, "./control/active/uml-active-sendmsg.ts": __vite_glob_0_11, "./control/active/uml-active-state.ts": __vite_glob_0_12, "./control/case/uml-case-case.ts": __vite_glob_0_13, "./control/case/uml-case-case1.ts": __vite_glob_0_14, "./control/case/uml-case-case2.ts": __vite_glob_0_15, "./control/case/uml-case-coll.ts": __vite_glob_0_16, "./control/case/uml-case-coop.ts": __vite_glob_0_17, "./control/case/uml-case-extend.ts": __vite_glob_0_18, "./control/case/uml-case-include.ts": __vite_glob_0_19, "./control/case/uml-case-interface.ts": __vite_glob_0_20, "./control/case/uml-case-part.ts": __vite_glob_0_21, "./control/case/uml-case-system.ts": __vite_glob_0_22, "./control/class/uml-class-cls.ts": __vite_glob_0_23, "./control/class/uml-class-cls1.ts": __vite_glob_0_24, "./control/class/uml-class-cls2.ts": __vite_glob_0_25, "./control/class/uml-class-constraint.ts": __vite_glob_0_26, "./control/class/uml-class-dt.ts": __vite_glob_0_27, "./control/class/uml-class-enum.ts": __vite_glob_0_28, "./control/class/uml-class-generalization.ts": __vite_glob_0_29, "./control/class/uml-class-impl.ts": __vite_glob_0_30, "./control/class/uml-class-interface.ts": __vite_glob_0_31, "./control/class/uml-class-link.ts": __vite_glob_0_32, "./control/class/uml-class-model.ts": __vite_glob_0_33, "./control/class/uml-class-obj.ts": __vite_glob_0_34, "./control/class/uml-class-overview.ts": __vite_glob_0_35, "./control/class/uml-class-package.ts": __vite_glob_0_36, "./control/class/uml-class-primitive.ts": __vite_glob_0_37, "./control/class/uml-class-rel.ts": __vite_glob_0_38, "./control/class/uml-class-signal.ts": __vite_glob_0_39, "./control/class/uml-class-ui.ts": __vite_glob_0_40, "./control/component/uml-comp-box.ts": __vite_glob_0_41, "./control/component/uml-comp-comp.ts": __vite_glob_0_42, "./control/component/uml-comp-comp1.ts": __vite_glob_0_43, "./control/component/uml-comp-compose.ts": __vite_glob_0_44, "./control/component/uml-comp-dependent.ts": __vite_glob_0_45, "./control/component/uml-comp-direct.ts": __vite_glob_0_46, "./control/component/uml-comp-interface.ts": __vite_glob_0_47, "./control/component/uml-comp-node.ts": __vite_glob_0_48, "./control/component/uml-comp-package.ts": __vite_glob_0_49, "./control/component/uml-comp-rel.ts": __vite_glob_0_50, "./control/component/uml-comp-reqinte.ts": __vite_glob_0_51, "./control/component/uml-comp-together.ts": __vite_glob_0_52, "./control/cooperate/uml-cop-msg.ts": __vite_glob_0_53, "./control/cooperate/uml-cop-msg1.ts": __vite_glob_0_54, "./control/cooperate/uml-cop-msg2.ts": __vite_glob_0_55, "./control/cooperate/uml-cop-msg3.ts": __vite_glob_0_56, "./control/cooperate/uml-cop-msg4.ts": __vite_glob_0_57, "./control/cooperate/uml-cop-msg5.ts": __vite_glob_0_58, "./control/cooperate/uml-cop-msg6.ts": __vite_glob_0_59, "./control/deploy/uml-dep-comm.ts": __vite_glob_0_60, "./control/deploy/uml-dep-comp-ins.ts": __vite_glob_0_61, "./control/deploy/uml-dep-comp-ins1.ts": __vite_glob_0_62, "./control/deploy/uml-dep-comp.ts": __vite_glob_0_63, "./control/deploy/uml-dep-comp1.ts": __vite_glob_0_64, "./control/deploy/uml-dep-depend.ts": __vite_glob_0_65, "./control/deploy/uml-dep-deploy.ts": __vite_glob_0_66, "./control/deploy/uml-dep-extend.ts": __vite_glob_0_67, "./control/deploy/uml-dep-manifest.ts": __vite_glob_0_68, "./control/deploy/uml-dep-node-ins.ts": __vite_glob_0_69, "./control/deploy/uml-dep-node.ts": __vite_glob_0_70, "./control/deploy/uml-dep-obj.ts": __vite_glob_0_71, "./control/deploy/uml-dep-overview-ins.ts": __vite_glob_0_72, "./control/deploy/uml-dep-overview.ts": __vite_glob_0_73, "./control/deploy/uml-dep-together.ts": __vite_glob_0_74, "./control/sequence/uml-seq-act-break.ts": __vite_glob_0_75, "./control/sequence/uml-seq-act.ts": __vite_glob_0_76, "./control/sequence/uml-seq-actor-life.ts": __vite_glob_0_77, "./control/sequence/uml-seq-actor.ts": __vite_glob_0_78, "./control/sequence/uml-seq-alt.ts": __vite_glob_0_79, "./control/sequence/uml-seq-alternative.ts": __vite_glob_0_80, "./control/sequence/uml-seq-async.ts": __vite_glob_0_81, "./control/sequence/uml-seq-control.ts": __vite_glob_0_82, "./control/sequence/uml-seq-custom.ts": __vite_glob_0_83, "./control/sequence/uml-seq-edge.ts": __vite_glob_0_84, "./control/sequence/uml-seq-entity.ts": __vite_glob_0_85, "./control/sequence/uml-seq-inv.ts": __vite_glob_0_86, "./control/sequence/uml-seq-life.ts": __vite_glob_0_87, "./control/sequence/uml-seq-loop.ts": __vite_glob_0_88, "./control/sequence/uml-seq-obj.ts": __vite_glob_0_89, "./control/sequence/uml-seq-objdel.ts": __vite_glob_0_90, "./control/sequence/uml-seq-objlife.ts": __vite_glob_0_91, "./control/sequence/uml-seq-opt.ts": __vite_glob_0_92, "./control/sequence/uml-seq-package.ts": __vite_glob_0_93, "./control/sequence/uml-seq-par.ts": __vite_glob_0_94, "./control/sequence/uml-seq-transition.ts": __vite_glob_0_95, "./control/state/uml-state-branch.ts": __vite_glob_0_96, "./control/state/uml-state-collect.ts": __vite_glob_0_97, "./control/state/uml-state-constraint.ts": __vite_glob_0_98, "./control/state/uml-state-convert.ts": __vite_glob_0_99, "./control/state/uml-state-end.ts": __vite_glob_0_100, "./control/state/uml-state-his.ts": __vite_glob_0_101, "./control/state/uml-state-his1.ts": __vite_glob_0_102, "./control/state/uml-state-state.ts": __vite_glob_0_103, "./control/state/uml-state-state1.ts": __vite_glob_0_104, "./control/state/uml-state-substate.ts": __vite_glob_0_105, "./control/state/uml-state-switch.ts": __vite_glob_0_106 }); const group_ctx = /* @__PURE__ */ Object.assign({ "./group/uml-active.ts": __vite_glob_1_0, "./group/uml-case.ts": __vite_glob_1_1, "./group/uml-class.ts": __vite_glob_1_2, "./group/uml-component.ts": __vite_glob_1_3, "./group/uml-cooperate.ts": __vite_glob_1_4, "./group/uml-deploy.ts": __vite_glob_1_5, "./group/uml-sequence.ts": __vite_glob_1_6, "./group/uml-state.ts": __vite_glob_1_7 }); const _DDeiExtUMLControls = class _DDeiExtUMLControls extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "controls", /* @__PURE__ */ new Map()); } getControls(editor) { let extOptions = this.getOptions(); let controls2 = /* @__PURE__ */ new Map(); let controls1 = new Map(editor.controls); for (let i2 in control_ctx) { let control = control_ctx[i2].default; if (control) { let c = cloneDeep(control); controls2.set(control.id, c); controls1.set(control.id, c); if (extOptions && extOptions[control.id]) { for (let x2 in extOptions[control.id]) { c.define[x2] = extOptions[control.id][x2]; } } } } controls2.forEach((control) => { loadControlByFrom(controls1, control); }); this.controls = controls2; return controls2; } getGroups(editor) { if (!this.controls) { this.getControls(editor); } let groups = []; for (let path in group_ctx) { groups.push(group_ctx[path].default); } loadAndSortGroup(groups, editor.controls); return groups; } static modify(fn) { return _DDeiExtUMLControls.defaultIns.modify(fn); } static configuration(options) { if (options) { let controls2 = new _DDeiExtUMLControls(options); return controls2; } return _DDeiExtUMLControls; } }; /** * 缺省实例 */ __publicField3(_DDeiExtUMLControls, "defaultIns", new _DDeiExtUMLControls(null)); let DDeiExtUMLControls = _DDeiExtUMLControls; const _DDeiExtUML = class _DDeiExtUML extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "order", 1); __publicField3(this, "controls", DDeiExtUMLControls); } getOptions() { let options = {}; let array = [this.controls]; array.forEach((plugin) => { if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { options = Object.assign({}, options, plugin.defaultIns.getOptions()); } else if (plugin instanceof DDeiPluginBase) { options = Object.assign({}, options, plugin.getOptions()); } }); return options; } getLangs(editor) { const langModules = /* @__PURE__ */ Object.assign({ "./i18n/en_US.ts": __vite_glob_0_0$1, "./i18n/zh_CN.ts": __vite_glob_0_1$1 }); let langs = {}; for (let i2 in langModules) { let langModule = langModules[i2]; let newI = i2.substring(i2.lastIndexOf("/") + 1, i2.lastIndexOf(".")); langs[newI] = langModule.default; } return langs; } getControls(editor) { if (DDeiPluginBase.isSubclass(this.controls, DDeiPluginBase)) { return this.controls.defaultIns.getControls(editor); } else if (this.controls instanceof DDeiPluginBase) { return this.controls.getControls(editor); } } getGroups(editor) { if (DDeiPluginBase.isSubclass(this.controls, DDeiPluginBase)) { return this.controls.defaultIns.getGroups(editor); } else if (this.controls instanceof DDeiPluginBase) { return this.controls.getGroups(editor); } } static modify(fn) { return _DDeiExtUML.defaultIns.modify(fn); } static configuration(options) { let core = new _DDeiExtUML(options); core.controls = core.controls.configuration(controls, true); return core; } }; __publicField3(_DDeiExtUML, "order", 1); /** * 缺省实例 */ __publicField3(_DDeiExtUML, "defaultIns", new _DDeiExtUML(null)); let DDeiExtUML = _DDeiExtUML; const _sfc_main$6 = { name: "ddei-core-dialog-quickpop", extends: null, props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { dialogId: "ddei-core-dialog-quickpop", //当前选中的控件 selectedModels: null, //当前操作 operateState: null, //全部都是线条 allLine: false, forceRefresh: false }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.editor.dialogs[this.dialogId].viewer = this; this.refreshData(); }, methods: { forceRefreshView: function() { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); }, refreshData() { var _a3; let stage2 = this.editor.ddInstance.stage; if (stage2) { this.selectedModels = stage2.selectedModels; this.operateState = stage2.render.operateState; if (((_a3 = this.selectedModels) == null ? void 0 : _a3.size) > 0) { let allLine = true; this.selectedModels.forEach((model) => { if (model.baseModelType != "DDeiLine") { allLine = false; } }); this.allLine = allLine; } } }, exchangeLinePoint() { var _a3, _b2; (_a3 = this.selectedModels) == null ? void 0 : _a3.forEach((model) => { if (model.baseModelType == "DDeiLine") { model.exchangeStartAndEnd(); } }); this.editor.bus.push(DDeiEnumBusCommandType.AddHistroy); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); (_b2 = this.editor.editorViewer) == null ? void 0 : _b2.changeFileModifyDirty(); }, showSetStyleDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-setstyle", { group: "top-dialog" }, { type: 5 }, srcElement, false, true); }, closeAllDialog() { DDeiEditorUtil.closeDialogs(this.editor); }, showAlignDialog(evt) { let srcElement = evt.currentTarget; DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-align", { group: "top-dialog" }, { type: 5 }, srcElement, false, true); }, //是否可以取消组合 canCancelMerge() { var _a3, _b2; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_b2 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _b2.size) > 0) { let models = Array.from(stage2 == null ? void 0 : stage2.selectedModels.values()); if (models[0].baseModelType == "DDeiContainer" && models[0].layout == "compose") { return true; } } return false; }, //是否可以组合 canMerge() { var _a3; return this.operateState != 50 && !this.allLine && ((_a3 = this.selectedModels) == null ? void 0 : _a3.size) > 1; }, /** * 执行组合 */ doMerge() { var _a3, _b2; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_b2 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _b2.size) > 1) { this.editor.bus.push(DDeiEnumBusCommandType.ModelMerge); this.editor.bus.executeAll(); } }, /** * 执行取消组合 */ doCancelMerge() { var _a3, _b2; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; if (((_b2 = stage2 == null ? void 0 : stage2.selectedModels) == null ? void 0 : _b2.size) > 0) { this.editor.bus.push(DDeiEnumBusCommandType.ModelCancelMerge); this.editor.bus.executeAll(); } }, //修改图形层次 doPush(v) { var _a3; let file = (_a3 = this.editor) == null ? void 0 : _a3.files[this.editor.currentFileIndex]; let sheet = file == null ? void 0 : file.sheets[file == null ? void 0 : file.currentSheetIndex]; let stage2 = sheet == null ? void 0 : sheet.stage; let stageRender = stage2 == null ? void 0 : stage2.render; let optContainer = stageRender == null ? void 0 : stageRender.currentOperateContainer; if (optContainer) { this.editor.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: v }); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } }, /** * 执行格式刷 */ execBrushAction(evt) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; if (this.editor.state == DDeiEditorState.QUICK_EDITING) { if (!((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.ddInstance) == null ? void 0 : _b2.stage) == null ? void 0 : _c2.brushDataText)) { (_e2 = (_d2 = this.editor) == null ? void 0 : _d2.hotkeys["ddei-core-keyaction-brush-data"]) == null ? void 0 : _e2.action(evt, this.editor.ddInstance, this.editor); } else { delete this.editor.ddInstance.stage.brushDataText; } } else { if (!((_h = (_g = (_f = this.editor) == null ? void 0 : _f.ddInstance) == null ? void 0 : _g.stage) == null ? void 0 : _h.brushData)) { (_j = (_i = this.editor) == null ? void 0 : _i.hotkeys["ddei-core-keyaction-brush-data"]) == null ? void 0 : _j.action(evt, this.editor.ddInstance, this.editor); } else { delete this.editor.ddInstance.stage.brushData; } } } } }; const CanvasQuickDialog_vue_vue_type_style_index_0_scoped_c4337de3_lang = ""; const _hoisted_1$6 = ["id"]; const _hoisted_2$4 = { key: 0, class: "content" }; const _hoisted_3$3 = { class: "panel12" }; const _hoisted_4$3 = { class: "panel12-content-1" }; const _hoisted_5$3 = { class: "panel12-content-2" }; const _hoisted_6$3 = { class: "panel12-content-5" }; const _hoisted_7$3 = { class: "panel12-content-5" }; const _hoisted_8$2 = { class: "panel12-content-3" }; const _hoisted_9$2 = { class: "panel12-content-3" }; const _hoisted_10$1 = { class: "panel12-content-3" }; const _hoisted_11$1 = { class: "panel12-content-3" }; const _hoisted_12$1 = { class: "panel12-content-3" }; const _hoisted_13$1 = { class: "panel12-split-3 panel12-content-4 panel1-split-4" }; const _hoisted_14 = { class: "panel12-content-4" }; const _hoisted_15 = ["title"]; const _hoisted_16 = { class: "text" }; const _hoisted_17 = { key: 1, class: "content" }; const _hoisted_18 = { class: "panel6" }; const _hoisted_19 = { class: "panel6-content1 pointtype" }; const _hoisted_20 = { class: "text" }; const _hoisted_21 = { class: "panel6-content1 pointtype" }; const _hoisted_22 = { class: "text" }; const _hoisted_23 = { class: "panel6", style: { "border-left": "1px solid #E2E2EB" } }; const _hoisted_24 = { class: "panel6-content type" }; const _hoisted_25 = { class: "text" }; const _hoisted_26 = { class: "panel6-content color2" }; const _hoisted_27 = { class: "text" }; const _hoisted_28 = { class: "panel6-content dash" }; const _hoisted_29 = { class: "text" }; const _hoisted_30 = { class: "panel6-content dash" }; const _hoisted_31 = { class: "text" }; const _hoisted_32 = { class: "panel6", style: { "border-left": "1px solid #E2E2EB" } }; const _hoisted_33 = { class: "text" }; const _hoisted_34 = { key: 2, class: "content" }; const _hoisted_35 = { class: "panel1" }; const _hoisted_36 = { class: "panel1-content-1" }; const _hoisted_37 = { class: "panel1-content-2" }; const _hoisted_38 = { class: "panel1-content-3" }; const _hoisted_39 = { class: "panel1-content-3" }; const _hoisted_40 = { class: "panel1-content-3" }; const _hoisted_41 = { class: "panel1-split-3 panel1-content-4 panel1-split-4" }; const _hoisted_42 = { class: "panel1-content-4" }; const _hoisted_43 = ["title"]; const _hoisted_44 = { class: "text" }; const _hoisted_45 = { class: "panel3" }; const _hoisted_46 = { class: "text" }; const _hoisted_47 = { class: "panel3-content i2" }; const _hoisted_48 = { class: "text" }; const _hoisted_49 = { class: "panel3-content i3" }; const _hoisted_50 = { class: "text" }; const _hoisted_51 = { class: "panel4" }; const _hoisted_52 = { class: "text" }; const _hoisted_53 = { class: "text" }; const _hoisted_54 = { class: "text" }; const _hoisted_55 = { class: "text" }; const _hoisted_56 = { class: "text" }; function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K; return $data.forceRefresh ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = $props.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, onMousedown: _cache[10] || (_cache[10] = ($event) => $options.closeAllDialog()), class: "ddei-core-dialog-quickpop" }, [ $data.operateState == 50 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$4, [ vue.createElementVNode("div", _hoisted_3$3, [ vue.createElementVNode("div", _hoisted_4$3, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_b2 = $props.editor) == null ? void 0 : _b2.panels["ddei-core-btn-fontfamily"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_5$3, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_c2 = $props.editor) == null ? void 0 : _c2.panels["ddei-core-btn-fontsize"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_6$3, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_d2 = $props.editor) == null ? void 0 : _d2.panels["ddei-core-btn-addfontsize"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, addValue: 1, attrCode: "font.size", img: "icon-add-fontsize", extcls: "magtop-2" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_7$3, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_e2 = $props.editor) == null ? void 0 : _e2.panels["ddei-core-btn-addfontsize"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, addValue: -1, attrCode: "font.size", img: "icon-reduce-fontsize", extcls: "magtop-1" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_8$2, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_f = $props.editor) == null ? void 0 : _f.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", attrCode: "textStyle.bold", img: "icon-bold" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_9$2, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_g = $props.editor) == null ? void 0 : _g.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", attrCode: "textStyle.italic", img: "icon-font-italic" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_10$1, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_h = $props.editor) == null ? void 0 : _h.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", attrCode: "textStyle.underline", img: "icon-text-underline", extcls: "ext-underline" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_11$1, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_i = $props.editor) == null ? void 0 : _i.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, electedValue: "1", attrCode: "textStyle.deleteline", img: "icon-a-ziyuan457" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_12$1, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_j = $props.editor) == null ? void 0 : _j.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", onlyQuickEdit: true, attrCode: "textStyle.subtype", img: "icon-text-subtype-2", extcls: "magtop-1" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_13$1, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_k = $props.editor) == null ? void 0 : _k.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "textStyle.bgcolor", img: "icon-a-ziyuan452" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_14, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_l = $props.editor) == null ? void 0 : _l.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "font.color", img: "icon-font" }, null, 8, ["editor", "controlDefine"])) ]) ]), vue.createElementVNode("div", { class: "panel2", title: $props.editor.i18n("ddei.brush"), style: { "border-right": "none" }, onClick: _cache[0] || (_cache[0] = ($event) => $options.execBrushAction($event)) }, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "panel2-content": true, "brush-selected": (_o = (_n = (_m = $props.editor) == null ? void 0 : _m.ddInstance) == null ? void 0 : _n.stage) == null ? void 0 : _o.brushDataText }) }, [ _cache[11] || (_cache[11] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-brush" }) ], -1)), vue.createElementVNode("div", _hoisted_16, vue.toDisplayString($props.editor.i18n("ddei.brush")), 1) ], 2) ], 8, _hoisted_15) ])) : vue.createCommentVNode("", true), $data.operateState != 50 && $data.allLine ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [ vue.createElementVNode("div", _hoisted_18, [ vue.createElementVNode("div", _hoisted_19, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_p = $props.editor) == null ? void 0 : _p.panels["ddei-core-btn-linepointtype"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "sp.type" }, null, 8, ["editor", "controlDefine"])), vue.createElementVNode("div", _hoisted_20, vue.toDisplayString($props.editor.i18n("ddei.startPoint")), 1) ]), vue.createElementVNode("div", { class: "panel6-content1 exchange", onClick: _cache[1] || (_cache[1] = (...args) => $options.exchangeLinePoint && $options.exchangeLinePoint(...args)) }, _cache[12] || (_cache[12] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-zhihuan" }) ], -1) ])), vue.createElementVNode("div", _hoisted_21, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_q = $props.editor) == null ? void 0 : _q.panels["ddei-core-btn-linepointtype"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "ep.type" }, null, 8, ["editor", "controlDefine"])), vue.createElementVNode("div", _hoisted_22, vue.toDisplayString($props.editor.i18n("ddei.endPoint")), 1) ]) ]), vue.createElementVNode("div", _hoisted_23, [ vue.createElementVNode("div", _hoisted_24, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_r = $props.editor) == null ? void 0 : _r.panels["ddei-core-btn-linetype"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "type", img: "icon-link-line" }, null, 8, ["editor", "controlDefine"])), vue.createElementVNode("div", _hoisted_25, vue.toDisplayString($props.editor.i18n("ddei.lineType")), 1) ]), vue.createElementVNode("div", _hoisted_26, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_s = $props.editor) == null ? void 0 : _s.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "color", img: "icon-border-pencil" }, null, 8, ["editor", "controlDefine"])), vue.createElementVNode("div", _hoisted_27, vue.toDisplayString($props.editor.i18n("ddei.lineColor")), 1) ]), vue.createElementVNode("div", _hoisted_28, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_t = $props.editor) == null ? void 0 : _t.panels["ddei-core-btn-borderweight"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "weight", hiddenCombo: "1" }, null, 8, ["editor", "controlDefine"])), vue.createElementVNode("div", _hoisted_29, vue.toDisplayString($props.editor.i18n("ddei.lineWeight")), 1) ]), vue.createElementVNode("div", _hoisted_30, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_u = $props.editor) == null ? void 0 : _u.panels["ddei-core-btn-borderdash"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "dash", hiddenCombo: "1" }, null, 8, ["editor", "controlDefine"])), vue.createElementVNode("div", _hoisted_31, vue.toDisplayString($props.editor.i18n("ddei.lineDash")), 1) ]) ]), vue.createElementVNode("div", _hoisted_32, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "panel6-content brush": true, "brush-selected": (_x = (_w = (_v = $props.editor) == null ? void 0 : _v.ddInstance) == null ? void 0 : _w.stage) == null ? void 0 : _x.brushData }), onClick: _cache[2] || (_cache[2] = ($event) => $options.execBrushAction($event)) }, [ _cache[13] || (_cache[13] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-brush" }) ], -1)), vue.createElementVNode("div", _hoisted_33, vue.toDisplayString($props.editor.i18n("ddei.brush")), 1) ], 2) ]) ])) : vue.createCommentVNode("", true), $data.operateState != 50 && !$data.allLine ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_34, [ vue.createElementVNode("div", _hoisted_35, [ vue.createElementVNode("div", _hoisted_36, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_y = $props.editor) == null ? void 0 : _y.panels["ddei-core-btn-fontfamily"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_37, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_z = $props.editor) == null ? void 0 : _z.panels["ddei-core-btn-fontsize"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_38, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_A = $props.editor) == null ? void 0 : _A.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", attrCode: "textStyle.bold", img: "icon-bold" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_39, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_B = $props.editor) == null ? void 0 : _B.panels["ddei-core-btn-editbox"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, selectedValue: "1", attrCode: "textStyle.italic", img: "icon-font-italic" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_40, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_C = $props.editor) == null ? void 0 : _C.panels["ddei-core-btn-textalign"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, img: "icon-text-align-left" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_41, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_D = $props.editor) == null ? void 0 : _D.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "textStyle.bgcolor", img: "icon-fill" }, null, 8, ["editor", "controlDefine"])) ]), vue.createElementVNode("div", _hoisted_42, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_E = $props.editor) == null ? void 0 : _E.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "font.color", img: "icon-font" }, null, 8, ["editor", "controlDefine"])) ]) ]), vue.createElementVNode("div", { class: "panel2", title: $props.editor.i18n("ddei.brush"), onClick: _cache[3] || (_cache[3] = ($event) => $options.execBrushAction($event)) }, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "panel2-content": true, "brush-selected": (_H = (_G = (_F = $props.editor) == null ? void 0 : _F.ddInstance) == null ? void 0 : _G.stage) == null ? void 0 : _H.brushData }) }, [ _cache[14] || (_cache[14] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-brush" }) ], -1)), vue.createElementVNode("div", _hoisted_44, vue.toDisplayString($props.editor.i18n("ddei.brush")), 1) ], 2) ], 8, _hoisted_43), vue.createElementVNode("div", _hoisted_45, [ vue.createElementVNode("div", { class: "panel3-content i1", onClick: _cache[4] || (_cache[4] = ($event) => $options.showSetStyleDialog($event)) }, [ _cache[15] || (_cache[15] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-shapes" }) ], -1)), vue.createElementVNode("div", _hoisted_46, vue.toDisplayString($props.editor.i18n("ddei.style")), 1) ]), vue.createElementVNode("div", _hoisted_47, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_I = $props.editor) == null ? void 0 : _I.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "fill.color", img: "icon-background" }, null, 8, ["editor", "controlDefine"])), vue.createElementVNode("div", _hoisted_48, vue.toDisplayString($props.editor.i18n("ddei.fill")), 1) ]), vue.createElementVNode("div", _hoisted_49, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_J = $props.editor) == null ? void 0 : _J.panels["ddei-core-btn-color"]), { editor: $props.editor, controlDefine: $props.editor.currentControlDefine, attrCode: "border.color", img: "icon-border-pencil" }, null, 8, ["editor", "controlDefine"])), vue.createElementVNode("div", _hoisted_50, vue.toDisplayString($props.editor.i18n("ddei.border")), 1) ]) ]), vue.createElementVNode("div", _hoisted_51, [ vue.createElementVNode("div", { class: "panel4-content", onClick: _cache[5] || (_cache[5] = ($event) => $options.doPush("top")) }, [ _cache[16] || (_cache[16] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-move-top" }) ], -1)), vue.createElementVNode("div", _hoisted_52, vue.toDisplayString($props.editor.i18n("ddei.pushTop")), 1) ]), vue.createElementVNode("div", { class: "panel4-content", onClick: _cache[6] || (_cache[6] = ($event) => $options.doPush("bottom")) }, [ _cache[17] || (_cache[17] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-move-bottom" }) ], -1)), vue.createElementVNode("div", _hoisted_53, vue.toDisplayString($props.editor.i18n("ddei.pushBottom")), 1) ]) ]), vue.createElementVNode("div", { class: "panel5", style: vue.normalizeStyle({ "display": $options.canMerge() || $options.canCancelMerge() ? "" : "none" }) }, [ vue.withDirectives(vue.createElementVNode("div", { class: "panel5-content", onClick: _cache[7] || (_cache[7] = ($event) => $options.canMerge() && $options.doMerge()) }, [ _cache[18] || (_cache[18] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-merge" }) ], -1)), vue.createElementVNode("div", _hoisted_54, vue.toDisplayString($props.editor.i18n("ddei.combina")), 1) ], 512), [ [vue.vShow, $options.canMerge()] ]), vue.withDirectives(vue.createElementVNode("div", { class: "panel5-content", onClick: _cache[8] || (_cache[8] = ($event) => $options.canCancelMerge() && $options.doCancelMerge()) }, [ _cache[19] || (_cache[19] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-cancel-merge" }) ], -1)), vue.createElementVNode("div", _hoisted_55, vue.toDisplayString($props.editor.i18n("ddei.cancelCombina")), 1) ], 512), [ [vue.vShow, $options.canCancelMerge()] ]), vue.withDirectives(vue.createElementVNode("div", { class: "panel5-content", onClick: _cache[9] || (_cache[9] = ($event) => $options.canMerge() && $options.showAlignDialog($event)) }, [ _cache[20] || (_cache[20] = vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-align" }) ], -1)), vue.createElementVNode("div", _hoisted_56, vue.toDisplayString($props.editor.i18n("ddei.align")), 1) ], 512), [ [vue.vShow, $options.canMerge()] ]) ], 4) ])) : vue.createCommentVNode("", true) ], 40, _hoisted_1$6)), [ [vue.vShow, ((_K = $data.selectedModels) == null ? void 0 : _K.size) > 0] ]) : vue.createCommentVNode("", true); } const CanvasQuickDialog = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-c4337de3"]]); const _DDeiCoreCanvasQuickDialog = class _DDeiCoreCanvasQuickDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", CanvasQuickDialog.name); __publicField3(this, "plugins", [CanvasQuickDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[CanvasQuickDialog.name]) { for (let i2 in options[CanvasQuickDialog.name]) { newOptions[i2] = options[CanvasQuickDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreCanvasQuickDialog(newOptions); return panels; } } return _DDeiCoreCanvasQuickDialog; } static modify(fn) { return _DDeiCoreCanvasQuickDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreCanvasQuickDialog, "defaultIns", new _DDeiCoreCanvasQuickDialog(null)); let DDeiCoreCanvasQuickDialog = _DDeiCoreCanvasQuickDialog; const _DDeiCoreCanvasLifeCycle = class _DDeiCoreCanvasLifeCycle extends DDeiLifeCycle { constructor() { super(...arguments); __publicField3(this, "name", "quickstyle-lifecycle"); __publicField3(this, "EVENT_CONTROL_SELECT_AFTER", new DDeiFuncData("quickstyle-show", 1, this.showQuickEditPicker)); __publicField3(this, "EVENT_MOUSE_OPERATING", new DDeiFuncData("quickstyle-hidden", 1, this.mouseOperating)); __publicField3(this, "EVENT_CLOSE_FILE_AFTER", new DDeiFuncData("quickstyle-hidden", 1, this.closeDialog)); } /** * 正在进行鼠标操作 */ mouseOperating(operateType, data, ddInstance, evt) { if (ddInstance && ddInstance["AC_DESIGN_EDIT"]) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); DDeiEditorUtil.hiddenDialog(editor, "ddei-core-dialog-quickpop"); if (operateType == "SCROLL_WORKING" || operateType == "CHANGE_RATIO" || operateType == "CHANGE_WPV" || operateType == "CHANGE_BOUNDS" || operateType == "CHANGE_ROTATE") { _DDeiCoreCanvasLifeCycle.displayQuickDialog(editor); } } } /** * 正在进行鼠标操作 */ closeDialog(operateType, data, ddInstance, evt) { if (ddInstance && ddInstance["AC_DESIGN_EDIT"]) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); DDeiEditorUtil.closeDialog(editor, "ddei-core-dialog-quickpop"); } } static displayQuickDialog(editor) { var _a3, _b2, _c2, _d2; if (editor.state == DDeiEditorState.DESIGNING && ((_c2 = (_b2 = (_a3 = editor == null ? void 0 : editor.ddInstance) == null ? void 0 : _a3.stage) == null ? void 0 : _b2.selectedModels) == null ? void 0 : _c2.size) > 0) { if (editor.ddInstance.stage.render.operateState != 0) { _DDeiCoreCanvasLifeCycle.displayQuickDialog(editor); return; } let models = Array.from((_d2 = editor.ddInstance.stage) == null ? void 0 : _d2.selectedModels.values()); if ((models == null ? void 0 : models.length) > 0) { let height = 130; let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let modelPos = DDeiUtil.getModelsDomAbsPosition(models); let left = modelPos.left - editorDomPos.left + modelPos.width / 2 + 40; let top = modelPos.top - editorDomPos.top; if (modelPos.top - height <= modelPos.cTop) { if (modelPos.height > 400) { top = top + height + 40; } else { top = top + modelPos.height + 40; } } else { top = top - height; } let canvasEle = document.getElementById(editor.id + "_canvas"); if (top < canvasEle.offsetTop) { top = modelPos.offsetTop; } else if (top + 80 > canvasEle.offsetTop + canvasEle.clientHeight) { top = canvasEle.offsetTop + canvasEle.clientHeight - 80; } if (left < canvasEle.offsetLeft) { left = canvasEle.offsetLeft; } else if (left + 550 > canvasEle.offsetLeft + canvasEle.clientWidth) { left = canvasEle.offsetLeft + canvasEle.clientWidth - 550; } DDeiEditorUtil.displayDialog(editor, "ddei-core-dialog-quickpop", null, { type: 99, left, top, hiddenMask: true }); } } } /** * 选择后,在选择控件的合适位置显示快捷编辑框 */ showQuickEditPicker(operateType, data, ddInstance, evt) { if (ddInstance && ddInstance["AC_DESIGN_EDIT"]) { let models = data == null ? void 0 : data.models; let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.state == DDeiEditorState.DESIGNING) { let curState = editor.state; DDeiEditorUtil.closeDialog(editor, "ddei-core-dialog-quickpop"); if ((models == null ? void 0 : models.length) > 0) { let height = 130; let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let modelPos = DDeiUtil.getModelsDomAbsPosition(models); let left = modelPos.left - editorDomPos.left + modelPos.width / 2 + 40; let top = modelPos.top - editorDomPos.top + modelPos.height / 2; if (modelPos.top - height <= modelPos.cTop) { if (modelPos.height > 400) { top = top + height + 40; } else { top = top + modelPos.height / 2 + 40; } } else { top = top - height; } let canvasEle = document.getElementById(editor.id + "_canvas"); if (top < canvasEle.offsetTop) { top = modelPos.offsetTop; } else if (top + 80 > canvasEle.offsetTop + canvasEle.clientHeight) { top = canvasEle.offsetTop + canvasEle.clientHeight - 80; } if (left < canvasEle.offsetLeft) { left = canvasEle.offsetLeft; } else if (left + 550 > canvasEle.offsetLeft + canvasEle.clientWidth) { left = canvasEle.offsetLeft + canvasEle.clientWidth - 550; } DDeiEditorUtil.showDialog(editor, "ddei-core-dialog-quickpop", { group: "canvas-pop" }, { type: 99, left, top, hiddenMask: true }, null, true, true); editor == null ? void 0 : editor.changeState(curState); } } } } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiCoreCanvasLifeCycle.name]) { for (let i2 in options[_DDeiCoreCanvasLifeCycle.name]) { newOptions[i2] = options[_DDeiCoreCanvasLifeCycle.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreCanvasLifeCycle(); if (newOptions.name) { panels.name = newOptions.name; } if (newOptions.sort) { panels.sort = newOptions.sort; } return panels; } } return _DDeiCoreCanvasLifeCycle; } static modify(fn) { return _DDeiCoreCanvasLifeCycle.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiCoreCanvasLifeCycle, "defaultIns", new _DDeiCoreCanvasLifeCycle(null)); _DDeiCoreCanvasLifeCycle.displayQuickDialog = debounce(_DDeiCoreCanvasLifeCycle.displayQuickDialog, 300); let DDeiCoreCanvasLifeCycle = _DDeiCoreCanvasLifeCycle; const _DDeiExtQuickStyle = class _DDeiExtQuickStyle extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "order", 2); __publicField3(this, "dialogs", DDeiCoreCanvasQuickDialog); __publicField3(this, "lifecyclies", DDeiCoreCanvasLifeCycle); } getDialogs(editor) { if (DDeiPluginBase.isSubclass(this.dialogs, DDeiPluginBase)) { return this.dialogs.defaultIns.getDialogs(editor); } else if (this.dialogs instanceof DDeiPluginBase) { return this.dialogs.getDialogs(editor); } } getLifeCyclies(editor) { if (DDeiPluginBase.isSubclass(this.lifecyclies, DDeiPluginBase)) { return this.lifecyclies.defaultIns.getLifeCyclies(editor); } else if (this.lifecyclies instanceof DDeiPluginBase) { return this.lifecyclies.getLifeCyclies(editor); } } static configuration(options) { let core = new _DDeiExtQuickStyle(options); core.dialogs = core.dialogs.configuration(options, true); core.lifecyclies = core.lifecyclies.configuration(options, true); return core; } static modify(fn) { return _DDeiExtQuickStyle.defaultIns.modify(fn); } }; __publicField3(_DDeiExtQuickStyle, "order", 2); /** * 缺省实例 */ __publicField3(_DDeiExtQuickStyle, "defaultIns", new _DDeiExtQuickStyle(null)); let DDeiExtQuickStyle = _DDeiExtQuickStyle; const DialogBase$1 = { props: { editor: { type: DDeiEditor, default: null } }, data: function() { return { forceRefresh: false }; }, methods: { forceRefreshView: function() { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); } }, mounted() { this.editor.dialogs[this.dialogId].viewer = this; } }; const _sfc_main$5 = { name: "ddei-ext-panel-search", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { searchInputId: "", replaceInputId: "", replaceText: "" }; }, computed: {}, watch: {}, created() { if (!this.editor.search) { this.editor.search = { resultIndex: -1, result: [] }; } this.executeQuery = debounce(this.executeQuery, 300); }, mounted() { var _a3, _b2, _c2; if (!this.editor.search.mode) { this.editor.search.mode = 1; } this.searchInputId = this.editor.id + "_search_input"; this.replaceInputId = this.editor.id + "_search_replace_input"; if (((_c2 = (_b2 = (_a3 = this.editor) == null ? void 0 : _a3.search) == null ? void 0 : _b2.result) == null ? void 0 : _c2.length) > 0) { this.changeFileSheetSelectAndModel(); } setTimeout(() => { if (this.editor.search.mode == 2) { this.$refs.searchReplaceBoxInput.focus(); } else { this.$refs.searchBoxInput.focus(); } }, 300); }, methods: { changeReplace() { if (this.editor.search.mode == 1 && this.editor.ddInstance && this.editor.ddInstance["AC_DESIGN_EDIT"]) { this.editor.search.mode = 2; } else { this.editor.search.mode = 1; } }, changeMatchCase() { if (this.editor.search.matchCase == true) { this.editor.search.matchCase = false; } else { this.editor.search.matchCase = true; } this.executeQuery(); }, changeMatchAll() { if (this.editor.search.matchAll == true) { this.editor.search.matchAll = false; } else { this.editor.search.matchAll = true; } this.executeQuery(); }, executeQuery(evt) { var _a3, _b2, _c2; if ((evt == null ? void 0 : evt.keyCode) != 13 && (evt == null ? void 0 : evt.keyCode) != 27) { let rs = this.editor.searchModels((_a3 = this.editor.search) == null ? void 0 : _a3.keywords, "text", false, 3, (_b2 = this.editor.search) == null ? void 0 : _b2.matchCase, (_c2 = this.editor.search) == null ? void 0 : _c2.matchAll); if ((rs == null ? void 0 : rs.length) > 0) { this.editor.search.result = rs; this.editor.search.resultIndex = -1; } else { this.editor.search.result = []; this.editor.search.resultIndex = -1; } this.moveToNextResult(); } this.editor.search.inActive = false; return true; }, moveToNextResult() { this.editor.search.resultIndex++; this.changeFileSheetSelectAndModel(); }, moveToUpResult() { this.editor.search.resultIndex--; this.changeFileSheetSelectAndModel(); }, changeFileSheetSelectAndModel(clearSpt = false) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; this.editor.search.inActive = false; if (this.editor.search.resultIndex >= this.editor.search.result.length - 1) { this.editor.search.resultIndex = this.editor.search.result.length - 1; } else if (this.editor.search.resultIndex < 0) { this.editor.search.resultIndex = 0; } let ddInstance = this.editor.ddInstance; let rsData = this.editor.search.result[this.editor.search.resultIndex]; let skipIndex = [this.editor.search.resultIndex]; let textSelectColor = DDeiUtil.getStyleValue("canvas-text-selection", this.editor.ddInstance); if (rsData == null ? void 0 : rsData.model) { let file = this.editor.files[rsData.fileIndex]; if (file) { let sheetIndex = rsData.sheetIndex; if (sheetIndex >= 0) { this.editor.changeFile(rsData.fileIndex, sheetIndex); this.editor.centerModels(ddInstance.stage, rsData.model.id); (_b2 = (_a3 = rsData.model) == null ? void 0 : _a3.render) == null ? void 0 : _b2.controlSelect(); if (!clearSpt) { let sptStyle = {}; for (let i2 = 0; i2 < rsData.len; i2++) { sptStyle["" + (rsData.index + i2)] = { textStyle: { bgcolor: textSelectColor } }; } for (let k = this.editor.search.resultIndex - 1; k > 0; k--) { if (this.editor.search.result[k].model == rsData.model) { let rsd1 = this.editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } skipIndex.push(k); } else { break; } } for (let k = this.editor.search.resultIndex + 1; k < this.editor.search.result.length; k++) { if (this.editor.search.result[k].model == rsData.model) { let rsd1 = this.editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } skipIndex.push(k); } else { break; } } (_d2 = (_c2 = rsData.model) == null ? void 0 : _c2.render) == null ? void 0 : _d2.drawShape({ border: { type: 1, color: "#017fff", width: 1, dash: [10, 10] }, sptStyle }); } else { (_f = (_e2 = rsData.model) == null ? void 0 : _e2.render) == null ? void 0 : _f.enableRefreshShape(); } } } } for (let ri = 0; ri < this.editor.search.result.length; ri++) { let rsData2 = this.editor.search.result[ri]; if (rsData2 == null ? void 0 : rsData2.model) { let file = this.editor.files[rsData2.fileIndex]; if (file) { let sheetIndex = rsData2.sheetIndex; if (sheetIndex >= 0) { if (skipIndex.indexOf(ri) == -1) { if (!clearSpt) { let sptStyle = {}; for (let i2 = 0; i2 < rsData2.len; i2++) { sptStyle["" + (rsData2.index + i2)] = { textStyle: { bgcolor: "#ebebeb" } }; } for (let k = ri + 1; k < this.editor.search.result.length; k++) { if (this.editor.search.result[k].model == rsData2.model) { let rsd1 = this.editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } } else { ri = k - 1; break; } } (_h = (_g = rsData2.model) == null ? void 0 : _g.render) == null ? void 0 : _h.drawShape({ sptStyle }); } else { (_j = (_i = rsData2.model) == null ? void 0 : _i.render) == null ? void 0 : _j.enableRefreshShape(); } } } } } } ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); }, executeReplace(editor) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; if (((_b2 = (_a3 = editor.search) == null ? void 0 : _a3.result) == null ? void 0 : _b2.length) > 0) { let rsData = (_d2 = editor.search) == null ? void 0 : _d2.result[(_c2 = editor.search) == null ? void 0 : _c2.resultIndex]; if (rsData.model) { editor.replaceModelsData([rsData.model], "text", rsData.index, rsData.index + rsData.len, this.replaceText); for (let k = editor.search.resultIndex + 1; k < ((_e2 = editor.search.result) == null ? void 0 : _e2.length); k++) { if (editor.search.result[k].model == rsData.model) { let lenDelta = this.replaceText.length - rsData.len; if (lenDelta != 0) { editor.search.result[k].index += lenDelta; if (editor.search.result[k].index < 0) { editor.search.result[k].index = 0; } } } else { break; } } editor.search.result.splice((_f = editor.search) == null ? void 0 : _f.resultIndex, 1); if (editor.search.result.length > editor.search.resultIndex) { editor.search.resultIndex--; if (editor.search.resultIndex < 0) { editor.search.resultIndex = 0; } } if (editor.search.result.length == 0) { editor.search.resultIndex = 0; (_h = (_g = rsData.model) == null ? void 0 : _g.render) == null ? void 0 : _h.clearCachedValue(); } } this.changeFileSheetSelectAndModel(); let ddInstance = editor.ddInstance; ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); } editor.search.inActive = false; return true; }, executeReplaceAll(editor) { var _a3, _b2, _c2, _d2, _e2, _f, _g; while (((_b2 = (_a3 = editor.search) == null ? void 0 : _a3.result) == null ? void 0 : _b2.length) > 0) { let rsData = (_c2 = editor.search) == null ? void 0 : _c2.result[0]; if (rsData.model) { editor.replaceModelsData([rsData.model], "text", rsData.index, rsData.index + rsData.len, this.replaceText); for (let k = 1; k < ((_d2 = editor.search.result) == null ? void 0 : _d2.length); k++) { if (editor.search.result[k].model == rsData.model) { let lenDelta = this.replaceText.length - rsData.len; if (lenDelta != 0) { editor.search.result[k].index += lenDelta; if (editor.search.result[k].index < 0) { editor.search.result[k].index = 0; } } } else { break; } } editor.search.result.splice((_e2 = editor.search) == null ? void 0 : _e2.resultIndex, 1); (_g = (_f = rsData.model) == null ? void 0 : _f.render) == null ? void 0 : _g.clearCachedValue(); } } editor.search.resultIndex = -1; let ddInstance = editor.ddInstance; ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); editor.search.inActive = false; return true; }, changeEditorState() { this.editor.changeState("ddei-search"); }, closeDialog() { DDeiEditorUtil.closeDialog(this.editor, "ddei-ext-dialog-search", true); this.changeFileSheetSelectAndModel(true); this.editor.changeState(DDeiEditorState.DESIGNING); } } }; const SearchPanel_vue_vue_type_style_index_0_scoped_75611720_lang = ""; const _hoisted_1$5 = { class: "ddei-ext-panel-search" }; const _hoisted_2$3 = { class: "icon", "aria-hidden": "true" }; const _hoisted_3$2 = { key: 0, "xlink:href": "#icon-btn-right1" }; const _hoisted_4$2 = { key: 1, "xlink:href": "#icon-expand2" }; const _hoisted_5$2 = { class: "ddei-ext-panel-search-box" }; const _hoisted_6$2 = ["id", "placeholder"]; const _hoisted_7$2 = { class: "icon", style: { "width": "16px", "height": "16px" }, "aria-hidden": "true" }; const _hoisted_8$1 = { key: 0, class: "ddei-ext-panel-search-result" }; const _hoisted_9$1 = { key: 1, class: "ddei-ext-panel-search-result" }; const _hoisted_10 = { class: "ddei-ext-panel-search-buttons" }; const _hoisted_11 = { key: 2, class: "ddei-ext-panel-search-box" }; const _hoisted_12 = ["id", "placeholder"]; const _hoisted_13 = { key: 3, class: "ddei-ext-panel-search-replace-buttons" }; function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s; return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-ext-panel-search-mode": true, "ddei-ext-panel-search-mode__expand": ((_a3 = $props.editor.search) == null ? void 0 : _a3.mode) == 2 }), onClick: _cache[0] || (_cache[0] = (...args) => $options.changeReplace && $options.changeReplace(...args)) }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2$3, [ ((_b2 = $props.editor.search) == null ? void 0 : _b2.mode) == 1 ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_3$2)) : vue.createCommentVNode("", true), ((_c2 = $props.editor.search) == null ? void 0 : _c2.mode) == 2 ? (vue.openBlock(), vue.createElementBlock("use", _hoisted_4$2)) : vue.createCommentVNode("", true) ])) ], 2), vue.createElementVNode("div", _hoisted_5$2, [ vue.withDirectives(vue.createElementVNode("input", { class: "ddei-ext-panel-search-box-input", "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.editor.search.keywords = $event), id: $data.searchInputId, ref: "searchBoxInput", onKeydown: _cache[2] || (_cache[2] = ($event) => $options.executeQuery($event)), onFocus: _cache[3] || (_cache[3] = (...args) => $options.changeEditorState && $options.changeEditorState(...args)), placeholder: $props.editor.i18n("ddei.search"), autocomplete: "off" }, null, 40, _hoisted_6$2), [ [vue.vModelText, $props.editor.search.keywords] ]), vue.createElementVNode("div", { onClick: _cache[4] || (_cache[4] = ($event) => $options.changeMatchCase()), class: vue.normalizeClass({ "ddei-ext-panel-search-box-btn": true, "ddei-ext-panel-search-box-btn__selected": ((_d2 = $props.editor.search) == null ? void 0 : _d2.matchCase) == 1 }) }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_7$2, _cache[13] || (_cache[13] = [ vue.createElementVNode("use", { "xlink:href": "#icon-lock-case" }, null, -1) ]))) ], 2), vue.createElementVNode("div", { onClick: _cache[5] || (_cache[5] = ($event) => $options.changeMatchAll()), class: vue.normalizeClass({ "ddei-ext-panel-search-box-btn": true, "ddei-ext-panel-search-box-btn__selected": ((_e2 = $props.editor.search) == null ? void 0 : _e2.matchAll) == 1 }) }, _cache[14] || (_cache[14] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-all-match" }) ], -1) ]), 2) ]), $props.editor.lang == "zh_CN" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, " 第" + vue.toDisplayString(((_f = $props.editor.search) == null ? void 0 : _f.resultIndex) + 1) + "项,共" + vue.toDisplayString((_h = (_g = $props.editor.search) == null ? void 0 : _g.result) == null ? void 0 : _h.length) + "项 ", 1)) : vue.createCommentVNode("", true), $props.editor.lang != "zh_CN" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, vue.toDisplayString(((_i = $props.editor.search) == null ? void 0 : _i.resultIndex) + 1) + "/" + vue.toDisplayString((_k = (_j = $props.editor.search) == null ? void 0 : _j.result) == null ? void 0 : _k.length), 1)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_10, [ vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-ext-panel-search-buttons-btn": true, "ddei-ext-panel-search-buttons-btn__disabled": !$props.editor.search || ((_l = $props.editor.search) == null ? void 0 : _l.resultIndex) >= ((_n = (_m = $props.editor.search) == null ? void 0 : _m.result) == null ? void 0 : _n.length) - 1 }), onClick: _cache[6] || (_cache[6] = ($event) => $options.moveToNextResult()) }, _cache[15] || (_cache[15] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-down" }) ], -1) ]), 2), vue.createElementVNode("div", { class: vue.normalizeClass({ "ddei-ext-panel-search-buttons-btn": true, "ddei-ext-panel-search-buttons-btn__disabled": !$props.editor.search || ((_o = $props.editor.search) == null ? void 0 : _o.resultIndex) == 0 || ((_q = (_p = $props.editor.search) == null ? void 0 : _p.result) == null ? void 0 : _q.length) == 0 }), onClick: _cache[7] || (_cache[7] = ($event) => $options.moveToUpResult()) }, _cache[16] || (_cache[16] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-up" }) ], -1) ]), 2), vue.createElementVNode("div", { class: "ddei-ext-panel-search-buttons-btn", onClick: _cache[8] || (_cache[8] = (...args) => $options.closeDialog && $options.closeDialog(...args)) }, _cache[17] || (_cache[17] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-close" }) ], -1) ])) ]), ((_r = $props.editor.search) == null ? void 0 : _r.mode) == 2 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [ vue.withDirectives(vue.createElementVNode("input", { id: $data.replaceInputId, ref: "searchReplaceBoxInput", class: "ddei-ext-panel-search-box-input", "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.replaceText = $event), onFocus: _cache[10] || (_cache[10] = (...args) => $options.changeEditorState && $options.changeEditorState(...args)), placeholder: $props.editor.i18n("ddei.replace"), autocomplete: "off" }, null, 40, _hoisted_12), [ [vue.vModelText, $data.replaceText] ]) ])) : vue.createCommentVNode("", true), ((_s = $props.editor.search) == null ? void 0 : _s.mode) == 2 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [ vue.createElementVNode("div", { class: "ddei-ext-panel-search-replace-buttons-btn", onClick: _cache[11] || (_cache[11] = ($event) => $options.executeReplace($props.editor)) }, _cache[18] || (_cache[18] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-replace" }) ], -1) ])), vue.createElementVNode("div", { class: "ddei-ext-panel-search-replace-buttons-btn", onClick: _cache[12] || (_cache[12] = ($event) => $options.executeReplaceAll($props.editor)) }, _cache[19] || (_cache[19] = [ vue.createElementVNode("svg", { class: "icon", "aria-hidden": "true" }, [ vue.createElementVNode("use", { "xlink:href": "#icon-replace-all" }) ], -1) ])) ])) : vue.createCommentVNode("", true) ]); } const SearchPanel = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-75611720"]]); const _sfc_main$4 = { name: "ddei-ext-dialog-search", extends: null, mixins: [DialogBase$1], props: { options: { type: Object, default: null } }, data() { return { dialogId: "ddei-ext-dialog-search" }; }, computed: {}, components: { SearchPanel }, watch: {}, created() { }, mounted() { }, methods: {} }; const SearchDialog_vue_vue_type_style_index_0_scoped_869178bc_lang = ""; const _hoisted_1$4 = ["id"]; function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { var _a3; const _component_SearchPanel = vue.resolveComponent("SearchPanel"); return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-ext-dialog-search" }, [ vue.createVNode(_component_SearchPanel, { editor: _ctx.editor, options: $props.options }, null, 8, ["editor", "options"]) ], 8, _hoisted_1$4)) : vue.createCommentVNode("", true); } const SearchDialog = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-869178bc"]]); const _DDeiExtSearchDialog = class _DDeiExtSearchDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", SearchDialog.name); __publicField3(this, "plugins", [SearchDialog]); } getDialogs(editor) { return this.plugins; } static modify(fn) { return _DDeiExtSearchDialog.defaultIns.modify(fn); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[AlignDialog.name]) { for (let i2 in options[AlignDialog.name]) { newOptions[i2] = options[AlignDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiExtSearchDialog(newOptions); return panels; } } return _DDeiExtSearchDialog; } }; /** * 缺省实例 */ __publicField3(_DDeiExtSearchDialog, "defaultIns", new _DDeiExtSearchDialog(null)); let DDeiExtSearchDialog = _DDeiExtSearchDialog; const _DDeiExtSearchPanel = class _DDeiExtSearchPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", SearchPanel.name); __publicField3(this, "plugins", [SearchPanel]); } getPanels(editor) { return this.plugins; } static modify(fn) { return _DDeiExtSearchPanel.defaultIns.modify(fn); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ChangeRatio.name]) { for (let i2 in options[ChangeRatio.name]) { newOptions[i2] = options[ChangeRatio.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiExtSearchPanel(newOptions); return panels; } } return _DDeiExtSearchPanel; } }; /** * 缺省实例 */ __publicField3(_DDeiExtSearchPanel, "defaultIns", new _DDeiExtSearchPanel(null)); let DDeiExtSearchPanel = _DDeiExtSearchPanel; const _DDeiKeyActionSearch = class _DDeiKeyActionSearch extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-ext-keyaction-search"); __publicField3(this, "defaultOptions", { "keys": [ { ctrl: 1, keys: "70", type: "search" }, { ctrl: 1, keys: "72", type: "replace" } ] }); } getHotKeys(editor) { return [this]; } static modify(fn) { return _DDeiKeyActionSearch.defaultIns.modify(fn); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionSearch.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionSearch.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionSearch.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionSearch(newOptions); return panels; } } return _DDeiKeyActionSearch; } // ============================ 方法 =============================== action(evt, ddInstance, editor, item) { var _a3; let mode = 1; if ((item == null ? void 0 : item.type) == "replace" && ddInstance && ddInstance["AC_DESIGN_EDIT"]) { mode = 2; } if (!editor.search) { editor.search = { resultIndex: -1, result: [] }; } editor.search.mode = mode; if (!editor.tempPopData || !editor.tempPopData["ddei-ext-dialog-search"]) { let srcElement = document.getElementById(editor.id + "_canvas"); if (srcElement) { let editor2 = DDeiEditorUtil.getEditorInsByDDei(ddInstance); DDeiEditorUtil.closeDialog(editor2, "ddei-ext-dialog-search", true); let editorEle = document.getElementById(editor2.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let canvasPos = DDeiUtil.getDomAbsPosition(srcElement); let left = canvasPos.left - editorDomPos.left + srcElement.offsetWidth - 500; let top = canvasPos.top - editorDomPos.top; if ((_a3 = editor2.search) == null ? void 0 : _a3.result) { editor2.search.inActive = true; } DDeiEditorUtil.showDialog(editor2, "ddei-ext-dialog-search", { group: "ddei-core-search" }, { type: 99, left, top, hiddenMask: true }, null, true, true); editor2.changeState("ddei-search"); } } else { if (mode == 2) { let searchReplaceInput = document.getElementById(editor.id + "_search_replace_input"); if (searchReplaceInput) { searchReplaceInput.focus(); editor.search.inActive = false; editor.changeState("ddei-search"); } } else { let searchInput = document.getElementById(editor.id + "_search_input"); if (searchInput) { searchInput.focus(); editor.search.inActive = false; editor.changeState("ddei-search"); } } } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionSearch, "defaultIns", new _DDeiKeyActionSearch()); let DDeiKeyActionSearch = _DDeiKeyActionSearch; const _DDeiKeyActionSearchUp = class _DDeiKeyActionSearchUp extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-ext-keyaction-search-up"); __publicField3(this, "defaultOptions", { "keys": [ { shift: 1, keys: "13", editorState: "ddei-search" } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionSearchUp.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionSearchUp.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionSearchUp.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionSearchUp(newOptions); return panels; } } return _DDeiKeyActionSearchUp; } static modify(fn) { return _DDeiKeyActionSearchUp.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance, editor) { var _a3; if (editor.tempPopData && editor.tempPopData["ddei-ext-dialog-search"]) { if (!((_a3 = editor.search) == null ? void 0 : _a3.inActive)) { if (editor.search.resultIndex <= 0) { return; } editor.search.resultIndex--; this.changeFileSheetSelectAndModel(editor); } else { editor.search.inActive = false; } } } changeFileSheetSelectAndModel(editor) { var _a3, _b2, _c2, _d2, _e2, _f; editor.search.inActive = false; if (editor.search.resultIndex >= editor.search.result.length - 1) { editor.search.resultIndex = editor.search.result.length - 1; } else if (editor.search.resultIndex < 0) { editor.search.resultIndex = 0; } let ddInstance = editor.ddInstance; let rsData = editor.search.result[editor.search.resultIndex]; let skipIndex = [editor.search.resultIndex]; let textSelectColor = DDeiUtil.getStyleValue("canvas-text-selection", editor.ddInstance); if (rsData == null ? void 0 : rsData.model) { let file = editor.files[rsData.fileIndex]; if (file) { let sheetIndex = rsData.sheetIndex; if (sheetIndex >= 0) { editor.changeFile(rsData.fileIndex, sheetIndex); editor.centerModels(ddInstance.stage, rsData.model.id); (_b2 = (_a3 = rsData.model) == null ? void 0 : _a3.render) == null ? void 0 : _b2.controlSelect(); let sptStyle = {}; for (let i2 = 0; i2 < rsData.len; i2++) { sptStyle["" + (rsData.index + i2)] = { textStyle: { bgcolor: textSelectColor } }; } for (let k = editor.search.resultIndex - 1; k > 0; k--) { if (editor.search.result[k].model == rsData.model) { let rsd1 = editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } skipIndex.push(k); } else { break; } } for (let k = editor.search.resultIndex + 1; k < editor.search.result.length; k++) { if (editor.search.result[k].model == rsData.model) { let rsd1 = editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } skipIndex.push(k); } else { break; } } (_d2 = (_c2 = rsData.model) == null ? void 0 : _c2.render) == null ? void 0 : _d2.drawShape({ border: { type: 1, color: "#017fff", width: 1, dash: [10, 10] }, sptStyle }); } } } for (let ri = 0; ri < editor.search.result.length; ri++) { let rsData2 = editor.search.result[ri]; if (rsData2 == null ? void 0 : rsData2.model) { let file = editor.files[rsData2.fileIndex]; if (file) { let sheetIndex = rsData2.sheetIndex; if (sheetIndex >= 0) { if (skipIndex.indexOf(ri) == -1) { let sptStyle = {}; for (let i2 = 0; i2 < rsData2.len; i2++) { sptStyle["" + (rsData2.index + i2)] = { textStyle: { bgcolor: "#ebebeb" } }; } for (let k = ri + 1; k < editor.search.result.length; k++) { if (editor.search.result[k].model == rsData2.model) { let rsd1 = editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } } else { ri = k - 1; break; } } (_f = (_e2 = rsData2.model) == null ? void 0 : _e2.render) == null ? void 0 : _f.drawShape({ sptStyle }); } } } } } ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionSearchUp, "defaultIns", new _DDeiKeyActionSearchUp()); let DDeiKeyActionSearchUp = _DDeiKeyActionSearchUp; const _DDeiKeyActionSearchNext = class _DDeiKeyActionSearchNext extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-core-keyaction-search-next"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "13", editorState: "ddei-search" }, { ctrl: 1, keys: "13", editorState: "ddei-search", type: "replaceAll" } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionSearchNext.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionSearchNext.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionSearchNext.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionSearchNext(newOptions); return panels; } } return _DDeiKeyActionSearchNext; } static modify(fn) { return _DDeiKeyActionSearchNext.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance, editor, item) { var _a3; if (editor.tempPopData && editor.tempPopData["ddei-ext-dialog-search"]) { if (!((_a3 = editor.search) == null ? void 0 : _a3.inActive)) { if (editor.search.resultIndex >= editor.search.result.length - 1) { return; } let replaceInput = document.getElementById(editor.id + "_search_replace_input"); if (replaceInput && document.activeElement == replaceInput && ddInstance && ddInstance["AC_DESIGN_EDIT"]) { if ((item == null ? void 0 : item.type) == "replaceAll") { this.executeReplaceAll(editor, replaceInput); return; } else { this.executeReplace(editor, replaceInput); } } editor.search.resultIndex++; this.changeFileSheetSelectAndModel(editor); } else { editor.search.inActive = false; } } } executeReplace(editor, textInput) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h; if (((_b2 = (_a3 = editor.search) == null ? void 0 : _a3.result) == null ? void 0 : _b2.length) > 0) { let rsData = (_d2 = editor.search) == null ? void 0 : _d2.result[(_c2 = editor.search) == null ? void 0 : _c2.resultIndex]; if (rsData.model) { editor.replaceModelsData([rsData.model], "text", rsData.index, rsData.index + rsData.len, textInput.value); for (let k = editor.search.resultIndex + 1; k < ((_e2 = editor.search.result) == null ? void 0 : _e2.length); k++) { if (editor.search.result[k].model == rsData.model) { let lenDelta = textInput.value.length - rsData.len; if (lenDelta != 0) { editor.search.result[k].index += lenDelta; if (editor.search.result[k].index < 0) { editor.search.result[k].index = 0; } } } else { break; } } editor.search.result.splice((_f = editor.search) == null ? void 0 : _f.resultIndex, 1); if (editor.search.result.length > editor.search.resultIndex) { editor.search.resultIndex--; if (editor.search.resultIndex < 0) { editor.search.resultIndex = 0; } } if (editor.search.result.length == 0) { editor.search.resultIndex = 0; (_h = (_g = rsData.model) == null ? void 0 : _g.render) == null ? void 0 : _h.clearCachedValue(); } } } } changeFileSheetSelectAndModel(editor) { var _a3, _b2, _c2, _d2, _e2, _f; editor.search.inActive = false; if (editor.search.resultIndex >= editor.search.result.length - 1) { editor.search.resultIndex = editor.search.result.length - 1; } else if (editor.search.resultIndex < 0) { editor.search.resultIndex = 0; } let ddInstance = editor.ddInstance; let rsData = editor.search.result[editor.search.resultIndex]; let skipIndex = [editor.search.resultIndex]; let textSelectColor = DDeiUtil.getStyleValue("canvas-text-selection", editor.ddInstance); if (rsData == null ? void 0 : rsData.model) { let file = editor.files[rsData.fileIndex]; if (file) { let sheetIndex = rsData.sheetIndex; if (sheetIndex >= 0) { editor.changeFile(rsData.fileIndex, sheetIndex); editor.centerModels(ddInstance.stage, rsData.model.id); (_b2 = (_a3 = rsData.model) == null ? void 0 : _a3.render) == null ? void 0 : _b2.controlSelect(); let sptStyle = {}; for (let i2 = 0; i2 < rsData.len; i2++) { sptStyle["" + (rsData.index + i2)] = { textStyle: { bgcolor: textSelectColor } }; } for (let k = editor.search.resultIndex - 1; k > 0; k--) { if (editor.search.result[k].model == rsData.model) { let rsd1 = editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } skipIndex.push(k); } else { break; } } for (let k = editor.search.resultIndex + 1; k < editor.search.result.length; k++) { if (editor.search.result[k].model == rsData.model) { let rsd1 = editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } skipIndex.push(k); } else { break; } } (_d2 = (_c2 = rsData.model) == null ? void 0 : _c2.render) == null ? void 0 : _d2.drawShape({ border: { type: 1, color: "#017fff", width: 1, dash: [10, 10] }, sptStyle }); } } } for (let ri = 0; ri < editor.search.result.length; ri++) { let rsData2 = editor.search.result[ri]; if (rsData2 == null ? void 0 : rsData2.model) { let file = editor.files[rsData2.fileIndex]; if (file) { let sheetIndex = rsData2.sheetIndex; if (sheetIndex >= 0) { if (skipIndex.indexOf(ri) == -1) { let sptStyle = {}; for (let i2 = 0; i2 < rsData2.len; i2++) { sptStyle["" + (rsData2.index + i2)] = { textStyle: { bgcolor: "#ebebeb" } }; } for (let k = ri + 1; k < editor.search.result.length; k++) { if (editor.search.result[k].model == rsData2.model) { let rsd1 = editor.search.result[k]; for (let ki = 0; ki < rsd1.len; ki++) { sptStyle["" + (rsd1.index + ki)] = { textStyle: { bgcolor: "#ebebeb" } }; } } else { ri = k - 1; break; } } (_f = (_e2 = rsData2.model) == null ? void 0 : _e2.render) == null ? void 0 : _f.drawShape({ sptStyle }); } } } } } ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.executeAll(); } executeReplaceAll(editor, textInput) { var _a3, _b2, _c2, _d2, _e2, _f, _g; while (((_b2 = (_a3 = editor.search) == null ? void 0 : _a3.result) == null ? void 0 : _b2.length) > 0) { let rsData = (_c2 = editor.search) == null ? void 0 : _c2.result[0]; if (rsData.model) { editor.replaceModelsData([rsData.model], "text", rsData.index, rsData.index + rsData.len, textInput.value); for (let k = 1; k < ((_d2 = editor.search.result) == null ? void 0 : _d2.length); k++) { if (editor.search.result[k].model == rsData.model) { let lenDelta = textInput.value.length - rsData.len; if (lenDelta != 0) { editor.search.result[k].index += lenDelta; if (editor.search.result[k].index < 0) { editor.search.result[k].index = 0; } } } else { break; } } editor.search.result.splice((_e2 = editor.search) == null ? void 0 : _e2.resultIndex, 1); (_g = (_f = rsData.model) == null ? void 0 : _f.render) == null ? void 0 : _g.clearCachedValue(); } } editor.search.resultIndex = -1; let ddInstance = editor.ddInstance; ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionSearchNext, "defaultIns", new _DDeiKeyActionSearchNext()); let DDeiKeyActionSearchNext = _DDeiKeyActionSearchNext; const _DDeiKeyActionSearchEsc = class _DDeiKeyActionSearchEsc extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-ext-keyaction-search-esc"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "27" } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionSearchEsc.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionSearchEsc.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionSearchEsc.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionSearchEsc(newOptions); return panels; } } return _DDeiKeyActionSearchEsc; } static modify(fn) { return _DDeiKeyActionSearchEsc.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance, editor) { var _a3, _b2; if (editor.tempPopData && editor.tempPopData["ddei-ext-dialog-search"]) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-search", true); if (editor.search.resultIndex >= editor.search.result.length - 1) { editor.search.resultIndex = editor.search.result.length - 1; } else if (editor.search.resultIndex < 0) { editor.search.resultIndex = 0; } let rsData = editor.search.result[editor.search.resultIndex]; if (rsData == null ? void 0 : rsData.model) { (_b2 = (_a3 = rsData.model) == null ? void 0 : _a3.render) == null ? void 0 : _b2.enableRefreshShape(); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {}); ddInstance.bus.executeAll(); } editor.changeState(DDeiEditorState.DESIGNING); } } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionSearchEsc, "defaultIns", new _DDeiKeyActionSearchEsc()); let DDeiKeyActionSearchEsc = _DDeiKeyActionSearchEsc; const _DDeiExtSearchHotkeys = class _DDeiExtSearchHotkeys extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [DDeiKeyActionSearch, DDeiKeyActionSearchUp, DDeiKeyActionSearchNext, DDeiKeyActionSearchEsc]); } getHotKeys(editor) { var _a3; let hotkeys = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getHotKeys(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getHotKeys(editor); } if ((ls == null ? void 0 : ls.length) > 0) { hotkeys = hotkeys.concat(ls); } }); return hotkeys; } static modify(fn) { return _DDeiExtSearchHotkeys.defaultIns.modify(fn); } static configuration(options) { var _a3; let hotkeys = new _DDeiExtSearchHotkeys(options); for (let i2 = 0; i2 < ((_a3 = hotkeys.plugins) == null ? void 0 : _a3.length); i2++) { hotkeys.plugins[i2] = hotkeys.plugins[i2].configuration(options, true); } return hotkeys; } }; /** * 缺省实例 */ __publicField3(_DDeiExtSearchHotkeys, "defaultIns", new _DDeiExtSearchHotkeys(null)); let DDeiExtSearchHotkeys = _DDeiExtSearchHotkeys; let DDeiExtSearchLifeCycle$1 = (_a2 = class extends DDeiLifeCycle { constructor() { super(...arguments); __publicField3(this, "name", "search-ext-lifecycle"); __publicField3(this, "EVENT_MOUSE_OPERATING", new DDeiFuncData("search-ext-hidden", 1, this.mouseOperating)); } /** * 正在进行鼠标操作 */ mouseOperating(operateType, data, ddInstance, evt) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.tempPopData && editor.tempPopData["ddei-ext-dialog-search"]) { DDeiEditorUtil.hiddenDialog(editor, "ddei-ext-dialog-search"); if (operateType == "SCROLL_WORKING" || operateType == "CHANGE_RATIO" || operateType == "SELECT_WORKING" || operateType == "DRAG" || operateType == "CREATE" || operateType == "CHANGE_WPV" || operateType == "CHANGE_BOUNDS" || operateType == "CHANGE_ROTATE") { _a2.displaySearchDialog(editor); } } } static displaySearchDialog(editor) { let srcElement = document.getElementById(editor.id + "_canvas"); let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let canvasPos = DDeiUtil.getDomAbsPosition(srcElement); let left = canvasPos.left - editorDomPos.left + srcElement.offsetWidth - 500; let top = canvasPos.top - editorDomPos.top; DDeiEditorUtil.displayDialog(editor, "ddei-ext-dialog-search", null, { type: 99, left, top, hiddenMask: true }); } static modify(fn) { return _a2.defaultIns.modify(fn); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_a2.name]) { for (let i2 in options[_a2.name]) { newOptions[i2] = options[_a2.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _a2(); if (newOptions.name) { panels.name = newOptions.name; } if (newOptions.sort) { panels.sort = newOptions.sort; } return panels; } } return _a2; } }, /** * 缺省实例 */ __publicField3(_a2, "defaultIns", new _a2(null)), _a2.displaySearchDialog = debounce(_a2.displaySearchDialog, 300), _a2); const DialogBase = { props: { editor: { type: DDeiEditor, default: null } }, data: function() { return { forceRefresh: false }; }, methods: { forceRefreshView: function() { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); } }, mounted() { this.editor.dialogs[this.dialogId].viewer = this; } }; const _sfc_main$3 = { name: "ddei-ext-panel-quickcontrol", extends: null, mixins: [], props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { leftOffset: null, rightOffset: null, topOffset: null, bottomOffset: null, //四个方向的状态,0无连线,1有连线 leftState: 0, rightState: 0, bottomState: 0, topState: 0 }; }, computed: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2, _c2, _d2, _e2; if (this.editor.tempPopData && this.editor.tempPopData["ddei-ext-dialog-quickcontrol"] && this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].model) { let model = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].model; if (model) { let outRect = DDeiAbstractShape.getOutRectByPV([model]); let stageRatio2 = (_a3 = model.stage) == null ? void 0 : _a3.getStageRatio(); outRect.x *= stageRatio2; outRect.x1 *= stageRatio2; outRect.y *= stageRatio2; outRect.y1 *= stageRatio2; outRect.width *= stageRatio2; outRect.height *= stageRatio2; let width = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].width; width = width || width == 0 ? width : 40; let height = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].height; height = height || height == 0 ? height : 40; this.$refs.quickControlDiv.style.width = outRect.width + width + "px"; this.$refs.quickControlDiv.style.height = outRect.height + height + "px"; this.leftOffset = (_b2 = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].offset) == null ? void 0 : _b2.left; this.rightOffset = (_c2 = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].offset) == null ? void 0 : _c2.right; this.topOffset = (_d2 = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].offset) == null ? void 0 : _d2.top; this.bottomOffset = (_e2 = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].offset) == null ? void 0 : _e2.bottom; for (let i2 in model.exPvs) { let mlPoint = model.exPvs[i2]; if (parseInt(mlPoint.y) == parseInt(outRect.y)) { this.topState = 1; } else if (parseInt(mlPoint.x) == parseInt(outRect.x1)) { this.rightState = 1; } else if (parseInt(mlPoint.y) == parseInt(outRect.y1)) { this.bottomState = 1; } else if (parseInt(mlPoint.x) == parseInt(outRect.x)) { this.leftState = 1; } } } } }, mouseEnter(type, el, evt) { if (this.editor.state == "designing") { if (this.editor.tempPopData["ddei-ext-dialog-quickcontrol"]) { let existsControl = null; let model = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].model; let layer2 = model.layer; let outRect = DDeiAbstractShape.getOutRectByPV([model]); if (type == 1) { let controls2 = layer2.getSubModels([model.id], 100, { x: outRect.x, y: outRect.y - 150, x1: outRect.x1, y1: outRect.y }); controls2 = this.filtControls(model, controls2); if (controls2.length > 0) { existsControl = controls2[0]; } } else if (type == 2) { let controls2 = layer2.getSubModels([model.id], 100, { x: outRect.x1, y: outRect.y, x1: outRect.x1 + 150, y1: outRect.y1 }); controls2 = this.filtControls(model, controls2); if (controls2.length > 0) { existsControl = controls2[0]; } } else if (type == 3) { let controls2 = layer2.getSubModels([model.id], 100, { x: outRect.x, y: outRect.y1, x1: outRect.x1, y1: outRect.y1 + 150 }); controls2 = this.filtControls(model, controls2); if (controls2.length > 0) { existsControl = controls2[0]; } } else if (type == 4) { let controls2 = layer2.getSubModels([model.id], 100, { x: outRect.x - 150, y: outRect.y, x1: outRect.x, y1: outRect.y1 }); controls2 = this.filtControls(model, controls2); if (controls2.length > 0) { existsControl = controls2[0]; } } if (!existsControl) { if (this.editor.tempLineModel) { this.editor.ddInstance.stage.removeModel(this.editor.tempLineModel, true); delete this.editor.tempLineModel; } let editorEle = document.getElementById(this.editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let modelPos = DDeiUtil.getModelsDomAbsPosition([model]); let width = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].width; width = width || width == 0 ? width : 40; let height = this.editor.tempPopData["ddei-ext-dialog-quickcontrol"].height; height = height || height == 0 ? height : 40; if (model.state == DDeiEnumControlState.SELECTED) { height = 70; } let left = modelPos.left - editorDomPos.left - width / 2; let top = modelPos.top - editorDomPos.top - height / 2; let qcWidth = modelPos.width + width; let qcHeight = modelPos.height + height; if (type == 1) { left = left + qcWidth / 2 - 120; top = top - 240; } else if (type == 2) { left = left + qcWidth; top = top + qcHeight / 2 - 120; } else if (type == 3) { left = left + qcWidth / 2 - 120; top = top + qcHeight; } else if (type == 4) { left = left - 240; top = top + qcHeight / 2 - 120; } if (model.state == DDeiEnumControlState.SELECTED) { top -= 10; } DDeiEditorUtil.showDialog(this.editor, "ddei-ext-dialog-quickchoosecontrol", { group: "canvas-pop-quickcreatecontrol", type, model }, { type: 99, left, top, hiddenMask: true }, null, true, true); } else if (!this.editor.tempLineModel) { let outRect1 = DDeiAbstractShape.getOutRectByPV([existsControl]); let sx, sy, ex, ey; let startSita, endSita; if (type == 1) { sx = (outRect.x + outRect.x1) / 2; sy = outRect.y; ex = (outRect1.x + outRect1.x1) / 2; ey = outRect1.y1; startSita = -90; endSita = 90; } else if (type == 2) { sx = outRect.x1; sy = (outRect.y + outRect.y1) / 2; ex = outRect1.x; ey = (outRect1.y + outRect1.y1) / 2; startSita = 0; endSita = 180; } else if (type == 3) { sx = (outRect.x + outRect.x1) / 2; sy = outRect.y1; ex = (outRect1.x + outRect1.x1) / 2; ey = outRect1.y; startSita = 90; endSita = -90; } else if (type == 4) { sx = outRect.x; sy = (outRect.y + outRect.y1) / 2; ex = outRect1.x1; ey = (outRect1.y + outRect1.y1) / 2; startSita = 180; endSita = 0; } let smodel = { id: model.id, x: sx, y: sy, rate: 0.5, sita: startSita }; let emodel = { id: existsControl.id, x: ex, y: ey, rate: 0.5, sita: endSita }; let initLine = DDeiEditorUtil.getLineInitJSON(this.editor.ddInstance, smodel, emodel); if (initLine) { let initJson = clone(initLine); initJson.model = initLine.modelCode ? initLine.modelCode : initLine.model ? initLine.model : initLine.id ? initLine.id : "100401"; if (!initJson.type) { initJson.type = 2; } if (!initJson.dash) { initJson.dash = [10, 5]; this.lockDash = false; } else { this.lockDash = true; } if (!initJson.startPoint) { initJson.startPoint = { x: sx, y: sy }; } if (!initJson.endPoint) { initJson.endPoint = { x: ex, y: ey }; } if (!initJson.smodel) { initJson.smodel = smodel; } if (!initJson.emodel) { initJson.emodel = emodel; } let lines = this.editor.addLines([ initJson ], true, true, false); this.editor.tempLineModel = lines[0]; DDeiEditorUtil.closeDialog(this.editor, "ddei-ext-dialog-quickchoosecontrol", true); this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape); this.editor.bus.executeAll(); } } } } }, createLineOk() { var _a3; if (this.editor.tempLineModel) { if (!this.lockDash) { delete this.editor.tempLineModel.dash; } delete this.lockDash; (_a3 = this.editor.tempLineModel.render) == null ? void 0 : _a3.clearCachedValue(); delete this.editor.tempLineModel; this.refreshData(); } }, mouseleave() { if (this.editor.tempLineModel) { this.editor.ddInstance.stage.removeModel(this.editor.tempLineModel, true); delete this.editor.tempLineModel; } }, filtControls(model, controls2) { let returnControls = []; if ((controls2 == null ? void 0 : controls2.length) > 0) { for (let i2 = 0; i2 < controls2.length; i2++) { if (controls2[i2].baseModelType != "DDeiLine" && controls2[i2].depModel != model) { let define2 = DDeiUtil.getControlDefine(controls2[i2]); let filterMethod = null; if (define2 && define2.filters && define2.filters["LINE_OBI_FILTER"]) { filterMethod = define2.filters["LINE_OBI_FILTER"]; } if (!filterMethod || filterMethod(model, { model: controls2[i2] })) { returnControls.push(controls2[i2]); } } } } return returnControls; } } }; const QuickControlPanel_vue_vue_type_style_index_0_scoped_dd1c62d6_lang = ""; const _hoisted_1$3 = { class: "ddei-ext-panel-quickcontrol", ref: "quickControlDiv" }; const _hoisted_2$2 = { class: "ddei-ext-panel-quickcontrol-middle" }; function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [ vue.createElementVNode("div", { class: "ddei-ext-panel-quickcontrol-left", style: vue.normalizeStyle($data.leftOffset) }, [ $data.leftState != 1 ? (vue.openBlock(), vue.createElementBlock("svg", { key: 0, width: "16", height: "11", onMouseenter: _cache[0] || (_cache[0] = ($event) => $options.mouseEnter(4, _ctx.$el, $event)), onMousedown: _cache[1] || (_cache[1] = (...args) => $options.createLineOk && $options.createLineOk(...args)), onMouseleave: _cache[2] || (_cache[2] = (...args) => $options.mouseleave && $options.mouseleave(...args)), style: { "transform": "rotate(-90deg)" } }, _cache[12] || (_cache[12] = [ vue.createElementVNode("polygon", { points: "8,0 1,10 15,10" }, null, -1) ]), 32)) : vue.createCommentVNode("", true) ], 4), vue.createElementVNode("div", _hoisted_2$2, [ vue.createElementVNode("div", { class: "ddei-ext-panel-quickcontrol-middle-top", style: vue.normalizeStyle($data.topOffset) }, [ $data.topState != 1 ? (vue.openBlock(), vue.createElementBlock("svg", { key: 0, width: "16", height: "11", onMouseenter: _cache[3] || (_cache[3] = ($event) => $options.mouseEnter(1, _ctx.$el, $event)), onMouseleave: _cache[4] || (_cache[4] = (...args) => $options.mouseleave && $options.mouseleave(...args)), onMousedown: _cache[5] || (_cache[5] = (...args) => $options.createLineOk && $options.createLineOk(...args)) }, _cache[13] || (_cache[13] = [ vue.createElementVNode("polygon", { points: "8,0 1,10 15,10" }, null, -1) ]), 32)) : vue.createCommentVNode("", true) ], 4), _cache[15] || (_cache[15] = vue.createElementVNode("div", { class: "ddei-ext-panel-quickcontrol-middle-middle" }, null, -1)), vue.createElementVNode("div", { class: "ddei-ext-panel-quickcontrol-middle-bottom", style: vue.normalizeStyle($data.bottomOffset) }, [ $data.bottomState != 1 ? (vue.openBlock(), vue.createElementBlock("svg", { key: 0, width: "16", height: "11", onMouseenter: _cache[6] || (_cache[6] = ($event) => $options.mouseEnter(3, _ctx.$el, $event)), onMouseleave: _cache[7] || (_cache[7] = (...args) => $options.mouseleave && $options.mouseleave(...args)), onMousedown: _cache[8] || (_cache[8] = (...args) => $options.createLineOk && $options.createLineOk(...args)), style: { "transform": "rotate(180deg)" } }, _cache[14] || (_cache[14] = [ vue.createElementVNode("polygon", { points: "8,0 1,10 15,10" }, null, -1) ]), 32)) : vue.createCommentVNode("", true) ], 4) ]), vue.createElementVNode("div", { class: "ddei-ext-panel-quickcontrol-right", style: vue.normalizeStyle($data.rightOffset) }, [ $data.rightState != 1 ? (vue.openBlock(), vue.createElementBlock("svg", { key: 0, width: "16", height: "11", onMouseenter: _cache[9] || (_cache[9] = ($event) => $options.mouseEnter(2, _ctx.$el, $event)), onMouseleave: _cache[10] || (_cache[10] = (...args) => $options.mouseleave && $options.mouseleave(...args)), onMousedown: _cache[11] || (_cache[11] = (...args) => $options.createLineOk && $options.createLineOk(...args)), style: { "transform": "rotate(90deg)" } }, _cache[16] || (_cache[16] = [ vue.createElementVNode("polygon", { points: "8,0 1,10 15,10" }, null, -1) ]), 32)) : vue.createCommentVNode("", true) ], 4) ], 512); } const QuickControlPanel = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-dd1c62d6"]]); const _sfc_main$2 = { name: "ddei-ext-dialog-quickcontrol", extends: null, mixins: [DialogBase], props: { options: { type: Object, default: null } }, data() { return { dialogId: "ddei-ext-dialog-quickcontrol" }; }, computed: {}, components: { QuickControlPanel }, watch: {}, created() { }, mounted() { }, methods: {} }; const QuickControlDialog_vue_vue_type_style_index_0_scoped_737aeea8_lang = ""; const _hoisted_1$2 = ["id"]; function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { var _a3; const _component_QuickControlPanel = vue.resolveComponent("QuickControlPanel"); return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-ext-dialog-quickcontrol" }, [ vue.createVNode(_component_QuickControlPanel, vue.mergeProps({ editor: _ctx.editor }, $props.options, { options: $props.options }), null, 16, ["editor", "options"]) ], 8, _hoisted_1$2)) : vue.createCommentVNode("", true); } const QuickControlDialog = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-737aeea8"]]); const _DDeiExtQuickControlDialog = class _DDeiExtQuickControlDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QuickControlDialog.name); __publicField3(this, "plugins", [QuickControlDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[AlignDialog.name]) { for (let i2 in options[AlignDialog.name]) { newOptions[i2] = options[AlignDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiExtQuickControlDialog(newOptions); return panels; } } return _DDeiExtQuickControlDialog; } static modify(fn) { return _DDeiExtQuickControlDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiExtQuickControlDialog, "defaultIns", new _DDeiExtQuickControlDialog(null)); let DDeiExtQuickControlDialog = _DDeiExtQuickControlDialog; const _sfc_main$1 = { name: "ddei-ext-dialog-quickchoosecontrol", extends: null, mixins: [DialogBase], props: { options: { type: Object, default: null }, //定义分组 customGroups: { type: Array, default: null }, //定义控件 customControls: { type: Array, default: null } }, data() { return { dialogId: "ddei-ext-dialog-quickchoosecontrol", //分组数据 groups: [], model: null }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.refreshData(); }, methods: { refreshData() { var _a3, _b2; let groups = this.editor.groups; if (this.customControls) { let controls2 = []; let gps = [{ display: true, controls: controls2 }]; let hasControlids = {}; groups.forEach((group2) => { var _a4; (_a4 = group2 == null ? void 0 : group2.controls) == null ? void 0 : _a4.forEach((control) => { if (!hasControlids[control.id] && this.customControls.indexOf(control.id) != -1) { hasControlids[control.id] = true; controls2.push(control); } }); }); this.groups = gps; } else if (this.customGroups) { let newGroups = []; (_a3 = this.customGroups) == null ? void 0 : _a3.forEach((cg) => { for (let i2 = 0; i2 < groups.length; i2++) { if (groups[i2].id == cg) { newGroups.push(groups[i2]); break; } } }); this.groups = newGroups; } else { let model = this.editor.tempPopData ? (_b2 = this.editor.tempPopData["ddei-ext-dialog-quickchoosecontrol"]) == null ? void 0 : _b2.model : null; if (!model) { DDeiEditorUtil.readRecentlyToolGroups(); let hisGroups = DDeiEditorUtil.recentlyToolGroups; let gps = []; if ((hisGroups == null ? void 0 : hisGroups.length) > 0) { hisGroups.forEach((hg) => { let group2 = null; for (let i2 = 0; i2 < groups.length; i2++) { if (groups[i2].id == hg.id) { group2 = groups[i2]; break; } } if (group2) { group2.expand = hg.expand; gps.push(group2); } }); this.groups = gps; } } else { let newGroups = []; for (let i2 = 0; i2 < groups.length; i2++) { let finded = false; for (let c = 0; c < groups[i2].controls.length; c++) { if (groups[i2].controls[c].id == model.modelCode) { finded = true; break; } } if (finded) { newGroups.push(groups[i2]); break; } } this.model = model; this.groups = newGroups; } } this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; }); }, quickCreateControl(controlId) { if (controlId && this.editor.tempPopData["ddei-ext-dialog-quickchoosecontrol"]) { let model = this.editor.tempPopData["ddei-ext-dialog-quickchoosecontrol"].model; let type = this.editor.tempPopData["ddei-ext-dialog-quickchoosecontrol"].type; if (model) { let outRect = DDeiAbstractShape.getOutRectByPV([model]); let controlInitJSON = DDeiEditorUtil.getModelInitJSON(this.editor.ddInstance, model, [ { model: controlId } ]); if (controlInitJSON) { let controls2 = this.editor.addControls(controlInitJSON, true, false, true); if ((controls2 == null ? void 0 : controls2.length) > 0) { let outRect1 = DDeiAbstractShape.getOutRectByPV(controls2); let x2, y2, sx, sy, ex, ey; let startSita, endSita; let weight = 60; if (type == 1) { x2 = (outRect.x + outRect.x1) / 2; y2 = outRect.y - weight - outRect1.height / 2; sx = x2; sy = outRect.y; ex = x2; ey = y2 + outRect1.height / 2; startSita = -90; endSita = 90; } else if (type == 2) { x2 = outRect.x1 + weight + outRect1.width / 2, y2 = (outRect.y1 + outRect.y) / 2; sx = outRect.x1; sy = y2; ex = x2 - outRect1.width / 2; ey = y2; startSita = 0; endSita = 180; } else if (type == 3) { x2 = (outRect.x + outRect.x1) / 2, y2 = outRect.y1 + weight + outRect1.height / 2; sx = x2; sy = outRect.y1; ex = x2; ey = y2 - outRect1.height / 2; startSita = 90; endSita = -90; } else if (type == 4) { x2 = outRect.x - weight - outRect1.width / 2; y2 = (outRect.y1 + outRect.y) / 2; sx = outRect.x; sy = y2; ex = x2 + outRect1.width / 2; ey = y2; startSita = 180; endSita = 0; } controls2[0].setPosition({ x: x2, y: y2 }); let smodel = { id: model.id, x: sx, y: sy, rate: 0.5, sita: startSita }; let emodel = { id: controls2[0].id, x: ex, y: ey, rate: 0.5, sita: endSita }; let initLine = DDeiEditorUtil.getLineInitJSON(this.editor.ddInstance, smodel, emodel); let lines = null; if (initLine) { let initJson = clone(initLine); initJson.model = initLine.modelCode ? initLine.modelCode : initLine.model ? initLine.model : initLine.id ? initLine.id : "100401"; if (!initJson.type) { initJson.type = 2; } if (!initJson.startPoint) { initJson.startPoint = { x: sx, y: sy }; } if (!initJson.endPoint) { initJson.endPoint = { x: ex, y: ey }; } if (!initJson.smodel) { initJson.smodel = smodel; } if (!initJson.emodel) { initJson.emodel = emodel; } lines = this.editor.addLines([ initJson ], true, true, false); } this.editor.bus.push(DDeiEnumBusCommandType.NodifyControlCreated, { models: controls2, lines }); this.editor.bus.executeAll(); this.editor.ddInstance.stage.makeSelectModels(controls2); this.editor.ddInstance.stage.notifyChange(); } } } } } } }; const QuickChooseControlDialog_vue_vue_type_style_index_0_scoped_5bda071e_lang = ""; const _hoisted_1$1 = ["id"]; const _hoisted_2$1 = { class: "ddei-ext-dialog-quickchoosecontrol-group" }; const _hoisted_3$1 = { key: 0, class: "ddei-ext-dialog-quickchoosecontrol-group-itempanel" }; const _hoisted_4$1 = ["title", "onClick"]; const _hoisted_5$1 = ["src"]; const _hoisted_6$1 = ["innerHTML"]; const _hoisted_7$1 = { class: "text" }; function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { var _a3; return _ctx.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = _ctx.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-ext-dialog-quickchoosecontrol" }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.groups, (group2) => { return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [ $props.customControls || $props.customGroups || group2.expand == true || $data.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(group2.controls, (control) => { var _a4; return vue.openBlock(), vue.createElementBlock("div", { class: "ddei-ext-dialog-quickchoosecontrol-group-itempanel-item", title: control.desc, onClick: ($event) => $options.quickCreateControl(control.id) }, [ !control.icon ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, class: "icon", src: (_a4 = _ctx.editor) == null ? void 0 : _a4.icons[control.id] }, null, 8, _hoisted_5$1)) : vue.createCommentVNode("", true), control.icon ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "icon-html", innerHTML: control.icon }, null, 8, _hoisted_6$1)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_7$1, vue.toDisplayString(_ctx.editor.i18n(control.name)), 1) ], 8, _hoisted_4$1); }), 256)) ])) : vue.createCommentVNode("", true) ], 512)), [ [vue.vShow, group2.display == true] ]); }), 256)) ], 8, _hoisted_1$1)) : vue.createCommentVNode("", true); } const QuickChooseControlDialog = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-5bda071e"]]); const _DDeiExtQuickChooseControlDialog = class _DDeiExtQuickChooseControlDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QuickChooseControlDialog.name); __publicField3(this, "plugins", [QuickChooseControlDialog]); } getDialogs(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[QuickChooseControlDialog.name]) { for (let i2 in options[QuickChooseControlDialog.name]) { newOptions[i2] = options[QuickChooseControlDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiExtQuickChooseControlDialog(newOptions); return panels; } } return _DDeiExtQuickChooseControlDialog; } static modify(fn) { return _DDeiExtQuickChooseControlDialog.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiExtQuickChooseControlDialog, "defaultIns", new _DDeiExtQuickChooseControlDialog(null)); let DDeiExtQuickChooseControlDialog = _DDeiExtQuickChooseControlDialog; const _DDeiExtQuickControlDialogs = class _DDeiExtQuickControlDialogs extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [ DDeiExtQuickControlDialog, DDeiExtQuickChooseControlDialog ]); } getDialogs(editor) { var _a3; let panels = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getDialogs(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getDialogs(editor); } if ((ls == null ? void 0 : ls.length) > 0) { panels = panels.concat(ls); } }); return panels; } static configuration(options) { var _a3; if (options) { let panels = new _DDeiExtQuickControlDialogs(options); for (let i2 = 0; i2 < ((_a3 = panels.plugins) == null ? void 0 : _a3.length); i2++) { panels.plugins[i2] = panels.plugins[i2].configuration(options, true); } return panels; } return _DDeiExtQuickControlDialogs; } static modify(fn) { return _DDeiExtQuickControlDialogs.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiExtQuickControlDialogs, "defaultIns", new _DDeiExtQuickControlDialogs(null)); let DDeiExtQuickControlDialogs = _DDeiExtQuickControlDialogs; const _DDeiExtQuickControlPanel = class _DDeiExtQuickControlPanel extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", QuickControlPanel.name); __publicField3(this, "plugins", [QuickControlPanel]); } getPanels(editor) { return this.plugins; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[ChangeRatio.name]) { for (let i2 in options[ChangeRatio.name]) { newOptions[i2] = options[ChangeRatio.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiExtQuickControlPanel(newOptions); return panels; } } return _DDeiExtQuickControlPanel; } static modify(fn) { return _DDeiExtQuickControlPanel.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiExtQuickControlPanel, "defaultIns", new _DDeiExtQuickControlPanel(null)); let DDeiExtQuickControlPanel = _DDeiExtQuickControlPanel; const _DDeiKeyActionQuickControlEsc = class _DDeiKeyActionQuickControlEsc extends DDeiKeyAction { constructor() { super(...arguments); __publicField3(this, "name", "ddei-ext-keyaction-quickcontrol-esc"); __publicField3(this, "defaultOptions", { "keys": [ { keys: "27" } ] }); } getHotKeys(editor) { return [this]; } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiKeyActionQuickControlEsc.defaultIns.name]) { for (let i2 in options[_DDeiKeyActionQuickControlEsc.defaultIns.name]) { newOptions[i2] = options[_DDeiKeyActionQuickControlEsc.defaultIns.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiKeyActionQuickControlEsc(newOptions); return panels; } } return _DDeiKeyActionQuickControlEsc; } static modify(fn) { return _DDeiKeyActionQuickControlEsc.defaultIns.modify(fn); } // ============================ 方法 =============================== action(evt, ddInstance, editor) { } }; /** * 缺省实例 */ __publicField3(_DDeiKeyActionQuickControlEsc, "defaultIns", new _DDeiKeyActionQuickControlEsc()); let DDeiKeyActionQuickControlEsc = _DDeiKeyActionQuickControlEsc; const _DDeiExtQuickControlHotkeys = class _DDeiExtQuickControlHotkeys extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "plugins", [DDeiKeyActionQuickControlEsc]); } getHotKeys(editor) { var _a3; let hotkeys = []; (_a3 = this.plugins) == null ? void 0 : _a3.forEach((plugin) => { let ls; if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { ls = plugin.defaultIns.getHotKeys(editor); } else if (plugin instanceof DDeiPluginBase) { ls = plugin.getHotKeys(editor); } if ((ls == null ? void 0 : ls.length) > 0) { hotkeys = hotkeys.concat(ls); } }); return hotkeys; } static configuration(options) { var _a3; let hotkeys = new _DDeiExtQuickControlHotkeys(options); for (let i2 = 0; i2 < ((_a3 = hotkeys.plugins) == null ? void 0 : _a3.length); i2++) { hotkeys.plugins[i2] = hotkeys.plugins[i2].configuration(options, true); } return hotkeys; } static modify(fn) { return _DDeiExtQuickControlHotkeys.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiExtQuickControlHotkeys, "defaultIns", new _DDeiExtQuickControlHotkeys(null)); let DDeiExtQuickControlHotkeys = _DDeiExtQuickControlHotkeys; const _DDeiExtSearchLifeCycle = class _DDeiExtSearchLifeCycle extends DDeiLifeCycle { constructor() { super(...arguments); __publicField3(this, "name", "quickcontrol-ext-lifecycle"); // static{ // DDeiExtSearchLifeCycle.changeQuickControlDialogPos = debounce(DDeiExtSearchLifeCycle.changeQuickControlDialogPos,200) // } __publicField3(this, "EVENT_MOUSE_MOVE_IN_CONTROL", new DDeiFuncData("quickcontrol-ext-show", 1, this.moveInControl)); __publicField3(this, "EVENT_CONTROL_DRAG_AFTER", new DDeiFuncData("quickcontrol-ext-changepos", 1, this.changeQuickControlDialogPos)); __publicField3(this, "EVENT_MOUSE_MOVE_IN_LAYER", new DDeiFuncData("quickcontrol-ext-close", 1, this.closeQuickControlDialog)); __publicField3(this, "EVENT_CONTROL_SELECT_AFTER", new DDeiFuncData("quickcontrol-ext-show", 1, this.closeAndShowQuickControlDialog)); __publicField3(this, "EVENT_MOUSE_OPERATING", new DDeiFuncData("quickstyle-ext-close", 1, this.mouseOperating)); __publicField3(this, "EVENT_CLOSE_FILE_AFTER", new DDeiFuncData("quickcontrol-ext-close", 1, this.closeDialogs)); } moveInControl(operateType, data, ddInstance, evt) { var _a3, _b2, _c2; if (ddInstance && ddInstance["AC_DESIGN_EDIT"] && ((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.state == "designing") { let model = data.models[0]; if (((_b2 = editor.ddInstance.stage.selectedModels) == null ? void 0 : _b2.size) > 0) { if (!editor.ddInstance.stage.selectedModels.has(model.id)) { if (((_c2 = editor.ddInstance.stage.selectedModels) == null ? void 0 : _c2.size) == 1) { model = Array.from(editor.ddInstance.stage.selectedModels.values())[0]; } else { return; } } } data.model = model; _DDeiExtSearchLifeCycle.showQuickControlDialog(operateType, data, ddInstance, evt); } } } changeQuickControlDialogPos(operateType, data, ddInstance, evt) { var _a3, _b2, _c2; if (ddInstance && ddInstance["AC_DESIGN_EDIT"] && ((_a3 = data == null ? void 0 : data.models) == null ? void 0 : _a3.length) > 0) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.state == "designing") { let model = data.models[0]; if (((_b2 = editor.ddInstance.stage.selectedModels) == null ? void 0 : _b2.size) > 0) { if (!editor.ddInstance.stage.selectedModels.has(model.id)) { if (((_c2 = editor.ddInstance.stage.selectedModels) == null ? void 0 : _c2.size) == 1) { model = Array.from(editor.ddInstance.stage.selectedModels.values())[0]; } else { return; } } } data.model = model; _DDeiExtSearchLifeCycle.changeQuickControlDialogPos(operateType, data, ddInstance, evt); } } } /** * 正在进行鼠标操作 */ mouseOperating(operateType, data, ddInstance, evt) { if (ddInstance && ddInstance["AC_DESIGN_EDIT"]) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.state == "designing") { let oldState = editor.state; DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickcontrol", true); DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickchoosecontrol", true); editor.changeState(oldState); } } } /** * 鼠标进入控件 */ closeAndShowQuickControlDialog(operateType, data, ddInstance, evt) { var _a3; if (ddInstance && ddInstance["AC_DESIGN_EDIT"]) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.state == "designing") { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickcontrol", true); DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickchoosecontrol", true); if (((_a3 = data.models) == null ? void 0 : _a3.length) > 0) { data.model = data.models[0]; _DDeiExtSearchLifeCycle.showQuickControlDialog(operateType, data, ddInstance, evt); } } } } /** * 鼠标进入控件 */ static showQuickControlDialog(operateType, data, ddInstance, evt) { var _a3, _b2; if (ddInstance && ddInstance["AC_DESIGN_EDIT"] && (data == null ? void 0 : data.model)) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (!((_a3 = data.model) == null ? void 0 : _a3.rotate) && ((_b2 = data.model) == null ? void 0 : _b2.baseModelType) != "DDeiLine" && (!editor.tempPopData || !editor.tempPopData["ddei-ext-dialog-quickcontrol"] || editor.tempPopData["ddei-ext-dialog-quickcontrol"].model != data.model)) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickcontrol", true); DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickchoosecontrol", true); let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let modelPos = DDeiUtil.getModelsDomAbsPosition([data.model]); let width = 50; let height = 50; let left = modelPos.left - editorDomPos.left - width / 2; let top = modelPos.top - editorDomPos.top - height / 2; let offset = null; if (data.model.state == DDeiEnumControlState.SELECTED) { height = 70; top -= 20; offset = { "left": "margin-top:20px", "right": "margin-top:20px" }; } DDeiEditorUtil.showDialog(editor, "ddei-ext-dialog-quickcontrol", { group: "canvas-pop-quickcontrol", model: data.model, width, height, offset }, { type: 99, left, top, ignoreOutSide: 1, hiddenMask: true }, null, true, true); } } } /** * 修改坐标 */ static changeQuickControlDialogPos(operateType, data, ddInstance, evt) { if (ddInstance && ddInstance["AC_DESIGN_EDIT"] && (data == null ? void 0 : data.model)) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let modelPos = DDeiUtil.getModelsDomAbsPosition([data.model]); let width = 50; let height = 50; let left = modelPos.left - editorDomPos.left - width / 2; let top = modelPos.top - editorDomPos.top - height / 2; let offset = null; if (data.model.state == DDeiEnumControlState.SELECTED) { height = 70; top -= 20; offset = { "left": "margin-top:20px", "right": "margin-top:20px" }; } DDeiEditorUtil.displayDialog(editor, "ddei-ext-dialog-quickcontrol", { group: "canvas-pop-quickcontrol", model: data.model, width, height, offset }, { type: 99, left, top, ignoreOutSide: 1, hiddenMask: true }, null, true, true); } } /** * 鼠标进入画布 */ closeQuickControlDialog(operateType, data, ddInstance, evt) { var _a3, _b2, _c2, _d2; if (ddInstance && ddInstance["AC_DESIGN_EDIT"]) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.tempPopData && ((_a3 = editor.tempPopData["ddei-ext-dialog-quickcontrol"]) == null ? void 0 : _a3.model)) { let model = (_b2 = editor.tempPopData["ddei-ext-dialog-quickcontrol"]) == null ? void 0 : _b2.model; let type = (_c2 = editor.tempPopData["ddei-ext-dialog-quickchoosecontrol"]) == null ? void 0 : _c2.type; let modelPos = DDeiUtil.getModelsDomAbsPosition([model]); let width = 25; let height = 25; if (model.state == DDeiEnumControlState.SELECTED) { height = 35; } modelPos.x -= width; modelPos.x1 += width; modelPos.y -= height; modelPos.y1 += height; if (type == 1) { modelPos.y -= 15; } else if (type == 2) { modelPos.x1 += 10; } else if (type == 3) { modelPos.y1 += 10; } else if (type == 4) { modelPos.x -= 10; } if (!(modelPos.x <= data.ex && modelPos.x1 >= data.ex && modelPos.y <= data.ey && modelPos.y1 >= data.ey)) { let selectedModels = ddInstance.stage.selectedModels; if ((selectedModels == null ? void 0 : selectedModels.size) == 1 && Array.from(selectedModels.values())[0] == ((_d2 = editor.tempPopData["ddei-ext-dialog-quickcontrol"]) == null ? void 0 : _d2.model)) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickchoosecontrol", true); } else { let quickChooseControlDialog = document.getElementById(editor.id + "_ddei-ext-dialog-quickchoosecontrol"); if (quickChooseControlDialog) { let quickChooseControlDialogPos = DDeiUtil.getDomAbsPosition(quickChooseControlDialog); let dx1 = quickChooseControlDialogPos.left + (quickChooseControlDialog == null ? void 0 : quickChooseControlDialog.clientWidth); let dy1 = quickChooseControlDialogPos.top + (quickChooseControlDialog == null ? void 0 : quickChooseControlDialog.clientHeight); let dx = quickChooseControlDialogPos.left; let dy = quickChooseControlDialogPos.top; if (!(dx <= evt.clientX && dx1 >= evt.clientX && dy <= evt.clientY && dy1 > evt.clientY)) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickcontrol", true); DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickchoosecontrol", true); } } else { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickcontrol", true); } } } } } } /** * 鼠标进入画布 */ closeDialogs(operateType, data, ddInstance, evt) { var _a3; if (ddInstance && ddInstance["AC_DESIGN_EDIT"]) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.tempPopData && ((_a3 = editor.tempPopData["ddei-ext-dialog-quickcontrol"]) == null ? void 0 : _a3.model)) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickcontrol", true); DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-quickchoosecontrol", true); } } } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiExtSearchLifeCycle.name]) { for (let i2 in options[_DDeiExtSearchLifeCycle.name]) { newOptions[i2] = options[_DDeiExtSearchLifeCycle.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiExtSearchLifeCycle(); if (newOptions.name) { panels.name = newOptions.name; } if (newOptions.sort) { panels.sort = newOptions.sort; } return panels; } } return _DDeiExtSearchLifeCycle; } static modify(fn) { return _DDeiExtSearchLifeCycle.defaultIns.modify(fn); } }; /** * 缺省实例 */ __publicField3(_DDeiExtSearchLifeCycle, "defaultIns", new _DDeiExtSearchLifeCycle(null)); let DDeiExtSearchLifeCycle = _DDeiExtSearchLifeCycle; const _DDeiExtQuickControl = class _DDeiExtQuickControl extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "order", 2); __publicField3(this, "dialogs", DDeiExtQuickControlDialogs); __publicField3(this, "panels", DDeiExtQuickControlPanel); __publicField3(this, "hotkeys", DDeiExtQuickControlHotkeys); __publicField3(this, "lifecyclies", DDeiExtSearchLifeCycle); } getDialogs(editor) { if (DDeiPluginBase.isSubclass(this.dialogs, DDeiPluginBase)) { return this.dialogs.defaultIns.getDialogs(editor); } else if (this.dialogs instanceof DDeiPluginBase) { return this.dialogs.getDialogs(editor); } } getPanels(editor) { if (DDeiPluginBase.isSubclass(this.panels, DDeiPluginBase)) { return this.panels.defaultIns.getPanels(editor); } else if (this.panels instanceof DDeiPluginBase) { return this.panels.getPanels(editor); } } getHotKeys(editor) { if (DDeiPluginBase.isSubclass(this.hotkeys, DDeiPluginBase)) { return this.hotkeys.defaultIns.getHotKeys(editor); } else if (this.hotkeys instanceof DDeiPluginBase) { return this.hotkeys.getHotKeys(editor); } } getLifeCyclies(editor) { if (DDeiPluginBase.isSubclass(this.lifecyclies, DDeiPluginBase)) { return this.lifecyclies.defaultIns.getLifeCyclies(editor); } else if (this.lifecyclies instanceof DDeiPluginBase) { return this.lifecyclies.getLifeCyclies(editor); } } static configuration(options) { let core = new _DDeiExtQuickControl(options); core.dialogs = core.dialogs.configuration(options, true); core.panels = core.panels.configuration(options, true); core.hotkeys = core.hotkeys.configuration(options, true); core.lifecyclies = core.lifecyclies.configuration(options, true); return core; } static modify(fn) { return _DDeiExtQuickControl.defaultIns.modify(fn); } }; __publicField3(_DDeiExtQuickControl, "order", 2); /** * 缺省实例 */ __publicField3(_DDeiExtQuickControl, "defaultIns", new _DDeiExtQuickControl(null)); let DDeiExtQuickControl = _DDeiExtQuickControl; const _DDeiExtSearch = class _DDeiExtSearch extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "order", 2); __publicField3(this, "dialogs", DDeiExtSearchDialog); __publicField3(this, "panels", DDeiExtSearchPanel); __publicField3(this, "hotkeys", DDeiExtSearchHotkeys); __publicField3(this, "lifecyclies", DDeiExtSearchLifeCycle$1); } getDialogs(editor) { if (DDeiPluginBase.isSubclass(this.dialogs, DDeiPluginBase)) { return this.dialogs.defaultIns.getDialogs(editor); } else if (this.dialogs instanceof DDeiPluginBase) { return this.dialogs.getDialogs(editor); } } getPanels(editor) { if (DDeiPluginBase.isSubclass(this.panels, DDeiPluginBase)) { return this.panels.defaultIns.getPanels(editor); } else if (this.panels instanceof DDeiPluginBase) { return this.panels.getPanels(editor); } } getHotKeys(editor) { if (DDeiPluginBase.isSubclass(this.hotkeys, DDeiPluginBase)) { return this.hotkeys.defaultIns.getHotKeys(editor); } else if (this.hotkeys instanceof DDeiPluginBase) { return this.hotkeys.getHotKeys(editor); } } getLifeCyclies(editor) { if (DDeiPluginBase.isSubclass(this.lifecyclies, DDeiPluginBase)) { return this.lifecyclies.defaultIns.getLifeCyclies(editor); } else if (this.lifecyclies instanceof DDeiPluginBase) { return this.lifecyclies.getLifeCyclies(editor); } } static modify(fn) { return _DDeiExtSearch.defaultIns.modify(fn); } static configuration(options) { let core = new _DDeiExtSearch(options); core.dialogs = core.dialogs.configuration(options, true); core.panels = core.panels.configuration(options, true); core.hotkeys = core.hotkeys.configuration(options, true); core.lifecyclies = core.lifecyclies.configuration(options, true); return core; } }; __publicField3(_DDeiExtSearch, "order", 2); /** * 缺省实例 */ __publicField3(_DDeiExtSearch, "defaultIns", new _DDeiExtSearch(null)); let DDeiExtSearch = _DDeiExtSearch; const _sfc_main = { name: "ddei-ext-dialog-tooltip", extends: null, props: { //外部传入的插件扩展参数 options: { type: Object, default: null }, editor: { type: DDeiEditor, default: null } }, data() { return { dialogId: "ddei-ext-dialog-tooltip", //当前控件 model: null, forceRefresh: false }; }, computed: {}, components: {}, watch: {}, created() { }, mounted() { this.editor.dialogs[this.dialogId].viewer = this; this.refreshData(); }, methods: { forceRefreshView: function() { this.forceRefresh = false; this.$nextTick(() => { this.forceRefresh = true; if (this.refreshData) { this.refreshData(); } }); }, refreshData() { if (this.editor.tempPopData && this.editor.tempPopData["ddei-ext-dialog-tooltip"]) { this.model = this.editor.tempPopData["ddei-ext-dialog-tooltip"].model; } } } }; const TooltipDialog_vue_vue_type_style_index_0_scoped_d9902947_lang = ""; const _hoisted_1 = ["id"]; const _hoisted_2 = { key: 1 }; const _hoisted_3 = { class: "ddei-ext-dialog-tooltip-row" }; const _hoisted_4 = { key: 0, class: "ddei-ext-dialog-tooltip-row-title" }; const _hoisted_5 = { key: 1, class: "ddei-ext-dialog-tooltip-row-data" }; const _hoisted_6 = { key: 0, class: "ddei-ext-dialog-tooltip-row" }; const _hoisted_7 = { class: "ddei-ext-dialog-tooltip-row-data" }; const _hoisted_8 = { key: 1, class: "ddei-ext-dialog-tooltip-row" }; const _hoisted_9 = { class: "ddei-ext-dialog-tooltip-row-data" }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { var _a3, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; return $data.forceRefresh ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, id: ((_a3 = $props.editor) == null ? void 0 : _a3.id) + "_" + $data.dialogId, class: "ddei-ext-dialog-tooltip fade-in" }, [ ((_b2 = $props.options) == null ? void 0 : _b2.viewer) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.options.viewer), { key: 0, editor: $props.editor, options: $props.options, model: $data.model }, null, 8, ["editor", "options", "model"])) : vue.createCommentVNode("", true), !((_c2 = $props.options) == null ? void 0 : _c2.viewer) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [ vue.createElementVNode("div", _hoisted_3, [ ((_d2 = $data.model) == null ? void 0 : _d2.id) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, " ID ")) : vue.createCommentVNode("", true), ((_e2 = $data.model) == null ? void 0 : _e2.id) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, vue.toDisplayString((_f = $data.model) == null ? void 0 : _f.id), 1)) : vue.createCommentVNode("", true) ]), ((_g = $data.model) == null ? void 0 : _g.code) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [ _cache[0] || (_cache[0] = vue.createElementVNode("div", { class: "ddei-ext-dialog-tooltip-row-title" }, " CODE ", -1)), vue.createElementVNode("div", _hoisted_7, vue.toDisplayString((_h = $data.model) == null ? void 0 : _h.code), 1) ])) : vue.createCommentVNode("", true), ((_i = $data.model) == null ? void 0 : _i.text) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [ _cache[1] || (_cache[1] = vue.createElementVNode("div", { class: "ddei-ext-dialog-tooltip-row-title" }, " 文本 ", -1)), vue.createElementVNode("div", _hoisted_9, vue.toDisplayString((_j = $data.model) == null ? void 0 : _j.text), 1) ])) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true) ], 8, _hoisted_1)) : vue.createCommentVNode("", true); } const TooltipDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-d9902947"]]); const _DDeiCoreTooltipDialog = class _DDeiCoreTooltipDialog extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "name", TooltipDialog.name); __publicField3(this, "plugins", [TooltipDialog]); } getDialogs(editor) { return this.plugins; } static modify(fn) { return _DDeiCoreTooltipDialog.defaultIns.modify(fn); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[TooltipDialog.name]) { for (let i2 in options[TooltipDialog.name]) { newOptions[i2] = options[TooltipDialog.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiCoreTooltipDialog(newOptions); return panels; } } return _DDeiCoreTooltipDialog; } }; /** * 缺省实例 */ __publicField3(_DDeiCoreTooltipDialog, "defaultIns", new _DDeiCoreTooltipDialog(null)); let DDeiCoreTooltipDialog = _DDeiCoreTooltipDialog; const _DDeiExtTooltipLifeCycle = class _DDeiExtTooltipLifeCycle extends DDeiLifeCycle { constructor() { super(...arguments); __publicField3(this, "name", "ddei-ext-tooltip-lifecycle"); __publicField3(this, "EVENT_MOUSE_MOVE_IN_CONTROL", new DDeiFuncData("tooltip-show", 1, (operateType, data, ddInstance, evt) => { this.showTooltip(operateType, data, ddInstance, evt); })); __publicField3(this, "EVENT_MOUSE_MOVE_IN_LAYER", new DDeiFuncData("tooltip-hidden", 1, this.mouseOperating)); __publicField3(this, "EVENT_CLOSE_FILE_AFTER", new DDeiFuncData("tooltip-close", 1, this.mouseOperating)); } static modify(fn) { return _DDeiExtTooltipLifeCycle.defaultIns.modify(fn); } static configuration(options, fullConfig = false) { if (options) { let newOptions = {}; if (fullConfig) { if (fullConfig) { if (options[_DDeiExtTooltipLifeCycle.name]) { for (let i2 in options[_DDeiExtTooltipLifeCycle.name]) { newOptions[i2] = options[_DDeiExtTooltipLifeCycle.name][i2]; } } } } else { newOptions = options; } if (newOptions && Object.keys(newOptions).length !== 0) { let panels = new _DDeiExtTooltipLifeCycle(newOptions); return panels; } } return _DDeiExtTooltipLifeCycle; } showTooltip(operateType, data, ddInstance, evt) { var _a3, _b2, _c2; let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); let stage2 = (_a3 = editor.ddInstance) == null ? void 0 : _a3.stage; if (((_b2 = stage2 == null ? void 0 : stage2.render) == null ? void 0 : _b2.operateState) == 0 && ((_c2 = data.models) == null ? void 0 : _c2.length) > 0 && data.models[0]) { if (editor.tempHoverModel != data.models[0]) { if (!editor.tempHoverX || !editor.tempHoverY || Math.abs(editor.tempHoverX - data.x) > 10 || Math.abs(editor.tempHoverY - data.y) > 10) { if (editor.tempPopData && editor.tempPopData["ddei-ext-dialog-tooltip"]) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-tooltip", true); } editor.tempHoverModel = data.models[0]; editor.tempHoverX = data.x; editor.tempHoverY = data.y; editor.tempHoverTime = (/* @__PURE__ */ new Date()).getTime(); } } else { if ((/* @__PURE__ */ new Date()).getTime() - editor.tempHoverTime >= this.options.time) { data.model = editor.tempHoverModel; this.showTooltipDialog(operateType, data, ddInstance, evt); } } } else { if (editor.tempPopData && editor.tempPopData["ddei-ext-dialog-tooltip"]) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-tooltip", true); } delete editor.tempHoverModel; delete editor.tempHoverTime; delete editor.tempHoverX; delete editor.tempHoverY; } } /** * 鼠标进入控件 */ showTooltipDialog(operateType, data, ddInstance, evt, options) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (!editor.tempPopData || !editor.tempPopData["ddei-ext-dialog-tooltip"] || editor.tempPopData["ddei-ext-dialog-tooltip"].model != data.model) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-tooltip", true); let editorEle = document.getElementById(editor.id); let editorDomPos = DDeiUtil.getDomAbsPosition(editorEle); let modelPos = DDeiUtil.getModelsDomAbsPosition([data.model]); let left = modelPos.left - editorDomPos.left + modelPos.width + 20; let top = modelPos.top - editorDomPos.top - 20; DDeiEditorUtil.showDialog(editor, "ddei-ext-dialog-tooltip", { group: "canvas-pop-tooltip", model: data.model }, { type: 99, left, top, hiddenMask: true }, null, true, true); } } mouseOperating(operateType, data, ddInstance, evt) { let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor.tempPopData && editor.tempPopData["ddei-ext-dialog-tooltip"]) { DDeiEditorUtil.closeDialog(editor, "ddei-ext-dialog-tooltip", true); } delete editor.tempHoverModel; delete editor.tempHoverTime; delete editor.tempHoverX; delete editor.tempHoverY; } }; /** * 缺省实例 */ __publicField3(_DDeiExtTooltipLifeCycle, "defaultIns", new _DDeiExtTooltipLifeCycle({ time: 400 })); let DDeiExtTooltipLifeCycle = _DDeiExtTooltipLifeCycle; const _DDeiExtTooltip = class _DDeiExtTooltip extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "order", 2); __publicField3(this, "dialogs", DDeiCoreTooltipDialog); __publicField3(this, "lifecyclies", DDeiExtTooltipLifeCycle); } getOptions() { return this.options; } getDialogs(editor) { if (DDeiPluginBase.isSubclass(this.dialogs, DDeiPluginBase)) { return this.dialogs.defaultIns.getDialogs(editor); } else if (this.dialogs instanceof DDeiPluginBase) { return this.dialogs.getDialogs(editor); } } getLifeCyclies(editor) { if (DDeiPluginBase.isSubclass(this.lifecyclies, DDeiPluginBase)) { return this.lifecyclies.defaultIns.getLifeCyclies(editor); } else if (this.lifecyclies instanceof DDeiPluginBase) { return this.lifecyclies.getLifeCyclies(editor); } } static modify(fn) { return _DDeiExtTooltip.defaultIns.modify(fn); } static configuration(options) { let core = new _DDeiExtTooltip(options); core.dialogs = core.dialogs.configuration(options, true); core.lifecyclies = core.lifecyclies.configuration(options, true); return core; } }; __publicField3(_DDeiExtTooltip, "order", 2); /** * 缺省实例 */ __publicField3(_DDeiExtTooltip, "defaultIns", new _DDeiExtTooltip(null)); let DDeiExtTooltip = _DDeiExtTooltip; const _DDeiExtHtmlViewerLifeCycle = class _DDeiExtHtmlViewerLifeCycle extends DDeiLifeCycle { constructor() { super(...arguments); __publicField3(this, "name", "ddei-ext-htmlviewer-lifecycle"); __publicField3(this, "EVENT_CONTROL_VIEW", new DDeiFuncData("htmlviewer-drawshape", 1, (operateType, data, ddInstance, evt) => { return this.htmlDrawShape(operateType, data, ddInstance, evt); })); } installed(editor) { for (let i2 in this.options) { if (i2 != "matchField") { if (this.options[i2]["viewer"]) { this.options[i2]["viewer"] = vue.markRaw(this.options[i2]["viewer"]); } } } } static configuration(options) { if (options && Object.keys(options).length !== 0) { let lcs = new _DDeiExtHtmlViewerLifeCycle(options); return lcs; } return _DDeiExtHtmlViewerLifeCycle; } static modify(fn) { return _DDeiExtHtmlViewerLifeCycle.defaultIns.modify(fn); } htmlDrawShape(operate, data, ddInstance, evt) { let models = data == null ? void 0 : data.models; let editor = DDeiEditorUtil.getEditorInsByDDei(ddInstance); if (editor) { let field = this.options.matchField; for (let i2 = 0; i2 < (models == null ? void 0 : models.length); i2++) { let model = models[i2]; if (model && model[field]) { let option = this.options[model[field]]; if (option && option.viewer) { if (model.render.tempCanvas) { model.render.tempCanvas.remove(); } if (model.render.viewerOption != option && vue.toRaw(model.render.viewerOption) != option) { DDeiUtil.removeRenderViewer(model); model.render.viewerOption = option; model.render.viewer = option.viewer; } } } } } } }; /** * 缺省实例 */ __publicField3(_DDeiExtHtmlViewerLifeCycle, "defaultIns", new _DDeiExtHtmlViewerLifeCycle({ matchField: "code" })); let DDeiExtHtmlViewerLifeCycle = _DDeiExtHtmlViewerLifeCycle; const _DDeiExtHtmlViewer = class _DDeiExtHtmlViewer extends DDeiPluginBase { constructor() { super(...arguments); __publicField3(this, "type", "package"); __publicField3(this, "order", 1); __publicField3(this, "lifecyclies", DDeiExtHtmlViewerLifeCycle); } getLifeCyclies(editor) { if (DDeiPluginBase.isSubclass(this.lifecyclies, DDeiPluginBase)) { return this.lifecyclies.defaultIns.getLifeCyclies(editor); } else if (this.lifecyclies instanceof DDeiPluginBase) { return this.lifecyclies.getLifeCyclies(editor); } } installed(editor) { if (DDeiPluginBase.isSubclass(this.lifecyclies, DDeiPluginBase)) { return this.lifecyclies.defaultIns.installed(editor); } else if (this.lifecyclies instanceof DDeiPluginBase) { return this.lifecyclies.installed(editor); } } static configuration(options) { let core = new _DDeiExtHtmlViewer(options); core.lifecyclies = core.lifecyclies.configuration(options); return core; } static modify(fn) { return _DDeiExtHtmlViewer.defaultIns.modify(fn); } }; __publicField3(_DDeiExtHtmlViewer, "order", 1); /** * 缺省实例 */ __publicField3(_DDeiExtHtmlViewer, "defaultIns", new _DDeiExtHtmlViewer(null)); let DDeiExtHtmlViewer = _DDeiExtHtmlViewer; exports.COMMANDS = COMMANDS; exports.DDei = DDei; exports.DDeiAbstractArrtibuteParser = DDeiAbstractArrtibuteParser; exports.DDeiAbstractShape = DDeiAbstractShape; exports.DDeiAbstractShapeRender = DDeiAbstractShapeRender; exports.DDeiActiveType = DDeiActiveType; exports.DDeiArrtibuteDefine = DDeiArrtibuteDefine; exports.DDeiArrtibuteParserBool = DDeiArrtibuteParserBool; exports.DDeiArrtibuteParserNumber = DDeiArrtibuteParserNumber; exports.DDeiArrtibuteParserString = DDeiArrtibuteParserString; exports.DDeiBus = DDeiBus; exports.DDeiBusCommand = DDeiBusCommand; exports.DDeiBusCommandAddHistroy = DDeiBusCommandAddHistroy; exports.DDeiBusCommandCancelCurLevelSelectedModels = DDeiBusCommandCancelCurLevelSelectedModels; exports.DDeiBusCommandCenterStageWPV = DDeiBusCommandCenterStageWPV; exports.DDeiBusCommandChangeCursor = DDeiBusCommandChangeCursor; exports.DDeiBusCommandChangeLayout = DDeiBusCommandChangeLayout; exports.DDeiBusCommandChangeLinePoint = DDeiBusCommandChangeLinePoint; exports.DDeiBusCommandChangeSelectorPassIndex = DDeiBusCommandChangeSelectorPassIndex; exports.DDeiBusCommandChangeStageRatio = DDeiBusCommandChangeStageRatio; exports.DDeiBusCommandChangeStageWPV = DDeiBusCommandChangeStageWPV; exports.DDeiBusCommandClearTemplateVars = DDeiBusCommandClearTemplateVars; exports.DDeiBusCommandModelAlign = DDeiBusCommandModelAlign; exports.DDeiBusCommandModelAutoPos = DDeiBusCommandModelAutoPos; exports.DDeiBusCommandModelCancelMerge = DDeiBusCommandModelCancelMerge; exports.DDeiBusCommandModelChangeBounds = DDeiBusCommandModelChangeBounds; exports.DDeiBusCommandModelChangeContainer = DDeiBusCommandModelChangeContainer; exports.DDeiBusCommandModelChangePosition = DDeiBusCommandModelChangePosition; exports.DDeiBusCommandModelChangeRotate = DDeiBusCommandModelChangeRotate; exports.DDeiBusCommandModelChangeSelect = DDeiBusCommandModelChangeSelect; exports.DDeiBusCommandModelChangeValue = DDeiBusCommandModelChangeValue; exports.DDeiBusCommandModelCopyStyle = DDeiBusCommandModelCopyStyle; exports.DDeiBusCommandModelEdgePosition = DDeiBusCommandModelEdgePosition; exports.DDeiBusCommandModelMerge = DDeiBusCommandModelMerge; exports.DDeiBusCommandModelPush = DDeiBusCommandModelPush; exports.DDeiBusCommandModelRemove = DDeiBusCommandModelRemove; exports.DDeiBusCommandNodifyControlCreated = DDeiBusCommandNodifyControlCreated; exports.DDeiBusCommandOVSChangePosition = DDeiBusCommandOVSChangePosition; exports.DDeiBusCommandRefreshShape = DDeiBusCommandRefreshShape; exports.DDeiBusCommandResetSelectorState = DDeiBusCommandResetSelectorState; exports.DDeiBusCommandSetHelpLine = DDeiBusCommandSetHelpLine; exports.DDeiBusCommandStageChangeSelectModels = DDeiBusCommandStageChangeSelectModels; exports.DDeiBusCommandTextEditorChangeSelectPos = DDeiBusCommandTextEditorChangeSelectPos; exports.DDeiBusCommandUpdateDragObj = DDeiBusCommandUpdateDragObj; exports.DDeiBusCommandUpdatePaperArea = DDeiBusCommandUpdatePaperArea; exports.DDeiBusCommandUpdateSelectorBounds = DDeiBusCommandUpdateSelectorBounds; exports.DDeiCircle = DDeiCircle; exports.DDeiCircleCanvasRender = DDeiCircleCanvasRender; exports.DDeiColor = DDeiColor; exports.DDeiCommandChangeEditMode = DDeiCommandChangeEditMode; exports.DDeiCommandChangeNodifyChange = DDeiCommandChangeNodifyChange; exports.DDeiConfig = DDeiConfig; exports.DDeiConverterBase = DDeiConverterBase; exports.DDeiCore = DDeiCore; exports.DDeiCoreAddFontSizeButton = DDeiCoreAddFontSizeButton; exports.DDeiCoreAlignDialog = DDeiCoreAlignDialog; exports.DDeiCoreAlignTypePropEditor = DDeiCoreAlignTypePropEditor; exports.DDeiCoreBorderDashButton = DDeiCoreBorderDashButton; exports.DDeiCoreBorderDashComboPropEditor = DDeiCoreBorderDashComboPropEditor; exports.DDeiCoreBorderTypePropEditor = DDeiCoreBorderTypePropEditor; exports.DDeiCoreBorderWeightButton = DDeiCoreBorderWeightButton; exports.DDeiCoreBottomMenuPanel = DDeiCoreBottomMenuPanel; exports.DDeiCoreBottomPanels = DDeiCoreBottomPanels; exports.DDeiCoreCanvasViewPanel = DDeiCoreCanvasViewPanel; exports.DDeiCoreChangeRatioDialog = DDeiCoreChangeRatioDialog; exports.DDeiCoreChangeRatioPanel = DDeiCoreChangeRatioPanel; exports.DDeiCoreChooseControlDialog = DDeiCoreChooseControlDialog; exports.DDeiCoreChooseControlGroupDialog = DDeiCoreChooseControlGroupDialog; exports.DDeiCoreCloseFileConfirmDialog = DDeiCoreCloseFileConfirmDialog; exports.DDeiCoreCollFileConfirmDialog = DDeiCoreCollFileConfirmDialog; exports.DDeiCoreColorComboPropEditor = DDeiCoreColorComboPropEditor; exports.DDeiCoreColorPropEditor = DDeiCoreColorPropEditor; exports.DDeiCoreComboxPropEditor = DDeiCoreComboxPropEditor; exports.DDeiCoreCommonPanels = DDeiCoreCommonPanels; exports.DDeiCoreComponents = DDeiCoreComponents; exports.DDeiCoreControls = DDeiCoreControls; exports.DDeiCoreDialogs = DDeiCoreDialogs; exports.DDeiCoreEditBoxButton = DDeiCoreEditBoxButton; exports.DDeiCoreEditColorButton = DDeiCoreEditColorButton; exports.DDeiCoreEditFontFamilyButton = DDeiCoreEditFontFamilyButton; exports.DDeiCoreEditFontSizeButton = DDeiCoreEditFontSizeButton; exports.DDeiCoreEditLinePointTypeButton = DDeiCoreEditLinePointTypeButton; exports.DDeiCoreEditLineTypeButton = DDeiCoreEditLineTypeButton; exports.DDeiCoreEditTextAlignButton = DDeiCoreEditTextAlignButton; exports.DDeiCoreExCheckboxPropEditor = DDeiCoreExCheckboxPropEditor; exports.DDeiCoreExportAndImportPanel = DDeiCoreExportAndImportPanel; exports.DDeiCoreFileInfoPanel = DDeiCoreFileInfoPanel; exports.DDeiCoreFileOperatePanel = DDeiCoreFileOperatePanel; exports.DDeiCoreFillTypePropEditor = DDeiCoreFillTypePropEditor; exports.DDeiCoreFontAndTextPanel = DDeiCoreFontAndTextPanel; exports.DDeiCoreFontSizePropEditor = DDeiCoreFontSizePropEditor; exports.DDeiCoreHotkeys = DDeiCoreHotkeys; exports.DDeiCoreImagePropEditor = DDeiCoreImagePropEditor; exports.DDeiCoreLayouts = DDeiCoreLayouts; exports.DDeiCoreLifeCycles = DDeiCoreLifeCycles; exports.DDeiCoreLinePointTypeDialog = DDeiCoreLinePointTypeDialog; exports.DDeiCoreLineTypeDialog = DDeiCoreLineTypeDialog; exports.DDeiCoreManageLayersDialog = DDeiCoreManageLayersDialog; exports.DDeiCoreManageLayersPanel = DDeiCoreManageLayersPanel; exports.DDeiCoreMenus = DDeiCoreMenus; exports.DDeiCoreMergeComposeDialog = DDeiCoreMergeComposeDialog; exports.DDeiCoreOpenFilesViewPanel = DDeiCoreOpenFilesViewPanel; exports.DDeiCoreOperatePanel = DDeiCoreOperatePanel; exports.DDeiCorePVEditors = DDeiCorePVEditors; exports.DDeiCorePanels = DDeiCorePanels; exports.DDeiCorePlayPanel = DDeiCorePlayPanel; exports.DDeiCorePositionDialog = DDeiCorePositionDialog; exports.DDeiCorePropertyViewPanel = DDeiCorePropertyViewPanel; exports.DDeiCorePublishFileConfirmDialog = DDeiCorePublishFileConfirmDialog; exports.DDeiCoreQCViewDialog = DDeiCoreQCViewDialog; exports.DDeiCoreQuickColorViewPanel = DDeiCoreQuickColorViewPanel; exports.DDeiCoreQuickSetStyleDialog = DDeiCoreQuickSetStyleDialog; exports.DDeiCoreRadioPropEditor = DDeiCoreRadioPropEditor; exports.DDeiCoreRangePropEditor = DDeiCoreRangePropEditor; exports.DDeiCoreRotateDialog = DDeiCoreRotateDialog; exports.DDeiCoreSelectBorderDashDialog = DDeiCoreSelectBorderDashDialog; exports.DDeiCoreSelectBorderWeightDialog = DDeiCoreSelectBorderWeightDialog; exports.DDeiCoreSelectColorDialog = DDeiCoreSelectColorDialog; exports.DDeiCoreSelectFontDialog = DDeiCoreSelectFontDialog; exports.DDeiCoreSelectFontSizeDialog = DDeiCoreSelectFontSizeDialog; exports.DDeiCoreShapeCountPanel = DDeiCoreShapeCountPanel; exports.DDeiCoreSheetsPanel = DDeiCoreSheetsPanel; exports.DDeiCoreSimpleLayout = DDeiCoreSimpleLayout; exports.DDeiCoreSimplePanels = DDeiCoreSimplePanels; exports.DDeiCoreSortPanel = DDeiCoreSortPanel; exports.DDeiCoreStandLayout = DDeiCoreStandLayout; exports.DDeiCoreStylePanel = DDeiCoreStylePanel; exports.DDeiCoreSuitRatioPanel = DDeiCoreSuitRatioPanel; exports.DDeiCoreSwitchCheckboxPropEditor = DDeiCoreSwitchCheckboxPropEditor; exports.DDeiCoreTextAlignDialog = DDeiCoreTextAlignDialog; exports.DDeiCoreTextAreaPropEditor = DDeiCoreTextAreaPropEditor; exports.DDeiCoreTextPropEditor = DDeiCoreTextPropEditor; exports.DDeiCoreThemeBlack = DDeiCoreThemeBlack; exports.DDeiCoreThemeDefault = DDeiCoreThemeDefault; exports.DDeiCoreThemes = DDeiCoreThemes; exports.DDeiCoreToolPanel = DDeiCoreToolPanel; exports.DDeiCoreToolboxPanel = DDeiCoreToolboxPanels; exports.DDeiCoreToolboxPanels = DDeiCoreToolboxPanels; exports.DDeiCoreToolboxSimplePanel = DDeiCoreToolboxSimplePanel; exports.DDeiCoreTopMenuPanel = DDeiCoreTopMenuPanel; exports.DDeiCoreTopMenuSimplePanel = DDeiCoreTopMenuSimplePanel; exports.DDeiDiamond = DDeiDiamond; exports.DDeiDiamondCanvasRender = DDeiDiamondCanvasRender; exports.DDeiEditor = DDeiEditor; exports.DDeiEditorArrtibute = DDeiEditorArrtibute; exports.DDeiEditorCommandAddHistroy = DDeiEditorCommandAddHistroy; exports.DDeiEditorCommandChangeEditMode = DDeiEditorCommandChangeEditMode; exports.DDeiEditorCommandClearTemplateUI = DDeiEditorCommandClearTemplateUI; exports.DDeiEditorCommandFileDirty = DDeiEditorCommandFileDirty; exports.DDeiEditorCommandLoadFile = DDeiEditorCommandLoadFile; exports.DDeiEditorCommandRefreshEditorParts = DDeiEditorCommandRefreshEditorParts; exports.DDeiEditorCommandSaveFile = DDeiEditorCommandSaveFile; exports.DDeiEditorEnumBusCommandType = DDeiEditorEnumBusCommandType; exports.DDeiEditorState = DDeiEditorState; exports.DDeiEditorUtil = DDeiEditorUtil; exports.DDeiEditorView = DDeiEditorView; exports.DDeiEnumAttributeType = DDeiEnumAttributeType; exports.DDeiEnumBusCommandType = DDeiEnumBusCommandType; exports.DDeiEnumControlState = DDeiEnumControlState; exports.DDeiEnumOperateState = DDeiEnumOperateState; exports.DDeiEnumOperateType = DDeiEnumOperateType; exports.DDeiEnumState = DDeiEnumState; exports.DDeiEnumStoreType = DDeiEnumStoreType; exports.DDeiExtHtmlViewer = DDeiExtHtmlViewer; exports.DDeiExtQuickControl = DDeiExtQuickControl; exports.DDeiExtQuickControlDialogs = DDeiExtQuickControlDialogs; exports.DDeiExtQuickControlHotkeys = DDeiExtQuickControlHotkeys; exports.DDeiExtQuickStyle = DDeiExtQuickStyle; exports.DDeiExtSearch = DDeiExtSearch; exports.DDeiExtSearchHotkeys = DDeiExtSearchHotkeys; exports.DDeiExtTooltip = DDeiExtTooltip; exports.DDeiExtUML = DDeiExtUML; exports.DDeiFile = DDeiFile; exports.DDeiFileState = DDeiFileState; exports.DDeiFuncCallResult = DDeiFuncCallResult; exports.DDeiFuncData = DDeiFuncData; exports.DDeiKeyAction = DDeiKeyAction; exports.DDeiKeyActionAllSelect = DDeiKeyActionAllSelect; exports.DDeiKeyActionBrushData = DDeiKeyActionBrushData; exports.DDeiKeyActionCancelCompose = DDeiKeyActionCancelCompose; exports.DDeiKeyActionCancelControlCreate = DDeiKeyActionCancelControlCreate; exports.DDeiKeyActionCancelCurrentAction = DDeiKeyActionCancelCurrentAction; exports.DDeiKeyActionCancelQuickEdit = DDeiKeyActionCancelQuickEdit; exports.DDeiKeyActionCancelSelect = DDeiKeyActionCancelSelect; exports.DDeiKeyActionClearBrushData = DDeiKeyActionClearBrushData; exports.DDeiKeyActionCloseDialog = DDeiKeyActionCloseDialog; exports.DDeiKeyActionCompose = DDeiKeyActionCompose; exports.DDeiKeyActionCopy = DDeiKeyActionCopy; exports.DDeiKeyActionCopyImage = DDeiKeyActionCopyImage; exports.DDeiKeyActionCut = DDeiKeyActionCut; exports.DDeiKeyActionEnterQuickEdit = DDeiKeyActionEnterQuickEdit; exports.DDeiKeyActionMoveModels = DDeiKeyActionMoveModels; exports.DDeiKeyActionNewRowQuickEdit = DDeiKeyActionNewRowQuickEdit; exports.DDeiKeyActionPaste = DDeiKeyActionPaste; exports.DDeiKeyActionPushModels = DDeiKeyActionPushModels; exports.DDeiKeyActionQuickControlEsc = DDeiKeyActionQuickControlEsc; exports.DDeiKeyActionReRevoke = DDeiKeyActionReRevoke; exports.DDeiKeyActionRemoveModels = DDeiKeyActionRemoveModels; exports.DDeiKeyActionRevoke = DDeiKeyActionRevoke; exports.DDeiKeyActionSaveFile = DDeiKeyActionSaveFile; exports.DDeiKeyActionSearch = DDeiKeyActionSearch; exports.DDeiKeyActionSearchEsc = DDeiKeyActionSearchEsc; exports.DDeiKeyActionSearchNext = DDeiKeyActionSearchNext; exports.DDeiKeyActionSearchUp = DDeiKeyActionSearchUp; exports.DDeiKeyActionStartQuickEdit = DDeiKeyActionStartQuickEdit; exports.DDeiKeyActionTableNextCol = DDeiKeyActionTableNextCol; exports.DDeiKeyActionTableNextRow = DDeiKeyActionTableNextRow; exports.DDeiLayer = DDeiLayer; exports.DDeiLayerCanvasRender = DDeiLayerCanvasRender; exports.DDeiLayoutManager = DDeiLayoutManager; exports.DDeiLayoutManagerCompose = DDeiLayoutManagerCompose; exports.DDeiLayoutManagerFactory = DDeiLayoutManagerFactory; exports.DDeiLayoutManagerFree = DDeiLayoutManagerFree; exports.DDeiLayoutManagerFull = DDeiLayoutManagerFull; exports.DDeiLayoutManagerNine = DDeiLayoutManagerNine; exports.DDeiLifeCycle = DDeiLifeCycle; exports.DDeiLine = DDeiLine; exports.DDeiLineCanvasRender = DDeiLineCanvasRender; exports.DDeiLink = DDeiLink; exports.DDeiMenuBase = DDeiMenuBase; exports.DDeiModelArrtibuteValue = DDeiModelArrtibuteValue; exports.DDeiModelLink = DDeiModelLink; exports.DDeiPluginBase = DDeiPluginBase; exports.DDeiPolygon = DDeiPolygon; exports.DDeiPolygonContainer = DDeiPolygonContainer; exports.DDeiPolygonContainerCanvasRender = DDeiPolygonContainerCanvasRender; exports.DDeiRectangle = DDeiRectangle; exports.DDeiRectangleCanvasRender = DDeiRectangleCanvasRender; exports.DDeiSelector = DDeiSelector; exports.DDeiSelectorCanvasRender = DDeiSelectorCanvasRender; exports.DDeiSheet = DDeiSheet; exports.DDeiStage = DDeiStage; exports.DDeiStageCanvasRender = DDeiStageCanvasRender; exports.DDeiStore = DDeiStore; exports.DDeiTable = DDeiTable; exports.DDeiTableCanvasRender = DDeiTableCanvasRender; exports.DDeiTableCell = DDeiTableCell; exports.DDeiTableCellCanvasRender = DDeiTableCellCanvasRender; exports.DDeiTableSelector = DDeiTableSelector; exports.DDeiTableSelectorCanvasRender = DDeiTableSelectorCanvasRender; exports.DDeiThemeBase = DDeiThemeBase; exports.DDeiUtil = DDeiUtil; exports.FONTS = FONTS; exports.Matrix3 = Matrix3; exports.MenuCancelMergeCell = MenuCancelMergeCell; exports.MenuCopySheet = MenuCopySheet; exports.MenuInsertCol = MenuInsertCol; exports.MenuInsertRow = MenuInsertRow; exports.MenuMergeCell = MenuMergeCell; exports.MenuRemoveCol = MenuRemoveCol; exports.MenuRemoveRow = MenuRemoveRow; exports.MenuRemoveSheet = MenuRemoveSheet; exports.QuickChooseControlDialog = DDeiExtQuickChooseControlDialog; exports.QuickControlDialog = DDeiExtQuickControlDialog; exports.Vector3 = Vector3; exports.addCommand = addCommand; exports.autoLoadCommand = autoLoadCommand; exports.clone = clone; exports.cloneDeep = cloneDeep; exports.config = config; exports.debounce = debounce; exports.default = DDeiEditorView; exports.loadAndSortGroup = loadAndSortGroup; exports.loadControlByFrom = loadControlByFrom; exports.loadControlDefineComposes = loadControlDefineComposes; exports.loadControlDefineExt = loadControlDefineExt; exports.merge = merge$1; exports.ov_link_h_split_point = ov_link_h_split_point; exports.ov_link_v_split_point = ov_link_v_split_point; exports.throttle = throttle; exports.trim = trim; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); });