b0b2babc436ed52fa5b8c78706d49d48.php 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <?php /*a:2:{s:67:"D:\phpstudy_pro\WWW\caiping\app\admin\view\project\contact\add.html";i:1723541257;s:59:"D:\phpstudy_pro\WWW\caiping\app\admin\view\common\base.html";i:1723541257;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="360-site-verification" content="a7c876fae8b6e3175a52ea9f19543f51" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
  10. <script src="/static/dist/xm-select.js"></script>
  11. <link rel="mobile-prefetch" href=""/>
  12. <title><?php echo get_system_config('web','admin_title'); ?></title>
  13. <meta name="keywords" content="<?php echo get_system_config('web','keywords'); ?>"/>
  14. <meta name="description" content="<?php echo get_system_config('web','desc'); ?>"/>
  15. <link rel="stylesheet" href="/static/assets/gougu/css/gougu.css?v=<?php echo get_system_config('web','version'); ?>" media="all">
  16. <style>
  17. .footer{
  18. display: none;
  19. }
  20. #fileBox li{
  21. display: flex;
  22. flex-wrap: wrap;
  23. flex-direction: column;
  24. }
  25. .layui-table th{
  26. text-align: center !important;
  27. font-weight: 500;
  28. }
  29. .layui-anim dd{
  30. text-align: left;
  31. }
  32. .layui-th-gray{
  33. background-color: rgb(241, 241, 241);
  34. }
  35. .layui-table th{
  36. border-color: #e2e2e2
  37. }
  38. .fujian p{
  39. margin: 3px 0 5px 0;
  40. width: 11vw;
  41. overflow: hidden;
  42. text-overflow: ellipsis;
  43. text-align: center;
  44. }
  45. .fujian{
  46. width: auto;
  47. overflow: auto;
  48. justify-content:flex-start;
  49. align-content: space-between;
  50. flex-direction: column-reverse;
  51. flex-wrap: wrap;
  52. display: flex;
  53. }
  54. .fujian li{
  55. padding: 0.5vw 0.8vw 0.5vw 0.8vw;
  56. white-space: nowrap;
  57. overflow: hidden;
  58. text-overflow: ellipsis;
  59. /*display: inline-block;*/
  60. border-right: 1px solid #e2e2e2;
  61. float: left;
  62. }
  63. .layui-btn-group{
  64. display: flex;
  65. justify-content: center;
  66. }
  67. </style>
  68. </head>
  69. <body class="main-body">
  70. <!-- 主体 -->
  71. <form class="layui-form p-4">
  72. <h3 class="pb-3">新建联系函</h3>
  73. <table class="layui-table layui-table-form">
  74. <tr>
  75. <th class="layui-th-gray-2" style="background-color: rgb(241, 241, 241);">联系函名称 <font style="color: red !important;">*</font></th>
  76. <th colspan="8">
  77. <input type="text" name="title" lay-verify="required" lay-reqText="请输入联系函名称"
  78. placeholder="请输入联系函名称" class="layui-input" value="">
  79. </th>
  80. </tr>
  81. <tr>
  82. <th class="layui-th-gray" style="vertical-align:top;">联系函内容 <font style="color: red !important;">*</font></th>
  83. <th colspan="8">
  84. <textarea name="content" placeholder="请输入内容" class="layui-textarea" id="container_content"
  85. style="border:0;padding:0"></textarea>
  86. </th>
  87. </tr>
  88. </table>
  89. <div class="pt-3">
  90. <input type="hidden" name="id" value=""/>
  91. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  92. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  93. </div>
  94. </form>
  95. <div class="layui-card border-y">
  96. <div class="layui-card-header" style="height:45px;border-color: #e2e2e2">
  97. <div class="layui-row">
  98. <div class="layui-col-md6">
  99. <strong>联系函附件</strong>
  100. </div>
  101. <div class="layui-col-md6" style="text-align:right">
  102. <button type="button" class="layui-btn layui-btn-danger layui-btn-sm" id="uploadBtn">上传附件</button>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="layui-row p-2 fujian" id="fileBox">
  107. <div class="layui-data-none">暂无附件</div>
  108. </div>
  109. </div>
  110. <!-- /主体 -->
  111. <!-- 底部 -->
  112. <div class="footer">
  113. 逸管工程项目管理系统 © www.yiguanfep.com
  114. <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
  115. <a href="https://beian.mps.gov.cn/#/query/websearch?code=45030202000160 " rel="\&quot;noreferrer'target=\”blank\&quot;" onclick="window.open(this.href); return false;">桂公网安备45030202000160号</a>
  116. <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
  117. </div>
  118. <!-- /底部 -->
  119. <!-- 脚本 -->
  120. <script>
  121. const moduleInit = ['tool', 'tagpicker', 'tinymce', 'oaTool'];
  122. function gouguInit() {
  123. var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
  124. var file_id = null;
  125. //编辑器初始化
  126. var editor = layui.tinymce;
  127. var edit = editor.render({
  128. selector: "#container_content",
  129. height: 500
  130. });
  131. let a = 1;
  132. //监听提交
  133. form.on('submit(webform)', function (data) {
  134. data.field.content = tinyMCE.editors['container_content'].getContent();
  135. if (data.field.content == '') {
  136. layer.msg('<span style="color: white">请先完善文章内容</span>');
  137. return false;
  138. }
  139. if(a){
  140. let callback = function (e) {
  141. parent.layui.contactTable.reload();
  142. layer.msg(e.msg);
  143. if (e.code == 0) {
  144. tool.tabRefresh(71);
  145. tool.sideClose(1000);
  146. a = 1
  147. }
  148. }
  149. data.field.file = file_id;
  150. data.field.project_id = '<?php echo htmlentities($project_id); ?>';
  151. tool.post("/admin/project.contact/add", data.field, callback);
  152. }
  153. a = 0
  154. return false;
  155. });
  156. function fileCard(item){
  157. var host = window.location.host;
  158. var li = '';
  159. if(item.length>0){
  160. for(var a=0;a<item.length;a++){
  161. let image = ['jpg','jpeg','png','gif'];
  162. let doc = ['doc','docx','xls','xlsx','ppt','pptx','txt','pdf','zip','rar','7z'];
  163. // let down = '<a href="'+item[a].filepath+'" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal" download="'+item[a].name+'">下载</a>';
  164. let down ='<a href="' + item[a]['filepath'] + '" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal" download="' + item[a]['name'] + '">预览</a>';
  165. // 判断元素是否在数组中
  166. let path='/static/home/images/icon/file.png';
  167. if (image.includes(item[a].fileext)) {
  168. path=item[a].filepath;
  169. down = '<span data-href="'+item[a].filepath+'" class="layui-btn layui-btn-xs layui-btn-normal file-view-img">预览</span>';
  170. } else if (doc.includes(item[a].fileext)){
  171. path='/static/home/images/icon/'+item[a].fileext+'.png';
  172. }
  173. if(item[a].fileext == 'pdf'){
  174. down = '<span data-href="'+item[a].filepath+'" class="layui-btn layui-btn-xs layui-btn-normal file-view-pdf">预览</span>';
  175. }
  176. li += '<li id="'+item[a].id+'" data-id="'+item[a].id+'" data-title="'+item[a].name+'" data-ext="'+item[a].fileext+'"><img src="'+path+'" alt="'+item[a].filename+
  177. '" style="object-fit: contain;" class="file-item"><p title="'+item[a].name+'">'+item[a].name+
  178. '</p><div class="layui-btn-group">'+ down +
  179. '<span class="layui-btn layui-btn-xs layui-btn-danger file-del">删除</span></div></li>';
  180. }
  181. return li;
  182. }
  183. }
  184. var emptyCard = ' <div class="layui-data-none">暂无附件</div>'
  185. $('#fileBox').on('click','.file-del',function(){
  186. layer.confirm('确定要删除该文件吗?', { icon: 3, title: '提示' }, function (index) {
  187. layer.closeAll();
  188. $('#' + file_id).remove();
  189. $("#fileBox").html(emptyCard);
  190. file_id = null;
  191. });
  192. })
  193. oaTool.addFile({
  194. type: 1,
  195. isSave: true,
  196. ajaxDelete: function (file_id) {
  197. var emptyCard = ' <div class="layui-data-none">暂无附件</div>'
  198. if (e.code == 0) {
  199. $('#fileItem' + file_id).remove();
  200. $("#fileBox").html(emptyCard);
  201. file_id = null;
  202. }
  203. },
  204. ajaxSave: function (res) {
  205. let callback = function (e) {
  206. layer.msg('上传成功');
  207. $("#fileBox").html(fileCard(e));
  208. file_id = res.data.id
  209. }
  210. tool.post("/admin/project.contact/add_file", {
  211. 'file': res.data.id,
  212. }, callback);
  213. }
  214. });
  215. }
  216. </script>
  217. <!-- /脚本 -->
  218. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  219. <script src="/static/assets/layui/layui.js"></script>
  220. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  221. <script src="/static/assets/gougu/gouguInit.js"></script>
  222. <script src="https://unpkg.com/pinyin-pro"></script>
  223. <script>
  224. var { pinyin } = pinyinPro;
  225. </script>
  226. <!-- 统计代码 -->
  227. <!-- /统计代码 -->
  228. </body>
  229. </html>