scripts.html
3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<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 : '';
parent.openIframeLayer(
"{:url('theme/fileArrayData')}?tab={$tab}&file_id={$file_id}&" + '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();
}
</script>