浏览代码

美化质量经验库

李士越 1 年之前
父节点
当前提交
747289f728

+ 1 - 1
wwwroot/mes/pc/intelligence/Richtext.ashx

@@ -28,7 +28,7 @@ public class Richtext : IHttpHandler, IReadOnlySessionState
             context.Request.Files[0].SaveAs(diskFileName);
             Dictionary<string, object> result = new Dictionary<string, object>();
             result.Add("errno", 0);
-            result.Add("data", new Dictionary<string, string>() { {"url","http://172.18.32.31:9000/"+fileName }  });
+            result.Add("data", new Dictionary<string, string>() { {"url","http://172.18.32.32:9000/"+fileName }  });
             context.Response.Write(JsonConvert.SerializeObject(result, Formatting.Indented));
         }
         //获取产品型号

+ 59 - 66
wwwroot/mes/pc/intelligence/Richtext.html

@@ -6,23 +6,18 @@
     <meta name="description" content="制造企业生产过程执行管理系统">
     <meta name="author" content="xuwei">
     <title>东科软件</title>
-    <link rel="stylesheet" type="text/css" href="/plugins/easyui/themes/dongke/easyui.css">
-    <link rel="stylesheet" type="text/css" href="/plugins/easyui/themes/icon.css">
-    <link rel="stylesheet" type="text/css" href="/plugins/xeasyui/xuwell.css">
-    <script type="text/javascript" src="/plugins/easyui/jquery.min.js"></script>
-    <script type="text/javascript" src="/plugins/easyui/jquery.easyui.min.js"></script>
-    <script type="text/javascript" src="/plugins/easyui/locale/easyui-lang-zh_CN.js"></script> 
     <link rel="shortcut icon" href="/img/logo.png" />
     <link rel="bookmark" href="/img/logo.png" />
     <link rel="stylesheet" type="text/css" href="/plugins/easyui/themes/dongke/easyui.css">
     <link rel="stylesheet" type="text/css" href="/plugins/easyui/themes/icon.css">
     <link rel="stylesheet" type="text/css" href="/plugins/xeasyui/xuwell.css">
+    <script type="text/javascript" src="/plugins/easyui/jquery.min.js"></script>
     <script type="text/javascript" src="/plugins/easyui/jquery.easyui.min.js"></script>
     <script type="text/javascript" src="/plugins/easyui/locale/easyui-lang-zh_CN.js"></script>
-    <script type="text/javascript" src="/plugins/xeasyui/xuwell.js"></script>
-    <link href="/plugins/xeasyui/toolbar.min.css" rel="stylesheet" /> 
+    <script type="text/javascript" src="/plugins/xeasyui/xuwell.js"></script> 
+    <link href="/plugins/xeasyui/toolbar.min.css" rel="stylesheet" />
     <link href="https://unpkg.com/@wangeditor/editor@latest/dist/css/style.css" rel="stylesheet">
-    <style> 
+    <style>
         .ddd {
             padding-top: 10px;
             margin: 0 20px;
@@ -30,25 +25,27 @@
         }
 
         .inp {
-            width: 100%;
+            width:90.5%;
             height: 32px;
             position: relative;
             /* 设置边框样式,以便更容易看到圆角效果 */
-            border: 2px solid #ccc;
+           /* border: 2px solid #ccc;*/
+            border:0;
             /* 设置圆角半径 */
-            border-radius: 10px; /* 你可以根据需要调整这个值 */
+          /*  border-radius: 10px; */
         }
 
         select {
-            width: 100%;
+            width: 80%;
             height: 32px;
             position: relative;
             background-color: #444;
             color: #fff;
             /* 设置边框样式,以便更容易看到圆角效果 */
-            border: 2px solid #ccc;
+            /* border: 2px solid #ccc;*/
+            border: 0;
             /* 设置圆角半径 */
-            border-radius: 10px; /* 你可以根据需要调整这个值 */
+          /*  border-radius: 10px; */
         }
 
         .bbb {
@@ -65,12 +62,13 @@
             justify-content: space-between; /* 可选,用于在元素之间添加空间,但在这个例子中可能不是必需的 */
             width: 100%; /* 确保 .top 容器占据其父容器的全部宽度 */
         }
+
         #editor—wrapper {
             border: 1px solid #ccc;
             z-index: 100; /* 按需定义 */
-            height:100%;
-            width:99%;
-            margin:auto;
+            height: 100%;
+           /*  width: 90%;*/
+            margin: 0 20px;
         }
 
         #toolbar-container {
@@ -78,33 +76,33 @@
         }
 
         #editor-container {
-            height: 100%; 
-        } 
+            height: 100%;
+        }
     </style>
 </head>
 <body class="easyui-layout">
     <div id="toolbarLayout" data-options="border:false,region:'north',title:'',iconCls:'icon-grid'">
         <div style="min-height: 100vh; ">
-            <div>
+            <div id="tbSearchDiv">
                 <div class="top">
-                    <div class="ddd" style=" flex: 1;">
-                        <span>产品名称:<input id="input_name" class="inp" type="text"></span>
+                    <div class="ddd" style=" flex: 1;margin-right:0;">
+                        产品名称:<input id="input_name" style=" width: 80%;" class="inp" type="text">
                     </div>
-                    <div class="ddd" style=" flex: 1;">
-                        <span>产品型号:</span>
+                    <div class="ddd" style=" flex: 1;margin-left:0;">
+                        产品型号:
                         <select id="modelSelect">
                             <option disabled selected value="">请选择型号</option>
                         </select>
                     </div>
                 </div>
                 <div class="ddd">
-                    <span>参与人员:<input id="input_participants" class="inp" type="text"> </span>
+                    参与人员:<input id="input_participants" class="inp" type="text">
                 </div>
                 <div class="ddd">
-                    <span>解决方式:<input id="input_solution" class="inp" type="text"> </span>
+                    解决方式:<input id="input_solution" class="inp" type="text">
                 </div>
                 <div class="ddd">
-                    <span>解决效果:<input id="input_solutioneffect" class="inp" type="text"> </span>
+                    解决效果:<input id="input_solutioneffect" class="inp" type="text">
                 </div>
                 <form enctype="multipart/form-data">
                     <div id="presetFileName" class="ddd">
@@ -112,25 +110,25 @@
                         <button type="button" class="ddd" style="padding-top:0; " onclick="deletefile()">删除</button>
                         <button type="button" class="ddd" style="padding-top:0; " onclick="downfile()">下载已上传文件</button>
                     </div>
-                   
+
                     <div id="isopen" class="ddd">
-                        上传附件:
-                        <input id="ff" type="file" style=" font-size: 20px" data-options="required:true,prompt:'',tipPosition:'bottom',buttonText:'选择文件',buttonAlign:'right',accept='*/*'">
-                        <button type="button" class="ddd" style="padding-top:0; " onclick="submitForm()">导入</button>
-                        <span style="color:red">上传附件后请点击导入按钮否则不会上传至服务器</span>
+                        上传附件:
+                        <input id="ff" type="file" style="font-size: 20px; " data-options="required:true,prompt:'',tipPosition:'bottom',buttonText:'选择文件',buttonAlign:'right',accept='*/*'">
+                         
                     </div>
                 </form>
-            </div>
-            <div style=" padding-top:10px">
-                <span class="ddd">问题: </span>
-                <div id="editor—wrapper">
-                    <div id="toolbar-container"><!-- 工具栏 --></div>
-                    <div id="editor-container"><!-- 编辑器 --></div>
-                    <div id="editor-text-area" class="editor-text-area"></div>
+
+                <div style=" padding-top: 10px; display: flex; align-items: center;" class="ddd">
+                    问题:
+                    <div id="editor—wrapper" style="flex:10"> 
+                        <div id="toolbar-container"><!-- 工具栏 --></div>
+                        <div id="editor-container"><!-- 编辑器 --></div>
+                        <div id="editor-text-area" class="editor-text-area"></div>
+                    </div>
+                </div>
+                <div class="ddd" style="text-align:center">
+                    <button type="button" class="ddd" style="padding-top: 0; margin:0 auto" onclick="add()">提交/修改</button>
                 </div>
-            </div>
-            <div class="ddd" >
-                <button type="button" class="ddd" style="padding-top: 0; " onclick="add()">提交/修改</button>
             </div>
         </div>
     </div> 
@@ -233,7 +231,15 @@
             const key = this.id.replace('input_', '');;
             addsb[key] = $(this).val(); 
         });
-        
+        /**上传文件子服务器*/
+        document.getElementById('ff').addEventListener('change', function (event) {
+            // 检查是否有文件被选中
+            if (event.target.files.length > 0) {
+                // 调用自定义的 submitForm 方法
+                submitForm();
+            }
+        });
+
         /** 添加/修改按钮  */
         const add = async() => {
             if (addsb.name == '') {
@@ -283,38 +289,25 @@
                         if (responseData.errno === 0) {
                             /**设置addsb.annex为响应中的url  */
                             addsb.annex = responseData.data.url;
-                            messager(true);
-                            $.messager.alert("上传附件", "上传成功");
+                           // messager(true);
+                            $.messager.alert("上传附件", "附件上传至服务器成功");
                         } else {
                             console.error('请求成功但发生错误', responseData.errno);
-                            messager(false);
-                            $.messager.alert("上传附件", "上传失败");
+                           // messager(false);
+                            $.messager.alert("上传附件", "附件上传至服务器失败");
                         }
                     } catch (e) {
                         console.error('解析JSON失败', e);
-                        messager(false);
-                        $.messager.alert("上传附件", "上传失败");
+                        //messager(false);
+                        $.messager.alert("上传附件", "附件上传至服务器失败");
                     }
                 } else {
                     console.error('请求失败', xhr.status);
-                    messager(false);
-                    $.messager.alert("上传附件", "上传失败");
+                   // messager(false);
+                    $.messager.alert("上传附件", "附件上传至服务器失败");
                 }
             }
-        };
-        /**消息提示*/
-        const messager = (type) => {
-            $.messager.show({
-                title: type ? '上传成功' :"上传失败",
-                msg: type ?'文件成功上传至服务器':'文件上传服务器失败',
-                showType: 'slide', 
-                style: {
-                    right: '',
-                    top: document.body.scrollTop + document.documentElement.scrollTop,
-                    bottom: '' 
-                }
-            });
-        }
+        }; 
         /** 获取产品型号 */
         const getproductmodel = () => {
             $.get("Richtext.ashx?m=getproductmodel", function (data) {

+ 23 - 18
wwwroot/mes/pc/intelligence/intelligence.html

@@ -42,8 +42,7 @@
                     时间:
                     <input id="opentime" type="text" class="easyui-datebox" style="width:165px; height:32px;">
                     -
-                    <input id="closetime" type="text" class="easyui-datebox" style="width:165px; height:32px;">
-
+                    <input id="closetime" type="text" class="easyui-datebox" style="width:165px; height:32px;"> 
                 </div>
                 <div style="padding-top:10px;">
                     项目名称:
@@ -64,17 +63,17 @@
                 <table id="myTable"  class="easyui-datagrid" data-options="method:'get',border:false,fit:true,fitColumns:true">
                     <thead>
                         <tr>
-                            <th data-options="field:'id',title:'id',align:'center',sortable:true,checkbox:true,hidden:true"></th>
-                            <th data-options="field:'name',title:'项目名称',align:'center',sortable:true"></th>
-                            <th data-options="field:'modelid',title:'产品ID',align:'center',sortable:true,hidden:true"></th>
-                            <th data-options="field:'modelname',title:'产品编码',align:'center',sortable:true"></th>
-                            <th data-options="field:'participants',title:'参与人员',align:'center',sortable:true"></th>
-                            <th data-options="field:'problem',title:'问题',align:'center',sortable:true"></th>
-                            <th data-options="field:'solution',title:'解决方式',align:'center',sortable:true"></th>
-                            <th data-options="field:'solutioneffect',title:'解决效果',align:'center',sortable:true"></th> 
-                            <th data-options="field:'showannex',title:'项目相关资料',align:'center',sortable:true"></th>
-                            <th data-options="field:'createtime',title:'创建时间',align:'center',sortable:true"></th>
-                            <th data-options="field:'username',title:'创建人',align:'center',sortable:true"></th>
+                            <th data-options="field:'id',title:'id',align:'center',sortable:false,checkbox:true,hidden:true"></th>
+                            <th data-options="field:'name',title:'项目名称',align:'center',sortable:false"></th>
+                            <th data-options="field:'modelid',title:'产品ID',align:'center',sortable:false,hidden:true"></th>
+                            <th data-options="field:'modelname',title:'产品编码',align:'center',sortable:false"></th>
+                            <th data-options="field:'participants',title:'参与人员',align:'center',sortable:false"></th>
+                            <th data-options="field:'problem',title:'问题',align:'center',sortable:false"></th>
+                            <th data-options="field:'solution',title:'解决方式',align:'center',sortable:false"></th>
+                            <th data-options="field:'solutioneffect',title:'解决效果',align:'center',sortable:false"></th> 
+                            <th data-options="field:'showannex',title:'项目相关资料',align:'center',sortable:false"></th>
+                            <th data-options="field:'createtime',title:'创建时间',align:'center',sortable:false"></th>
+                            <th data-options="field:'username',title:'创建人',align:'center',sortable:false"></th>
                         </tr>
                     </thead> 
                 </table>
@@ -82,6 +81,8 @@
         </div>
     </div>
     <script>
+        var width = 1280;
+        var height = 720;
         /**加载前调用*/
         $(document).ready(function () {
             getcontent();
@@ -119,8 +120,10 @@
         const jump = () => { 
             $('#myTable').datagridDialog({
                 title: '编辑数据',
-                width: window.screen.width - 100,
-                height: window.screen.height - 200,
+                //width: window.screen.width - 100,
+                //height: window.screen.height - 200,
+                width: width,
+                height: height,
                 url: 'Richtext.html'
             });
         };
@@ -128,7 +131,7 @@
         const getcontent = () => {
             $.get("/mes/pc/intelligence/Richtext.ashx?m=get", function (data) {
                 /**填充表格*/
-                toshow(data);
+                toshow(data); 
             })
         };
         /**刷新 */
@@ -212,8 +215,10 @@
             var selectedRow = $('#myTable').datagrid('getSelected');
             $('#myTable').datagridDialog({
                 title: '编辑数据',
-                width: window.screen.width - 100,
-                height: window.screen.height - 200,
+                //width: window.screen.width - 100,
+                //height: window.screen.height - 200,
+                width: width,
+                height: height,
                 url: 'Richtext.html?id=' + selectedRow.id
             });
         }