@sl-material/sl-import 1.0.0-beta0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +486 -0
- package/index.d.ts +456 -0
- package/package.json +38 -0
- package/sl-import.cjs.js +2 -0
- package/sl-import.es.js +4095 -0
- package/sl-import.umd.umd.js +1573 -0
package/sl-import.es.js
ADDED
|
@@ -0,0 +1,4095 @@
|
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var A=document.createElement("style");A.appendChild(document.createTextNode("@charset \"UTF-8\";:root{--sl-color-white: #ffffff;--sl-color-black: #000000;--sl-color-primary-rgb: 40, 120, 255;--sl-color-success-rgb: 0, 180, 42;--sl-color-warning-rgb: 255, 105, 0;--sl-color-danger-rgb: 255, 77, 80;--sl-color-error-rgb: 255, 77, 80;--sl-color-info-rgb: 136, 141, 154;--sl-font-size-extra-large: 20px;--sl-font-size-large: 18px;--sl-font-size-medium: 16px;--sl-font-size-base: 14px;--sl-font-size-small: 13px;--sl-font-size-extra-small: 12px;--sl-font-size-extra-smaller: 11px;--sl-font-size-last-small: 10px;--sl-font-family: \"PingFang SC\", \"Microsoft YaHei\", \"Helvetica Neue\", Helvetica, \"Hiragino Sans GB\", \"微软雅黑\", Arial, sans-serif;--sl-font-weight-primary: 400;--sl-font-weight-500: 500;--sl-font-line-height-primary: 24px;--sl-index-normal: 1;--sl-index-top: 1000;--sl-index-popper: 2000;--sl-border-radius-base: 4px;--sl-border-radius-small: 2px;--sl-border-radius-round: 20px;--sl-border-radius-circle: 100%;--sl-transition-duration: .3s;--sl-transition-duration-fast: .2s;--sl-transition-function-ease-in-out-bezier: cubic-bezier(.645, .045, .355, 1);--sl-transition-function-fast-bezier: cubic-bezier(.23, 1, .32, 1);--sl-transition-all: all var(--sl-transition-duration) var(--sl-transition-function-ease-in-out-bezier);--sl-transition-fade: opacity var(--sl-transition-duration) var(--sl-transition-function-fast-bezier);--sl-transition-md-fade: transform var(--sl-transition-duration) var(--sl-transition-function-fast-bezier), opacity var(--sl-transition-duration) var(--sl-transition-function-fast-bezier);--sl-transition-fade-linear: opacity var(--sl-transition-duration-fast) linear;--sl-transition-border: border-color var(--sl-transition-duration-fast) var(--sl-transition-function-ease-in-out-bezier);--sl-transition-box-shadow: box-shadow var(--sl-transition-duration-fast) var(--sl-transition-function-ease-in-out-bezier);--sl-transition-color: color var(--sl-transition-duration-fast) var(--sl-transition-function-ease-in-out-bezier);--sl-component-size-large: 40px;--sl-component-size: 32px;--sl-component-size-small: 24px;color-scheme:light;--sl-color-primary: #2878ff;--sl-color-primary-light-3: #5594ff;--sl-color-primary-light-5: #9FC3FF;--sl-color-primary-light-7: #bfd7ff;--sl-color-primary-light-8: #d4e4ff;--sl-color-primary-light-9: #E8F3FF;--sl-color-primary-dark-2: #0A59DF;--sl-color-success: #00B42A;--sl-color-success-light-3: rgb(77, 203, 106);--sl-color-success-light-5: rgb(128, 218, 149);--sl-color-success-light-7: rgb(179, 233, 191);--sl-color-success-light-8: rgb(204, 240, 212);--sl-color-success-light-9: #E8FFEA;--sl-color-success-dark-2: rgb(0, 144, 34);--sl-color-warning: #FF6900;--sl-color-warning-light-3: rgb(255, 150, 77);--sl-color-warning-light-5: rgb(255, 180, 128);--sl-color-warning-light-7: rgb(255, 210, 179);--sl-color-warning-light-8: rgb(255, 225, 204);--sl-color-warning-light-9: #FFF3E4;--sl-color-warning-dark-2: rgb(204, 84, 0);--sl-color-danger: #FF4D50;--sl-color-danger-light-3: rgb(255, 130, 133);--sl-color-danger-light-5: rgb(255, 166, 168);--sl-color-danger-light-7: rgb(255, 202, 203);--sl-color-danger-light-8: rgb(255, 219, 220);--sl-color-danger-light-9: #FFEBEB;--sl-color-danger-dark-2: rgb(204, 62, 64);--sl-color-error: #FF4D50;--sl-color-error-light-3: rgb(255, 130, 133);--sl-color-error-light-5: rgb(255, 166, 168);--sl-color-error-light-7: rgb(255, 202, 203);--sl-color-error-light-8: rgb(255, 219, 220);--sl-color-error-light-9: rgb(255, 237, 238);--sl-color-error-dark-2: rgb(204, 62, 64);--sl-color-info: #888d9a;--sl-color-info-light-3: #b1b3b8;--sl-color-info-light-5: #c8c9cc;--sl-color-info-light-7: #dedfe0;--sl-color-info-light-8: #e9e9eb;--sl-color-info-light-9: #f4f5f6;--sl-color-info-dark-2: rgb(109, 113, 123);--sl-color-rest: #955609;--sl-color-rest-light-1: #ffeac9;--sl-color-success-light-4: #23C343;--sl-color-success-light-6: #7BE188;--sl-color-warning-light-4: #FD7E14;--sl-color-warning-light-6: #FFC078;--sl-color-danger-light-4: #FC7274;--sl-color-danger-light-6: #FFB9BA;--sl-bg-color: #ffffff;--sl-bg-color-page: #f2f3f5;--sl-bg-color-overlay: #ffffff;--sl-bg-color-rest: rgba(253, 192, 45, .03);--sl-bg-color-container: #f2f4f6;--sl-text-color: #1D2129;--sl-text-color-primary: #1D2129;--sl-text-color-regular: #1D2129;--sl-text-color-secondary: #4E5969;--sl-text-color-thridary: #86909C;--sl-text-color-four: #C9CDD4;--sl-text-color-fifth: #FFFFFF;--sl-text-color-placeholder: #86909C;--sl-text-color-disabled: #C9CDD4;--sl-text-color-icon: #afb1b4;--sl-border-color: #E5E6EB;--sl-border-color-light: #F2F3F5;--sl-border-color-dark: #C9CDD4;--sl-border-color-darker: #86909C;--sl-border-color-checkbox: #C9CDD4;--sl-border-color-switch: #C9CDD4;--sl-fill-color: #F2F3F5;--sl-fill-color-light: #F7F8FA;--sl-fill-color-dark: #E5E6EB;--sl-fill-color-darker: #C9CDD4;--sl-fill-color-extra-darker: #4E5969;--sl-fill-color-blank: #ffffff;--sl-box-shadow: 0px 12px 32px 4px rgba(0, 0, 0, .04), 0px 8px 20px rgba(0, 0, 0, .08);--sl-box-shadow-light: 0px 0px 12px rgba(0, 0, 0, .12);--sl-box-shadow-lighter: 0px 0px 6px rgba(0, 0, 0, .12);--sl-box-shadow-dark: 0px 16px 48px 16px rgba(0, 0, 0, .08), 0px 12px 32px rgba(0, 0, 0, .12), 0px 8px 16px -8px rgba(0, 0, 0, .16);--sl-disabled-bg-color: var(--sl-fill-color-light);--sl-disabled-text-color: var(--sl-text-color-thridary);--sl-disabled-border-color: var(--sl-border-color-dark);--sl-overlay-color: rgba(0, 0, 0, .8);--sl-overlay-color-light: rgba(0, 0, 0, .7);--sl-overlay-color-lighter: rgba(0, 0, 0, .5);--sl-mask-color: rgba(255, 255, 255, .9);--sl-mask-color-extra-light: rgba(255, 255, 255, .3);--sl-border-width: 1px;--sl-border-style: solid;--sl-border-color-hover: var(--sl-text-color-disabled);--sl-border: var(--sl-border-width) var(--sl-border-style) var(--sl-border-color);--sl-checkbox-input-border-custom: var(--sl-border-width) var(--sl-border-style) var(--sl-border-color-checkbox);--sl-svg-monochrome-grey: var(--sl-border-color);--sl-form-item-tooltip-width: 240px }:root{--slm-card-bg-color4: #F6F6F6;--slm-card-bg-color5:#EDEDED;--slm-primary-color-hover:#5297ff }@font-face{font-family:iconfont;src:url(data:font/woff2;base64,d09GMgABAAAAAAYwAAsAAAAADLgAAAXiAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACENAqKXIh5ATYCJAMwCxoABCAFhGcHgQYb9wojESZkU0T2VwV2s+MHJqmqG83MyKuq+nUQRrbNCA6xPbH3RWF5in3cCwf7/SKC7/f77blPvjnaVJvZdBKJTGIoneSJRKmkTvb//zvzTt5KkRZAli44L8nCQe2ZaT35ak9QKpMa/FsEAOTYaOfLFKKhdtN84P/R3L94aYQ0ba9+61onPO6OzYHpffu1vKi0q8hgEho1zhe9RfYw1SQimXghIS6hESqPUCi9oiCey8ViAp4jULelCO/isw8JAbfVhFGg4IbMDYyGccvmNvC6x8oD3EM1qox6bA4f3En3vGvAg/Lz8S89QpIiE7nR5U2lAU59+DAzuoeG7BOTXRdsn1Agw1rF4uM9OPUNaaVrkLrXR7i5A/qCIOkrdInEiJdorJn/BU4ijBDXEykOfSJKJJayf/FAVaGilKupa8gkQZSCsXm2fi1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mbwd3YXJuaW5nB3N1Y2Nlc3MFY3Vvd3UFcHJldjIFcHJldjMEbmV4dAVuZXh0MQlpY29uX3RpcHMGeGlhemFpBXRpc2hpAAAAAA==) format(\"truetype\"),url(\"data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%20%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%3e%3cmetadata%3eCreated%20by%20iconfont%3c/metadata%3e%3cdefs%3e%3cfont%20id='iconfont'%20horiz-adv-x='1024'%3e%3cfont-face%20font-family='iconfont'%20font-weight='400'%20font-stretch='normal'%20units-per-em='1024'%20ascent='896'%20descent='-128'%20/%3e%3cmissing-glyph%20/%3e%3cglyph%20glyph-name='info'%20unicode='&%2359005;'%20d='M512%20800c-229.76%200-416-186.24-416-416s186.24-416%20416-416%20416%20186.24%20416%20416-186.24%20416-416%20416zM577.248%20230.944c-31.392-47.136-63.328-83.456-117.056-83.456-36.672%205.984-51.744%2032.256-43.808%2059.04l69.12%20228.928c1.696%205.6-1.12%2011.584-6.24%2013.408-5.088%201.792-15.072-4.832-23.712-14.304l-41.792-50.272c-1.12%208.448-0.128%2022.4-0.128%2028.032%2031.392%2047.136%2082.976%2084.32%20117.952%2084.32%2033.248-3.392%2048.992-29.984%2043.2-59.2l-69.6-230.048c-0.928-5.184%201.824-10.464%206.528-12.128%205.12-1.792%2015.872%204.832%2024.544%2014.304l41.76%2050.24c1.12-8.448-0.768-23.232-0.768-28.864zM567.936%20529.952c-26.432%200-47.872%2019.264-47.872%2047.616s21.44%2047.584%2047.872%2047.584%2047.872-19.264%2047.872-47.584c0-28.384-21.44-47.616-47.872-47.616z'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='warning'%20unicode='&%2358993;'%20d='M512%20832q190.016-4.992%20316.512-131.488T960%20384q-4.992-190.016-131.488-316.512T512-64q-190.016%204.992-316.512%20131.488T64%20384q4.992%20190.016%20131.488%20316.512T512%20832z%20m0-192q-26.016%200-43.008-19.008T453.984%20576l23.008-256q2.016-14.016%2011.488-22.496t23.488-8.512%2023.488%208.512%2011.488%2022.496l23.008%20256q2.016%2026.016-15.008%2044.992T511.936%20640z%20m0-512q22.016%200.992%2036.512%2015.008t14.496%2036-14.496%2036.512T512%20230.016t-36.512-14.496-14.496-36.512%2014.496-36T512%20128z'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='success'%20unicode='&%2358924;'%20d='M510.646-63.35c-247.257%200-447.692%20200.447-447.692%20447.701%200%20247.247%20200.436%20447.692%20447.692%20447.692s447.693-200.445%20447.693-447.692c0-247.254-200.437-447.7-447.693-447.7z%20m273.546%20605.113l-14.388%2014.388c-7.949%207.949-20.826%207.949-28.775%200L442.6%20263.914%20333.045%20378.569c-3.598%203.597-12.958%200.06-20.908-7.888l-14.388-14.39c-7.95-7.95-11.465-17.31-7.87-20.896l146.185-152.97c3.576-3.598%2012.937-0.05%2020.887%207.889l14.368%2014.388c2.543%202.524%204.411%205.137%205.96%207.711l306.914%20300.563c7.95%207.94%207.95%2020.838-0.001%2028.787z'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='cuowu'%20unicode='&%2358900;'%20d='M512-85.333333C252.8-85.333333%2042.666667%20124.8%2042.666667%20384S252.8%20853.333333%20512%20853.333333s469.333333-210.133333%20469.333333-469.333333-210.133333-469.333333-469.333333-469.333333z%20m44.245333%20469.333333l159.914667%20159.914667a31.274667%2031.274667%200%201%201-44.245333%2044.245333L512%20428.245333%20352.085333%20588.16a31.274667%2031.274667%200%201%201-44.245333-44.245333L467.754667%20384l-159.914667-159.914667a31.274667%2031.274667%200%201%201%2044.245333-44.245333L512%20339.754667l159.914667-159.914667a31.274667%2031.274667%200%201%201%2044.245333%2044.245333L556.245333%20384z'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='prev2'%20unicode='&%2358881;'%20d='M62.56%20384.096L485.952%20807.744a48.64%2048.64%200%200%200%2068.736-68.736L199.616%20383.936l356.8-356.8A48.64%2048.64%200%200%200%20487.68-41.6l-39.744%2039.744%200.256%200.256L62.528%20384.064z%20m388.8%200L874.752%20807.744a48.64%2048.64%200%200%200%2068.736-68.736L588.416%20383.936l356.8-356.8A48.64%2048.64%200%200%200%20876.48-41.6l-39.776%2039.744%200.288%200.256-385.664%20385.664z'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='prev3'%20unicode='&%2358899;'%20d='M714.608%20854.926L265.584%20405.903c-10.963-10.963-11.993-28.099-3.083-40.21899999l0.06099999-0.07900001a31.629%2031.629%200%200%201%201.55500001-1.926c0.47-0.539%200.954-1.07000001%201.468-1.584L714.608-86.92700000000002c12.098-12.097%2031.71-12.097%2043.808%200%2012.097%2012.096%2012.097%2031.71%200%2043.807L331.296%20384l427.11900001%20427.12c12.097%2012.096%2012.097%2031.71-1e-8%2043.807-12.097%2012.097-31.708%2012.097-43.807-0.001z'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='next'%20unicode='&%2358896;'%20d='M277.761223-128c-7.82426%200-15.64852%203.91213-23.472779%209.780325-11.73639%2011.73639-11.73639%2033.253104%200%2044.989494l457.719198%20459.675263-455.763133%20455.763133c-11.73639%2011.73639-11.73639%2033.253104%200%2044.989494s33.253104%2011.73639%2044.989494%200l479.235912-479.235912c11.73639-11.73639%2011.73639-33.253104%200-44.989494l-481.191977-483.148042C293.409742-124.08787%20285.585482-128%20277.761223-128z'%20horiz-adv-x='1037'%20/%3e%3cglyph%20glyph-name='next1'%20unicode='&%2358880;'%20d='M948.064%20382.944L536.064-29.312a47.296%2047.296%200%200%200-66.88%2066.88l345.504%20345.504L467.52%20730.24a47.296%2047.296%200%200%200%2066.88%2066.88l38.688-38.688-0.256-0.256%20375.264-375.264m-378.336%200.032L157.76-29.312a47.296%2047.296%200%200%200-66.88%2066.88l345.472%20345.504L89.184%20730.24a47.296%2047.296%200%200%200%2066.88%2066.88l38.688-38.688-0.256-0.256%20375.264-375.264'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='icon_tips'%20unicode='&%2358919;'%20d='M512%20192c-53.024%200-96%2042.976-96%2096v512c0%2053.024%2042.976%2096%2096%2096s96-42.976%2096-96v-512c0-53.024-42.976-96-96-96M512%2064c53.024%200%2096-42.976%2096-96s-42.976-96-96-96c-53.024%200-96%2042.976-96%2096%200%2053.024%2042.976%2096%2096%2096z'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='xiazai'%20unicode='&%2358921;'%20d='M469.357714%20334.628571V789.357714h85.284572v-454.729143l120.685714%20120.685715%2060.416-60.342857L512%20171.300571%20288.329143%20394.971429l60.342857%2060.342857%20120.685714-120.685715z%20m-256-270.628571v85.357714H128v-170.715428h768v170.715428h-85.357714v-85.357714H213.357714z'%20horiz-adv-x='1024'%20/%3e%3cglyph%20glyph-name='tishi'%20unicode='&%2358922;'%20d='M170.666667%20384a341.333333%20341.333333%200%201%201%20682.666666%200%20341.333333%20341.333333%200%201%201-682.666666%200ZM512-85.333333A469.333333%20469.333333%200%201%201%20512%20853.333333a469.333333%20469.333333%200%200%201%200-938.666666zM448%20618.666667a64%2064%200%200%200%20128%200v-256a64%2064%200%200%200-128%200v256zM597.333333%20170.666667a85.333333%2085.333333%200%201%200-170.666666%200%2085.333333%2085.333333%200%200%200%20170.666666%200z'%20horiz-adv-x='1024'%20/%3e%3c/font%3e%3c/defs%3e%3c/svg%3e\") format(\"svg\")}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-info:before{content:\"\"}.icon-warning:before{content:\"\"}.icon-success:before{content:\"\"}.icon-cuowu:before{content:\"\"}.icon-prev2:before{content:\"\"}.icon-prev3:before{content:\"\"}.icon-next:before{content:\"\"}.icon-next1:before{content:\"\"}.icon-icon_tips:before{content:\"\"}.icon-xiazai:before{content:\"\"}.icon-tishi:before{content:\"\"}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 #e6e6e6,-1px 0 #e6e6e6,0 1px #e6e6e6,0 -1px #e6e6e6,0 3px 13px #00000014}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:\"\";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:#000000e6;fill:#000000e6;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#000000e6;fill:#000000e6}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:#0000001a}.numInputWrapper span:active{background:#0003}.numInputWrapper span:after{display:block;content:\"\";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:#00000080}.numInputWrapper:hover{background:#0000000d}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:#0000000d}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch�;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:#000000e6}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:#000000e6}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:#00000080;background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:#0000000d}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:#0000008a;line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:#3939394d;background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:#3939391a}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 #569ff7,5px 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:#3939394d;background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:\"\";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}")),document.head.appendChild(A)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
import flatpickr from "flatpickr";
|
|
6
|
+
import Resumable from "resumablejs";
|
|
7
|
+
var TemplateTypeEnum = /* @__PURE__ */ ((TemplateTypeEnum2) => {
|
|
8
|
+
TemplateTypeEnum2["BASE"] = "base";
|
|
9
|
+
TemplateTypeEnum2["TEMPLATE1"] = "template1";
|
|
10
|
+
TemplateTypeEnum2["TEMPLATE2"] = "template2";
|
|
11
|
+
TemplateTypeEnum2["TEMPLATE3"] = "template3";
|
|
12
|
+
TemplateTypeEnum2["TEMPLATE4"] = "template4";
|
|
13
|
+
TemplateTypeEnum2["TEMPLATE5"] = "template5";
|
|
14
|
+
return TemplateTypeEnum2;
|
|
15
|
+
})(TemplateTypeEnum || {});
|
|
16
|
+
var ExportTypeEnum = /* @__PURE__ */ ((ExportTypeEnum2) => {
|
|
17
|
+
ExportTypeEnum2["image"] = "image";
|
|
18
|
+
ExportTypeEnum2["excel"] = "excel";
|
|
19
|
+
return ExportTypeEnum2;
|
|
20
|
+
})(ExportTypeEnum || {});
|
|
21
|
+
var I18nLocaleEnum = /* @__PURE__ */ ((I18nLocaleEnum2) => {
|
|
22
|
+
I18nLocaleEnum2["ZH_CN"] = "zh-CN";
|
|
23
|
+
I18nLocaleEnum2["ZH_TW"] = "zh-TW";
|
|
24
|
+
I18nLocaleEnum2["JA"] = "ja";
|
|
25
|
+
I18nLocaleEnum2["ID"] = "id";
|
|
26
|
+
I18nLocaleEnum2["EN_US"] = "en-US";
|
|
27
|
+
return I18nLocaleEnum2;
|
|
28
|
+
})(I18nLocaleEnum || {});
|
|
29
|
+
const DEFAULT_LOCALE = "zh-CN";
|
|
30
|
+
const DEFAULT_IMAGE_RATIOS = [
|
|
31
|
+
{ label: "原图", value: "original" },
|
|
32
|
+
{ label: "4:3", value: "4:3" },
|
|
33
|
+
{ label: "3:4", value: "3:4" },
|
|
34
|
+
{ label: "1:1", value: "1:1" },
|
|
35
|
+
{ label: "16:9", value: "16:9" }
|
|
36
|
+
];
|
|
37
|
+
const getImageRatioOptions = (t2) => [
|
|
38
|
+
{ label: t2("imageRatioOriginal"), value: "original" },
|
|
39
|
+
{ label: t2("imageRatio4to3"), value: "4:3" },
|
|
40
|
+
{ label: t2("imageRatio3to4"), value: "3:4" },
|
|
41
|
+
{ label: t2("imageRatio1to1"), value: "1:1" },
|
|
42
|
+
{ label: t2("imageRatio16to9"), value: "16:9" }
|
|
43
|
+
];
|
|
44
|
+
const getTranslatedTemplateConfigs = (t2) => ({
|
|
45
|
+
[TemplateTypeEnum.BASE]: {
|
|
46
|
+
type: ExportTypeEnum.excel,
|
|
47
|
+
tabs: [],
|
|
48
|
+
showBrand: false,
|
|
49
|
+
showImageRatio: false,
|
|
50
|
+
showMonth: false,
|
|
51
|
+
showDateRange: false,
|
|
52
|
+
uploadTitle: t2("uploadTitleBase"),
|
|
53
|
+
uploadLinkText: t2("uploadLinkTextDefault"),
|
|
54
|
+
uploadHint: t2("uploadHintExcel"),
|
|
55
|
+
acceptTypes: ".xls,.xlsx",
|
|
56
|
+
tips: [],
|
|
57
|
+
templateUrl: "/template/base_template.xlsx"
|
|
58
|
+
},
|
|
59
|
+
[TemplateTypeEnum.TEMPLATE1]: {
|
|
60
|
+
type: ExportTypeEnum.excel,
|
|
61
|
+
tabs: [],
|
|
62
|
+
showBrand: true,
|
|
63
|
+
showImageRatio: true,
|
|
64
|
+
showMonth: false,
|
|
65
|
+
showDateRange: false,
|
|
66
|
+
uploadTitle: t2("uploadTitleTemplate1"),
|
|
67
|
+
uploadLinkText: t2("uploadLinkTextDefault"),
|
|
68
|
+
uploadHint: t2("uploadHintExcel"),
|
|
69
|
+
acceptTypes: ".xls,.xlsx",
|
|
70
|
+
tips: t2("tipsTemplate1").split("\n"),
|
|
71
|
+
templateUrl: "/template/template1.xlsx"
|
|
72
|
+
},
|
|
73
|
+
[TemplateTypeEnum.TEMPLATE2]: {
|
|
74
|
+
type: ExportTypeEnum.excel,
|
|
75
|
+
tabs: [
|
|
76
|
+
{ label: t2("tabCoverImport"), key: "cover" },
|
|
77
|
+
{ label: t2("tabIncrementImport"), key: "increment" }
|
|
78
|
+
],
|
|
79
|
+
showBrand: false,
|
|
80
|
+
showImageRatio: false,
|
|
81
|
+
showMonth: false,
|
|
82
|
+
showDateRange: false,
|
|
83
|
+
uploadTitle: t2("uploadTitleTemplate2"),
|
|
84
|
+
uploadLinkText: t2("uploadLinkTextImport"),
|
|
85
|
+
uploadHint: t2("uploadHintImage"),
|
|
86
|
+
acceptTypes: ".rar,.zip,.jpg,.png,.jpeg",
|
|
87
|
+
tips: t2("tipsTemplate2").split("\n"),
|
|
88
|
+
templateUrl: "/template/template2.xlsx"
|
|
89
|
+
},
|
|
90
|
+
[TemplateTypeEnum.TEMPLATE3]: {
|
|
91
|
+
type: ExportTypeEnum.excel,
|
|
92
|
+
tabs: [],
|
|
93
|
+
showBrand: true,
|
|
94
|
+
showImageRatio: false,
|
|
95
|
+
showMonth: false,
|
|
96
|
+
showDateRange: false,
|
|
97
|
+
uploadTitle: t2("uploadTitleTemplate3"),
|
|
98
|
+
uploadLinkText: t2("uploadLinkTextImport"),
|
|
99
|
+
uploadHint: t2("uploadHintExcel"),
|
|
100
|
+
acceptTypes: ".xls,.xlsx",
|
|
101
|
+
tips: t2("tipsTemplate3").split("\n"),
|
|
102
|
+
templateUrl: "/template/template3.xlsx"
|
|
103
|
+
},
|
|
104
|
+
[TemplateTypeEnum.TEMPLATE4]: {
|
|
105
|
+
type: ExportTypeEnum.excel,
|
|
106
|
+
tabs: [],
|
|
107
|
+
showBrand: true,
|
|
108
|
+
showImageRatio: false,
|
|
109
|
+
showMonth: false,
|
|
110
|
+
showDateRange: false,
|
|
111
|
+
uploadTitle: t2("uploadTitleTemplate4"),
|
|
112
|
+
uploadLinkText: t2("uploadLinkTextImport"),
|
|
113
|
+
uploadHint: t2("uploadHintExcel"),
|
|
114
|
+
acceptTypes: ".xls,.xlsx",
|
|
115
|
+
tips: t2("tipsTemplate4").split("\n"),
|
|
116
|
+
templateUrl: "/template/template4.xlsx"
|
|
117
|
+
},
|
|
118
|
+
[TemplateTypeEnum.TEMPLATE5]: {
|
|
119
|
+
type: ExportTypeEnum.excel,
|
|
120
|
+
tabs: [
|
|
121
|
+
{ label: t2("tabInPrice"), key: "inPrice" },
|
|
122
|
+
{ label: t2("tabOutPrice"), key: "outPrice" }
|
|
123
|
+
],
|
|
124
|
+
showBrand: false,
|
|
125
|
+
showImageRatio: false,
|
|
126
|
+
showMonth: false,
|
|
127
|
+
showDateRange: true,
|
|
128
|
+
uploadTitle: t2("uploadTitleTemplate5"),
|
|
129
|
+
uploadLinkText: t2("uploadLinkTextImport"),
|
|
130
|
+
uploadHint: t2("uploadHintExcel"),
|
|
131
|
+
acceptTypes: ".xls,.xlsx",
|
|
132
|
+
tips: t2("tipsTemplate5").split("\n"),
|
|
133
|
+
templateUrl: "/template/template5.xlsx"
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
const DEFAULT_TEMPLATE_CONFIGS = {
|
|
137
|
+
[TemplateTypeEnum.BASE]: {
|
|
138
|
+
type: ExportTypeEnum.excel,
|
|
139
|
+
tabs: [],
|
|
140
|
+
showBrand: false,
|
|
141
|
+
showImageRatio: false,
|
|
142
|
+
showMonth: false,
|
|
143
|
+
showDateRange: false,
|
|
144
|
+
uploadTitle: "上传文件",
|
|
145
|
+
uploadLinkText: "点击上传",
|
|
146
|
+
uploadHint: "文件仅支持扩展名:.xls,.xlsx",
|
|
147
|
+
acceptTypes: ".xls,.xlsx",
|
|
148
|
+
tips: [],
|
|
149
|
+
templateUrl: "/template/base_template.xlsx"
|
|
150
|
+
},
|
|
151
|
+
[TemplateTypeEnum.TEMPLATE1]: {
|
|
152
|
+
type: ExportTypeEnum.excel,
|
|
153
|
+
tabs: [],
|
|
154
|
+
showBrand: true,
|
|
155
|
+
showImageRatio: true,
|
|
156
|
+
showMonth: false,
|
|
157
|
+
showDateRange: false,
|
|
158
|
+
uploadTitle: "上传编辑好的文件",
|
|
159
|
+
uploadLinkText: "点击上传",
|
|
160
|
+
uploadHint: "文件仅支持扩展名:.xls,.xlsx",
|
|
161
|
+
acceptTypes: ".xls,.xlsx",
|
|
162
|
+
tips: ["这里写一些提示信息"],
|
|
163
|
+
templateUrl: "/template/template1.xlsx"
|
|
164
|
+
},
|
|
165
|
+
[TemplateTypeEnum.TEMPLATE2]: {
|
|
166
|
+
type: ExportTypeEnum.excel,
|
|
167
|
+
tabs: [
|
|
168
|
+
{ label: "覆盖导入数据", key: "cover" },
|
|
169
|
+
{ label: "增量导入数据", key: "increment" }
|
|
170
|
+
],
|
|
171
|
+
showBrand: false,
|
|
172
|
+
showImageRatio: false,
|
|
173
|
+
showMonth: false,
|
|
174
|
+
showDateRange: false,
|
|
175
|
+
uploadTitle: "导入菜品图片文件",
|
|
176
|
+
uploadLinkText: "点击导入",
|
|
177
|
+
uploadHint: "文件仅支持扩展名:.rar .zip .jpg .png .jpeg",
|
|
178
|
+
acceptTypes: ".rar,.zip,.jpg,.png,.jpeg",
|
|
179
|
+
tips: [
|
|
180
|
+
"图片名称需要与菜品名称一致",
|
|
181
|
+
"上传文件仅支持ZIP、RAR压缩包文件(暂不支持win11自带工具压缩的文件),文件大小不超过100M",
|
|
182
|
+
"图片支持jpg、png、jpeg格式,单张大小不超过2M"
|
|
183
|
+
],
|
|
184
|
+
templateUrl: "/template/template2.xlsx"
|
|
185
|
+
},
|
|
186
|
+
[TemplateTypeEnum.TEMPLATE3]: {
|
|
187
|
+
type: ExportTypeEnum.excel,
|
|
188
|
+
tabs: [],
|
|
189
|
+
showBrand: false,
|
|
190
|
+
showImageRatio: false,
|
|
191
|
+
showMonth: true,
|
|
192
|
+
showDateRange: false,
|
|
193
|
+
uploadTitle: "上传营业目标文件",
|
|
194
|
+
uploadLinkText: "点击上传",
|
|
195
|
+
uploadHint: "文件仅支持扩展名:.xls,.xlsx",
|
|
196
|
+
acceptTypes: ".xls,.xlsx",
|
|
197
|
+
tips: [
|
|
198
|
+
"日目标金额最多支持两位小数,单位是元",
|
|
199
|
+
"导入文件严格按照下载的模版格式进行数据填入",
|
|
200
|
+
"导入采用直接覆盖的方式且直接保存成功,不可逆",
|
|
201
|
+
"每次仅支持多个门店一个月的目标导入"
|
|
202
|
+
],
|
|
203
|
+
templateUrl: "/template/template3.xlsx"
|
|
204
|
+
},
|
|
205
|
+
[TemplateTypeEnum.TEMPLATE4]: {
|
|
206
|
+
type: ExportTypeEnum.excel,
|
|
207
|
+
tabs: [],
|
|
208
|
+
showBrand: true,
|
|
209
|
+
showImageRatio: false,
|
|
210
|
+
showMonth: false,
|
|
211
|
+
showDateRange: false,
|
|
212
|
+
uploadTitle: "导入菜谱方案文件",
|
|
213
|
+
uploadLinkText: "点击导入",
|
|
214
|
+
uploadHint: "文件仅支持扩展名:.xls,.xlsx",
|
|
215
|
+
acceptTypes: ".xls,.xlsx",
|
|
216
|
+
tips: [
|
|
217
|
+
"最多支持导入五个菜谱方案",
|
|
218
|
+
"菜品以代码为唯一标识进行集团菜品的匹配,请仔细核对菜品代码",
|
|
219
|
+
"模版支持导入名称、线上可点分类、价格和自定义分类,其余菜品的属性获取集团菜品库"
|
|
220
|
+
],
|
|
221
|
+
templateUrl: "/template/template4.xlsx"
|
|
222
|
+
},
|
|
223
|
+
[TemplateTypeEnum.TEMPLATE5]: {
|
|
224
|
+
type: ExportTypeEnum.excel,
|
|
225
|
+
tabs: [
|
|
226
|
+
{ label: "合批修改入库价格", key: "inPrice" },
|
|
227
|
+
{ label: "合批修改出库价格", key: "outPrice" }
|
|
228
|
+
],
|
|
229
|
+
showBrand: false,
|
|
230
|
+
showImageRatio: false,
|
|
231
|
+
showMonth: false,
|
|
232
|
+
showDateRange: true,
|
|
233
|
+
uploadTitle: "导入菜谱方案文件",
|
|
234
|
+
uploadLinkText: "点击导入",
|
|
235
|
+
uploadHint: "文件仅支持扩展名:.xls,.xlsx",
|
|
236
|
+
acceptTypes: ".xls,.xlsx",
|
|
237
|
+
tips: [],
|
|
238
|
+
templateUrl: "/template/template5.xlsx"
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
const types = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
242
|
+
__proto__: null,
|
|
243
|
+
DEFAULT_IMAGE_RATIOS,
|
|
244
|
+
DEFAULT_TEMPLATE_CONFIGS,
|
|
245
|
+
getImageRatioOptions,
|
|
246
|
+
getTranslatedTemplateConfigs
|
|
247
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
248
|
+
function getImportDialogStyles() {
|
|
249
|
+
return `
|
|
250
|
+
/* iconfont 字体内联定义 */
|
|
251
|
+
@font-face {
|
|
252
|
+
font-family: "iconfont";
|
|
253
|
+
src: url('data:font/woff2;charset=utf-8;base64,d09GMgABAAAAAASEAAsAAAAACawAAAQ2AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDZAqFXIRmATYCJAMgCxIABCAFhGcHYxthCMgOJQUSwWAgIkBBPPz/fv32ufc+GeEvs4ZaFc9/kVSTJvGZhljJVLwEQqPimTz/p1O/rACBShRCFpzks1m+Aspu2V5LNAWUvk4IOKxN/v/9Zsbrp1HtNrQ3s/cxt8R5iUonJEKCiUlaijvrOyu5TgF2toQ/gR8R6NquiOZwVUMHBFxjiQliuFFXg6A9rmGJBS/OoRSwQ2uuq15YUryFivRMcw9vnO+Pf3ZGS1Jl6qOOXK0U4NJP+LmRHkwPyN8Nu5vCwQkVMjZPzBWD4sB9tFfYjNbN+lyxDPS1kvIzfoz/mPqx7sfG6RE/RagbdGop9I1p/+JRhCyp1BqiBlOfYlwuNvxkCCn8DCMHjcMmA03BJgGtg00FtAE2NdBGDGhAa10wDozhG7FEJXdTuSQEqdSyZXw8ONT4s/6dTjsz49c/Je06PnEgTEA79o8fiyiiotkHwvbd4fwNXJOOCFHa5VCdrDNipyNSEk3bpCs1Zg8Tthe7nGoyfzK8kDoeZR08yeeS8wnlPnzqegxl8KjDlpvymJw9RaJ907HWjq72HsrHhBE9Neh8rhGu7peEo+sF4ex4hsNRVfGdhh0XXechDc45L1Cd9iOnnGeOUl3ftEgZHXtnUT3vX+R44b3H2ZF3y0EzHEtyRs54vqcJt/onAWx+333p0hYP7dVrW6ODY7aq6olbY4KjIfyJ7+2nsVtv37l509YHu7YPHyI3+PRlDHYdUPbtez9vct79Ez19fWg80/JeBM3tJNvj/XHO/XnqSBcFo4vrl88Hw9Ri2ecpnlLbAc+Wb3TdWL787ke16+6WzZ2dKrwzZUFVBpc0LWloMJxxbEuWePgzia0dqYqxGBcW4mLjlC63rbgwjJ+iTiu6GFOZVRkDsYezKmK3X9z81yWJUuSs4KpgUABGt/NFOguMDmfI52WukiPykPs8H6cXce1phLbr/1g2OgIlNb/IXd/X73h9iskdDiz43/YK+PGhZrcTHykFulF9H0hl1dcUOl38T/wcJUlbstTG4opAA4foCh0M1Ujoakt8QpFJH7okpyq3ElpTASSNJchaKymFsREqPTuh1toDXZtUXt4zxYIWpYO1NhAQxk1AMuYrZONuUgrjJVRm/YTauP/QdTT8b9azNi6Vy4glSGC4lQzmzSZRNxNn0zYkLTWwclq2C8k2jDSTmpQSL1cjE5LbOMW2TEojRGRE2WxkqpjHIYPBzFhksw7xJElLiCUvOVnM+pIk3myEcjKERSACBmclBsYzMxEtPIn+vDaIZCkDllyR0lWQ2WBszkiVJKUCpdpkqjR3IrttlpGkIQiROkwkMzNiVCk+xKAVzBiW7P10EB6RRNsgZ5EnmcSJVU1Jw5PG07wGXeq920iRo0QVdTTRRkd1S0bL0qz6dLcbaAVxN+2p3ntyp2GCLTaPFZhdxWJ3gm1aDAAAAA==') format('woff2');
|
|
254
|
+
}
|
|
255
|
+
.iconfont {
|
|
256
|
+
font-family: "iconfont" !important;
|
|
257
|
+
font-size: 16px;
|
|
258
|
+
font-style: normal;
|
|
259
|
+
-webkit-font-smoothing: antialiased;
|
|
260
|
+
-moz-osx-font-smoothing: grayscale;
|
|
261
|
+
}
|
|
262
|
+
.icon-prev2:before { content: "\\e601"; }
|
|
263
|
+
.icon-prev3:before { content: "\\e613"; }
|
|
264
|
+
.icon-next:before { content: "\\e610"; }
|
|
265
|
+
.icon-next1:before { content: "\\e600"; }
|
|
266
|
+
.icon-icon_tips:before { content: "\\e627"; }
|
|
267
|
+
.icon-xiazai:before { content: "\\e629"; }
|
|
268
|
+
.icon-tishi:before { content: "\\e62a"; }
|
|
269
|
+
|
|
270
|
+
.import-dialog-vanilla-wrapper {
|
|
271
|
+
position: fixed;
|
|
272
|
+
top: 0;
|
|
273
|
+
left: 0;
|
|
274
|
+
right: 0;
|
|
275
|
+
bottom: 0;
|
|
276
|
+
z-index: 1000;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.import-dialog-vanilla-overlay {
|
|
280
|
+
position: fixed;
|
|
281
|
+
top: 0;
|
|
282
|
+
left: 0;
|
|
283
|
+
right: 0;
|
|
284
|
+
bottom: 0;
|
|
285
|
+
background: var(--sl-overlay-color-lighter);
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: flex-start;
|
|
288
|
+
justify-content: center;
|
|
289
|
+
padding-top: 100px;
|
|
290
|
+
overflow: auto;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.import-dialog-vanilla-modal {
|
|
294
|
+
padding: 20px 16px;
|
|
295
|
+
position: relative;
|
|
296
|
+
background-color: var(--sl-color-white);
|
|
297
|
+
background-clip: padding-box;
|
|
298
|
+
border: 0;
|
|
299
|
+
border-radius: 4px;
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
box-shadow: var(--sl-box-shadow);
|
|
303
|
+
pointer-events: auto;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.import-dialog-vanilla-header {
|
|
307
|
+
display: flex;
|
|
308
|
+
justify-content: space-between;
|
|
309
|
+
align-items: center;
|
|
310
|
+
border-radius: 8px 8px 0 0;
|
|
311
|
+
border-bottom: none;
|
|
312
|
+
margin-bottom: 16px;
|
|
313
|
+
font-size: 16px;
|
|
314
|
+
font-weight: 500;
|
|
315
|
+
padding: 0px;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.import-dialog-vanilla-title {
|
|
319
|
+
font-size: 16px;
|
|
320
|
+
font-weight: 500;
|
|
321
|
+
color: var(--sl-text-color);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.import-dialog-vanilla-close {
|
|
325
|
+
font-size: 20px;
|
|
326
|
+
color: var(--sl-text-color-thridary);
|
|
327
|
+
cursor: pointer;
|
|
328
|
+
line-height: 1;
|
|
329
|
+
padding: 4px;
|
|
330
|
+
transition: color 0.3s;
|
|
331
|
+
font-weight:300;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
.import-dialog-vanilla-tabs {
|
|
337
|
+
display: flex;
|
|
338
|
+
margin-bottom: 8px;
|
|
339
|
+
gap: 4px;
|
|
340
|
+
border-bottom: 1px solid var(--sl-border-color);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.import-dialog-vanilla-tab {
|
|
344
|
+
padding: 0 16px;
|
|
345
|
+
height: 32px;
|
|
346
|
+
display: flex;
|
|
347
|
+
align-items: center;
|
|
348
|
+
cursor: pointer;
|
|
349
|
+
background: var(--slm-card-bg-color4);
|
|
350
|
+
color: var(--sl-text-color-secondary);
|
|
351
|
+
font-size: 14px;
|
|
352
|
+
border-radius: 4px 4px 0 0;
|
|
353
|
+
border: 1px solid var(--sl-border-color);
|
|
354
|
+
border-bottom: none;
|
|
355
|
+
transition: all 0.3s;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.import-dialog-vanilla-tab:hover {
|
|
359
|
+
color: var(--sl-color-primary);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.import-dialog-vanilla-tab.active {
|
|
363
|
+
background: var(--sl-color-primary);
|
|
364
|
+
border-color: var(--sl-color-primary);
|
|
365
|
+
color: var(--sl-color-white);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.import-dialog-vanilla-section {
|
|
369
|
+
background: var(--slm-card-bg-color4);
|
|
370
|
+
border-radius: 8px;
|
|
371
|
+
padding: 8px 12px;
|
|
372
|
+
margin-bottom: 8px;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.import-dialog-vanilla-section-title {
|
|
376
|
+
font-size: 14px;
|
|
377
|
+
font-weight: 500;
|
|
378
|
+
color: var(--sl-text-color);
|
|
379
|
+
margin-bottom: 8px;
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.import-dialog-vanilla-tips-icon {
|
|
385
|
+
width: 18px;
|
|
386
|
+
height: 18px;
|
|
387
|
+
background: #ECECEC;
|
|
388
|
+
border-radius: 50%;
|
|
389
|
+
display: flex;
|
|
390
|
+
align-items: center;
|
|
391
|
+
justify-content: center;
|
|
392
|
+
}
|
|
393
|
+
.import-dialog-vanilla-tips-icon>i {
|
|
394
|
+
font-size: 12px;
|
|
395
|
+
font-weight:600;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.import-dialog-vanilla-tips-title {
|
|
399
|
+
font-size: 16px;
|
|
400
|
+
margin-left:12px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.import-dialog-vanilla-tips-content {
|
|
404
|
+
padding-left: 30px;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.import-dialog-vanilla-tip-item {
|
|
408
|
+
font-size: 14px;
|
|
409
|
+
color: var(--sl-text-color-secondary);
|
|
410
|
+
margin: 4px 0;
|
|
411
|
+
line-height: 1.4;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.import-dialog-vanilla-btn {
|
|
415
|
+
display: inline-flex;
|
|
416
|
+
align-items: center;
|
|
417
|
+
justify-content: center;
|
|
418
|
+
gap: 6px;
|
|
419
|
+
padding: 4px 16px;
|
|
420
|
+
height: 32px;
|
|
421
|
+
font-size: 14px;
|
|
422
|
+
border-radius: 4px;
|
|
423
|
+
border: 1px solid var(--sl-border-color);
|
|
424
|
+
background: var(--sl-color-white);
|
|
425
|
+
color: var(--sl-text-color-regular);
|
|
426
|
+
cursor: pointer;
|
|
427
|
+
transition: all 0.3s;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.import-dialog-vanilla-btn:hover {
|
|
431
|
+
border-color: var(--sl-color-primary);
|
|
432
|
+
color: var(--sl-color-primary);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.import-dialog-vanilla-btn:disabled {
|
|
436
|
+
opacity: 0.6;
|
|
437
|
+
cursor: not-allowed;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.import-dialog-vanilla-btn-primary {
|
|
441
|
+
background: var(--sl-color-primary);
|
|
442
|
+
border-color: var(--sl-color-primary);
|
|
443
|
+
color: var(--sl-color-white);
|
|
444
|
+
text-decoration: none;
|
|
445
|
+
}
|
|
446
|
+
.download-template-btn {
|
|
447
|
+
font-weight:500;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.import-dialog-vanilla-btn-primary:hover {
|
|
451
|
+
background: var(--slm-primary-color-hover);
|
|
452
|
+
border-color: var(--slm-primary-color-hover);
|
|
453
|
+
color: var(--sl-color-white);
|
|
454
|
+
text-decoration: none;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
.import-dialog-vanilla-icon {
|
|
459
|
+
font-size: 14px;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.import-dialog-vanilla-setting-content {
|
|
463
|
+
display: flex;
|
|
464
|
+
flex-direction: column;
|
|
465
|
+
gap: 12px;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.import-dialog-vanilla-setting-item {
|
|
469
|
+
display: flex;
|
|
470
|
+
align-items: center;
|
|
471
|
+
justify-content: space-between;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.import-dialog-vanilla-setting-label {
|
|
475
|
+
min-width: 100px;
|
|
476
|
+
color: var(--sl-text-color-primary);
|
|
477
|
+
font-size: 14px;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.import-dialog-vanilla-setting-label.required::before {
|
|
481
|
+
content: "*";
|
|
482
|
+
color: var(--sl-color-error);
|
|
483
|
+
margin-right: 4px;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.import-dialog-vanilla-select {
|
|
487
|
+
width: 200px;
|
|
488
|
+
height: 28px;
|
|
489
|
+
padding: 0 8px;
|
|
490
|
+
font-size: 14px;
|
|
491
|
+
border: 1px solid var(--sl-border-color);
|
|
492
|
+
border-radius: 4px;
|
|
493
|
+
background: var(--sl-color-white);
|
|
494
|
+
outline: none;
|
|
495
|
+
cursor: pointer;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.import-dialog-vanilla-select:focus {
|
|
499
|
+
border-color: var(--sl-color-primary);
|
|
500
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/* Custom Select Component Styles */
|
|
504
|
+
.import-dialog-vanilla-custom-select {
|
|
505
|
+
position: relative;
|
|
506
|
+
width: 200px;
|
|
507
|
+
height: 28px;
|
|
508
|
+
font-size: 14px;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.import-dialog-vanilla-select-trigger {
|
|
512
|
+
width: 100%;
|
|
513
|
+
height: 100%;
|
|
514
|
+
padding: 0 8px;
|
|
515
|
+
border: 1px solid var(--sl-border-color);
|
|
516
|
+
border-radius: 4px;
|
|
517
|
+
background: var(--sl-color-white);
|
|
518
|
+
cursor: pointer;
|
|
519
|
+
display: flex;
|
|
520
|
+
align-items: center;
|
|
521
|
+
justify-content: space-between;
|
|
522
|
+
transition: all 0.3s;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.import-dialog-vanilla-select-trigger:hover {
|
|
526
|
+
border-color: var(--sl-color-primary);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.import-dialog-vanilla-select-trigger.active {
|
|
530
|
+
border-color: var(--sl-color-primary);
|
|
531
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.import-dialog-vanilla-select-trigger.disabled {
|
|
535
|
+
background: #f5f5f5;
|
|
536
|
+
cursor: not-allowed;
|
|
537
|
+
opacity: 0.6;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.import-dialog-vanilla-select-value {
|
|
541
|
+
flex: 1;
|
|
542
|
+
overflow: hidden;
|
|
543
|
+
text-overflow: ellipsis;
|
|
544
|
+
white-space: nowrap;
|
|
545
|
+
color: var(--sl-text-color-primary);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.import-dialog-vanilla-select-placeholder {
|
|
549
|
+
color: var(--sl-text-color-placeholder);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.import-dialog-vanilla-select-arrow {
|
|
553
|
+
width: 0;
|
|
554
|
+
height: 0;
|
|
555
|
+
border-left: 4px solid transparent;
|
|
556
|
+
border-right: 4px solid transparent;
|
|
557
|
+
border-top: 4px solid var(--sl-text-color-placeholder);
|
|
558
|
+
transition: transform 0.3s;
|
|
559
|
+
margin-left: 8px;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.import-dialog-vanilla-select-trigger.active .import-dialog-vanilla-select-arrow {
|
|
563
|
+
transform: rotate(180deg);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.import-dialog-vanilla-select-dropdown {
|
|
567
|
+
position: absolute;
|
|
568
|
+
top: 100%;
|
|
569
|
+
left: 0;
|
|
570
|
+
right: 0;
|
|
571
|
+
z-index: 1000;
|
|
572
|
+
margin-top: 4px;
|
|
573
|
+
background: var(--sl-color-white);
|
|
574
|
+
border-radius: 4px;
|
|
575
|
+
box-shadow: var(--sl-box-shadow-light);
|
|
576
|
+
max-height: 200px;
|
|
577
|
+
overflow-y: auto;
|
|
578
|
+
opacity: 0;
|
|
579
|
+
transform: translateY(-10px);
|
|
580
|
+
transition: all 0.3s;
|
|
581
|
+
pointer-events: none;
|
|
582
|
+
padding: 4px 0;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.import-dialog-vanilla-select-dropdown.show {
|
|
586
|
+
opacity: 1;
|
|
587
|
+
transform: translateY(0);
|
|
588
|
+
pointer-events: auto;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.import-dialog-vanilla-select-option {
|
|
592
|
+
padding: 0px 8px;
|
|
593
|
+
cursor: pointer;
|
|
594
|
+
transition: background-color 0.3s;
|
|
595
|
+
color: var(--sl-text-color-primary);
|
|
596
|
+
font-size: 14px;
|
|
597
|
+
height: 34px;
|
|
598
|
+
margin: 0px 4px;
|
|
599
|
+
border-radius: 8px;
|
|
600
|
+
line-height: 34px;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.import-dialog-vanilla-select-option:hover {
|
|
604
|
+
background: var(--sl-fill-color-light);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.import-dialog-vanilla-select-option.selected {
|
|
608
|
+
background: var(--sl-color-primary-light-9);
|
|
609
|
+
color: var(--sl-color-primary);
|
|
610
|
+
font-weight: 500;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.import-dialog-vanilla-radio-group {
|
|
614
|
+
display: flex;
|
|
615
|
+
gap: 20px;
|
|
616
|
+
flex-wrap: wrap;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.import-dialog-vanilla-radio {
|
|
620
|
+
display: flex;
|
|
621
|
+
align-items: center;
|
|
622
|
+
gap: 8px;
|
|
623
|
+
cursor: pointer;
|
|
624
|
+
font-size: 14px;
|
|
625
|
+
color: var(--sl-text-color-secondary);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.import-dialog-vanilla-radio input[type="radio"] {
|
|
629
|
+
appearance: none;
|
|
630
|
+
width: 16px;
|
|
631
|
+
height: 16px;
|
|
632
|
+
border-radius: 50%;
|
|
633
|
+
border: 2px solid var(--sl-text-color-four);
|
|
634
|
+
position: relative;
|
|
635
|
+
outline: none;
|
|
636
|
+
cursor: pointer;
|
|
637
|
+
margin: 0;
|
|
638
|
+
}
|
|
639
|
+
.import-dialog-vanilla-radio input[type="radio"]:hover {
|
|
640
|
+
border-color: var(--sl-color-primary);
|
|
641
|
+
}
|
|
642
|
+
.import-dialog-vanilla-radio input[type="radio"]:checked {
|
|
643
|
+
border-color: var(--sl-color-primary);
|
|
644
|
+
border-width: 5px;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.import-dialog-vanilla-radio input[type="radio"]:checked::before {
|
|
648
|
+
content: '';
|
|
649
|
+
width: 6px;
|
|
650
|
+
height: 6px;
|
|
651
|
+
border-radius: 50%;
|
|
652
|
+
position: absolute;
|
|
653
|
+
top: 50%;
|
|
654
|
+
left: 50%;
|
|
655
|
+
transform: translate(-50%, -50%);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.import-dialog-vanilla-radio span {
|
|
659
|
+
color: var(--sl-text-color-primary);
|
|
660
|
+
font-size: 14px;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.import-dialog-vanilla-date-range {
|
|
664
|
+
display: flex;
|
|
665
|
+
align-items: center;
|
|
666
|
+
gap: 8px;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.import-dialog-vanilla-date-input {
|
|
670
|
+
width: 150px;
|
|
671
|
+
height: 28px;
|
|
672
|
+
padding: 0 8px;
|
|
673
|
+
font-size: 14px;
|
|
674
|
+
border: 1px solid var(--sl-border-color);
|
|
675
|
+
border-radius: 4px;
|
|
676
|
+
outline: none;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.import-dialog-vanilla-date-input:focus {
|
|
680
|
+
border-color: var(--sl-color-primary);
|
|
681
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.import-dialog-vanilla-date-separator {
|
|
685
|
+
color: #999;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/* 上传区域包装器 - 文件列表和上传区域横向排列 */
|
|
689
|
+
.import-dialog-vanilla-upload-wrapper {
|
|
690
|
+
display: flex;
|
|
691
|
+
flex-direction: column;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.import-dialog-vanilla-upload-area {
|
|
695
|
+
min-height: 176px;
|
|
696
|
+
cursor: pointer;
|
|
697
|
+
transition: all 0.3s;
|
|
698
|
+
display: flex;
|
|
699
|
+
align-items: center;
|
|
700
|
+
justify-content: center;
|
|
701
|
+
position: relative;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.import-dialog-vanilla-upload-area:hover {
|
|
705
|
+
border-color: var(--sl-color-primary);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.import-dialog-vanilla-upload-area.dragover {
|
|
709
|
+
border-color: var(--sl-color-primary);
|
|
710
|
+
background: rgba(24, 144, 255, 0.05);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.import-dialog-vanilla-upload-area.disabled {
|
|
714
|
+
cursor: not-allowed;
|
|
715
|
+
opacity: 0.6;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.import-dialog-vanilla-file-input {
|
|
719
|
+
position: absolute;
|
|
720
|
+
width: 0;
|
|
721
|
+
height: 0;
|
|
722
|
+
opacity: 0;
|
|
723
|
+
pointer-events: none;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.import-dialog-vanilla-upload-content {
|
|
727
|
+
text-align: center;
|
|
728
|
+
padding: 20px;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.import-dialog-vanilla-upload-icon {
|
|
732
|
+
// font-size: 48px;
|
|
733
|
+
width:88px;
|
|
734
|
+
height:74px;
|
|
735
|
+
object-fit: contain;
|
|
736
|
+
margin-bottom: 16px;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.import-dialog-vanilla-upload-text {
|
|
740
|
+
color: var(--sl-text-color-secondary);
|
|
741
|
+
font-size: 14px;
|
|
742
|
+
margin-bottom: 8px;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.import-dialog-vanilla-upload-link {
|
|
746
|
+
color: var(--sl-color-primary);
|
|
747
|
+
cursor: pointer;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.import-dialog-vanilla-upload-link:hover {
|
|
751
|
+
text-decoration: underline;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.import-dialog-vanilla-upload-hint {
|
|
755
|
+
color: var(--sl-text-color-secondary);
|
|
756
|
+
font-size: 12px;
|
|
757
|
+
margin: 0;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.import-dialog-vanilla-file-info {
|
|
761
|
+
display: flex;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.import-dialog-vanilla-file-name {
|
|
765
|
+
flex: 1;
|
|
766
|
+
font-size: 14px;
|
|
767
|
+
color: var(--sl-text-color-primary);
|
|
768
|
+
overflow: hidden;
|
|
769
|
+
text-overflow: ellipsis;
|
|
770
|
+
white-space: nowrap;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.import-dialog-vanilla-file-remove {
|
|
774
|
+
font-size: 18px;
|
|
775
|
+
color: #999;
|
|
776
|
+
cursor: pointer;
|
|
777
|
+
line-height: 1;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.import-dialog-vanilla-file-remove:hover {
|
|
781
|
+
color: #ff4d4f;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
.import-dialog-vanilla-upload-progress {
|
|
785
|
+
margin-top: 12px;
|
|
786
|
+
padding: 8px 0;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.import-dialog-vanilla-progress-bar {
|
|
790
|
+
height: 8px;
|
|
791
|
+
background: #f0f0f0;
|
|
792
|
+
border-radius: 4px;
|
|
793
|
+
overflow: hidden;
|
|
794
|
+
margin-bottom: 8px;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.import-dialog-vanilla-progress-inner {
|
|
798
|
+
height: 100%;
|
|
799
|
+
border-radius: 4px;
|
|
800
|
+
transition: width 0.3s;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.import-dialog-vanilla-progress-inner.active {
|
|
804
|
+
background: var(--sl-color-primary);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.import-dialog-vanilla-progress-inner.success {
|
|
808
|
+
background: #52c41a;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.import-dialog-vanilla-progress-inner.error {
|
|
812
|
+
background: #ff4d4f;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.import-dialog-vanilla-progress-text {
|
|
816
|
+
font-size: 12px;
|
|
817
|
+
color: var(--sl-text-color-secondary);
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
.import-dialog-vanilla-upload-message {
|
|
821
|
+
font-size: 14px;
|
|
822
|
+
padding: 6px 12px;
|
|
823
|
+
border-radius: 4px;
|
|
824
|
+
margin-top: 8px;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.import-dialog-vanilla-upload-message.info {
|
|
828
|
+
color: var(--sl-color-primary);
|
|
829
|
+
background: rgba(24, 144, 255, 0.1);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.import-dialog-vanilla-upload-message.success {
|
|
833
|
+
color: #52c41a;
|
|
834
|
+
background: rgba(82, 196, 26, 0.1);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
.import-dialog-vanilla-upload-message.error {
|
|
838
|
+
color: #ff4d4f;
|
|
839
|
+
background: rgba(255, 77, 79, 0.1);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.import-dialog-vanilla-footer {
|
|
843
|
+
display: flex;
|
|
844
|
+
justify-content: flex-end;
|
|
845
|
+
gap: 12px;
|
|
846
|
+
padding-top: 8px;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.import-dialog-vanilla-toast {
|
|
850
|
+
position: fixed;
|
|
851
|
+
top: 16px;
|
|
852
|
+
left: 50%;
|
|
853
|
+
transform: translateX(-50%);
|
|
854
|
+
padding: 0;
|
|
855
|
+
border-radius: 4px;
|
|
856
|
+
font-size: 14px;
|
|
857
|
+
z-index: 1100;
|
|
858
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
859
|
+
animation: import-dialog-toast-in 0.3s ease;
|
|
860
|
+
display: flex;
|
|
861
|
+
align-items: center;
|
|
862
|
+
padding: 8px 15px;
|
|
863
|
+
box-sizing: content-box;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.import-dialog-vanilla-toast-content {
|
|
867
|
+
display: flex;
|
|
868
|
+
align-items: center;
|
|
869
|
+
flex: 1;
|
|
870
|
+
gap:8px;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.import-dialog-vanilla-toast-icon {
|
|
874
|
+
font-size: 16px;
|
|
875
|
+
flex-shrink: 0;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.import-dialog-vanilla-toast-message {
|
|
879
|
+
flex: 1;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
.import-dialog-vanilla-toast-close {
|
|
883
|
+
background: none;
|
|
884
|
+
border: none;
|
|
885
|
+
padding: 11px 15px;
|
|
886
|
+
cursor: pointer;
|
|
887
|
+
display: flex;
|
|
888
|
+
align-items: center;
|
|
889
|
+
color: inherit;
|
|
890
|
+
opacity: 0.6;
|
|
891
|
+
transition: opacity 0.2s;
|
|
892
|
+
flex-shrink: 0;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.import-dialog-vanilla-toast-close:hover {
|
|
896
|
+
opacity: 1;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.import-dialog-vanilla-toast-close i {
|
|
900
|
+
font-size: 14px;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.import-dialog-vanilla-toast.info {
|
|
904
|
+
background-color: var(--sl-color-primary-light-9);
|
|
905
|
+
color: var(--sl-color-primary);
|
|
906
|
+
border: 1px solid var(--sl-color-primary-light-8);
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
.import-dialog-vanilla-toast.success {
|
|
910
|
+
background-color: var(--sl-color-success-light-9);
|
|
911
|
+
color: var(--sl-color-success);
|
|
912
|
+
border: 1px solid var(--sl-color-success-light-8);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.import-dialog-vanilla-toast.warning {
|
|
916
|
+
background-color: var(--sl-color-warning-light-9);
|
|
917
|
+
color: var(--sl-color-warning);
|
|
918
|
+
border: 1px solid var(--sl-color-warning-light-8);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
.import-dialog-vanilla-toast.error {
|
|
922
|
+
background-color: var(--sl-color-error-light-9);
|
|
923
|
+
color: var(--sl-color-error);
|
|
924
|
+
border: 1px solid var(--sl-color-error-light-8);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.import-dialog-vanilla-toast.fade-out {
|
|
928
|
+
animation: import-dialog-toast-out 0.3s ease forwards;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
@keyframes import-dialog-toast-in {
|
|
932
|
+
from {
|
|
933
|
+
opacity: 0;
|
|
934
|
+
transform: translateX(-50%) translateY(-20px);
|
|
935
|
+
}
|
|
936
|
+
to {
|
|
937
|
+
opacity: 1;
|
|
938
|
+
transform: translateX(-50%) translateY(0);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
@keyframes import-dialog-toast-out {
|
|
943
|
+
from {
|
|
944
|
+
opacity: 1;
|
|
945
|
+
transform: translateX(-50%) translateY(0);
|
|
946
|
+
}
|
|
947
|
+
to {
|
|
948
|
+
opacity: 0;
|
|
949
|
+
transform: translateX(-50%) translateY(-20px);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
/* DateRangePicker */
|
|
954
|
+
.sl-date-range-picker {
|
|
955
|
+
position: relative;
|
|
956
|
+
display: inline-flex;
|
|
957
|
+
align-items: center;
|
|
958
|
+
border: 1px solid var(--sl-border-color);
|
|
959
|
+
border-radius: 4px;
|
|
960
|
+
background: var(--sl-color-white);
|
|
961
|
+
height: 28px;
|
|
962
|
+
padding: 0 8px;
|
|
963
|
+
gap: 6px;
|
|
964
|
+
cursor: pointer;
|
|
965
|
+
transition: border-color 0.3s;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.sl-date-range-picker:hover {
|
|
969
|
+
border-color: var(--sl-color-primary);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.sl-date-range-picker:focus-within {
|
|
973
|
+
border-color: var(--sl-color-primary);
|
|
974
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.sl-date-range-input {
|
|
978
|
+
border: none;
|
|
979
|
+
outline: none;
|
|
980
|
+
background: transparent;
|
|
981
|
+
font-size: 13px;
|
|
982
|
+
color: var(--sl-text-color-primary);
|
|
983
|
+
width: 80px;
|
|
984
|
+
text-align: center;
|
|
985
|
+
cursor: pointer;
|
|
986
|
+
padding: 0;
|
|
987
|
+
height: 100%;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.sl-date-range-input::placeholder {
|
|
991
|
+
color: var(--sl-text-color-placeholder);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
.sl-date-range-separator {
|
|
995
|
+
color: var(--sl-text-color);
|
|
996
|
+
font-size: 13px;
|
|
997
|
+
flex-shrink: 0;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.sl-date-range-icon {
|
|
1001
|
+
display: flex;
|
|
1002
|
+
align-items: center;
|
|
1003
|
+
color: var(--sl-text-color-placeholder);
|
|
1004
|
+
flex-shrink: 0;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/* 日期范围选择器日历样式覆盖 */
|
|
1008
|
+
.sl-date-range-calendar {
|
|
1009
|
+
border: 1px solid var(--sl-border-color-light);
|
|
1010
|
+
box-shadow: var(--sl-box-shadow-light);
|
|
1011
|
+
border-radius: 8px;
|
|
1012
|
+
z-index: 1100 !important;
|
|
1013
|
+
padding: 0 !important;
|
|
1014
|
+
overflow: visible !important;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/* 隐藏 flatpickr 自带的箭头 */
|
|
1018
|
+
.sl-date-range-calendar::before,
|
|
1019
|
+
.sl-date-range-calendar::after {
|
|
1020
|
+
display: none !important;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/* 自定义箭头元素 — 基础样式 */
|
|
1024
|
+
.sl-calendar-arrow {
|
|
1025
|
+
position: absolute;
|
|
1026
|
+
transform: translateX(-50%);
|
|
1027
|
+
width: 0;
|
|
1028
|
+
height: 0;
|
|
1029
|
+
border-left: 8px solid transparent;
|
|
1030
|
+
border-right: 8px solid transparent;
|
|
1031
|
+
z-index: 1;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/* 箭头朝上(日历在输入框下方) */
|
|
1035
|
+
.sl-calendar-arrow-top {
|
|
1036
|
+
top: -8px;
|
|
1037
|
+
border-bottom: 8px solid #e4e7ed;
|
|
1038
|
+
}
|
|
1039
|
+
.sl-calendar-arrow-top::after {
|
|
1040
|
+
content: "";
|
|
1041
|
+
position: absolute;
|
|
1042
|
+
top: 1px;
|
|
1043
|
+
left: -8px;
|
|
1044
|
+
border-left: 8px solid transparent;
|
|
1045
|
+
border-right: 8px solid transparent;
|
|
1046
|
+
border-bottom: 8px solid #fff;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
/* 箭头朝下(日历在输入框上方) */
|
|
1050
|
+
.sl-calendar-arrow-bottom {
|
|
1051
|
+
bottom: -8px;
|
|
1052
|
+
border-top: 8px solid #e4e7ed;
|
|
1053
|
+
}
|
|
1054
|
+
.sl-calendar-arrow-bottom::after {
|
|
1055
|
+
content: "";
|
|
1056
|
+
position: absolute;
|
|
1057
|
+
bottom: 1px;
|
|
1058
|
+
left: -8px;
|
|
1059
|
+
border-left: 8px solid transparent;
|
|
1060
|
+
border-right: 8px solid transparent;
|
|
1061
|
+
border-top: 8px solid #fff;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
/* 日历整体固定宽度 */
|
|
1065
|
+
.sl-date-range-calendar {
|
|
1066
|
+
width: 646px !important;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
.sl-date-range-calendar.has-shortcuts {
|
|
1070
|
+
display: flex !important;
|
|
1071
|
+
flex-direction: row !important;
|
|
1072
|
+
width: 756px !important; /* 646 + 110 快捷方式面板 */
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
.sl-date-range-calendar-content {
|
|
1076
|
+
width: 646px;
|
|
1077
|
+
flex-shrink: 0;
|
|
1078
|
+
padding: 12px;
|
|
1079
|
+
box-sizing: border-box;
|
|
1080
|
+
position: relative;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/* 两个月份之间的连续分割线 */
|
|
1084
|
+
.sl-date-range-calendar-content::after {
|
|
1085
|
+
content: '';
|
|
1086
|
+
position: absolute;
|
|
1087
|
+
top: 12px;
|
|
1088
|
+
bottom: 12px;
|
|
1089
|
+
left: 50%;
|
|
1090
|
+
width: 1px;
|
|
1091
|
+
background-color: var(--sl-border-color);
|
|
1092
|
+
// transform: translateX(-50%);
|
|
1093
|
+
pointer-events: none;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
.sl-date-range-calendar-content .flatpickr-months,
|
|
1097
|
+
.sl-date-range-calendar-content .flatpickr-innerContainer {
|
|
1098
|
+
width: 100%;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/* 覆盖 flatpickr 固定宽度,让两个月份并排 */
|
|
1102
|
+
.sl-date-range-calendar .flatpickr-innerContainer {
|
|
1103
|
+
overflow: visible !important;
|
|
1104
|
+
width: 622px !important; /* 311px * 2 */
|
|
1105
|
+
position: relative;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/* 没有快捷方式时的分割线(直接在 innerContainer 上) */
|
|
1109
|
+
.sl-date-range-calendar:not(.has-shortcuts) .flatpickr-innerContainer::after {
|
|
1110
|
+
content: '';
|
|
1111
|
+
position: absolute;
|
|
1112
|
+
top: 0;
|
|
1113
|
+
bottom: 0;
|
|
1114
|
+
left: 50%;
|
|
1115
|
+
width: 1px;
|
|
1116
|
+
background-color: var(--sl-border-color-light);
|
|
1117
|
+
transform: translateX(-50%);
|
|
1118
|
+
pointer-events: none;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
/* 没有快捷方式时月份头部的分割线 */
|
|
1122
|
+
.sl-date-range-calendar:not(.has-shortcuts) .flatpickr-months::after {
|
|
1123
|
+
content: '';
|
|
1124
|
+
position: absolute;
|
|
1125
|
+
top: 0;
|
|
1126
|
+
bottom: 0;
|
|
1127
|
+
left: 50%;
|
|
1128
|
+
width: 1px;
|
|
1129
|
+
background-color: var(--sl-border-color-light);
|
|
1130
|
+
transform: translateX(-50%);
|
|
1131
|
+
pointer-events: none;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
.sl-date-range-calendar .flatpickr-rContainer {
|
|
1135
|
+
width: 622px !important; /* 311px * 2 */
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
.sl-date-range-calendar .flatpickr-days .dayContainer + .dayContainer {
|
|
1139
|
+
box-shadow: none !important;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
/* 快捷方式面板 */
|
|
1143
|
+
.sl-date-range-shortcuts {
|
|
1144
|
+
display: flex;
|
|
1145
|
+
flex-direction: column;
|
|
1146
|
+
padding: 12px 0;
|
|
1147
|
+
border-right: 1px solid var(--sl-border-color);
|
|
1148
|
+
width: 110px;
|
|
1149
|
+
flex-shrink: 0;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
.sl-date-range-shortcut-item {
|
|
1153
|
+
padding: 0px 12px;
|
|
1154
|
+
font-size: 14px;
|
|
1155
|
+
color: var(--sl-text-color-regular);
|
|
1156
|
+
cursor: pointer;
|
|
1157
|
+
white-space: nowrap;
|
|
1158
|
+
transition: color 0.2s;
|
|
1159
|
+
line-height: 28px;
|
|
1160
|
+
text-align: start;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
.sl-date-range-shortcut-item:hover {
|
|
1164
|
+
color: var(--sl-color-primary);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
.sl-date-range-shortcut-item.active {
|
|
1168
|
+
color: var(--sl-color-primary);
|
|
1169
|
+
font-weight: 500;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/* 月份头部区域 */
|
|
1173
|
+
.sl-date-range-calendar .flatpickr-months {
|
|
1174
|
+
padding: 0 4px !important;
|
|
1175
|
+
align-items: center;
|
|
1176
|
+
width: 622px !important; /* 311px * 2 */
|
|
1177
|
+
position: relative !important;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
.sl-date-range-calendar .flatpickr-months .flatpickr-month {
|
|
1181
|
+
height: 30px;
|
|
1182
|
+
display: flex;
|
|
1183
|
+
align-items: center;
|
|
1184
|
+
width: 311px !important;
|
|
1185
|
+
flex: none !important;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
/* 箭头样式 */
|
|
1189
|
+
.sl-date-range-calendar .flatpickr-prev-year,
|
|
1190
|
+
.sl-date-range-calendar .flatpickr-next-year,
|
|
1191
|
+
.sl-date-range-calendar .flatpickr-prev-month,
|
|
1192
|
+
.sl-date-range-calendar .flatpickr-next-month {
|
|
1193
|
+
position: absolute !important;
|
|
1194
|
+
top: 0;
|
|
1195
|
+
height: 34px;
|
|
1196
|
+
padding: 10px;
|
|
1197
|
+
z-index: 3;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
.sl-date-range-calendar .flatpickr-prev-year,
|
|
1201
|
+
.sl-date-range-calendar .flatpickr-prev-month {
|
|
1202
|
+
left: 0;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
.sl-date-range-calendar .flatpickr-next-year,
|
|
1206
|
+
.sl-date-range-calendar .flatpickr-next-month {
|
|
1207
|
+
right: 0;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
.sl-date-range-calendar .flatpickr-current-month {
|
|
1211
|
+
font-size: 14px;
|
|
1212
|
+
font-weight: 500;
|
|
1213
|
+
padding-top: 8px;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
.sl-date-range-calendar .flatpickr-current-month .cur-month {
|
|
1217
|
+
font-weight: 500;
|
|
1218
|
+
font-size: 16px;
|
|
1219
|
+
color:var(--sl-text-color)
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
/* 年份和月份导航箭头 */
|
|
1223
|
+
.sl-date-range-calendar .flatpickr-prev-year,
|
|
1224
|
+
.sl-date-range-calendar .flatpickr-next-year {
|
|
1225
|
+
display: inline-flex;
|
|
1226
|
+
align-items: center;
|
|
1227
|
+
justify-content: center;
|
|
1228
|
+
width: 28px;
|
|
1229
|
+
height: 28px;
|
|
1230
|
+
cursor: pointer;
|
|
1231
|
+
font-size: 16px;
|
|
1232
|
+
user-select: none;
|
|
1233
|
+
transition: color 0.2s;
|
|
1234
|
+
position: relative;
|
|
1235
|
+
top: 0;
|
|
1236
|
+
line-height: 40px;
|
|
1237
|
+
padding: 0;
|
|
1238
|
+
z-index: 1;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
.sl-date-range-calendar .flatpickr-prev-year:hover,
|
|
1242
|
+
.sl-date-range-calendar .flatpickr-next-year:hover {
|
|
1243
|
+
color: var(--sl-color-primary);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
.sl-date-range-calendar .flatpickr-prev-month,
|
|
1247
|
+
.sl-date-range-calendar .flatpickr-next-month {
|
|
1248
|
+
padding: 0 !important;
|
|
1249
|
+
width: 28px;
|
|
1250
|
+
height: 28px;
|
|
1251
|
+
display: inline-flex !important;
|
|
1252
|
+
align-items: center;
|
|
1253
|
+
justify-content: center;
|
|
1254
|
+
position: absolute !important;
|
|
1255
|
+
top: 0 !important;
|
|
1256
|
+
line-height: 28px;
|
|
1257
|
+
font-size: 16px;
|
|
1258
|
+
color: var(--sl-text-color);
|
|
1259
|
+
overflow: visible !important;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
.sl-date-range-calendar .flatpickr-prev-month {
|
|
1263
|
+
left: 12px !important;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
.sl-date-range-calendar .flatpickr-next-month {
|
|
1267
|
+
right: 12px !important;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
.sl-date-range-calendar .flatpickr-prev-month:hover,
|
|
1271
|
+
.sl-date-range-calendar .flatpickr-next-month:hover {
|
|
1272
|
+
color: var(--sl-color-primary);
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/* 隐藏 flatpickr 原始 SVG 箭头(已替换为 iconfont) */
|
|
1276
|
+
.sl-date-range-calendar .flatpickr-prev-month svg,
|
|
1277
|
+
.sl-date-range-calendar .flatpickr-next-month svg {
|
|
1278
|
+
display: none !important;
|
|
1279
|
+
}
|
|
1280
|
+
.flatpickr-prev-month .iconfont,
|
|
1281
|
+
.flatpickr-next-month .iconfont,
|
|
1282
|
+
.flatpickr-prev-year .iconfont,
|
|
1283
|
+
.flatpickr-next-year .iconfont {
|
|
1284
|
+
font-size:12px;
|
|
1285
|
+
color:var(--sl-text-color-primary);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
/* 星期标题 */
|
|
1289
|
+
.sl-date-range-calendar .flatpickr-weekdays {
|
|
1290
|
+
padding: 0 4px;
|
|
1291
|
+
height: 36px;
|
|
1292
|
+
width: 622px !important; /* 311px * 2 */
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
.sl-date-range-calendar .flatpickr-weekdaycontainer {
|
|
1296
|
+
width: 311px !important;
|
|
1297
|
+
min-width: 311px !important;
|
|
1298
|
+
flex: none !important;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
.sl-date-range-calendar span.flatpickr-weekday {
|
|
1302
|
+
font-size: var(--sl-font-size-base);
|
|
1303
|
+
color: var(--sl-text-color);
|
|
1304
|
+
font-weight:400;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
/* 日期单元格 */
|
|
1308
|
+
.sl-date-range-calendar .flatpickr-days {
|
|
1309
|
+
padding: 0 4px;
|
|
1310
|
+
width: 622px !important; /* 311px * 2 */
|
|
1311
|
+
overflow: visible !important;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
.sl-date-range-calendar .dayContainer {
|
|
1315
|
+
padding: 0 4px;
|
|
1316
|
+
width: 311px !important; /* (646 - 24px padding - 1px border) / 2 */
|
|
1317
|
+
min-width: 311px !important;
|
|
1318
|
+
max-width: 311px !important;
|
|
1319
|
+
min-height: 216px;
|
|
1320
|
+
display: flex;
|
|
1321
|
+
flex-wrap: wrap;
|
|
1322
|
+
justify-content: flex-start;
|
|
1323
|
+
box-sizing: border-box;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/* 外层包裹:占满一格宽度,提供 inRange 选中区间的背景色 */
|
|
1327
|
+
.sl-day-cell {
|
|
1328
|
+
display: flex;
|
|
1329
|
+
align-items: center;
|
|
1330
|
+
justify-content: center;
|
|
1331
|
+
width: 14.2857%;
|
|
1332
|
+
height: 30px;
|
|
1333
|
+
box-sizing: border-box;
|
|
1334
|
+
position: relative;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/* 内层 span:日期数字,选中时显示为圆形高亮 */
|
|
1338
|
+
.sl-day-cell .flatpickr-day {
|
|
1339
|
+
font-size: 14px;
|
|
1340
|
+
color: var(--sl-text-color);
|
|
1341
|
+
width: 24px;
|
|
1342
|
+
height: 24px;
|
|
1343
|
+
max-width: 24px;
|
|
1344
|
+
min-width: 24px;
|
|
1345
|
+
display: flex;
|
|
1346
|
+
align-items: center;
|
|
1347
|
+
justify-content: center;
|
|
1348
|
+
position: relative;
|
|
1349
|
+
border:none;
|
|
1350
|
+
background:transparent;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
.sl-day-cell .flatpickr-day:hover {
|
|
1354
|
+
background: transparent !important;
|
|
1355
|
+
border-color: transparent !important;
|
|
1356
|
+
border: none !important;
|
|
1357
|
+
color: var(--sl-color-primary);
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
/* 未确认范围时,去掉 flatpickr 默认给 startRange/endRange/inRange 加的背景和边框 */
|
|
1361
|
+
.sl-date-range-calendar:not(.sl-range-confirmed) .sl-day-cell .flatpickr-day.startRange,
|
|
1362
|
+
.sl-date-range-calendar:not(.sl-range-confirmed) .sl-day-cell .flatpickr-day.endRange,
|
|
1363
|
+
.sl-date-range-calendar:not(.sl-range-confirmed) .sl-day-cell .flatpickr-day.inRange {
|
|
1364
|
+
background: transparent !important;
|
|
1365
|
+
border: none !important;
|
|
1366
|
+
box-shadow: none !important;
|
|
1367
|
+
color: var(--sl-text-color) !important;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
/* 未确认范围时,鼠标悬停在单元格上才显示主题色 */
|
|
1371
|
+
.sl-date-range-calendar:not(.sl-range-confirmed) .sl-day-cell:hover .flatpickr-day {
|
|
1372
|
+
color: var(--sl-color-primary) !important;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/* 未确认范围时,仅第一个选中的日期保留蓝色圆 */
|
|
1376
|
+
.sl-date-range-calendar:not(.sl-range-confirmed) .sl-day-cell .flatpickr-day.selected {
|
|
1377
|
+
background: var(--sl-color-primary) !important;
|
|
1378
|
+
color: var(--sl-color-white) !important;
|
|
1379
|
+
border-radius: 50% !important;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/* 今天:蓝色文字 */
|
|
1383
|
+
.sl-day-cell .flatpickr-day.today {
|
|
1384
|
+
border: none;
|
|
1385
|
+
color: var(--sl-color-primary);
|
|
1386
|
+
font-weight: 600;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
.sl-day-cell .flatpickr-day.today:not(.selected):not(.startRange):not(.endRange) {
|
|
1390
|
+
color: var(--sl-color-primary);
|
|
1391
|
+
font-weight: 600;
|
|
1392
|
+
}
|
|
1393
|
+
/* 悬停时的 inRange(未确认范围):仅改变字体颜色,不显示灰色背景带 */
|
|
1394
|
+
.sl-day-cell:has(.flatpickr-day.inRange) .flatpickr-day {
|
|
1395
|
+
box-shadow: none ;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/* 已确认范围:显示灰色背景带 */
|
|
1399
|
+
.sl-range-confirmed .sl-day-cell:has(.flatpickr-day.inRange) {
|
|
1400
|
+
background: var(--sl-border-color-light);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
.sl-range-confirmed .sl-day-cell:has(.flatpickr-day.inRange) .flatpickr-day:hover {
|
|
1404
|
+
color: var(--sl-color-primary) !important;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/* 开始日期:仅在范围确认后显示灰色背景带 */
|
|
1408
|
+
.sl-range-confirmed .sl-day-cell:has(.flatpickr-day.startRange) {
|
|
1409
|
+
background: var(--sl-border-color-light);
|
|
1410
|
+
border-top-left-radius: 50%;
|
|
1411
|
+
border-bottom-left-radius: 50%;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.sl-range-confirmed .sl-day-cell:has(.flatpickr-day.startRange.endRange) {
|
|
1415
|
+
background: transparent;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/* 结束日期:仅在范围确认后显示灰色背景带 */
|
|
1419
|
+
.sl-range-confirmed .sl-day-cell:has(.flatpickr-day.endRange) {
|
|
1420
|
+
background: var(--sl-border-color-light);
|
|
1421
|
+
border-top-right-radius: 50%;
|
|
1422
|
+
border-bottom-right-radius: 50%;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
/* 选中的开始和结束日期:蓝色实心圆 */
|
|
1426
|
+
.sl-day-cell .flatpickr-day.selected,
|
|
1427
|
+
.sl-day-cell .flatpickr-day.startRange,
|
|
1428
|
+
.sl-day-cell .flatpickr-day.endRange {
|
|
1429
|
+
background: var(--sl-color-primary) !important;
|
|
1430
|
+
border-color: var(--sl-color-primary) !important;
|
|
1431
|
+
color: var(--sl-color-white) !important;
|
|
1432
|
+
border-radius: 50% !important;
|
|
1433
|
+
box-shadow: none !important;
|
|
1434
|
+
}
|
|
1435
|
+
/* 禁用日期 */
|
|
1436
|
+
.sl-day-cell .flatpickr-day.flatpickr-disabled {
|
|
1437
|
+
color: var(--sl-text-color-disabled);
|
|
1438
|
+
cursor: not-allowed;
|
|
1439
|
+
opacity: 1;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
.sl-day-cell .flatpickr-day.flatpickr-disabled:hover {
|
|
1443
|
+
background: transparent !important;
|
|
1444
|
+
border-color: transparent !important;
|
|
1445
|
+
cursor: not-allowed;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
.sl-day-cell .flatpickr-day.prevMonthDay,
|
|
1449
|
+
.sl-day-cell .flatpickr-day.nextMonthDay {
|
|
1450
|
+
color: #c0c4cc;
|
|
1451
|
+
}
|
|
1452
|
+
.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.preMonthDay.inRange{
|
|
1453
|
+
background: transparent ;
|
|
1454
|
+
border:none;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
/* ============ 多文件上传列表样式 - 横向滚动 ============ */
|
|
1458
|
+
.import-dialog-vanilla-file-list {
|
|
1459
|
+
display: flex;
|
|
1460
|
+
flex-direction: row;
|
|
1461
|
+
gap: 12px;
|
|
1462
|
+
overflow-x: auto;
|
|
1463
|
+
overflow-y: hidden;
|
|
1464
|
+
padding: 0px 0px 12px 0px;
|
|
1465
|
+
scrollbar-width: thin;
|
|
1466
|
+
// scrollbar-color: #d9d9d9 transparent;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
.import-dialog-vanilla-file-list::-webkit-scrollbar {
|
|
1470
|
+
height: 6px;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
.import-dialog-vanilla-file-list::-webkit-scrollbar-track {
|
|
1474
|
+
background: transparent;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
.import-dialog-vanilla-file-list::-webkit-scrollbar-thumb {
|
|
1478
|
+
background: #d9d9d9;
|
|
1479
|
+
border-radius: 3px;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
.import-dialog-vanilla-file-list::-webkit-scrollbar-thumb:hover {
|
|
1483
|
+
background: #bfbfbf;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
.import-dialog-vanilla-file-item {
|
|
1487
|
+
position: relative;
|
|
1488
|
+
display: flex;
|
|
1489
|
+
flex-direction: row;
|
|
1490
|
+
align-items: center;
|
|
1491
|
+
gap: 8px;
|
|
1492
|
+
padding: 4px 8px;
|
|
1493
|
+
background: var(--slm-card-bg-color5);
|
|
1494
|
+
border-radius: 12px;
|
|
1495
|
+
flex-shrink: 0;
|
|
1496
|
+
min-width: 196px;
|
|
1497
|
+
width:196px;
|
|
1498
|
+
height:52px;
|
|
1499
|
+
cursor: default;
|
|
1500
|
+
transition: all 0.2s;
|
|
1501
|
+
}
|
|
1502
|
+
.import-dialog-vanilla-file-item.width-100{
|
|
1503
|
+
width:100%;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
// .import-dialog-vanilla-file-item:hover {
|
|
1507
|
+
// background: #FFF7E6;
|
|
1508
|
+
// }
|
|
1509
|
+
|
|
1510
|
+
// .import-dialog-vanilla-file-item.status-success {
|
|
1511
|
+
// background: #FFFBF0;
|
|
1512
|
+
// }
|
|
1513
|
+
|
|
1514
|
+
.import-dialog-vanilla-file-item.status-error {
|
|
1515
|
+
background: #FFF2F0;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
.import-dialog-vanilla-file-item.status-uploading {
|
|
1519
|
+
background: #FFFBF0;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
.import-dialog-vanilla-file-icon {
|
|
1523
|
+
width: 18px;
|
|
1524
|
+
height: 18px;
|
|
1525
|
+
display: flex;
|
|
1526
|
+
align-items: center;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
.import-dialog-vanilla-file-icon svg {
|
|
1530
|
+
width: 32px;
|
|
1531
|
+
height: 32px;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.import-dialog-vanilla-file-info {
|
|
1535
|
+
flex: 1;
|
|
1536
|
+
min-width: 0;
|
|
1537
|
+
display: flex;
|
|
1538
|
+
flex-direction: column;
|
|
1539
|
+
gap: 2px;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
.import-dialog-vanilla-file-name {
|
|
1543
|
+
font-size: 13px;
|
|
1544
|
+
color: var(--sl-text-color);
|
|
1545
|
+
white-space: nowrap;
|
|
1546
|
+
overflow: hidden;
|
|
1547
|
+
text-overflow: ellipsis;
|
|
1548
|
+
line-height: 1.4;
|
|
1549
|
+
width:144px;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
.import-dialog-vanilla-file-meta {
|
|
1553
|
+
display: flex;
|
|
1554
|
+
align-items: center;
|
|
1555
|
+
gap: 4px;
|
|
1556
|
+
font-size: 12px;
|
|
1557
|
+
color: var(--sl-text-color-secondary);
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
.import-dialog-vanilla-file-progress-text {
|
|
1561
|
+
font-size: 12px;
|
|
1562
|
+
color: #1890FF;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.import-dialog-vanilla-file-error-text {
|
|
1566
|
+
font-size: 12px;
|
|
1567
|
+
color: var(--sl-color-error);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
/* 删除按钮 - 默认隐藏,hover时显示 */
|
|
1571
|
+
.import-dialog-vanilla-file-remove-btn {
|
|
1572
|
+
position: absolute;
|
|
1573
|
+
top: 2px;
|
|
1574
|
+
right: 2px;
|
|
1575
|
+
width: 14px;
|
|
1576
|
+
height: 14px;
|
|
1577
|
+
display: flex;
|
|
1578
|
+
align-items: center;
|
|
1579
|
+
justify-content: center;
|
|
1580
|
+
border: none;
|
|
1581
|
+
cursor: pointer;
|
|
1582
|
+
opacity: 0;
|
|
1583
|
+
transition: opacity 0.2s;
|
|
1584
|
+
z-index: 1;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
.import-dialog-vanilla-file-item:hover .import-dialog-vanilla-file-remove-btn {
|
|
1588
|
+
opacity: 1;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
.import-dialog-vanilla-file-remove-btn svg {
|
|
1592
|
+
width: 14px;
|
|
1593
|
+
height: 14px;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
/* 全局遮罩 Loading */
|
|
1597
|
+
.import-dialog-vanilla-loading-overlay {
|
|
1598
|
+
position: absolute;
|
|
1599
|
+
top: 0;
|
|
1600
|
+
left: 0;
|
|
1601
|
+
right: 0;
|
|
1602
|
+
bottom: 0;
|
|
1603
|
+
background: var(--sl-overlay-color-lighter);
|
|
1604
|
+
display: flex;
|
|
1605
|
+
align-items: center;
|
|
1606
|
+
justify-content: center;
|
|
1607
|
+
z-index: 1000;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
.import-dialog-vanilla-loading-spinner {
|
|
1611
|
+
width: 32px;
|
|
1612
|
+
height: 32px;
|
|
1613
|
+
border: 3px solid var(--sl-border-color);
|
|
1614
|
+
border-top: 3px solid var(--sl-color-primary);
|
|
1615
|
+
border-radius: 50%;
|
|
1616
|
+
animation: import-dialog-vanilla-spin 1s linear infinite;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
@keyframes import-dialog-vanilla-spin {
|
|
1620
|
+
0% { transform: rotate(0deg); }
|
|
1621
|
+
100% { transform: rotate(360deg); }
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
`;
|
|
1625
|
+
}
|
|
1626
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1627
|
+
var zh = { exports: {} };
|
|
1628
|
+
(function(module, exports) {
|
|
1629
|
+
(function(global2, factory) {
|
|
1630
|
+
factory(exports);
|
|
1631
|
+
})(commonjsGlobal, function(exports2) {
|
|
1632
|
+
var fp = typeof window !== "undefined" && window.flatpickr !== void 0 ? window.flatpickr : {
|
|
1633
|
+
l10ns: {}
|
|
1634
|
+
};
|
|
1635
|
+
var Mandarin = {
|
|
1636
|
+
weekdays: {
|
|
1637
|
+
shorthand: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
|
1638
|
+
longhand: [
|
|
1639
|
+
"星期日",
|
|
1640
|
+
"星期一",
|
|
1641
|
+
"星期二",
|
|
1642
|
+
"星期三",
|
|
1643
|
+
"星期四",
|
|
1644
|
+
"星期五",
|
|
1645
|
+
"星期六"
|
|
1646
|
+
]
|
|
1647
|
+
},
|
|
1648
|
+
months: {
|
|
1649
|
+
shorthand: [
|
|
1650
|
+
"一月",
|
|
1651
|
+
"二月",
|
|
1652
|
+
"三月",
|
|
1653
|
+
"四月",
|
|
1654
|
+
"五月",
|
|
1655
|
+
"六月",
|
|
1656
|
+
"七月",
|
|
1657
|
+
"八月",
|
|
1658
|
+
"九月",
|
|
1659
|
+
"十月",
|
|
1660
|
+
"十一月",
|
|
1661
|
+
"十二月"
|
|
1662
|
+
],
|
|
1663
|
+
longhand: [
|
|
1664
|
+
"一月",
|
|
1665
|
+
"二月",
|
|
1666
|
+
"三月",
|
|
1667
|
+
"四月",
|
|
1668
|
+
"五月",
|
|
1669
|
+
"六月",
|
|
1670
|
+
"七月",
|
|
1671
|
+
"八月",
|
|
1672
|
+
"九月",
|
|
1673
|
+
"十月",
|
|
1674
|
+
"十一月",
|
|
1675
|
+
"十二月"
|
|
1676
|
+
]
|
|
1677
|
+
},
|
|
1678
|
+
rangeSeparator: " 至 ",
|
|
1679
|
+
weekAbbreviation: "周",
|
|
1680
|
+
scrollTitle: "滚动切换",
|
|
1681
|
+
toggleTitle: "点击切换 12/24 小时时制"
|
|
1682
|
+
};
|
|
1683
|
+
fp.l10ns.zh = Mandarin;
|
|
1684
|
+
var zh2 = fp.l10ns;
|
|
1685
|
+
exports2.Mandarin = Mandarin;
|
|
1686
|
+
exports2.default = zh2;
|
|
1687
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1688
|
+
});
|
|
1689
|
+
})(zh, zh.exports);
|
|
1690
|
+
var zhExports = zh.exports;
|
|
1691
|
+
const customLocale = {
|
|
1692
|
+
...zhExports.Mandarin,
|
|
1693
|
+
weekdays: {
|
|
1694
|
+
shorthand: ["日", "一", "二", "三", "四", "五", "六"],
|
|
1695
|
+
longhand: ["日", "一", "二", "三", "四", "五", "六"]
|
|
1696
|
+
}
|
|
1697
|
+
};
|
|
1698
|
+
class DateRangePicker {
|
|
1699
|
+
constructor(options) {
|
|
1700
|
+
__publicField(this, "container");
|
|
1701
|
+
__publicField(this, "startInput");
|
|
1702
|
+
__publicField(this, "endInput");
|
|
1703
|
+
__publicField(this, "fpInstance", null);
|
|
1704
|
+
__publicField(this, "selectedDates", [null, null]);
|
|
1705
|
+
__publicField(this, "onChange");
|
|
1706
|
+
__publicField(this, "placeholder");
|
|
1707
|
+
__publicField(this, "shortcuts");
|
|
1708
|
+
__publicField(this, "disabledDate");
|
|
1709
|
+
__publicField(this, "activeShortcutIndex", -1);
|
|
1710
|
+
__publicField(this, "isShortcutTriggered", false);
|
|
1711
|
+
__publicField(this, "scrollHandler", null);
|
|
1712
|
+
__publicField(this, "scrollParents", []);
|
|
1713
|
+
this.container = options.container;
|
|
1714
|
+
this.selectedDates = options.defaultDates || [null, null];
|
|
1715
|
+
this.onChange = options.onChange;
|
|
1716
|
+
this.placeholder = options.placeholder || ["Start date", "End date"];
|
|
1717
|
+
this.shortcuts = options.shortcuts || [];
|
|
1718
|
+
this.disabledDate = options.disabledDate;
|
|
1719
|
+
this.render();
|
|
1720
|
+
this.initFlatpickr();
|
|
1721
|
+
}
|
|
1722
|
+
render() {
|
|
1723
|
+
this.container.innerHTML = "";
|
|
1724
|
+
this.container.className = "sl-date-range-picker";
|
|
1725
|
+
this.startInput = document.createElement("input");
|
|
1726
|
+
this.startInput.type = "text";
|
|
1727
|
+
this.startInput.className = "sl-date-range-input";
|
|
1728
|
+
this.startInput.placeholder = this.placeholder[0];
|
|
1729
|
+
this.startInput.readOnly = true;
|
|
1730
|
+
if (this.selectedDates[0]) {
|
|
1731
|
+
this.startInput.value = this.formatDate(this.selectedDates[0]);
|
|
1732
|
+
}
|
|
1733
|
+
const separator = document.createElement("span");
|
|
1734
|
+
separator.className = "sl-date-range-separator";
|
|
1735
|
+
separator.textContent = "To";
|
|
1736
|
+
this.endInput = document.createElement("input");
|
|
1737
|
+
this.endInput.type = "text";
|
|
1738
|
+
this.endInput.className = "sl-date-range-input";
|
|
1739
|
+
this.endInput.placeholder = this.placeholder[1];
|
|
1740
|
+
this.endInput.readOnly = true;
|
|
1741
|
+
if (this.selectedDates[1]) {
|
|
1742
|
+
this.endInput.value = this.formatDate(this.selectedDates[1]);
|
|
1743
|
+
}
|
|
1744
|
+
const iconBtn = document.createElement("span");
|
|
1745
|
+
iconBtn.className = "sl-date-range-icon";
|
|
1746
|
+
iconBtn.innerHTML = `<svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1747
|
+
<path d="M5 1v2M11 1v2M1.5 6h13M3 2.5h10a1.5 1.5 0 011.5 1.5v10a1.5 1.5 0 01-1.5 1.5H3a1.5 1.5 0 01-1.5-1.5V4A1.5 1.5 0 013 2.5z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1748
|
+
</svg>`;
|
|
1749
|
+
this.container.appendChild(this.startInput);
|
|
1750
|
+
this.container.appendChild(separator);
|
|
1751
|
+
this.container.appendChild(this.endInput);
|
|
1752
|
+
this.container.appendChild(iconBtn);
|
|
1753
|
+
this.container.addEventListener("click", (e) => {
|
|
1754
|
+
var _a;
|
|
1755
|
+
e.stopPropagation();
|
|
1756
|
+
(_a = this.fpInstance) == null ? void 0 : _a.open();
|
|
1757
|
+
});
|
|
1758
|
+
}
|
|
1759
|
+
buildShortcutsPanel() {
|
|
1760
|
+
const panel = document.createElement("div");
|
|
1761
|
+
panel.className = "sl-date-range-shortcuts";
|
|
1762
|
+
this.shortcuts.forEach((shortcut, index) => {
|
|
1763
|
+
const item = document.createElement("div");
|
|
1764
|
+
item.className = "sl-date-range-shortcut-item";
|
|
1765
|
+
if (index === this.activeShortcutIndex) {
|
|
1766
|
+
item.classList.add("active");
|
|
1767
|
+
}
|
|
1768
|
+
item.textContent = shortcut.text;
|
|
1769
|
+
item.addEventListener("click", (e) => {
|
|
1770
|
+
e.stopPropagation();
|
|
1771
|
+
this.handleShortcutClick(index);
|
|
1772
|
+
});
|
|
1773
|
+
panel.appendChild(item);
|
|
1774
|
+
});
|
|
1775
|
+
return panel;
|
|
1776
|
+
}
|
|
1777
|
+
handleShortcutClick(index) {
|
|
1778
|
+
var _a, _b, _c, _d;
|
|
1779
|
+
const shortcut = this.shortcuts[index];
|
|
1780
|
+
if (!shortcut) return;
|
|
1781
|
+
const [start, end] = shortcut.value();
|
|
1782
|
+
this.isShortcutTriggered = true;
|
|
1783
|
+
this.activeShortcutIndex = index;
|
|
1784
|
+
this.selectedDates = [start, end];
|
|
1785
|
+
this.startInput.value = this.formatDate(start);
|
|
1786
|
+
this.endInput.value = this.formatDate(end);
|
|
1787
|
+
(_a = this.fpInstance) == null ? void 0 : _a.setDate([start, end], false);
|
|
1788
|
+
(_b = this.onChange) == null ? void 0 : _b.call(this, [start, end]);
|
|
1789
|
+
(_c = this.fpInstance) == null ? void 0 : _c.calendarContainer.classList.add("sl-range-confirmed");
|
|
1790
|
+
if (this.fpInstance) {
|
|
1791
|
+
this.updateMonthHeaders(this.fpInstance);
|
|
1792
|
+
this.unwrapDayCells(this.fpInstance);
|
|
1793
|
+
this.padDayContainers(this.fpInstance);
|
|
1794
|
+
this.wrapDayCells(this.fpInstance);
|
|
1795
|
+
}
|
|
1796
|
+
this.updateShortcutActiveState();
|
|
1797
|
+
this.isShortcutTriggered = false;
|
|
1798
|
+
(_d = this.fpInstance) == null ? void 0 : _d.close();
|
|
1799
|
+
}
|
|
1800
|
+
updateShortcutActiveState() {
|
|
1801
|
+
var _a;
|
|
1802
|
+
const panel = (_a = this.fpInstance) == null ? void 0 : _a.calendarContainer.querySelector(
|
|
1803
|
+
".sl-date-range-shortcuts"
|
|
1804
|
+
);
|
|
1805
|
+
if (!panel) return;
|
|
1806
|
+
const items = panel.querySelectorAll(".sl-date-range-shortcut-item");
|
|
1807
|
+
items.forEach((item, i) => {
|
|
1808
|
+
if (i === this.activeShortcutIndex) {
|
|
1809
|
+
item.classList.add("active");
|
|
1810
|
+
} else {
|
|
1811
|
+
item.classList.remove("active");
|
|
1812
|
+
}
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
initFlatpickr() {
|
|
1816
|
+
const hiddenInput = document.createElement("input");
|
|
1817
|
+
hiddenInput.type = "text";
|
|
1818
|
+
hiddenInput.style.cssText = "position:absolute;width:0;height:0;opacity:0;pointer-events:none;";
|
|
1819
|
+
this.container.appendChild(hiddenInput);
|
|
1820
|
+
const defaultDates = [];
|
|
1821
|
+
if (this.selectedDates[0]) defaultDates.push(this.selectedDates[0]);
|
|
1822
|
+
if (this.selectedDates[1]) defaultDates.push(this.selectedDates[1]);
|
|
1823
|
+
const disableFn = this.disabledDate;
|
|
1824
|
+
const disableConfig = disableFn ? [(date) => disableFn(date)] : [];
|
|
1825
|
+
this.fpInstance = flatpickr(hiddenInput, {
|
|
1826
|
+
mode: "range",
|
|
1827
|
+
showMonths: 2,
|
|
1828
|
+
locale: customLocale,
|
|
1829
|
+
dateFormat: "Y-m-d",
|
|
1830
|
+
defaultDate: defaultDates.length === 2 ? defaultDates : void 0,
|
|
1831
|
+
positionElement: this.container,
|
|
1832
|
+
static: false,
|
|
1833
|
+
position: "below",
|
|
1834
|
+
disable: disableConfig,
|
|
1835
|
+
onReady: (_selectedDates, _dateStr, instance) => {
|
|
1836
|
+
instance.calendarContainer.classList.add("sl-date-range-calendar");
|
|
1837
|
+
if (_selectedDates.length === 2) {
|
|
1838
|
+
instance.calendarContainer.classList.add("sl-range-confirmed");
|
|
1839
|
+
}
|
|
1840
|
+
instance.calendarContainer.addEventListener("mouseleave", () => {
|
|
1841
|
+
if (!instance.calendarContainer.classList.contains("sl-range-confirmed") && instance.selectedDates.length === 1) {
|
|
1842
|
+
instance.calendarContainer.querySelectorAll(".flatpickr-day.inRange, .flatpickr-day.endRange").forEach((el) => {
|
|
1843
|
+
el.classList.remove("inRange", "endRange");
|
|
1844
|
+
});
|
|
1845
|
+
}
|
|
1846
|
+
});
|
|
1847
|
+
this.customizeCalendarHeader(instance);
|
|
1848
|
+
this.padDayContainers(instance);
|
|
1849
|
+
this.wrapDayCells(instance);
|
|
1850
|
+
if (this.shortcuts.length > 0) {
|
|
1851
|
+
instance.calendarContainer.classList.add("has-shortcuts");
|
|
1852
|
+
const calendarContent = document.createElement("div");
|
|
1853
|
+
calendarContent.className = "sl-date-range-calendar-content";
|
|
1854
|
+
while (instance.calendarContainer.firstChild) {
|
|
1855
|
+
calendarContent.appendChild(instance.calendarContainer.firstChild);
|
|
1856
|
+
}
|
|
1857
|
+
const shortcutsPanel = this.buildShortcutsPanel();
|
|
1858
|
+
instance.calendarContainer.appendChild(shortcutsPanel);
|
|
1859
|
+
instance.calendarContainer.appendChild(calendarContent);
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1862
|
+
onOpen: (_selectedDates, _dateStr, instance) => {
|
|
1863
|
+
this.updateMonthHeaders(instance);
|
|
1864
|
+
this.unwrapDayCells(instance);
|
|
1865
|
+
this.padDayContainers(instance);
|
|
1866
|
+
this.wrapDayCells(instance);
|
|
1867
|
+
requestAnimationFrame(() => {
|
|
1868
|
+
this.positionCalendar(instance);
|
|
1869
|
+
});
|
|
1870
|
+
this.bindScrollListeners(instance);
|
|
1871
|
+
},
|
|
1872
|
+
onClose: () => {
|
|
1873
|
+
this.unbindScrollListeners();
|
|
1874
|
+
},
|
|
1875
|
+
onMonthChange: (_selectedDates, _dateStr, instance) => {
|
|
1876
|
+
requestAnimationFrame(() => {
|
|
1877
|
+
this.updateMonthHeaders(instance);
|
|
1878
|
+
this.unwrapDayCells(instance);
|
|
1879
|
+
this.padDayContainers(instance);
|
|
1880
|
+
this.wrapDayCells(instance);
|
|
1881
|
+
});
|
|
1882
|
+
},
|
|
1883
|
+
onYearChange: (_selectedDates, _dateStr, instance) => {
|
|
1884
|
+
requestAnimationFrame(() => {
|
|
1885
|
+
this.updateMonthHeaders(instance);
|
|
1886
|
+
this.unwrapDayCells(instance);
|
|
1887
|
+
this.padDayContainers(instance);
|
|
1888
|
+
this.wrapDayCells(instance);
|
|
1889
|
+
});
|
|
1890
|
+
},
|
|
1891
|
+
onChange: (dates, _dateStr, instance) => {
|
|
1892
|
+
var _a;
|
|
1893
|
+
if (!this.isShortcutTriggered) {
|
|
1894
|
+
this.activeShortcutIndex = -1;
|
|
1895
|
+
this.updateShortcutActiveState();
|
|
1896
|
+
}
|
|
1897
|
+
if (dates.length === 2) {
|
|
1898
|
+
this.selectedDates = [dates[0], dates[1]];
|
|
1899
|
+
this.startInput.value = this.formatDate(dates[0]);
|
|
1900
|
+
this.endInput.value = this.formatDate(dates[1]);
|
|
1901
|
+
(_a = this.onChange) == null ? void 0 : _a.call(this, this.selectedDates);
|
|
1902
|
+
instance.calendarContainer.classList.add("sl-range-confirmed");
|
|
1903
|
+
} else if (dates.length === 1) {
|
|
1904
|
+
this.selectedDates = [dates[0], null];
|
|
1905
|
+
this.startInput.value = this.formatDate(dates[0]);
|
|
1906
|
+
this.endInput.value = "";
|
|
1907
|
+
instance.calendarContainer.classList.remove("sl-range-confirmed");
|
|
1908
|
+
}
|
|
1909
|
+
requestAnimationFrame(() => {
|
|
1910
|
+
this.updateMonthHeaders(instance);
|
|
1911
|
+
this.unwrapDayCells(instance);
|
|
1912
|
+
this.padDayContainers(instance);
|
|
1913
|
+
this.wrapDayCells(instance);
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
customizeCalendarHeader(instance) {
|
|
1919
|
+
const monthsContainer = instance.calendarContainer.querySelector(".flatpickr-months");
|
|
1920
|
+
if (!monthsContainer) return;
|
|
1921
|
+
const prevYear = document.createElement("span");
|
|
1922
|
+
prevYear.className = "flatpickr-prev-year";
|
|
1923
|
+
prevYear.innerHTML = '<i class="iconfont icon-prev2"></i>';
|
|
1924
|
+
prevYear.addEventListener("click", (e) => {
|
|
1925
|
+
e.stopPropagation();
|
|
1926
|
+
instance.changeYear(instance.currentYear - 1);
|
|
1927
|
+
});
|
|
1928
|
+
const nextYear = document.createElement("span");
|
|
1929
|
+
nextYear.className = "flatpickr-next-year";
|
|
1930
|
+
nextYear.innerHTML = '<i class="iconfont icon-next1"></i>';
|
|
1931
|
+
nextYear.addEventListener("click", (e) => {
|
|
1932
|
+
e.stopPropagation();
|
|
1933
|
+
instance.changeYear(instance.currentYear + 1);
|
|
1934
|
+
});
|
|
1935
|
+
const prevMonth = monthsContainer.querySelector(".flatpickr-prev-month");
|
|
1936
|
+
const nextMonth = monthsContainer.querySelector(".flatpickr-next-month");
|
|
1937
|
+
if (prevMonth) {
|
|
1938
|
+
prevMonth.innerHTML = '<i class="iconfont icon-prev3"></i>';
|
|
1939
|
+
monthsContainer.insertBefore(prevYear, prevMonth);
|
|
1940
|
+
}
|
|
1941
|
+
if (nextMonth) {
|
|
1942
|
+
nextMonth.innerHTML = '<i class="iconfont icon-next"></i>';
|
|
1943
|
+
nextMonth.after(nextYear);
|
|
1944
|
+
}
|
|
1945
|
+
this.updateMonthHeaders(instance);
|
|
1946
|
+
}
|
|
1947
|
+
updateMonthHeaders(instance) {
|
|
1948
|
+
const monthNames = [
|
|
1949
|
+
"1",
|
|
1950
|
+
"2",
|
|
1951
|
+
"3",
|
|
1952
|
+
"4",
|
|
1953
|
+
"5",
|
|
1954
|
+
"6",
|
|
1955
|
+
"7",
|
|
1956
|
+
"8",
|
|
1957
|
+
"9",
|
|
1958
|
+
"10",
|
|
1959
|
+
"11",
|
|
1960
|
+
"12"
|
|
1961
|
+
];
|
|
1962
|
+
const months = instance.calendarContainer.querySelectorAll(
|
|
1963
|
+
".flatpickr-current-month"
|
|
1964
|
+
);
|
|
1965
|
+
months.forEach((monthEl, i) => {
|
|
1966
|
+
const curMonth = monthEl.querySelector(".cur-month");
|
|
1967
|
+
const yearInput = monthEl.querySelector(".numInputWrapper");
|
|
1968
|
+
if (!curMonth || !yearInput) return;
|
|
1969
|
+
const monthIndex = (instance.currentMonth + i) % 12;
|
|
1970
|
+
const year = instance.currentYear + Math.floor((instance.currentMonth + i) / 12);
|
|
1971
|
+
yearInput.style.display = "none";
|
|
1972
|
+
curMonth.textContent = `${year} 年 ${monthNames[monthIndex]} 月`;
|
|
1973
|
+
});
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* 将每个 dayContainer 填充到 42 个单元格(6 行 × 7 列)。
|
|
1977
|
+
* 参考 Element Plus 逻辑:在开头补充上月日期,在末尾补充下月日期,
|
|
1978
|
+
* 确保每一行都被完全填满。
|
|
1979
|
+
*/
|
|
1980
|
+
padDayContainers(instance) {
|
|
1981
|
+
const containers = instance.calendarContainer.querySelectorAll(".dayContainer");
|
|
1982
|
+
containers.forEach((container, idx) => {
|
|
1983
|
+
container.querySelectorAll(".sl-pad-day").forEach((el) => el.remove());
|
|
1984
|
+
container.querySelectorAll(".flatpickr-day.hidden").forEach((el) => el.classList.remove("hidden"));
|
|
1985
|
+
const totalCells = 42;
|
|
1986
|
+
const monthIndex = (instance.currentMonth + idx) % 12;
|
|
1987
|
+
const year = instance.currentYear + Math.floor((instance.currentMonth + idx) / 12);
|
|
1988
|
+
const existingPrevDays = container.querySelectorAll(
|
|
1989
|
+
".flatpickr-day.prevMonthDay"
|
|
1990
|
+
);
|
|
1991
|
+
const firstDayOfMonth = new Date(year, monthIndex, 1).getDay();
|
|
1992
|
+
const prevDaysNeeded = firstDayOfMonth - existingPrevDays.length;
|
|
1993
|
+
if (prevDaysNeeded > 0) {
|
|
1994
|
+
const prevMonth = monthIndex === 0 ? 11 : monthIndex - 1;
|
|
1995
|
+
const prevYear = monthIndex === 0 ? year - 1 : year;
|
|
1996
|
+
const daysInPrevMonth = new Date(prevYear, prevMonth + 1, 0).getDate();
|
|
1997
|
+
const firstChild = container.firstChild;
|
|
1998
|
+
for (let i = prevDaysNeeded - 1; i >= 0; i--) {
|
|
1999
|
+
const dayNum = daysInPrevMonth - i;
|
|
2000
|
+
const span = document.createElement("span");
|
|
2001
|
+
span.className = "flatpickr-day prevMonthDay sl-pad-day";
|
|
2002
|
+
span.textContent = String(dayNum);
|
|
2003
|
+
span.tabIndex = -1;
|
|
2004
|
+
container.insertBefore(span, firstChild);
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
const currentCount = container.querySelectorAll(".flatpickr-day").length;
|
|
2008
|
+
if (currentCount < totalCells) {
|
|
2009
|
+
const existingNextDays = container.querySelectorAll(".nextMonthDay");
|
|
2010
|
+
let nextDayNum = 1;
|
|
2011
|
+
if (existingNextDays.length > 0) {
|
|
2012
|
+
const lastNext = existingNextDays[existingNextDays.length - 1];
|
|
2013
|
+
nextDayNum = parseInt(lastNext.textContent || "0", 10) + 1;
|
|
2014
|
+
}
|
|
2015
|
+
const needed = totalCells - currentCount;
|
|
2016
|
+
for (let i = 0; i < needed; i++) {
|
|
2017
|
+
const span = document.createElement("span");
|
|
2018
|
+
span.className = "flatpickr-day nextMonthDay sl-pad-day";
|
|
2019
|
+
span.textContent = String(nextDayNum + i);
|
|
2020
|
+
span.tabIndex = -1;
|
|
2021
|
+
container.appendChild(span);
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* 将每个 .flatpickr-day span 包裹在 div.sl-day-cell 中,实现双层渲染:
|
|
2028
|
+
* - 外层 div:占满整格宽度的背景带(用于 inRange)
|
|
2029
|
+
* - 内层 span:圆形高亮(用于 startRange/endRange)
|
|
2030
|
+
* 类似 Element Plus 的 table>tr>td>div>span 结构。
|
|
2031
|
+
*/
|
|
2032
|
+
wrapDayCells(instance) {
|
|
2033
|
+
const containers = instance.calendarContainer.querySelectorAll(".dayContainer");
|
|
2034
|
+
containers.forEach((container) => {
|
|
2035
|
+
const days = container.querySelectorAll(
|
|
2036
|
+
".flatpickr-day:not(.sl-day-wrapped)"
|
|
2037
|
+
);
|
|
2038
|
+
days.forEach((day) => {
|
|
2039
|
+
var _a;
|
|
2040
|
+
if (day.parentElement && day.parentElement.classList.contains("sl-day-cell")) {
|
|
2041
|
+
return;
|
|
2042
|
+
}
|
|
2043
|
+
const wrapper = document.createElement("div");
|
|
2044
|
+
wrapper.className = "sl-day-cell";
|
|
2045
|
+
day.classList.add("sl-day-wrapped");
|
|
2046
|
+
(_a = day.parentNode) == null ? void 0 : _a.insertBefore(wrapper, day);
|
|
2047
|
+
wrapper.appendChild(day);
|
|
2048
|
+
});
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* 移除所有 sl-day-cell 包裹,恢复 flatpickr 的扁平结构。
|
|
2053
|
+
*/
|
|
2054
|
+
unwrapDayCells(instance) {
|
|
2055
|
+
const wrappers = instance.calendarContainer.querySelectorAll(".sl-day-cell");
|
|
2056
|
+
wrappers.forEach((wrapper) => {
|
|
2057
|
+
var _a;
|
|
2058
|
+
const child = wrapper.firstElementChild;
|
|
2059
|
+
if (child) {
|
|
2060
|
+
child.classList.remove("sl-day-wrapped");
|
|
2061
|
+
(_a = wrapper.parentNode) == null ? void 0 : _a.insertBefore(child, wrapper);
|
|
2062
|
+
}
|
|
2063
|
+
wrapper.remove();
|
|
2064
|
+
});
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* 将日历居中定位在输入框下方(或上方),并显示箭头指示器。
|
|
2068
|
+
*/
|
|
2069
|
+
positionCalendar(instance) {
|
|
2070
|
+
const cal = instance.calendarContainer;
|
|
2071
|
+
const inputRect = this.container.getBoundingClientRect();
|
|
2072
|
+
const gap = 4;
|
|
2073
|
+
const arrowSize = 8;
|
|
2074
|
+
const calHeight = cal.offsetHeight;
|
|
2075
|
+
const calWidth = cal.offsetWidth;
|
|
2076
|
+
const inputCenter = inputRect.left + inputRect.width / 2;
|
|
2077
|
+
const desiredLeft = inputCenter - calWidth / 2;
|
|
2078
|
+
const maxLeft = window.innerWidth - calWidth - 8;
|
|
2079
|
+
const clampedLeft = Math.max(8, Math.min(desiredLeft, maxLeft));
|
|
2080
|
+
const spaceBelow = window.innerHeight - inputRect.bottom - gap - arrowSize;
|
|
2081
|
+
const spaceAbove = inputRect.top - gap - arrowSize;
|
|
2082
|
+
const placeAbove = spaceBelow < calHeight && spaceAbove > spaceBelow;
|
|
2083
|
+
if (placeAbove) {
|
|
2084
|
+
cal.style.top = `${inputRect.top + window.scrollY - calHeight - gap - arrowSize}px`;
|
|
2085
|
+
} else {
|
|
2086
|
+
cal.style.top = `${inputRect.bottom + window.scrollY + gap + arrowSize}px`;
|
|
2087
|
+
}
|
|
2088
|
+
cal.style.left = `${clampedLeft}px`;
|
|
2089
|
+
let arrow = cal.querySelector(".sl-calendar-arrow");
|
|
2090
|
+
if (!arrow) {
|
|
2091
|
+
arrow = document.createElement("div");
|
|
2092
|
+
arrow.className = "sl-calendar-arrow";
|
|
2093
|
+
cal.appendChild(arrow);
|
|
2094
|
+
}
|
|
2095
|
+
const arrowLeft = inputCenter - clampedLeft;
|
|
2096
|
+
arrow.style.left = `${arrowLeft}px`;
|
|
2097
|
+
if (placeAbove) {
|
|
2098
|
+
arrow.className = "sl-calendar-arrow sl-calendar-arrow-bottom";
|
|
2099
|
+
} else {
|
|
2100
|
+
arrow.className = "sl-calendar-arrow sl-calendar-arrow-top";
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
formatDate(date) {
|
|
2104
|
+
const y = date.getFullYear();
|
|
2105
|
+
const m = String(date.getMonth() + 1).padStart(2, "0");
|
|
2106
|
+
const d = String(date.getDate()).padStart(2, "0");
|
|
2107
|
+
return `${y}-${m}-${d}`;
|
|
2108
|
+
}
|
|
2109
|
+
getDates() {
|
|
2110
|
+
return [...this.selectedDates];
|
|
2111
|
+
}
|
|
2112
|
+
setDates(dates) {
|
|
2113
|
+
var _a;
|
|
2114
|
+
this.selectedDates = dates;
|
|
2115
|
+
if (dates[0]) this.startInput.value = this.formatDate(dates[0]);
|
|
2116
|
+
else this.startInput.value = "";
|
|
2117
|
+
if (dates[1]) this.endInput.value = this.formatDate(dates[1]);
|
|
2118
|
+
else this.endInput.value = "";
|
|
2119
|
+
const fpDates = [];
|
|
2120
|
+
if (dates[0]) fpDates.push(dates[0]);
|
|
2121
|
+
if (dates[1]) fpDates.push(dates[1]);
|
|
2122
|
+
(_a = this.fpInstance) == null ? void 0 : _a.setDate(fpDates, false);
|
|
2123
|
+
}
|
|
2124
|
+
/**
|
|
2125
|
+
* 获取元素的所有可滚动祖先元素。
|
|
2126
|
+
*/
|
|
2127
|
+
getScrollParents(el) {
|
|
2128
|
+
const parents = [];
|
|
2129
|
+
let current = el.parentElement;
|
|
2130
|
+
while (current) {
|
|
2131
|
+
const style = getComputedStyle(current);
|
|
2132
|
+
const overflow = style.overflow + style.overflowY + style.overflowX;
|
|
2133
|
+
if (/auto|scroll/.test(overflow)) {
|
|
2134
|
+
parents.push(current);
|
|
2135
|
+
}
|
|
2136
|
+
current = current.parentElement;
|
|
2137
|
+
}
|
|
2138
|
+
parents.push(window);
|
|
2139
|
+
return parents;
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* 绑定滚动监听,滚动时重新定位日历并判断居上/居下。
|
|
2143
|
+
*/
|
|
2144
|
+
bindScrollListeners(instance) {
|
|
2145
|
+
this.unbindScrollListeners();
|
|
2146
|
+
this.scrollHandler = () => {
|
|
2147
|
+
this.positionCalendar(instance);
|
|
2148
|
+
};
|
|
2149
|
+
this.scrollParents = this.getScrollParents(this.container);
|
|
2150
|
+
this.scrollParents.forEach((parent) => {
|
|
2151
|
+
parent.addEventListener("scroll", this.scrollHandler, { passive: true });
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
/**
|
|
2155
|
+
* 解绑滚动监听。
|
|
2156
|
+
*/
|
|
2157
|
+
unbindScrollListeners() {
|
|
2158
|
+
if (this.scrollHandler) {
|
|
2159
|
+
this.scrollParents.forEach((parent) => {
|
|
2160
|
+
parent.removeEventListener("scroll", this.scrollHandler);
|
|
2161
|
+
});
|
|
2162
|
+
this.scrollHandler = null;
|
|
2163
|
+
this.scrollParents = [];
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
destroy() {
|
|
2167
|
+
var _a;
|
|
2168
|
+
this.unbindScrollListeners();
|
|
2169
|
+
(_a = this.fpInstance) == null ? void 0 : _a.destroy();
|
|
2170
|
+
this.fpInstance = null;
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
const zhCN = {
|
|
2174
|
+
// 通用
|
|
2175
|
+
loadingText: "加载中...",
|
|
2176
|
+
cancel: "取消",
|
|
2177
|
+
confirm: "确认",
|
|
2178
|
+
download: "下载",
|
|
2179
|
+
select: "选择",
|
|
2180
|
+
required: "必填",
|
|
2181
|
+
// 对话框标题
|
|
2182
|
+
batchImport: "批量导入",
|
|
2183
|
+
// 下载模板部分
|
|
2184
|
+
downloadTemplateTitle: "1.下载模版,根据提示信息完善表格内容",
|
|
2185
|
+
downloadTemplateText: "下载模板",
|
|
2186
|
+
// 导入设置部分
|
|
2187
|
+
importSettingsTitle: "2.导入设置",
|
|
2188
|
+
selectBrand: "选择所属品牌",
|
|
2189
|
+
defaultBrand: "默认品牌",
|
|
2190
|
+
selectImageRatio: "选择图片比例",
|
|
2191
|
+
selectMonth: "选择月份",
|
|
2192
|
+
selectDate: "选择日期",
|
|
2193
|
+
// 上传部分
|
|
2194
|
+
uploadTitle: "3.上传文件",
|
|
2195
|
+
dragFileHere: "将文件拖到此处,或",
|
|
2196
|
+
or: "或",
|
|
2197
|
+
uploadLinkText: "点击上传",
|
|
2198
|
+
uploadHint: "文件仅支持扩展名:.xls,.xlsx",
|
|
2199
|
+
// 提示信息
|
|
2200
|
+
tipsTitle: "提示信息",
|
|
2201
|
+
// 月份
|
|
2202
|
+
month: "月",
|
|
2203
|
+
// 日期选择器
|
|
2204
|
+
startDate: "开始日期",
|
|
2205
|
+
endDate: "结束日期",
|
|
2206
|
+
to: "至",
|
|
2207
|
+
// 错误信息
|
|
2208
|
+
fileTypeError: "请上传文件",
|
|
2209
|
+
fileSizeError: "文件大小超出限制",
|
|
2210
|
+
uploadFailed: "上传失败",
|
|
2211
|
+
uploadSuccess: "上传成功",
|
|
2212
|
+
uploading: "上传中...",
|
|
2213
|
+
// 模板配置 - 上传标题
|
|
2214
|
+
uploadTitleBase: "上传文件",
|
|
2215
|
+
uploadTitleTemplate1: "上传编辑好的文件",
|
|
2216
|
+
uploadTitleTemplate2: "导入菜品图片文件",
|
|
2217
|
+
uploadTitleTemplate3: "导入菜品信息文件",
|
|
2218
|
+
uploadTitleTemplate4: "导入菜谱方案文件",
|
|
2219
|
+
uploadTitleTemplate5: "导入价格调整文件",
|
|
2220
|
+
// 模板配置 - 上传链接文本
|
|
2221
|
+
uploadLinkTextDefault: "点击上传",
|
|
2222
|
+
uploadLinkTextImport: "点击导入",
|
|
2223
|
+
// 模板配置 - 上传提示
|
|
2224
|
+
uploadHintExcel: "文件仅支持扩展名:.xls,.xlsx",
|
|
2225
|
+
uploadHintImage: "文件仅支持扩展名:.rar .zip .jpg .png .jpeg",
|
|
2226
|
+
// 模板配置 - 提示信息
|
|
2227
|
+
tipsDefault: [],
|
|
2228
|
+
tipsTemplate1: [],
|
|
2229
|
+
tipsTemplate2: [
|
|
2230
|
+
"图片名称需要与菜品名称一致",
|
|
2231
|
+
"上传文件仅支持ZIP、RAR压缩包文件(暂不支持win11自带工具压缩的文件),文件大小不超过100M",
|
|
2232
|
+
"图片支持jpg、png、jpeg格式,单张大小不超过2M"
|
|
2233
|
+
],
|
|
2234
|
+
tipsTemplate3: [
|
|
2235
|
+
"菜品以代码为唯一标识进行集团菜品的匹配,请仔细核对菜品代码",
|
|
2236
|
+
"模版支持导入名称、价格、自定义分类,其余菜品的属性获取集团菜品库"
|
|
2237
|
+
],
|
|
2238
|
+
tipsTemplate4: [
|
|
2239
|
+
"最多支持导入五个菜谱方案",
|
|
2240
|
+
"菜品以代码为唯一标识进行集团菜品的匹配,请仔细核对菜品代码",
|
|
2241
|
+
"模版支持导入名称、线上可点分类、价格和自定义分类,其余菜品的属性获取集团菜品库"
|
|
2242
|
+
],
|
|
2243
|
+
tipsTemplate5: [
|
|
2244
|
+
"价格调整将覆盖现有价格,请谨慎操作",
|
|
2245
|
+
"支持批量调整入库价格和出库价格"
|
|
2246
|
+
],
|
|
2247
|
+
// Tab 标签
|
|
2248
|
+
tabCoverImport: "覆盖导入数据",
|
|
2249
|
+
tabIncrementImport: "增量导入数据",
|
|
2250
|
+
tabInPrice: "合批修改入库价格",
|
|
2251
|
+
tabOutPrice: "合批修改出库价格",
|
|
2252
|
+
// 图片比例
|
|
2253
|
+
imageRatioOriginal: "原图",
|
|
2254
|
+
imageRatio4to3: "4:3",
|
|
2255
|
+
imageRatio3to4: "3:4",
|
|
2256
|
+
imageRatio1to1: "1:1",
|
|
2257
|
+
imageRatio16to9: "16:9"
|
|
2258
|
+
};
|
|
2259
|
+
const zhTW = {
|
|
2260
|
+
// 通用
|
|
2261
|
+
loadingText: "載入中...",
|
|
2262
|
+
cancel: "取消",
|
|
2263
|
+
confirm: "確認",
|
|
2264
|
+
download: "下載",
|
|
2265
|
+
select: "選擇",
|
|
2266
|
+
required: "必填",
|
|
2267
|
+
// 對話框標題
|
|
2268
|
+
batchImport: "批量匯入",
|
|
2269
|
+
// 下載模板部分
|
|
2270
|
+
downloadTemplateTitle: "1.下載模板,根據提示資訊完善表格內容",
|
|
2271
|
+
downloadTemplateText: "下載模板",
|
|
2272
|
+
// 匯入設置部分
|
|
2273
|
+
importSettingsTitle: "2.匯入設置",
|
|
2274
|
+
selectBrand: "選擇所屬品牌",
|
|
2275
|
+
defaultBrand: "預設品牌",
|
|
2276
|
+
selectImageRatio: "選擇圖片比例",
|
|
2277
|
+
selectMonth: "選擇月份",
|
|
2278
|
+
selectDate: "選擇日期",
|
|
2279
|
+
// 上傳部分
|
|
2280
|
+
uploadTitle: "3.上傳檔案",
|
|
2281
|
+
dragFileHere: "將檔案拖到此處,或",
|
|
2282
|
+
or: "或",
|
|
2283
|
+
uploadLinkText: "點擊上傳",
|
|
2284
|
+
uploadHint: "檔案僅支援副檔名:.xls,.xlsx",
|
|
2285
|
+
// 提示資訊
|
|
2286
|
+
tipsTitle: "提示資訊",
|
|
2287
|
+
// 月份
|
|
2288
|
+
month: "月",
|
|
2289
|
+
// 日期選擇器
|
|
2290
|
+
startDate: "開始日期",
|
|
2291
|
+
endDate: "結束日期",
|
|
2292
|
+
to: "至",
|
|
2293
|
+
// 錯誤資訊
|
|
2294
|
+
fileTypeError: "請上傳檔案",
|
|
2295
|
+
fileSizeError: "檔案大小超出限制",
|
|
2296
|
+
uploadFailed: "上傳失敗",
|
|
2297
|
+
uploadSuccess: "上傳成功",
|
|
2298
|
+
uploading: "上傳中...",
|
|
2299
|
+
// 模板配置 - 上傳標題
|
|
2300
|
+
uploadTitleBase: "上傳檔案",
|
|
2301
|
+
uploadTitleTemplate1: "上傳編輯好的檔案",
|
|
2302
|
+
uploadTitleTemplate2: "匯入菜品圖片檔案",
|
|
2303
|
+
uploadTitleTemplate3: "匯入菜品資訊檔案",
|
|
2304
|
+
uploadTitleTemplate4: "匯入食譜方案檔案",
|
|
2305
|
+
uploadTitleTemplate5: "匯入價格調整檔案",
|
|
2306
|
+
// 模板配置 - 上傳連結文本
|
|
2307
|
+
uploadLinkTextDefault: "點擊上傳",
|
|
2308
|
+
uploadLinkTextImport: "點擊匯入",
|
|
2309
|
+
// 模板配置 - 上傳提示
|
|
2310
|
+
uploadHintExcel: "檔案僅支援副檔名:.xls,.xlsx",
|
|
2311
|
+
uploadHintImage: "檔案僅支援副檔名:.rar .zip .jpg .png .jpeg",
|
|
2312
|
+
// 模板配置 - 提示資訊
|
|
2313
|
+
tipsDefault: ["這裡寫一些提示資訊"],
|
|
2314
|
+
tipsTemplate1: ["這裡寫一些提示資訊"],
|
|
2315
|
+
tipsTemplate2: [
|
|
2316
|
+
"圖片名稱需要與菜品名稱一致",
|
|
2317
|
+
"上傳檔案僅支援ZIP、RAR壓縮包檔案(暫不支援win11自帶工具壓縮的檔案),檔案大小不超過100M",
|
|
2318
|
+
"圖片支援jpg、png、jpeg格式,單張大小不超過2M"
|
|
2319
|
+
],
|
|
2320
|
+
tipsTemplate3: [
|
|
2321
|
+
"菜品以代碼為唯一標識進行集團菜品的匹配,請仔細核對菜品代碼",
|
|
2322
|
+
"模板支援匯入名稱、價格、自定義分類,其餘菜品的屬性獲取集團菜品庫"
|
|
2323
|
+
],
|
|
2324
|
+
tipsTemplate4: [
|
|
2325
|
+
"最多支援匯入五個食譜方案",
|
|
2326
|
+
"菜品以代碼為唯一標識進行集團菜品的匹配,請仔細核對菜品代碼",
|
|
2327
|
+
"模板支援匯入名稱、線上可點分類、價格和自定義分類,其餘菜品的屬性獲取集團菜品庫"
|
|
2328
|
+
],
|
|
2329
|
+
tipsTemplate5: [
|
|
2330
|
+
"價格調整將覆蓋現有價格,請謹慎操作",
|
|
2331
|
+
"支援批量調整入庫價格和出庫價格"
|
|
2332
|
+
],
|
|
2333
|
+
// Tab 標籤
|
|
2334
|
+
tabCoverImport: "覆蓋匯入資料",
|
|
2335
|
+
tabIncrementImport: "增量匯入資料",
|
|
2336
|
+
tabInPrice: "合批修改入庫價格",
|
|
2337
|
+
tabOutPrice: "合批修改出庫價格",
|
|
2338
|
+
// 圖片比例
|
|
2339
|
+
imageRatioOriginal: "原圖",
|
|
2340
|
+
imageRatio4to3: "4:3",
|
|
2341
|
+
imageRatio3to4: "3:4",
|
|
2342
|
+
imageRatio1to1: "1:1",
|
|
2343
|
+
imageRatio16to9: "16:9"
|
|
2344
|
+
};
|
|
2345
|
+
const ja = {
|
|
2346
|
+
// 通用
|
|
2347
|
+
loadingText: "読み込み中...",
|
|
2348
|
+
cancel: "キャンセル",
|
|
2349
|
+
confirm: "確認",
|
|
2350
|
+
download: "ダウンロード",
|
|
2351
|
+
select: "選択",
|
|
2352
|
+
required: "必須",
|
|
2353
|
+
// ダイアログタイトル
|
|
2354
|
+
batchImport: "一括インポート",
|
|
2355
|
+
// テンプレートダウンロード部分
|
|
2356
|
+
downloadTemplateTitle: "1.テンプレートをダウンロードし、指示に従ってスプレッドシートを完成させる",
|
|
2357
|
+
downloadTemplateText: "テンプレートをダウンロード",
|
|
2358
|
+
// インポート設定部分
|
|
2359
|
+
importSettingsTitle: "2.インポート設定",
|
|
2360
|
+
selectBrand: "ブランドを選択",
|
|
2361
|
+
defaultBrand: "デフォルトブランド",
|
|
2362
|
+
selectImageRatio: "画像比率を選択",
|
|
2363
|
+
selectMonth: "月を選択",
|
|
2364
|
+
selectDate: "日付を選択",
|
|
2365
|
+
// アップロード部分
|
|
2366
|
+
uploadTitle: "3.ファイルをアップロード",
|
|
2367
|
+
dragFileHere: "ファイルをここにドラッグ、または",
|
|
2368
|
+
or: "または",
|
|
2369
|
+
uploadLinkText: "クリックしてアップロード",
|
|
2370
|
+
uploadHint: "ファイルは拡張子のみサポート:.xls,.xlsx",
|
|
2371
|
+
// ヒント情報
|
|
2372
|
+
tipsTitle: "ヒント",
|
|
2373
|
+
// 月
|
|
2374
|
+
month: "月",
|
|
2375
|
+
// 日付選択器
|
|
2376
|
+
startDate: "開始日",
|
|
2377
|
+
endDate: "終了日",
|
|
2378
|
+
to: "から",
|
|
2379
|
+
// エラー情報
|
|
2380
|
+
fileTypeError: "ファイルをアップロードしてください",
|
|
2381
|
+
fileSizeError: "ファイルサイズが制限を超えています",
|
|
2382
|
+
uploadFailed: "アップロード失敗",
|
|
2383
|
+
uploadSuccess: "アップロード成功",
|
|
2384
|
+
uploading: "アップロード中...",
|
|
2385
|
+
// テンプレート設定 - アップロードタイトル
|
|
2386
|
+
uploadTitleBase: "ファイルをアップロード",
|
|
2387
|
+
uploadTitleTemplate1: "編集済みファイルをアップロード",
|
|
2388
|
+
uploadTitleTemplate2: "料理画像ファイルをインポート",
|
|
2389
|
+
uploadTitleTemplate3: "料理情報ファイルをインポート",
|
|
2390
|
+
uploadTitleTemplate4: "レシプトプランファイルをインポート",
|
|
2391
|
+
uploadTitleTemplate5: "価格調整ファイルをインポート",
|
|
2392
|
+
// テンプレート設定 - アップロードリンクテキスト
|
|
2393
|
+
uploadLinkTextDefault: "クリックしてアップロード",
|
|
2394
|
+
uploadLinkTextImport: "クリックしてインポート",
|
|
2395
|
+
// テンプレート設定 - アップロードヒント
|
|
2396
|
+
uploadHintExcel: "ファイルは拡張子のみサポート:.xls,.xlsx",
|
|
2397
|
+
uploadHintImage: "ファイルは拡張子のみサポート:.rar .zip .jpg .png .jpeg",
|
|
2398
|
+
// テンプレート設定 - ヒント情報
|
|
2399
|
+
tipsDefault: [],
|
|
2400
|
+
tipsTemplate1: [],
|
|
2401
|
+
tipsTemplate2: [
|
|
2402
|
+
"画像名は料理名と一致する必要があります",
|
|
2403
|
+
"アップロードファイルはZIP、RAR圧縮ファイルのみサポート(Windows11付属ツールで圧縮されたファイルはサポートされません)、ファイルサイズは100Mを超えないでください",
|
|
2404
|
+
"画像はjpg、png、jpeg形式をサポート、単一サイズは2Mを超えないでください"
|
|
2405
|
+
],
|
|
2406
|
+
tipsTemplate3: [
|
|
2407
|
+
"料理はコードを唯一の識別子としてグループ料理と一致させ、料理コードを慎重に確認してください",
|
|
2408
|
+
"テンプレートは名前、価格、カスタム分類のインポートをサポート、その他の料理属性はグループ料理データベースから取得"
|
|
2409
|
+
],
|
|
2410
|
+
tipsTemplate4: [
|
|
2411
|
+
"最大5つのレシピプランのインポートをサポート",
|
|
2412
|
+
"料理はコードを唯一の識別子としてグループ料理と一致させ、料理コードを慎重に確認してください",
|
|
2413
|
+
"テンプレートは名前、オンライン注文可能分類、価格とカスタム分類のインポートをサポート、その他の料理属性はグループ料理データベースから取得"
|
|
2414
|
+
],
|
|
2415
|
+
tipsTemplate5: [
|
|
2416
|
+
"価格調整は既存価格を上書きします、慎重に操作してください",
|
|
2417
|
+
"仕入価格と販売価格の一括調整をサポート"
|
|
2418
|
+
],
|
|
2419
|
+
// Tab ラベル
|
|
2420
|
+
tabCoverImport: "上書きインポートデータ",
|
|
2421
|
+
tabIncrementImport: "増分インポートデータ",
|
|
2422
|
+
tabInPrice: "一括仕入価格修正",
|
|
2423
|
+
tabOutPrice: "一括販売価格修正",
|
|
2424
|
+
// 画像比率
|
|
2425
|
+
imageRatioOriginal: "元画像",
|
|
2426
|
+
imageRatio4to3: "4:3",
|
|
2427
|
+
imageRatio3to4: "3:4",
|
|
2428
|
+
imageRatio1to1: "1:1",
|
|
2429
|
+
imageRatio16to9: "16:9"
|
|
2430
|
+
};
|
|
2431
|
+
const id = {
|
|
2432
|
+
// 通用
|
|
2433
|
+
loadingText: "Memuat...",
|
|
2434
|
+
cancel: "Batal",
|
|
2435
|
+
confirm: "Konfirmasi",
|
|
2436
|
+
download: "Unduh",
|
|
2437
|
+
select: "Pilih",
|
|
2438
|
+
required: "Wajib",
|
|
2439
|
+
// Judul dialog
|
|
2440
|
+
batchImport: "Impor Batch",
|
|
2441
|
+
// Bagian unduh template
|
|
2442
|
+
downloadTemplateTitle: "1. Unduh template dan lengkapi spreadsheet sesuai petunjuk",
|
|
2443
|
+
downloadTemplateText: "Unduh Template",
|
|
2444
|
+
// Bagian pengaturan impor
|
|
2445
|
+
importSettingsTitle: "2. Pengaturan Impor",
|
|
2446
|
+
selectBrand: "Pilih Merek",
|
|
2447
|
+
defaultBrand: "Merek Default",
|
|
2448
|
+
selectImageRatio: "Pilih Rasio Gambar",
|
|
2449
|
+
selectMonth: "Pilih Bulan",
|
|
2450
|
+
selectDate: "Pilih Tanggal",
|
|
2451
|
+
// Bagian unggah
|
|
2452
|
+
uploadTitle: "3. Unggah File",
|
|
2453
|
+
dragFileHere: "Seret file di sini, atau",
|
|
2454
|
+
or: "atau",
|
|
2455
|
+
uploadLinkText: "klik untuk mengunggah",
|
|
2456
|
+
uploadHint: "Hanya mendukung ekstensi file: .xls,.xlsx",
|
|
2457
|
+
// Informasi tips
|
|
2458
|
+
tipsTitle: "Tips",
|
|
2459
|
+
// Bulan
|
|
2460
|
+
month: "Bulan",
|
|
2461
|
+
// Pemilih tanggal
|
|
2462
|
+
startDate: "Tanggal mulai",
|
|
2463
|
+
endDate: "Tanggal akhir",
|
|
2464
|
+
to: "hingga",
|
|
2465
|
+
// Informasi error
|
|
2466
|
+
fileTypeError: "Silakan unggah file",
|
|
2467
|
+
fileSizeError: "Ukuran file melebihi batas",
|
|
2468
|
+
uploadFailed: "Unggah gagal",
|
|
2469
|
+
uploadSuccess: "Unggah berhasil",
|
|
2470
|
+
uploading: "Mengunggah...",
|
|
2471
|
+
// Konfigurasi template - Judul unggah
|
|
2472
|
+
uploadTitleBase: "Unggah File",
|
|
2473
|
+
uploadTitleTemplate1: "Unggah File yang Diedit",
|
|
2474
|
+
uploadTitleTemplate2: "Impor File Gambar Menu",
|
|
2475
|
+
uploadTitleTemplate3: "Impor File Informasi Menu",
|
|
2476
|
+
uploadTitleTemplate4: "Impor File Rencana Resep",
|
|
2477
|
+
uploadTitleTemplate5: "Impor File Penyesuaian Harga",
|
|
2478
|
+
// Konfigurasi template - Teks link unggah
|
|
2479
|
+
uploadLinkTextDefault: "klik untuk mengunggah",
|
|
2480
|
+
uploadLinkTextImport: "klik untuk mengimpor",
|
|
2481
|
+
// Konfigurasi template - Tips unggah
|
|
2482
|
+
uploadHintExcel: "Hanya mendukung ekstensi file: .xls,.xlsx",
|
|
2483
|
+
uploadHintImage: "Hanya mendukung ekstensi file: .rar .zip .jpg .png .jpeg",
|
|
2484
|
+
// Konfigurasi template - Informasi tips
|
|
2485
|
+
tipsDefault: [],
|
|
2486
|
+
tipsTemplate1: [],
|
|
2487
|
+
tipsTemplate2: [
|
|
2488
|
+
"Nama gambar harus sesuai dengan nama menu",
|
|
2489
|
+
"File unggah hanya mendukung file terkompresi ZIP, RAR (file yang dikompresi dengan tools bawaan Windows11 tidak didukung), ukuran file tidak melebihi 100M",
|
|
2490
|
+
"Gambar mendukung format jpg, png, jpeg, ukuran tunggal tidak melebihi 2M"
|
|
2491
|
+
],
|
|
2492
|
+
tipsTemplate3: [
|
|
2493
|
+
"Menu dicocokkan dengan menu grup menggunakan kode sebagai identifier unik, harap periksa kode menu dengan cermat",
|
|
2494
|
+
"Template mendukung impor nama, harga, kategori kustom, atribut menu lainnya diperoleh dari database menu grup"
|
|
2495
|
+
],
|
|
2496
|
+
tipsTemplate4: [
|
|
2497
|
+
"Mendukung impor hingga lima rencana resep",
|
|
2498
|
+
"Menu dicocokkan dengan menu grup menggunakan kode sebagai identifier unik, harap periksa kode menu dengan cermat",
|
|
2499
|
+
"Template mendukung impor nama, kategori dapat dipesan online, harga dan kategori kustom, atribut menu lainnya diperoleh dari database menu grup"
|
|
2500
|
+
],
|
|
2501
|
+
tipsTemplate5: [
|
|
2502
|
+
"Penyesuaian harga akan menimpa harga yang ada, harap beroperasi dengan hati-hati",
|
|
2503
|
+
"Mendukung penyesuaian harga pembelian dan harga jual secara batch"
|
|
2504
|
+
],
|
|
2505
|
+
// Label Tab
|
|
2506
|
+
tabCoverImport: "Timpa Data Impor",
|
|
2507
|
+
tabIncrementImport: "Data Impor Incremental",
|
|
2508
|
+
tabInPrice: "Modifikasi Harga Pembelian Batch",
|
|
2509
|
+
tabOutPrice: "Modifikasi Harga Penjualan Batch",
|
|
2510
|
+
// Rasio gambar
|
|
2511
|
+
imageRatioOriginal: "Asli",
|
|
2512
|
+
imageRatio4to3: "4:3",
|
|
2513
|
+
imageRatio3to4: "3:4",
|
|
2514
|
+
imageRatio1to1: "1:1",
|
|
2515
|
+
imageRatio16to9: "16:9"
|
|
2516
|
+
};
|
|
2517
|
+
const enUS = {
|
|
2518
|
+
// 通用
|
|
2519
|
+
loadingText: "Loading...",
|
|
2520
|
+
cancel: "Cancel",
|
|
2521
|
+
confirm: "Confirm",
|
|
2522
|
+
download: "Download",
|
|
2523
|
+
select: "Select",
|
|
2524
|
+
required: "Required",
|
|
2525
|
+
// 对话框标题
|
|
2526
|
+
batchImport: "Batch Import",
|
|
2527
|
+
// 下载模板部分
|
|
2528
|
+
downloadTemplateTitle: "1. Download template and complete the spreadsheet according to the instructions",
|
|
2529
|
+
downloadTemplateText: "Download Template",
|
|
2530
|
+
// 导入设置部分
|
|
2531
|
+
importSettingsTitle: "2. Import Settings",
|
|
2532
|
+
selectBrand: "Select Brand",
|
|
2533
|
+
defaultBrand: "Default Brand",
|
|
2534
|
+
selectImageRatio: "Select Image Ratio",
|
|
2535
|
+
selectMonth: "Select Month",
|
|
2536
|
+
selectDate: "Select Date",
|
|
2537
|
+
// 上传部分
|
|
2538
|
+
uploadTitle: "3. Upload File",
|
|
2539
|
+
dragFileHere: "Drag files here, or",
|
|
2540
|
+
or: "or",
|
|
2541
|
+
uploadLinkText: "click to upload",
|
|
2542
|
+
uploadHint: "Supports batch import, file size not exceeding 10MB",
|
|
2543
|
+
// 提示信息
|
|
2544
|
+
tipsTitle: "Tips",
|
|
2545
|
+
// 月份
|
|
2546
|
+
month: "Month",
|
|
2547
|
+
// 日期选择器
|
|
2548
|
+
startDate: "Start date",
|
|
2549
|
+
endDate: "End date",
|
|
2550
|
+
to: "to",
|
|
2551
|
+
// 错误信息
|
|
2552
|
+
fileTypeError: "Please upload file",
|
|
2553
|
+
fileSizeError: "File size exceeds limit",
|
|
2554
|
+
uploadFailed: "Upload failed",
|
|
2555
|
+
uploadSuccess: "Upload successful",
|
|
2556
|
+
uploading: "Uploading...",
|
|
2557
|
+
// 模板配置 - 上传标题
|
|
2558
|
+
uploadTitleBase: "Upload File",
|
|
2559
|
+
uploadTitleTemplate1: "Upload Edited File",
|
|
2560
|
+
uploadTitleTemplate2: "Import Dish Image File",
|
|
2561
|
+
uploadTitleTemplate3: "Import Dish Information File",
|
|
2562
|
+
uploadTitleTemplate4: "Import Recipe Plan File",
|
|
2563
|
+
uploadTitleTemplate5: "Import Price Adjustment File",
|
|
2564
|
+
// 模板配置 - 上传链接文本
|
|
2565
|
+
uploadLinkTextDefault: "click to upload",
|
|
2566
|
+
uploadLinkTextImport: "click to import",
|
|
2567
|
+
// 模板配置 - 上传提示
|
|
2568
|
+
uploadHintExcel: "File only supports extensions: .xls,.xlsx",
|
|
2569
|
+
uploadHintImage: "File only supports extensions: .rar .zip .jpg .png .jpeg",
|
|
2570
|
+
// 模板配置 - 提示信息
|
|
2571
|
+
tipsDefault: [],
|
|
2572
|
+
tipsTemplate1: [],
|
|
2573
|
+
tipsTemplate2: [
|
|
2574
|
+
"Image name must match dish name",
|
|
2575
|
+
"Upload files only support ZIP, RAR compressed files (files compressed with Win11 built-in tools are not supported), file size not exceeding 100M",
|
|
2576
|
+
"Images support jpg, png, jpeg formats, single size not exceeding 2M"
|
|
2577
|
+
],
|
|
2578
|
+
tipsTemplate3: [
|
|
2579
|
+
"Dishes are matched with group dishes by code as unique identifier, please carefully check dish codes",
|
|
2580
|
+
"Template supports importing name, price, custom category, other dish attributes are obtained from group dish database"
|
|
2581
|
+
],
|
|
2582
|
+
tipsTemplate4: [
|
|
2583
|
+
"Support importing up to five recipe plans",
|
|
2584
|
+
"Dishes are matched with group dishes by code as unique identifier, please carefully check dish codes",
|
|
2585
|
+
"Template supports importing name, online orderable category, price and custom category, other dish attributes are obtained from group dish database"
|
|
2586
|
+
],
|
|
2587
|
+
tipsTemplate5: [
|
|
2588
|
+
"Price adjustment will overwrite existing prices, please operate with caution",
|
|
2589
|
+
"Support batch adjustment of purchase price and sale price"
|
|
2590
|
+
],
|
|
2591
|
+
// Tab 标签
|
|
2592
|
+
tabCoverImport: "Overwrite Import Data",
|
|
2593
|
+
tabIncrementImport: "Increment Import Data",
|
|
2594
|
+
tabInPrice: "Batch Modify Purchase Price",
|
|
2595
|
+
tabOutPrice: "Batch Modify Sale Price",
|
|
2596
|
+
// 图片比例
|
|
2597
|
+
imageRatioOriginal: "Original",
|
|
2598
|
+
imageRatio4to3: "4:3",
|
|
2599
|
+
imageRatio3to4: "3:4",
|
|
2600
|
+
imageRatio1to1: "1:1",
|
|
2601
|
+
imageRatio16to9: "16:9"
|
|
2602
|
+
};
|
|
2603
|
+
const defaultLocale = DEFAULT_LOCALE;
|
|
2604
|
+
const locales = {
|
|
2605
|
+
"zh-CN": zhCN,
|
|
2606
|
+
"zh-TW": zhTW,
|
|
2607
|
+
ja,
|
|
2608
|
+
id,
|
|
2609
|
+
"en-US": enUS
|
|
2610
|
+
};
|
|
2611
|
+
class I18n {
|
|
2612
|
+
constructor() {
|
|
2613
|
+
__publicField(this, "currentLocale", defaultLocale);
|
|
2614
|
+
__publicField(this, "messages", locales[defaultLocale]);
|
|
2615
|
+
}
|
|
2616
|
+
setLocale(locale) {
|
|
2617
|
+
this.currentLocale = locale;
|
|
2618
|
+
this.messages = locales[locale] || locales[defaultLocale];
|
|
2619
|
+
}
|
|
2620
|
+
getLocale() {
|
|
2621
|
+
return this.currentLocale;
|
|
2622
|
+
}
|
|
2623
|
+
t(key, params) {
|
|
2624
|
+
const message = this.messages[key] || key;
|
|
2625
|
+
if (Array.isArray(message)) {
|
|
2626
|
+
return message.join("\n");
|
|
2627
|
+
}
|
|
2628
|
+
if (!params) {
|
|
2629
|
+
return message;
|
|
2630
|
+
}
|
|
2631
|
+
return message.replace(/\{(\w+)\}/g, (match, paramKey) => {
|
|
2632
|
+
return String(params[paramKey] || match);
|
|
2633
|
+
});
|
|
2634
|
+
}
|
|
2635
|
+
// 批量翻译
|
|
2636
|
+
tBatch(keys) {
|
|
2637
|
+
const result = {};
|
|
2638
|
+
keys.forEach((key) => {
|
|
2639
|
+
result[key] = this.t(key);
|
|
2640
|
+
});
|
|
2641
|
+
return result;
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
const i18n = new I18n();
|
|
2645
|
+
const t = (key, params) => i18n.t(key, params);
|
|
2646
|
+
const setLocale = (locale) => i18n.setLocale(locale);
|
|
2647
|
+
const getLocale = () => i18n.getLocale();
|
|
2648
|
+
const uploadImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACUCAYAAADlL3kbAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAABa9SURBVHic7Z1bb9xGloDPqSre+qK7HFmxE8fwSEFmBpuFNpiZeLArYGcWyMM85v/o/+hpn/KQBBAW2JldzArwQ5yMvR7HWDttO9HVlNjdZNWpfei0TLX6QrJJNrvFDzDgbpHFYvfpw1PnVgglkdje3hbh1y9eOLz3GM8Tl97z60dXjgEAqDRR9Hu/i7RF3/MAAJjXJsa4vnJtR8ve9/DI0IZRp6RzIlJIFYtdmV/AL41BsnXxmglb9RtftJVq3F89ht3dvn9PAqY1UH922Nq9r5dlmwxgTANR4usN+lCGIQwV+ZzwF0Lks3HmWhIi9L1Lbngnz/ZOUhs6rYH6sb29x2SbDKiAW9G6Nc5YJFv80j/y+86dcZ+EodQowZUB5+F/48ytZAg2nVUQmwAAFROGPnHikupgveztbdPK7S/B1IYlV11v4fSGN+jYW7eafYVtb2/vyuNwUvSaDtDHfOg1HYLAZXopGEuLq8Bhddm6+LG6wiZuNAl6TINKRSoAgPn5H6ler2uI+fn1u79+uK6Lp6c3hio+zxO8UpHqBN6Y0hYc2uqKqTMumT8aV27fXwcAWLDmDp88+aKd9fVKisXK5v06eFAHADAdw2883jtIa+xMzYYw8/M/UoTDSmYY5rVTlYHchLf7GCu5vvTzXIxDbsJbcj0Z5RYch1J4S6aW3IS3SF6DktkgU1fZ9WOHbW/vXVIIUdxKYcKuNtN0SQhn4FphkHuxS78oYBgpm+j79UQKrNHYagHsTHQRXijhfe+93y8OCklOkn5BjHBI9C1fwjd/733PB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Mjwc2meCyIzlraj4w5vZGsblHr5+3R5q1jhCxvqQw/dKZLKh9/r5QwzfK+NmrEACMjH0cyS6HJaXsjlxt6X7w98OD19/9xWBeohMZ14pywCbyMWDw9fffRWn0/rF+RXtnAJjGhjTo8PDO4R14w0wppmQCqvcHTb4kydftLshUCakunnTHfpobNy/e3G86Rj+waM/DtR0AAAVctxuEWInxDr8sX5xrwAANp0NvdfdXRW+V1vGu9e7i8dDFxsvfnfrNHyvz57tDdTSeXP6+n+fHq3XvuZcP85CiBlgk3P9OKnQdkkYHu7moMY5PnoIdHt7W8QrOIwbYo17r1mNneT4/Km/++Gyodgaan0zaQspBtjUiC9tJl83Go9Tqe6Y+KOqZLpYvHt3ns75MkfDIQ4G01RBhRXNSAAAkMYmYxAgUaBBeEoHTVZVh8dPrzanHpf/BzTmoK+dHmeiAAAAAElFTkSuQmCC";
|
|
2649
|
+
class ImportDialogRenderer {
|
|
2650
|
+
constructor(context) {
|
|
2651
|
+
__publicField(this, "context");
|
|
2652
|
+
this.context = context;
|
|
2653
|
+
}
|
|
2654
|
+
updateContext(context) {
|
|
2655
|
+
this.context = { ...this.context, ...context };
|
|
2656
|
+
}
|
|
2657
|
+
get showSettingSection() {
|
|
2658
|
+
const config = this.context.currentConfig;
|
|
2659
|
+
return config.showBrand || config.showImageRatio || config.showMonth || config.showDateRange;
|
|
2660
|
+
}
|
|
2661
|
+
get uploadSectionIndex() {
|
|
2662
|
+
return this.showSettingSection ? 3 : 2;
|
|
2663
|
+
}
|
|
2664
|
+
get tipsList() {
|
|
2665
|
+
return this.context.currentConfig.tips;
|
|
2666
|
+
}
|
|
2667
|
+
get imageRatioOptions() {
|
|
2668
|
+
return getImageRatioOptions(t);
|
|
2669
|
+
}
|
|
2670
|
+
get monthOptions() {
|
|
2671
|
+
return Array.from({ length: 12 }, (_, i) => i + 1);
|
|
2672
|
+
}
|
|
2673
|
+
render() {
|
|
2674
|
+
const config = this.context.currentConfig;
|
|
2675
|
+
const hasTabs = config.tabs && config.tabs.length > 0;
|
|
2676
|
+
return `
|
|
2677
|
+
<div class="import-dialog-vanilla-overlay">
|
|
2678
|
+
<div class="import-dialog-vanilla-modal" style="width: ${this.context.width}">
|
|
2679
|
+
<div class="import-dialog-vanilla-header">
|
|
2680
|
+
<span class="import-dialog-vanilla-title">${this.context.dialogTitle}</span>
|
|
2681
|
+
<span id="import-dialog-close-btn" class="import-dialog-vanilla-close">×</span>
|
|
2682
|
+
</div>
|
|
2683
|
+
<div class="import-dialog-vanilla-content">
|
|
2684
|
+
${hasTabs ? this.renderTabs() : ""}
|
|
2685
|
+
${this.renderDownloadSection()}
|
|
2686
|
+
${this.showSettingSection ? this.renderSettingSection() : ""}
|
|
2687
|
+
${this.renderUploadSection()}
|
|
2688
|
+
${this.tipsList.length > 0 ? this.renderTipsSection() : ""}
|
|
2689
|
+
${this.renderFooter()}
|
|
2690
|
+
</div>
|
|
2691
|
+
</div>
|
|
2692
|
+
</div>
|
|
2693
|
+
`;
|
|
2694
|
+
}
|
|
2695
|
+
renderTabs() {
|
|
2696
|
+
const tabs = this.context.currentConfig.tabs;
|
|
2697
|
+
return `
|
|
2698
|
+
<div class="import-dialog-vanilla-tabs">
|
|
2699
|
+
${tabs.map(
|
|
2700
|
+
(tab, index) => `
|
|
2701
|
+
<div class="import-dialog-vanilla-tab ${this.context.activeTabIndex === index ? "active" : ""}"
|
|
2702
|
+
data-tab-index="${index}">
|
|
2703
|
+
${tab.label}
|
|
2704
|
+
</div>
|
|
2705
|
+
`
|
|
2706
|
+
).join("")}
|
|
2707
|
+
</div>
|
|
2708
|
+
`;
|
|
2709
|
+
}
|
|
2710
|
+
renderDownloadSection() {
|
|
2711
|
+
return `
|
|
2712
|
+
<div class="import-dialog-vanilla-section">
|
|
2713
|
+
<div class="import-dialog-vanilla-section-title">${t("downloadTemplateTitle")}</div>
|
|
2714
|
+
<a id="import-dialog-download-btn" class="import-dialog-vanilla-btn download-template-btn import-dialog-vanilla-btn-primary" href="${this.context.currentConfig.templateUrl}">
|
|
2715
|
+
<i class="iconfont icon-xiazai"></i>
|
|
2716
|
+
${t("downloadTemplateText")}
|
|
2717
|
+
</a>
|
|
2718
|
+
</div>
|
|
2719
|
+
`;
|
|
2720
|
+
}
|
|
2721
|
+
renderSettingSection() {
|
|
2722
|
+
const config = this.context.currentConfig;
|
|
2723
|
+
let content = "";
|
|
2724
|
+
if (config.showBrand) {
|
|
2725
|
+
content += this.renderBrandSelect();
|
|
2726
|
+
}
|
|
2727
|
+
if (config.showImageRatio) {
|
|
2728
|
+
content += this.renderImageRatioSelect();
|
|
2729
|
+
}
|
|
2730
|
+
if (config.showMonth) {
|
|
2731
|
+
content += this.renderMonthSelect();
|
|
2732
|
+
}
|
|
2733
|
+
if (config.showDateRange) {
|
|
2734
|
+
content += this.renderDateRangeSelect();
|
|
2735
|
+
}
|
|
2736
|
+
return `
|
|
2737
|
+
<div class="import-dialog-vanilla-section">
|
|
2738
|
+
<div class="import-dialog-vanilla-section-title">${t("importSettingsTitle")}</div>
|
|
2739
|
+
<div class="import-dialog-vanilla-setting-content">
|
|
2740
|
+
${content}
|
|
2741
|
+
</div>
|
|
2742
|
+
</div>
|
|
2743
|
+
`;
|
|
2744
|
+
}
|
|
2745
|
+
renderBrandSelect() {
|
|
2746
|
+
const placeholder = this.context.brandPlaceholder;
|
|
2747
|
+
const selectedBrand = this.context.brandList.find(
|
|
2748
|
+
(item) => item.value === this.context.formData.brandId
|
|
2749
|
+
);
|
|
2750
|
+
const displayValue = selectedBrand ? selectedBrand.label : this.context.brandLoading ? t("loadingText") : placeholder;
|
|
2751
|
+
return `
|
|
2752
|
+
<div class="import-dialog-vanilla-setting-item">
|
|
2753
|
+
<span class="import-dialog-vanilla-setting-label required">${t("selectBrand")}</span>
|
|
2754
|
+
<div class="import-dialog-vanilla-custom-select" data-field="brandId">
|
|
2755
|
+
<div class="import-dialog-vanilla-select-trigger ${this.context.brandLoading ? "disabled" : ""}">
|
|
2756
|
+
<span class="import-dialog-vanilla-select-value ${!selectedBrand && !this.context.brandLoading ? "import-dialog-vanilla-select-placeholder" : ""}">${displayValue}</span>
|
|
2757
|
+
<span class="import-dialog-vanilla-select-arrow"></span>
|
|
2758
|
+
</div>
|
|
2759
|
+
<div class="import-dialog-vanilla-select-dropdown">
|
|
2760
|
+
${this.context.brandList.map(
|
|
2761
|
+
(item) => `
|
|
2762
|
+
<div class="import-dialog-vanilla-select-option ${this.context.formData.brandId === item.value ? "selected" : ""}"
|
|
2763
|
+
data-value="${item.value}">
|
|
2764
|
+
${item.label}
|
|
2765
|
+
</div>
|
|
2766
|
+
`
|
|
2767
|
+
).join("")}
|
|
2768
|
+
</div>
|
|
2769
|
+
</div>
|
|
2770
|
+
</div>
|
|
2771
|
+
`;
|
|
2772
|
+
}
|
|
2773
|
+
renderImageRatioSelect() {
|
|
2774
|
+
const options = this.imageRatioOptions;
|
|
2775
|
+
return `
|
|
2776
|
+
<div class="import-dialog-vanilla-setting-item">
|
|
2777
|
+
<span class="import-dialog-vanilla-setting-label required">${t("selectImageRatio")}</span>
|
|
2778
|
+
<div class="import-dialog-vanilla-radio-group">
|
|
2779
|
+
${options.map(
|
|
2780
|
+
(ratio) => `
|
|
2781
|
+
<label class="import-dialog-vanilla-radio">
|
|
2782
|
+
<input type="radio" name="imageRatio" value="${ratio.value}"
|
|
2783
|
+
${this.context.formData.imageRatio === ratio.value ? "checked" : ""} data-field="imageRatio">
|
|
2784
|
+
<span>${ratio.label}</span>
|
|
2785
|
+
</label>
|
|
2786
|
+
`
|
|
2787
|
+
).join("")}
|
|
2788
|
+
</div>
|
|
2789
|
+
</div>
|
|
2790
|
+
`;
|
|
2791
|
+
}
|
|
2792
|
+
renderMonthSelect() {
|
|
2793
|
+
const selectedMonth = this.monthOptions.find(
|
|
2794
|
+
(m) => m === this.context.formData.month
|
|
2795
|
+
);
|
|
2796
|
+
const displayValue = selectedMonth ? `${selectedMonth}${t("month")}` : t("selectMonth");
|
|
2797
|
+
return `
|
|
2798
|
+
<div class="import-dialog-vanilla-setting-item">
|
|
2799
|
+
<span class="import-dialog-vanilla-setting-label required">${t("selectMonth")}</span>
|
|
2800
|
+
<div class="import-dialog-vanilla-custom-select" data-field="month">
|
|
2801
|
+
<div class="import-dialog-vanilla-select-trigger">
|
|
2802
|
+
<span class="import-dialog-vanilla-select-value ${!selectedMonth ? "import-dialog-vanilla-select-placeholder" : ""}">${displayValue}</span>
|
|
2803
|
+
<span class="import-dialog-vanilla-select-arrow"></span>
|
|
2804
|
+
</div>
|
|
2805
|
+
<div class="import-dialog-vanilla-select-dropdown">
|
|
2806
|
+
${this.monthOptions.map(
|
|
2807
|
+
(m) => `
|
|
2808
|
+
<div class="import-dialog-vanilla-select-option ${this.context.formData.month === m ? "selected" : ""}"
|
|
2809
|
+
data-value="${m}">
|
|
2810
|
+
${m}${t("month")}
|
|
2811
|
+
</div>
|
|
2812
|
+
`
|
|
2813
|
+
).join("")}
|
|
2814
|
+
</div>
|
|
2815
|
+
</div>
|
|
2816
|
+
</div>
|
|
2817
|
+
`;
|
|
2818
|
+
}
|
|
2819
|
+
renderDateRangeSelect() {
|
|
2820
|
+
return `
|
|
2821
|
+
<div class="import-dialog-vanilla-setting-item">
|
|
2822
|
+
<span class="import-dialog-vanilla-setting-label required">${t("selectDate")}</span>
|
|
2823
|
+
<div class="import-dialog-vanilla-date-range-container" data-field="dateRange"></div>
|
|
2824
|
+
</div>
|
|
2825
|
+
`;
|
|
2826
|
+
}
|
|
2827
|
+
renderUploadSection() {
|
|
2828
|
+
const config = this.context.currentConfig;
|
|
2829
|
+
const hasFiles = this.context.uploadFileList.length > 0;
|
|
2830
|
+
const isAllUploading = this.context.uploadFileList.some(
|
|
2831
|
+
(f) => f.status === "uploading"
|
|
2832
|
+
);
|
|
2833
|
+
const reachedLimit = this.context.multiple && this.context.uploadFileList.length >= this.context.maxFiles;
|
|
2834
|
+
return `
|
|
2835
|
+
<div class="import-dialog-vanilla-section">
|
|
2836
|
+
<div class="import-dialog-vanilla-section-title">${this.uploadSectionIndex}.${config.uploadTitle}</div>
|
|
2837
|
+
<div class="import-dialog-vanilla-upload-wrapper">
|
|
2838
|
+
${hasFiles ? this.renderFileList() : ""}
|
|
2839
|
+
${!reachedLimit ? `
|
|
2840
|
+
<div id="import-dialog-upload-area" class="import-dialog-vanilla-upload-area ${isAllUploading ? "disabled" : ""}">
|
|
2841
|
+
<input type="file" class="import-dialog-vanilla-file-input" accept="${config.acceptTypes}" ${this.context.multiple ? "multiple" : ""} ${isAllUploading ? "disabled" : ""}>
|
|
2842
|
+
<div class="import-dialog-vanilla-upload-content">
|
|
2843
|
+
<img class="import-dialog-vanilla-upload-icon" src="${uploadImage}" alt="">
|
|
2844
|
+
<p class="import-dialog-vanilla-upload-text">
|
|
2845
|
+
${t("dragFileHere")}
|
|
2846
|
+
${t("or")}
|
|
2847
|
+
<a class="import-dialog-vanilla-upload-link">${config.uploadLinkText}</a>
|
|
2848
|
+
</p>
|
|
2849
|
+
<p class="import-dialog-vanilla-upload-hint">${config.uploadHint}</p>
|
|
2850
|
+
</div>
|
|
2851
|
+
</div>
|
|
2852
|
+
` : ""}
|
|
2853
|
+
</div>
|
|
2854
|
+
</div>
|
|
2855
|
+
`;
|
|
2856
|
+
}
|
|
2857
|
+
renderFileList() {
|
|
2858
|
+
if (this.context.uploadFileList.length === 0) return "";
|
|
2859
|
+
return `
|
|
2860
|
+
<div class="import-dialog-vanilla-file-list">
|
|
2861
|
+
${this.context.uploadFileList.map((fileItem, index) => this.renderFileItem(fileItem, index)).join("")}
|
|
2862
|
+
</div>
|
|
2863
|
+
`;
|
|
2864
|
+
}
|
|
2865
|
+
renderFileItem(fileItem, index) {
|
|
2866
|
+
var _a;
|
|
2867
|
+
const statusClass = `status-${fileItem.status}`;
|
|
2868
|
+
const fileSize = this.formatFileSize(fileItem.size);
|
|
2869
|
+
const isUploading = fileItem.status === "uploading";
|
|
2870
|
+
const isError = fileItem.status === "error";
|
|
2871
|
+
const fileExt = ((_a = fileItem.name.split(".").pop()) == null ? void 0 : _a.toUpperCase()) || "FILE";
|
|
2872
|
+
const widthClass = this.context.multiple ? "" : "width-100";
|
|
2873
|
+
const iconColor = isError ? "#FF1212" : "#FFD741";
|
|
2874
|
+
let metaContent = "";
|
|
2875
|
+
if (isError) {
|
|
2876
|
+
metaContent = `<span class="import-dialog-vanilla-file-error-text">${t("uploadFailed")}</span>`;
|
|
2877
|
+
} else if (isUploading) {
|
|
2878
|
+
metaContent = `<span class="import-dialog-vanilla-file-progress-text">${t("uploading")}...</span><span>·</span><span>${fileSize}</span>`;
|
|
2879
|
+
} else {
|
|
2880
|
+
metaContent = `<span>${fileExt}</span><span>·</span><span>${fileSize}</span>`;
|
|
2881
|
+
}
|
|
2882
|
+
return `
|
|
2883
|
+
<div class="import-dialog-vanilla-file-item ${statusClass} ${widthClass}" data-file-id="${fileItem.id}">
|
|
2884
|
+
<div class="import-dialog-vanilla-file-icon">
|
|
2885
|
+
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2886
|
+
<path d="M4 6C4 4.89543 4.89543 4 6 4H14L18 8H26C27.1046 8 28 8.89543 28 10V26C28 27.1046 27.1046 28 26 28H6C4.89543 28 4 27.1046 4 26V6Z" fill="${iconColor}"/>
|
|
2887
|
+
</svg>
|
|
2888
|
+
</div>
|
|
2889
|
+
<button class="import-dialog-vanilla-file-remove-btn" data-file-index="${index}" title="删除">
|
|
2890
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2891
|
+
<circle cx="8" cy="8" r="8" fill="rgba(0,0,0)"/>
|
|
2892
|
+
<path d="M5 5L11 11M11 5L5 11" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
|
|
2893
|
+
</svg>
|
|
2894
|
+
</button>
|
|
2895
|
+
<div class="import-dialog-vanilla-file-info">
|
|
2896
|
+
<div class="import-dialog-vanilla-file-name" title="${fileItem.name}">${fileItem.name}</div>
|
|
2897
|
+
<div class="import-dialog-vanilla-file-meta">
|
|
2898
|
+
${metaContent}
|
|
2899
|
+
</div>
|
|
2900
|
+
</div>
|
|
2901
|
+
</div>
|
|
2902
|
+
`;
|
|
2903
|
+
}
|
|
2904
|
+
formatFileSize(bytes) {
|
|
2905
|
+
if (bytes === 0) return "0 B";
|
|
2906
|
+
const k = 1024;
|
|
2907
|
+
const sizes = ["B", "KB", "MB", "GB"];
|
|
2908
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2909
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(0)) + sizes[i];
|
|
2910
|
+
}
|
|
2911
|
+
renderUploadProgress() {
|
|
2912
|
+
if (!this.context.isUploading && !this.context.uploadMessage) return "";
|
|
2913
|
+
const progressStatus = this.context.uploadMessageType === "error" ? "error" : this.context.uploadProgress === 100 ? "success" : "active";
|
|
2914
|
+
return `
|
|
2915
|
+
<div class="import-dialog-vanilla-upload-progress">
|
|
2916
|
+
${this.context.isUploading || this.context.uploadProgress > 0 ? `
|
|
2917
|
+
<div class="import-dialog-vanilla-progress-bar">
|
|
2918
|
+
<div class="import-dialog-vanilla-progress-inner ${progressStatus}" style="width: ${this.context.uploadProgress}%"></div>
|
|
2919
|
+
</div>
|
|
2920
|
+
<span class="import-dialog-vanilla-progress-text">${this.context.uploadProgress}%</span>
|
|
2921
|
+
` : ""}
|
|
2922
|
+
${this.context.uploadMessage ? `
|
|
2923
|
+
<div class="import-dialog-vanilla-upload-message ${this.context.uploadMessageType}">
|
|
2924
|
+
${this.context.uploadMessage}
|
|
2925
|
+
</div>
|
|
2926
|
+
` : ""}
|
|
2927
|
+
</div>
|
|
2928
|
+
`;
|
|
2929
|
+
}
|
|
2930
|
+
renderTipsSection() {
|
|
2931
|
+
return `
|
|
2932
|
+
<div class="import-dialog-vanilla-section">
|
|
2933
|
+
<div class="import-dialog-vanilla-section-title">
|
|
2934
|
+
<span class="import-dialog-vanilla-tips-icon"><i class="iconfont icon-icon_tips"></i></span>
|
|
2935
|
+
<span class="import-dialog-vanilla-tips-title">${t("tipsTitle")}</span>
|
|
2936
|
+
</div>
|
|
2937
|
+
<div class="import-dialog-vanilla-tips-content">
|
|
2938
|
+
${this.tipsList.map((tip) => `<p class="import-dialog-vanilla-tip-item">${tip}</p>`).join("")}
|
|
2939
|
+
</div>
|
|
2940
|
+
</div>
|
|
2941
|
+
`;
|
|
2942
|
+
}
|
|
2943
|
+
renderFooter() {
|
|
2944
|
+
return `
|
|
2945
|
+
<div class="import-dialog-vanilla-footer">
|
|
2946
|
+
<button id="import-dialog-cancel-btn" class="import-dialog-vanilla-btn">${t("cancel")}</button>
|
|
2947
|
+
<button id="import-dialog-confirm-btn" class="import-dialog-vanilla-btn import-dialog-vanilla-btn-primary">
|
|
2948
|
+
${t("confirm")}
|
|
2949
|
+
</button>
|
|
2950
|
+
</div>
|
|
2951
|
+
${this.context.confirmLoading ? `
|
|
2952
|
+
<div class="import-dialog-vanilla-loading-overlay">
|
|
2953
|
+
<div class="import-dialog-vanilla-loading-spinner"></div>
|
|
2954
|
+
</div>
|
|
2955
|
+
` : ""}
|
|
2956
|
+
`;
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
const generateId = () => {
|
|
2960
|
+
return `file_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
2961
|
+
};
|
|
2962
|
+
class ImportDialogUploader {
|
|
2963
|
+
constructor(config, callbacks = {}) {
|
|
2964
|
+
__publicField(this, "config");
|
|
2965
|
+
__publicField(this, "callbacks");
|
|
2966
|
+
__publicField(this, "resumable");
|
|
2967
|
+
// Resumable实例
|
|
2968
|
+
__publicField(this, "currentFileItem", null);
|
|
2969
|
+
// 当前上传的文件项
|
|
2970
|
+
// Promise resolve/reject 函数存储
|
|
2971
|
+
__publicField(this, "uploadCompleteResolve");
|
|
2972
|
+
__publicField(this, "uploadCompleteReject");
|
|
2973
|
+
// 上传状态
|
|
2974
|
+
__publicField(this, "uploadFileList", []);
|
|
2975
|
+
//上传文件列表
|
|
2976
|
+
__publicField(this, "fileList", []);
|
|
2977
|
+
// 原始文件列表
|
|
2978
|
+
__publicField(this, "uploadProgress", 0);
|
|
2979
|
+
__publicField(this, "isUploading", false);
|
|
2980
|
+
__publicField(this, "uploadMessage", "");
|
|
2981
|
+
__publicField(this, "uploadMessageType", "info");
|
|
2982
|
+
this.config = config;
|
|
2983
|
+
this.callbacks = callbacks;
|
|
2984
|
+
}
|
|
2985
|
+
/**
|
|
2986
|
+
* 判断是否应该使用分片上传
|
|
2987
|
+
* 条件:配置了chunkedUpload 且 是单文件模式
|
|
2988
|
+
*/
|
|
2989
|
+
shouldUseChunkedUpload() {
|
|
2990
|
+
const uploadConfig = this.config.uploadConfig;
|
|
2991
|
+
return !!((uploadConfig == null ? void 0 : uploadConfig.chunkedUpload) && !this.config.multiple);
|
|
2992
|
+
}
|
|
2993
|
+
/**
|
|
2994
|
+
* 获取分片上传配置
|
|
2995
|
+
*/
|
|
2996
|
+
getChunkedUploadConfig() {
|
|
2997
|
+
var _a;
|
|
2998
|
+
return ((_a = this.config.uploadConfig) == null ? void 0 : _a.chunkedUpload) || null;
|
|
2999
|
+
}
|
|
3000
|
+
updateConfig(config) {
|
|
3001
|
+
this.config = { ...this.config, ...config };
|
|
3002
|
+
}
|
|
3003
|
+
updateCallbacks(callbacks) {
|
|
3004
|
+
this.callbacks = { ...this.callbacks, ...callbacks };
|
|
3005
|
+
}
|
|
3006
|
+
reset() {
|
|
3007
|
+
this.cancelUpload();
|
|
3008
|
+
this.uploadFileList = [];
|
|
3009
|
+
this.fileList = [];
|
|
3010
|
+
this.uploadProgress = 0;
|
|
3011
|
+
this.isUploading = false;
|
|
3012
|
+
this.uploadMessage = "";
|
|
3013
|
+
this.uploadMessageType = "info";
|
|
3014
|
+
this.currentFileItem = null;
|
|
3015
|
+
this.uploadCompleteResolve = void 0;
|
|
3016
|
+
this.uploadCompleteReject = void 0;
|
|
3017
|
+
}
|
|
3018
|
+
/**
|
|
3019
|
+
* 文件上传之前的校验 选择文件时调用
|
|
3020
|
+
*/
|
|
3021
|
+
beforeUpload(files) {
|
|
3022
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
3023
|
+
const fileArray = Array.isArray(files) ? files : [files];
|
|
3024
|
+
if (!fileArray.length) {
|
|
3025
|
+
(_b = (_a = this.callbacks).onMessage) == null ? void 0 : _b.call(_a, "请选择文件", "warning");
|
|
3026
|
+
return false;
|
|
3027
|
+
}
|
|
3028
|
+
if (this.config.multiple) {
|
|
3029
|
+
const totalFiles = this.uploadFileList.length + fileArray.length;
|
|
3030
|
+
if (totalFiles > this.config.maxFiles) {
|
|
3031
|
+
(_d = (_c = this.callbacks).onMessage) == null ? void 0 : _d.call(
|
|
3032
|
+
_c,
|
|
3033
|
+
`最多只能上传 ${this.config.maxFiles} 个文件`,
|
|
3034
|
+
"warning"
|
|
3035
|
+
);
|
|
3036
|
+
return false;
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
for (const file of fileArray) {
|
|
3040
|
+
if (file.size > this.config.maxFileSize) {
|
|
3041
|
+
(_f = (_e = this.callbacks).onMessage) == null ? void 0 : _f.call(
|
|
3042
|
+
_e,
|
|
3043
|
+
`文件 ${file.name} 超过最大限制 ${Math.round(this.config.maxFileSize / 1024 / 1024)}MB`,
|
|
3044
|
+
"warning"
|
|
3045
|
+
);
|
|
3046
|
+
return false;
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
for (const file of fileArray) {
|
|
3050
|
+
const fileItem = {
|
|
3051
|
+
id: generateId(),
|
|
3052
|
+
file,
|
|
3053
|
+
name: file.name,
|
|
3054
|
+
size: file.size,
|
|
3055
|
+
progress: 0,
|
|
3056
|
+
status: "pending"
|
|
3057
|
+
};
|
|
3058
|
+
if (this.config.multiple) {
|
|
3059
|
+
this.uploadFileList.unshift(fileItem);
|
|
3060
|
+
this.fileList.unshift(file);
|
|
3061
|
+
} else {
|
|
3062
|
+
this.uploadFileList = [fileItem];
|
|
3063
|
+
this.fileList = [file];
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
(_h = (_g = this.callbacks).onUpdate) == null ? void 0 : _h.call(_g);
|
|
3067
|
+
(_j = (_i = this.callbacks).onFileChange) == null ? void 0 : _j.call(_i, this.uploadFileList);
|
|
3068
|
+
const autoUpload = ((_k = this.config.uploadConfig) == null ? void 0 : _k.autoUpload) != null ? this.config.uploadConfig.autoUpload : false;
|
|
3069
|
+
if (autoUpload) {
|
|
3070
|
+
this.startUploadFiles();
|
|
3071
|
+
}
|
|
3072
|
+
return true;
|
|
3073
|
+
}
|
|
3074
|
+
/**
|
|
3075
|
+
* 删除文件
|
|
3076
|
+
*/
|
|
3077
|
+
removeFile(index) {
|
|
3078
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3079
|
+
if (index !== void 0 && index >= 0 && index < this.uploadFileList.length) {
|
|
3080
|
+
const fileItem = this.uploadFileList[index];
|
|
3081
|
+
if (fileItem.status === "uploading") {
|
|
3082
|
+
(_b = (_a = this.callbacks).onMessage) == null ? void 0 : _b.call(_a, "正在上传中,无法删除", "warning");
|
|
3083
|
+
return false;
|
|
3084
|
+
}
|
|
3085
|
+
this.uploadFileList.splice(index, 1);
|
|
3086
|
+
this.fileList.splice(index, 1);
|
|
3087
|
+
} else {
|
|
3088
|
+
this.uploadFileList = [];
|
|
3089
|
+
this.fileList = [];
|
|
3090
|
+
}
|
|
3091
|
+
this.uploadProgress = 0;
|
|
3092
|
+
this.uploadMessage = "";
|
|
3093
|
+
this.uploadMessageType = "info";
|
|
3094
|
+
this.isUploading = false;
|
|
3095
|
+
(_d = (_c = this.callbacks).onFileChange) == null ? void 0 : _d.call(_c, this.uploadFileList);
|
|
3096
|
+
(_f = (_e = this.callbacks).onUpdate) == null ? void 0 : _f.call(_e);
|
|
3097
|
+
return true;
|
|
3098
|
+
}
|
|
3099
|
+
async startUploadFiles() {
|
|
3100
|
+
const pendingFiles = this.uploadFileList.filter(
|
|
3101
|
+
(f) => f.status === "pending"
|
|
3102
|
+
);
|
|
3103
|
+
for (const fileItem of pendingFiles) {
|
|
3104
|
+
await this.uploadSingleFile(fileItem);
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
/**
|
|
3108
|
+
* 单个文件上传
|
|
3109
|
+
* @param fileItem
|
|
3110
|
+
*/
|
|
3111
|
+
async uploadSingleFile(fileItem) {
|
|
3112
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3113
|
+
fileItem.status = "uploading";
|
|
3114
|
+
fileItem.progress = 0;
|
|
3115
|
+
this.isUploading = true;
|
|
3116
|
+
(_b = (_a = this.callbacks).onUpdate) == null ? void 0 : _b.call(_a);
|
|
3117
|
+
try {
|
|
3118
|
+
if (this.shouldUseChunkedUpload()) {
|
|
3119
|
+
await this.uploadFileChunked(fileItem);
|
|
3120
|
+
} else {
|
|
3121
|
+
await this.uploadFileSimple(fileItem);
|
|
3122
|
+
}
|
|
3123
|
+
fileItem.status = "success";
|
|
3124
|
+
fileItem.progress = 100;
|
|
3125
|
+
(_d = (_c = this.callbacks).onUploadSuccess) == null ? void 0 : _d.call(_c, fileItem, fileItem.response);
|
|
3126
|
+
} catch (error) {
|
|
3127
|
+
fileItem.status = "error";
|
|
3128
|
+
fileItem.errorMessage = error instanceof Error ? error.message : "上传失败";
|
|
3129
|
+
(_f = (_e = this.callbacks).onUploadError) == null ? void 0 : _f.call(_e, fileItem, error);
|
|
3130
|
+
}
|
|
3131
|
+
this.isUploading = this.uploadFileList.some(
|
|
3132
|
+
(f) => f.status === "uploading"
|
|
3133
|
+
);
|
|
3134
|
+
(_h = (_g = this.callbacks).onUpdate) == null ? void 0 : _h.call(_g);
|
|
3135
|
+
this.updateOverallProgress();
|
|
3136
|
+
}
|
|
3137
|
+
/**
|
|
3138
|
+
* 普通上传(非分片)
|
|
3139
|
+
*/
|
|
3140
|
+
async uploadFileSimple(fileItem) {
|
|
3141
|
+
var _a;
|
|
3142
|
+
const customUpload = (_a = this.config.uploadConfig) == null ? void 0 : _a.customUpload;
|
|
3143
|
+
if (customUpload) {
|
|
3144
|
+
fileItem.response = await customUpload(fileItem.file, (progress) => {
|
|
3145
|
+
var _a2, _b, _c, _d;
|
|
3146
|
+
fileItem.progress = progress;
|
|
3147
|
+
(_b = (_a2 = this.callbacks).onUploadProgress) == null ? void 0 : _b.call(_a2, fileItem, progress);
|
|
3148
|
+
(_d = (_c = this.callbacks).onUpdate) == null ? void 0 : _d.call(_c);
|
|
3149
|
+
});
|
|
3150
|
+
} else {
|
|
3151
|
+
fileItem.response = fileItem.file;
|
|
3152
|
+
}
|
|
3153
|
+
}
|
|
3154
|
+
/**
|
|
3155
|
+
* 分片上传
|
|
3156
|
+
* 业务侧只需提供:initUpload, getResumableConfig, mergeChunks
|
|
3157
|
+
*/
|
|
3158
|
+
async uploadFileChunked(fileItem) {
|
|
3159
|
+
const chunkedConfig = this.getChunkedUploadConfig();
|
|
3160
|
+
if (!chunkedConfig) {
|
|
3161
|
+
throw new Error("分片上传需要配置 chunkedUpload");
|
|
3162
|
+
}
|
|
3163
|
+
try {
|
|
3164
|
+
const initResult = await chunkedConfig.initUpload(
|
|
3165
|
+
fileItem.file.name,
|
|
3166
|
+
fileItem.file.size
|
|
3167
|
+
);
|
|
3168
|
+
fileItem.uploadSessionId = initResult.uploadSessionId;
|
|
3169
|
+
this.currentFileItem = fileItem;
|
|
3170
|
+
this.initResumable(chunkedConfig, initResult);
|
|
3171
|
+
this.resumable.addFile(fileItem.file);
|
|
3172
|
+
fileItem.response = await this.waitForUploadComplete();
|
|
3173
|
+
} catch (error) {
|
|
3174
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
3175
|
+
throw err;
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
/**
|
|
3179
|
+
* 等待上传完成
|
|
3180
|
+
*/
|
|
3181
|
+
waitForUploadComplete() {
|
|
3182
|
+
return new Promise((resolve, reject) => {
|
|
3183
|
+
this.uploadCompleteResolve = resolve;
|
|
3184
|
+
this.uploadCompleteReject = reject;
|
|
3185
|
+
});
|
|
3186
|
+
}
|
|
3187
|
+
/**
|
|
3188
|
+
* 初始化Resumable实例
|
|
3189
|
+
*/
|
|
3190
|
+
initResumable(chunkedConfig, initResult) {
|
|
3191
|
+
if (this.resumable) {
|
|
3192
|
+
this.resumable.cancel();
|
|
3193
|
+
}
|
|
3194
|
+
const customConfig = chunkedConfig.getResumableConfig(initResult);
|
|
3195
|
+
const defaultConfig = {
|
|
3196
|
+
chunkSize: initResult.partSize,
|
|
3197
|
+
simultaneousUploads: 3,
|
|
3198
|
+
testChunks: false,
|
|
3199
|
+
method: "multipart",
|
|
3200
|
+
chunkNumberParameterName: "partNumber",
|
|
3201
|
+
totalChunksParameterName: "totalParts",
|
|
3202
|
+
fileParameterName: "file",
|
|
3203
|
+
withCredentials: true,
|
|
3204
|
+
maxChunkRetries: 3,
|
|
3205
|
+
chunkRetryInterval: 1e3,
|
|
3206
|
+
forceChunkSize: true
|
|
3207
|
+
};
|
|
3208
|
+
const finalConfig = { ...defaultConfig, ...customConfig };
|
|
3209
|
+
this.resumable = new Resumable(finalConfig);
|
|
3210
|
+
this.bindResumableEvents();
|
|
3211
|
+
}
|
|
3212
|
+
/**
|
|
3213
|
+
* 绑定Resumable事件监听器
|
|
3214
|
+
*/
|
|
3215
|
+
bindResumableEvents() {
|
|
3216
|
+
this.resumable.on("progress", () => {
|
|
3217
|
+
var _a, _b, _c, _d;
|
|
3218
|
+
const progress = Math.floor(this.resumable.progress() * 100);
|
|
3219
|
+
this.uploadProgress = progress;
|
|
3220
|
+
this.uploadMessage = `正在上传 (${progress}%)...`;
|
|
3221
|
+
if (this.currentFileItem) {
|
|
3222
|
+
this.currentFileItem.progress = Math.min(progress, 90);
|
|
3223
|
+
(_b = (_a = this.callbacks).onUploadProgress) == null ? void 0 : _b.call(
|
|
3224
|
+
_a,
|
|
3225
|
+
this.currentFileItem,
|
|
3226
|
+
this.currentFileItem.progress
|
|
3227
|
+
);
|
|
3228
|
+
}
|
|
3229
|
+
(_d = (_c = this.callbacks).onUpdate) == null ? void 0 : _d.call(_c);
|
|
3230
|
+
});
|
|
3231
|
+
this.resumable.on("fileSuccess", () => {
|
|
3232
|
+
this.handleResumableComplete();
|
|
3233
|
+
});
|
|
3234
|
+
this.resumable.on("error", (message) => {
|
|
3235
|
+
console.error("[Resumable分片上传] 上传错误:", message);
|
|
3236
|
+
this.handleResumableError(message);
|
|
3237
|
+
});
|
|
3238
|
+
this.resumable.on("fileAdded", () => {
|
|
3239
|
+
this.resumable.upload();
|
|
3240
|
+
});
|
|
3241
|
+
this.resumable.on("pause", () => {
|
|
3242
|
+
this.uploadMessage = "上传已暂停";
|
|
3243
|
+
});
|
|
3244
|
+
}
|
|
3245
|
+
/**
|
|
3246
|
+
* 处理Resumable上传完成
|
|
3247
|
+
*/
|
|
3248
|
+
async handleResumableComplete() {
|
|
3249
|
+
var _a;
|
|
3250
|
+
if (!this.currentFileItem || !this.uploadCompleteResolve || !this.uploadCompleteReject) {
|
|
3251
|
+
return;
|
|
3252
|
+
}
|
|
3253
|
+
try {
|
|
3254
|
+
const chunkedConfig = this.getChunkedUploadConfig();
|
|
3255
|
+
if (!chunkedConfig) {
|
|
3256
|
+
throw new Error("分片上传配置缺失");
|
|
3257
|
+
}
|
|
3258
|
+
const mergeResult = await chunkedConfig.mergeChunks(
|
|
3259
|
+
this.currentFileItem.uploadSessionId
|
|
3260
|
+
);
|
|
3261
|
+
if (this.currentFileItem) {
|
|
3262
|
+
this.currentFileItem.progress = 100;
|
|
3263
|
+
}
|
|
3264
|
+
this.uploadMessage = "上传完成";
|
|
3265
|
+
this.uploadMessageType = "success";
|
|
3266
|
+
this.uploadCompleteResolve(mergeResult);
|
|
3267
|
+
this.uploadCompleteResolve = void 0;
|
|
3268
|
+
this.uploadCompleteReject = void 0;
|
|
3269
|
+
} catch (error) {
|
|
3270
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
3271
|
+
this.handleResumableError(err.message);
|
|
3272
|
+
(_a = this.uploadCompleteReject) == null ? void 0 : _a.call(this, error);
|
|
3273
|
+
this.uploadCompleteResolve = void 0;
|
|
3274
|
+
this.uploadCompleteReject = void 0;
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
/**
|
|
3278
|
+
* 处理Resumable上传错误
|
|
3279
|
+
*/
|
|
3280
|
+
handleResumableError(message) {
|
|
3281
|
+
var _a, _b;
|
|
3282
|
+
if (this.currentFileItem) {
|
|
3283
|
+
this.currentFileItem.status = "error";
|
|
3284
|
+
this.currentFileItem.errorMessage = message;
|
|
3285
|
+
}
|
|
3286
|
+
this.uploadMessage = message || "上传失败";
|
|
3287
|
+
this.uploadMessageType = "error";
|
|
3288
|
+
this.isUploading = false;
|
|
3289
|
+
if (this.uploadCompleteReject) {
|
|
3290
|
+
this.uploadCompleteReject(new Error(message));
|
|
3291
|
+
this.uploadCompleteResolve = void 0;
|
|
3292
|
+
this.uploadCompleteReject = void 0;
|
|
3293
|
+
}
|
|
3294
|
+
(_b = (_a = this.callbacks).onUpdate) == null ? void 0 : _b.call(_a);
|
|
3295
|
+
}
|
|
3296
|
+
/**
|
|
3297
|
+
* 手动触发上传(用于autoUpload=false的场景)
|
|
3298
|
+
*/
|
|
3299
|
+
async startUpload() {
|
|
3300
|
+
await this.startUploadFiles();
|
|
3301
|
+
}
|
|
3302
|
+
/**
|
|
3303
|
+
* 暂停上传
|
|
3304
|
+
*/
|
|
3305
|
+
pauseUpload() {
|
|
3306
|
+
if (this.resumable) {
|
|
3307
|
+
this.resumable.pause();
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
/**
|
|
3311
|
+
* 恢复上传
|
|
3312
|
+
*/
|
|
3313
|
+
resumeUpload() {
|
|
3314
|
+
if (this.resumable) {
|
|
3315
|
+
this.resumable.upload();
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
/**
|
|
3319
|
+
* 取消上传
|
|
3320
|
+
*/
|
|
3321
|
+
cancelUpload() {
|
|
3322
|
+
var _a, _b;
|
|
3323
|
+
if (this.resumable) {
|
|
3324
|
+
this.resumable.cancel();
|
|
3325
|
+
this.resumable = null;
|
|
3326
|
+
}
|
|
3327
|
+
this.currentFileItem = null;
|
|
3328
|
+
this.isUploading = false;
|
|
3329
|
+
this.uploadMessage = "上传已取消";
|
|
3330
|
+
this.uploadMessageType = "info";
|
|
3331
|
+
(_b = (_a = this.callbacks).onUpdate) == null ? void 0 : _b.call(_a);
|
|
3332
|
+
}
|
|
3333
|
+
updateOverallProgress() {
|
|
3334
|
+
if (this.uploadFileList.length === 0) {
|
|
3335
|
+
this.uploadProgress = 0;
|
|
3336
|
+
return;
|
|
3337
|
+
}
|
|
3338
|
+
const totalProgress = this.uploadFileList.reduce(
|
|
3339
|
+
(sum, f) => sum + f.progress,
|
|
3340
|
+
0
|
|
3341
|
+
);
|
|
3342
|
+
this.uploadProgress = Math.round(
|
|
3343
|
+
totalProgress / this.uploadFileList.length
|
|
3344
|
+
);
|
|
3345
|
+
}
|
|
3346
|
+
/**
|
|
3347
|
+
* 是否有文件正在上传中
|
|
3348
|
+
*/
|
|
3349
|
+
hasUploadingFiles() {
|
|
3350
|
+
return this.uploadFileList.some((f) => f.status === "uploading");
|
|
3351
|
+
}
|
|
3352
|
+
/**
|
|
3353
|
+
* 是否有待上传的文件(用于延迟上传场景)
|
|
3354
|
+
*/
|
|
3355
|
+
hasPendingFiles() {
|
|
3356
|
+
return this.uploadFileList.some((f) => f.status === "pending");
|
|
3357
|
+
}
|
|
3358
|
+
hasAllFilesUploaded() {
|
|
3359
|
+
return this.uploadFileList.length > 0 && this.uploadFileList.every((f) => f.status === "success");
|
|
3360
|
+
}
|
|
3361
|
+
getFailedFiles() {
|
|
3362
|
+
return this.uploadFileList.filter((f) => f.status === "error");
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
const ICON_MAP = {
|
|
3366
|
+
success: "icon-success",
|
|
3367
|
+
error: "icon-cuowu",
|
|
3368
|
+
warning: "icon-warning",
|
|
3369
|
+
info: "icon-info"
|
|
3370
|
+
};
|
|
3371
|
+
const activeToasts = /* @__PURE__ */ new Set();
|
|
3372
|
+
function showToast(options) {
|
|
3373
|
+
const { message, type, duration = 3e3, closable = true } = options;
|
|
3374
|
+
const toast2 = document.createElement("div");
|
|
3375
|
+
toast2.className = `import-dialog-vanilla-toast ${type}`;
|
|
3376
|
+
const iconClass = ICON_MAP[type] || ICON_MAP.info;
|
|
3377
|
+
toast2.innerHTML = `
|
|
3378
|
+
<div class="import-dialog-vanilla-toast-content">
|
|
3379
|
+
<i class="iconfont ${iconClass} import-dialog-vanilla-toast-icon"></i>
|
|
3380
|
+
<span class="import-dialog-vanilla-toast-message">${message}</span>
|
|
3381
|
+
</div>
|
|
3382
|
+
${closable ? `<button class="import-dialog-vanilla-toast-close" data-action="close-toast">
|
|
3383
|
+
<i class="iconfont icon-guanbi"></i>
|
|
3384
|
+
</button>` : ""}
|
|
3385
|
+
`;
|
|
3386
|
+
document.body.appendChild(toast2);
|
|
3387
|
+
const timers = [];
|
|
3388
|
+
const close = () => {
|
|
3389
|
+
toast2.classList.add("fade-out");
|
|
3390
|
+
const removeTimer = window.setTimeout(() => {
|
|
3391
|
+
toast2.remove();
|
|
3392
|
+
activeToasts.delete(instance);
|
|
3393
|
+
}, 3e3);
|
|
3394
|
+
timers.push(removeTimer);
|
|
3395
|
+
};
|
|
3396
|
+
const instance = {
|
|
3397
|
+
element: toast2,
|
|
3398
|
+
timers,
|
|
3399
|
+
close
|
|
3400
|
+
};
|
|
3401
|
+
activeToasts.add(instance);
|
|
3402
|
+
if (closable) {
|
|
3403
|
+
const closeBtn = toast2.querySelector('[data-action="close-toast"]');
|
|
3404
|
+
if (closeBtn) {
|
|
3405
|
+
closeBtn.addEventListener("click", close);
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
if (duration > 0) {
|
|
3409
|
+
const autoCloseTimer = window.setTimeout(close, duration);
|
|
3410
|
+
timers.push(autoCloseTimer);
|
|
3411
|
+
}
|
|
3412
|
+
return instance;
|
|
3413
|
+
}
|
|
3414
|
+
function clearAllToasts() {
|
|
3415
|
+
activeToasts.forEach((instance) => {
|
|
3416
|
+
instance.timers.forEach((timerId) => {
|
|
3417
|
+
window.clearTimeout(timerId);
|
|
3418
|
+
});
|
|
3419
|
+
instance.element.remove();
|
|
3420
|
+
});
|
|
3421
|
+
activeToasts.clear();
|
|
3422
|
+
}
|
|
3423
|
+
const _ImportDialog = class _ImportDialog {
|
|
3424
|
+
constructor(container) {
|
|
3425
|
+
// DOM相关
|
|
3426
|
+
__publicField(this, "container", null);
|
|
3427
|
+
__publicField(this, "modalElement", null);
|
|
3428
|
+
__publicField(this, "styleElement", null);
|
|
3429
|
+
__publicField(this, "dateRangePicker", null);
|
|
3430
|
+
// 运行时状态(必要的)
|
|
3431
|
+
__publicField(this, "activeTabIndex", 0);
|
|
3432
|
+
__publicField(this, "brandList", []);
|
|
3433
|
+
__publicField(this, "brandLoading", false);
|
|
3434
|
+
__publicField(this, "confirmLoading", false);
|
|
3435
|
+
__publicField(this, "formData", {
|
|
3436
|
+
brandId: void 0,
|
|
3437
|
+
imageRatio: "original",
|
|
3438
|
+
month: 1,
|
|
3439
|
+
dateRange: [null, null]
|
|
3440
|
+
});
|
|
3441
|
+
// 当前弹窗配置(每次openModal时设置)
|
|
3442
|
+
__publicField(this, "modalOptions", {});
|
|
3443
|
+
// 渲染器和上传器
|
|
3444
|
+
__publicField(this, "renderer");
|
|
3445
|
+
/**
|
|
3446
|
+
* 文件上传管理器 - 负责处理所有文件上传相关的逻辑
|
|
3447
|
+
*
|
|
3448
|
+
* 功能:
|
|
3449
|
+
* 1. 文件状态管理:维护上传文件列表、进度、状态等
|
|
3450
|
+
* 2. 文件操作:添加、删除、重置文件
|
|
3451
|
+
* 3. 上传控制:开始/停止上传、进度跟踪
|
|
3452
|
+
* 4. 错误处理:失败文件管理、错误消息显示
|
|
3453
|
+
* 5. 配置管理:动态更新上传参数(多文件、分块、大小限制等)
|
|
3454
|
+
*
|
|
3455
|
+
* 避免了在 ImportDialog 中直接处理复杂的文件上传逻辑,实现了职责分离
|
|
3456
|
+
*/
|
|
3457
|
+
__publicField(this, "uploader");
|
|
3458
|
+
// 事件回调
|
|
3459
|
+
__publicField(this, "onTabChangeCallback");
|
|
3460
|
+
__publicField(this, "onBrandChangeCallback");
|
|
3461
|
+
__publicField(this, "handleDocumentClick", (e) => {
|
|
3462
|
+
const target = e.target;
|
|
3463
|
+
const clickedInsideSelect = Array.from(
|
|
3464
|
+
document.querySelectorAll(".import-dialog-vanilla-custom-select")
|
|
3465
|
+
).some((select) => select.contains(target));
|
|
3466
|
+
if (!clickedInsideSelect) {
|
|
3467
|
+
this.closeAllSelects();
|
|
3468
|
+
}
|
|
3469
|
+
});
|
|
3470
|
+
this.container = container || document.body;
|
|
3471
|
+
this.injectStyles();
|
|
3472
|
+
this.initUploader();
|
|
3473
|
+
}
|
|
3474
|
+
injectStyles() {
|
|
3475
|
+
if (document.getElementById("import-dialog-vanilla-styles")) return;
|
|
3476
|
+
this.styleElement = document.createElement("style");
|
|
3477
|
+
this.styleElement.id = "import-dialog-vanilla-styles";
|
|
3478
|
+
this.styleElement.textContent = getImportDialogStyles();
|
|
3479
|
+
document.head.appendChild(this.styleElement);
|
|
3480
|
+
}
|
|
3481
|
+
/**
|
|
3482
|
+
* 上传相关的逻辑处理
|
|
3483
|
+
*/
|
|
3484
|
+
initUploader() {
|
|
3485
|
+
this.uploader = new ImportDialogUploader(
|
|
3486
|
+
{
|
|
3487
|
+
multiple: false,
|
|
3488
|
+
maxFiles: 10,
|
|
3489
|
+
maxFileSize: 100 * 1024 * 1024
|
|
3490
|
+
},
|
|
3491
|
+
{
|
|
3492
|
+
onUpdate: () => this.updateModal(),
|
|
3493
|
+
onMessage: (msg, type) => this.showMessage(msg, type),
|
|
3494
|
+
onFileChange: (files) => {
|
|
3495
|
+
var _a, _b;
|
|
3496
|
+
return (_b = (_a = this.modalOptions).onFileChange) == null ? void 0 : _b.call(_a, files);
|
|
3497
|
+
},
|
|
3498
|
+
onUploadProgress: (file, progress) => {
|
|
3499
|
+
var _a, _b;
|
|
3500
|
+
return (_b = (_a = this.modalOptions).onUploadProgress) == null ? void 0 : _b.call(_a, file, progress);
|
|
3501
|
+
},
|
|
3502
|
+
onUploadSuccess: (file, response) => {
|
|
3503
|
+
var _a, _b;
|
|
3504
|
+
return (_b = (_a = this.modalOptions).onUploadSuccess) == null ? void 0 : _b.call(_a, file, response);
|
|
3505
|
+
},
|
|
3506
|
+
onUploadError: (file, error) => {
|
|
3507
|
+
var _a, _b;
|
|
3508
|
+
return (_b = (_a = this.modalOptions).onUploadError) == null ? void 0 : _b.call(_a, file, error);
|
|
3509
|
+
}
|
|
3510
|
+
}
|
|
3511
|
+
);
|
|
3512
|
+
}
|
|
3513
|
+
get currentConfig() {
|
|
3514
|
+
const templateType = this.modalOptions.templateType || TemplateTypeEnum.BASE;
|
|
3515
|
+
const translatedConfigs = getTranslatedTemplateConfigs(t);
|
|
3516
|
+
const baseConfig = translatedConfigs[templateType] || translatedConfigs[TemplateTypeEnum.BASE];
|
|
3517
|
+
const opts = this.modalOptions;
|
|
3518
|
+
return {
|
|
3519
|
+
...baseConfig,
|
|
3520
|
+
tabs: opts.tabs || baseConfig.tabs,
|
|
3521
|
+
showBrand: opts.showBrand != null ? opts.showBrand : baseConfig.showBrand,
|
|
3522
|
+
showImageRatio: opts.showImageRatio != null ? opts.showImageRatio : baseConfig.showImageRatio,
|
|
3523
|
+
showMonth: opts.showMonth != null ? opts.showMonth : baseConfig.showMonth,
|
|
3524
|
+
showDateRange: opts.showDateRange != null ? opts.showDateRange : baseConfig.showDateRange,
|
|
3525
|
+
uploadTitle: opts.uploadTitle || baseConfig.uploadTitle,
|
|
3526
|
+
uploadLinkText: opts.uploadLinkText || baseConfig.uploadLinkText,
|
|
3527
|
+
uploadHint: opts.uploadHint || baseConfig.uploadHint,
|
|
3528
|
+
acceptTypes: opts.acceptTypes || baseConfig.acceptTypes,
|
|
3529
|
+
tips: opts.tips || baseConfig.tips,
|
|
3530
|
+
templateUrl: opts.templateUrl || baseConfig.templateUrl
|
|
3531
|
+
};
|
|
3532
|
+
}
|
|
3533
|
+
get dialogTitle() {
|
|
3534
|
+
return this.modalOptions.title || t("batchImport");
|
|
3535
|
+
}
|
|
3536
|
+
get dialogWidth() {
|
|
3537
|
+
return this.modalOptions.width || "480px";
|
|
3538
|
+
}
|
|
3539
|
+
getRenderContext() {
|
|
3540
|
+
var _a, _b;
|
|
3541
|
+
return {
|
|
3542
|
+
currentConfig: this.currentConfig,
|
|
3543
|
+
dialogTitle: this.dialogTitle,
|
|
3544
|
+
width: this.dialogWidth,
|
|
3545
|
+
activeTabIndex: this.activeTabIndex,
|
|
3546
|
+
brandList: this.brandList,
|
|
3547
|
+
brandLoading: this.brandLoading,
|
|
3548
|
+
brandPlaceholder: this.modalOptions.brandPlaceholder || t("defaultBrand"),
|
|
3549
|
+
formData: this.formData,
|
|
3550
|
+
uploadFileList: this.uploader.uploadFileList,
|
|
3551
|
+
multiple: ((_a = this.modalOptions.uploadConfig) == null ? void 0 : _a.multiple) != null ? this.modalOptions.uploadConfig.multiple : false,
|
|
3552
|
+
maxFiles: ((_b = this.modalOptions.uploadConfig) == null ? void 0 : _b.maxFiles) != null ? this.modalOptions.uploadConfig.maxFiles : 10,
|
|
3553
|
+
confirmLoading: this.confirmLoading,
|
|
3554
|
+
isUploading: this.uploader.isUploading,
|
|
3555
|
+
uploadProgress: this.uploader.uploadProgress,
|
|
3556
|
+
uploadMessage: this.uploader.uploadMessage,
|
|
3557
|
+
uploadMessageType: this.uploader.uploadMessageType
|
|
3558
|
+
};
|
|
3559
|
+
}
|
|
3560
|
+
createModal() {
|
|
3561
|
+
var _a;
|
|
3562
|
+
if (this.modalElement) {
|
|
3563
|
+
this.modalElement.remove();
|
|
3564
|
+
}
|
|
3565
|
+
this.renderer = new ImportDialogRenderer(this.getRenderContext());
|
|
3566
|
+
this.modalElement = document.createElement("div");
|
|
3567
|
+
this.modalElement.className = "import-dialog-vanilla-wrapper";
|
|
3568
|
+
this.modalElement.innerHTML = this.renderer.render();
|
|
3569
|
+
(_a = this.container) == null ? void 0 : _a.appendChild(this.modalElement);
|
|
3570
|
+
this.bindEvents();
|
|
3571
|
+
this.initDateRangePicker();
|
|
3572
|
+
}
|
|
3573
|
+
/**
|
|
3574
|
+
* 更新模态框界面 - 核心UI更新机制
|
|
3575
|
+
*
|
|
3576
|
+
* 功能:
|
|
3577
|
+
* 1. 保存当前日期选择器的状态(避免用户输入丢失)
|
|
3578
|
+
* 2. 更新渲染器上下文并重新生成HTML
|
|
3579
|
+
* 3. 重新绑定所有事件监听器(DOM被替换后需要重新绑定)
|
|
3580
|
+
* 4. 如果启用了日期范围选择器,重新初始化并恢复状态
|
|
3581
|
+
*
|
|
3582
|
+
* 调用场景:
|
|
3583
|
+
* - 文件上传状态变化时
|
|
3584
|
+
* - 品牌数据加载时
|
|
3585
|
+
* - Tab切换时
|
|
3586
|
+
* - 确认按钮加载状态变化时
|
|
3587
|
+
* - 语言切换时等
|
|
3588
|
+
*/
|
|
3589
|
+
updateModal() {
|
|
3590
|
+
var _a;
|
|
3591
|
+
if (!this.modalElement) return;
|
|
3592
|
+
const datePickerDates = (_a = this.dateRangePicker) == null ? void 0 : _a.getDates();
|
|
3593
|
+
this.renderer.updateContext(this.getRenderContext());
|
|
3594
|
+
this.modalElement.innerHTML = this.renderer.render();
|
|
3595
|
+
this.bindEvents();
|
|
3596
|
+
if (this.currentConfig.showDateRange) {
|
|
3597
|
+
if (datePickerDates) {
|
|
3598
|
+
this.formData.dateRange = datePickerDates;
|
|
3599
|
+
}
|
|
3600
|
+
this.initDateRangePicker();
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3603
|
+
initDateRangePicker() {
|
|
3604
|
+
var _a;
|
|
3605
|
+
if (!this.modalElement) return;
|
|
3606
|
+
const container = this.modalElement.querySelector(
|
|
3607
|
+
'[data-field="dateRange"]'
|
|
3608
|
+
);
|
|
3609
|
+
if (!container) return;
|
|
3610
|
+
(_a = this.dateRangePicker) == null ? void 0 : _a.destroy();
|
|
3611
|
+
this.dateRangePicker = new DateRangePicker({
|
|
3612
|
+
container,
|
|
3613
|
+
defaultDates: [this.formData.dateRange[0], this.formData.dateRange[1]],
|
|
3614
|
+
placeholder: [t("startDate"), t("endDate")],
|
|
3615
|
+
shortcuts: this.modalOptions.dateRangeShortcuts,
|
|
3616
|
+
disabledDate: this.modalOptions.disabledDate,
|
|
3617
|
+
onChange: (dates) => {
|
|
3618
|
+
this.formData.dateRange[0] = dates[0];
|
|
3619
|
+
this.formData.dateRange[1] = dates[1] ? new Date(
|
|
3620
|
+
dates[1].getFullYear(),
|
|
3621
|
+
dates[1].getMonth(),
|
|
3622
|
+
dates[1].getDate(),
|
|
3623
|
+
23,
|
|
3624
|
+
59,
|
|
3625
|
+
59
|
|
3626
|
+
) : null;
|
|
3627
|
+
}
|
|
3628
|
+
});
|
|
3629
|
+
}
|
|
3630
|
+
/**
|
|
3631
|
+
* 给 dom 绑定事件
|
|
3632
|
+
* @returns
|
|
3633
|
+
*/
|
|
3634
|
+
bindEvents() {
|
|
3635
|
+
if (!this.modalElement) return;
|
|
3636
|
+
const overlay = this.modalElement.querySelector(
|
|
3637
|
+
".import-dialog-vanilla-overlay"
|
|
3638
|
+
);
|
|
3639
|
+
overlay == null ? void 0 : overlay.addEventListener("click", (e) => e.stopPropagation());
|
|
3640
|
+
const modal = this.modalElement.querySelector(
|
|
3641
|
+
".import-dialog-vanilla-modal"
|
|
3642
|
+
);
|
|
3643
|
+
modal == null ? void 0 : modal.addEventListener("click", (e) => e.stopPropagation());
|
|
3644
|
+
const closeBtn = this.modalElement.querySelector(
|
|
3645
|
+
"#import-dialog-close-btn"
|
|
3646
|
+
);
|
|
3647
|
+
closeBtn == null ? void 0 : closeBtn.addEventListener("click", () => this.handleCancel());
|
|
3648
|
+
const tabs = this.modalElement.querySelectorAll(
|
|
3649
|
+
".import-dialog-vanilla-tab"
|
|
3650
|
+
);
|
|
3651
|
+
tabs.forEach((tab) => {
|
|
3652
|
+
tab.addEventListener("click", (e) => {
|
|
3653
|
+
const index = parseInt(
|
|
3654
|
+
e.currentTarget.dataset.tabIndex || "0"
|
|
3655
|
+
);
|
|
3656
|
+
this.handleTabChange(index);
|
|
3657
|
+
});
|
|
3658
|
+
});
|
|
3659
|
+
const uploadArea = this.modalElement.querySelector(
|
|
3660
|
+
".import-dialog-vanilla-upload-area"
|
|
3661
|
+
);
|
|
3662
|
+
const fileInput = this.modalElement.querySelector(
|
|
3663
|
+
".import-dialog-vanilla-file-input"
|
|
3664
|
+
);
|
|
3665
|
+
uploadArea == null ? void 0 : uploadArea.addEventListener("click", () => {
|
|
3666
|
+
if (!this.uploader.isUploading) {
|
|
3667
|
+
fileInput == null ? void 0 : fileInput.click();
|
|
3668
|
+
}
|
|
3669
|
+
});
|
|
3670
|
+
fileInput == null ? void 0 : fileInput.addEventListener("change", (e) => {
|
|
3671
|
+
var _a;
|
|
3672
|
+
const files = e.target.files;
|
|
3673
|
+
if (files && files.length > 0) {
|
|
3674
|
+
const multiple = ((_a = this.modalOptions.uploadConfig) == null ? void 0 : _a.multiple) != null ? this.modalOptions.uploadConfig.multiple : false;
|
|
3675
|
+
if (multiple) {
|
|
3676
|
+
this.uploader.beforeUpload(Array.from(files));
|
|
3677
|
+
} else {
|
|
3678
|
+
this.uploader.beforeUpload(files[0]);
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
});
|
|
3682
|
+
uploadArea == null ? void 0 : uploadArea.addEventListener("dragover", (e) => {
|
|
3683
|
+
e.preventDefault();
|
|
3684
|
+
uploadArea.classList.add("dragover");
|
|
3685
|
+
});
|
|
3686
|
+
uploadArea == null ? void 0 : uploadArea.addEventListener("dragleave", () => {
|
|
3687
|
+
uploadArea.classList.remove("dragover");
|
|
3688
|
+
});
|
|
3689
|
+
uploadArea == null ? void 0 : uploadArea.addEventListener("drop", (e) => {
|
|
3690
|
+
var _a, _b;
|
|
3691
|
+
e.preventDefault();
|
|
3692
|
+
uploadArea.classList.remove("dragover");
|
|
3693
|
+
const files = (_a = e.dataTransfer) == null ? void 0 : _a.files;
|
|
3694
|
+
if (files && files.length > 0 && !this.uploader.isUploading) {
|
|
3695
|
+
const multiple = ((_b = this.modalOptions.uploadConfig) == null ? void 0 : _b.multiple) != null ? this.modalOptions.uploadConfig.multiple : false;
|
|
3696
|
+
if (multiple) {
|
|
3697
|
+
this.uploader.beforeUpload(Array.from(files));
|
|
3698
|
+
} else {
|
|
3699
|
+
this.uploader.beforeUpload(files[0]);
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3702
|
+
});
|
|
3703
|
+
const removeBtns = this.modalElement.querySelectorAll(
|
|
3704
|
+
".import-dialog-vanilla-file-remove-btn"
|
|
3705
|
+
);
|
|
3706
|
+
removeBtns.forEach((btn) => {
|
|
3707
|
+
btn.addEventListener("click", (e) => {
|
|
3708
|
+
e.stopPropagation();
|
|
3709
|
+
const fileIndex = btn.getAttribute("data-file-index");
|
|
3710
|
+
if (fileIndex !== null) {
|
|
3711
|
+
this.uploader.removeFile(parseInt(fileIndex));
|
|
3712
|
+
} else {
|
|
3713
|
+
this.uploader.removeFile();
|
|
3714
|
+
}
|
|
3715
|
+
});
|
|
3716
|
+
});
|
|
3717
|
+
this.bindFormEvents();
|
|
3718
|
+
const confirmBtn = this.modalElement.querySelector(
|
|
3719
|
+
"#import-dialog-confirm-btn"
|
|
3720
|
+
);
|
|
3721
|
+
confirmBtn == null ? void 0 : confirmBtn.addEventListener("click", () => this.handleConfirm());
|
|
3722
|
+
const cancelBtn = this.modalElement.querySelector(
|
|
3723
|
+
"#import-dialog-cancel-btn"
|
|
3724
|
+
);
|
|
3725
|
+
cancelBtn == null ? void 0 : cancelBtn.addEventListener("click", () => this.handleCancel());
|
|
3726
|
+
}
|
|
3727
|
+
bindFormEvents() {
|
|
3728
|
+
if (!this.modalElement) return;
|
|
3729
|
+
this.bindCustomSelectEvents();
|
|
3730
|
+
const ratioInputs = this.modalElement.querySelectorAll(
|
|
3731
|
+
'[data-field="imageRatio"]'
|
|
3732
|
+
);
|
|
3733
|
+
ratioInputs.forEach((input) => {
|
|
3734
|
+
input.addEventListener("change", (e) => {
|
|
3735
|
+
this.formData.imageRatio = e.target.value;
|
|
3736
|
+
});
|
|
3737
|
+
});
|
|
3738
|
+
}
|
|
3739
|
+
bindCustomSelectEvents() {
|
|
3740
|
+
if (!this.modalElement) return;
|
|
3741
|
+
const customSelects = this.modalElement.querySelectorAll(
|
|
3742
|
+
".import-dialog-vanilla-custom-select"
|
|
3743
|
+
);
|
|
3744
|
+
customSelects.forEach((customSelect) => {
|
|
3745
|
+
const trigger = customSelect.querySelector(
|
|
3746
|
+
".import-dialog-vanilla-select-trigger"
|
|
3747
|
+
);
|
|
3748
|
+
const dropdown = customSelect.querySelector(
|
|
3749
|
+
".import-dialog-vanilla-select-dropdown"
|
|
3750
|
+
);
|
|
3751
|
+
const options = customSelect.querySelectorAll(
|
|
3752
|
+
".import-dialog-vanilla-select-option"
|
|
3753
|
+
);
|
|
3754
|
+
const fieldName = customSelect.getAttribute("data-field");
|
|
3755
|
+
trigger == null ? void 0 : trigger.addEventListener("click", (e) => {
|
|
3756
|
+
e.stopPropagation();
|
|
3757
|
+
if (trigger.classList.contains("disabled")) return;
|
|
3758
|
+
this.closeAllSelects(customSelect);
|
|
3759
|
+
trigger.classList.toggle("active");
|
|
3760
|
+
dropdown == null ? void 0 : dropdown.classList.toggle("show");
|
|
3761
|
+
});
|
|
3762
|
+
options.forEach((option) => {
|
|
3763
|
+
option.addEventListener("click", (e) => {
|
|
3764
|
+
var _a;
|
|
3765
|
+
e.stopPropagation();
|
|
3766
|
+
const value = option.getAttribute("data-value");
|
|
3767
|
+
const label = option.textContent || "";
|
|
3768
|
+
const valueElement = trigger.querySelector(
|
|
3769
|
+
".import-dialog-vanilla-select-value"
|
|
3770
|
+
);
|
|
3771
|
+
if (valueElement) {
|
|
3772
|
+
valueElement.textContent = label;
|
|
3773
|
+
valueElement.classList.remove(
|
|
3774
|
+
"import-dialog-vanilla-select-placeholder"
|
|
3775
|
+
);
|
|
3776
|
+
}
|
|
3777
|
+
options.forEach((opt) => opt.classList.remove("selected"));
|
|
3778
|
+
option.classList.add("selected");
|
|
3779
|
+
trigger.classList.remove("active");
|
|
3780
|
+
dropdown == null ? void 0 : dropdown.classList.remove("show");
|
|
3781
|
+
if (fieldName === "brandId") {
|
|
3782
|
+
this.formData.brandId = value || void 0;
|
|
3783
|
+
(_a = this.onBrandChangeCallback) == null ? void 0 : _a.call(this, value || "");
|
|
3784
|
+
} else if (fieldName === "month") {
|
|
3785
|
+
this.formData.month = parseInt(value || "1");
|
|
3786
|
+
}
|
|
3787
|
+
});
|
|
3788
|
+
});
|
|
3789
|
+
});
|
|
3790
|
+
document.addEventListener("click", this.handleDocumentClick);
|
|
3791
|
+
}
|
|
3792
|
+
closeAllSelects(except) {
|
|
3793
|
+
if (!this.modalElement) return;
|
|
3794
|
+
const customSelects = this.modalElement.querySelectorAll(
|
|
3795
|
+
".import-dialog-vanilla-custom-select"
|
|
3796
|
+
);
|
|
3797
|
+
customSelects.forEach((customSelect) => {
|
|
3798
|
+
if (except && customSelect === except) return;
|
|
3799
|
+
const trigger = customSelect.querySelector(
|
|
3800
|
+
".import-dialog-vanilla-select-trigger"
|
|
3801
|
+
);
|
|
3802
|
+
const dropdown = customSelect.querySelector(
|
|
3803
|
+
".import-dialog-vanilla-select-dropdown"
|
|
3804
|
+
);
|
|
3805
|
+
trigger == null ? void 0 : trigger.classList.remove("active");
|
|
3806
|
+
dropdown == null ? void 0 : dropdown.classList.remove("show");
|
|
3807
|
+
});
|
|
3808
|
+
}
|
|
3809
|
+
resetForm() {
|
|
3810
|
+
const now = /* @__PURE__ */ new Date();
|
|
3811
|
+
const currentMonth = now.getMonth() + 1;
|
|
3812
|
+
const monthStart = new Date(now.getFullYear(), now.getMonth(), 1);
|
|
3813
|
+
const monthEnd = new Date(
|
|
3814
|
+
now.getFullYear(),
|
|
3815
|
+
now.getMonth() + 1,
|
|
3816
|
+
0,
|
|
3817
|
+
23,
|
|
3818
|
+
59,
|
|
3819
|
+
59
|
|
3820
|
+
);
|
|
3821
|
+
this.formData = {
|
|
3822
|
+
brandId: void 0,
|
|
3823
|
+
imageRatio: "original",
|
|
3824
|
+
month: currentMonth,
|
|
3825
|
+
dateRange: [monthStart, monthEnd]
|
|
3826
|
+
};
|
|
3827
|
+
this.uploader.reset();
|
|
3828
|
+
}
|
|
3829
|
+
async loadBrandData() {
|
|
3830
|
+
if (!this.currentConfig.showBrand) return;
|
|
3831
|
+
const brandDataSource = this.modalOptions.brandData;
|
|
3832
|
+
if (Array.isArray(brandDataSource)) {
|
|
3833
|
+
this.brandList = brandDataSource;
|
|
3834
|
+
this.updateModal();
|
|
3835
|
+
} else if (typeof brandDataSource === "function") {
|
|
3836
|
+
this.brandLoading = true;
|
|
3837
|
+
this.updateModal();
|
|
3838
|
+
try {
|
|
3839
|
+
this.brandList = await brandDataSource();
|
|
3840
|
+
} catch (error) {
|
|
3841
|
+
this.brandList = [];
|
|
3842
|
+
} finally {
|
|
3843
|
+
this.brandLoading = false;
|
|
3844
|
+
this.updateModal();
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3847
|
+
}
|
|
3848
|
+
handleTabChange(index) {
|
|
3849
|
+
var _a, _b, _c;
|
|
3850
|
+
this.activeTabIndex = index;
|
|
3851
|
+
const tabData = { index, tab: this.currentConfig.tabs[index] };
|
|
3852
|
+
(_a = this.onTabChangeCallback) == null ? void 0 : _a.call(this, tabData);
|
|
3853
|
+
(_c = (_b = this.modalOptions).onTabChange) == null ? void 0 : _c.call(_b, tabData);
|
|
3854
|
+
this.updateModal();
|
|
3855
|
+
}
|
|
3856
|
+
/**
|
|
3857
|
+
* 取消按钮事件
|
|
3858
|
+
*/
|
|
3859
|
+
async handleCancel() {
|
|
3860
|
+
if (this.modalOptions.onBeforeCancel) {
|
|
3861
|
+
await this.modalOptions.onBeforeCancel();
|
|
3862
|
+
}
|
|
3863
|
+
this.hide();
|
|
3864
|
+
if (this.modalOptions.onCancel) {
|
|
3865
|
+
await this.modalOptions.onCancel();
|
|
3866
|
+
}
|
|
3867
|
+
}
|
|
3868
|
+
/**
|
|
3869
|
+
* 确认按钮事件
|
|
3870
|
+
* @returns
|
|
3871
|
+
*/
|
|
3872
|
+
async handleConfirm() {
|
|
3873
|
+
if (this.uploader.uploadFileList.length === 0) {
|
|
3874
|
+
this.showMessage(t("fileTypeError"), "warning");
|
|
3875
|
+
return;
|
|
3876
|
+
}
|
|
3877
|
+
if (this.uploader.hasUploadingFiles()) {
|
|
3878
|
+
this.showMessage("有文件正在上传中,请等待上传完成", "warning");
|
|
3879
|
+
return;
|
|
3880
|
+
}
|
|
3881
|
+
if (this.uploader.hasPendingFiles()) {
|
|
3882
|
+
this.confirmLoading = true;
|
|
3883
|
+
this.updateModal();
|
|
3884
|
+
try {
|
|
3885
|
+
await this.uploader.startUpload();
|
|
3886
|
+
} catch (error) {
|
|
3887
|
+
console.error("[ImportDialog] 上传失败:", error);
|
|
3888
|
+
this.showMessage("上传失败,请重试", "error");
|
|
3889
|
+
return;
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
const failedFiles = this.uploader.getFailedFiles();
|
|
3893
|
+
console.log("[ImportDialog] 上传失败的文件数:", failedFiles);
|
|
3894
|
+
if (failedFiles.length > 0) {
|
|
3895
|
+
this.showMessage(
|
|
3896
|
+
`有 ${failedFiles.length} 个文件上传失败,请重新上传`,
|
|
3897
|
+
"warning"
|
|
3898
|
+
);
|
|
3899
|
+
this.confirmLoading = false;
|
|
3900
|
+
this.updateModal();
|
|
3901
|
+
return;
|
|
3902
|
+
}
|
|
3903
|
+
if (!this.uploader.hasAllFilesUploaded()) {
|
|
3904
|
+
this.showMessage("请等待所有文件上传完成", "warning");
|
|
3905
|
+
this.confirmLoading = false;
|
|
3906
|
+
this.updateModal();
|
|
3907
|
+
return;
|
|
3908
|
+
}
|
|
3909
|
+
const uploadResponses = this.uploader.uploadFileList.map(
|
|
3910
|
+
(item) => item.response || item.file
|
|
3911
|
+
);
|
|
3912
|
+
const submitData = {
|
|
3913
|
+
files: uploadResponses,
|
|
3914
|
+
formData: { ...this.formData },
|
|
3915
|
+
activeTab: this.currentConfig.tabs[this.activeTabIndex],
|
|
3916
|
+
activeTabIndex: this.activeTabIndex
|
|
3917
|
+
};
|
|
3918
|
+
try {
|
|
3919
|
+
if (this.modalOptions.onBeforeConfirm) {
|
|
3920
|
+
await this.modalOptions.onBeforeConfirm(submitData);
|
|
3921
|
+
}
|
|
3922
|
+
if (this.modalOptions.onConfirm) {
|
|
3923
|
+
const res = await this.modalOptions.onConfirm(submitData);
|
|
3924
|
+
if (res == null ? void 0 : res.success) {
|
|
3925
|
+
this.hide();
|
|
3926
|
+
} else if (res == null ? void 0 : res.message) {
|
|
3927
|
+
this.showMessage(res.message, "error");
|
|
3928
|
+
}
|
|
3929
|
+
}
|
|
3930
|
+
} finally {
|
|
3931
|
+
this.confirmLoading = false;
|
|
3932
|
+
this.updateModal();
|
|
3933
|
+
}
|
|
3934
|
+
}
|
|
3935
|
+
showMessage(message, type) {
|
|
3936
|
+
showToast({ message, type, duration: 3e3 });
|
|
3937
|
+
}
|
|
3938
|
+
// ==================== 公共方法 ====================
|
|
3939
|
+
/**
|
|
3940
|
+
* 内部方法:打开模态框的核心逻辑
|
|
3941
|
+
*/
|
|
3942
|
+
_openModalCore(options) {
|
|
3943
|
+
this.modalOptions = options || {};
|
|
3944
|
+
if (options == null ? void 0 : options.locale) {
|
|
3945
|
+
setLocale(options.locale);
|
|
3946
|
+
}
|
|
3947
|
+
const uploadConfig = options == null ? void 0 : options.uploadConfig;
|
|
3948
|
+
this.uploader.updateConfig({
|
|
3949
|
+
multiple: (uploadConfig == null ? void 0 : uploadConfig.multiple) != null ? uploadConfig.multiple : false,
|
|
3950
|
+
maxFiles: (uploadConfig == null ? void 0 : uploadConfig.maxFiles) != null ? uploadConfig.maxFiles : 10,
|
|
3951
|
+
maxFileSize: (uploadConfig == null ? void 0 : uploadConfig.maxFileSize) != null ? uploadConfig.maxFileSize : 100 * 1024 * 1024,
|
|
3952
|
+
uploadConfig
|
|
3953
|
+
});
|
|
3954
|
+
this.activeTabIndex = (options == null ? void 0 : options.defaultActiveTab) || 0;
|
|
3955
|
+
this.resetForm();
|
|
3956
|
+
this.createModal();
|
|
3957
|
+
this.loadBrandData();
|
|
3958
|
+
}
|
|
3959
|
+
openModal(options) {
|
|
3960
|
+
this._openModalCore(options);
|
|
3961
|
+
}
|
|
3962
|
+
closeModal() {
|
|
3963
|
+
this.handleCancel();
|
|
3964
|
+
}
|
|
3965
|
+
setConfirmLoading(loading) {
|
|
3966
|
+
this.confirmLoading = loading;
|
|
3967
|
+
this.updateModal();
|
|
3968
|
+
}
|
|
3969
|
+
hide() {
|
|
3970
|
+
var _a;
|
|
3971
|
+
(_a = this.dateRangePicker) == null ? void 0 : _a.destroy();
|
|
3972
|
+
this.dateRangePicker = null;
|
|
3973
|
+
if (this.modalElement) {
|
|
3974
|
+
this.modalElement.remove();
|
|
3975
|
+
this.modalElement = null;
|
|
3976
|
+
}
|
|
3977
|
+
document.removeEventListener("click", this.handleDocumentClick);
|
|
3978
|
+
}
|
|
3979
|
+
destroy() {
|
|
3980
|
+
this.hide();
|
|
3981
|
+
clearAllToasts();
|
|
3982
|
+
if (this.styleElement) {
|
|
3983
|
+
this.styleElement.remove();
|
|
3984
|
+
this.styleElement = null;
|
|
3985
|
+
}
|
|
3986
|
+
document.removeEventListener("click", this.handleDocumentClick);
|
|
3987
|
+
}
|
|
3988
|
+
onTabChange(callback) {
|
|
3989
|
+
this.onTabChangeCallback = callback;
|
|
3990
|
+
}
|
|
3991
|
+
onBrandChange(callback) {
|
|
3992
|
+
this.onBrandChangeCallback = callback;
|
|
3993
|
+
}
|
|
3994
|
+
// ==================== 静态方法(单例 + Promise 模式)====================
|
|
3995
|
+
static getInstance() {
|
|
3996
|
+
if (!_ImportDialog.instance) {
|
|
3997
|
+
_ImportDialog.instance = new _ImportDialog(document.body);
|
|
3998
|
+
}
|
|
3999
|
+
return _ImportDialog.instance;
|
|
4000
|
+
}
|
|
4001
|
+
static open(options) {
|
|
4002
|
+
return new Promise((resolve, reject) => {
|
|
4003
|
+
const dialog = _ImportDialog.getInstance();
|
|
4004
|
+
const wrappedOptions = {
|
|
4005
|
+
...options,
|
|
4006
|
+
onBeforeConfirm: async (data) => {
|
|
4007
|
+
if (options == null ? void 0 : options.onBeforeConfirm) {
|
|
4008
|
+
await options.onBeforeConfirm(data);
|
|
4009
|
+
}
|
|
4010
|
+
},
|
|
4011
|
+
onConfirm: async (data) => {
|
|
4012
|
+
if (options == null ? void 0 : options.onConfirm) {
|
|
4013
|
+
const res = await options.onConfirm(data);
|
|
4014
|
+
if (res == null ? void 0 : res.success) {
|
|
4015
|
+
resolve(data);
|
|
4016
|
+
}
|
|
4017
|
+
return res;
|
|
4018
|
+
}
|
|
4019
|
+
resolve(data);
|
|
4020
|
+
},
|
|
4021
|
+
onBeforeCancel: async () => {
|
|
4022
|
+
if (options == null ? void 0 : options.onBeforeCancel) {
|
|
4023
|
+
await options.onBeforeCancel();
|
|
4024
|
+
}
|
|
4025
|
+
},
|
|
4026
|
+
onCancel: () => {
|
|
4027
|
+
if (options == null ? void 0 : options.onCancel) {
|
|
4028
|
+
options.onCancel();
|
|
4029
|
+
}
|
|
4030
|
+
reject(new Error("用户取消"));
|
|
4031
|
+
}
|
|
4032
|
+
};
|
|
4033
|
+
dialog._openModalCore(wrappedOptions);
|
|
4034
|
+
});
|
|
4035
|
+
}
|
|
4036
|
+
static close() {
|
|
4037
|
+
var _a;
|
|
4038
|
+
(_a = _ImportDialog.instance) == null ? void 0 : _a.closeModal();
|
|
4039
|
+
}
|
|
4040
|
+
static setLoading(loading) {
|
|
4041
|
+
var _a;
|
|
4042
|
+
(_a = _ImportDialog.instance) == null ? void 0 : _a.setConfirmLoading(loading);
|
|
4043
|
+
}
|
|
4044
|
+
static isReady() {
|
|
4045
|
+
return _ImportDialog.instance !== null;
|
|
4046
|
+
}
|
|
4047
|
+
static setLocale(locale) {
|
|
4048
|
+
setLocale(locale);
|
|
4049
|
+
if (_ImportDialog.instance) {
|
|
4050
|
+
_ImportDialog.instance.updateModal();
|
|
4051
|
+
}
|
|
4052
|
+
}
|
|
4053
|
+
static getLocale() {
|
|
4054
|
+
return i18n.getLocale();
|
|
4055
|
+
}
|
|
4056
|
+
static destroyInstance() {
|
|
4057
|
+
if (_ImportDialog.instance) {
|
|
4058
|
+
_ImportDialog.instance.destroy();
|
|
4059
|
+
_ImportDialog.instance = null;
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
static install() {
|
|
4063
|
+
if (typeof window !== "undefined") {
|
|
4064
|
+
window.addEventListener("message", (event) => {
|
|
4065
|
+
const { type, data } = event.data || {};
|
|
4066
|
+
if (type === "OPEN_IMPORT_DIALOG") {
|
|
4067
|
+
_ImportDialog.open(data).catch(() => {
|
|
4068
|
+
});
|
|
4069
|
+
} else if (type === "CLOSE_IMPORT_DIALOG") {
|
|
4070
|
+
_ImportDialog.close();
|
|
4071
|
+
}
|
|
4072
|
+
});
|
|
4073
|
+
window.$importDialog = _ImportDialog;
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
};
|
|
4077
|
+
// 静态单例实例
|
|
4078
|
+
__publicField(_ImportDialog, "instance", null);
|
|
4079
|
+
let ImportDialog = _ImportDialog;
|
|
4080
|
+
const importDialogService = ImportDialog;
|
|
4081
|
+
const installImportDialog = () => ImportDialog.install();
|
|
4082
|
+
export {
|
|
4083
|
+
DEFAULT_LOCALE,
|
|
4084
|
+
ExportTypeEnum,
|
|
4085
|
+
I18nLocaleEnum,
|
|
4086
|
+
ImportDialog,
|
|
4087
|
+
TemplateTypeEnum,
|
|
4088
|
+
ImportDialog as default,
|
|
4089
|
+
getLocale,
|
|
4090
|
+
importDialogService,
|
|
4091
|
+
installImportDialog,
|
|
4092
|
+
setLocale,
|
|
4093
|
+
t,
|
|
4094
|
+
types
|
|
4095
|
+
};
|