Browse Source

fix(conflict): toolbar

toolbar resize.js
master
mengshukeji 5 years ago
parent
commit
8cfa6ac1be
  1. 34
      README-zh.md
  2. 31
      README.md
  3. 2
      docs/guide/config.md
  4. 2
      docs/zh/guide/config.md
  5. 22
      src/controllers/constant.js
  6. 7
      src/controllers/controlHistory.js
  7. 22
      src/controllers/handler.js
  8. 265
      src/controllers/hyperlinkCtrl.js
  9. 109
      src/controllers/resize.js
  10. 5
      src/controllers/sheetmanage.js
  11. 34
      src/css/luckysheet-core.css
  12. 16
      src/locale/en.js
  13. 16
      src/locale/zh.js

34
README-zh.md

@ -191,6 +191,30 @@ npm run build
[英文社群](./README.md)
## 赞助
如果你感觉这个项目对你有用或者有所启发,可以请作者喝杯果汁:
注意事项:
1. 付款留言请备注:昵称,您的网站地址
2. 默认会将您加入到下方的赞助者列表。如果您想匿名赞助,付款留言请备注:匿名
3. 如果您忘记留言昵称或者网站地址,请联系小编email: alexads@foxmail.com或者微信:dushusir2。
| 微信 | 支付宝 |
|---|---|
| <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |
### [Paypal Me](https://www.paypal.me/wbfsa)
## 赞助者列表
(按时间顺序排列)
- *勇 ¥ 30
- 虚我 ¥ 200
- 甜党 ¥ 50
- Alphabet(Google)-gcf ¥ 1
- **平 ¥ 100
- **东 ¥ 10
## 贡献者和感谢
### 团队成员
@ -208,16 +232,6 @@ npm run build
- [@gsw945](https://github.com/gsw945)
- [@swen-xiong](https://github.com/swen-xiong)
## 捐赠
如果你感觉这个项目对你有用或者有所启发,可以请作者喝杯果汁:
| 微信 | 支付宝 |
|---|---|
| <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |
[Paypal Me](https://www.paypal.me/wbfsa)
## 版权信息
[MIT](http://opensource.org/licenses/MIT)

31
README.md

@ -184,6 +184,30 @@ Create a table
[Chinese community](./README-zh.md)
## Sponsor
If you find this project useful, you can buy author a glass of juice:
Note:
1. Please note the payment message: nickname, your website address
2. By default, you will be added to the sponsor list below. If you want to sponsor anonymously, please leave a note on payment: anonymous
3. If you forget your nickname or website address, please contact the editor email: alexads@foxmail.com or WeChat: dushusir2.
| WeChat | Alipay |
|---|---|
| <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |
### [Paypal Me](https://www.paypal.me/wbfsa)
## Sponsors List
(Sort by time)
- *勇 ¥ 30
- 虚我 ¥ 200
- 甜党 ¥ 50
- Alphabet(Google)-gcf ¥ 1
- **平 ¥ 100
- **东 ¥ 10
## Authors and acknowledgment
### Team
@ -203,13 +227,6 @@ Create a table
## Donate
If you find this project useful, you can buy author a glass of juice:
| WeChat | Alipay |
|---|---|
| <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |
[Paypal Me](https://www.paypal.me/wbfsa)
## License

2
docs/guide/config.md

@ -213,6 +213,7 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
textWrapMode: false, //'Wrap mode'
textRotateMode: false, //'Text Rotation Mode'
image:false, // 'Insert picture'
link:false, // 'Insert link'
chart: false, //'chart' (the icon is hidden, but if the chart plugin is configured, you can still create a new chart by right click)
postil: false, //'comment'
pivotTable: false, //'PivotTable'
@ -226,7 +227,6 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
findAndReplace: false, //'Find and Replace'
protection:false, // 'Worksheet protection'
print:false, // 'print'
//link:false, // 'Insert link'(TODO)
}
```
- Example:

2
docs/zh/guide/config.md

@ -301,6 +301,7 @@ Luckysheet开放了更细致的自定义配置选项,分别有
textWrapMode: false, // '换行方式'
textRotateMode: false, // '文本旋转方式'
image:false, // '插入图片'
link:false, // '插入链接'
chart: false, // '图表'(图标隐藏,但是如果配置了chart插件,右击仍然可以新建图表)
postil: false, //'批注'
pivotTable: false, //'数据透视表'
@ -314,7 +315,6 @@ Luckysheet开放了更细致的自定义配置选项,分别有
findAndReplace: false, // '查找替换'
protection:false, // '工作表保护'
print:false, // '打印'
// link:false, // '插入链接'(TODO)
}
```
- 示例:

22
src/controllers/constant.js

@ -384,6 +384,9 @@ function rightclickHTML(){
<div id="luckysheetInsertImage" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">${toolbar.insertImage}</div>
</div>
<div id="luckysheetInsertLink" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">${toolbar.insertLink}</div>
</div>
<div id="luckysheetDataVerification" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">${toolbar.dataVerification}</div>
</div>
@ -1229,6 +1232,23 @@ function menuToolBar (){
</div>
</div>
<div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"
data-tips="${toolbar.insertLink}" id="luckysheet-insertLink-btn-title" role="button" style="user-select: none;">
<div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"
style="user-select: none;">
<div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"
style="user-select: none;">
<div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"
style="user-select: none;">
<div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">
<div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-lianjie"
style="user-select: none;">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"
data-tips="${toolbar.chart}" id="luckysheet-chart-btn-title" role="button" style="user-select: none;">
<div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"
style="user-select: none;">
@ -1239,7 +1259,6 @@ function menuToolBar (){
<div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">
<div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-tubiao"
style="user-select: none;">
<input id="luckysheet-imgUpload" type="file" accept="image/*" style="display:none;"></input>
</div>
</div>
</div>
@ -1272,7 +1291,6 @@ function menuToolBar (){
<div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">
<div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-shujutoushi"
style="user-select: none;">
<input id="luckysheet-imgUpload" type="file" accept="image/*" style="display:none;"></input>
</div>
</div>
</div>

7
src/controllers/controlHistory.js

@ -5,6 +5,7 @@ import conditionformat from './conditionformat';
import luckysheetPostil from './postil';
import imageCtrl from './imageCtrl';
import dataVerificationCtrl from './dataVerificationCtrl';
import hyperlinkCtrl from './hyperlinkCtrl';
import {zoomRefreshView,zoomNumberDomBind} from './zoom';
import { createFilter, createFilterOptions, labelFilterOptionState } from './filter';
import formula from '../global/formula';
@ -344,6 +345,9 @@ const controlHistory = {
else if (ctr.type == "updateDataVerificationOfCheckbox"){
dataVerificationCtrl.refOfCheckbox(ctr.currentDataVerification, ctr.historyDataVerification, ctr.sheetIndex, ctr.data, ctr.range);
}
else if (ctr.type == "updateHyperlink"){
hyperlinkCtrl.ref(ctr.currentHyperlink, ctr.historyHyperlink, ctr.sheetIndex, ctr.data, ctr.range);
}
else if (ctr.type == "updateCF"){
let historyRules = ctr["data"]["historyRules"];
@ -650,6 +654,9 @@ const controlHistory = {
else if (ctr.type == "updateDataVerificationOfCheckbox"){
dataVerificationCtrl.refOfCheckbox(ctr.historyDataVerification, ctr.currentDataVerification, ctr.sheetIndex, ctr.curData, ctr.range);
}
else if (ctr.type == "updateHyperlink") {
hyperlinkCtrl.ref(ctr.historyHyperlink, ctr.currentHyperlink, ctr.sheetIndex, ctr.curData, ctr.range);
}
else if (ctr.type == "updateCF"){
let currentRules = ctr["data"]["currentRules"];

22
src/controllers/handler.js

@ -5,6 +5,7 @@ import pivotTable from './pivotTable';
import luckysheetDropCell from './dropCell';
import luckysheetPostil from './postil';
import imageCtrl from './imageCtrl';
import hyperlinkCtrl from './hyperlinkCtrl';
import dataVerificationCtrl from './dataVerificationCtrl';
import menuButton from './menuButton';
import conditionformat from './conditionformat';
@ -338,6 +339,9 @@ export default function luckysheetHandler() {
//数据验证 单元格聚焦
dataVerificationCtrl.cellFocus(row_index, col_index, true);
//链接 单元格聚焦
hyperlinkCtrl.cellFocus(row_index, col_index);
//若点击单元格部分不在视图内
if (col_pre < $("#luckysheet-cell-main").scrollLeft()) {
$("#luckysheet-scrollbar-x").scrollLeft(col_pre);
@ -4531,6 +4535,24 @@ export default function luckysheetHandler() {
}
});
//菜单栏 插入链接按钮
$("#luckysheet-insertLink-btn-title").click(function () {
if(!checkProtectionNotEnable(Store.currentSheetIndex)){
return;
}
if (Store.luckysheet_select_save == null || Store.luckysheet_select_save.length == 0) {
return;
}
hyperlinkCtrl.createDialog();
hyperlinkCtrl.init();
})
$("#luckysheetInsertLink").click(function () {
$("#luckysheet-insertLink-btn-title").click();
$("#luckysheet-rightclick-menu").hide();
})
//菜单栏 数据验证按钮
$("#luckysheet-dataVerification-btn-title").click(function () {
if(!checkProtectionNotEnable(Store.currentSheetIndex)){

265
src/controllers/hyperlinkCtrl.js

@ -0,0 +1,265 @@
import { replaceHtml } from '../utils/util';
import { getcellvalue } from '../global/getdata';
import { luckysheetrefreshgrid } from '../global/refresh';
import formula from '../global/formula';
import tooltip from '../global/tooltip';
import editor from '../global/editor';
import { modelHTML } from './constant';
import server from './server';
import { getSheetIndex } from '../methods/get';
import locale from '../locale/locale';
import Store from '../store';
const hyperlinkCtrl = {
item: {
linkType: 'external', //链接类型 external外部链接,internal内部链接
linkAddress: '', //链接地址 网页地址或工作表单元格引用
linkTooltip: '', //提示
},
hyperlink: null,
createDialog: function(){
let _this = this;
const _locale = locale();
const hyperlinkText = _locale.insertLink;
const toolbarText = _locale.toolbar;
const buttonText = _locale.button;
$("#luckysheet-modal-dialog-mask").show();
$("#luckysheet-insertLink-dialog").remove();
let sheetListOption = '';
Store.luckysheetfile.forEach(item => {
sheetListOption += `<option value="${item.name}">${item.name}</option>`;
})
let content = `<div class="box">
<div class="box-item">
<label for="luckysheet-insertLink-dialog-linkText">${hyperlinkText.linkText}</label>
<input type="text" id="luckysheet-insertLink-dialog-linkText"/>
</div>
<div class="box-item">
<label for="luckysheet-insertLink-dialog-linkType">${hyperlinkText.linkType}</label>
<select id="luckysheet-insertLink-dialog-linkType">
<option value="external">${hyperlinkText.external}</option>
<option value="internal">${hyperlinkText.internal}</option>
</select>
</div>
<div class="show-box show-box-external">
<div class="box-item">
<label for="luckysheet-insertLink-dialog-linkAddress">${hyperlinkText.linkAddress}</label>
<input type="text" id="luckysheet-insertLink-dialog-linkAddress" placeholder="${hyperlinkText.placeholder1}" />
</div>
</div>
<div class="show-box show-box-internal">
<div class="box-item">
<label for="luckysheet-insertLink-dialog-linkSheet">${hyperlinkText.linkSheet}</label>
<select id="luckysheet-insertLink-dialog-linkSheet">
${sheetListOption}
</select>
</div>
<div class="box-item">
<label for="luckysheet-insertLink-dialog-linkCell">${hyperlinkText.linkCell}</label>
<input type="text" id="luckysheet-insertLink-dialog-linkCell" value="A1" placeholder="${hyperlinkText.placeholder2}" />
</div>
</div>
<div class="box-item">
<label for="luckysheet-insertLink-dialog-linkTooltip">${hyperlinkText.linkTooltip}</label>
<input type="text" id="luckysheet-insertLink-dialog-linkTooltip" placeholder="${hyperlinkText.placeholder3}" />
</div>
</div>`;
$("body").append(replaceHtml(modelHTML, {
"id": "luckysheet-insertLink-dialog",
"addclass": "luckysheet-insertLink-dialog",
"title": toolbarText.insertLink,
"content": content,
"botton": `<button id="luckysheet-insertLink-dialog-confirm" class="btn btn-primary">${buttonText.confirm}</button>
<button class="btn btn-default luckysheet-model-close-btn">${buttonText.cancel}</button>`,
"style": "z-index:100003"
}));
let $t = $("#luckysheet-insertLink-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 350).end(),
myh = $t.outerHeight(),
myw = $t.outerWidth();
let winw = $(window).width(),
winh = $(window).height();
let scrollLeft = $(document).scrollLeft(),
scrollTop = $(document).scrollTop();
$("#luckysheet-insertLink-dialog").css({
"left": (winw + scrollLeft - myw) / 2,
"top": (winh + scrollTop - myh) / 3
}).show();
_this.dataAllocation();
},
init: function (){
let _this = this;
const _locale = locale();
const hyperlinkText = _locale.insertLink;
//链接类型
$(document).off("change.linkType").on("change.linkType", "#luckysheet-insertLink-dialog-linkType", function(e){
let value = this.value;
$("#luckysheet-insertLink-dialog .show-box").hide();
$("#luckysheet-insertLink-dialog .show-box-" + value).show();
})
//确认按钮
$(document).off("click.confirm").on("click.confirm", "#luckysheet-insertLink-dialog-confirm", function(e){
let last = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
let rowIndex = last.row_focus || last.row[0];
let colIndex = last.column_focus || last.column[0];
//文本
let linkText = $("#luckysheet-insertLink-dialog-linkText").val();
let linkType = $("#luckysheet-insertLink-dialog-linkType").val();
let linkAddress = $("#luckysheet-insertLink-dialog-linkAddress").val();
let linkSheet = $("#luckysheet-insertLink-dialog-linkSheet").val();
let linkCell = $("#luckysheet-insertLink-dialog-linkCell").val();
let linkTooltip = $("#luckysheet-insertLink-dialog-linkTooltip").val();
if(linkType == 'external'){
if(!/^http[s]?:\/\/([\w\-\.]+)+[\w-]*([\w\-\.\/\?%&=]+)?$/ig.test(linkAddress)){
tooltip.info('<i class="fa fa-exclamation-triangle"></i>', hyperlinkText.tooltipInfo1);
return;
}
}
else{
if(!formula.iscelldata(linkCell)){
tooltip.info('<i class="fa fa-exclamation-triangle"></i>', hyperlinkText.tooltipInfo2);
return;
}
linkAddress = linkSheet + "!" + linkCell;
}
if(linkText == null || linkText.replace(/\s/g, '') == ''){
linkText = linkAddress;
}
let item = {
linkType: linkType,
linkAddress: linkAddress,
linkTooltip: linkTooltip,
}
let historyHyperlink = $.extend(true, {}, _this.hyperlink);
let currentHyperlink = $.extend(true, {}, _this.hyperlink);
currentHyperlink[rowIndex + "_" + colIndex] = item;
let d = editor.deepCopyFlowData(Store.flowdata);
let cell = d[rowIndex][colIndex];
if(cell == null){
cell = {};
}
cell.fc = 'rgb(0, 0, 255)';
cell.un = 1;
cell.v = linkText;
d[rowIndex][colIndex] = cell;
_this.ref(
historyHyperlink,
currentHyperlink,
Store.currentSheetIndex,
d,
{ row: [rowIndex, rowIndex], column: [colIndex, colIndex] }
);
$("#luckysheet-modal-dialog-mask").hide();
$("#luckysheet-insertLink-dialog").hide();
})
},
dataAllocation: function(){
let _this = this;
let last = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
let rowIndex = last.row_focus || last.row[0];
let colIndex = last.column_focus || last.column[0];
let hyperlink = _this.hyperlink || {};
let item = hyperlink[rowIndex + "_" + colIndex] || {};
//文本
let text = getcellvalue(rowIndex, colIndex, null, 'm');
$("#luckysheet-insertLink-dialog-linkText").val(text);
//链接类型
let linkType = item.linkType || 'external';
$("#luckysheet-insertLink-dialog-linkType").val(linkType);
$("#luckysheet-insertLink-dialog .show-box").hide();
$("#luckysheet-insertLink-dialog .show-box-" + linkType).show();
//链接地址
let linkAddress = item.linkAddress || '';
if(linkType == 'external'){
$("#luckysheet-insertLink-dialog-linkAddress").val(linkAddress);
}
else{
if(formula.iscelldata(linkAddress)){
let sheettxt = linkAddress.split("!")[0];
let rangetxt = linkAddress.split("!")[1];
$("#luckysheet-insertLink-dialog-linkSheet").val(sheettxt);
$("#luckysheet-insertLink-dialog-linkCell").val(rangetxt);
}
}
//提示
let linkTooltip = item.linkTooltip || '';
$("#luckysheet-insertLink-dialog-linkTooltip").val(linkTooltip);
},
cellFocus: function(r, c){
let _this = this;
if(_this.hyperlink == null || _this.hyperlink[r + '_' + c] == null){
return;
}
},
ref: function(historyHyperlink, currentHyperlink, sheetIndex, d, range){
let _this = this;
if (Store.clearjfundo) {
Store.jfundo = [];
let redo = {};
redo["type"] = "updateHyperlink";
redo["sheetIndex"] = sheetIndex;
redo["historyHyperlink"] = historyHyperlink;
redo["currentHyperlink"] = currentHyperlink;
redo["data"] = Store.flowdata;
redo["curData"] = d;
redo["range"] = range;
Store.jfredo.push(redo);
}
_this.hyperlink = currentHyperlink;
Store.luckysheetfile[getSheetIndex(sheetIndex)].hyperlink = currentHyperlink;
Store.flowdata = d;
editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据
Store.luckysheetfile[getSheetIndex(sheetIndex)].data = Store.flowdata;
//共享编辑模式
if(server.allowUpdate){
server.saveParam("all", sheetIndex, currentHyperlink, { "k": "hyperlink" });
server.historyParam(Store.flowdata, sheetIndex, range);
}
setTimeout(function () {
luckysheetrefreshgrid();
}, 1);
}
}
export default hyperlinkCtrl;

109
src/controllers/resize.js

@ -402,137 +402,64 @@ export function menuToolBarWidth() {
image:{
ele:'#luckysheet-insertImg-btn-title',
index:21,
}, // 'Insert picture'
}, //'Insert link'
link:{
ele:'#luckysheet-insertLink-btn-title',
index:22,
}, //'Insert picture'
chart: {
ele:'#luckysheet-chart-btn-title',
index:22,
index:23,
}, //'chart' (the icon is hidden, but if the chart plugin is configured, you can still create a new chart by right click)
postil: {
ele:'#luckysheet-icon-postil',
index:23,
index:24,
}, //'comment'
pivotTable: {
ele:['#luckysheet-pivot-btn-title','#toolbar-separator-pivot-table'],
index:24,
index:25,
}, //'PivotTable'
function: {
ele:['#luckysheet-icon-function','#luckysheet-icon-function-menu'],
index:25,
index:26,
}, //'formula'
frozenMode: {
ele:['#luckysheet-freezen-btn-horizontal','#luckysheet-icon-freezen-menu'],
index:26,
index:27,
}, //'freeze mode'
sortAndFilter: {
ele:'#luckysheet-icon-autofilter',
index:27,
index:28,
}, //'sort and filter'
conditionalFormat: {
ele:'#luckysheet-icon-conditionformat',
index:28,
index:29,
}, //'Conditional Format'
dataVerification: {
ele:'#luckysheet-dataVerification-btn-title',
index:29,
index:30,
}, // 'Data Verification'
splitColumn: {
ele:'#luckysheet-splitColumn-btn-title',
index:30,
index:31,
}, //'Split column'
screenshot: {
ele:'#luckysheet-chart-btn-screenshot',
index:31,
index:32,
}, //'screenshot'
findAndReplace: {
ele:'#luckysheet-icon-seachmore',
index:32,
index:33,
}, //'Find and Replace'
protection:{
ele:'#luckysheet-icon-protection',
index:33,
index:34,
}, // 'Worksheet protection'
print:{
ele:'#luckysheet-icon-print',
index:34,
index:35,
}, // 'print'
// link:false, // 'Insert link'
};
// toobarObject.toobarWidths= [
// $('#luckysheet-icon-undo').offset().left,
// $('#luckysheet-icon-redo').offset().left,
// $('#luckysheet-icon-paintformat').offset().left,
// $('#luckysheet-icon-currency').offset().left,
// $('#luckysheet-icon-percent').offset().left,
// $('#luckysheet-icon-fmt-decimal-decrease').offset().left,
// $('#luckysheet-icon-fmt-decimal-increase').offset().left,
// $('#luckysheet-icon-fmt-other').offset().left,
// $('#luckysheet-icon-font-family').offset().left,
// $('#luckysheet-icon-font-size').offset().left,
// $('#luckysheet-icon-bold').offset().left,
// $('#luckysheet-icon-italic').offset().left,
// $('#luckysheet-icon-strikethrough').offset().left,
// $('#luckysheet-icon-text-color').offset().left,
// $('#luckysheet-icon-cell-color').offset().left,
// $('#luckysheet-icon-border-all').offset().left,
// $('#luckysheet-icon-merge-button').offset().left,
// $('#luckysheet-icon-align').offset().left,
// $('#luckysheet-icon-valign').offset().left,
// $('#luckysheet-icon-textwrap').offset().left,
// $('#luckysheet-icon-rotation').offset().left,
// $('#luckysheet-insertImg-btn-title').offset().left,
// $('#luckysheet-chart-btn-title').offset().left,
// $('#luckysheet-icon-postil').offset().left,
// $('#luckysheet-pivot-btn-title').offset().left,
// $('#luckysheet-icon-function').offset().left,
// $('#luckysheet-freezen-btn-horizontal').offset().left,
// $('#luckysheet-icon-autofilter').offset().left,
// $('#luckysheet-icon-conditionformat').offset().left,
// $('#luckysheet-dataVerification-btn-title').offset().left,
// $('#luckysheet-splitColumn-btn-title').offset().left,
// $('#luckysheet-chart-btn-screenshot').offset().left,
// $('#luckysheet-icon-seachmore').offset().left,
// $('#luckysheet-icon-protection').offset().left,
// $('#luckysheet-icon-print').offset().left,
// $('#luckysheet-icon-print').offset().left + $('#luckysheet-icon-protection').outerWidth() + 5,
// ];
// toobarObject.toobarElements = [
// '#luckysheet-icon-undo',
// '#luckysheet-icon-redo',
// ['#luckysheet-icon-paintformat','#toolbar-separator-paint-format'],
// '#luckysheet-icon-currency',
// '#luckysheet-icon-percent',
// '#luckysheet-icon-fmt-decimal-decrease',
// '#luckysheet-icon-fmt-decimal-increase',
// ['#luckysheet-icon-fmt-other','#toolbar-separator-more-format'],
// ['#luckysheet-icon-font-family','#toolbar-separator-font-family'],
// ['#luckysheet-icon-font-size','#toolbar-separator-font-size'],
// '#luckysheet-icon-bold',
// '#luckysheet-icon-italic',
// '#luckysheet-icon-strikethrough',
// ['#luckysheet-icon-text-color','#luckysheet-icon-text-color-menu','#toolbar-separator-text-color'],
// ['#luckysheet-icon-cell-color','#luckysheet-icon-cell-color-menu'],
// ['#luckysheet-icon-border-all','#luckysheet-icon-border-menu'],
// ['#luckysheet-icon-merge-button','#luckysheet-icon-merge-menu','#toolbar-separator-merge-cell'],
// ['#luckysheet-icon-align','#luckysheet-icon-align-menu'],
// ['#luckysheet-icon-valign','#luckysheet-icon-valign-menu'],
// ['#luckysheet-icon-textwrap','#luckysheet-icon-textwrap-menu'],
// ['#luckysheet-icon-rotation','#luckysheet-icon-rotation-menu','#toolbar-separator-text-rotate'],
// '#luckysheet-insertImg-btn-title',
// '#luckysheet-chart-btn-title',
// '#luckysheet-icon-postil',
// ['#luckysheet-pivot-btn-title','#toolbar-separator-pivot-table'],
// ['#luckysheet-icon-function','#luckysheet-icon-function-menu'],
// ['#luckysheet-freezen-btn-horizontal','#luckysheet-icon-freezen-menu'],
// '#luckysheet-icon-autofilter',
// '#luckysheet-icon-conditionformat',
// '#luckysheet-dataVerification-btn-title',
// '#luckysheet-splitColumn-btn-title',
// '#luckysheet-chart-btn-screenshot',
// '#luckysheet-icon-seachmore',
// '#luckysheet-icon-protection',
// '#luckysheet-icon-print',
// ]
const config = {
undo: true, //Undo

5
src/controllers/sheetmanage.js

@ -19,6 +19,7 @@ import luckysheetsizeauto from './resize';
import luckysheetPostil from './postil';
import imageCtrl from './imageCtrl';
import dataVerificationCtrl from './dataVerificationCtrl';
import hyperlinkCtrl from './hyperlinkCtrl';
import luckysheetFreezen from './freezen';
import { createFilterOptions, labelFilterOptionState } from './filter';
import { selectHightlightShow, selectionCopyShow } from './select';
@ -930,6 +931,10 @@ const sheetmanage = {
//数据验证
dataVerificationCtrl.dataVerification = file.dataVerification;
dataVerificationCtrl.init();
//链接
hyperlinkCtrl.hyperlink = file.hyperlink;
hyperlinkCtrl.init();
createFilterOptions(file["filter_select"], file["filter"]);
},

34
src/css/luckysheet-core.css

@ -7065,6 +7065,40 @@ fieldset[disabled] .btn-danger.focus {
position: absolute;
display: none;
}
/* 插入链接 */
#luckysheet-insertLink-dialog{
user-select: none;
}
#luckysheet-insertLink-dialog .box{
font-size: 12px;
}
#luckysheet-insertLink-dialog .box-item{
height: 30px;
line-height: 30px;
margin-bottom: 10px;
}
#luckysheet-insertLink-dialog .box-item label{
display: inline-block;
width: 80px;
text-align: right;
margin-right: 10px;
}
#luckysheet-insertLink-dialog .box-item input{
width: 200px;
height: 30px;
padding: 0 10px;
border: 1px solid #d4d4d4;
outline-style: none;
box-sizing: border-box;
}
#luckysheet-insertLink-dialog .box-item select{
width: 200px;
height: 30px;
padding: 0 5px;
border: 1px solid #d4d4d4;
outline-style: none;
box-sizing: border-box;
}
/* 数据验证 */
#luckysheet-dataVerification-dialog{
user-select: none;

16
src/locale/en.js

@ -8859,6 +8859,7 @@ export default {
screenshot: 'Screenshot',
splitColumn: 'Split text',
insertImage: 'Insert image',
insertLink: 'Insert link',
dataVerification: 'Data verification',
protection:"Protect the sheet",
@ -9689,6 +9690,21 @@ export default {
fiveQuadrantDiagram: 'Five-quadrant diagram',
fiveBoxes: '5 Boxes',
},
insertLink: {
linkText: "Text",
linkType: "Link type",
external: "External link",
internal: "Internal link",
linkAddress: "Link address",
linkSheet: "Worksheet",
linkCell: "Cell reference",
linkTooltip: "Tooltip",
placeholder1: "Please enter the web link address",
placeholder2: "Please enter the cell to be quoted, example A1",
placeholder3: "Please enter the prompt content",
tooltipInfo1: "Please enter a valid link",
tooltipInfo2: "Please enter the correct cell reference",
},
dataVerification: {
cellRange: 'Cell range',
selectCellRange: 'Click to select a cell range',

16
src/locale/zh.js

@ -9085,6 +9085,7 @@ export default {
screenshot: '截图',
splitColumn: '分列',
insertImage: '插入图片',
insertLink: '插入链接',
dataVerification: '数据验证',
protection:"保护工作表内容",
@ -9933,6 +9934,21 @@ export default {
fiveQuadrantDiagram: '五象限图',
fiveBoxes: '5个框',
},
insertLink: {
linkText: "文本",
linkType: "链接类型",
external: "外部链接",
internal: "内部链接",
linkAddress: "链接地址",
linkSheet: "工作表",
linkCell: "单元格引用",
linkTooltip: "提示",
placeholder1: "请输入网页链接地址",
placeholder2: "请输入要引用的单元格,例A1",
placeholder3: "请输入提示内容",
tooltipInfo1: "请输入有效的链接",
tooltipInfo2: "请输入正确的单元格引用",
},
dataVerification: {
cellRange: '单元格范围',
selectCellRange: '点击选择单元格范围',

Loading…
Cancel
Save