浏览代码

新增数据补录功能

xieqy 2 年之前
父节点
当前提交
726bc0ed6e

+ 20 - 9
src/css/style.scss

@@ -54,6 +54,7 @@ body,
         right: unset;
 
         .sm-compass {
+
             .sm-compass-tilt,
             .sm-compass-tiltbar,
             .sm-compass-arrows {
@@ -157,15 +158,15 @@ input {
 
 div.abc-checkbox label::before {
     background-color: transparent !important;
-    border-color: $system_bdcolor !important;
+    border-color: $system_bdcolor  !important;
 }
 
-.abc-checkbox input[type="checkbox"]:checked + label::before {
+.abc-checkbox input[type="checkbox"]:checked+label::before {
     background-color: transparent;
     border-color: $system_bdcolor;
 }
 
-.abc-checkbox input[type="checkbox"]:checked + label:after {
+.abc-checkbox input[type="checkbox"]:checked+label:after {
     font-family: "Glyphicons Halflings" !important;
     content: "\e013" !important;
     color: rgba(255, 255, 255, 0.9);
@@ -174,15 +175,15 @@ div.abc-checkbox label::before {
 
 div.abc-radio label::before {
     background-color: transparent !important;
-    border-color: $system_bdcolor !important;
+    border-color: $system_bdcolor  !important;
 }
 
-.abc-radio input[type="radio"]:checked + label::before {
+.abc-radio input[type="radio"]:checked+label::before {
     border-color: $system_bdcolor;
     background-color: transparent;
 }
 
-.abc-radio input[type="radio"]:checked + label:after {
+.abc-radio input[type="radio"]:checked+label:after {
     background-color: rgba(255, 255, 255, 0.9);
     text-align: center;
 }
@@ -236,6 +237,7 @@ div.abc-radio label::before {
         text-align: center;
         border-bottom: 1px solid #ddd;
     }
+
     .row.paging {
         .pagenumber {
             font-size: 0.875rem;
@@ -255,32 +257,39 @@ div.abc-radio label::before {
         margin-bottom: 10px;
     }
 }
+
 .dataTables_wrapper {
     .paging {
         .information {
             display: flex;
             align-items: center;
         }
+
         .dataTables_info {
             padding-top: 0;
         }
+
         .length-changing {
             margin: 0;
             display: flex;
             align-items: center;
+
             .dataTables_length {
                 display: flex;
                 flex-flow: row nowrap;
                 align-items: center;
                 height: 42px;
                 line-height: 42px;
+
                 label {
                     margin-bottom: 0;
                 }
             }
         }
+
         .pagination {
             margin: 0;
+
             .dataTables_paginate {
                 margin-top: 2px;
             }
@@ -292,6 +301,7 @@ div.abc-radio label::before {
 
 .ztree {
     li {
+
         span.button.chk.checkbox_false_full,
         span.button.chk.checkbox_false_full_focus,
         span.button.chk.checkbox_false_part,
@@ -542,7 +552,7 @@ div.abc-radio label::before {
 }
 
 ::-webkit-scrollbar-track {
-    box-shadow: inset 0 0 1px rgba(93,196,213,0.5);
+    box-shadow: inset 0 0 1px rgba(93, 196, 213, 0.5);
     background-color: rgba(93, 196, 213, 0.1);
     border-radius: 0;
 }
@@ -550,7 +560,7 @@ div.abc-radio label::before {
 ::-webkit-scrollbar-thumb {
     -webkit-border-radius: 0;
     border-radius: 0;
-    background:rgba(78, 124, 206, 0.2);
+    background: rgba(78, 124, 206, 0.2);
     box-shadow: inset 0 0 1px transparent;
 }
 
@@ -1640,6 +1650,7 @@ div.abc-radio label::before {
 
 //datatable表头间隔
 .dataTableSetCss {
+
     //表头白色间隔
     th {
         border-left: 1px solid white !important;
@@ -1772,4 +1783,4 @@ div.abc-radio label::before {
         background: white;
         border: 1px solid #ced4da;
     }
-}
+}

+ 74 - 0
src/widgets/DataRerecords/Widget.html

@@ -0,0 +1,74 @@
+<div class="widget-DataRerecords">
+    <div class="container-fluid" style="height: 100%;">
+        <div class="row" style="height: 100%;">
+            <div class="col-3" style="height:100%">
+                <div class="pbstreepanel">
+                    <div class="overlay">
+                        <i class="fa fa-spinner fa-pulse"></i>
+                    </div>
+                    <div>
+                        <ul style="display: none;" id="pbstempTree" class="ztree"></ul>
+                    </div>
+                    <div class="tab-content">
+                        <!-- 结构树 -->
+                        <div id="pbstree" role="tabpanel" class="tab-pane fade show active">
+                            <div class="searchContainer">
+                                <div class="input-group searchbox">
+                                    <div class="input-group-prepend">
+                                        <select class="searchType" id="searchTypeSel">
+                                            <option value="2">工程名称</option>
+                                            <option value="0">PBS编码</option>
+                                            <option value="1">部件标识码</option>
+                                        </select>
+                                    </div>
+                                    <input class="form-control" type="text" autocomplete="off" id="pbsSearchInput" />
+                                    <div class="input-group-append">
+                                        <button class="btn" type="button" id="resetBtn">重置</button>
+                                        <button class="btn" type="button" id="searchBtn">
+                                            <i class="fa fa-search"></i>
+                                        </button>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="content">
+                                <ul id="pbsTreeDivId" class="ztree"></ul>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="col-9" style="height:100%">
+                <div class="photoPanel">
+                    <div class="picFilterTool">
+                        <form class="form-inline">
+                            <label>单位:</label>
+                            <select class="js-data-example-ajax" id="departMentSel">
+                            </select>
+                            <label style="margin-left:20px">用户名:</label>
+                            <input class="form-control" placeholder="请输入用户名" id="userNameInp">
+                            <label style="margin-left:20px">上传日期:</label>
+                            <input class="form-control" style="width: 220px;" placeholder="" id="scanDate">
+                            <button class="btn btn-primary" type="button" id="queryBtn">查询</button>
+                            <button class="btn btn-primary" type="button" id="picresetBtn">重置</button>
+                            <button class="btn btn-primary" type="button" id="dataRerecords">数据补录</button>
+                            <label style="margin-left:20px">类型:</label>
+                            <select id="photoType">
+                                <option value="">全部</option>
+                                <option value="CON">施工</option>
+                                <option value="SPV">监理</option>
+                            </select>
+                        </form>
+                    </div>
+                    <div class="picContainer">
+                        <div class="picListPanel">
+                            <ul id="photoLayout" class="picList"></ul>
+                        </div>
+                        <div id="picPaginator" class="picPage">
+
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 745 - 0
src/widgets/DataRerecords/Widget.ts

@@ -0,0 +1,745 @@
+import BaseWidget = require('core/BaseWidget.class');
+import VerificationHelper = require("common/VerificationHelper.class");
+import dataRerecords = require('./dataRerecords');
+
+/**
+ * PBS工程结构树全景展示
+ */
+class DataRerecords extends BaseWidget {
+    baseClass = "widget-DataRerecords";
+    widgetClass = ".widget-DataRerecords "//本模块的名称用于vue,避免模块之间的项目干扰
+    ztree: any;
+    opeartionItme = [];//被选中的列的id;
+    retable: any;
+    reset = "";
+    currentTarget = null;
+    localWindow = null;
+    treeDatas = [];
+    pbsSearchInputID = "pbsSearchInput";
+    searchBtnID = "searchBtn";
+    searchTypeSelID = "searchTypeSel";
+    photoLayoutID = "photoLayout";
+    picPaginatorID = "picPaginator";
+    verificationHelper = new VerificationHelper();
+    _viewer = undefined;
+    _searchData = {
+        "orders[0].asc": false,
+        "orders[0].column": "create_time",
+        userName: "",
+        photoType: '',
+        code: "",
+        departmentId: "",
+        beginDate: "",
+        endDate: "",
+        size: 15,
+        current: 1
+    }
+    treeNodes = [];
+    ztreetemp: any;
+    tempCode = "";
+    setting = null;
+    dateRange = {
+        startDate: "",
+        endDate: ""
+    };
+    _apiUrls = {
+        getUnitPid: "/tofly-sxgk/structure/getPidByPbsNew",
+        pipeScanRecord: "/tofly-sxgk/newpspipe/page",//管道施工信息
+        pointScanRecord: "/tofly-sxgk/newpsnode/page",//检查井施工信息
+        downLoad: "/base/file/loadImg",
+        pipeAndNodePic: "/tofly-sxgk/newPipeAndNodeScan/getPictureList",//获取当前层级的所有扫码照片
+        // departMentInfo: "/base/department/page"
+        departMentInfo: "/base/department/pageFilterPrj",
+        getUnitNew: "/tofly-sxgk/contract/getContructDepartment",
+        //
+        getPbsTreeApi: "/tofly-sxgk/structure/list",
+        sjfw: "",
+        pointDesign: "/tofly-sxgk/psnode/getNodeInfo", // 管点设计tab
+        pipeDesign: "/tofly-sxgk/pspipe/getPipeInfo", // 管线设计tab
+
+    }
+    dataRerecordsHandler = null
+    /**
+     * 启动
+     */
+    startup() {
+        this.initHtml();
+    }
+
+    /**
+     * 页面初始化
+     */
+    initHtml() {
+        this.setHtml(this.template);
+        this.domEvent();
+        this.loadPbsTree();
+    }
+
+    /**
+     * 获取pbs结构树
+     */
+    loadPbsTree() {
+        var url = this.config.getPbsTreeApi;
+        this.sendAjax({}, url, "GET", this.getPbsTreeCallback.bind(this), 0);
+    }
+    domEvent() {
+        this.domObj.find("#queryBtn").off('click').on('click', (e) => {
+            const scanUser = this.domObj.find("#userNameInp").val() ? this.domObj.find("#userNameInp").val().toString() : "";
+            const departmentID = this.domObj.find("#departMentSel").val() ? this.domObj.find("#departMentSel").val().toString() : "";
+
+            this._searchData.departmentId = departmentID;
+            this._searchData.userName = scanUser;
+            this._searchData.beginDate = this.dateRange.startDate;
+            this._searchData.endDate = this.dateRange.endDate;
+            this._searchData.current = 1;
+
+            this.showScanPhotos(true);
+        })
+        this.domObj.find("#picresetBtn").off('click').on('click', (e) => {
+            this.domObj.find("#departMentSel").val(null);
+            this.domObj.find("#departMentSel").trigger('change');
+            this.domObj.find("#userNameInp").val('');
+            this.domObj.find("#photoType").val('');
+            this.initDatePicker();
+        })
+        //数据补录模块
+        this.dataRerecordsHandler = new dataRerecords(this);//数据补录模块实例
+        this.domObj.find("#dataRerecords").off('click').on('click', (e) => {
+            this._apiUrls.sjfw = this.AppX.appConfig.gisResource.tiplayers.config["sjfw"].url
+            this.dataRerecordsHandler.showModuleContent(this._searchData.code)
+        })
+        this.domObj.find("#photoType").off('change').on('change', (e) => {
+            const photoType = this.domObj.find("#photoType").val().toString();
+
+            this._searchData.photoType = photoType;
+            this._searchData.current = 1;
+            this.showScanPhotos(true);
+        })
+        this.initDatePicker()
+        this.departMentInit();
+
+
+    }
+    initDatePicker() {
+        //
+        this.dateRange.startDate = "";
+        this.dateRange.endDate = "";
+        this.domObj.find('#scanDate').val('');
+        this.domObj.find('#scanDate').daterangepicker({
+            ranges: {
+                '今天': [moment(), moment()],
+                '近7天': [moment().subtract(6, 'days'), moment()],
+                '本月': [moment().startOf('month'), moment().endOf('month')],
+                '今年': [moment().startOf('year'), moment().endOf('year')]
+            },
+            opens: "left",
+            startDate: moment().hours(0).minutes(0).seconds(0), //设置开始日期
+            endDate: moment(new Date()), //设置结束器日期
+            maxDate: moment(new Date()), //设置最大日期
+            autoUpdateInput: false,
+            showWeekNumbers: true,
+            locale: {
+                format: "YYYY-MM-DD", //设置显示格式 HH:mm:ss
+                applyLabel: '确定', //确定按钮文本
+                cancelLabel: '取消', //取消按钮文本
+                customRangeLabel: '自定义',
+                daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
+                monthNames: ['一月', '二月', '三月', '四月', '五月', '六月',
+                    '七月', '八月', '九月', '十月', '十一月', '十二月'
+                ],
+                firstDay: 1
+            }
+        },
+            function (start, end) {
+                //this.domObj.find('#scanDate'  + ' span').html(start.format('YYYY/MM/DD') + ' - ' + end.format('YYYY/MM/DD'));
+                //alert(start.format('YYYYMMDD') + " " + end.format('YYYYMMDD'));
+                //this.showSpeedInfos(start.format('YYYY-MM-DD'),end.format('YYYY-MM-DD'));
+            }.bind(this)
+        ).on('apply.daterangepicker', function (ev, picker) {
+            this.domObj.find('#scanDate').val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
+            this.dateRange.startDate = picker.startDate.format('YYYY-MM-DD');
+            this.dateRange.endDate = picker.endDate.format('YYYY-MM-DD');
+        }.bind(this));
+    }
+    /**
+     * 该方法用于单位信息初始化
+     */
+    departMentInit() {
+        const that = this;
+        //单位初始化
+        var data = {
+            current: 1,
+            size: 10,
+        }
+        var url = this.apiRoot + this._apiUrls.getUnitNew;
+        //this.domObj.find("#departMentSel").select2();
+        this.domObj.find("#departMentSel").select2({
+            language: "zh-CN",
+            width: "220px",
+            ajax: {
+                headers: that.header,
+                delay: 250,
+                url: url,
+                // dataType: "json",
+                type: "GET",
+                contentType: "application/json;charset=utf-8",
+                data: (params) => {
+                    var query = {
+                        // current: params.page || 1,
+                        // size: 20,
+                        name: params.term,
+                        prjId: that.AppX.appConfig.currentPrj
+                    }
+                    return query;
+                },
+                processResults: (data) => {
+                    let nodes = [];
+                    // if (data.code != 1) {
+                    //     console.error(data.message);
+                    //     return { results: nodes };
+                    // }
+                    nodes = data.result.map(item => {
+                        return { id: item.id, text: item.name };
+                    })
+                    return {
+                        results: nodes,
+                        // pagination: {
+                        //     more: data.result.current < data.result.pages
+                        // }
+                    }
+                }
+            }
+        })
+
+    }
+    /**
+     * pbs结构树信息集合
+     * @param results pbs结构树集合
+     */
+    getPbsTreeCallback(results) {
+        let dep = 0;
+        let curPid = [];
+        function arr2tree(data, parent) {
+            let tree = []; // 定义最终输出
+            let temp = []; // 定义中间存储用变量
+            const usedParent = _.find(curPid, function (item) { return item.pid === parent })
+            if (!usedParent) {
+                dep += 1;
+                curPid.push({ pid: parent, dep: dep });
+            }
+            for (let i = 0; i < data.length; i++) {
+                if (data[i].pid == parent) { // 找到父级
+                    let obj = data[i]; // 保存父级
+                    obj.originname = obj.name;
+                    obj.name = `${obj.name}_${obj.code}`;
+                    obj.prjId = obj.prjid;
+                    obj.prjName = obj.prjname;
+                    const curparent = _.find(curPid, function (item) { return item.pid === parent });
+                    let open = true;
+                    if (curparent) {
+                        dep = curparent.dep;
+                        if (curparent.dep >= 2) open = false;
+                    }
+                    if (obj.levelname !== "部件类型") {
+                        temp = arr2tree(data, data[i].id); // 递归调用
+                    }
+                    if (temp.length > 0) { // 如果找到了
+                        obj.children = temp; // 父级的子集就等于刚才递归的结果
+                        obj.open = open;
+                    } else {
+                        obj.children = []; // 没有子集就把这个父级的children字段改成null 防止出现收起展开的图标
+                    }
+                    tree.push(obj); // 把父级和子集放到最终输出
+                }
+            }
+            return tree;
+        }
+        let zNodes = arr2tree(results.result[0].structures, null);
+
+        this.initZtree(zNodes);
+        this.treeNodes = zNodes;
+        this.initTempTree(zNodes);
+        this.loadMask.hide();
+    }
+    initTempTree(zNodes) {
+        if (this.ztree) {
+            this.ztree.destroy("pbsTreeDivId");
+            this.ztree = null;
+        }
+        var that = this;
+        var setting = {
+            async: {
+                enable: true
+            },
+            check: {
+                enable: false
+            },
+            data: {
+                simpleData: {
+                    enable: true,
+                    idKey: "id",
+                    pIdKey: "pid",
+                    rootPId: null
+                }
+            },
+            view: {
+                showLine: true,
+                showIcon: false
+            }
+        };
+        this.ztreetemp = $.fn.zTree.init($("#pbstempTree"), setting, zNodes);
+    }
+    /**
+     * 构建 ztree
+     * @param datas
+     */
+    initZtree(zNodes) {
+        if (this.ztree) {
+            this.ztree.destroy("pbsTreeDivId");
+            this.ztree = null;
+        }
+        var that = this;
+        var setting = {
+            async: {
+                enable: true
+            },
+            check: {
+                enable: false
+            },
+            data: {
+                simpleData: {
+                    enable: true,
+                    idKey: "id",
+                    pIdKey: "pid",
+                    rootPId: null
+                }
+            },
+            view: {
+                showLine: true,
+                showIcon: false,
+                fontCss: (treeId, treeNode) => {
+                    if (treeNode.pressureType === "1") {
+                        return { color: "#000000" };//待建
+                    } else if (treeNode.pressureType === "2") {
+                        return { color: "#0076FF" };//建设中
+                    } else if (treeNode.pressureType === "3") {
+                        return { color: "#009100" };//完工
+                    }
+                }
+            },
+            callback: {
+                onClick: function (event, treeId, treeNode) {
+                    //if (treeNode && treeNode.layerName) {
+                    that._searchData.code = treeNode.code;
+                    that.showScanPhotos(true);
+                    //}
+
+                },
+                onExpand: (event, treeId, treeNode) => {
+                    const tree = $.fn.zTree.getZTreeObj("pbsTreeDivId")
+                    if (treeNode.levelname == "部件类型") {
+                        this.sendAjax({ id: treeNode.id }, this.config.getPbsBjApi, "GET", res => {
+                            res.result.forEach(item => {
+                                item.value = item.code,
+                                    item.pipeId = item.pipeId,
+                                    item.layerName = item.layerName
+                                item.name = `${item.code}(${item.pipeId})`
+                                tree.addNodes(treeNode, item);
+                            });
+                        }, 1, true)
+                    }
+                },
+                onRightClick: (event, treeId, treeNode) => {
+                    const exsitBtn = $(".exportQRcodeBtn");
+                    if (treeNode !== null && treeNode.levelname === "部件类型") {
+                        if (exsitBtn.length !== 0) {
+                            exsitBtn.remove();
+                        }
+                        const url = "/tofly-sxgk/structure/createPdfByType";
+                        const downloadUrl = "/tofly-sxgk/commonFile/download";
+                        const data = { stdId: treeNode.id };
+                        const btn = `<button class="btn btn-info exportQRcodeBtn">导出二维码</button>`;
+                        const target = event.target;
+                        $(target).append(btn);
+                        $(target).css("position", "relative");
+                        const scanBtn = $(".exportQRcodeBtn");
+                        scanBtn.css({ "top": event.offsetY, "left": event.offsetX });
+                        scanBtn.on("click", (e) => {
+                            e.stopPropagation();
+                            this.sendAjax(data, url, "GET", res => {
+                                scanBtn.remove();
+                                if (res.code === -1) {
+                                    this.toast.show(res.message);
+                                    return;
+                                }
+                                const pdf = this.apiRoot + downloadUrl + "?fileName=" + res.result + "&access_token=" + this.userToken;
+                                window.open(pdf);
+                            }, 1);
+                        });
+                        this.domObj.on("click", () => {
+                            const exsitBtn = $(".exportQRcodeBtn");
+                            exsitBtn.remove();
+                        })
+                    }
+                }
+            }
+        };
+
+        this.setting = setting;
+        $(document).ready(function () {
+            this.ztree = $.fn.zTree.init($("#pbsTreeDivId"), setting, zNodes);
+            //默认点击第一个NODE
+            //获取第一个节点
+            var node = this.ztree.getNodes()[0];
+            //选中第一个子节点
+            this.ztree.selectNode(node);
+            setting.callback.onClick(null, this.ztree.setting.treeId, node);
+            this.initTreeCheck("puchatree");
+            this.initTreeCheck("shigongtree");
+            this.initTreeCheck("shejitree");
+            this.initTreeCheck("chengguotree");
+        }.bind(this));
+
+
+        this.domObj.find("#pbsTreeDivId").on("click", "a", function (e) {
+            if (this.domObj.find("#pbsTreeDivId a").find(".active").length > 1) {
+                this.domObj.find("#pbsTreeDivId a").find(".active").removeClass("active")
+            }
+            $(e.currentTarget).find(".diy").addClass("active");
+            that.currentTarget = $(that.domObj.find("#pbsTreeDivId .diy.active")[1]).find(".btn_files").attr("value");
+
+        }.bind(this));
+        this.domObj.find("#" + this.searchTypeSelID).off('change').on('change', function () {
+            this.domObj.find("#" + this.pbsSearchInputID).val('');
+        }.bind(this))
+        this.domObj.find("#resetBtn").off("click").on("click", () => {
+            this.tempCode = "";
+            this.domObj.find("#pbsSearchInput").val("");
+            // if (this.treeNodes.length !== 0) {
+            //     const shouldRemove = this.ztree.getNodes().slice();
+            //     if (shouldRemove) {
+            //         for (let i in shouldRemove) {
+            //             this.ztree.removeNode(shouldRemove[i])
+            //         }
+            //     }
+            // };
+            // this.ztree.addNodes(null, this.treeNodes[0]);
+            // this.treeNodes = [];
+            $.fn.zTree.init($("#pbsTreeDivId"), this.setting, this.treeNodes);
+        });
+        this.domObj.find('#' + this.searchBtnID).off('click').on('click', function () {
+            this.searchOperation();
+        }.bind(this))
+        this.domObj.find("#" + this.pbsSearchInputID).keyup(function (e) {
+            if (e.keyCode === 13) {
+                this.searchOperation();
+            }
+        }.bind(this));
+    }
+    /**
+     * 该方法用于初始化分页
+     */
+    initPaginator(pages) {
+        const that = this;
+        $('#' + this.picPaginatorID).pagination({
+            pages: pages,
+            edges: 2,
+            cssStyle: 'pagination',
+            displayedPages: 5,
+            onPageClick: function (pageNumber, event) {
+                that._searchData.current = pageNumber;
+                that.showScanPhotos();
+            },
+            onInit: function (getid) {
+                //刷新时调用
+                //alert(getid);
+            }
+
+        });
+    }
+    /**
+     * 该方法用于根据部件ID查询照片
+     * @param treeNode  树节点
+     */
+    showScanPhotos(clickEvt: boolean = false) {
+        //const geoType=treeNode.layerName.indexOf('PIPE')>-1?"LINE":"POINT";
+        //const url = geoType === "LINE" ? this._apiUrls.pipeScanRecord : this._apiUrls.pointScanRecord;
+        const url = this._apiUrls.pipeAndNodePic;
+        // const options = {
+        //     "orders[0].asc": false,
+        //     "orders[0].column": "create_time",
+        //     "current": 0,
+        //     "dataType": dataType,
+        //     "pbsCode": treeNode.code
+        // };
+        // const options = {
+        //     "current": 1,
+        //     "size":15,
+        //     "photoType": dataType,
+        //     "code": treeNode.code
+        // };
+        if (!this._searchData.code) {
+            this.toast.show("请选择工程");
+            return;
+        }
+        const options = this._searchData;
+        const that = this;
+        const panelHeight = this.domObj.find('.picListPanel').height();
+        options.size = Math.ceil(panelHeight / 244) * 5;
+        this.baseAjaxSend.sendAjax(that, options, url, 'GET', function (data) {
+            if (data.code !== 1 || !data.result) {
+                return;
+            }
+            const records = data.result.records;
+            //表格html内容
+            let tableHtml = "";
+            //图片html内容
+            let pictureHtml = "";
+            if (records && records.length) {
+                let index = 0;
+                records.forEach((item, index) => {
+                    //表格html内容
+                    index++;
+                    let gxStr = "";
+                    gxStr = item.pdName;
+                    let user = this.verificationHelper.setNullAndUndefined(item.realName) + "(" + (item.dataType === "CON" ? "施工" : "监理") + ")";
+                    let gx = this.verificationHelper.setNullAndUndefined(gxStr);
+                    const pipeName = item.typeName + "(" + item.partCode + ")";
+                    //图片html内容
+                    // if (picArray && picArray.length && picArray.length > 0) {
+                    //picArray.forEach(picItem => {
+                    let time = "/";
+                    if (item.createTime) {
+                        time = this.verificationHelper.setNullAndUndefined(item.createTime);
+
+                    }
+                    const nodeINDEX = (item.filePath as string).lastIndexOf('/');
+                    const newFilePath = item.filePath.slice(0, nodeINDEX) + "/thumbnail-" + item.filePath.slice(nodeINDEX + 1);
+                    const picurlOrigin = that.apiRoot + that._apiUrls.downLoad + "?remotePath=" + item.filePath + "&access_token=" + that.userToken;
+                    let picurl = that.apiRoot + that._apiUrls.downLoad + "?remotePath=" + newFilePath + "&access_token=" + that.userToken;
+
+                    pictureHtml += ("<li class='picItem'><img class='imgItem' data-original=" + picurlOrigin + " src='" + picurl + "' />"
+                        + "<div class='pipeDiv'>" + pipeName + "</div>"
+                        + "<div class='timeDiv'>" + time + "</div>"
+                        + "<div class='divItem'>"
+                        + "<span class='picUser'>" + user + "</span>"
+                        + "<span class='picgx'>" + gx + "</span>"
+                        + "</div></li>")
+                    //})
+                    //}
+                });
+                this.domObj.find('#' + this.photoLayoutID).viewer('destroy');
+                this.domObj.find('#' + this.photoLayoutID).empty().append(pictureHtml);
+
+
+                this._viewer = this.domObj.find('#' + this.photoLayoutID).viewer({
+                    navbar: true,
+                    url: "data-original"
+                });
+                if (clickEvt) {
+                    that.initPaginator(data.result.pages);
+                }
+            } else {
+                this.domObj.find('#' + this.photoLayoutID).viewer('destroy');
+                this.domObj.find('#' + this.photoLayoutID).empty().append("");
+                that.clearPictureOptions();
+                that.toast.show('无扫码记录');
+            };
+
+        }, function (err) {
+            console.log(err);
+        })
+    }
+    clearPictureOptions() {
+        $('#' + this.picPaginatorID).pagination('destroy');
+        $("#departMentSel").val('');
+        $("#userNameInp").val('');
+        $("#photoType").val('');
+    }
+    searchOperation() {
+        //const overlayObj = this.domObj.find('.overlay');
+        //overlayObj.show();
+
+        const code = this.domObj.find("#" + this.pbsSearchInputID).val().toString().trim();
+        if (code.trim() === "") return;
+        //XSS脚本检测
+        if (this.baseAjaxSend.isXSS(code)) {
+            this.toast.show('非法输入');
+            return;
+        }
+        const searchType = this.domObj.find("#" + this.searchTypeSelID).val().toString();
+
+        if (code !== "" && this.tempCode === code) return
+        this.tempCode = code;
+        switch (searchType) {
+            case "0":
+                this.searchDynamic(code);
+                break;
+            case "1":
+                this.searchDynamic(code);
+                break;
+            case "2":
+                this.searchStatic("originname", code, true);
+                break;
+        }
+    }
+
+    initTreeCheck(id) {
+        var setting = {
+            async: {
+                enable: true
+            },
+            check: {
+                enable: true
+            },
+            data: {
+                simpleData: {
+                    enable: true
+                }
+            },
+            view: {
+                showLine: true,
+                showIcon: false
+            },
+            callback: {
+                onClick: function (event, treeId, treeNode) {
+
+                }
+            }
+        };
+
+        $.fn.zTree.init($("#" + id), setting, this.config.nodedatas);
+
+    }
+    /**
+     * 该方法用后台接口搜索部件
+     * @param value pbs编码或部件标识码
+     */
+    searchDynamic(value: string) {
+        if (!value) return;
+        const that = this;
+        const ztreeObj = this.ztree;
+        const url = this._apiUrls.getUnitPid;
+        const size = 50;
+        this.sendAjax({ pbs: value, pageSize: size }, url, 'GET', function (result) {
+            if (result.code === 1 && result.result) {
+                if (result.result.length >= size) {
+                    that.AppX.runtimeConfig.toast.show("查询结果过多!当前显示匹配的50条记录")
+                }
+                const nodes = result.result.map((item) => {
+                    const targetNode = item;
+                    targetNode.pid = null;
+                    targetNode.value = targetNode.code;
+                    targetNode.pipeId = targetNode.pipeId;
+                    targetNode.layerName = targetNode.layerName;
+                    targetNode.name = `${targetNode.code}(${targetNode.pipeId})`;
+                    return targetNode;
+                })
+                $.fn.zTree.init($("#pbsTreeDivId"), this.setting, nodes);
+                //this.domObj.find('.overlay').hide();
+            }
+
+        }, 1)
+    }
+    /**
+     * 该方法用于搜索PBS工程结构树的静态数据
+     * @param {string} key ztree模糊查询关键值
+     * @param {string} code 模糊查询字符串
+     * @param {boolean} isLike 是否模糊查询
+     */
+    searchStatic(key: string, code: string, isLike: boolean) {
+
+        const ztreeObj = this.ztree;
+        const ztreetemp = this.ztreetemp;
+        //ztreeObj.cancelSelectedNode();
+        //this.ztree.removeNode(this.searchNodes[0])
+        let nodes = [];
+        if (isLike) {
+            //nodes = ztreeObj.getNodesByParamFuzzy(key, code, null);
+            const resNodes = ztreetemp.getNodesByParamFuzzy(key, code, null);
+            for (let i = 0; i < resNodes.length; i++) {
+                const item = resNodes[i];
+                const parentNode = _.find(resNodes, (node: any) => { return node.id === item.pid; });
+                if (!parentNode) {
+                    nodes.push(item);
+                }
+            }
+        } else {
+            nodes = ztreetemp.getNodesByParam(key, code, null);
+
+        }
+
+        //将找到的nodelist节点更新至Ztree内
+        $.fn.zTree.init($("#pbsTreeDivId"), this.setting, nodes);
+
+    }
+    /**
+     * 检查返回的数据集合是否正确
+     * @param results 用户信息集合
+     * @returns 返回true或者false(true正常,false返回数据异常)
+     */
+    checkRsults(results, colsepopup) {
+        this.loadMask.hide();
+        if (results.code != 1) {
+            console.error(results.message);
+            this.toast.show(results.message);
+            return false;
+        } else {
+            return true
+        }
+    }
+
+    /**
+     * 后台请求
+     */
+    sendAjax(data, url, ajaxtype, callBack?, type?, isasync?) {
+        //const overlay = this.domObj.find('.overlay');
+        let sendtype = "";
+        let senddata = null;
+        let contentType = "application/json;charset=utf-8";
+        if (ajaxtype == "POST" || ajaxtype == "PUT") {
+            senddata = JSON.stringify(data);
+        } else if (ajaxtype == "DELETE") {
+            contentType = "application/x-www-form-urlencoded";
+            senddata = {
+                ids: _.join(data.ids, ',')
+            }
+        }
+        else {
+            senddata = data;
+        }
+        if (type != 1) {
+            this.loadMask.show("正在加载中,请耐心等待...");
+        }
+        $.ajax({
+            headers: this.header,
+            async: isasync,
+            type: ajaxtype,
+            url: this.apiRoot + url,
+            contentType: contentType,
+            data: senddata,
+            success: callBack.bind(this),
+            error: function (data) {
+                console.error(data);
+                //overlay.hide();
+                this.loadMask.hide();
+                this.toast.show("服务端ajax出错,获取数据失败!");
+            }.bind(this),
+            dataType: "json",
+        });
+    }
+
+    /**
+     * 销毁对象
+     */
+    destroy() {
+        if (this.localWindow && this.localWindow.infoWindow) {
+            this.localWindow.infoWindow.remove();
+            this.AppX.appConfig.infowindow = null;
+            this.localWindow = null;
+        }
+        this.domObj.remove();
+        this.afterDestroy();
+    }
+}
+export = DataRerecords;

+ 225 - 0
src/widgets/DataRerecords/config.json

@@ -0,0 +1,225 @@
+{
+    "getPbsTreeApi": "/tofly-sxgk/structure/list",
+    "getPbsBjApi": "/tofly-sxgk/structure/findPsInfo",
+    "nodedatas": [
+        {
+            "id": 1,
+            "pId": -1,
+            "pid": -1,
+            "name": "排水设施图层",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 2,
+            "pId": 1,
+            "pid": 1,
+            "name": "检查井",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 100,
+            "pId": 2,
+            "pid": 2,
+            "name": "冷水铺路",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 1000,
+            "pId": 100,
+            "pid": 100,
+            "name": "01WS1",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 1001,
+            "pId": 100,
+            "pid": 100,
+            "name": "01WS2",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 1002,
+            "pId": 100,
+            "pid": 100,
+            "name": "01WS3",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 1003,
+            "pId": 100,
+            "pid": 100,
+            "name": "01WS4",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 1004,
+            "pId": 100,
+            "pid": 100,
+            "name": "01WS5",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 3,
+            "pId": 1,
+            "pid": 1,
+            "name": "排水管",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 4,
+            "pId": 1,
+            "pid": 1,
+            "name": "排水泵站",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 5,
+            "pId": 1,
+            "pid": 1,
+            "name": "污水处理厂",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 6,
+            "pId": 1,
+            "pid": 1,
+            "name": "雨水口",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 7,
+            "pId": 1,
+            "pid": 1,
+            "name": "排放口",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 8,
+            "pId": 1,
+            "pid": 1,
+            "name": "调蓄池",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 9,
+            "pId": 1,
+            "pid": 1,
+            "name": "闸门",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 10,
+            "pId": 1,
+            "pid": 1,
+            "name": "阀门",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 11,
+            "pId": 1,
+            "pid": 1,
+            "name": "化粪池",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 12,
+            "pId": 1,
+            "pid": 1,
+            "name": "一体化污水处理设施",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 13,
+            "pId": 1,
+            "pid": 1,
+            "name": "特征点",
+            "open": true,
+            "checked": true
+        },
+        {
+            "id": 14,
+            "pId": 1,
+            "pid": 1,
+            "name": "排水渠",
+            "open": true,
+            "checked": true
+        }
+    ],
+    "queryParameter": {
+        "dataSource": "sxgk",
+        "datasets": [
+            {
+                "title": "雨水管",
+                "name": "NETWORK_SJ_PSYS@sxgk#1",
+                "dataset": "NETWORK_SJ_PSYS",
+                "layername": "TF_SJ_PSYS_PIPE_B_3D"
+            },
+            {
+                "title": "雨水井",
+                "name": "TF_SJ_PSYS_JG_B_3D@sxgk#1",
+                "dataset": "TF_SJ_PSYS_JG_B_3D",
+                "layername": "TF_SJ_PSYS_NODE_B_3D"
+            },
+            {
+                "title": "雨水井盖",
+                "name": "TF_SJ_PSYS_JG_B_3D@sxgk#2",
+                "dataset": "TF_SJ_PSYS_JG_B_3D",
+                "layername": "TF_SJ_PSYS_NODE_B_3D"
+            },
+            {
+                "title": "污水管",
+                "name": "NETWORK_SJ_PSWS@sxgk#1",
+                "dataset": "NETWORK_SJ_PSWS",
+                "layername": "TF_SJ_PSWS_PIPE_B_3D"
+            },
+            {
+                "title": "污水井",
+                "name": "TF_SJ_PSWS_JG_B_3D@sxgk#1",
+                "dataset": "TF_SJ_PSWS_JG_B_3D",
+                "layername": "TF_SJ_PSWS_NODE_B_3D"
+            },
+            {
+                "title": "污水井盖",
+                "name": "TF_SJ_PSWS_JG_B_3D@sxgk#2",
+                "dataset": "TF_SJ_PSWS_JG_B_3D",
+                "layername": "TF_SJ_PSWS_NODE_B_3D"
+            },
+            {
+                "title": "雨污管",
+                "name": "NETWORK_SJ_PSHS@sxgk#1",
+                "dataset": "NETWORK_SJ_PSHS",
+                "layername": "TF_SJ_PSHS_PIPE_B_3D"
+            },
+            {
+                "title": "雨污井",
+                "name": "TF_SJ_PSHS_JG_B_3D@sxgk#1",
+                "dataset": "TF_SJ_PSHS_JG_B_3D",
+                "layername": "TF_SJ_PSHS_NODE_B_3D"
+            },
+            {
+                "title": "雨污井盖",
+                "name": "TF_SJ_PSHS_JG_B_3D@sxgk#2",
+                "dataset": "TF_SJ_PSHS_JG_B_3D",
+                "layername": "TF_SJ_PSHS_NODE_B_3D"
+            }
+        ]
+    }
+}

+ 659 - 0
src/widgets/DataRerecords/css/style.scss

@@ -0,0 +1,659 @@
+.widget-DataRerecords {
+    height: 100%;
+    $fontsize: 0.875rem;
+
+    .container-fluid {
+        padding-left: 5px;
+        padding-right: 5px;
+
+        .row {
+            margin-left: -5px;
+            margin-right: -5px;
+
+            .col-3,
+            .col-9 {
+                padding-left: 5px;
+                padding-right: 5px;
+            }
+        }
+    }
+
+    select,
+    input {
+        color: #000 !important;
+        background-color: #fff !important;
+        box-shadow: none !important;
+        margin: 0 !important;
+    }
+
+    .overlay {
+        display: none;
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        background-color: rgba(255, 255, 255, 0.5);
+        z-index: 1000;
+
+        i {
+            position: absolute;
+            font-size: 50px;
+            top: 50%;
+            left: 50%;
+            margin-top: -25px;
+            margin-left: -25px;
+            color: #000;
+            z-index: 1001;
+        }
+    }
+
+    .searchContainer {
+        height: 45px;
+
+        //background-color: rgba(215, 240, 248, 1);
+        .searchbox {
+            //height: 35px;
+            border: 1px solid #bbbccc;
+            font-size: $fontsize;
+
+            select {
+                border: none !important;
+                background-color: #fff;
+                margin: 0;
+                color: #000;
+            }
+
+            select.searchType {
+                width: 100px;
+            }
+
+            input {
+                font-size: $fontsize;
+                border: none !important;
+                box-shadow: none;
+                background-color: #fff;
+                margin: 0;
+                color: #000;
+            }
+
+            button {
+                font-size: $fontsize;
+                color: #47d9d9;
+                border: none !important;
+                background-color: #fff;
+                box-shadow: none !important;
+                margin: 0;
+                padding: .375rem .75rem;
+                border-radius: 0 !important;
+            }
+        }
+    }
+
+    .content {
+        position: absolute;
+        width: calc(100% - 12px);
+        height: calc(100% - 45px);
+        overflow: auto;
+        border-radius: 5px;
+        background-color: #fff;
+    }
+
+    .photoPanel {
+        height: 100%;
+        background-color: #fff;
+
+        .picFilterTool {
+            .btn.dropdown-toggle {
+                background-color: #fff;
+                color: #000;
+                margin: 0;
+                padding-right: 0;
+
+                .filter-option-inner-inner {
+                    text-overflow: ellipsis;
+                }
+            }
+        }
+
+        .select2-container .select2-selection--single {
+            height: 36px;
+        }
+
+        form {
+            padding: 5px;
+        }
+
+        .picContainer {
+            height: calc(100% - 56px);
+
+            .picListPanel {
+                height: calc(100% - 50px);
+                overflow-y: auto;
+            }
+
+            .picPage {
+                position: relative;
+
+                .pagination {
+                    position: absolute;
+                    right: 10px;
+                }
+
+                .page-item.active .page-link {
+                    color: #fff;
+                    background-color: #007bff;
+                    border-color: #007bff;
+                }
+            }
+        }
+
+        .picList {
+            list-style: none;
+            padding: 10px;
+            margin: 0px;
+        }
+
+        li.picItem {
+            position: relative;
+            float: left;
+            width: 20%;
+            padding: 10px;
+
+            img {
+                vertical-align: middle;
+                border-style: none;
+                width: 100%;
+                height: 200px;
+            }
+
+            .pipeDiv {
+                position: absolute;
+                top: 10px;
+                left: 10px;
+                right: 10px;
+                font-size: 14px;
+                padding: 3px;
+                color: #fff;
+            }
+
+            .timeDiv {
+                position: absolute;
+                bottom: 34px;
+                left: 10px;
+                right: 10px;
+                font-size: 14px;
+                padding: 3px;
+                color: #fff;
+                background: rgba(0, 0, 0, 0.5);
+            }
+
+            .picUser {
+                position: relative;
+                float: left;
+                background: rgba(255, 255, 255, 0.5);
+                font-size: 0.875rem;
+            }
+
+            .picgx {
+                // position: relative;
+                // float: right
+                position: absolute;
+                float: left;
+                right: 10px;
+                font-size: 0.875rem;
+            }
+        }
+    }
+
+    //zTree
+    .ztree li span {
+        line-height: 40px;
+        margin-right: 2px;
+        font-size: 1rem !important;
+        color: inherit !important;
+    }
+
+    .ztree li span.button.root_open {
+        background-position: -105px -63px;
+    }
+
+    .ztree li span.button.root_close {
+        background-position: -126px -63px;
+    }
+
+    .ztree li span.button.switch {
+        width: 21px;
+        height: 25px;
+    }
+
+    .ztree li a.curSelectedNode {
+        padding-top: 0px;
+        background-color: #e5e5e5;
+        color: black;
+        height: 40px;
+        opacity: 0.8;
+    }
+
+    .ztree li a:hover {
+        padding-top: 0px;
+        background-color: transparent;
+        color: black;
+        height: 40px;
+        opacity: 0.8;
+    }
+
+    .ztree li a.curSelectedNode {
+        //background-color: rgba(182, 223, 255, 1);
+        //background: url(../images/back_bolder.png);
+        background-repeat: no-repeat;
+        background-size: 100% 100%;
+        //11.27
+        background-color: rgba(225, 233, 251, 1);
+        border: 1px solid rgba(1, 69, 248, 1);
+
+        span {
+            //color: #66ceff;
+            color: #0145F8;
+            font-weight: bold;
+        }
+    }
+
+    .ztree li span.button.firstPage {
+        margin-left: 2px;
+        margin-right: 0;
+        background-position: -144px -16px;
+        vertical-align: top;
+        *vertical-align: middle
+    }
+
+    .ztree li span.button.prevPage {
+        margin-left: 2px;
+        margin-right: 0;
+        background-position: -144px -48px;
+        vertical-align: top;
+        *vertical-align: middle
+    }
+
+    .ztree li span.button.nextPage {
+        margin-left: 2px;
+        margin-right: 0;
+        background-position: -144px -64px;
+        vertical-align: top;
+        *vertical-align: middle
+    }
+
+    .ztree li span.button.lastPage {
+        margin-left: 2px;
+        margin-right: 0;
+        background-position: -144px -32px;
+        vertical-align: top;
+        *vertical-align: middle
+    }
+
+    .ztree li span.button.firstPage,
+    .ztree li span.button.prevPage,
+    .ztree li span.button.nextPage,
+    .ztree li span.button.lastPage {
+        line-height: 0;
+        margin: 0;
+        width: 16px;
+        height: 16px;
+        display: inline-block;
+        vertical-align: middle;
+        border: 0 none;
+        cursor: pointer;
+        outline: none;
+        background-color: transparent;
+        background-repeat: no-repeat;
+        background-attachment: scroll;
+        background-image: url(../images/zTreeStandard.png);
+    }
+
+    padding: 1px;
+
+    .nav-tabs {
+        background: rgb(225, 245, 254);
+
+        .nav-item {
+            width: 50%;
+
+            .nav-link {
+                font-size: 14px;
+                padding: .5rem .5rem;
+            }
+
+            a.nav-link {
+                text-align: center;
+                color: #495057;
+
+                :hover {
+                    color: #495057;
+                }
+            }
+
+            a.nav-link.active {
+                color: #007bff;
+            }
+        }
+    }
+
+    .tab-content {
+        overflow-y: auto;
+        font-size: 14px;
+
+        .tab-pane {
+            //padding: .5rem;
+
+            .img-fluid {
+                max-height: 300px;
+            }
+
+            p {
+                margin-bottom: .4rem;
+            }
+
+            .table tbody {
+
+                // tr td:first-child{white-space: nowrap;font-weight: bold;}
+                tr td {
+                    color: rgb(11, 88, 159);
+                }
+
+                tr td:first-child {
+                    white-space: nowrap;
+                    color: black;
+                }
+
+            }
+
+            .table-noborder {
+                margin-bottom: 10px;
+
+                td {
+                    border-top: unset;
+                }
+            }
+
+            .documentList {
+                tr td:first-child {
+                    width: 120px;
+                }
+
+                th,
+                td {
+                    text-align: center;
+                }
+            }
+        }
+    }
+
+    .scrtabs-tab-scroll-arrow {
+        height: 38px;
+        padding-top: 11px;
+    }
+
+    .bujian_img {
+        background: url(../images/bjxg.png);
+        width: 395px;
+        height: 600px;
+        background-repeat: no-repeat;
+        background-size: cover;
+        position: absolute;
+    }
+
+    .exportQRcodeBtn {
+        position: absolute;
+        z-index: 999;
+        // border-radius: 6px;
+        // background: white;
+        // color: black;
+        // border: none;
+        width: 80px;
+        height: 40px;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+    }
+}
+
+.widget-fullpanel {
+    .widget-fullpanel-con {
+        margin: 0;
+        height: calc(100% - 45px);
+    }
+}
+
+.daterangepicker.dropdown-menu {
+    z-index: 10000;
+}
+
+.select2-container {
+    .select2-dropdown--below {
+        z-index: 10000;
+        width: auto !important;
+
+        .select2-results__options li {
+            white-space: nowrap;
+        }
+    }
+}
+
+.viewer-container.viewer-fixed.viewer-fade.viewer-transition.viewer-in {
+    top: 78px !important
+}
+
+//数据补录弹窗
+.sjblpopup {
+    overflow: auto;
+    height: 100%;
+    width: 100%;
+
+    .sjblpopup-header {
+        width: 100%;
+        padding: 0 30px;
+        color: #000;
+
+        .dropdown-menu,
+        .inner {
+            max-height: 240px !important;
+        }
+
+        label {
+            white-space: nowrap;
+            color: #000 !important;
+            margin: 0 !important;
+        }
+
+        .title {
+            width: 80px;
+        }
+
+        .sjbl-pbsInfo {
+            display: flex;
+
+            button {
+                width: 450px !important;
+                padding: 2px 5px !important;
+                border: 1px solid #aaa !important;
+            }
+
+        }
+
+        .sjbl-detailInfo {
+            margin: 0 80px;
+            font-size: 12px;
+            color: #495057;
+        }
+
+        .sjbl-infoSets {
+            width: 100%;
+            display: flex;
+
+            .sets-item {
+                display: flex;
+                align-items: center;
+                margin-right: 10px;
+            }
+
+            input[type='radio'] {
+                margin-left: 10px;
+            }
+        }
+    }
+
+    .sjblpopup-djinfo {
+        height: 310px;
+        width: 100%;
+        padding-left: 30px;
+        padding-right: 20px;
+
+        .mask {
+            height: calc(100% - 230px);
+            width: 96%;
+            background-color: rgba(207, 207, 207, 0.7);
+            position: absolute;
+            display: block;
+            z-index: 999;
+            // display: flex;
+            // justify-content: center;
+            // align-items: center;
+            // .mask-text{
+            font-size: 14px;
+            font-family: Source Han Sans CN;
+            font-weight: 400;
+            color: #000000;
+            // }
+        }
+
+        table {
+            border: none !important;
+            width: 100% !important;
+            height: 100% !important;
+
+            thead {
+                background-color: rgba(16, 102, 208, 0.12) !important;
+                font-size: 14px;
+                font-family: Source Han Sans CN;
+                font-weight: 500;
+                color: #1066D0;
+            }
+
+            th {
+                padding-right: 0px !important;
+            }
+
+            tr {
+                height: 35px;
+            }
+        }
+
+        .table_pagecontrol {
+            position: absolute;
+            bottom: 10px;
+            width: 98%;
+            margin-left: 4px;
+        }
+
+        .pagination {
+            margin: 1.5px 0px;
+            position: relative;
+            margin-left: 10px;
+        }
+    }
+
+    #layerconfig_wrapper {
+        height: 100%;
+        width: 100%;
+
+        .dataTables_scroll {
+            height: 260px;
+
+            .dataName {
+                max-width: 248px !important;
+            }
+
+            .even {
+                background-color: #F3F7FE;
+                border: 2px solid;
+            }
+        }
+
+        .dataTables_scrollBody {
+            height: calc(100% - 50px) !important;
+
+            tr {
+                font-size: 14px;
+                font-family: Source Han Sans CN;
+                font-weight: 400;
+                color: #555555;
+                line-height: 18px;
+            }
+
+            td {
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                // border-bottom: 1px solid rgba(222, 222, 222, 1);
+            }
+        }
+
+        .paging {
+            // width: 38%;
+            // position: absolute;
+            display: flex;
+            margin-left: 0;
+        }
+
+        .information {
+            font-size: 12px;
+            font-family: Source Han Sans CN;
+            font-weight: 500;
+            color: #999999;
+        }
+
+        .page-link {
+            font-size: 12px;
+            font-family: Source Han Sans CN;
+            font-weight: 500;
+            color: #555555;
+            background: #FFFFFF;
+            box-shadow: 0px 0px 10px 0px rgba(19, 20, 22, 0.1);
+            border-radius: 2px;
+            margin-left: 4px;
+            padding: 5px 8px;
+        }
+
+        .page-link:hover {
+            background: #2D74E7;
+        }
+
+        .page-link:focus {
+            background: #2D74E7;
+        }
+
+        .page-item.active .page-link {
+            background-color: #2D74E7;
+        }
+
+        .turnToolbar {
+            font-size: 12px;
+            font-family: Source Han Sans CN;
+            font-weight: 500;
+            color: #999999;
+            margin-left: 10px;
+
+            .addPageIndexInput {
+                max-width: 50px;
+                height: 25px;
+                margin-top: 5px;
+            }
+        }
+
+        .upload {
+            color: #1066D0;
+            margin: 0px;
+            cursor: pointer;
+        }
+    }
+}

+ 400 - 0
src/widgets/DataRerecords/dataRerecords.ts

@@ -0,0 +1,400 @@
+import { result } from "lodash";
+
+//数据补录模块
+class dataRerecords {
+    global = null;
+    dataTable = null;
+    popup = null
+    code = null
+    pbsCode = null
+    tdtechId = null
+    nodeOrPipe = null
+    pdtechId = null
+    pipeId = null
+    updateAddFileWithNoMarkUrl = '/tofly-sxgk/uploadSeparately/updateAddFileWithNoMark'//上传文件接口
+    newpspipeSupplementUrl = "/tofly-sxgk/newpspipeSupplement"//补录管网信息管道接口
+    newpsnodeSupplementUrl = "/tofly-sxgk/newpsnodeSupplement"//补录检查井接口接口
+    constructor(global) {
+        this.global = global;
+    }
+
+    showModuleContent(code) {
+        if (!code) {
+            this.global.toast.show('请选择部件!')
+            return
+        }
+        this.code = code
+        this.global.popup.setSize(800, 550);
+        const popup = this.global.popup.show("数据补录", this.initTemplat());
+        this.popup = popup
+        this.initEvent(popup)
+        this.pbsInfoInit(popup)
+        this.gyInfoInit(popup)
+    }
+    //初始化模板,因使用select2,故采用下列方式添加
+    initTemplat() {
+        let temp = []
+        temp.push('<div class="sjblpopup">')
+        temp.push('<div class="sjblpopup-header">')
+        temp.push('<div class="sjbl-pbsInfo">')
+        temp.push('<label class="title">PBS编码:</label>')
+        temp.push('<select id="pbsInfoSelect" data-live-search="true"></select>')
+        temp.push('</div>')
+        temp.push('<div class="sjbl-detailInfo"></div>')
+        temp.push('<div class="sjbl-infoSets">')
+        temp.push('<div class="sets-item">')
+        temp.push('<label>工艺名称:</label><select id="gyInfoSelect"></select>')
+        temp.push('</div>')
+        temp.push('<div class="sets-item">')
+        temp.push('<label>工序照片类型:</label>')
+        temp.push('<input type="radio" name="dataType" value="CON" checked><label class="type">施工</label>')
+        temp.push('<input type="radio" name="dataType" value="SPV"><label class="type">监理</label>')
+        temp.push('<input type="file" style="display: none;" multiple="multiple" name="file"  class="form-control fileGx" id="fileGx"/>')
+        temp.push('</div>')
+        temp.push('</div>')
+        temp.push('</div>')
+        temp.push('<div class="sjblpopup-djinfo">')
+        temp.push('</div>')
+        temp.push('</div>')
+        return temp.join("")
+    }
+    initEvent(popup) {
+        const that = this
+        popup.domObj.find(".btn-submit").off('click').on('click', () => {
+            this.global.popup.removePope();
+        })
+        popup.domObj.find(".btn-hide").off('click').on('click', () => {
+            this.global.popup.removePope();
+        })
+        popup.domObj.find(".btn-close").off('click').on('click', () => {
+            this.global.popup.removePope();
+        })
+        popup.domObj.find(".fileGx").on("change", function (e) {
+            var e = e || window.event
+            var _file = e.target.files
+            if (_file.length > 0) {
+                that.updateAddFileWithMark(_file)
+            } else {
+                return
+            }
+        })
+    }
+    updateAddFileWithMark(file) {
+        let data = new FormData()
+        data.append('file', file[0])
+        this.global.baseAjaxSend.sendFileAjax(this.global, data, this.updateAddFileWithNoMarkUrl, "PUT", result => {
+            this.rerecordData(result.result[0])
+        })
+    }
+    rerecordData(id) {
+        let data = {
+            isweb: true,
+            dataType: this.popup.domObj.find("input[name='dataType']:checked").val(),//照片类型
+            fileUIds: [id],
+            tdCode: this.tdtechId,//工艺
+            pdCode: this.pdtechId,//工序
+            partCode: this.pipeId,//部件编码
+            pbsCode: this.pbsCode
+        }
+        this.global.baseAjaxSend.sendAjax(this.global, data, this.nodeOrPipe === 'POINT' ? this.newpsnodeSupplementUrl : this.newpspipeSupplementUrl, "POST", result => {
+            if (result.code !== -1) {
+                this.global.toast.show('补录数据成功')
+            } else {
+                this.global.toast.show('补录数据失败')
+            }
+        })
+    }
+    //Pbs编码信息初始化
+    pbsInfoInit(popup) {
+        const that = this;
+        let dom = popup.domObj.find("#pbsInfoSelect")
+        this.global.baseAjaxSend.sendAjax(this.global, { pbs: this.code, pageSize: 9999 }, this.global._apiUrls.getUnitPid, "GET", result => {
+            if (result.code !== 1) return;
+            const data = result.result
+            let html = ""
+            if (data.length > 0) {
+                data.forEach(item => {
+                    html += "<option value='" + item.code + "' pipeId='" + item.pipeId + "'>" + item.code + '(' + item.pipeId + ')' + "</option>";
+                })
+            } else {
+                html = "<option value=''>未查询到数据</option>"
+            }
+            dom.empty().append(html);
+            this.global.baseAjaxSend.selectSearch(dom);
+            getInfo()
+        })
+        dom.on('change', () => {
+            getInfo()
+        })
+        function getInfo() {
+            let pbs = dom.find('option:selected').val()
+            that.pbsCode = dom.find('option:selected').val()
+            that.pipeId = dom.find('option:selected').attr('pipeId')
+            that.searchPbsLayerInfo(pbs)
+        }
+    }
+    /**
+     * 该方法用于根据pbs编码定位部件位置
+     * @param pbs 
+     */
+    searchPbsLayerInfo(pbs: string) {
+        const url = '/tofly-sxgk/structure/getPidByPbs';
+        this.global.baseAjaxSend.sendAjax(this.global, { pbs: pbs }, url, "GET", (result) => {
+            if (result.code !== 1) return;
+            let lyName = result.result.layerName;
+            const code = pbs;
+            if (lyName.indexOf(',') > -1) {
+                lyName = lyName.split(',')[1];
+            }
+            else {
+                lyName = lyName;
+            }
+            this.queryForPipeUnitInfoByPBS(lyName, code);
+        })
+    }
+    /**
+     * 该方法用于通过iserver接口利用pbs编码查询构件信息
+     * @param {string} tableName 数据服务中的三维数据表名
+     * @param {string} code 构件pbs编码
+     */
+    queryForPipeUnitInfoByPBS(tableName: string, code: string) {
+        const gl = this;
+        const queryParameter = this.global.config.queryParameter;
+        const datasets = queryParameter.datasets as Array<any>;
+        const dataset = _.find(datasets, function (item) {
+            return item.layername === tableName;
+        });
+        if (dataset) {
+            const dataName = dataset.dataset;
+            const options = {
+                url: this.global._apiUrls.sjfw,
+                datasetNames: [queryParameter.dataSource + ":" + dataset.layername],
+                whereclause: "CODE='" + code + "'",
+                completed: function (result) {
+                    if (result.result.featureCount > 0) {
+                        const geometry = result.originResult.features[0].geometry;
+                        let geoType = (geometry.type === "LINE3D") ? "LINE" : "POINT"
+                        gl.nodeOrPipe = geoType
+                        gl.getDesignInfo(geoType, code)
+                    }
+                    else {
+                        gl.popup.domObj.find('.sjbl-detailInfo').empty().append(`<div>未查询到相关信息</div>`)
+                    }
+                }.bind(this),
+                failed: function (error) {
+                    console.error(error);
+                    gl.popup.domObj.find('.sjbl-detailInfo').empty().append(`<div>未查询到相关信息</div>`)
+                }
+            }
+            this.queryByAttribute(options);
+        }
+    }
+    /**
+     * 该方法用于属性查询(查询数据服务)
+     * @param options 
+     */
+    queryByAttribute(options: {
+        url: string,
+        datasetNames: string[],
+        whereclause: string,
+        fields?: string[],
+        completed: Function,
+        failed: Function
+    }) {
+        const filterparams = new SuperMap.REST.FilterParameter({
+            attributeFilter: options.whereclause,
+            fields: options.fields
+        });
+        const sqlParams = new SuperMap.REST.GetFeaturesBySQLParameters({
+            queryParameter: filterparams,
+            datasetNames: options.datasetNames,
+            toIndex: -1
+        });
+        const queryservice = new SuperMap.REST.GetFeaturesBySQLService(options.url, {
+            eventListeners: {
+                processCompleted: options.completed,
+                processFailed: options.failed
+            }
+        });
+        queryservice.processAsync(sqlParams);
+    }
+    //获取设计信息
+    getDesignInfo(geoType, pbs) {
+        this.global.baseAjaxSend.sendAjax(this.global, { code: pbs }, geoType === "LINE" ? this.global._apiUrls.pipeDesign : this.global._apiUrls.pointDesign, "GET", result => {
+            if (result.code == 1) {
+                this.showDetailInfo(result.result)
+            } else {
+                this.popup.domObj.find('.sjbl-detailInfo').empty().append(`<div>未查询到相关信息</div>`)
+            }
+        })
+    }
+    //
+    showDetailInfo(data) {
+        Object.keys(data).forEach(val => data[val] = data[val] || '/')
+        let html = []
+        html.push(`<div>施工单位:${data.buildUnit}</div>`)
+        html.push(`<div>监理单位:${data.supervisionUnit}</div>`)
+        html.push(`<div>工程信息:${data.projectName}${data.drawingProjectName}${data.designMajorName}${data.type}</div>`)
+        html.join("")
+        this.popup.domObj.find('.sjbl-detailInfo').empty().append(html)
+    }
+    //工艺信息初始化
+    gyInfoInit(popup) {
+        var that = this;
+        let dom = popup.domObj.find('#gyInfoSelect');
+        dom.select2().select2({
+            language: "zh-CN",
+            width: "220px",
+            dropdownParent: $('.sjblpopup'),
+            ajax: {
+                headers: that.global.header,
+                delay: 250,
+                url: that.global.apiRoot + '/tofly-sxgk/tdtech/page',
+                dataType: "json",
+                type: "GET",
+                contentType: "application/json;charset=utf-8",
+                data: (params) => {
+                    var query = {
+                        current: params.page || 1,
+                        size: 10,
+                    }
+                    return query;
+                },
+                processResults: (data) => {
+                    let nodes = [];
+                    if (data.code != 1) {
+                        console.error(data.message);
+                        return { results: nodes };
+                    }
+                    nodes = data.result.records.map(item => {
+                        return { id: item.id, text: item.name };
+                    })
+                    return {
+                        results: nodes,
+                        pagination: {
+                            more: data.result.current < data.result.pages
+                        }
+                    }
+                }
+            }
+        })
+        dom.change(e => {
+            this.tdtechId = dom.find('option:selected').val()
+            this.getInfoList(popup)
+        });
+    }
+    //工序结果列表
+    getInfoList(popup) {
+        const that = this;
+        popup.domObj.find('.sjblpopup-djinfo').empty().append('<table id="layerconfig" cellspacing="0" style="width: 100% !important;"></table>')
+        if (!that.tdtechId) return
+        // if (that.dataTable) {
+        //     that.dataTable.ajax.reload();
+        //     return;
+        // };
+        let aExtentData = {};
+        const columns = [
+            {
+                name: 'id', title: "工序ID", data: 'id', visible: false
+            },
+            {
+                name: 'gx', title: "工序", data: 'pdName'
+            },
+            {
+                name: 'td', title: "工艺名称", data: 'tdtechName'
+            },
+            {
+                name: 'operation', title: '操作', data: 'operation'
+            }
+        ];
+        const dataoptions = {
+            dom: 't' +
+                '     <"row paging"' +
+                '           <"information"ri>' +
+                '           <"turnToolbar">' +
+                '           <"rowReverse pagination"p>' +
+                '     >',
+            language: {
+                "lengthMenu": "每页 _MENU_ 条",
+                "zeroRecords": "未查询到任何记录",
+                "info": "共 _TOTAL_ 条",
+                "infoEmpty": "共0条",
+                "infoFiltered": "",
+                "processing": "查询中,请稍等...",
+                "paginate": {
+                    "first": "首页",
+                    "last": "尾页",
+                    "next": "下一页",
+                    "previous": "上一页"
+                },
+                "search": "搜索: ",
+            },
+            columns: columns,//表头
+            ordering: false,//排序
+            paging: true,//分页
+            pageLength: 4,
+            info: true,//页面信息
+            searching: true,//搜索           
+            scrollCollapse: false,
+            scrollY: scrollY + 'px',
+            processing: true,
+            serverSide: true,
+            ajax: {
+                headers: that.global.header,
+                type: "GET",
+                data: function (e) {
+                    let start = (e['start'] / e['length']) + 1;
+                    if (that.dataTable && that.dataTable.deafultPageIndex && that.dataTable.deafultPageIndex != -10) {
+                        start = parseInt(that.dataTable.deafultPageIndex);
+                        that.dataTable.context[0]._iDisplayStart = (start - 1) * that.dataTable.context[0]._iDisplayLength
+                        that.dataTable.deafultPageIndex = -10;
+                    }
+                    return {
+                        tdtechId: that.tdtechId,
+                        current: that.dataTable != null ? that.dataTable.page.info().page + 1 : 1,
+                        size: that.dataTable != null ? that.dataTable.page.info().length : 4,
+                    }
+                },
+                url: that.global.apiRoot + '/tofly-sxgk/procedurenew/page',
+                dataType: "json",
+                async: false,
+                error: function (e) {
+                    that.global.toast.show("获取列表失败");
+                    console.error(e);
+                },
+                dataSrc: function (results) {
+                    if (results.code == 1) {
+                        var value = results;
+                        results = {};
+                        //这里除了把数据处理后返回给DataTables,还需要把另外三个参数处理为顶级的属性(加入另外两个参数过会会有问题只需要recordsFiltered)
+                        value.recordsFiltered = value.result.total;
+                        results.data = [];
+                        $.each(value.result.records, function (i: number, item) {
+                            results.data.push({
+                                id: item.id,
+                                pdName: item.pdName,
+                                tdtechName: item.tdtechName,
+                                operation: "<label class='upload' value='" + i + "'>上传</label>",
+                            })
+                        })
+                        aExtentData = results.data;
+                        return results.data;
+                    } else {
+                        console.error(results.message);
+                    }
+                },
+            },
+            drawCallback: (setting) => {
+                //文件上传
+                popup.domObj.find(".upload").off('click').on('click', function () {
+                    let index = $(this).attr("value")
+                    that.pdtechId = aExtentData[index].id;
+                    popup.domObj.find('.fileGx').val('')
+                    popup.domObj.find(".fileGx").click()
+                })
+            },
+        }
+        this.dataTable = popup.domObj.find("#layerconfig").DataTable(dataoptions);
+    }
+}
+export = dataRerecords;