fd2c21a3c888f6fb047fff97eba97f33.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:80:"D:\phpstudy_pro\WWW\minongyun\public/../application/admin\view\feeding\edit.html";i:1709714141;s:72:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\layout\default.html";i:1709714141;s:69:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\meta.html";i:1709714141;s:71:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\script.html";i:1711415624;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  8. <meta name="renderer" content="webkit">
  9. <meta name="referrer" content="never">
  10. <meta name="robots" content="noindex, nofollow">
  11. <link rel="shortcut icon" href="/assets/img/favicon.ico" />
  12. <!-- Loading Bootstrap -->
  13. <link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  14. <?php if(\think\Config::get('fastadmin.adminskin')): ?>
  15. <link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  16. <?php endif; ?>
  17. <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
  18. <!--[if lt IE 9]>
  19. <script src="/assets/js/html5shiv.js"></script>
  20. <script src="/assets/js/respond.min.js"></script>
  21. <![endif]-->
  22. <script type="text/javascript">
  23. var require = {
  24. config: <?php echo json_encode($config); ?>
  25. };
  26. </script>
  27. </head>
  28. <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
  29. <div id="main" role="main">
  30. <div class="tab-content tab-addtabs">
  31. <div id="content">
  32. <div class="row">
  33. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  34. <section class="content-header hide">
  35. <h1>
  36. <?php echo __('Dashboard'); ?>
  37. <small><?php echo __('Control panel'); ?></small>
  38. </h1>
  39. </section>
  40. <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
  41. <!-- RIBBON -->
  42. <div id="ribbon">
  43. <ol class="breadcrumb pull-left">
  44. <?php if($auth->check('dashboard')): ?>
  45. <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
  46. <?php endif; ?>
  47. </ol>
  48. <ol class="breadcrumb pull-right">
  49. <?php foreach($breadcrumb as $vo): ?>
  50. <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
  51. <?php endforeach; ?>
  52. </ol>
  53. </div>
  54. <!-- END RIBBON -->
  55. <?php endif; ?>
  56. <div class="content">
  57. <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
  58. <div class="form-group" style="display: none">
  59. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Bach'); ?>:</label>
  60. <div class="col-xs-12 col-sm-8">
  61. <input id="c-bach" data-rule="required" class="form-control" name="row[bach]" type="text" value="<?php echo htmlentities($row['bach']); ?>">
  62. </div>
  63. </div>
  64. <div class="form-group" style="display: none">
  65. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Material'); ?>:</label>
  66. <div class="col-xs-12 col-sm-8">
  67. <input id="c-material" data-rule="required" class="form-control" name="row[material]" type="text" value="<?php echo htmlentities($row['material']); ?>">
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Weight'); ?>:</label>
  72. <div class="col-xs-12 col-sm-8">
  73. <input id="c-weight" data-rule="required" class="form-control" name="row[weight]" type="text" value="<?php echo htmlentities($row['weight']); ?>">
  74. </div>
  75. </div>
  76. <div class="form-group" style="display: none">
  77. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Gy_num'); ?>:</label>
  78. <div class="col-xs-12 col-sm-8">
  79. <input id="c-gy_num" data-rule="required" class="form-control" name="row[gy_num]" type="number" value="<?php echo htmlentities($row['gy_num']); ?>">
  80. </div>
  81. </div>
  82. <div class="form-group" style="display: none">
  83. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Date'); ?>:</label>
  84. <div class="col-xs-12 col-sm-8">
  85. <input id="c-date" data-rule="required" class="form-control" name="row[date]" type="text" value="<?php echo htmlentities($row['date']); ?>">
  86. </div>
  87. </div>
  88. <div class="form-group" style="display: none">
  89. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Operator'); ?>:</label>
  90. <div class="col-xs-12 col-sm-8">
  91. <input id="c-operator" data-rule="required" class="form-control" name="row[operator]" type="text" value="<?php echo htmlentities($row['operator']); ?>">
  92. </div>
  93. </div>
  94. <div class="form-group" style="display: none">
  95. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Inspector'); ?>:</label>
  96. <div class="col-xs-12 col-sm-8">
  97. <input id="c-inspector" data-rule="required" class="form-control" name="row[inspector]" type="text" value="<?php echo htmlentities($row['inspector']); ?>">
  98. </div>
  99. </div>
  100. <div class="form-group" style="display: none">
  101. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Tid'); ?>:</label>
  102. <div class="col-xs-12 col-sm-8">
  103. <input id="c-tid" class="form-control" name="row[tid]" type="number" value="<?php echo htmlentities($row['tid']); ?>">
  104. </div>
  105. </div>
  106. <div class="form-group" style="display: none">
  107. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Nweight'); ?>:</label>
  108. <div class="col-xs-12 col-sm-8">
  109. <input id="c-nweight" data-rule="required" class="form-control" name="row[nweight]" type="text" value="<?php echo htmlentities($row['nweight']); ?>">
  110. </div>
  111. </div>
  112. <div class="form-group layer-footer">
  113. <label class="control-label col-xs-12 col-sm-2"></label>
  114. <div class="col-xs-12 col-sm-8">
  115. <button type="submit" class="btn btn-primary btn-embossed disabled"><?php echo __('OK'); ?></button>
  116. <button type="reset" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>
  117. </div>
  118. </div>
  119. </form>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
  127. <input type="hidden" value="<?php echo \think\Session::get('admin.username'); ?>" name="" id="username">
  128. <input type="hidden" value="<?php echo \think\Session::get('admin.company'); ?>" name="" id="company">
  129. <script>
  130. function watermark(element, config) {
  131. // 获取元素的坐标
  132. function getOffset(el) {
  133. if (el.offsetParent) {
  134. return {
  135. x: el.offsetLeft + getOffset(el.offsetParent).x,
  136. y: el.offsetTop + getOffset(el.offsetParent).y,
  137. };
  138. }
  139. return {
  140. x: el.offsetLeft,
  141. y: el.offsetTop,
  142. };
  143. }
  144. if (!element) return;
  145. // 默认配置
  146. const _config = {
  147. text1: '张三', //文本1
  148. text2: '13868686868', // 文本2
  149. start_x: 0, // x轴起始位置
  150. start_y: 0, // y轴起始位置
  151. space_x: 100, // x轴间距
  152. space_y: 50, // y轴间距
  153. width: 210, // 宽度
  154. height: 80, // 长度
  155. fontSize: 14, // 字体
  156. color: '#aaa', // 字色
  157. alpha: 0.4, // 透明度
  158. rotate: 15, // 倾斜度
  159. };
  160. // 替换默认配置
  161. if (arguments.length === 2 && typeof arguments[1] === "object") {
  162. const src = arguments[1] || {};
  163. for (let key in src) {
  164. if (src[key] && _config[key] && src[key] === _config[key]) {
  165. continue;
  166. } else if (src[key]) {
  167. _config[key] = src[key];
  168. }
  169. }
  170. }
  171. // 节点的总宽度
  172. const total_width = element.scrollWidth;
  173. // 节点的总高度
  174. const total_height = element.scrollHeight;
  175. // 创建文本碎片,用于包含所有的插入节点
  176. const mark = document.createDocumentFragment();
  177. // 水印节点的起始坐标
  178. const position = getOffset(element);
  179. let x = position.x + _config.start_x, y = position.y + _config.start_y;
  180. // 先循环y轴插入水印
  181. do {
  182. // 再循环x轴插入水印
  183. do {
  184. // 创建单个水印节点
  185. const item = document.createElement('div');
  186. item.className = 'watermark-item';
  187. // 设置节点的样式
  188. item.style.position = "absolute";
  189. item.style.zIndex = 99999;
  190. item.style.left = `${x}px`;
  191. item.style.top = `${y}px`;
  192. item.style.width = `${_config.width}px`;
  193. item.style.height = `${_config.height}px`;
  194. item.style.fontSize = `${_config.fontSize}px`;
  195. item.style.color = _config.color;
  196. item.style.textAlign = 'center';
  197. item.style.opacity = _config.alpha;
  198. item.style.filter = `alpha(opacity=${_config.alpha * 100})`;
  199. // item.style.filter = `opacity(${_config.alpha * 100}%)`;
  200. item.style.webkitTransform = `rotate(-${_config.rotate}deg)`;
  201. item.style.MozTransform = `rotate(-${_config.rotate}deg)`;
  202. item.style.msTransform = `rotate(-${_config.rotate}deg)`;
  203. item.style.OTransform = `rotate(-${_config.rotate}deg)`;
  204. item.style.transform = `rotate(-${_config.rotate}deg)`;
  205. item.style.pointerEvents = 'none'; //让水印不遮挡页面的点击事件
  206. // 创建text1水印节点
  207. const text1 = document.createElement('div');
  208. text1.appendChild(document.createTextNode(_config.text1));
  209. item.append(text1);
  210. // 创建text2水印节点
  211. const text2 = document.createElement('div');
  212. text2.appendChild(document.createTextNode(_config.text2));
  213. item.append(text2);
  214. // 添加水印节点到文本碎片
  215. mark.append(item);
  216. // x坐标递增
  217. x = x + _config.width + _config.space_x;
  218. // 超出文本右侧坐标停止插入
  219. } while (total_width + position.x > x + _config.width);
  220. // 重置x初始坐标
  221. x = position.x + _config.start_x;
  222. // y坐标递增
  223. y = y + _config.height + _config.space_y;
  224. // 超出文本底部坐标停止插入
  225. } while (total_height + position.y > y + _config.height);
  226. // 插入文档碎片
  227. element.append(mark);
  228. }
  229. var username = document.getElementById('username');
  230. var company = document.getElementById('company');
  231. //找到存放水印的盒子
  232. const element = document.getElementsByTagName('body')[0];
  233. watermark(element,{text1:username.value,text2:company.value});
  234. </script>
  235. </body>
  236. </html>