sheetnext 0.1.1 → 0.1.2

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.
@@ -81144,7 +81144,8 @@ function baseMousedown(event) {
81144
81144
  this.validSelect.style.left = `${w + x + 4}px`;
81145
81145
  this.validSelect.style.top = `${y + h - 22}px`;
81146
81146
  this.validSelect.style.display = `block`;
81147
- const list = downCell?._dataValidation.formula1.map((item) => `<li onclick="SN.activeSheet.getCell(${downCell.row.rIndex},${downCell.cIndex}).editVal='${item}';SN.r();">${item}</li>`).join("");
81147
+ const ns2 = this.SN.namespace;
81148
+ const list = downCell?._dataValidation.formula1.map((item) => `<li onclick="${ns2}.activeSheet.getCell(${downCell.row.rIndex},${downCell.cIndex}).editVal='${item}';${ns2}.r();">${item}</li>`).join("");
81148
81149
  this.validSelect.querySelector("ul").innerHTML = list;
81149
81150
  downBeforeFuns.push(() => this.validSelect.style.display = `none`);
81150
81151
  }
@@ -82254,9 +82255,9 @@ class Canvas {
82254
82255
  cell.editVal = inputValue;
82255
82256
  if (!cell.validData && cell._dataValidation.showErrorMessage) {
82256
82257
  if (cell._dataValidation.error) {
82257
- showModal(cell._dataValidation.error);
82258
+ alert(cell._dataValidation.error);
82258
82259
  } else {
82259
- showModal("您输入的内容不符合限制要求!");
82260
+ alert("您输入的内容不符合限制要求!");
82260
82261
  }
82261
82262
  this.input.style.zIndex = "-1";
82262
82263
  this.input.innerHTML = "";
@@ -85443,8 +85444,6 @@ class Utils {
85443
85444
  }, 300);
85444
85445
  }, 3e3);
85445
85446
  }
85446
- showModal(html) {
85447
- }
85448
85447
  fullScreen() {
85449
85448
  if (!document.fullscreenElement) {
85450
85449
  document.documentElement.requestFullscreen();
@@ -88932,589 +88931,582 @@ class Layout {
88932
88931
  viewport.content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no";
88933
88932
  }
88934
88933
  _createDOMStructure(dom2) {
88934
+ const ns2 = this.SN.namespace;
88935
88935
  dom2.innerHTML = `
88936
- <main id="snMain">
88937
- <header class="sn-head">
88938
- <div class="sn-file">
88939
- <svg t="1758768238261" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14714" width="26" height="26"><path d="M535.601 0h68.997v95.247h349.2c19.749 0.843 41.303 0 58.401 12.042 12.042 17.58 10.597 39.977 12.042 60.207q-0.963 310.186 0 619.89c0 34.68 3.13 70.082-3.974 104.159-4.576 24.805-33.716 25.407-53.102 26.25H605.32v105.723h-72.249C355.101 991.007 177.49 960.542 0 928.753V95.368C178.574 63.578 357.148 32.27 535.601 0z" fill="#207245" p-id="14715"></path><path d="M604.598 131.01h383.88v750.06h-383.88v-71.406h93.08v-83.326h-93.08V678.17h93.08v-82.845h-93.08v-47.563h93.08v-83.447h-93.08V416.15h93.08v-82.725h-93.08V285.26h93.08v-82.845h-93.08z" fill="#FFFFFF" p-id="14716"></path><path d="M744.278 202.416h162.8v83.326h-162.8z" fill="#207245" p-id="14717"></path><path d="M344.504 314.04q39.616-2.89 79.112-4.937-46.6 97.655-93.802 195.19c31.91 66.59 64.662 132.456 96.33 199.526l-84.289-5.418c-19.748-49.731-43.83-97.656-58.04-149.675-15.774 48.166-38.411 94.044-56.594 141.366-25.407 0-50.935-1.445-76.342-2.529 29.862-60.206 58.762-120.413 89.588-179.777-26.25-61.291-54.91-121.378-81.882-182.428l76.704-4.455c17.34 46.6 36.124 92.478 50.574 140.282 16.135-50.694 39.255-98.257 58.641-147.145z" fill="#FFFFFF" p-id="14718"></path><path d="M744.278 333.426h162.8v83.327h-162.8z m0 130.89h162.8v83.447h-162.8z m0 131.01h162.8v83.327h-162.8z m0 131.01h162.8v83.327h-162.8z" fill="#207245" p-id="14719"></path></svg>
88940
- <span id="fileNameDom">新SheetNext工作簿</span>
88941
- </div>
88942
- <div class="sn-menu-list">
88943
- <div class="sn-dropdown">
88944
- <button class="head-btn sn-dropdown-toggle">文件</button>
88945
- <ul class="sn-dropdown-menu">
88946
- <li onclick="document.getElementById('upload').click()">导入 XLSX</li>
88947
- <li class="sn-dropdown-divider"></li>
88948
- <li onclick="SN.export('XLSX')">导出 XLSX</li>
88949
- </ul>
88950
- </div>
88951
- <div class="sn-dropdown">
88952
- <button class="head-btn sn-dropdown-toggle">插入</button>
88953
- <ul class="sn-dropdown-menu">
88954
- <li onclick="SN.Utils.pi('在表最后新插入10行')">插入行</li>
88955
- <li onclick="SN.Utils.pi('在表最后新插入10列')">插入列</li>
88956
- <li onclick="SN.Layout.addHrefsBtn()">超链接</li>
88957
- <li data-ds="true">图片<span class="sn-float-end sn-color-999">待开放</span></li>
88958
- <li onclick="SN.Utils.pi('根据表中数据生成柱状图')">图表</li>
88959
- <li data-ds="true">图形<span class="sn-float-end sn-color-999"">待开放</span></li>
88960
- <li data-ds="true">控件<span class="sn-float-end sn-color-999"">待开放</span></li>
88961
- <li data-ds="true">数据透视表<span class="sn-float-end sn-color-999"">待开放</span></li>
88962
- <li onclick="SN.Utils.pi('在A1编写公式,求F18:G21的平均值');">公式</li>
88963
- </ul>
88964
- </div>
88965
- <div class="sn-dropdown">
88966
- <button class="head-btn sn-dropdown-toggle">视图</button>
88967
- <ul class="sn-dropdown-menu" style="min-width: 120px;">
88968
- <li onclick="SN.activeSheet.showRowColHeaders=true;SN.r()">显示行标列标</li>
88969
- <li onclick="SN.activeSheet.showRowColHeaders=false;SN.r()">隐藏行标列标</li>
88970
- <li onclick="SN.activeSheet.showGridLines=true;SN.r()">显示网格线</li>
88971
- <li onclick="SN.activeSheet.showGridLines=false;SN.r()">隐藏网格线</li>
88972
- <li onclick="SN.activeSheet.ySplit=1;SN.r()">冻结首行</li>
88973
- <li onclick="SN.activeSheet.xSplit=1;SN.r()">冻结首列</li>
88974
- </ul>
88975
- </div>
88976
- <div class="sn-dropdown">
88977
- <button class="head-btn sn-dropdown-toggle"><i
88978
- class="iconfont icon-duoyuyan me-1"></i> 中文</button>
88979
- <ul class="sn-dropdown-menu">
88980
- <li>简体中文</li>
88981
- </ul>
88982
- </div>
88983
- <div class="sn-dropdown">
88984
- <button class="head-btn sn-dropdown-toggle">更多</button>
88985
- <ul class="sn-dropdown-menu">
88986
- <li>返回首页</li>
88987
- <li>企业服务</li>
88988
- <li>会员服务</li>
88989
- </ul>
88990
- </div>
88991
- </div>
88992
- <div class="sn-my">
88993
- <i class="iconfont icon-touxiang user-btn sn-cur" onclick="userLogin('<%= userId %>')"></i>
88994
- </div>
88995
- </header>
88996
- <div class="sn-tools">
88997
- <i class="iconfont icon-a-chexiaozhongzuoshangyibu sn-tooltip" title="撤销" onclick="SN.UndoRedo.undo()"></i>
88998
- <i class="iconfont icon-a-chexiaozhongzuoxiayibu-xianxing sn-tooltip" title="重做" onclick="SN.UndoRedo.redo()"></i>
88999
- <i onclick="SN.activeSheet.showAllHidCols();SN.r()" class="iconfont icon-zuoyouzhankai sn-tooltip" title="展示隐藏列"></i>
89000
- <i onclick="SN.activeSheet.showAllHidRows();SN.r()" class="iconfont icon-shangxiazhankai sn-tooltip" title="展示隐藏行"></i>
89001
- <i onclick="SN.activeSheet.setBrush(false)" ondblclick="SN.activeSheet.setBrush(true)"
89002
- class="iconfont icon-geshishua sn-tooltip" title="格式刷 双击重复使用"></i>
89003
- <div class="sn-dropdown sn-tooltip" title="清除格式">
89004
- <div class="sn-dropdown-toggle">
89005
- <i class="iconfont icon-qingchugeshi"></i>
89006
- </div>
88936
+ <main id="snMain">
88937
+ <header class="sn-head">
88938
+ <div class="sn-file">
88939
+ <svg t="1758768238261" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14714" width="26" height="26"><path d="M535.601 0h68.997v95.247h349.2c19.749 0.843 41.303 0 58.401 12.042 12.042 17.58 10.597 39.977 12.042 60.207q-0.963 310.186 0 619.89c0 34.68 3.13 70.082-3.974 104.159-4.576 24.805-33.716 25.407-53.102 26.25H605.32v105.723h-72.249C355.101 991.007 177.49 960.542 0 928.753V95.368C178.574 63.578 357.148 32.27 535.601 0z" fill="#207245" p-id="14715"></path><path d="M604.598 131.01h383.88v750.06h-383.88v-71.406h93.08v-83.326h-93.08V678.17h93.08v-82.845h-93.08v-47.563h93.08v-83.447h-93.08V416.15h93.08v-82.725h-93.08V285.26h93.08v-82.845h-93.08z" fill="#FFFFFF" p-id="14716"></path><path d="M744.278 202.416h162.8v83.326h-162.8z" fill="#207245" p-id="14717"></path><path d="M344.504 314.04q39.616-2.89 79.112-4.937-46.6 97.655-93.802 195.19c31.91 66.59 64.662 132.456 96.33 199.526l-84.289-5.418c-19.748-49.731-43.83-97.656-58.04-149.675-15.774 48.166-38.411 94.044-56.594 141.366-25.407 0-50.935-1.445-76.342-2.529 29.862-60.206 58.762-120.413 89.588-179.777-26.25-61.291-54.91-121.378-81.882-182.428l76.704-4.455c17.34 46.6 36.124 92.478 50.574 140.282 16.135-50.694 39.255-98.257 58.641-147.145z" fill="#FFFFFF" p-id="14718"></path><path d="M744.278 333.426h162.8v83.327h-162.8z m0 130.89h162.8v83.447h-162.8z m0 131.01h162.8v83.327h-162.8z m0 131.01h162.8v83.327h-162.8z" fill="#207245" p-id="14719"></path></svg>
88940
+ <span id="fileNameDom">新SheetNext工作簿</span>
88941
+ </div>
88942
+ <div class="sn-menu-list">
88943
+ <div class="sn-dropdown">
88944
+ <button class="head-btn sn-dropdown-toggle">文件</button>
89007
88945
  <ul class="sn-dropdown-menu">
89008
- <li onclick="SN.Fun.clearAreaFormat();">清除全部</li>
89009
- <li onclick="SN.Fun.clearAreaFormat('style');">清除样式</li>
89010
- <li onclick="SN.Fun.clearAreaFormat('value');">清除内容</li>
89011
- <li onclick="SN.Fun.clearAreaFormat('border');">清除边框</li>
88946
+ <li onclick="document.getElementById('upload').click()">导入 XLSX</li>
88947
+ <li class="sn-dropdown-divider"></li>
88948
+ <li onclick="${ns2}.export('XLSX')">导出 XLSX</li>
89012
88949
  </ul>
89013
88950
  </div>
89014
- <span></span>
89015
- <div class="sn-dropdown sn-tooltip" title="字体">
89016
- <div class="sn-dropdown-toggle">
89017
- <i class="iconfont icon-zitishezhi"></i>
89018
- </div>
88951
+ <div class="sn-dropdown">
88952
+ <button class="head-btn sn-dropdown-toggle">插入</button>
89019
88953
  <ul class="sn-dropdown-menu">
89020
- <li style="font-family: '仿宋';" onclick="SN.Fun.areasStyle('font',{name:'仿宋'});">
89021
- 仿宋</li>
89022
- <li style="font-family: '宋体';" onclick="SN.Fun.areasStyle('font',{name:'宋体'});">
89023
- 宋体</li>
89024
- <li style="font-family: '新宋体';" onclick="SN.Fun.areasStyle('font',{name:'新宋体'});">新宋体
89025
- </li>
89026
- <li style="font-family: '微软雅黑';" onclick="SN.Fun.areasStyle('font',{name:'微软雅黑'});">微软雅黑
89027
- </li>
89028
- <li style="font-family: '楷体';" onclick="SN.Fun.areasStyle('font',{name:'楷体'});">
89029
- 楷体</li>
89030
- <li style="font-family: '黑体';" onclick="SN.Fun.areasStyle('font',{name:'黑体'});">
89031
- 黑体</li>
89032
- <li style="font-family: '等线';" onclick="SN.Fun.areasStyle('font',{name:'等线'});">
89033
- 等线</li>
89034
- <li style="font-family: 'Arial';" onclick="SN.Fun.areasStyle('font',{name:'Arial'});">
89035
- Arial
89036
- </li>
89037
- <li style="font-family: 'Arial Black';" onclick="SN.Fun.areasStyle('font',{name:'Arial Black'});">
89038
- Arial Black</li>
89039
- <li style="font-family: 'Verdana';" onclick="SN.Fun.areasStyle('font',{name:'Verdana'});">
89040
- Verdana
89041
- </li>
89042
- <li style="font-family: 'Tahoma';" onclick="SN.Fun.areasStyle('font',{name:'Tahoma'});">
89043
- Tahoma
89044
- </li>
89045
- <li style="font-family: 'Trebuchet MS';" onclick="SN.Fun.areasStyle('font',{name:'Trebuchet MS'});">
89046
- Trebuchet MS</li>
89047
- <li style="font-family: 'Gill Sans';" onclick="SN.Fun.areasStyle('font',{name:'Gill Sans'});">
89048
- Gill
89049
- Sans</li>
89050
- <li style="font-family: 'Century Gothic';" onclick="SN.Fun.areasStyle('font',{name:'Century Gothic'});">
89051
- Century
89052
- Gothic
89053
- </li>
89054
- <li style="font-family: 'Lucida Sans';" onclick="SN.Fun.areasStyle('font',{name:'Lucida Sans'});">
89055
- Lucida Sans</li>
89056
- <li style="font-family: 'Optima';" onclick="SN.Fun.areasStyle('font',{name:'Optima'});">
89057
- Optima
89058
- </li>
89059
- <li style="font-family: 'Impact';" onclick="SN.Fun.areasStyle('font',{name:'Impact'});">
89060
- Impact
89061
- </li>
89062
- <li style="font-family: 'Helvetica';" onclick="SN.Fun.areasStyle('font',{name:'Helvetica'});">
89063
- Helvetica</li>
89064
- <li style="font-family: 'Times New Roman';" onclick="SN.Fun.areasStyle('font',{name:'Times New Roman'});">
89065
- Times New
89066
- Roman</li>
89067
- <li style="font-family: 'Georgia';" onclick="SN.Fun.areasStyle('font',{name:'Georgia'});">
89068
- Georgia
89069
- </li>
89070
- <li style="font-family: 'Garamond';" onclick="SN.Fun.areasStyle('font',{name:'Garamond'});">
89071
- Garamond</li>
89072
- <li style="font-family: 'Didot';" onclick="SN.Fun.areasStyle('font',{name:'Didot'});">
89073
- Didot
89074
- </li>
89075
- <li style="font-family: 'Palatino';" onclick="SN.Fun.areasStyle('font',{name:'Palatino'});">
89076
- Palatino</li>
89077
- <li style="font-family: 'Goudy Old Style';" onclick="SN.Fun.areasStyle('font',{name:'Goudy Old Style'});">
89078
- Goudy Old
89079
- Style</li>
89080
- <li style="font-family: 'Lucida Bright';" onclick="SN.Fun.areasStyle('font',{name:'Lucida Bright'});">
89081
- Lucida
89082
- Bright
89083
- </li>
89084
- <li style="font-family: 'Courier New';" onclick="SN.Fun.areasStyle('font',{name:'Courier New'});">
89085
- Courier New</li>
89086
- <li style="font-family: 'Consolas';" onclick="SN.Fun.areasStyle('font',{name:'Consolas'});">
89087
- Consolas</li>
89088
- <li style="font-family: 'Lucida Sans Typewriter';"
89089
- onclick="SN.Fun.areasStyle('font',{name:'Lucida Sans Typewriter'});">
89090
- Lucida
89091
- Sans
89092
- Typewriter
89093
- </li>
89094
- <li style="font-family: 'Brush Script MT';" onclick="SN.Fun.areasStyle('font',{name:'Brush Script MT'});">
89095
- Brush
89096
- Script
89097
- MT</li>
89098
- <li style="font-family: 'Bradley Hand';" onclick="SN.Fun.areasStyle('font',{name:'Bradley Hand'});">
89099
- Bradley Hand</li>
89100
- <li style="font-family: 'Comic Sans MS';" onclick="SN.Fun.areasStyle('font',{name:'Comic Sans MS'});">
89101
- Comic Sans
89102
- MS
89103
- </li>
89104
- <li style="font-family: 'Copperplate Gothic';"
89105
- onclick="SN.Fun.areasStyle('font',{name:'Copperplate Gothic'});">
89106
- Copperplate
89107
- Gothic
89108
- </li>
89109
- <li style="font-family: 'Papyrus';" onclick="SN.Fun.areasStyle('font',{name:'Papyrus'});">
89110
- Papyrus
89111
- </li>
88954
+ <li onclick="${ns2}.Utils.pi('在表最后新插入10行')">插入行</li>
88955
+ <li onclick="${ns2}.Utils.pi('在表最后新插入10列')">插入列</li>
88956
+ <li onclick="${ns2}.Utils.pi('在A1插入超链接,文本:百度 地址:https://baidu.com')">超链接</li>
88957
+ <li data-ds="true">图片<span class="sn-float-end sn-color-999">待开放</span></li>
88958
+ <li onclick="${ns2}.Utils.pi('根据表中数据生成柱状图')">图表</li>
88959
+ <li data-ds="true">图形<span class="sn-float-end sn-color-999"">待开放</span></li>
88960
+ <li data-ds="true">控件<span class="sn-float-end sn-color-999"">待开放</span></li>
88961
+ <li data-ds="true">数据透视表<span class="sn-float-end sn-color-999"">待开放</span></li>
88962
+ <li onclick="${ns2}.Utils.pi('在A1编写公式,求F18:G21的平均值');">公式</li>
89112
88963
  </ul>
89113
88964
  </div>
89114
- <div class="sn-dropdown sn-tooltip" title="字号">
89115
- <div class="sn-dropdown-toggle">
89116
- <i class="iconfont icon-zihao"></i>
89117
- </div>
89118
- <ul class="sn-dropdown-menu">
89119
- <li onclick="SN.Fun.areasStyle('font',{'size':8});">8</li>
89120
- <li onclick="SN.Fun.areasStyle('font',{'size':9});">9</li>
89121
- <li onclick="SN.Fun.areasStyle('font',{'size':10});">10</li>
89122
- <li onclick="SN.Fun.areasStyle('font',{'size':11});">11</li>
89123
- <li onclick="SN.Fun.areasStyle('font',{'size':12});">12</li>
89124
- <li onclick="SN.Fun.areasStyle('font',{'size':14});">14</li>
89125
- <li onclick="SN.Fun.areasStyle('font',{'size':16});">16</li>
89126
- <li onclick="SN.Fun.areasStyle('font',{'size':18});">18</li>
89127
- <li onclick="SN.Fun.areasStyle('font',{'size':20});">20</li>
89128
- <li onclick="SN.Fun.areasStyle('font',{'size':22});">22</li>
89129
- <li onclick="SN.Fun.areasStyle('font',{'size':24});">24</li>
89130
- <li onclick="SN.Fun.areasStyle('font',{'size':26});">26</li>
89131
- <li onclick="SN.Fun.areasStyle('font',{'size':28});">28</li>
89132
- <li onclick="SN.Fun.areasStyle('font',{'size':36});">36</li>
89133
- <li onclick="SN.Fun.areasStyle('font',{'size':48});">48</li>
89134
- <li onclick="SN.Fun.areasStyle('font',{'size':72});">72</li>
88965
+ <div class="sn-dropdown">
88966
+ <button class="head-btn sn-dropdown-toggle">视图</button>
88967
+ <ul class="sn-dropdown-menu" style="min-width: 120px;">
88968
+ <li onclick="${ns2}.activeSheet.showRowColHeaders=true;${ns2}.r()">显示行标列标</li>
88969
+ <li onclick="${ns2}.activeSheet.showRowColHeaders=false;${ns2}.r()">隐藏行标列标</li>
88970
+ <li onclick="${ns2}.activeSheet.showGridLines=true;${ns2}.r()">显示网格线</li>
88971
+ <li onclick="${ns2}.activeSheet.showGridLines=false;${ns2}.r()">隐藏网格线</li>
88972
+ <li onclick="${ns2}.activeSheet.ySplit=1;${ns2}.r()">冻结首行</li>
88973
+ <li onclick="${ns2}.activeSheet.xSplit=1;${ns2}.r()">冻结首列</li>
89135
88974
  </ul>
89136
88975
  </div>
89137
- <span></span>
89138
- <i onclick="SN.Fun.fontInversion('bold');" class="iconfont icon-fuwenbenbianjiqi_jiacu sn-tooltip" title="加粗"></i>
89139
- <i onclick="SN.Fun.fontInversion('italic');" class="iconfont icon-qingxie sn-tooltip" title="倾斜"></i>
89140
-
89141
- <div class="sn-dropdown sn-tooltip" title="下划线">
89142
- <div class="sn-dropdown-toggle">
89143
- <i class="iconfont icon-xiahuaxian1"></i>
89144
- </div>
88976
+ <div class="sn-dropdown">
88977
+ <button class="head-btn sn-dropdown-toggle">更多</button>
89145
88978
  <ul class="sn-dropdown-menu">
89146
- <li onclick="SN.Fun.fontInversion('underline','single');">单下划线</li>
89147
- <li onclick="SN.Fun.fontInversion('underline','double');">双下划线</li>
89148
- <li onclick="SN.Fun.fontInversion('underline','');">清除下划线</li>
88979
+ <li onclick="window.open('https://www.sheetnext.com/enterprise')">SheetNext Pro</li>
88980
+ <li>...</li>
89149
88981
  </ul>
89150
88982
  </div>
88983
+ </div>
88984
+ <div class="sn-my sn-cur">
88985
+ <span onclick="alert('🪄 欢迎使用SheetNext智能表格社区开源版本,此版本支持商用和分发。但为了更好的发展我们限制了一些功能!具体访问官网:https://www.sheetnext.com/enterprise')">🪄 社区版</span>
88986
+ </div>
88987
+ </header>
88988
+ <div class="sn-tools">
88989
+ <i class="iconfont icon-a-chexiaozhongzuoshangyibu sn-tooltip" title="撤销" onclick="${ns2}.UndoRedo.undo()"></i>
88990
+ <i class="iconfont icon-a-chexiaozhongzuoxiayibu-xianxing sn-tooltip" title="重做" onclick="${ns2}.UndoRedo.redo()"></i>
88991
+ <i onclick="${ns2}.activeSheet.showAllHidCols();${ns2}.r()" class="iconfont icon-zuoyouzhankai sn-tooltip" title="展示隐藏列"></i>
88992
+ <i onclick="${ns2}.activeSheet.showAllHidRows();${ns2}.r()" class="iconfont icon-shangxiazhankai sn-tooltip" title="展示隐藏行"></i>
88993
+ <i onclick="${ns2}.activeSheet.setBrush(false)" ondblclick="${ns2}.activeSheet.setBrush(true)"
88994
+ class="iconfont icon-geshishua sn-tooltip" title="格式刷 双击重复使用"></i>
88995
+ <div class="sn-dropdown sn-tooltip" title="清除格式">
88996
+ <div class="sn-dropdown-toggle">
88997
+ <i class="iconfont icon-qingchugeshi"></i>
88998
+ </div>
88999
+ <ul class="sn-dropdown-menu">
89000
+ <li onclick="${ns2}.Fun.clearAreaFormat();">清除全部</li>
89001
+ <li onclick="${ns2}.Fun.clearAreaFormat('style');">清除样式</li>
89002
+ <li onclick="${ns2}.Fun.clearAreaFormat('value');">清除内容</li>
89003
+ <li onclick="${ns2}.Fun.clearAreaFormat('border');">清除边框</li>
89004
+ </ul>
89005
+ </div>
89006
+ <span></span>
89007
+ <div class="sn-dropdown sn-tooltip" title="字体">
89008
+ <div class="sn-dropdown-toggle">
89009
+ <i class="iconfont icon-zitishezhi"></i>
89010
+ </div>
89011
+ <ul class="sn-dropdown-menu">
89012
+ <li style="font-family: '仿宋';" onclick="${ns2}.Fun.areasStyle('font',{name:'仿宋'});">
89013
+ 仿宋</li>
89014
+ <li style="font-family: '宋体';" onclick="${ns2}.Fun.areasStyle('font',{name:'宋体'});">
89015
+ 宋体</li>
89016
+ <li style="font-family: '新宋体';" onclick="${ns2}.Fun.areasStyle('font',{name:'新宋体'});">新宋体
89017
+ </li>
89018
+ <li style="font-family: '微软雅黑';" onclick="${ns2}.Fun.areasStyle('font',{name:'微软雅黑'});">微软雅黑
89019
+ </li>
89020
+ <li style="font-family: '楷体';" onclick="${ns2}.Fun.areasStyle('font',{name:'楷体'});">
89021
+ 楷体</li>
89022
+ <li style="font-family: '黑体';" onclick="${ns2}.Fun.areasStyle('font',{name:'黑体'});">
89023
+ 黑体</li>
89024
+ <li style="font-family: '等线';" onclick="${ns2}.Fun.areasStyle('font',{name:'等线'});">
89025
+ 等线</li>
89026
+ <li style="font-family: 'Arial';" onclick="${ns2}.Fun.areasStyle('font',{name:'Arial'});">
89027
+ Arial
89028
+ </li>
89029
+ <li style="font-family: 'Arial Black';" onclick="${ns2}.Fun.areasStyle('font',{name:'Arial Black'});">
89030
+ Arial Black</li>
89031
+ <li style="font-family: 'Verdana';" onclick="${ns2}.Fun.areasStyle('font',{name:'Verdana'});">
89032
+ Verdana
89033
+ </li>
89034
+ <li style="font-family: 'Tahoma';" onclick="${ns2}.Fun.areasStyle('font',{name:'Tahoma'});">
89035
+ Tahoma
89036
+ </li>
89037
+ <li style="font-family: 'Trebuchet MS';" onclick="${ns2}.Fun.areasStyle('font',{name:'Trebuchet MS'});">
89038
+ Trebuchet MS</li>
89039
+ <li style="font-family: 'Gill Sans';" onclick="${ns2}.Fun.areasStyle('font',{name:'Gill Sans'});">
89040
+ Gill
89041
+ Sans</li>
89042
+ <li style="font-family: 'Century Gothic';" onclick="${ns2}.Fun.areasStyle('font',{name:'Century Gothic'});">
89043
+ Century
89044
+ Gothic
89045
+ </li>
89046
+ <li style="font-family: 'Lucida Sans';" onclick="${ns2}.Fun.areasStyle('font',{name:'Lucida Sans'});">
89047
+ Lucida Sans</li>
89048
+ <li style="font-family: 'Optima';" onclick="${ns2}.Fun.areasStyle('font',{name:'Optima'});">
89049
+ Optima
89050
+ </li>
89051
+ <li style="font-family: 'Impact';" onclick="${ns2}.Fun.areasStyle('font',{name:'Impact'});">
89052
+ Impact
89053
+ </li>
89054
+ <li style="font-family: 'Helvetica';" onclick="${ns2}.Fun.areasStyle('font',{name:'Helvetica'});">
89055
+ Helvetica</li>
89056
+ <li style="font-family: 'Times New Roman';" onclick="${ns2}.Fun.areasStyle('font',{name:'Times New Roman'});">
89057
+ Times New
89058
+ Roman</li>
89059
+ <li style="font-family: 'Georgia';" onclick="${ns2}.Fun.areasStyle('font',{name:'Georgia'});">
89060
+ Georgia
89061
+ </li>
89062
+ <li style="font-family: 'Garamond';" onclick="${ns2}.Fun.areasStyle('font',{name:'Garamond'});">
89063
+ Garamond</li>
89064
+ <li style="font-family: 'Didot';" onclick="${ns2}.Fun.areasStyle('font',{name:'Didot'});">
89065
+ Didot
89066
+ </li>
89067
+ <li style="font-family: 'Palatino';" onclick="${ns2}.Fun.areasStyle('font',{name:'Palatino'});">
89068
+ Palatino</li>
89069
+ <li style="font-family: 'Goudy Old Style';" onclick="${ns2}.Fun.areasStyle('font',{name:'Goudy Old Style'});">
89070
+ Goudy Old
89071
+ Style</li>
89072
+ <li style="font-family: 'Lucida Bright';" onclick="${ns2}.Fun.areasStyle('font',{name:'Lucida Bright'});">
89073
+ Lucida
89074
+ Bright
89075
+ </li>
89076
+ <li style="font-family: 'Courier New';" onclick="${ns2}.Fun.areasStyle('font',{name:'Courier New'});">
89077
+ Courier New</li>
89078
+ <li style="font-family: 'Consolas';" onclick="${ns2}.Fun.areasStyle('font',{name:'Consolas'});">
89079
+ Consolas</li>
89080
+ <li style="font-family: 'Lucida Sans Typewriter';"
89081
+ onclick="${ns2}.Fun.areasStyle('font',{name:'Lucida Sans Typewriter'});">
89082
+ Lucida
89083
+ Sans
89084
+ Typewriter
89085
+ </li>
89086
+ <li style="font-family: 'Brush Script MT';" onclick="${ns2}.Fun.areasStyle('font',{name:'Brush Script MT'});">
89087
+ Brush
89088
+ Script
89089
+ MT</li>
89090
+ <li style="font-family: 'Bradley Hand';" onclick="${ns2}.Fun.areasStyle('font',{name:'Bradley Hand'});">
89091
+ Bradley Hand</li>
89092
+ <li style="font-family: 'Comic Sans MS';" onclick="${ns2}.Fun.areasStyle('font',{name:'Comic Sans MS'});">
89093
+ Comic Sans
89094
+ MS
89095
+ </li>
89096
+ <li style="font-family: 'Copperplate Gothic';"
89097
+ onclick="${ns2}.Fun.areasStyle('font',{name:'Copperplate Gothic'});">
89098
+ Copperplate
89099
+ Gothic
89100
+ </li>
89101
+ <li style="font-family: 'Papyrus';" onclick="${ns2}.Fun.areasStyle('font',{name:'Papyrus'});">
89102
+ Papyrus
89103
+ </li>
89104
+ </ul>
89105
+ </div>
89106
+ <div class="sn-dropdown sn-tooltip" title="字号">
89107
+ <div class="sn-dropdown-toggle">
89108
+ <i class="iconfont icon-zihao"></i>
89109
+ </div>
89110
+ <ul class="sn-dropdown-menu">
89111
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':8});">8</li>
89112
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':9});">9</li>
89113
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':10});">10</li>
89114
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':11});">11</li>
89115
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':12});">12</li>
89116
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':14});">14</li>
89117
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':16});">16</li>
89118
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':18});">18</li>
89119
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':20});">20</li>
89120
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':22});">22</li>
89121
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':24});">24</li>
89122
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':26});">26</li>
89123
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':28});">28</li>
89124
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':36});">36</li>
89125
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':48});">48</li>
89126
+ <li onclick="${ns2}.Fun.areasStyle('font',{'size':72});">72</li>
89127
+ </ul>
89128
+ </div>
89129
+ <span></span>
89130
+ <i onclick="${ns2}.Fun.fontInversion('bold');" class="iconfont icon-fuwenbenbianjiqi_jiacu sn-tooltip" title="加粗"></i>
89131
+ <i onclick="${ns2}.Fun.fontInversion('italic');" class="iconfont icon-qingxie sn-tooltip" title="倾斜"></i>
89151
89132
 
89133
+ <div class="sn-dropdown sn-tooltip" title="下划线">
89134
+ <div class="sn-dropdown-toggle">
89135
+ <i class="iconfont icon-xiahuaxian1"></i>
89136
+ </div>
89137
+ <ul class="sn-dropdown-menu">
89138
+ <li onclick="${ns2}.Fun.fontInversion('underline','single');">单下划线</li>
89139
+ <li onclick="${ns2}.Fun.fontInversion('underline','double');">双下划线</li>
89140
+ <li onclick="${ns2}.Fun.fontInversion('underline','');">清除下划线</li>
89141
+ </ul>
89142
+ </div>
89152
89143
 
89153
89144
 
89154
- <i onclick="SN.Fun.fontInversion('strike');" class="iconfont icon-strikethrough sn-tooltip" title="删除线"></i>
89155
- <div class="sn-dropdown sn-tooltip" title="字体颜色">
89156
- <div class="sn-dropdown-toggle">
89157
- <i class="iconfont icon-zitiyanse"></i>
89158
- </div>
89159
- <ul class="sn-dropdown-menu" style="width: 235px;">
89160
- <div class="sn-color-select" onclick="SN.Fun.fontColorBtn(event)"></div>
89161
- </ul>
89145
+
89146
+ <i onclick="${ns2}.Fun.fontInversion('strike');" class="iconfont icon-strikethrough sn-tooltip" title="删除线"></i>
89147
+ <div class="sn-dropdown sn-tooltip" title="字体颜色">
89148
+ <div class="sn-dropdown-toggle">
89149
+ <i class="iconfont icon-zitiyanse"></i>
89162
89150
  </div>
89151
+ <ul class="sn-dropdown-menu" style="width: 235px;">
89152
+ <div class="sn-color-select" onclick="${ns2}.Fun.fontColorBtn(event)"></div>
89153
+ </ul>
89154
+ </div>
89163
89155
 
89164
- <div class="sn-dropdown sn-tooltip" title="填充颜色">
89165
- <div class="sn-dropdown-toggle">
89166
- <i class="iconfont icon-tianchongyanse"></i>
89167
- </div>
89168
- <ul class="sn-dropdown-menu" style="width: 235px;">
89169
- <div class="sn-color-select" onclick="SN.Fun.fillColorBtn(event)"></div>
89170
- </ul>
89156
+ <div class="sn-dropdown sn-tooltip" title="填充颜色">
89157
+ <div class="sn-dropdown-toggle">
89158
+ <i class="iconfont icon-tianchongyanse"></i>
89171
89159
  </div>
89160
+ <ul class="sn-dropdown-menu" style="width: 235px;">
89161
+ <div class="sn-color-select" onclick="${ns2}.Fun.fillColorBtn(event)"></div>
89162
+ </ul>
89163
+ </div>
89172
89164
 
89173
- <div class="sn-dropdown sn-tooltip" title="边框">
89174
- <div class="sn-dropdown-toggle">
89175
- <i class="iconfont icon-jurassic_border-htwg"></i>
89176
- </div>
89177
- <ul class="sn-dropdown-menu" style="width: 251px;">
89178
- <div class="sn-w100 sn-f13 sn-p-1 sn-color-999 sn-text-left">位置</div>
89179
- <div class="d-flex justify-content-evenly pc">
89180
- <div class="sn-f13" onclick="SN.activeSheet.areasBorder('all',{style:''});SN.r();">无
89181
- </div>
89182
- <div class="sn-f13" onclick="SN.activeSheet.areasBorder('all',{style:'thin'});SN.r();">全
89183
- </div>
89184
- <div class="sn-f13" onclick="SN.activeSheet.areasBorder('out',{style:'thin'});SN.r();">外
89185
- </div>
89186
- <div class="sn-f13" onclick="SN.activeSheet.areasBorder('all',{style:'thick'});SN.r();">粗
89187
- </div>
89188
- <div class="sn-f13" onclick="SN.activeSheet.areasBorder('top',{style:'thin'});SN.r();">上
89189
- </div>
89190
- <div class="sn-f13" onclick="SN.activeSheet.areasBorder('left',{style:'thin'});SN.r();">左
89191
- </div>
89192
- <div class="sn-f13" onclick="SN.activeSheet.areasBorder('bottom',{style:'thin'});SN.r();">
89193
-
89194
- </div>
89195
- <div class="sn-f13" onclick="SN.activeSheet.areasBorder('right',{style:'thin'});SN.r();">
89196
-
89197
- </div>
89198
- </div>
89199
- <div class="sn-w100 sn-f13 sn-p-1 sn-color-999 sn-text-left">颜色</div>
89200
- <div class="sn-color-select sn-p-2" onclick="SN.Fun.borderColorBtn(event)"></div>
89201
- <div class="sn-w100 sn-f13 sn-p-1 sn-color-999 sn-text-left">样式</div>
89202
- <li onclick="SN.activeSheet.areasBorder('all',{style:'thin'});SN.r();">thin</li>
89203
- <li onclick="SN.activeSheet.areasBorder('all',{style:'medium'});SN.r();">medium
89204
- </li>
89205
- <li onclick="SN.activeSheet.areasBorder('all',{style:'dashed'});SN.r();">dashed
89206
- </li>
89207
- <li onclick="SN.activeSheet.areasBorder('all',{style:'dotted'});SN.r();">dotted</li>
89208
- <li onclick="SN.activeSheet.areasBorder('all',{style:'thick'});SN.r();">
89209
- thick
89210
- </li>
89211
- <li onclick="SN.activeSheet.areasBorder('all',{style:'double'});SN.r();">
89212
- double
89213
- </li>
89214
- <li onclick="SN.activeSheet.areasBorder('all',{style:'hair'});SN.r();">
89215
- hair
89216
- </li>
89217
- <li onclick="SN.activeSheet.areasBorder('all',{style:'mediumDashed'});SN.r();">
89218
- mediumDashed
89219
- </li>
89220
- <li onclick="SN.activeSheet.areasBorder('all',{style:'dashDot'});SN.r();">
89221
- dashDot
89222
- </li>
89223
- <li onclick="SN.activeSheet.areasBorder('all',{style:'mediumDashDot'});SN.r();">
89224
- mediumDashDot
89225
- </li>
89226
- <li onclick="SN.activeSheet.areasBorder('all',{style:'dashDotDot'});SN.r();">dashDotDot
89227
- </li>
89228
- <li onclick="SN.activeSheet.areasBorder('all',{style:'mediumDashDotDot'});SN.r();">
89229
- mediumDashDotDot
89230
- </li>
89231
- <li onclick="SN.activeSheet.areasBorder('all',{style:'slantDashDot'});SN.r();">
89232
- slantDashDot
89233
- </li>
89234
- </ul>
89165
+ <div class="sn-dropdown sn-tooltip" title="边框">
89166
+ <div class="sn-dropdown-toggle">
89167
+ <i class="iconfont icon-jurassic_border-htwg"></i>
89235
89168
  </div>
89236
- <span></span>
89237
- <div class="sn-dropdown sn-tooltip" title="水平对齐">
89238
- <div class="sn-dropdown-toggle">
89239
- <i class="iconfont icon-zuoduiqi"></i>
89169
+ <ul class="sn-dropdown-menu" style="width: 251px;">
89170
+ <div class="sn-w100 sn-f13 sn-p-1 sn-color-999 sn-text-left">位置</div>
89171
+ <div class="d-flex justify-content-evenly pc">
89172
+ <div class="sn-f13" onclick="${ns2}.activeSheet.areasBorder('all',{style:''});${ns2}.r();">无
89173
+ </div>
89174
+ <div class="sn-f13" onclick="${ns2}.activeSheet.areasBorder('all',{style:'thin'});${ns2}.r();">全
89175
+ </div>
89176
+ <div class="sn-f13" onclick="${ns2}.activeSheet.areasBorder('out',{style:'thin'});${ns2}.r();">外
89177
+ </div>
89178
+ <div class="sn-f13" onclick="${ns2}.activeSheet.areasBorder('all',{style:'thick'});${ns2}.r();">粗
89179
+ </div>
89180
+ <div class="sn-f13" onclick="${ns2}.activeSheet.areasBorder('top',{style:'thin'});${ns2}.r();">上
89181
+ </div>
89182
+ <div class="sn-f13" onclick="${ns2}.activeSheet.areasBorder('left',{style:'thin'});${ns2}.r();">左
89183
+ </div>
89184
+ <div class="sn-f13" onclick="${ns2}.activeSheet.areasBorder('bottom',{style:'thin'});${ns2}.r();">
89185
+
89186
+ </div>
89187
+ <div class="sn-f13" onclick="${ns2}.activeSheet.areasBorder('right',{style:'thin'});${ns2}.r();">
89188
+
89189
+ </div>
89240
89190
  </div>
89241
- <ul class="sn-dropdown-menu">
89242
- <li onclick="SN.Fun.areasStyle('alignment',{horizontal:'left'});">左对齐</li>
89243
- <li onclick="SN.Fun.areasStyle('alignment',{horizontal:'right'});">右对齐</li>
89244
- <li onclick="SN.Fun.areasStyle('alignment',{horizontal:'center'});">居中</li>
89245
- </ul>
89191
+ <div class="sn-w100 sn-f13 sn-p-1 sn-color-999 sn-text-left">颜色</div>
89192
+ <div class="sn-color-select sn-p-2" onclick="${ns2}.Fun.borderColorBtn(event)"></div>
89193
+ <div class="sn-w100 sn-f13 sn-p-1 sn-color-999 sn-text-left">样式</div>
89194
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'thin'});${ns2}.r();">thin</li>
89195
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'medium'});${ns2}.r();">medium
89196
+ </li>
89197
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'dashed'});${ns2}.r();">dashed
89198
+ </li>
89199
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'dotted'});${ns2}.r();">dotted</li>
89200
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'thick'});${ns2}.r();">
89201
+ thick
89202
+ </li>
89203
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'double'});${ns2}.r();">
89204
+ double
89205
+ </li>
89206
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'hair'});${ns2}.r();">
89207
+ hair
89208
+ </li>
89209
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'mediumDashed'});${ns2}.r();">
89210
+ mediumDashed
89211
+ </li>
89212
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'dashDot'});${ns2}.r();">
89213
+ dashDot
89214
+ </li>
89215
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'mediumDashDot'});${ns2}.r();">
89216
+ mediumDashDot
89217
+ </li>
89218
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'dashDotDot'});${ns2}.r();">dashDotDot
89219
+ </li>
89220
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'mediumDashDotDot'});${ns2}.r();">
89221
+ mediumDashDotDot
89222
+ </li>
89223
+ <li onclick="${ns2}.activeSheet.areasBorder('all',{style:'slantDashDot'});${ns2}.r();">
89224
+ slantDashDot
89225
+ </li>
89226
+ </ul>
89227
+ </div>
89228
+ <span></span>
89229
+ <div class="sn-dropdown sn-tooltip" title="水平对齐">
89230
+ <div class="sn-dropdown-toggle">
89231
+ <i class="iconfont icon-zuoduiqi"></i>
89246
89232
  </div>
89247
- <div class="sn-dropdown sn-tooltip" title="垂直对齐">
89248
- <div class="sn-dropdown-toggle">
89249
- <i class="iconfont icon-chuizhiduiqi"></i>
89250
- </div>
89251
- <ul class="sn-dropdown-menu">
89252
- <li onclick="SN.Fun.areasStyle('alignment',{vertical:'top'});">居上</li>
89253
- <li onclick="SN.Fun.areasStyle('alignment',{vertical:'center'});">居中</li>
89254
- <li onclick="SN.Fun.areasStyle('alignment',{vertical:'bottom'});">局下</li>
89255
- </ul>
89233
+ <ul class="sn-dropdown-menu">
89234
+ <li onclick="${ns2}.Fun.areasStyle('alignment',{horizontal:'left'});">左对齐</li>
89235
+ <li onclick="${ns2}.Fun.areasStyle('alignment',{horizontal:'right'});">右对齐</li>
89236
+ <li onclick="${ns2}.Fun.areasStyle('alignment',{horizontal:'center'});">居中</li>
89237
+ </ul>
89238
+ </div>
89239
+ <div class="sn-dropdown sn-tooltip" title="垂直对齐">
89240
+ <div class="sn-dropdown-toggle">
89241
+ <i class="iconfont icon-chuizhiduiqi"></i>
89256
89242
  </div>
89257
- <i onclick="SN.Fun.mergeCell();" class="iconfont icon-hebingdanyuange sn-tooltip" title="合并单元格"></i>
89258
- <span></span>
89259
- <div class="sn-dropdown sn-tooltip" title="数字格式">
89260
- <div class="sn-dropdown-toggle">
89261
- <i class="iconfont icon-shuzhigeshi"></i>
89262
- </div>
89263
- <ul class="sn-dropdown-menu" style="min-width: 220px;">
89264
- <li onclick="SN.Fun.areasNumFmt('');">常规</li>
89265
- <li onclick="SN.Fun.areasNumFmt('0.00');">数值<span class="sn-color-999 sn-float-end">0.01</span>
89266
- </li>
89267
- <li onclick="SN.Fun.areasNumFmt('0.00%');">百分比<span class="sn-color-999 sn-float-end">0.60%</span>
89268
- </li>
89269
- <li onclick="SN.Fun.areasNumFmt('# ?/?');">分数<span class="sn-color-999 sn-float-end">2 1/2</span>
89270
- </li>
89271
- <li onclick="SN.Fun.areasNumFmt('0.00E+00');">科学记数<span class="sn-color-999 sn-float-end">6.00E-03</span>
89272
- </li>
89273
- <li onclick="SN.Fun.areasNumFmt('¥#,##0.00');">人民币<span class="sn-color-999 sn-float-end">¥0.01</span>
89274
- </li>
89275
- <li onclick="SN.Fun.areasNumFmt('$#,##0.00');">美元<span class="sn-color-999 sn-float-end">$0.01</span>
89276
- </li>
89277
- <li onclick='SN.Fun.areasNumFmt(\`_ ¥* #,##0.00_ ;_ ¥* -#,##0.00_ ;_ ¥* "-"??_ ;_ @_ \`);'>会计专用<span
89278
- class="sn-color-999 sn-float-end">¥0.01</span>
89279
- </li>
89280
- <li onclick="SN.Fun.areasNumFmt('yyyy/m/d');">日期<span class="sn-color-999 sn-float-end">1900/1/1</span>
89281
- </li>
89282
- <li onclick="SN.Fun.areasNumFmt('yyyy年m月d日');">日期<span class="sn-color-999 sn-float-end">1900年1月1日</span>
89283
- </li>
89284
- <li onclick="SN.Fun.areasNumFmt('h:mm:ss');">时间<span class="sn-color-999 sn-float-end">0:08:38</span>
89285
- </li>
89286
- <li onclick="SN.Fun.areasNumFmt('yyyy/m/d h:mm:ss');">日期时间<span class="sn-color-999 sn-float-end">2024/10/1
89287
- 12:00:00</span></li>
89288
- <li onclick="SN.Fun.areasNumFmt('@');">文本<span class="sn-color-999 sn-float-end">0.006</span>
89289
- </li>
89290
- <li onclick="SN.Utils.pi('将A列数字格式显示为:¥100')">AI自定义</li>
89291
- </ul>
89243
+ <ul class="sn-dropdown-menu">
89244
+ <li onclick="${ns2}.Fun.areasStyle('alignment',{vertical:'top'});">居上</li>
89245
+ <li onclick="${ns2}.Fun.areasStyle('alignment',{vertical:'center'});">居中</li>
89246
+ <li onclick="${ns2}.Fun.areasStyle('alignment',{vertical:'bottom'});">局下</li>
89247
+ </ul>
89248
+ </div>
89249
+ <i onclick="${ns2}.Fun.mergeCell();" class="iconfont icon-hebingdanyuange sn-tooltip" title="合并单元格"></i>
89250
+ <span></span>
89251
+ <div class="sn-dropdown sn-tooltip" title="数字格式">
89252
+ <div class="sn-dropdown-toggle">
89253
+ <i class="iconfont icon-shuzhigeshi"></i>
89292
89254
  </div>
89293
- <i onclick="SN.Fun.decimalPlaces('cut');" class="iconfont icon-xiaoshudianzuoyi sn-tooltip" title="减少小数位数"></i>
89294
- <i onclick="SN.Fun.decimalPlaces('add');" class="iconfont icon-xiaoshudianyouyi sn-tooltip" title="增加小数位数"></i>
89295
- <i onclick="SN.Utils.pi('在A1编写公式,求F18:G21的平均值');" class="iconfont icon-formula sn-tooltip" title="公式"></i>
89296
- <i onclick="SN.Utils.pi('请帮我查询此表A列含xx, B列含XX的行, 另外请保留表头');" class="iconfont icon-shaixuan1 sn-tooltip" title="筛选"></i>
89297
- <i onclick="SN.Utils.pi('请帮我将A列数字升序排序');" class="iconfont icon-paixu sn-tooltip" title="排序"></i>
89298
- <span></span>
89299
- <div class="sn-dropdown sn-tooltip" title="冻结">
89300
- <div class="sn-dropdown-toggle">
89301
- <i class="iconfont icon-dongjiebiaotou"></i>
89302
- </div>
89303
- <ul class="sn-dropdown-menu">
89304
- <li onclick="SN.activeSheet.ySplit=1;SN.r()">冻结首行</li>
89305
- <li onclick="SN.activeSheet.xSplit=1;SN.r()">冻结首列</li>
89306
- <li onclick="SN.activeSheet.xSplit=0;SN.activeSheet.ySplit=0;SN.r()">解冻</li>
89307
- </ul>
89255
+ <ul class="sn-dropdown-menu" style="min-width: 220px;">
89256
+ <li onclick="${ns2}.Fun.areasNumFmt('');">常规</li>
89257
+ <li onclick="${ns2}.Fun.areasNumFmt('0.00');">数值<span class="sn-color-999 sn-float-end">0.01</span>
89258
+ </li>
89259
+ <li onclick="${ns2}.Fun.areasNumFmt('0.00%');">百分比<span class="sn-color-999 sn-float-end">0.60%</span>
89260
+ </li>
89261
+ <li onclick="${ns2}.Fun.areasNumFmt('# ?/?');">分数<span class="sn-color-999 sn-float-end">2 1/2</span>
89262
+ </li>
89263
+ <li onclick="${ns2}.Fun.areasNumFmt('0.00E+00');">科学记数<span class="sn-color-999 sn-float-end">6.00E-03</span>
89264
+ </li>
89265
+ <li onclick="${ns2}.Fun.areasNumFmt('¥#,##0.00');">人民币<span class="sn-color-999 sn-float-end">¥0.01</span>
89266
+ </li>
89267
+ <li onclick="${ns2}.Fun.areasNumFmt('$#,##0.00');">美元<span class="sn-color-999 sn-float-end">$0.01</span>
89268
+ </li>
89269
+ <li onclick='${ns2}.Fun.areasNumFmt(\`_ ¥* #,##0.00_ ;_ ¥* -#,##0.00_ ;_ ¥* "-"??_ ;_ @_ \`);'>会计专用<span
89270
+ class="sn-color-999 sn-float-end">¥0.01</span>
89271
+ </li>
89272
+ <li onclick="${ns2}.Fun.areasNumFmt('yyyy/m/d');">日期<span class="sn-color-999 sn-float-end">1900/1/1</span>
89273
+ </li>
89274
+ <li onclick="${ns2}.Fun.areasNumFmt('yyyy年m月d日');">日期<span class="sn-color-999 sn-float-end">1900年1月1日</span>
89275
+ </li>
89276
+ <li onclick="${ns2}.Fun.areasNumFmt('h:mm:ss');">时间<span class="sn-color-999 sn-float-end">0:08:38</span>
89277
+ </li>
89278
+ <li onclick="${ns2}.Fun.areasNumFmt('yyyy/m/d h:mm:ss');">日期时间<span class="sn-color-999 sn-float-end">2024/10/1
89279
+ 12:00:00</span></li>
89280
+ <li onclick="${ns2}.Fun.areasNumFmt('@');">文本<span class="sn-color-999 sn-float-end">0.006</span>
89281
+ </li>
89282
+ <li onclick="${ns2}.Utils.pi('将A列数字格式显示为:¥100')">AI自定义</li>
89283
+ </ul>
89284
+ </div>
89285
+ <i onclick="${ns2}.Fun.decimalPlaces('cut');" class="iconfont icon-xiaoshudianzuoyi sn-tooltip" title="减少小数位数"></i>
89286
+ <i onclick="${ns2}.Fun.decimalPlaces('add');" class="iconfont icon-xiaoshudianyouyi sn-tooltip" title="增加小数位数"></i>
89287
+ <i onclick="${ns2}.Utils.pi('在A1编写公式,求F18:G21的平均值');" class="iconfont icon-formula sn-tooltip" title="公式"></i>
89288
+ <i onclick="${ns2}.Utils.pi('请帮我查询此表A列含xx, B列含XX的行, 另外请保留表头');" class="iconfont icon-shaixuan1 sn-tooltip" title="筛选"></i>
89289
+ <i onclick="${ns2}.Utils.pi('请帮我将A列数字升序排序');" class="iconfont icon-paixu sn-tooltip" title="排序"></i>
89290
+ <span></span>
89291
+ <div class="sn-dropdown sn-tooltip" title="冻结">
89292
+ <div class="sn-dropdown-toggle">
89293
+ <i class="iconfont icon-dongjiebiaotou"></i>
89308
89294
  </div>
89309
- <i onclick="SN.Utils.fullScreen()" class="iconfont icon-quanping sn-tooltip wap-hidden" title="全屏"></i>
89295
+ <ul class="sn-dropdown-menu">
89296
+ <li onclick="${ns2}.activeSheet.ySplit=1;${ns2}.r()">冻结首行</li>
89297
+ <li onclick="${ns2}.activeSheet.xSplit=1;${ns2}.r()">冻结首列</li>
89298
+ <li onclick="${ns2}.activeSheet.xSplit=0;${ns2}.activeSheet.ySplit=0;${ns2}.r()">解冻</li>
89299
+ </ul>
89310
89300
  </div>
89311
- <div class="sn-op">
89312
-
89313
- <div id="snChat">
89314
- <div class="sn-chat-input">
89315
- <div class="sn-chat-head d-flex justify-content-between align-items-center">
89316
- ⚙️ AI 助手
89317
- <i onclick="SN.Layout.showAIChatWindow=!SN.Layout.showAIChatWindow" class="icon-xiaochuangbofang iconfont"></i>
89318
- </div>
89319
- <div class="upImgList"></div>
89320
- <textarea autocomplete="off" id="promptInput" rows="3"
89321
- placeholder="输入需求进行逻辑操作、图转表、分析、问答、录入..."></textarea>
89322
- <div class="input-btns">
89323
- <div>
89324
- <button class="send-btn sn-tooltip" onclick="SN.AI.clearChat()" title="清空上下文">
89325
- <i class="iconfont icon-clear"></i>
89326
- </button>
89327
- <button class="send-btn sn-tooltip" onclick="document.getElementById('fileInput').click()" title="上传图片,可粘贴">
89328
- <i class="iconfont icon-tupian1"></i>
89329
- </button>
89330
- <input type="file" id="fileInput" accept="image/*" style="display: none;" multiple
89331
- onchange="SN.AI.handleFileChange(event)">
89301
+ <i onclick="${ns2}.Utils.fullScreen()" class="iconfont icon-quanping sn-tooltip wap-hidden" title="全屏"></i>
89302
+ </div>
89303
+ <div class="sn-op">
89332
89304
 
89333
- </div>
89334
- <button class="send-btn" id="sendBtn" onclick="SN.AI.conversation(document.querySelector('#promptInput').value)">
89335
- <i class="iconfont icon-fasong"></i>
89305
+ <div id="snChat">
89306
+ <div class="sn-chat-input">
89307
+ <div class="sn-chat-head d-flex justify-content-between align-items-center">
89308
+ ⚙️ AI 助手
89309
+ <i onclick="${ns2}.Layout.showAIChatWindow=!${ns2}.Layout.showAIChatWindow" class="icon-xiaochuangbofang iconfont"></i>
89310
+ </div>
89311
+ <div class="upImgList"></div>
89312
+ <textarea autocomplete="off" id="promptInput" rows="3"
89313
+ placeholder="输入需求进行逻辑操作、图转表、分析、问答、录入..."></textarea>
89314
+ <div class="input-btns">
89315
+ <div>
89316
+ <button class="send-btn sn-tooltip" onclick="${ns2}.AI.clearChat()" title="清空上下文">
89317
+ <i class="iconfont icon-clear"></i>
89336
89318
  </button>
89319
+ <button class="send-btn sn-tooltip" onclick="document.getElementById('fileInput').click()" title="上传图片,可粘贴">
89320
+ <i class="iconfont icon-tupian1"></i>
89321
+ </button>
89322
+ <input type="file" id="fileInput" accept="image/*" style="display: none;" multiple
89323
+ onchange="${ns2}.AI.handleFileChange(event)">
89324
+
89337
89325
  </div>
89326
+ <button class="send-btn" id="sendBtn" onclick="${ns2}.AI.conversation(document.querySelector('#promptInput').value)">
89327
+ <i class="iconfont icon-fasong"></i>
89328
+ </button>
89338
89329
  </div>
89339
- <p class="sn-f13 sn-color-999 sn-pl-2 sn-mb-2 sn-mt-2">* 对话越多时间和算力消耗越多,历史对话无关时请及时清理。</p>
89340
- <div class="sn-chat-info">
89341
- <div class="dryd chat-system" onclick="document.getElementById('upload').click()">
89342
- <svg t="1755248852288" class="icon" viewBox="0 0 1113 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7610" width="30" height="30"><path d="M801.391304 284.382609L550.4 0 299.408696 284.382609h161.391304v384.556521h186.434783V284.382609h154.156521z" fill="#999" p-id="7611"></path><path d="M1113.043478 712.347826l-199.791304-310.53913h-166.956522v75.130434h83.478261l151.373913 235.408696h-234.852174v102.4H366.747826V712.347826H131.895652l151.373913-235.408696h82.921739V401.808696H199.791304L0 712.347826v311.652174h1113.043478v-311.652174z" fill="#999" p-id="7612"></path></svg>
89343
- <div class="mt-2 f14" style="letter-spacing: 1px;">快速导入要操作的xlsx,或直接生成想要的内容</div>
89344
- </div>
89345
- <div class="chat-msg chat-system">
89346
- <div class="info-box">
89347
- <div class="f14 pb-1" style="letter-spacing:1px;">💡 支持数据分析、图表操作、图片转表、逻辑操作、快速建表、整理录入等所有excel任务,提示词示例:</div>
89348
- <ul class="sn-color-999 sn-mb-0 sn-mt-3 sn-chat-associate sn-px-0" style="list-style: none;">
89349
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">请为B1-B10单元格添加下拉菜单:香蕉/苹果/芒果/其他</li>
89350
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">生成美观的2025年日历表</li>
89351
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">分组高亮不同部门</li>
89352
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">请帮我删除空白行</li>
89353
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">请将营业额向上去整</li>
89354
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">根据你觉得核心的维度分析表中数据,生成汇总表、图表、总结到一张新表中</li>
89355
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">将不同部门拆分到不同表</li>
89356
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">帮我生成一个会议记录表模板</li>
89357
- <li onclick="SN.Utils.pi(this.innerText);" class="sn-mb-2">部门列降序排序后将相同部门合并</li>
89358
- </ul>
89359
- </div>
89330
+ </div>
89331
+ <p class="sn-f13 sn-color-999 sn-pl-2 sn-mb-2 sn-mt-2">* 对话越多时间和算力消耗越多,历史对话无关时请及时清理。</p>
89332
+ <div class="sn-chat-info">
89333
+ <div class="dryd chat-system" onclick="document.getElementById('upload').click()">
89334
+ <svg t="1755248852288" class="icon" viewBox="0 0 1113 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7610" width="30" height="30"><path d="M801.391304 284.382609L550.4 0 299.408696 284.382609h161.391304v384.556521h186.434783V284.382609h154.156521z" fill="#999" p-id="7611"></path><path d="M1113.043478 712.347826l-199.791304-310.53913h-166.956522v75.130434h83.478261l151.373913 235.408696h-234.852174v102.4H366.747826V712.347826H131.895652l151.373913-235.408696h82.921739V401.808696H199.791304L0 712.347826v311.652174h1113.043478v-311.652174z" fill="#999" p-id="7612"></path></svg>
89335
+ <div class="mt-2 f14" style="letter-spacing: 1px;">快速导入要操作的xlsx,或直接生成想要的内容</div>
89336
+ </div>
89337
+ <div class="chat-msg chat-system sn-associate">
89338
+ <div class="info-box">
89339
+ <div class="f14 pb-1" style="letter-spacing:1px;">💡 支持数据分析、图表操作、图片转表、逻辑操作、快速建表、整理录入等所有excel任务,提示词示例:</div>
89340
+ <ul class="sn-color-999 sn-mb-0 sn-mt-3 sn-chat-associate sn-px-0" style="list-style: none;">
89341
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">请为B1-B10单元格添加下拉菜单:香蕉/苹果/芒果/其他</li>
89342
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">生成美观的2025年日历表</li>
89343
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">分组高亮不同部门</li>
89344
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">请帮我删除空白行</li>
89345
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">请将营业额向上去整</li>
89346
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">根据你觉得核心的维度分析表中数据,生成汇总表、图表、总结到一张新表中</li>
89347
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">将不同部门拆分到不同表</li>
89348
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">帮我生成一个会议记录表模板</li>
89349
+ <li onclick="${ns2}.Utils.pi(this.innerText);" class="sn-mb-2">部门列降序排序后将相同部门合并</li>
89350
+ </ul>
89360
89351
  </div>
89361
89352
  </div>
89362
89353
  </div>
89363
- <div class="sn-content">
89354
+ </div>
89355
+ <div class="sn-content">
89364
89356
 
89365
- <div class="sn-input">
89366
- <span onclick="SN.Layout.showAIChat=!SN.Layout.showAIChat" class="sn-cur">🤖</span>
89367
- <span class="sn-text-center f14 sn-cur" id="areaDom">A1</span>
89368
- <div class="formulaBarBox">
89369
- <div class="sn-color-999 sn-text-center op-btns">
89370
- <i class="iconfont icon-cuowu sn-cur" id="opCancel"></i>&nbsp;
89371
- <i class="iconfont icon-zhengque sn-cur" id="opConfirm"></i>&nbsp;
89372
- <i class="iconfont icon-gongshi1 sn-cur" id="opFun" onclick="SN.Utils.pi('在A1编写公式,求F18:G21的平均值');"></i>
89373
- </div>
89374
- <textarea autocomplete="off" rows="1" id="formulaBar" placeholder=""></textarea>
89357
+ <div class="sn-input">
89358
+ <span onclick="${ns2}.Layout.showAIChat=!${ns2}.Layout.showAIChat" class="sn-cur">🤖</span>
89359
+ <span class="sn-text-center f14 sn-cur" id="areaDom">A1</span>
89360
+ <div class="formulaBarBox">
89361
+ <div class="sn-color-999 sn-text-center op-btns">
89362
+ <i class="iconfont icon-cuowu sn-cur" id="opCancel"></i>&nbsp;
89363
+ <i class="iconfont icon-zhengque sn-cur" id="opConfirm"></i>&nbsp;
89364
+ <i class="iconfont icon-gongshi1 sn-cur" id="opFun" onclick="${ns2}.Utils.pi('在A1编写公式,求F18:G21的平均值');"></i>
89375
89365
  </div>
89366
+ <textarea autocomplete="off" rows="1" id="formulaBar" placeholder=""></textarea>
89376
89367
  </div>
89377
- <div id="analysis">
89378
- <div id="sn">
89379
- <!-- Loading -->
89380
- <div id="loadingDiv">
89381
- <div class="spinner-border sn-text-primary" role="status">
89382
- <span class="visually-hidden">Loading...</span>
89383
- </div>
89384
- <div class="f14 sn-color-999">加载编辑器中...</div>
89368
+ </div>
89369
+ <div id="analysis">
89370
+ <div id="sn">
89371
+ <!-- Loading -->
89372
+ <div id="loadingDiv">
89373
+ <div class="spinner-border sn-text-primary" role="status">
89374
+ <span class="visually-hidden">Loading...</span>
89385
89375
  </div>
89386
- <!-- 显示层,基础数据显示 -->
89387
- <canvas id="showLayer" width="0" height="0"></canvas>
89388
- <!-- 中间层,图纸/选中等 -->
89389
- <div id="middleLayer">
89390
- <!-- 图纸 -->
89391
- <div id="drawingsCon"></div>
89376
+ <div class="f14 sn-color-999">加载编辑器中...</div>
89377
+ </div>
89378
+ <!-- 显示层,基础数据显示 -->
89379
+ <canvas id="showLayer" width="0" height="0"></canvas>
89380
+ <!-- 中间层,图纸/选中等 -->
89381
+ <div id="middleLayer">
89382
+ <!-- 图纸 -->
89383
+ <div id="drawingsCon"></div>
89384
+ </div>
89385
+ <!-- 操作层,鼠标操作 -->
89386
+ <canvas id="handleLayer"></canvas>
89387
+ <!-- 顶层,滚动条,各种悬浮框 -->
89388
+ <div id="topLayer">
89389
+ <!-- Scroll bar -->
89390
+ <div class="sn-roll-y">
89391
+ <div></div>
89392
89392
  </div>
89393
- <!-- 操作层,鼠标操作 -->
89394
- <canvas id="handleLayer"></canvas>
89395
- <!-- 顶层,滚动条,各种悬浮框 -->
89396
- <div id="topLayer">
89397
- <!-- Scroll bar -->
89398
- <div class="sn-roll-y">
89399
- <div></div>
89400
- </div>
89401
- <div class="sn-roll-x">
89402
- <div></div>
89403
- </div>
89404
- <!-- 滚动位置提示 -->
89405
- <div id="scrollTip"></div>
89406
- <div id="snInput" contenteditable="true" style="z-index: -1;"></div>
89407
- <!-- drag line -->
89408
- <div id="snDragLine"></div>
89409
- <!-- padding config -->
89410
- <div class="dropdown sn-cur bg-white" id="paddingType">
89411
- <div class="sn-dropdown-toggle"><i
89412
- class="iconfont icon-biaoge"></i>
89413
- </div>
89414
- <ul class="sn-dropdown-menu">
89415
- <li onclick="SN.activeSheet.paddingArea(undefined,undefined,'order');SN.r();">序列填充
89416
- </li>
89417
- <li onclick="SN.activeSheet.paddingArea(undefined,undefined,'copy');SN.r();">复制单元格
89418
- </li>
89419
- <li onclick="SN.activeSheet.paddingArea(undefined,undefined,'format');SN.r();">
89420
- 仅填充格式
89421
- </li>
89422
- <li onclick="SN.activeSheet.paddingArea(undefined,undefined,'noFormat');SN.r();">
89423
- 不填充格式
89424
- </li>
89425
- </ul>
89426
- </div>
89427
- <!-- 超链接 -->
89428
- <div onclick="SN.activeSheet.hyperlinkJump(this)" id="hyperlinkJumpBtn" class="sn-cur">
89429
- <i class="iconfont icon-a-chexiaozhongzuoxiayibu-xianxing"></i>
89430
- </div>
89431
- <!-- 数据验证下拉框 -->
89432
- <div class="dropdown sn-cur bg-white" id="validSelect">
89433
- <div class="sn-dropdown-toggle"><i
89434
- class="iconfont icon-biaoge"></i></div>
89435
- <ul class="sn-dropdown-menu"></ul>
89436
- </div>
89437
- <!-- 数据验证提示框 -->
89438
- <div id="validTip">
89439
- <div class="fw-bold"></div>
89440
- <span></span>
89393
+ <div class="sn-roll-x">
89394
+ <div></div>
89395
+ </div>
89396
+ <!-- 滚动位置提示 -->
89397
+ <div id="scrollTip"></div>
89398
+ <div id="snInput" contenteditable="true" style="z-index: -1;"></div>
89399
+ <!-- drag line -->
89400
+ <div id="snDragLine"></div>
89401
+ <!-- padding config -->
89402
+ <div class="dropdown sn-cur bg-white" id="paddingType">
89403
+ <div class="sn-dropdown-toggle"><i
89404
+ class="iconfont icon-biaoge"></i>
89441
89405
  </div>
89442
- <!-- column right click -->
89443
- <div class="rc-box" id="colRC">
89444
- <div onclick="SN.Fun.addCols(event,'left')">在左侧插入<input type="number" min="1" max="10"
89445
- value="1">列
89446
- </div>
89447
- <div onclick="SN.Fun.addCols(event,'right')">在右侧插入<input type="number" min="1" max="10"
89448
- value="1">列
89449
- </div>
89450
- <div onclick="SN.Fun.hidCols()">隐藏列</div>
89451
- <div onclick="SN.Fun.delCols()">删除列</div>
89406
+ <ul class="sn-dropdown-menu">
89407
+ <li onclick="${ns2}.activeSheet.paddingArea(undefined,undefined,'order');${ns2}.r();">序列填充
89408
+ </li>
89409
+ <li onclick="${ns2}.activeSheet.paddingArea(undefined,undefined,'copy');${ns2}.r();">复制单元格
89410
+ </li>
89411
+ <li onclick="${ns2}.activeSheet.paddingArea(undefined,undefined,'format');${ns2}.r();">
89412
+ 仅填充格式
89413
+ </li>
89414
+ <li onclick="${ns2}.activeSheet.paddingArea(undefined,undefined,'noFormat');${ns2}.r();">
89415
+ 不填充格式
89416
+ </li>
89417
+ </ul>
89418
+ </div>
89419
+ <!-- 超链接 -->
89420
+ <div onclick="${ns2}.activeSheet.hyperlinkJump(this)" id="hyperlinkJumpBtn" class="sn-cur">
89421
+ <i class="iconfont icon-a-chexiaozhongzuoxiayibu-xianxing"></i>
89422
+ </div>
89423
+ <!-- 数据验证下拉框 -->
89424
+ <div class="dropdown sn-cur bg-white" id="validSelect">
89425
+ <div class="sn-dropdown-toggle"><i
89426
+ class="iconfont icon-biaoge"></i></div>
89427
+ <ul class="sn-dropdown-menu"></ul>
89428
+ </div>
89429
+ <!-- 数据验证提示框 -->
89430
+ <div id="validTip">
89431
+ <div class="fw-bold"></div>
89432
+ <span></span>
89433
+ </div>
89434
+ <!-- column right click -->
89435
+ <div class="rc-box" id="colRC">
89436
+ <div onclick="${ns2}.Fun.addCols(event,'left')">在左侧插入<input type="number" min="1" max="10"
89437
+ value="1">列
89452
89438
  </div>
89453
- <!-- row right click -->
89454
- <div class="rc-box" id="rowRC">
89455
- <div onclick="SN.Fun.addRows(event,'top')">在上方插入<input type="number" min="1" max="10"
89456
- value="1">行
89457
- </div>
89458
- <div onclick="SN.Fun.addRows(event,'bottom')">在下方插入<input type="number" min="1" max="10"
89459
- value="1">行
89460
- </div>
89461
- <div onclick="SN.Fun.hidRows()">隐藏行</div>
89462
- <div onclick="SN.Fun.delRows()">删除行</div>
89439
+ <div onclick="${ns2}.Fun.addCols(event,'right')">在右侧插入<input type="number" min="1" max="10"
89440
+ value="1">列
89463
89441
  </div>
89464
- <!-- cell right click -->
89465
- <div class="rc-box" id="cellRC" onclick="this.style.display='none'">
89466
- <div onclick="SN.Fun.fontInversion('bold');"><i
89467
- class="iconfont icon-fuwenbenbianjiqi_jiacu"></i>
89468
- 加粗</div>
89469
- <div onclick="SN.Fun.fontInversion('italic');"><i class="iconfont icon-qingxie"></i>
89470
- 倾斜
89471
- </div>
89472
- <div onclick="SN.Fun.fontInversion('underline','single');"><i
89473
- class="iconfont icon-xiahuaxian1"></i>
89474
- 下划线</div>
89475
- <div onclick="SN.Fun.fontInversion('strike');"><i class="iconfont icon-strikethrough"></i>
89476
- 删除线</div>
89477
- <div onclick="SN.Utils.pi(areaDom.innerText)"><i class="iconfont icon-gengduo"></i> 更多</div>
89442
+ <div onclick="${ns2}.Fun.hidCols()">隐藏列</div>
89443
+ <div onclick="${ns2}.Fun.delCols()">删除列</div>
89444
+ </div>
89445
+ <!-- row right click -->
89446
+ <div class="rc-box" id="rowRC">
89447
+ <div onclick="${ns2}.Fun.addRows(event,'top')">在上方插入<input type="number" min="1" max="10"
89448
+ value="1">行
89478
89449
  </div>
89479
- <!-- cell right click -->
89480
- <div class="rc-box" id="drawingRC" onclick="this.style.display='none'">
89481
- <div onclick="SN.Utils.pi('帮我调整一下ID为' + SN.Canvas.activeDrawing?.id + '的图纸,调整需求:')"><i
89482
- class="iconfont icon-zhinengyouhua"></i> AI 调整</div>
89483
- <div onclick="SN.Canvas.activeDrawing.updIndex('top');SN.r('s');"><i
89484
- class="iconfont icon-zhiding"></i> 置于顶部</div>
89485
- <div onclick="SN.Canvas.activeDrawing.updIndex('bottom');SN.r('s');"><i
89486
- class="iconfont icon-zhidi"></i> 置于底部</div>
89487
- <div onclick="SN.Canvas.activeDrawing.updIndex('up');SN.r('s');"><i
89488
- class="iconfont icon-shangyi"></i> 上移一层</div>
89489
- <div onclick="SN.Canvas.activeDrawing.updIndex('down');SN.r('s');"><i
89490
- class="iconfont icon-xiayi"></i> 下移一层</div>
89491
- <div onclick="SN.activeSheet.removeDrawing(SN.Canvas.activeDrawing.id);SN.r('s');"><i
89492
- class="iconfont icon-shanchu1"></i> 删除此图纸</div>
89450
+ <div onclick="${ns2}.Fun.addRows(event,'bottom')">在下方插入<input type="number" min="1" max="10"
89451
+ value="1">行
89493
89452
  </div>
89453
+ <div onclick="${ns2}.Fun.hidRows()">隐藏行</div>
89454
+ <div onclick="${ns2}.Fun.delRows()">删除行</div>
89494
89455
  </div>
89495
- </div>
89496
- <div class="sn-sheets">
89497
- <div class="sn-sheet-mgt">
89498
- <i class="iconfont icon-tianjia sn-cur sn-sheets-btn" onmousedown="SN.activeSheet = SN.addSheet();"></i>
89456
+ <!-- cell right click -->
89457
+ <div class="rc-box" id="cellRC" onclick="this.style.display='none'">
89458
+ <div onclick="${ns2}.Fun.fontInversion('bold');"><i
89459
+ class="iconfont icon-fuwenbenbianjiqi_jiacu"></i>
89460
+ 加粗</div>
89461
+ <div onclick="${ns2}.Fun.fontInversion('italic');"><i class="iconfont icon-qingxie"></i>
89462
+ 倾斜
89463
+ </div>
89464
+ <div onclick="${ns2}.Fun.fontInversion('underline','single');"><i
89465
+ class="iconfont icon-xiahuaxian1"></i>
89466
+ 下划线</div>
89467
+ <div onclick="${ns2}.Fun.fontInversion('strike');"><i class="iconfont icon-strikethrough"></i>
89468
+ 删除线</div>
89469
+ <div onclick="${ns2}.Utils.pi(areaDom.innerText)"><i class="iconfont icon-gengduo"></i> 更多</div>
89499
89470
  </div>
89500
- <div class="sn-sheet-list" id="sheets">
89501
- <button class="sheet-sel">Sheet1</button>
89471
+ <!-- cell right click -->
89472
+ <div class="rc-box" id="drawingRC" onclick="this.style.display='none'">
89473
+ <div onclick="${ns2}.Utils.pi('帮我调整一下ID为' + ${ns2}.Canvas.activeDrawing?.id + '的图纸,调整需求:')"><i
89474
+ class="iconfont icon-zhinengyouhua"></i> AI 调整</div>
89475
+ <div onclick="${ns2}.Canvas.activeDrawing.updIndex('top');${ns2}.r('s');"><i
89476
+ class="iconfont icon-zhiding"></i> 置于顶部</div>
89477
+ <div onclick="${ns2}.Canvas.activeDrawing.updIndex('bottom');${ns2}.r('s');"><i
89478
+ class="iconfont icon-zhidi"></i> 置于底部</div>
89479
+ <div onclick="${ns2}.Canvas.activeDrawing.updIndex('up');${ns2}.r('s');"><i
89480
+ class="iconfont icon-shangyi"></i> 上移一层</div>
89481
+ <div onclick="${ns2}.Canvas.activeDrawing.updIndex('down');${ns2}.r('s');"><i
89482
+ class="iconfont icon-xiayi"></i> 下移一层</div>
89483
+ <div onclick="${ns2}.activeSheet.removeDrawing(${ns2}.Canvas.activeDrawing.id);${ns2}.r('s');"><i
89484
+ class="iconfont icon-shanchu1"></i> 删除此图纸</div>
89502
89485
  </div>
89503
- <div class="sn-text-center">
89504
- <div class="sn-dropdown">
89505
- <i class="iconfont icon-gengduo sn-dropdown-toggle sn-cur sn-sheets-btn sn-no-icon" onmousedown="SN.Layout.moreSheet(this)"></i>
89506
- <ul class="sn-dropdown-menu" style="width: 160px;"></ul>
89507
- </div>
89486
+ </div>
89487
+ </div>
89488
+ <div class="sn-sheets">
89489
+ <div class="sn-sheet-mgt">
89490
+ <i class="iconfont icon-tianjia sn-cur sn-sheets-btn" onmousedown="${ns2}.activeSheet = ${ns2}.addSheet();"></i>
89491
+ </div>
89492
+ <div class="sn-sheet-list" id="sheets">
89493
+ <button class="sheet-sel">Sheet1</button>
89494
+ </div>
89495
+ <div class="sn-text-center">
89496
+ <div class="sn-dropdown">
89497
+ <i class="iconfont icon-gengduo sn-dropdown-toggle sn-cur sn-sheets-btn sn-no-icon" onmousedown="${ns2}.Layout.moreSheet(this)"></i>
89498
+ <ul class="sn-dropdown-menu" style="width: 160px;"></ul>
89508
89499
  </div>
89509
89500
  </div>
89510
89501
  </div>
89511
-
89512
89502
  </div>
89513
89503
 
89514
89504
  </div>
89515
- </main>
89516
- <input type="file" accept=".xlsx" id="upload" hidden="hidden" />
89517
- <div class="toast-container"></div>
89505
+
89506
+ </div>
89507
+ </main>
89508
+ <input type="file" accept=".xlsx" id="upload" hidden="hidden" />
89509
+ <div class="toast-container"></div>
89518
89510
  `;
89519
89511
  }
89520
89512
  _cacheDOMElements() {
@@ -89681,22 +89673,6 @@ class Layout {
89681
89673
  window.addEventListener("load", removeLoadingDiv);
89682
89674
  }
89683
89675
  }
89684
- addHrefsBtn() {
89685
- const html = `<div class="input-group mb-3 input-group-sm">
89686
- <span class="input-group-text">链接地址</span>
89687
- <input type="text" class="form-control sn-f13" id='iA' placeholder="请输入链接地址(必须带http/s)">
89688
- </div>
89689
- <div class="input-group input-group-sm">
89690
- <span class="input-group-text">提示文本</span>
89691
- <input type="text" class="form-control sn-f13" id='iB' placeholder="请输入提示文本(可选)">
89692
- </div>`;
89693
- this.SN.Utils.showModal(html).then((res) => {
89694
- if (res != "ok") return;
89695
- const hyperlink = document.querySelector("#iA").value;
89696
- const tooltip = document.querySelector("#iB").value;
89697
- this.hrefs(hyperlink, tooltip);
89698
- });
89699
- }
89700
89676
  showChat(keepOpen) {
89701
89677
  if (keepOpen || this.snChat.style.display === "none") {
89702
89678
  this.snChat.style.display = "block";
@@ -89709,23 +89685,10 @@ class Layout {
89709
89685
  this.SN.sheets.forEach((sheet2) => {
89710
89686
  if (sheet2.name == this.SN.activeSheet.name) return html += `<li class="sn-text-primary" data-ds="true">${sheet2.name}</li>`;
89711
89687
  if (sheet2.hidden) return;
89712
- html += `<li onmousedown="SN.activeSheet=SN.getSheetByName('${sheet2.name}')">${sheet2.name}</li>`;
89688
+ html += `<li onmousedown="${ns}.activeSheet=${ns}.getSheetByName('${sheet2.name}')">${sheet2.name}</li>`;
89713
89689
  });
89714
89690
  dom2.nextElementSibling.innerHTML = html;
89715
89691
  }
89716
- hrefs(hyperlink, tooltip) {
89717
- const sheet2 = this.SN.activeSheet;
89718
- const areas = sheet2.activeAreas;
89719
- sheet2.eachAreas(areas, ({ c, r, s, e: e2 }) => {
89720
- const cell = sheet2.getCell(r, c);
89721
- cell.font = { color: "#800080", underline: "single" };
89722
- cell.hyperlink = {
89723
- target: hyperlink,
89724
- tooltip
89725
- };
89726
- });
89727
- this.SN.r();
89728
- }
89729
89692
  }
89730
89693
  class Fun {
89731
89694
  constructor(SN2) {
@@ -97697,7 +97660,7 @@ const docAiMd = `\r
97697
97660
  - RangeStr : e.g., A1:C3 | A:B | 1:2\r
97698
97661
  - RangeRef : RangeNum | RangeStr\r
97699
97662
  \r
97700
- # SN Class\r
97663
+ # _$SNSPACE Class\r
97701
97664
  ## attr\r
97702
97665
  - activeSheet:Sheet\r
97703
97666
  - sheets:Sheet[]\r
@@ -97753,7 +97716,7 @@ interface SortItem {\r
97753
97716
  }\r
97754
97717
  \`\`\`javascript\r
97755
97718
  // Except for the header, sort by the letters in column C in the following order: A V U T\r
97756
- const sheet=SN.activeSheet\r
97719
+ const sheet=_$SNSPACE.activeSheet\r
97757
97720
  sheet.rangeSort([{type: 'column', order: 'value', index: 'C', sortData: ["A", "V", "U", "T"]}],{s:{c:0,r:1},e:{c:sheet.colCount,r:sheet.rowCount}});\r
97758
97721
  \`\`\`\r
97759
97722
  - insertTable(ISheet:(ICellConfig | str | num)[][],startCell:CellRef,globalConfig:{a,border,w,h,fg,c}):RangeNum\r
@@ -97783,12 +97746,12 @@ const t = [\r
97783
97746
  [{ v: "Content", h: 280 }, { mr: 2 }, "", ""],\r
97784
97747
  [{ v: "Remarks", h: 80 }, { mr: 2 }, "", ""]\r
97785
97748
  ]; // It must be a rectangular matrix\r
97786
- SN.activeSheet.insertTable(t, "A1", { border: true, a: "c", h: 35, w: 140 }); // Insert into the blank area\r
97749
+ _$SNSPACE.activeSheet.insertTable(t, "A1", { border: true, a: "c", h: 35, w: 140 }); // Insert into the blank area\r
97787
97750
  \`\`\`\r
97788
97751
  - addDrawing({type,startCell,...}):Drawing\r
97789
97752
  \`\`\`javascript\r
97790
97753
  // e.g.\r
97791
- SN.activeSheet.addDrawing({type: 'chart',startCell: 'B2',option:{\r
97754
+ _$SNSPACE.activeSheet.addDrawing({type: 'chart',startCell: 'B2',option:{\r
97792
97755
  title: {text: 'Sales trend chart'},\r
97793
97756
  legend: {\r
97794
97757
  data: ['Sales volume'] // or \`\${sheet.name}!B3\`\r
@@ -97886,29 +97849,30 @@ SN.activeSheet.addDrawing({type: 'chart',startCell: 'B2',option:{\r
97886
97849
  }\r
97887
97850
  - Set light background for each row except the first\r
97888
97851
  {\r
97889
- "code": "const sheet=SN.activeSheet;sheet.eachArea(\`A2:A\${sheet.rows.length}\`,(r,c)=>sheet.getRow(r).fill={fgColor:'#EEEEEE'});",\r
97852
+ "code": "const sheet=_$SNSPACE.activeSheet;sheet.eachArea(\`A2:A\${sheet.rows.length}\`,(r,c)=>sheet.getRow(r).fill={fgColor:'#EEEEEE'});",\r
97890
97853
  "message": "Set all rows except the first to gray background"\r
97891
97854
  }\r
97892
97855
  - Delete blank lines\r
97893
97856
  {\r
97894
- "code":"const sheet = SN.activeSheet;sheet.eachArea('A:A', (r) => { if (sheet.getRow(r).cells.every(cell => !cell.showVal)) sheet.delRows(r, 1); }, true);"\r
97857
+ "code":"const sheet = _$SNSPACE.activeSheet;sheet.eachArea('A:A', (r) => { if (sheet.getRow(r).cells.every(cell => !cell.showVal)) sheet.delRows(r, 1); }, true);"\r
97895
97858
  "message": "Removed all blank lines"\r
97896
97859
  }\r
97897
97860
  - Filter the data containing the letter a in column a\r
97898
97861
  {\r
97899
- "code":"const sheet = SN.activeSheet;sheet.eachArea('A:A',(r,c)=>{if(!sheet.getCell(r,c).showVal.includes('a')) sheet.getRow(r).hidden = true;});",\r
97862
+ "code":"const sheet = _$SNSPACE.activeSheet;sheet.eachArea('A:A',(r,c)=>{if(!sheet.getCell(r,c).showVal.includes('a')) sheet.getRow(r).hidden = true;});",\r
97900
97863
  "message": "Filtering completed. Irrelevant data has been hidden"\r
97901
97864
  }\r
97902
97865
  - How many columns in A are greater than 50?\r
97903
97866
  {\r
97904
- "code": "const sheet = SN.activeSheet;let count = 0;sheet.eachArea('A:A', (r, c) => { if (sheet.getCell(r, c).showVal > 50) count++; });", \r
97867
+ "code": "const sheet = _$SNSPACE.activeSheet;let count = 0;sheet.eachArea('A:A', (r, c) => { if (sheet.getCell(r, c).showVal > 50) count++; });", \r
97905
97868
  "message": "There are \${count} items in column A greater than 50."\r
97906
97869
  }`;
97907
- const promptMd = "你是 SN 表格编辑器全能自动化 AI 助手\r\n\r\n已知:\r\n1.编辑器实时可视区域视图(若未提供则为空白表)\r\n2.SN 表格 Markdown 操作文档:{{DOC}}\r\n\r\n任务:\r\n根据已知信息,理解用户需求,生成操作代码或问答分析\r\n\r\n输出:\r\n使用以下标签格式输出:\r\n\r\n<status>状态标识(working|end)</status>\r\n<title>当前任务阶段总结(如:获取必要信息 / 生成模板等)</title>\r\n<code>JS执行代码(直接调用 SN 实例的属性和方法,不要注释,不需要时留空)</code>\r\n<message>精炼的反馈信息(支持用${变量名}引用code中的变量值)</message>\r\n\r\n状态解释:\r\n\r\n1.working(此任务缺少必要信息,且无法合理推断出来)\r\n - code中生成代码获取你想知道的数据内容或区域截图\r\n - message中说明正在获取什么信息以及原因\r\n - 系统将自动执行code并将结果传递回下一轮分析\r\n\r\n2.end\r\n - 任务结束或无法处理或需询问用户信息\r\n - message中反馈具体情况或结果说明\r\n\r\n注意:\r\n1.用户可能会手动编辑数据,所以非当前任务获取的数据可能已经不准确,一切以最新截图数据结构为基准进行处理\r\n2.新内容应在空白位置或新表,并告知用户位置,避免与已有内容位置冲突";
97870
+ const promptMd = "你是 SN 表格编辑器全能自动化 AI 助手\r\n\r\n已知:\r\n1.编辑器实时可视区域视图(若未提供则为空白表)\r\n2.SN 表格 Markdown 操作文档:{{DOC}}\r\n\r\n任务:\r\n根据已知信息,理解用户需求,生成操作代码或问答分析\r\n\r\n输出:\r\n使用以下标签格式输出:\r\n\r\n<title>当前任务阶段总结(如:获取必要信息 / 生成模板等)</title>\r\n<code>JS执行代码(直接调用命名空间:_$SNSPACE 上的属性和方法,代码禁止注释。不需要时留空)</code>\r\n<message>精炼的反馈信息(支持用${变量名}引用code中的变量值),或此任务缺少必要信息,且无法合理推断出来时询问用户</message>\r\n\r\n注意:\r\n1.若用户需要生成巨量数据,应该用代码组合构建,注意灵活判断\r\n2.用户可能会手动编辑数据,所以非当前任务获取的数据可能已经不准确,一切以最新截图数据结构为基准进行处理\r\n3.新内容应在空白位置或新表,并告知用户位置,避免与已有内容位置冲突";
97908
97871
  class AI {
97909
- constructor(SN2, options = {}) {
97872
+ constructor(SN2, option) {
97910
97873
  this.SN = SN2;
97911
- this.AI_URL = options.AI_URL ?? "http://localhost:3000/api/chat";
97874
+ this.AI_URL = option.AI_URL;
97875
+ this.AI_TOKEN = option.AI_TOKEN;
97912
97876
  this.messages = [];
97913
97877
  this.chatNum = 0;
97914
97878
  this.selectedFiles = [];
@@ -97931,11 +97895,12 @@ class AI {
97931
97895
  }
97932
97896
  if (joinChat) this.insertMsg("user", p);
97933
97897
  document.querySelector("#promptInput").value = "";
97898
+ const ns = this.SN.namespace;
97934
97899
  const chatBox = `<div class="chat-msg" id="chatNum${++this.chatNum}">
97935
97900
  <div class="info-op">
97936
97901
  <div class="info-box">
97937
97902
  <div class="ai-thinking">
97938
- <div class="ai-title thinking-title" onclick="SN.AI.toggleThinking(${this.chatNum})">
97903
+ <div class="ai-title thinking-title" onclick="${ns}.AI.toggleThinking(${this.chatNum})">
97939
97904
  <span>💭 <span class="title-text">思考中...</span></span>
97940
97905
  </div>
97941
97906
  <div class="chat-time">Take time : <span class="chat-clock">0</span> S</div>
@@ -97970,6 +97935,9 @@ class AI {
97970
97935
  let reworkNum = 0;
97971
97936
  const reqAI = async () => {
97972
97937
  try {
97938
+ if (!this.AI_URL || !this.AI_URL.trim()) {
97939
+ throw new Error("未配置 AI_URL,请在初始化时配置 AI_URL 参数,详见开发者文档");
97940
+ }
97973
97941
  let base64 = havaData ? await this.getRangeBase64() : null;
97974
97942
  const messages = this.buildMessages(this.messages, base64, attachment);
97975
97943
  let fullResponse = { think: "", status: "", code: "", title: "", message: "" };
@@ -98079,9 +98047,25 @@ class AI {
98079
98047
  }
98080
98048
  } catch (error2) {
98081
98049
  console.error(error2);
98082
- if (chatTextDom) {
98083
- chatTextDom.innerHTML = error2.message || error2;
98050
+ const aiTitleDom = document.querySelector(`#chatNum${this.chatNum} .ai-title`);
98051
+ if (aiTitleDom) {
98052
+ aiTitleDom.style.borderLeft = "3px solid red";
98084
98053
  }
98054
+ if (titleTextDom) {
98055
+ const firstTextNode = titleTextDom.parentElement.parentElement.querySelector("span").firstChild;
98056
+ if (firstTextNode && firstTextNode.nodeType === Node.TEXT_NODE) {
98057
+ firstTextNode.textContent = "❌ ";
98058
+ }
98059
+ titleTextDom.textContent = "请求失败";
98060
+ }
98061
+ if (!chatTextDom) {
98062
+ const contentWrapper = document.createElement("div");
98063
+ contentWrapper.className = "ai-content";
98064
+ contentWrapper.innerHTML = '<span class="chat-text"></span>';
98065
+ aiThinkingDom.insertBefore(contentWrapper, aiThinkingDom.querySelector(".chat-time"));
98066
+ chatTextDom = contentWrapper.querySelector(".chat-text");
98067
+ }
98068
+ chatTextDom.innerHTML = `<span>${error2.message || error2}</span>`;
98085
98069
  taskEnd();
98086
98070
  }
98087
98071
  };
@@ -98274,10 +98258,11 @@ class AI {
98274
98258
  this.selectedFiles.push(file);
98275
98259
  const reader = new FileReader();
98276
98260
  reader.onload = (e2) => {
98261
+ const ns2 = this.SN.namespace;
98277
98262
  const imgElement = document.createElement("div");
98278
98263
  imgElement.classList.add("img-container");
98279
98264
  imgElement.innerHTML = `
98280
- <img src="${e2.target.result}" class="preview-img" onclick="SN.AI.previewImage(this)" />
98265
+ <img src="${e2.target.result}" class="preview-img" onclick="${ns2}.AI.previewImage(this)" />
98281
98266
  <button class="remove-btn">×</button>
98282
98267
  `;
98283
98268
  document.querySelector(".upImgList").appendChild(imgElement);
@@ -98327,8 +98312,9 @@ class AI {
98327
98312
  }
98328
98313
  async loadDocs() {
98329
98314
  try {
98330
- this.docMD = docAiMd;
98331
- this.prompt = promptMd;
98315
+ this.docMD = docAiMd.replaceAll("_$SNSPACE", this.SN.namespace);
98316
+ this.prompt = promptMd.replaceAll("_$SNSPACE", this.SN.namespace);
98317
+ ;
98332
98318
  } catch (error2) {
98333
98319
  console.error("Failed to load AI docs:", error2);
98334
98320
  }
@@ -98339,7 +98325,6 @@ class License {
98339
98325
  #licenseData = null;
98340
98326
  constructor(sheetNext, licenseKey) {
98341
98327
  this.sheetNext = sheetNext;
98342
- this.storageKey = "_sn_license";
98343
98328
  this.publicKey = `-----BEGIN PUBLIC KEY-----
98344
98329
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjj99fcB34yCl/AAX7Pbi
98345
98330
  QzlQh3atU2+4WiwTKTWNa6s0CXnfa15BFsKNYtk5Ojl4rKRJOiG4ucRtCdIPwGBP
@@ -98349,38 +98334,17 @@ dJzE6Ra1MBFUOLUvCJpVbMI9g/DBYUXVbK3esDaygGBDEqRRuWbWOZhwCpb5WHd1
98349
98334
  L5YjLroj5pYBcw1CyoMlmrFFDV050PfjBU4+zsoQl7M6q09Obatm08UxYVAVTbra
98350
98335
  mwIDAQAB
98351
98336
  -----END PUBLIC KEY-----`;
98352
- this.loadLicense();
98353
- if (licenseKey) {
98354
- const result2 = this.activate(licenseKey);
98337
+ if (!licenseKey) return console.log("当前产品未授权,功能受限请及时授权!");
98338
+ this.activate(licenseKey).then((result2) => {
98355
98339
  console.log(result2.message);
98356
- } else if (!this.#isActivated) {
98357
- console.log("当前产品未授权,功能受限请及时授权!");
98358
- }
98340
+ });
98359
98341
  }
98360
98342
  // 快捷获取授权状态
98361
98343
  get isActivated() {
98362
98344
  return this.#isActivated;
98363
98345
  }
98364
- // 从本地存储加载 License
98365
- loadLicense() {
98366
- try {
98367
- const encrypted = localStorage.getItem(this.storageKey);
98368
- if (!encrypted) return;
98369
- const decrypted = this.decrypt(encrypted);
98370
- const data = JSON.parse(decrypted);
98371
- if (this.validateLicense(data)) {
98372
- this.#licenseData = data;
98373
- this.#isActivated = true;
98374
- } else {
98375
- this.clearLicense();
98376
- }
98377
- } catch (error2) {
98378
- console.error("License 加载失败:", error2);
98379
- this.clearLicense();
98380
- }
98381
- }
98382
- // 激活 License
98383
- activate(licenseKey) {
98346
+ // 激活 License (异步方法)
98347
+ async activate(licenseKey) {
98384
98348
  try {
98385
98349
  if (!licenseKey || typeof licenseKey !== "string") {
98386
98350
  throw new Error("License Key 格式错误");
@@ -98392,7 +98356,8 @@ mwIDAQAB
98392
98356
  const dataStr = this.base64Decode(parts[0]);
98393
98357
  const signature2 = parts[1];
98394
98358
  const data = JSON.parse(dataStr);
98395
- if (!this.verifySignature(dataStr, signature2)) {
98359
+ const isSignatureValid = await this.verifySignature(dataStr, signature2);
98360
+ if (!isSignatureValid) {
98396
98361
  throw new Error("License Key 签名验证失败");
98397
98362
  }
98398
98363
  if (!this.validateLicense(data)) {
@@ -98400,7 +98365,6 @@ mwIDAQAB
98400
98365
  }
98401
98366
  this.#licenseData = data;
98402
98367
  this.#isActivated = true;
98403
- localStorage.setItem(this.storageKey, this.encrypt(dataStr));
98404
98368
  return { success: true, message: "授权成功" };
98405
98369
  } catch (error2) {
98406
98370
  return { success: false, message: error2.message };
@@ -98472,32 +98436,14 @@ mwIDAQAB
98472
98436
  return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
98473
98437
  }).join(""));
98474
98438
  }
98475
- // 加密存储 (简单 XOR 加密)
98476
- encrypt(str) {
98477
- const key2 = "SNEditor_Secret_Key_2025";
98478
- let result2 = "";
98479
- for (let i2 = 0; i2 < str.length; i2++) {
98480
- result2 += String.fromCharCode(str.charCodeAt(i2) ^ key2.charCodeAt(i2 % key2.length));
98481
- }
98482
- return this.base64Encode(result2);
98483
- }
98484
- // 解密存储
98485
- decrypt(encrypted) {
98486
- const key2 = "SNEditor_Secret_Key_2025";
98487
- const decoded = this.base64Decode(encrypted);
98488
- let result2 = "";
98489
- for (let i2 = 0; i2 < decoded.length; i2++) {
98490
- result2 += String.fromCharCode(decoded.charCodeAt(i2) ^ key2.charCodeAt(i2 % key2.length));
98491
- }
98492
- return result2;
98493
- }
98494
98439
  // 检查授权状态
98495
98440
  check() {
98496
98441
  if (!this.#isActivated || !this.#licenseData) {
98497
98442
  return { valid: false, reason: "未授权,请输入 License Key" };
98498
98443
  }
98499
98444
  if (!this.validateLicense(this.#licenseData)) {
98500
- this.clearLicense();
98445
+ this.#isActivated = false;
98446
+ this.#licenseData = null;
98501
98447
  return { valid: false, reason: "License 已失效或环境不匹配" };
98502
98448
  }
98503
98449
  return { valid: true };
@@ -98513,12 +98459,6 @@ mwIDAQAB
98513
98459
  daysLeft: Math.ceil((new Date(this.#licenseData.expireDate) - Date.now()) / (1e3 * 60 * 60 * 24))
98514
98460
  };
98515
98461
  }
98516
- // 清除 License
98517
- clearLicense() {
98518
- this.#isActivated = false;
98519
- this.#licenseData = null;
98520
- localStorage.removeItem(this.storageKey);
98521
- }
98522
98462
  }
98523
98463
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
98524
98464
  function getDefaultExportFromCjs(x) {
@@ -105647,7 +105587,6 @@ const xlsxExport = (SN2) => {
105647
105587
  }
105648
105588
  const content2 = zip.generate({ type: "blob", compression: "DEFLATE" });
105649
105589
  FileSaver_minExports.saveAs(content2, `${document.querySelector("#fileNameDom").innerText}.xlsx`);
105650
- debugger;
105651
105590
  SN2._Xml = null;
105652
105591
  console.timeEnd("导出耗时");
105653
105592
  };
@@ -106562,14 +106501,18 @@ function getCellValue(ref) {
106562
106501
  }
106563
106502
  }
106564
106503
  class SheetNext {
106504
+ // 静态计数器,用于生成唯一的命名空间
106505
+ static _instanceCounter = 0;
106565
106506
  constructor(dom2, options = {}) {
106566
106507
  if (!(dom2 instanceof HTMLElement)) throw new Error("Please pass in the correct DOM!");
106567
106508
  this.containerDom = dom2;
106568
106509
  dom2.style.boxSizing = "border-box";
106569
106510
  dom2.style.background = "#e9e9e9";
106570
- this.Layout = new Layout(this);
106511
+ this.namespace = this._setupGlobalNamespace();
106512
+ dom2.__sheetNextInstance = this;
106513
+ this.Layout = new Layout(this, options);
106571
106514
  this.Fun = new Fun(this);
106572
- this.AI = new AI(this, options?.AI);
106515
+ this.AI = new AI(this, options);
106573
106516
  this.locked = false;
106574
106517
  this._activeSheet = null;
106575
106518
  this.sheets = [];
@@ -106580,11 +106523,29 @@ class SheetNext {
106580
106523
  this.Canvas = new Canvas(this);
106581
106524
  this.sharedFormula = {};
106582
106525
  this.License = new License(this, options.licenseKey);
106583
- this.options = options;
106584
106526
  this.loadXmlObj();
106585
106527
  this._Xml = null;
106586
106528
  }
106529
+ /**
106530
+ * 设置全局命名空间
106531
+ * @private
106532
+ * @returns {string} 命名空间名称
106533
+ */
106534
+ _setupGlobalNamespace() {
106535
+ const namespace = `SN_${SheetNext._instanceCounter++}`;
106536
+ window[namespace] = this;
106537
+ return namespace;
106538
+ }
106587
106539
  export(type) {
106540
+ if (!this.License.isActivated) {
106541
+ if (this.sheets.length > 1) {
106542
+ return this.Utils.msg("未授权版本仅支持导出单张表,当前有 " + this.sheets.length + " 张表。");
106543
+ }
106544
+ const activeSheet = this.activeSheet;
106545
+ if (activeSheet.rowCount > 100 || activeSheet.colCount > 24) {
106546
+ return this.Utils.msg(`未授权版本仅支持导出 100 行 × 24 列数据,当前数据范围:${activeSheet.rowCount} 行 × ${activeSheet.colCount} 列。`);
106547
+ }
106548
+ }
106588
106549
  if (type == "XLSX") {
106589
106550
  xlsxExport(this);
106590
106551
  }
@@ -106662,6 +106623,12 @@ class SheetNext {
106662
106623
  async import(file) {
106663
106624
  if (!file) return this.Utils.msg("未选择文件");
106664
106625
  if (file.type !== "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") return this.Utils.msg("文件类型无效。请选择一个 .xlsx 文件。");
106626
+ if (!this.License.isActivated) {
106627
+ const maxSize = 1 * 1024 * 1024;
106628
+ if (file.size > maxSize) {
106629
+ return this.Utils.msg(`未授权版本仅支持导入 1MB 以内的文件,当前文件大小:${(file.size / 1024 / 1024).toFixed(2)}MB。`);
106630
+ }
106631
+ }
106665
106632
  try {
106666
106633
  const reader = new FileReader();
106667
106634
  reader.onload = (e2) => {
@@ -106680,20 +106647,21 @@ class SheetNext {
106680
106647
  }
106681
106648
  }
106682
106649
  updListDom() {
106650
+ const ns2 = this.namespace;
106683
106651
  const sheetName = this.activeSheet.name;
106684
106652
  let sheetsHtml = "";
106685
106653
  this.sheets.forEach((item, index) => {
106686
106654
  if (item.name == sheetName || this.sheetNames.length == 1) {
106687
106655
  sheetsHtml += `<button class="sheet-sel sn-sheet-item" onmousedown="this.classList.add('sheet-sel')">${item.name}</button>`;
106688
106656
  } else if (!item.hidden) {
106689
- sheetsHtml += `<button class="sn-sheet-item" onmousedown="SN.activeSheet=SN.getSheetByName('${item.name}');this.classList.add('sheet-sel')">${item.name}</button>`;
106657
+ sheetsHtml += `<button class="sn-sheet-item" onmousedown="${ns2}.activeSheet=${ns2}.getSheetByName('${item.name}');this.classList.add('sheet-sel')">${item.name}</button>`;
106690
106658
  }
106691
106659
  });
106692
106660
  document.querySelector("#sheets").innerHTML = sheetsHtml;
106693
106661
  }
106694
- // 激活 License
106695
- activateLicense(licenseKey) {
106696
- const result2 = this.License.activate(licenseKey);
106662
+ // 激活 License(异步方法)
106663
+ async activateLicense(licenseKey) {
106664
+ const result2 = await this.License.activate(licenseKey);
106697
106665
  if (result2.success) {
106698
106666
  this.Utils.msg("License 激活成功!");
106699
106667
  } else {
@@ -106705,11 +106673,6 @@ class SheetNext {
106705
106673
  getLicenseInfo() {
106706
106674
  return this.License.getInfo();
106707
106675
  }
106708
- // 清除 License
106709
- clearLicense() {
106710
- this.License.clearLicense();
106711
- this.Utils.msg("License 已清除");
106712
- }
106713
106676
  }
106714
106677
  window.SheetNext = SheetNext;
106715
106678
  console.log("%c SheetNext Editor 1.0", "background:#36c;color:#fff;padding:5px 10px;font-size:12px;");