#
luxiaotao1123
2022-04-07 620460930976dd6e9a725a0915ab7b2b44c06b4e
#
2个文件已修改
76 ■■■■■ 已修改文件
static/js/object/ObjectSelect.js 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/utils/DataShow.js 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/ObjectSelect.js
@@ -5,8 +5,13 @@
    let selectedObjects = [];
    window.addEventListener( 'click', onMouseClick);
    window.addEventListener('dblclick', onMouseDbClick);
    function onMouseClick(event) {
        $("#label").attr("style", "display:none;");
    }
    function onMouseDbClick(event) {
        let x, y;
        if (event.changedTouches) {
            x = event.changedTouches[0].pageX;
@@ -18,11 +23,10 @@
        mouse.x = (x/ window.innerWidth) * 2 - 1;
        mouse.y = -(y/ window.innerHeight) * 2 + 1;
        raycaster.setFromCamera(mouse, _camera);
        var intersects = raycaster.intersectObjects([_scene], true);
        let intersects = raycaster.intersectObjects([_scene], true);
        if (intersects.length === 0) {
            $("#label").attr("style", "display:none;");//隐藏说明性标签
            $("#label").attr("style", "display:none;");
            return;
        }
@@ -35,14 +39,21 @@
                    $("#label").attr("style", "display:block;");
                    $("#label").css({left: x, top: y - 40});
                    let dataShow = new DataShow();
                    let dataShow = new DataShow('locNo', dest);
                    selectedObjects.pop();
                    selectedObjects.push(intersects[0].object);
                    $("#label").html(dataShow.showHint());
                // 运行中
                } else if (dest.length === 4) {
                    $("#label").attr("style", "display:block;");
                    $("#label").css({left: x, top: y - 40});
                    let dataShow = new DataShow('wrkNo', dest);
                    selectedObjects.pop();
                    selectedObjects.push(intersects[0].object);
                    $("#label").html(dataShow.showHint());
                } else {
                    $("#label").attr("style", "display:none;");
                }
static/js/utils/DataShow.js
@@ -1,46 +1,25 @@
function DataShow(type,no) {
    this.type=type;
    this.no=no;
    this.colRowDistributionChart = null;
    this.RowDistributionChart = null;
function DataShow(type, uuid) {
    this.type = type;
    this.uuid = uuid;
}
DataShow.prototype.showHint=function(){
    let htmltext='';
    return htmltext='<p>仓库编码:'+ 12312 +'</p>';
    let dataAnalyze = new DataAnalyze(this.no);
   if(this.type=='StoreSign'||this.type=='Store')
   {
       let store= dataAnalyze.getStore(this.no);
       htmltext='<p>仓库编码:'+store.No +'</p>';
       htmltext+='<p>仓库名称:'+store.Name +'</p>';
       htmltext+='<p>总库存:'+dataAnalyze.getStoreTotalBin(this.no) +'</p>';
       htmltext+='<p>已占库存:'+dataAnalyze.getStoreOccurpyBin(this.no) +'</p>';
       htmltext+='<p>今日入库:'+dataAnalyze.getStoreTotalBin(this.no) +'</p>';
       htmltext+='<p>今日出库:'+dataAnalyze.getStoreOccurpyBin(this.no) +'</p>';
       htmltext+='<p1>提示:双击可查看详细信息</p1>';
   }
    else if(this.type=='StoreGroup')
    {
        let group= dataAnalyze.getGroup(this.no);
        htmltext='<p>编码:'+group.No +'</p>';
        htmltext+='<p>名称:'+group.Name +'</p>';
        htmltext+='<p>总库存:'+dataAnalyze.getGroupTotalBin(this.no) +'</p>';
        htmltext+='<p>已占库存:'+dataAnalyze.getGroupOccurpyBin(this.no) +'</p>';
        htmltext+='<p>今日入库:'+dataAnalyze.getGroupTotalBin(this.no) +'</p>';
        htmltext+='<p>今日出库:'+dataAnalyze.getGroupOccurpyBin(this.no) +'</p>';
        htmltext+='<p1>提示:双击可查看详细信息</p1>';
DataShow.prototype.showHint = function(){
    let htmlText='';
    switch (type) {
        case 'locNo':
            htmlText+='<p>库位编号:'+ this.uuid +'</p>';
            break
        case "wrkNo":
            htmlText+='<p>任务编号:'+ this.uuid +'</p>';
            break
        default:
            break
    }
    else if(this.type=='StoreGoods')
    {
        let bin= dataAnalyze.getBin(this.no);
        htmltext='<p>编码:'+bin.No +'</p>';
        htmltext+='<p>名称:'+bin.Name +'</p>';
        htmltext+='<p>条码号:'+bin.Barcode +'</p>';
        htmltext+='<p>状态:'+bin.State +'</p>';
    }
    return htmltext;
    return htmlText;
}