camera_add.blade.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <style>
  2. .layui-upload-list {
  3. width: auto;
  4. height: auto;
  5. margin-bottom: 0;
  6. }
  7. .layui-elem-quote {
  8. padding-bottom: 5px;
  9. }
  10. .layui-upload-img {
  11. /*width: 92px;*/
  12. height: 92px;
  13. }
  14. hr {
  15. margin: 15px 0;
  16. }
  17. .uk-alert-danger {
  18. background: #fff1f0;
  19. color: #d85030;
  20. margin-bottom: 15px;
  21. padding: 10px;
  22. border: 1px solid rgba(216, 80, 48, .3);
  23. border-radius: 4px;
  24. text-shadow: 0 1px 0 #fff;
  25. }
  26. .imgItem {
  27. display: inline-block;
  28. position: relative;
  29. margin: 0 10px 10px 0;
  30. }
  31. .imgItem .layui-close {
  32. position: absolute;
  33. top: 0;
  34. right: 0;
  35. height: 16px;
  36. line-height: 16px;
  37. text-align: center;
  38. color: #000;
  39. width: 16px;
  40. border: 1px solid #000;
  41. background-color: #fff;
  42. }
  43. iframe.fr-iframe {
  44. padding: 0 20px;
  45. }
  46. .fr-wrapper.show-placeholder .fr-placeholder {
  47. padding-left: 30px !important;
  48. }
  49. .layui-form-label {
  50. width: {{ $colWidth }}px;
  51. }
  52. .layui-input-block {
  53. margin-left: {{ $colWidth + 30 }}px;
  54. }
  55. .weadmin-body {
  56. overflow: initial;
  57. }
  58. </style>
  59. <script src="/js/admin/xm-select.js"></script>
  60. <script src="/laydate/laydate.js"></script>
  61. <form class="layui-form" id="form-unify" method="post" action="{{ $path ?? '' }}" style="padding:20px;">
  62. @csrf
  63. <h2 class="uk-modal-title">{{ $fromTitle }}</h2>
  64. @if(isset($item[$primaryKey]))
  65. <input type="hidden" name="{{ $primaryKey }}" value="{{ $item[$primaryKey] }}">
  66. @endif
  67. <br>
  68. @foreach($columns as $key => $column)
  69. @switch($column['type'])
  70. @case('tree_select')
  71. <div class="layui-form-item">
  72. <label class="layui-form-label">{{ $column['label'] }}</label>
  73. <div class="layui-input-block">
  74. {{-- {!! json_encode($column) !!} --}}
  75. <select name="{{ $key }}">
  76. @if($column['isShowNull'] == true)
  77. <option value="0" @if(!isset($item)) selected @endif>无</option>
  78. @endif
  79. @if(count($column['options']) > 0)
  80. @include('admin::component.multi_select_option', ['selects' => $column['options'], 'selectPid' => $item[$key] ?? ($column['default'] ?? '')])
  81. @endif
  82. </select>
  83. </div>
  84. </div>
  85. @break
  86. @endswitch
  87. @endforeach
  88. <div class="layui-form-item">
  89. <label class="layui-form-label">摄像头名称</label>
  90. <div class="layui-input-block">
  91. <input class="layui-input" type="text" placeholder="请输入摄像头名称" name="camera_name" value="{{ $item['camera_name'] ?? (old('camera_name')) }}"/>
  92. </div>
  93. </div>
  94. <div class="layui-form-item">
  95. <label class="layui-form-label">摄像头类型</label>
  96. <div class="layui-input-block">
  97. <select name="camera_type">
  98. <option value="0" @if(!isset($item)) selected @endif>无</option>
  99. @if(count($columns['camera_type']['options']) > 0)
  100. @foreach($columns['camera_type']['options'] as $k => $col)
  101. <option value="{{ $k }}"
  102. @if($columns['camera_type']['default'] == $k || (isset($item['camera_type']) && $item['camera_type'] == $k)) selected @endif>
  103. {{ $col }}
  104. </option>
  105. @endforeach
  106. @endif
  107. </select>
  108. </div>
  109. </div>
  110. <div class="layui-form-item">
  111. <label class="layui-form-label">摄像头来源</label>
  112. <div class="layui-input-block">
  113. <select name="camera_source" id="camera_source" lay-filter="camera_source">
  114. <option value="0" @if(!isset($item)) selected @endif>无</option>
  115. @if(count($columns['camera_source']['options']) > 0)
  116. @foreach($columns['camera_source']['options'] as $k => $col)
  117. <option value="{{ $k }}"
  118. @if($columns['camera_source']['default'] == $k || (isset($item['camera_source']) && $item['camera_source'] == $k)) selected @endif>
  119. {{ $col }}
  120. </option>
  121. @endforeach
  122. @endif
  123. </select>
  124. </div>
  125. </div>
  126. <input class="layui-input" type="hidden" id="source_default" value="{{ $item['camera_source'] ?? (old('camera_source')) }}"/>
  127. <div class="layui-form-item" id="video_recorder">
  128. <div class="layui-form-label">录像机品牌</div>
  129. <div class="layui-input-block">
  130. @foreach($columns['video_recorder']['options'] as $k => $col)
  131. <label><input type="radio" name="video_recorder" lay-filter="radio" value="{{ $k }}"
  132. @if((isset($item['video_recorder']) && $item['video_recorder'] == $k) ||
  133. old('video_recorder') === $k ||
  134. (isset($columns['video_recorder']['default']) && $columns['video_recorder']['default'] === $k)) checked
  135. @endif title="{{ $col }}"/>
  136. </label>
  137. @endforeach
  138. </div>
  139. </div>
  140. <div class="layui-form-item" id="rtsp">
  141. <label class="layui-form-label">rtsp规则</label>
  142. <div class="layui-input-block">
  143. <input class="layui-input" type="text" readonly id="rtsp_input" value="rtsp://用户名:密码@IP地址:端口/h264/ch通道号/码流类型/av_stream(sub:子码流,main:主码流)"/>
  144. </div>
  145. </div>
  146. <div class="layui-form-item" id="camera_url">
  147. <label class="layui-form-label">摄像头链接</label>
  148. <div class="layui-input-block">
  149. <input class="layui-input" type="text" placeholder="请输入摄像头链接" name="camera_url" value="{{ $item['camera_url'] ?? (old('camera_url')) }}"/>
  150. </div>
  151. </div>
  152. <div class="layui-form-item" id="user_name">
  153. <label class="layui-form-label">用户名</label>
  154. <div class="layui-input-block">
  155. <input class="layui-input" type="text" placeholder="请输入用户名" name="user_name" value="{{ $item['user_name'] ?? (old('user_name')) }}"/>
  156. </div>
  157. </div>
  158. <div class="layui-form-item" id="password">
  159. <label class="layui-form-label">密码</label>
  160. <div class="layui-input-block">
  161. <input class="layui-input" type="text" placeholder="请输入密码" name="password" value="{{ $item['password'] ?? (old('password')) }}"/>
  162. </div>
  163. </div>
  164. <div class="layui-form-item" id="ip">
  165. <label class="layui-form-label">ip地址</label>
  166. <div class="layui-input-block">
  167. <input class="layui-input" type="text" placeholder="请输入ip地址" name="ip" value="{{ $item['ip'] ?? (old('ip')) }}"/>
  168. </div>
  169. </div>
  170. <div class="layui-form-item" id="port">
  171. <label class="layui-form-label">端口</label>
  172. <div class="layui-input-block">
  173. <input class="layui-input" type="text" placeholder="请输入端口" name="port" value="{{ $item['port'] ?? (old('port')) }}"/>
  174. </div>
  175. </div>
  176. <div class="layui-form-item" id="com_number">
  177. <label class="layui-form-label">通道号</label>
  178. <div class="layui-input-block">
  179. <input class="layui-input" type="text" placeholder="请输入通道号" name="com_number" value="{{ $item['com_number'] ?? (old('com_number')) }}"/>
  180. </div>
  181. </div>
  182. <div class="layui-form-item" id="code_stream">
  183. <label class="layui-form-label">视频码流</label>
  184. <div class="layui-input-block">
  185. <?php //dd($columns['code_stream']['value'] == 1);exit;?>
  186. <select name="code_stream">
  187. <option value="0">无</option>
  188. {{-- @foreach($columns['code_stream']['options'] as $k=>$v)--}}
  189. {{-- @if($k == 1 && count($columns['code_stream']['options']) > 0)--}}
  190. {{-- <option value="{{ $k }}" selected>{{ $v }}</option>--}}
  191. {{-- @else--}}
  192. {{-- <option value="{{ $k }}">{{ $v }}</option>--}}
  193. {{-- @endif--}}
  194. {{-- @endforeach--}}
  195. @if($columns['code_stream']['value'] == 2)
  196. <option value="1">子码流</option>
  197. <option value="2" selected>主码流</option>
  198. @else
  199. <option value="1" selected>子码流</option>
  200. <option value="2">主码流</option>
  201. @endif
  202. </select>
  203. </div>
  204. </div>
  205. <div class="layui-form-item">
  206. <label class="layui-form-label">排序</label>
  207. <div class="layui-input-block">
  208. <input class="layui-input" type="text" placeholder="请输入排序" name="sort" value="{{ $item['sort'] ?? (old('sort')) }}"/>
  209. </div>
  210. </div>
  211. @if(isset($columns['surface_id']))
  212. <div class="layui-form-item">
  213. <label class="layui-form-label">所属矿区区域</label>
  214. <div class="layui-input-block">
  215. <?php /*dd($columns);exit;*/?>
  216. <select name="surface_id">
  217. <option value="0">无</option>
  218. @foreach($columns['surface_id']['options'] as $k=>$v)
  219. @if($k == 1 && count($columns['surface_id']['options']) > 0)
  220. <option value="{{ $k }}" selected>{{ $v }}</option>
  221. @else
  222. <option value="{{ $k }}">{{ $v }}</option>
  223. @endif
  224. @endforeach
  225. </select>
  226. </div>
  227. </div>
  228. @endif
  229. @foreach($columns as $key => $column)
  230. @switch($column['type'])
  231. @case('uploadImg')
  232. <label class="layui-form-label">{{ $column['label'] }}</label>
  233. <div class="layui-upload">
  234. <img id="pre" class="layui-upload-img none">
  235. @if (strlen($column['default']) > 0)
  236. <script>
  237. $('#pre').attr('src', '{{ $column['default'] }}');
  238. </script>
  239. @endif
  240. <span style="display: inline-table;">
  241. <button type="button" class="layui-btn" id="selectImgBtn">上传图片</button>
  242. <p id="uploadTips">
  243. <input type="hidden" name="{{ $key }}" value="{{ $column['default'] ?? '' }}"/>
  244. </p>
  245. </span>
  246. </div>
  247. <style>
  248. .layui-upload-img {
  249. /*width: 92px;*/
  250. height: 92px;
  251. margin: 10px 10px 10px 10px;
  252. }
  253. #uploadTips {
  254. line-height: 30px;
  255. }
  256. </style>
  257. <script>
  258. layui.use('upload', function () {
  259. var $ = layui.jquery
  260. , upload = layui.upload;
  261. var uploadInst = upload.render({
  262. elem: '#selectImgBtn'
  263. , url: "{{ $column['uploadURLPath'] }}"
  264. , acceptMime: 'image/jpg, image/png, image/jpeg'
  265. , number: 1
  266. , before: function (obj) {
  267. //预读本地文件示例,不支持ie8
  268. obj.preview(function (index, file, result) {
  269. $('#pre').attr('src', result); //图片链接(base64)
  270. });
  271. //开始加载效果
  272. var loading = layer.load(0, {
  273. shade: 0.2,
  274. time: 2*1000
  275. });
  276. }
  277. , done: function (res) {
  278. //如果上传失败
  279. if (res.code > 0) {
  280. return layer.msg('上传失败');
  281. }
  282. //上传成功
  283. $("input[name='{{ $key }}']").val(res.data.image_path);
  284. //结束加载效果
  285. }
  286. , error: function () {
  287. //演示失败状态,并实现重传
  288. var uploadTips = $('#uploadTips');
  289. uploadTips.html('<span style="color: #FF5722; text-align:center">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
  290. uploadTips.find('.demo-reload').on('click', function () {
  291. uploadInst.upload();
  292. });
  293. }
  294. });
  295. });
  296. </script>
  297. @break
  298. @default
  299. @endswitch
  300. @if($hasHr)
  301. <hr>
  302. @endif
  303. @endforeach
  304. @if(!is_null($footBtns))
  305. <hr>
  306. <div style="text-align: right">
  307. @if(in_array('goback',$footBtns))
  308. @if($isAjax)
  309. <button class="layui-btn layui-btn-primary layui-layer-close" style="position:relative;"
  310. type="button">
  311. 取消
  312. </button>
  313. @else
  314. <button class="layui-btn layui-btn-primary layui-layer-close" style="position:relative;"
  315. type="button"
  316. onclick="javascript:history.go(-1);">返回
  317. </button>
  318. @endif
  319. @endif
  320. @if(in_array('save',$footBtns))
  321. <button class="layui-btn" type="submit" lay-submit lay-filter="formBox">保存</button>
  322. @endif
  323. </div>
  324. @endif
  325. </form>
  326. <script>
  327. layui.use(['form', 'laydate', 'table'], function () {
  328. var form = layui.form, table = layui.table;
  329. form.render();
  330. form.on('checkbox', function (data) {
  331. $(data.othis).toggleClass('layui-form-checked');
  332. });
  333. form.on('select(camera_source)', function(data){
  334. var val=data.value;
  335. if(val == 1){
  336. document.getElementById("camera_url").style.display = 'none';
  337. document.getElementById("user_name").style.display = 'block';
  338. document.getElementById("password").style.display = 'block';
  339. document.getElementById("ip").style.display = 'block';
  340. document.getElementById("port").style.display = 'block';
  341. document.getElementById("com_number").style.display = 'block';
  342. document.getElementById("code_stream").style.display = 'block';
  343. document.getElementById("video_recorder").style.display = 'block';
  344. document.getElementById("rtsp").style.display = 'block';
  345. }else if(val == 2){
  346. document.getElementById("camera_url").style.display = 'none';
  347. document.getElementById("user_name").style.display = 'none';
  348. document.getElementById("password").style.display = 'none';
  349. document.getElementById("ip").style.display = 'none';
  350. document.getElementById("port").style.display = 'none';
  351. document.getElementById("com_number").style.display = 'none';
  352. document.getElementById("code_stream").style.display = 'block';
  353. document.getElementById("video_recorder").style.display = 'none';
  354. document.getElementById("rtsp").style.display = 'none';
  355. }else if(val == 3){
  356. document.getElementById("camera_url").style.display = 'block';
  357. document.getElementById("user_name").style.display = 'none';
  358. document.getElementById("password").style.display = 'none';
  359. document.getElementById("ip").style.display = 'none';
  360. document.getElementById("port").style.display = 'none';
  361. document.getElementById("com_number").style.display = 'none';
  362. document.getElementById("code_stream").style.display = 'none';
  363. document.getElementById("video_recorder").style.display = 'none';
  364. document.getElementById("rtsp").style.display = 'none';
  365. }
  366. });
  367. form.on('radio(radio)', function(data){
  368. var val=data.value;
  369. if(val == 1){
  370. document.getElementById('rtsp_input').value = 'rtsp://用户名:密码@IP地址:端口/h264/ch通道号/码流类型/av_stream(sub:子码流,main:主码流)';
  371. }
  372. if(val == 2){
  373. document.getElementById('rtsp_input').value = 'rtsp://用户名:密码@IP地址:端口/cam/realmonitor?channel=通道号&subtype=码流类型(0:主码流,1:子码流)';
  374. }
  375. if(val == 3){
  376. document.getElementById('rtsp_input').value = 'rtsp://用户名:密码@IP地址:端口/unicast/c通道号/s码流类型/live(0:主码流,1:子码流)';
  377. }
  378. });
  379. @if($isAjax)
  380. form.on('submit(formBox)', function (data) {
  381. var urlPost = $('#form-unify').attr('action');
  382. var submitBtn = $(data.elem);
  383. submitBtn.addClass('layui-btn-disabled').prop('disabled', true).text('提交中……');
  384. $.ajax({
  385. url: urlPost,
  386. type: 'POST',
  387. dataType: 'json',
  388. data: data.field
  389. })
  390. .done(function (res) {
  391. if (res.code === 0) {
  392. submitBtn.text('完成');
  393. layer.msg('完成!', {anim: 0}, function () {
  394. if (res.data.table === '') {
  395. // location.reload();
  396. var mine_id = document.getElementById('mine_id').value;
  397. var camera_name = document.getElementById('camera_name').value;
  398. var camera_source = document.getElementById('camera_source').value;
  399. var camera_type = document.getElementById('camera_type').value;
  400. document.getElementById('camera_list').innerHTML = '';
  401. $.get('/admin/camera/update',{'mine_id':mine_id,'camera_source':camera_source,'camera_type':camera_type,'camera_name':camera_name},function(str){
  402. if(str.data.length > 0){
  403. for(var i=0;i<str.data.length;i++){
  404. if(str.data[i].is_show == 1){
  405. $('#camera_list').append('<tr><td>'+str.data[i].parent_title+'</td><td>'+str.data[i].title+'</td><td>'+str.data[i].camera_name+'</td><td>'+str.data[i].camera_type+'</td><td>'+str.data[i].camera_source+'</td><td><span class="layui-form"><input type="checkbox" name="is_show" data-href="camera/list/edit?type=show&id='+str.data[i].id+'" lay-skin="switch" lay-text="是|否" checked></span></td><td>'+str.data[i].sort+'</td><td><button class="layui-btn layui-btn-xs layui-btn-normal viewItem" onclick="check_camera('+str.data[i].id+');">查看</button><button class="layui-btn layui-btn-xs editItem" onclick="edit_camera('+str.data[i].id+');">编辑</button><button class="layui-btn layui-btn-xs layui-btn-danger delItem" onclick="del_camera('+str.data[i].id+');">删除</button></td></tr>');
  406. }else{
  407. $('#camera_list').append('<tr><td>'+str.data[i].parent_title+'</td><td>'+str.data[i].title+'</td><td>'+str.data[i].camera_name+'</td><td>'+str.data[i].camera_type+'</td><td>'+str.data[i].camera_source+'</td><td><span class="layui-form"><input type="checkbox" name="is_show" data-href="camera/list/edit?type=show&id='+str.data[i].id+'" lay-skin="switch" lay-text="是|否"></span></td><td>'+str.data[i].sort+'</td><td><button class="layui-btn layui-btn-xs layui-btn-normal viewItem" onclick="check_camera('+str.data[i].id+');">查看</button><button class="layui-btn layui-btn-xs editItem" onclick="edit_camera('+str.data[i].id+');">编辑</button><button class="layui-btn layui-btn-xs layui-btn-danger delItem" onclick="del_camera('+str.data[i].id+');">删除</button></td></tr>');
  408. }
  409. }
  410. layui.form.render();
  411. }else{
  412. $('#camera_list').append('<tr><td colspan="8">暂无数据</td></tr>');
  413. }
  414. //分页
  415. $("#page").paging({
  416. nowPage: 1, // 当前页码
  417. pageNum: str.last_page, // 总页码
  418. buttonNum: 7, //要展示的页码数量
  419. callback: function (num) { //回调函数
  420. $.get('/admin/camera/camerapage',{'page':num,'mine_id':mine_id,'camera_name':camera_name,'camera_source':camera_source,'camera_type':camera_type},function(str){
  421. document.getElementById('camera_list').innerHTML = '';
  422. if(str.data.length > 0){
  423. for(var i=0;i<str.data.length;i++){
  424. if(str.data[i].is_show == 1){
  425. $('#camera_list').append('<tr><td>'+str.data[i].parent_title+'</td><td>'+str.data[i].title+'</td><td>'+str.data[i].camera_name+'</td><td>'+str.data[i].camera_type+'</td><td>'+str.data[i].camera_source+'</td><td><span class="layui-form"><input type="checkbox" name="is_show" data-href="camera/list/edit?type=show&id='+str.data[i].id+'" lay-skin="switch" lay-text="是|否" checked></span></td><td>'+str.data[i].sort+'</td><td><button class="layui-btn layui-btn-xs layui-btn-normal viewItem" onclick="check_camera('+str.data[i].id+');">查看</button><button class="layui-btn layui-btn-xs editItem" onclick="edit_camera('+str.data[i].id+');">编辑</button><button class="layui-btn layui-btn-xs layui-btn-danger delItem" onclick="del_camera('+str.data[i].id+');">删除</button></td></tr>');
  426. }else{
  427. $('#camera_list').append('<tr><td>'+str.data[i].parent_title+'</td><td>'+str.data[i].title+'</td><td>'+str.data[i].camera_name+'</td><td>'+str.data[i].camera_type+'</td><td>'+str.data[i].camera_source+'</td><td><span class="layui-form"><input type="checkbox" name="is_show" data-href="camera/list/edit?type=show&id='+str.data[i].id+'" lay-skin="switch" lay-text="是|否"></span></td><td>'+str.data[i].sort+'</td><td><button class="layui-btn layui-btn-xs layui-btn-normal viewItem" onclick="check_camera('+str.data[i].id+');">查看</button><button class="layui-btn layui-btn-xs editItem" onclick="edit_camera('+str.data[i].id+');">编辑</button><button class="layui-btn layui-btn-xs layui-btn-danger delItem" onclick="del_camera('+str.data[i].id+');">删除</button></td></tr>');
  428. }
  429. }
  430. layui.form.render();
  431. }else{
  432. $('#camera_list').append('<tr><td colspan="8">暂无数据</td></tr>');
  433. }
  434. });
  435. }
  436. });
  437. });
  438. layer.closeAll();
  439. } else {
  440. layer.closeAll();
  441. if (res.data.table !== undefined) {
  442. // table.reload(res.data.table);
  443. }
  444. if (res.url !== undefined) {
  445. location.href = res.url;
  446. }
  447. }
  448. });
  449. } else {
  450. layer.msg(res.message, {anim: 0}, function () {
  451. submitBtn.removeClass('layui-btn-disabled').prop('disabled', false).text('重新保存');
  452. });
  453. }
  454. })
  455. .fail(function (res) {
  456. layer.msg(res.message, {anim: 0}, function () {
  457. submitBtn.removeClass('layui-btn-disabled').prop('disabled', false).text('重新保存');
  458. });
  459. });
  460. return false;
  461. });
  462. @endif
  463. });
  464. $('.layui-form').on('click', '.layui-close', function () {
  465. var self = $(this);
  466. self.closest('.imgItem').remove();
  467. });
  468. $('.layui-form').on('click', '.file-delete', function () {
  469. var self = $(this);
  470. self.closest('tr').remove();
  471. });
  472. // alert(document.getElementById("source_default").value == '');
  473. // alert(document.getElementById("camera_source").value);
  474. //根据摄像头来源显示内容
  475. if(document.getElementById("source_default").value == ''){//硬盘录像机
  476. document.getElementById("camera_url").style.display = 'none';
  477. document.getElementById("user_name").style.display = 'block';
  478. document.getElementById("password").style.display = 'block';
  479. document.getElementById("ip").style.display = 'block';
  480. document.getElementById("port").style.display = 'block';
  481. document.getElementById("com_number").style.display = 'block';
  482. document.getElementById("code_stream").style.display = 'block';
  483. document.getElementById("rtsp").style.display = 'block';
  484. document.getElementById("video_recorder").style.display = 'block';
  485. }
  486. if(document.getElementById("source_default").value == 1){//硬盘录像机
  487. document.getElementById("camera_url").style.display = 'none';
  488. document.getElementById("user_name").style.display = 'block';
  489. document.getElementById("password").style.display = 'block';
  490. document.getElementById("ip").style.display = 'block';
  491. document.getElementById("port").style.display = 'block';
  492. document.getElementById("com_number").style.display = 'block';
  493. document.getElementById("code_stream").style.display = 'block';
  494. document.getElementById("rtsp").style.display = 'block';
  495. document.getElementById("video_recorder").style.display = 'block';
  496. }
  497. if(document.getElementById("source_default").value == 2){//视频服务器
  498. document.getElementById("camera_url").style.display = 'none';
  499. document.getElementById("user_name").style.display = 'none';
  500. document.getElementById("password").style.display = 'none';
  501. document.getElementById("ip").style.display = 'none';
  502. document.getElementById("port").style.display = 'none';
  503. document.getElementById("com_number").style.display = 'none';
  504. document.getElementById("code_stream").style.display = 'block';
  505. document.getElementById("rtsp").style.display = 'none';
  506. document.getElementById("video_recorder").style.display = 'none';
  507. }
  508. if(document.getElementById("source_default").value == 3){//内网摄像头
  509. document.getElementById("camera_url").style.display = 'block';
  510. document.getElementById("user_name").style.display = 'none';
  511. document.getElementById("password").style.display = 'none';
  512. document.getElementById("ip").style.display = 'none';
  513. document.getElementById("port").style.display = 'none';
  514. document.getElementById("com_number").style.display = 'none';
  515. document.getElementById("code_stream").style.display = 'none';
  516. document.getElementById("rtsp").style.display = 'none';
  517. document.getElementById("video_recorder").style.display = 'none';
  518. }
  519. </script>