Browse Source

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

MaiXinRong 6 years ago
parent
commit
fc898a7ffc

BIN
app/public/css/jquery-ui/images/ui-icons_444444_256x240.png


BIN
app/public/css/jquery-ui/images/ui-icons_555555_256x240.png


BIN
app/public/css/jquery-ui/images/ui-icons_777620_256x240.png


BIN
app/public/css/jquery-ui/images/ui-icons_777777_256x240.png


BIN
app/public/css/jquery-ui/images/ui-icons_cc0000_256x240.png


BIN
app/public/css/jquery-ui/images/ui-icons_ffffff_256x240.png


File diff suppressed because it is too large
+ 7 - 0
app/public/css/jquery-ui/jquery-ui.min.css


+ 8 - 1
app/public/js/change_set.js

@@ -250,7 +250,7 @@ $(document).ready(() => {
     // 打开签约清单modal并删除之前的操作
     $('#open-list-modal').click(function () {
        $('#table-list-select tr').removeClass('table-success');
-       $('#table-list-select tr').attr('data-detail', '');
+       $('#table-list-select tr').attr('data-bwmx', '');
        $('#code-list').html('');
     });
 
@@ -345,6 +345,13 @@ $(document).ready(() => {
         $(this).select();
     });
 
+    // 取消选中清单
+    $('#cancel-list-btn').click(function () {
+        $('#table-list-select tr').removeClass('table-success');
+        $('#table-list-select tr').attr('data-bwmx', '');
+        $('#code-list').html('');
+    });
+
     // 移除已选清单并重新编号
     $('body').on('click', '#list td a', function () {
         const index = $(this).parents('tr').data('index');

File diff suppressed because it is too large
+ 6 - 16615
app/public/js/jquery/jquery-ui.js


+ 19 - 7
app/public/js/stage_detail.js

@@ -402,6 +402,13 @@ $(document).ready(() => {
         reLoadDetailData();
     });
 
+    function setdraggrable(){
+        $( ".img-item" ).draggable({ containment: "parent" },{stop: function( event, ui ) {
+            }}).resizable({ containment: "parent" },{ handles: 'n, e, s, w, ne, se, sw, nw' },{ maxWidth: parseFloat($('#imgwidth').val())},{maxHeight: parseFloat($('#imgheight').val())},{
+            stop: function( event, ui ) {
+            }
+        });
+    }
 
     // 草图相关
     // 移动图片
@@ -444,20 +451,21 @@ $(document).ready(() => {
     // 加载草图组成
     $('#edit-img').on('show.bs.modal', function () {
         const data = getSelectDetailData();
-        const items = JSON.parse(data.calc_img_org) || [];
+        const items = data.calc_img_org !== undefined ? JSON.parse(data.calc_img_org) : [];
         const html = [];
         for (const item of items) {
-            const itemStyle = 'top:' + item.top + ';' + 'left:' + item.left + ';';
+            const itemStyle = 'top:' + item.top + ';' + 'left:' + item.left + ';' + 'width:' + item.width + ';' + 'height:' + item.height + ';';
             html.push('<div class="img-item" style="' + itemStyle + '">');
             html.push('<div class="img-bar">');
             html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove"></i></a>');
             html.push('</div>');
-            html.push('<img src="', item.src, '" id="draggable">');
+            html.push('<div class="focus" style="width:100%; height:100%"><img src="', item.src, '" id="draggable" style="width:100%; height:100%"></div>');
             html.push('</div>');
         }
         $('.img-view').html(html.join(''));
-        $('.img-item').mousedown(moveImageItem);
+        // $('.img-item').mousedown(moveImageItem);
         $('.img-bar').click(removeImageItem);
+        setdraggrable();
     });
     // 上传图片
     $('#upload-img').click(function () {
@@ -473,11 +481,12 @@ $(document).ready(() => {
                 html.push('<div class="img-bar">');
                 html.push('<a href="" class="text-danger" title="删除"><i class="fa fa-remove"></i></a>');
                 html.push('</div>');
-                html.push('<img src="', '/' + result, '" id="draggable">');
+                html.push('<div class="focus" style="width:100%; height:100%"><img src="', '/' + result, '" id="draggable" style="width:100%; height:100%"></div>');
                 html.push('</div>');
                 $('.img-view').append(html.join(''));
-                $('.img-item').mousedown(moveImageItem);
+                // $('.img-item').mousedown(moveImageItem);
                 $('.img-bar').click(removeImageItem);
+                setdraggrable();
             });
         }
     });
@@ -493,6 +502,8 @@ $(document).ready(() => {
                     src: $('img', item).attr('src'),
                     left: item.style.left,
                     top: item.style.top,
+                    width: item.style.width,
+                    height: item.style.height,
                 };
                 itemInfo.push(itemData);
             }
@@ -521,6 +532,7 @@ $(document).ready(() => {
             }
             updateData.img = canvas.toDataURL('image/jpeg');
             updateData.imgInfo = itemInfo;
+            console.log(updateData);
             postData(window.location.pathname + '/merge-img', updateData, function (result) {
                 _.assign(data, result);
                 $('#calc-img').html('<img src="/' + data.calc_img + '" class="d-100" width="100%">');
@@ -534,4 +546,4 @@ $(document).ready(() => {
             });
         }
     });
-});
+});

+ 2 - 1
app/service/stage_detail.js

@@ -112,6 +112,7 @@ module.exports = app => {
                 const org = await this.getLastestImStageData(this.ctx.tender.id, this.ctx.stage.id, data.lid, data.uuid);
                 const order = this.ctx.stage.curAuditor ? this.ctx.stage.curAuditor.order : 0;
                 if (org.times === this.ctx.stage.times && org.order === order) {
+                    delete org.flow;
                     const newData = this._.assign(org, data);
                     await this.db.update(this.tableName, newData);
                     return newData;
@@ -137,4 +138,4 @@ module.exports = app => {
     }
 
     return StageDetail;
-};
+};

+ 2 - 1
app/view/stage/detail.ejs

@@ -1,4 +1,5 @@
 <% include ../tender/tender_sub_menu.ejs %>
+<link rel="stylesheet" type="text/css" href="/public/css/jquery-ui/jquery-ui.min.css">
 <div class="panel-content">
     <div class="panel-title">
         <div class="title-main d-flex justify-content-between">
@@ -134,4 +135,4 @@
     const readOnly = <%- stage.readOnly %>;
     const stage = JSON.parse('<%- JSON.stringify(ctx.stage) %>');
     const imType = JSON.parse('<%- JSON.stringify(imType) %>');
-</script>
+</script>