Browse Source

Merge branch 'master' of http://116.63.33.55/git/industry-data-platform into master

lhy 11 months ago
parent
commit
ee3e19fa75
22 changed files with 172 additions and 25 deletions
  1. BIN
      industry-admin/src/assets/images/change.jpg
  2. BIN
      industry-admin/src/assets/images/cqcybg2.jpg
  3. BIN
      industry-admin/src/assets/images/cqcybg2.png
  4. 1 1
      industry-admin/src/components/CommonTable/index.vue
  5. 6 6
      industry-admin/src/views/login/index.vue
  6. 5 0
      industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/entity/UserGroupUser.java
  7. 11 0
      industry-system/industry-da/src/main/java/com/example/opc_da/controller/UserGroupController.java
  8. 1 0
      industry-system/industry-da/src/main/java/com/example/opc_da/dao/UserGroupDao.java
  9. 2 0
      industry-system/industry-da/src/main/java/com/example/opc_da/service/UserGroupService.java
  10. 4 1
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/ReportTableServiceImpl.java
  11. 17 0
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/UserGroupServiceImpl.java
  12. 26 2
      industry-system/industry-da/src/main/java/com/example/opc_da/validate/reportTable/AutomaticReportTableValidate.java
  13. 12 1
      industry-system/industry-da/src/main/resources/mapper/UserGroupDao.xml
  14. 0 0
      industry-system/industry-da/src/main/resources/static/reportSheet/js/Luckysheet-2.1.13/luckysheet.esm.js
  15. 0 0
      industry-system/industry-da/src/main/resources/static/reportSheet/js/Luckysheet-2.1.13/luckysheet.esm.js.map
  16. 1 1
      industry-system/industry-da/src/main/resources/static/reportSheet/js/Luckysheet-2.1.13/luckysheet.umd.js
  17. 0 0
      industry-system/industry-da/src/main/resources/static/reportSheet/js/Luckysheet-2.1.13/luckysheet.umd.js.map
  18. 1 0
      industry-system/industry-da/src/main/resources/static/reportSheet/js/index.js
  19. 19 3
      industry-system/industry-da/src/main/resources/static/reportSheet/js/report-history.js
  20. 17 8
      industry-system/industry-da/src/main/resources/static/reportSheet/js/src/model/item-util.js
  21. 4 2
      industry-system/industry-da/src/main/resources/static/reportSheet/js/src/model/right-menu.js
  22. 45 0
      industry-system/industry-da/src/main/resources/static/reportSheet/js/src/model/sheet-util.js

BIN
industry-admin/src/assets/images/change.jpg


BIN
industry-admin/src/assets/images/cqcybg2.jpg


BIN
industry-admin/src/assets/images/cqcybg2.png


+ 1 - 1
industry-admin/src/components/CommonTable/index.vue

@@ -15,7 +15,7 @@
                 </slot>
                 <slot v-if="(item.type == 'img') && item.formatter">
                   <img v-if="item.formatter(scope.row).imgtype==0" src='@/assets/images/time.png' height="16" width="16" style="margin-bottom: -3px;margin-right: 10px" />
-                  <img v-else-if="item.formatter(scope.row).imgtype==1" src='@/assets/images/change.png' height="16" width="16" style="margin-bottom: -3px;margin-right: 10px" />
+                  <img v-else-if="item.formatter(scope.row).imgtype==1" src='@/assets/images/change.jpg' height="16" width="16" style="margin-bottom: -3px;margin-right: 10px" />
                   <img v-else="item.formatter(scope.row).imgtype==2" src='@/assets/images/cond.png' height="16" width="16" style="margin-bottom: -3px;margin-right: 10px" />
                   <span>{{ item.formatter(scope.row).text }}</span>
                 </slot>

+ 6 - 6
industry-admin/src/views/login/index.vue

@@ -11,7 +11,7 @@
       >
         <div class="title-container">
 <!--          <h3 class="title">工业实时数据可视化管理系统</h3>-->
-          <h3 class="title">工业实时数据报表软件</h3>
+<!--          <h3 class="title">工业实时数据报表软件</h3>-->
         </div>
         <el-form-item prop="userName">
           <span class="svg-container">
@@ -20,7 +20,7 @@
           <el-input
             ref="userName"
             v-model="loginForm.userName"
-            placeholder="用户名"
+            placeholder="用户名"
             name="userName"
             type="text"
             tabindex="1"
@@ -42,7 +42,7 @@
               ref="password"
               v-model="loginForm.password"
               :type="passwordType"
-              placeholder="密码"
+              placeholder="登录口令"
               name="password"
               tabindex="2"
               auto-complete="off"
@@ -254,7 +254,7 @@ export default {
           {
             required: true,
             trigger: ['blur', 'change'],
-            message: '请输入您的用户名',
+            message: '请输入您的用户名',
             pattern: '[^ \x22]+'
           }
         ],
@@ -262,7 +262,7 @@ export default {
           {
             required: true,
             trigger: ['blur', 'change'],
-            message: '请输入您的密码',
+            message: '请输入您的登录口令',
             pattern: '[^ \x22]+'
           }
         ]
@@ -429,7 +429,7 @@ export default {
 </script>
 
 <style lang="scss">
-$imgBg: url("~@/assets/images/cqcybg.png");
+$imgBg: url("~@/assets/images/cqcybg2.jpg");
 $dark_gray: #889aa4;
 
 

+ 5 - 0
industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/entity/UserGroupUser.java

@@ -23,4 +23,9 @@ public class UserGroupUser implements Serializable {
      * 用户id
      */
     private String userId;
+
+    /**
+     * 用户名称
+     */
+    private String userName;
 }

+ 11 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/controller/UserGroupController.java

@@ -93,6 +93,17 @@ public class UserGroupController {
     }
 
     /**
+     * 获取当前登录人,创建的用户组
+     *
+     * @return
+     */
+    @GetMapping("/getAllUserGroupTree")
+    @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.USERGROUP, OperationEnum = OperationEnum.SELECT)
+    public Result getAllUserGroupTree() {
+        return userGroupService.getAllUserGroupTree();
+    }
+
+    /**
      * 分页获取当前登录人,创建的用户组
      *
      * @return

+ 1 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/dao/UserGroupDao.java

@@ -11,6 +11,7 @@ import java.util.List;
 public interface UserGroupDao {
 
     List<UserGroup> getAllUserGroup(String userId);
+    List<UserGroup> getAllUserGroupTree(String userId);
 
     UserGroup getUserGroupById(Integer id);
 

+ 2 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/service/UserGroupService.java

@@ -10,6 +10,8 @@ public interface UserGroupService {
 
     Result getAllUserGroup();
 
+    Result getAllUserGroupTree();
+
     Result getUserGroupPage(Integer page, Integer limit);
 
     Result updateUserGroup(UserGroup userGroup);

+ 4 - 1
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/ReportTableServiceImpl.java

@@ -178,7 +178,10 @@ public class ReportTableServiceImpl implements ReportTableService {
         }
         // 添加报表、策略、点位关系
         addReportTableIdAndPolicyIdAndItemId(resultList);
-        return Result.ok("修改报表模板成功");
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("msg", "修改报表模板成功");
+        jsonObject.put("version", tableTemplate.getVersion());
+        return Result.ok(jsonObject);
     }
 
     @Override

+ 17 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/UserGroupServiceImpl.java

@@ -3,6 +3,7 @@ package com.example.opc_da.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.example.opc_common.entity.Department;
 import com.example.opc_common.entity.ReportTable;
+import com.example.opc_common.entity.User;
 import com.example.opc_common.entity.UserGroup;
 import com.example.opc_common.enums.ResultEnum;
 import com.example.opc_common.util.Blank;
@@ -126,6 +127,22 @@ public class UserGroupServiceImpl implements UserGroupService {
         String userId = userUtil.getCurrentUserId();
         return Result.ok(userGroupDao.getAllUserGroup(userId));
     }
+    @Override
+    public Result getAllUserGroupTree() {
+        String userId = userUtil.getCurrentUserId();
+
+        List<UserGroup> userList = userGroupDao.getAllUserGroupTree(userId);
+        for(UserGroup u :userList){
+
+        }
+
+        //UserGroup userGroup = userGroupDao.getUserGroupById(id);
+        //List<String> userIdList = userGroupDao.getUserGroupUserByGroup(id);
+        //userGroup.setUserIdList(userIdList);
+
+
+        return null;
+    }
 
     @Override
     public Result getUserGroupPage(Integer page, Integer limit) {

+ 26 - 2
industry-system/industry-da/src/main/java/com/example/opc_da/validate/reportTable/AutomaticReportTableValidate.java

@@ -29,7 +29,11 @@ import java.util.stream.Stream;
 @Slf4j
 public abstract class AutomaticReportTableValidate implements ReportTableValidate {
 
-    private static final String timePattern = "yyyy-MM-dd HH:mm:ss.SSS";
+    private static final String timePattern = "yyyy-MM-dd HH:mm:ss.SSS";//秒
+    private static final String timePattern_hour = "yyyy-MM-dd HH:00";//小时
+    private static final String timePattern_min = "yyyy-MM-dd HH:mm";//分
+    private static final String timePattern_day = "yyyy-MM-dd";//日
+    String timePattern_str;
 
     InFluxDBService inFluxDBService = SpringContextUtils.getBean(InFluxDBService.class);
     String bucket = SpringContextUtils.getYamlProperty("influxdb.bucket");
@@ -561,9 +565,29 @@ public abstract class AutomaticReportTableValidate implements ReportTableValidat
                     }
                 }
                 //求出每段应该返回的值
+
+                switch (bucketType){
+                    case 0:
+                        timePattern_str = timePattern;
+                        break;
+                    case 1:
+                        timePattern_str = timePattern_day;
+                        break;
+                    case 2:
+                        timePattern_str = timePattern_hour;
+                        break;
+                    case 3:
+                        timePattern_str = timePattern_min;
+                        break;
+                    case 4:
+                        timePattern_str = timePattern;
+                        break;
+                }
+
                 newItemList.add(new Item()
                         .value(CalculateDataFactory.getCalculateData(valueTakingMode).calculateData(valueList))
-                        .time(sDateTime.format(DateTimeFormatter.ofPattern(timePattern))));
+                        .time(sDateTime.format(DateTimeFormatter.ofPattern(timePattern_str))));
+
                 sDateTime = eDateTime;
 
             }

+ 12 - 1
industry-system/industry-da/src/main/resources/mapper/UserGroupDao.xml

@@ -40,6 +40,13 @@
         where user_id = #{userId} order by sort_num,create_time desc
     </select>
 
+    <select id="getAllUserGroupTree" resultType="com.example.opc_common.entity.UserGroup">
+        select
+        <include refid="userGroup"/>
+        from t_user_group
+        where user_id = #{userId} order by sort_num,create_time desc
+    </select>
+
     <select id="getUserGroupCount" resultType="java.lang.Integer">
         select count(*)
         from t_user_group
@@ -82,11 +89,15 @@
         from t_user_group_user
         where user_group_id = #{userGroupId}
     </select>
+    <select id="getUserGroupUserByGroup" resultType="java.lang.String">
+        select user_id
+        from t_user_group_user
+        where user_group_id = #{userGroupId}
+    </select>
 
     <select id="getUserByGroupId" resultType="com.example.opc_common.entity.User">
         select user_id,
                user_name,
-               PASSWORD,
                user_type,
                create_time,
                last_login_time,

File diff suppressed because it is too large
+ 0 - 0
industry-system/industry-da/src/main/resources/static/reportSheet/js/Luckysheet-2.1.13/luckysheet.esm.js


File diff suppressed because it is too large
+ 0 - 0
industry-system/industry-da/src/main/resources/static/reportSheet/js/Luckysheet-2.1.13/luckysheet.esm.js.map


+ 1 - 1
industry-system/industry-da/src/main/resources/static/reportSheet/js/Luckysheet-2.1.13/luckysheet.umd.js

@@ -22033,7 +22033,7 @@
 				Engineering: "工程计算",
 				Filter: "过滤器",
 				Financial: "财务",
-				luckysheet: "Luckysheet内置",
+				luckysheet: "系统内置",
 				other: "其它",
 				Logical: "逻辑",
 				Lookup: "查找",

File diff suppressed because it is too large
+ 0 - 0
industry-system/industry-da/src/main/resources/static/reportSheet/js/Luckysheet-2.1.13/luckysheet.umd.js.map


+ 1 - 0
industry-system/industry-da/src/main/resources/static/reportSheet/js/index.js

@@ -4,6 +4,7 @@ layui.use(use.index, function() {
 window.onload = function() {
 	window.addEventListener('message', function(e) {
 		const json = e.data;
+		console.log(json);
 		if (json.cmd == 'init') {
 			localStorage.setItem('url', json.data.url)
 			localStorage.setItem('token', json.data.token)

+ 19 - 3
industry-system/industry-da/src/main/resources/static/reportSheet/js/report-history.js

@@ -98,8 +98,6 @@ window.onload = function() {
 				}
 			})
 		} else if(json.cmd=='download'){
-			//console.log('down');
-			console.log(json.data.dtype);
 			const range = luckysheet.getRange()
 			if (range.length > 1) {
 				layer.msg('请选择单个打印区域!', {icon: 2})
@@ -130,7 +128,25 @@ window.onload = function() {
 				data,
 				success: (json) => {
 					let fileName = localStorage.getItem('url') + '/' + json.data;
-					console.log(fileName);
+					console.log(json.data);
+					let url = fileName;
+					let name=json.data.split('/').pop();
+					let xhr = new XMLHttpRequest();
+					xhr.open('get',url,true);
+					xhr.responseType = 'blob';
+					xhr.onreadystatechange = function (){
+						if(xhr.readyState===4 && xhr.status===200){
+							window.URL = window.URL || window.webkitURL;
+							let a = document.createElement('a');
+							let blob = new Blob([xhr.response]);
+							let url = window.URL.createObjectURL(blob);
+							a.href = url;
+							a.download = name;
+							a.click();
+							window.URL.revokeObjectURL(url);
+						}
+					}
+					xhr.send();
 				}
 			})
 		}

+ 17 - 8
industry-system/industry-da/src/main/resources/static/reportSheet/js/src/model/item-util.js

@@ -44,6 +44,7 @@ layui.define(function(exports) {
 			_this.checkReport({
 				row,
 				column,
+				direction: itemForm.valType,
 				error: () => {
 					error()
 				},
@@ -188,7 +189,6 @@ layui.define(function(exports) {
 							
 						}
 					}
-					//console.log(cellsData)
 					luckysheet.setRangeValue(cellsData, {range: {
 						row: [json.r, json.r + cellsData.length - 1],
 						column: [json.c, json.c + cellsData[0].length - 1],
@@ -223,6 +223,7 @@ layui.define(function(exports) {
 			_this.checkReport({
 				row,
 				column,
+				direction: itemForm.valType,
 				error: () => {
 					error()
 				},
@@ -231,7 +232,6 @@ layui.define(function(exports) {
 					const cs = json.cs || 0
 					let cellsData = _this.plugCell(json)
 					let cdata = {}
-					//console.log(json)
 					for (let i = 0; i < row; i++) {
 						let ri = rs > 0 ? (i == 0 ? 0 : i * rs) : i
 						for (let j = 0; j < column; j++) {
@@ -338,7 +338,6 @@ layui.define(function(exports) {
 							
 						}
 					}
-					//console.log(cellsData)
 					luckysheet.setRangeValue(cellsData, {range: {
 						row: [json.r, json.r + cellsData.length - 1],
 						column: [json.c, json.c + cellsData[0].length - 1],
@@ -358,6 +357,7 @@ layui.define(function(exports) {
 			_this.checkReport({
 				row,
 				column,
+				direction: 1,
 				error: () => {
 					error()
 				},
@@ -494,10 +494,18 @@ layui.define(function(exports) {
 						break
 					}
 					if (sheetData[i][j] && sheetData[i][j].m && sheetData[i][j].tableId != layui.itemListTable.data.tableId) {
-						if (rr == -1 && cc == -1) {
-							rr = i
-							cc = j
+						if (i < endRow && j < endColumn) {
+							const ar = endRow - i
+							const ac = endColumn - j
+							
+							if (ar < ac && rr == -1) {
+								rr = ar
+							}
+							if (ac < ar && cc == -1) {
+								cc = ac
+							}
 						}
+						
 						if (sheetData[i][j].tableId) {
 							params.error()
 							return
@@ -510,19 +518,20 @@ layui.define(function(exports) {
 			// 补足差的列数
 			let columnNum = 0
 			if (rr > 0) {
-				rowNum = endRow - rr + 1
+				rowNum = rr
 			} else {
 				if (sheetData.length < endRow) {
 					rowNum = endRow - sheetData.length + 1
 				}
 			}
 			if (cc > 0) {
-				columnNum = endColumn - cc + 1
+				columnNum = cc
 			} else {
 				if (sheetData[0].length < endColumn) {
 					columnNum = endColumn - sheetData[0].length + 1
 				}
 			}
+			
 			if (rowNum > 0) {
 				while(rowNum > 100) {
 					luckysheet.insertRow(position.r, {

+ 4 - 2
industry-system/industry-da/src/main/resources/static/reportSheet/js/src/model/right-menu.js

@@ -29,15 +29,17 @@ layui.define(['layer', 'util', 'jquery', 'form', 'sheetTypew', 'chartRightw', 'i
 					chart: layui.excelUtil.getChartData()
 				}),
 			}
-			console.log(params)
+			//console.log(params)
 			if (layui.sheetTypew.templateReportId > 0) {
 				params.id = layui.sheetTypew.templateReportId
 				params.version = layui.sheetTypew.templateReportVersion
+				console.log(params)
 				layui.api.updateTableTemplate(params).then(json => {
 					if (json.code == 200) {
+						layui.sheetTypew.templateReportVersion = json.data.version;
 						layer.msg('保存报表成功!', {icon: 1})
 					} else {
-						layer.msg(json.msg, {icon: 2})
+						layer.msg(json.data.msg, {icon: 2})
 					}
 				})
 			} else {

+ 45 - 0
industry-system/industry-da/src/main/resources/static/reportSheet/js/src/model/sheet-util.js

@@ -60,6 +60,7 @@ layui.define(function(exports) {
 				move: false,
 				extend: false
 			}
+			let copyRange = null;
 			const $ = layui.jquery
 			const option = $.extend(true, {}, sheetOption)
 			option.container = 'luckysheet'
@@ -70,6 +71,7 @@ layui.define(function(exports) {
 			if (sheetConfig && sheetConfig.data) {
 				option.data = sheetConfig.data
 			}
+
 			option.hook = {
 				cellEditBefore: function(range) {
 					const cell = luckysheet.getCellValue((range[0].row)[0], (range[0].column)[0], {type: 'v'})
@@ -104,6 +106,49 @@ layui.define(function(exports) {
 					}
 					return true
 				},
+				rangeCopyAfter:function(range,data){
+					copyRange = range;
+					let scol = copyRange[0].column[0];
+					let ecol = copyRange[0].column[1];
+					let srow = copyRange[0].row[0];
+					let erow = copyRange[0].row[1];
+					console.log(scol);
+					console.log(srow);
+					console.log(luckysheet.getCellValue(3, 6));
+					for(let i=srow;i<=erow;i++){
+						for(let j=scol;j<=ecol;j++){
+							const cell = luckysheet.getCellValue(i, j);
+							console.log(cell)
+						}
+					}
+				},
+				rangePasteBefore:function(range,data){
+					console.log('rangePasteBefore')
+					console.log(range);
+					console.log(data);
+					let scol = range[0].column[0];
+					let ecol = range[0].column[1];
+					let srow = range[0].row[0];
+					let erow = range[0].row[1];
+					console.log(scol);
+					console.log(srow);
+					console.log(luckysheet.getCellValue(3, 6));
+					for(let i=srow;i<=erow;i++){
+						for(let j=scol;j<=ecol;j++){
+							const cell = luckysheet.getCellValue(i, j);
+							console.log(cell)
+						}
+					}
+				},
+				cellMousedown:function(cell,position,sheet,ctx){
+					//console.log('r='+position.r+','+'c='+position.c);
+					//console.log(position.c);
+					//console.log(cell);
+				},
+				rangePasteAfter:function(range,data){
+					console.log('rangePasteAfter')
+					console.log(data);
+				},
 				sheetMousemove: function(cell, position, sheet, moveState) {
 					if (moveState.cellSelectedMove && !moveJson.move) {
 						moveJson.sr = position.r

Some files were not shown because too many files changed in this diff