7ac66a998e7add8c3e870faa26fead50.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:78:"D:\phpstudy_pro\WWW\minongyun\public/../application/admin\view\task\index.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:1709714141;}*/ ?>
  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. <div class="panel panel-default panel-intro">
  58. <?php echo build_heading(); ?>
  59. <div class="panel-body">
  60. <div id="myTabContent" class="tab-content">
  61. <div class="tab-pane fade active in" id="one">
  62. <div class="widget-body no-padding">
  63. <div id="toolbar" class="toolbar">
  64. <a href="javascript:;" class="btn btn-primary btn-refresh" title="<?php echo __('Refresh'); ?>" ><i class="fa fa-refresh"></i> </a>
  65. <a href="#" class="btn btn-success" id="button" >生成领料单</a>
  66. <!--<a href="javascript:;" class="btn btn-success btn-add <?php echo $auth->check('task/add')?'':'hide'; ?>" title="<?php echo __('Add'); ?>" ><i class="fa fa-plus"></i> <?php echo __('Add'); ?></a>-->
  67. <!-- <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled <?php echo $auth->check('task/edit')?'':'hide'; ?>" title="<?php echo __('Edit'); ?>" ><i class="fa fa-pencil"></i> <?php echo __('Edit'); ?></a>-->
  68. <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled <?php echo $auth->check('task/del')?'':'hide'; ?>" title="<?php echo __('Delete'); ?>" ><i class="fa fa-trash"></i> <?php echo __('Delete'); ?></a>
  69. <div class="dropdown btn-group <?php echo $auth->check('task/multi')?'':'hide'; ?>">
  70. <!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> <?php echo __('More'); ?></a>-->
  71. <ul class="dropdown-menu text-left" role="menu">
  72. <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> <?php echo __('Set to normal'); ?></a></li>
  73. <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> <?php echo __('Set to hidden'); ?></a></li>
  74. </ul>
  75. </div>
  76. </div>
  77. <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
  78. data-operate-edit="<?php echo $auth->check('task/edit'); ?>"
  79. data-operate-del=""
  80. width="100%">
  81. <!-- data-operate-edit="<?php echo $auth->check('task/edit'); ?>"-->
  82. <!-- data-operate-del="<?php echo $auth->check('task/del'); ?>"-->
  83. </table>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <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>
  96. <input type="hidden" value="<?php echo \think\Session::get('admin.username'); ?>" name="" id="username">
  97. <input type="hidden" value="<?php echo \think\Session::get('admin.company'); ?>" name="" id="company">
  98. <script>
  99. function watermark(element, config) {
  100. // 获取元素的坐标
  101. function getOffset(el) {
  102. if (el.offsetParent) {
  103. return {
  104. x: el.offsetLeft + getOffset(el.offsetParent).x,
  105. y: el.offsetTop + getOffset(el.offsetParent).y,
  106. };
  107. }
  108. return {
  109. x: el.offsetLeft,
  110. y: el.offsetTop,
  111. };
  112. }
  113. if (!element) return;
  114. // 默认配置
  115. const _config = {
  116. text1: '张三', //文本1
  117. text2: '13868686868', // 文本2
  118. start_x: 0, // x轴起始位置
  119. start_y: 0, // y轴起始位置
  120. space_x: 100, // x轴间距
  121. space_y: 50, // y轴间距
  122. width: 210, // 宽度
  123. height: 80, // 长度
  124. fontSize: 14, // 字体
  125. color: '#aaa', // 字色
  126. alpha: 0.4, // 透明度
  127. rotate: 15, // 倾斜度
  128. };
  129. // 替换默认配置
  130. if (arguments.length === 2 && typeof arguments[1] === "object") {
  131. const src = arguments[1] || {};
  132. for (let key in src) {
  133. if (src[key] && _config[key] && src[key] === _config[key]) {
  134. continue;
  135. } else if (src[key]) {
  136. _config[key] = src[key];
  137. }
  138. }
  139. }
  140. // 节点的总宽度
  141. const total_width = element.scrollWidth;
  142. // 节点的总高度
  143. const total_height = element.scrollHeight;
  144. // 创建文本碎片,用于包含所有的插入节点
  145. const mark = document.createDocumentFragment();
  146. // 水印节点的起始坐标
  147. const position = getOffset(element);
  148. let x = position.x + _config.start_x, y = position.y + _config.start_y;
  149. // 先循环y轴插入水印
  150. do {
  151. // 再循环x轴插入水印
  152. do {
  153. // 创建单个水印节点
  154. const item = document.createElement('div');
  155. item.className = 'watermark-item';
  156. // 设置节点的样式
  157. item.style.position = "absolute";
  158. item.style.zIndex = 99999;
  159. item.style.left = `${x}px`;
  160. item.style.top = `${y}px`;
  161. item.style.width = `${_config.width}px`;
  162. item.style.height = `${_config.height}px`;
  163. item.style.fontSize = `${_config.fontSize}px`;
  164. item.style.color = _config.color;
  165. item.style.textAlign = 'center';
  166. item.style.opacity = _config.alpha;
  167. item.style.filter = `alpha(opacity=${_config.alpha * 100})`;
  168. // item.style.filter = `opacity(${_config.alpha * 100}%)`;
  169. item.style.webkitTransform = `rotate(-${_config.rotate}deg)`;
  170. item.style.MozTransform = `rotate(-${_config.rotate}deg)`;
  171. item.style.msTransform = `rotate(-${_config.rotate}deg)`;
  172. item.style.OTransform = `rotate(-${_config.rotate}deg)`;
  173. item.style.transform = `rotate(-${_config.rotate}deg)`;
  174. item.style.pointerEvents = 'none'; //让水印不遮挡页面的点击事件
  175. // 创建text1水印节点
  176. const text1 = document.createElement('div');
  177. text1.appendChild(document.createTextNode(_config.text1));
  178. item.append(text1);
  179. // 创建text2水印节点
  180. const text2 = document.createElement('div');
  181. text2.appendChild(document.createTextNode(_config.text2));
  182. item.append(text2);
  183. // 添加水印节点到文本碎片
  184. mark.append(item);
  185. // x坐标递增
  186. x = x + _config.width + _config.space_x;
  187. // 超出文本右侧坐标停止插入
  188. } while (total_width + position.x > x + _config.width);
  189. // 重置x初始坐标
  190. x = position.x + _config.start_x;
  191. // y坐标递增
  192. y = y + _config.height + _config.space_y;
  193. // 超出文本底部坐标停止插入
  194. } while (total_height + position.y > y + _config.height);
  195. // 插入文档碎片
  196. element.append(mark);
  197. }
  198. var username = document.getElementById('username');
  199. var company = document.getElementById('company');
  200. //找到存放水印的盒子
  201. const element = document.getElementsByTagName('body')[0];
  202. watermark(element,{text1:username.value,text2:company.value});
  203. </script>
  204. </body>
  205. </html>