|
@@ -2035,8 +2035,9 @@ var projectObj = {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//选中的都是数字, 如果不为0则悬浮显示
|
|
//选中的都是数字, 如果不为0则悬浮显示
|
|
- if (notNumber === false && total > 0 && counter > 1) {
|
|
|
|
- const div = $('<div id="total-tips"><p>合计: <input type="text" id="total" readonly="readonly" style="border: none;"/></p><p><a href="javascript:void(0);">复制</a></p></div>');
|
|
|
|
|
|
+ if (notNumber === false && total > 0 && counter > 1) {//
|
|
|
|
+ const totalString = total.toFixed(max);
|
|
|
|
+ const div = $(`<div id="total-tips"><p>合计:<label id="total">${totalString}</label> </p><p><a href="javascript:void(0);">复制</a></p></div>`);
|
|
div.css({
|
|
div.css({
|
|
position: "absolute",
|
|
position: "absolute",
|
|
border: "1px #C0C0C0 solid",
|
|
border: "1px #C0C0C0 solid",
|
|
@@ -2051,7 +2052,7 @@ var projectObj = {
|
|
div.children("p").first().css({
|
|
div.children("p").first().css({
|
|
borderBottom: "1px #C0C0C0 solid"
|
|
borderBottom: "1px #C0C0C0 solid"
|
|
});
|
|
});
|
|
- const totalString = total.toFixed(max);
|
|
|
|
|
|
+
|
|
// input长度
|
|
// input长度
|
|
const inputWidth = totalString.length * 8;
|
|
const inputWidth = totalString.length * 8;
|
|
// 计算是否会超出显示范围
|
|
// 计算是否会超出显示范围
|
|
@@ -2070,7 +2071,7 @@ var projectObj = {
|
|
top: y,
|
|
top: y,
|
|
});
|
|
});
|
|
|
|
|
|
- div.children().children("#total").width(inputWidth).val(totalString);
|
|
|
|
|
|
+ div.children().children("#total").val(totalString);
|
|
$("body").append(div);
|
|
$("body").append(div);
|
|
// 用于判断是否要关闭窗体
|
|
// 用于判断是否要关闭窗体
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
@@ -2362,8 +2363,7 @@ var projectObj = {
|
|
// 点击合计框中的复制
|
|
// 点击合计框中的复制
|
|
$("body").on("click", "#total-tips a", function() {
|
|
$("body").on("click", "#total-tips a", function() {
|
|
const totalElement = $(this).parent().siblings("p").find("#total");
|
|
const totalElement = $(this).parent().siblings("p").find("#total");
|
|
- totalElement.select();
|
|
|
|
- document.execCommand("Copy");
|
|
|
|
|
|
+ sheetCommonObj.copyTextToClipboard(totalElement.text());
|
|
$(this).text("已复制");
|
|
$(this).text("已复制");
|
|
});
|
|
});
|
|
// 合计框点击其他位置关闭
|
|
// 合计框点击其他位置关闭
|