kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

iframe弹窗--子页面


序号字段名显示中文名排序值选择
1ZGFL管理人员11111
2ZGFL高层管理22222
3ZGFL中层管理33333
4ZGFL基层管理44444
5ZGFL专业技术类55555
















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
<script>
function select_iframe(pre1, pid, pre2, sid, m)
{
	prr = pid.split(',');
	srr = sid.split(',');
	for (var i = 0; i < prr.length; i ++) {
		var ttype = parent.document.getElementById(pre1+'_'+prr[i]).type;
		if (ttype == 'select-one') {
			var ops = parent.document.getElementById(pre1+'_'+prr[i]).children;
			var html = document.getElementById(pre2+'_'+srr[i]).innerHTML;
			for (oi = 0; oi < ops.length; oi ++) {
				if (ops[oi].text == html) {
					// parent.document.getElementById(pre1+'_'+prr[i]).options[oi].selected = true;
					// ops[oi].selected = true;
				//    $(parent.document).find('#'+pre1+'_'+prr[i]).val(ops[oi].value).trigger('change');
					$('#'+pre1+'_'+prr[i], window.parent.document).val(ops[oi].value).trigger('change');
					var show_id = $('#select2-'+pre1+'_'+prr[i]+"-container", window.parent.document)[0];
					if (typeof(show_id) != "undefined") {
						show_id.title = ops[oi].text;
						show_id.innerText = ops[oi].text;
					}
					break;
				}
			}
		} else if (ttype == 'textarea') {
			parent.document.getElementById(pre1+'_'+prr[i]).innerHTML = document.getElementById(pre2+'_'+srr[i]).innerHTML;
			parent.document.getElementById(pre1+'_'+prr[i]).value = document.getElementById(pre2+'_'+srr[i]).innerHTML;
		} else {
			parent.document.getElementById(pre1+'_'+prr[i]).value = document.getElementById(pre2+'_'+srr[i]).innerHTML;
		}
	}
	if (m == '2') {
		parent.document.getElementById("popup").style.display = "none";
	}
}
</script>

<br>

<table border='1' style="border-collapse: collapse;" table-layout='fixed' id='tb_zzdmk_98' width='98%' >
<thead>
<tr>
	<th>序号</th><th>字段名</th><th>显示中文名</th><th>排序值</th><th>选择</th>
</tr>
</thead>
<tr ondblclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_668', 'zwm,sortid', '2')" ><td>1</td><td id='zzdmk_668_pbf'>ZGFL</td><td id='zzdmk_668_zwm'>管理人员</td><td id='zzdmk_668_sortid'>11111</td><td><input style='width:70%;height:70%;' type='radio' name='radio_iframe' onclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_668', 'zwm,sortid', '1')"></td></tr>
<tr ondblclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_669', 'zwm,sortid', '2')" ><td>2</td><td id='zzdmk_669_pbf'>ZGFL</td><td id='zzdmk_669_zwm'>高层管理</td><td id='zzdmk_669_sortid'>22222</td><td><input style='width:70%;height:70%;' type='radio' name='radio_iframe' onclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_669', 'zwm,sortid', '1')"></td></tr>
<tr ondblclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_670', 'zwm,sortid', '2')" ><td>3</td><td id='zzdmk_670_pbf'>ZGFL</td><td id='zzdmk_670_zwm'>中层管理</td><td id='zzdmk_670_sortid'>33333</td><td><input style='width:70%;height:70%;' type='radio' name='radio_iframe' onclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_670', 'zwm,sortid', '1')"></td></tr>
<tr ondblclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_671', 'zwm,sortid', '2')" ><td>4</td><td id='zzdmk_671_pbf'>ZGFL</td><td id='zzdmk_671_zwm'>基层管理</td><td id='zzdmk_671_sortid'>44444</td><td><input style='width:70%;height:70%;' type='radio' name='radio_iframe' onclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_671', 'zwm,sortid', '1')"></td></tr>
<tr ondblclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_672', 'zwm,sortid', '2')" ><td>5</td><td id='zzdmk_672_pbf'>ZGFL</td><td id='zzdmk_672_zwm'>专业技术类</td><td id='zzdmk_672_sortid'>55555</td><td><input style='width:70%;height:70%;' type='radio' name='radio_iframe' onclick="select_iframe('zzfl_id', 'zgfl,sortid', 'zzdmk_672', 'zwm,sortid', '1')"></td></tr>
</table>


<script> parent.document.getElementById('popup').style.display = 'block'; </script>

language, web

« iframe弹窗--主页面 动态设置select2 »