Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

zhoupeng 1 éve
szülő
commit
c0c7286168

+ 4 - 4
chuanyi_client2/public/luckysheet/luckysheet.umd.js

@@ -38787,7 +38787,7 @@ field\u53EF\u4EE5\u662F\u8207database\u7B2C\u4E00\u884C\u4E2D\u67D0\u500B\u5217\
                         s * .54 > u ? s = u / .54 : u = s * .54;
                         let d = $("<canvas>").attr("width", s).attr("height", u)[0];
                         d.getContext("2d").putImageData(o, 0, 0), t.attr("width", 350), t.attr("height", 189), t.get(0).getContext("2d").drawImage(d, 0, 0, 350, 189);
-                        let f = t.get(0).toDataURL("image/jpeg", .9), m = luckysheet.sheetmanage.getCurSheetnoset();
+                        let f = t.get(0).toDataURL("image/jpeg", 1), m = luckysheet.sheetmanage.getCurSheetnoset();
                         e.imageRequestLock = !0;
                         let g = encodeURIComponent(JSON.stringify({t: "thumb", img: f, curindex: m}));
                         t.remove(), e.updateImageUrl != "" && $.post(e.updateImageUrl, {
@@ -49319,7 +49319,7 @@ field\u53EF\u4EE5\u662F\u8207database\u7B2C\u4E00\u884C\u4E2D\u67D0\u500B\u5217\
         }).css({width: y, height: m});
         lr(g, f, y, m, 1, 1, null, null, v);
         let b = v.get(0).getContext("2d");
-        return b.beginPath(), b.moveTo(0, 0), b.lineTo(0, h.devicePixelRatio * m), b.lineWidth = h.devicePixelRatio * 2, b.strokeStyle = Tl.strokeStyle, b.stroke(), b.closePath(), b.beginPath(), b.moveTo(0, 0), b.lineTo(h.devicePixelRatio * y, 0), b.lineWidth = h.devicePixelRatio * 2, b.strokeStyle = Tl.strokeStyle, b.stroke(), b.closePath(), v.get(0).toDataURL("image/png")
+        return b.beginPath(), b.moveTo(0, 0), b.lineTo(0, h.devicePixelRatio * m), b.lineWidth = h.devicePixelRatio * 2, b.strokeStyle = Tl.strokeStyle, b.stroke(), b.closePath(), b.beginPath(), b.moveTo(0, 0), b.lineTo(h.devicePixelRatio * y, 0), b.lineWidth = h.devicePixelRatio * 2, b.strokeStyle = Tl.strokeStyle, b.stroke(), b.closePath(), v.get(0).toDataURL("image/png",1)
     }
 
     function Ne0(e, n = {}) {
@@ -52176,7 +52176,7 @@ field\u53EF\u4EE5\u662F\u8207database\u7B2C\u4E00\u884C\u4E2D\u67D0\u500B\u5217\
                             $("#" + _).hide();
                             let R = $(this), I = R.attr("itemvalue");
                             if (I == 0) $("#luckysheetborderSizepreview").attr("src", "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==").attr("itemvalue", null); else {
-                                let F = R.find("canvas").get(0).toDataURL("image/png");
+                                let F = R.find("canvas").get(0).toDataURL("image/png",1);
                                 $("#luckysheetborderSizepreview").attr("src", F).attr("itemvalue", I)
                             }
                             e.focus($("#" + _), I)
@@ -55478,7 +55478,7 @@ field\u53EF\u4EE5\u662F\u8207database\u7B2C\u4E00\u884C\u4E2D\u67D0\u500B\u5217\
             lr(C, w, S, x, 1, 1, null, null, _);
             let T = _.get(0).getContext("2d");
             T.beginPath(), T.moveTo(0, 0), T.lineTo(0, h.devicePixelRatio * x), T.lineWidth = h.devicePixelRatio * 2, T.strokeStyle = Tl.strokeStyle, T.stroke(), T.closePath(), T.beginPath(), T.moveTo(0, 0), T.lineTo(h.devicePixelRatio * S, 0), T.lineWidth = h.devicePixelRatio * 2, T.strokeStyle = Tl.strokeStyle, T.stroke(), T.closePath();
-            let A = new Image, R = _.get(0).toDataURL("image/png");
+            let A = new Image, R = _.get(0).toDataURL("image/png",1);
             A.src = R, S > x ? A.style.width = "100%" : A.style.height = "100%";
             let I = $(window).height() - 200;
             U.screenshot(g.screenshotTipSuccess, '<div id="luckysheet-confirm-screenshot-save" style="height:' + I + 'px;overflow:auto;"></div>', R), $("#luckysheet-confirm-screenshot-save").append(A), _.remove()

+ 1 - 1
chuanyi_client2/src/components/CustomDialog/DataSourceItem.vue

@@ -189,7 +189,7 @@
     </el-dialog>
 
     <el-dialog
-        title="选择四则运算表达式"
+        title="选择四则运算/值替换表达式"
         width="500px"
         top="10vh"
         center

+ 1 - 1
chuanyi_client2/src/components/HeaderMain/index.vue

@@ -444,7 +444,7 @@
     </el-dialog>
 
     <el-dialog
-        title="选择四则运算表达式"
+        title="选择四则运算/值替换表达式"
         width="500px"
         top="10vh"
         center

+ 20 - 1
chuanyi_client2/src/views/data_model/index.vue

@@ -262,6 +262,11 @@ export default {
     sortChange({ prop, order }) {
       this.tableData.sort(customCompare(prop, order))
     },
+    extractNumbers(expr) {
+      const regex = /\d+/g;
+      const numbers = expr.match(regex);
+      return numbers ? numbers.map(Number) : [];
+    },
     /** 四则运算表达式验证 */
     validateCalc(rule, value, callback) {
       if (this.dataModelForm.modelType == 1) {
@@ -274,7 +279,8 @@ export default {
       }
       try {
         // value = value.replace(/ /g, '')
-        value = value.replace(/calcVal/g, '99999')
+        let num = 99999
+        value = value.replace(/calcVal/g, num + '')
         if (/^[\d|\-|\+|\*|\/|\.|\(|\)]+$/.test(value)) {
           // 排除连续的运算符
           if (/[\-|\+|\*|\/]{2,}/.test(value)) {
@@ -286,6 +292,19 @@ export default {
             callback(new Error('表达式验证失败,请修改后再试'))
             return
           }
+          let numArr = this.extractNumbers(value)
+          let flag = false
+          for (let i = 0; i < numArr.length; i ++) {
+            if (numArr[i] > num) {
+              flag = true
+              break
+            }
+          }
+          // 排除类似表达式:2calcVal+1+calcVal5
+          if (flag) {
+            callback(new Error('表达式验证失败,请修改后再试'))
+            return
+          }
           let val = eval(value)
           if (typeof val == 'number' && val != Infinity) {
             callback()

+ 1 - 1
chuanyi_client2/src/views/group_item/index.vue

@@ -183,7 +183,7 @@
     </el-dialog>
 
     <el-dialog
-        title="选择四则运算表达式"
+        title="选择四则运算/值替换表达式"
         width="500px"
         top="10vh"
         center

+ 6 - 4
chuanyi_client2/src/views/my_report/index.vue

@@ -2220,7 +2220,7 @@ export default {
         luckysheet.getScreenshotNew((imgSrc) => {
           window.luckysheet.showGridLines();
           // * Lodop中的ADD_PRINT_IMAGE,也可以直接输出base64码图片,不用加img标签(如果加了img标签,会被当做超文本对待,受浏览器引擎解析的影响)
-          let $img = `<img src=${imgSrc} style="max-width: 90%;" />`
+          let $img = `<img src=${imgSrc} style="" />`
           this.$nextTick(() => {
             document.querySelector('#print-html').innerHTML = $img;
             setTimeout(() => {
@@ -2228,9 +2228,10 @@ export default {
                 printable: 'print-html',
                 type: 'html',
                 documentTitle: '文档标题',
+                maxWidth: 1150, // 最大宽度
                 header: '',
                 headerStyle: 'font-weight:400;text-align:center;',
-                style: '@page {margin: 0 10mm};', // 不打印页眉和页脚
+                style: '', // 不打印页眉和页脚
                 honorColor: true, // 是否打印彩色文本
                 targetStyles: ['*'] // 允许打印所有样式属性
               }) // Print.js插件
@@ -2251,7 +2252,7 @@ export default {
         luckysheet.getScreenshotNew((imgSrc) => {
           window.luckysheet.showGridLines();
           // * Lodop中的ADD_PRINT_IMAGE,也可以直接输出base64码图片,不用加img标签(如果加了img标签,会被当做超文本对待,受浏览器引擎解析的影响)
-          let $img = `<img src=${imgSrc} style="max-width: 90%;" />`
+          let $img = `<img src=${imgSrc} style="" />`
           this.$nextTick(() => {
             document.querySelector('#print-html').innerHTML = $img;
             setTimeout(() => {
@@ -2259,9 +2260,10 @@ export default {
                 printable: 'print-html',
                 type: 'html',
                 documentTitle: '文档标题',
+                maxWidth: 1150, // 最大宽度
                 header: '',
                 headerStyle: 'font-weight:400;text-align:center;',
-                style: '@page {margin: 0 10mm};', // 不打印页眉和页脚
+                style: '', // 不打印页眉和页脚
                 honorColor: true, // 是否打印彩色文本
                 targetStyles: ['*'] // 允许打印所有样式属性
               }) // Print.js插件

+ 8 - 6
chuanyi_client2/src/views/report_template/index.vue

@@ -305,7 +305,7 @@
     </el-dialog>
 
     <el-dialog
-        title="选择四则运算表达式"
+        title="选择四则运算/值替换表达式"
         width="500px"
         top="10vh"
         center
@@ -2281,7 +2281,7 @@ export default {
       }
       if ((this.barChartForm.legendType == '0' && this.chooseItemData.length > 1)
           || (this.barChartForm.type == 'pie' && this.chooseItemData.length > 1)) {
-        showAlertMsgWin(this, null, '选择一项数据项!')
+        showAlertMsgWin(this, null, '饼图仅支持选择一项数据项!')
         return
       }
       // 图表参数
@@ -2561,7 +2561,7 @@ export default {
         luckysheet.getScreenshotNew((imgSrc) => {
           window.luckysheet.showGridLines();
           // * Lodop中的ADD_PRINT_IMAGE,也可以直接输出base64码图片,不用加img标签(如果加了img标签,会被当做超文本对待,受浏览器引擎解析的影响)
-          let $img = `<img src=${imgSrc} style="max-width: 90%;" />`
+          let $img = `<img src=${imgSrc} style="" />`
           this.$nextTick(() => {
             document.querySelector('#print-html').innerHTML = $img;
             setTimeout(() => {
@@ -2569,9 +2569,10 @@ export default {
                 printable: 'print-html',
                 type: 'html',
                 documentTitle: '文档标题',
+                maxWidth: 1150, // 最大宽度
                 header: '',
                 headerStyle: 'font-weight:400;text-align:center;',
-                style: '@page {margin: 0 10mm};', // 不打印页眉和页脚
+                style: '', // 不打印页眉和页脚
                 honorColor: true, // 是否打印彩色文本
                 targetStyles: ['*'] // 允许打印所有样式属性
               }) // Print.js插件
@@ -2593,7 +2594,7 @@ export default {
         luckysheet.getScreenshotNew((imgSrc) => {
           window.luckysheet.showGridLines();
           // * Lodop中的ADD_PRINT_IMAGE,也可以直接输出base64码图片,不用加img标签(如果加了img标签,会被当做超文本对待,受浏览器引擎解析的影响)
-          let $img = `<img src=${imgSrc} style="max-width: 90%;" />`
+          let $img = `<img src=${imgSrc} style="" />`
           this.$nextTick(() => {
             document.querySelector('#print-html').innerHTML = $img;
             setTimeout(() => {
@@ -2601,9 +2602,10 @@ export default {
                 printable: 'print-html',
                 type: 'html',
                 documentTitle: '文档标题',
+                maxWidth: 1150, // 最大宽度
                 header: '',
                 headerStyle: 'font-weight:400;text-align:center;',
-                style: '@page {margin: 0 10mm};', // 不打印页眉和页脚
+                style: '', // 不打印页眉和页脚
                 honorColor: true, // 是否打印彩色文本
                 targetStyles: ['*'] // 允许打印所有样式属性
               }) // Print.js插件

+ 15 - 10
chuanyi_client2/src/views/run_config/index.vue

@@ -2413,7 +2413,7 @@ export default {
         //行数
         item.forEach((it, itemIndex) => {
           if (it !== null && it.v) {
-            console.log(index, it)
+            // console.log(index, it)
             if (objRowColumn.row[1] < index) {
               objRowColumn.row[1] = index; //row第二位
             }
@@ -2428,7 +2428,7 @@ export default {
     /** 打印操作 */
     printExcel() {
       const loading = showLoading(this, '请稍候···')
-      document.querySelector('#print-area').style = "display:block";
+      document.querySelector('#print-area').style = "display:block;margin:20px;";
       window.luckysheet.hideGridLines();
       //获取当前选中区域
       let currentSelected = luckysheet.getRange()
@@ -2438,17 +2438,19 @@ export default {
         luckysheet.getScreenshotNew((imgSrc) => {
           window.luckysheet.showGridLines();
           // * Lodop中的ADD_PRINT_IMAGE,也可以直接输出base64码图片,不用加img标签(如果加了img标签,会被当做超文本对待,受浏览器引擎解析的影响)
-          let $img = `<img src=${imgSrc} style="max-width: 90%;" />`
+          let $img = `<img src=${imgSrc} />`
           this.$nextTick(() => {
+            console.log(imgSrc)
             document.querySelector('#print-html').innerHTML = $img;
             setTimeout(() => {
               Print({
                 printable: 'print-html',
                 type: 'html',
                 documentTitle: '文档标题',
+                maxWidth: 1150, // 最大宽度
                 header: '',
                 headerStyle: 'font-weight:400;text-align:center;',
-                style: '@page {margin: 0 10mm};', // 不打印页眉和页脚
+                style: '', // 不打印页眉和页脚
                 honorColor: true, // 是否打印彩色文本
                 targetStyles: ['*'] // 允许打印所有样式属性
               }) // Print.js插件
@@ -2469,7 +2471,7 @@ export default {
         luckysheet.getScreenshotNew((imgSrc) => {
           window.luckysheet.showGridLines();
           // * Lodop中的ADD_PRINT_IMAGE,也可以直接输出base64码图片,不用加img标签(如果加了img标签,会被当做超文本对待,受浏览器引擎解析的影响)
-          let $img = `<img src=${imgSrc} style="max-width: 90%;" />`
+          let $img = `<img src=${imgSrc} />`
           this.$nextTick(() => {
             document.querySelector('#print-html').innerHTML = $img;
             setTimeout(() => {
@@ -2477,9 +2479,10 @@ export default {
                 printable: 'print-html',
                 type: 'html',
                 documentTitle: '文档标题',
+                maxWidth: 1150, // 最大宽度
                 header: '',
                 headerStyle: 'font-weight:400;text-align:center;',
-                style: '@page {margin: 0 10mm};', // 不打印页眉和页脚
+                style: '', // 不打印页眉和页脚
                 honorColor: true, // 是否打印彩色文本
                 targetStyles: ['*'] // 允许打印所有样式属性
               }) // Print.js插件
@@ -2505,7 +2508,7 @@ export default {
         let imgSrc = luckysheet.getScreenshot();
         window.luckysheet.showGridLines();
         // * Lodop中的ADD_PRINT_IMAGE,也可以直接输出base64码图片,不用加img标签(如果加了img标签,会被当做超文本对待,受浏览器引擎解析的影响)
-        let $img = `<img src=${imgSrc} style="max-width: 90%;" />`
+        let $img = `<img src=${imgSrc} style="" />`
         this.$nextTick(() => {
           document.querySelector('#print-html').innerHTML = $img;
           setTimeout(() => {
@@ -2513,9 +2516,10 @@ export default {
               printable: 'print-html',
               type: 'html',
               documentTitle: '文档标题',
+              maxWidth: 1150, // 最大宽度
               header: '',
               headerStyle: 'font-weight:400;text-align:center;',
-              style: '@page {margin: 0 10mm};', // 不打印页眉和页脚
+              style: '', // 不打印页眉和页脚
               honorColor: true, // 是否打印彩色文本
               targetStyles: ['*'] // 允许打印所有样式属性
             }) // Print.js插件
@@ -2533,7 +2537,7 @@ export default {
         let imgSrc = luckysheet.getScreenshot(); // 生成base64图片
         window.luckysheet.showGridLines();
         // * Lodop中的ADD_PRINT_IMAGE,也可以直接输出base64码图片,不用加img标签(如果加了img标签,会被当做超文本对待,受浏览器引擎解析的影响)
-        let $img = `<img src=${imgSrc} style="max-width: 90%;" />`
+        let $img = `<img src=${imgSrc} style="" />`
         this.$nextTick(() => {
           document.querySelector('#print-html').innerHTML = $img;
           setTimeout(() => {
@@ -2541,9 +2545,10 @@ export default {
               printable: 'print-html',
               type: 'html',
               documentTitle: '文档标题',
+              maxWidth: 1150, // 最大宽度
               header: '',
               headerStyle: 'font-weight:400;text-align:center;',
-              style: '@page {margin: 0 10mm};', // 不打印页眉和页脚
+              style: '', // 不打印页眉和页脚
               honorColor: true, // 是否打印彩色文本
               targetStyles: ['*'] // 允许打印所有样式属性
             }) // Print.js插件