| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 | <script src="__STATIC__/js/admin.js"></script><script>    Wind.use('colorpicker', function () {        $('.js-color').each(function () {            var $this = $(this);            $this.ColorPicker({                livePreview: true,                onChange: function (hsb, hex, rgb) {                    $this.val('#' + hex);                },                onBeforeShow: function () {                    $(this).ColorPickerSetColor(this.value);                }            });        });    });    function doSelectData(obj) {        var $obj              = $(obj);        var $realInput        = $obj.next();        var selectedObjectsId = $realInput.val();        var dataSource        = $obj.data('source');        var title             = $obj.data('title');        parent.openIframeLayer("{:url('theme/dataSource')}?ids=" + selectedObjectsId + '&data_source=' + dataSource, title, {            area: ['95%', '90%'],            btn: ['确定', '取消'],            yes: function (index, layero) {                var iframeWin       = parent.window[layero.find('iframe')[0]['name']];                var selectedObjects = iframeWin.confirm();                if (selectedObjects.selectedObjectsId.length == 0) {                    layer.msg('您没有选择任何数据!');                    return;                }                $realInput.val(selectedObjects.selectedObjectsId.join(','));                $obj.val(selectedObjects.selectedObjectsName.join(','));                parent.layer.close(index); //如果设定了yes回调,需进行手工关闭            }        });    }    function doEditArrayData(obj) {        var $obj   = $(obj);        var mVar   = $obj.data('var');        var title  = $obj.data('title');        var widget = $obj.data('widget');        widget     = widget ? '&widget=' + widget : '';        var fileId = $obj.data('file_id');        if (!fileId) {            fileId = '{$file_id}';        }        parent.openIframeLayer(            "{:url('theme/fileArrayData')}?tab={$tab}&file_id="+fileId+"&" + 'var=' + mVar + widget,            title,            {                area: ['95%', '90%'],                btn: ['确定', '取消'],                yes: function (index, layero) {                    var iframeWin = parent.window[layero.find('iframe')[0]['name']];                    var result    = iframeWin.confirm();                    if (result) {                        parent.layer.close(index); //如果设定了yes回调,需进行手工关闭                    }                }            }        );    }    function doSelectLocation(obj) {        var $obj       = $(obj);        var title      = $obj.data('title');        var $realInput = $obj.next();        var location   = $realInput.val();        parent.openIframeLayer(            "{:url('dialog/map')}?location=" + location,            title,            {                area: ['95%', '90%'],                btn: ['确定', '取消'],                yes: function (index, layero) {                    var iframeWin = parent.window[layero.find('iframe')[0]['name']];                    var location  = iframeWin.confirm();                    $realInput.val(location.lng + ',' + location.lat);                    $obj.val(location.address);                    parent.layer.close(index); //如果设定了yes回调,需进行手工关闭                }            }        );    }    function confirm() {        $('#submit-btn').click();    }    function removeImage(wigetVarName) {        //需要定位input和image        //清空Input        $('#js-' + wigetVarName + '-input').val('');        //修改Image为原图。        var defaultImage = $('#js-' + wigetVarName + '-button-remove').attr('defaultImage');        $('#js-' + wigetVarName + '-input-preview').attr('src', defaultImage);        //移除自身        $('#js-' + wigetVarName + '-button-remove').remove();    }</script>
 |