From 020b676349e1d490cf272d856f3c938a1b4cfaa8 Mon Sep 17 00:00:00 2001 From: ccongli <1441652193@qq.com> Date: Fri, 27 Oct 2023 12:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=AE=BE=E5=A4=87=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9A=94=E7=A6=BB=E4=B8=9A=E5=8A=A1v4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/Partial/Data_ConfigService.cs | 27 ++++++++++ .../machine/Partial/Data_MachineService.cs | 28 ++++++++++ .../produce/Partial/Data_ProduceService.cs | 27 ++++++++++ vol-net6/VOL.Data/VOL.Data.csproj | 1 + .../config/partial/Data_Config.cs | 8 +++ .../System/Partial/ISys_UserService.cs | 2 + .../System/Partial/Sys_UserService.cs | 26 +++++++++- .../Data/Partial/Data_ProduceController.cs | 3 ++ vol-vue3/src/api/http.js | 2 +- .../src/extension/data/config/Data_Config.js | 52 +++++++++++++------ .../extension/data/machine/Data_Machine.js | 44 ++++++++++------ .../extension/data/produce/Data_Produce.js | 47 +++++++++++------ .../src/views/data/config/Data_Config.vue | 10 ++-- .../src/views/data/machine/Data_Machine.vue | 17 +++--- .../src/views/data/produce/Data_Produce.vue | 8 +-- 15 files changed, 234 insertions(+), 68 deletions(-) diff --git a/vol-net6/VOL.Data/Services/config/Partial/Data_ConfigService.cs b/vol-net6/VOL.Data/Services/config/Partial/Data_ConfigService.cs index 4428e07..057c07f 100644 --- a/vol-net6/VOL.Data/Services/config/Partial/Data_ConfigService.cs +++ b/vol-net6/VOL.Data/Services/config/Partial/Data_ConfigService.cs @@ -17,6 +17,11 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Http; using VOL.Data.IRepositories; +using Microsoft.AspNetCore.Mvc; +using VOL.Core.Enums; +using VOL.Core.Filters; +using VOL.System.Services; +using VOL.System.IServices; namespace VOL.Data.Services { @@ -38,6 +43,28 @@ namespace VOL.Data.Services base.Init(dbRepository); } + // 获取数据分页列表 + [ApiActionPermission(ActionPermissionOptions.Search)] + [HttpPost, Route("GetPageData")] + public override PageGridData GetPageData([FromBody] PageDataOptions loadData) + { + ISys_UserService us = Sys_UserService.Instance; + //查询完成后,在返回页面前可对查询的数据进行操作 + GetPageDataOnExecuted = (PageGridData grid) => + { + //可对查询的结果的数据操作 + List configList = grid.rows; + foreach (Data_Config item in configList) { + Task task = us.GetUserById(item.CreateID); + Sys_User user = task.GetAwaiter().GetResult(); + item.companyName = user.UserTrueName; + item.Creator = user.UserTrueName; + } + }; + return base.GetPageData(loadData); + } + + public List getConfigList() { var list = _repository.DbContext.Set().Select(x => new Data_Config() { id = x.id, name = x.name, type = x.type, device_ip = x.device_ip, com_ip = x.com_ip diff --git a/vol-net6/VOL.Data/Services/machine/Partial/Data_MachineService.cs b/vol-net6/VOL.Data/Services/machine/Partial/Data_MachineService.cs index 3e33b73..7d15868 100644 --- a/vol-net6/VOL.Data/Services/machine/Partial/Data_MachineService.cs +++ b/vol-net6/VOL.Data/Services/machine/Partial/Data_MachineService.cs @@ -26,6 +26,11 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; using VOL.Core.Utilities; +using Microsoft.AspNetCore.Mvc; +using VOL.Core.Enums; +using VOL.Core.Filters; +using VOL.System.IServices; +using VOL.System.Services; namespace VOL.Data.Services { @@ -49,6 +54,29 @@ namespace VOL.Data.Services base.Init(dbRepository); } + // 获取数据分页列表 + [ApiActionPermission(ActionPermissionOptions.Search)] + [HttpPost, Route("GetPageData")] + public override PageGridData GetPageData([FromBody] PageDataOptions loadData) + { + ISys_UserService us = Sys_UserService.Instance; + //查询完成后,在返回页面前可对查询的数据进行操作 + GetPageDataOnExecuted = (PageGridData grid) => + { + //可对查询的结果的数据操作 + List configList = grid.rows; + foreach (Data_Machine item in configList) + { + Task task = us.GetUserById(item.CreateID); + Sys_User user = task.GetAwaiter().GetResult(); + //item.companyName = user.UserTrueName; + item.Creator = user.UserTrueName; + } + }; + return base.GetPageData(loadData); + } + + public Dictionary GetMachineData() { var db = _repository.DbContext.Set(); diff --git a/vol-net6/VOL.Data/Services/produce/Partial/Data_ProduceService.cs b/vol-net6/VOL.Data/Services/produce/Partial/Data_ProduceService.cs index fd3a642..88f6a52 100644 --- a/vol-net6/VOL.Data/Services/produce/Partial/Data_ProduceService.cs +++ b/vol-net6/VOL.Data/Services/produce/Partial/Data_ProduceService.cs @@ -19,6 +19,11 @@ using Microsoft.AspNetCore.Http; using VOL.Data.IRepositories; using VOL.Core.DBManager; using SkiaSharp; +using Microsoft.AspNetCore.Mvc; +using VOL.Core.Enums; +using VOL.Core.Filters; +using VOL.System.IServices; +using VOL.System.Services; namespace VOL.Data.Services { @@ -42,6 +47,28 @@ namespace VOL.Data.Services base.Init(dbRepository); } + // 获取数据分页列表 + [ApiActionPermission(ActionPermissionOptions.Search)] + [HttpPost, Route("GetPageData")] + public override PageGridData GetPageData([FromBody] PageDataOptions loadData) + { + ISys_UserService us = Sys_UserService.Instance; + //查询完成后,在返回页面前可对查询的数据进行操作 + GetPageDataOnExecuted = (PageGridData grid) => + { + //可对查询的结果的数据操作 + List configList = grid.rows; + foreach (Data_Produce item in configList) + { + Task task = us.GetUserById(item.CreateID); + Sys_User user = task.GetAwaiter().GetResult(); + //item.companyName = user.UserTrueName; + item.Creator = user.UserTrueName; + } + }; + return base.GetPageData(loadData); + } + public Data_Produce getLastProduceData(Func query) { //_repository.DbContext.Set().FirstOrDefault(query); diff --git a/vol-net6/VOL.Data/VOL.Data.csproj b/vol-net6/VOL.Data/VOL.Data.csproj index 9dad5eb..eb145a3 100644 --- a/vol-net6/VOL.Data/VOL.Data.csproj +++ b/vol-net6/VOL.Data/VOL.Data.csproj @@ -9,6 +9,7 @@ + diff --git a/vol-net6/VOL.Entity/DomainModels/config/partial/Data_Config.cs b/vol-net6/VOL.Entity/DomainModels/config/partial/Data_Config.cs index 49154bd..3913a68 100644 --- a/vol-net6/VOL.Entity/DomainModels/config/partial/Data_Config.cs +++ b/vol-net6/VOL.Entity/DomainModels/config/partial/Data_Config.cs @@ -33,5 +33,13 @@ namespace VOL.Entity.DomainModels [Editable(true), NotMapped] public short? state { get; set; } + /// + /// 企业名称 + /// + [Display(Name = "企业账号")] + [Column(TypeName = "string")] + [Editable(true), NotMapped] + public string? companyName { get; set; } + } } \ No newline at end of file diff --git a/vol-net6/VOL.System/IServices/System/Partial/ISys_UserService.cs b/vol-net6/VOL.System/IServices/System/Partial/ISys_UserService.cs index f0d9786..1971913 100644 --- a/vol-net6/VOL.System/IServices/System/Partial/ISys_UserService.cs +++ b/vol-net6/VOL.System/IServices/System/Partial/ISys_UserService.cs @@ -12,6 +12,8 @@ namespace VOL.System.IServices Task ReplaceToken(); Task ModifyPwd(string oldPwd, string newPwd); Task GetCurrentUserInfo(); + + Task GetUserById(int? userId); } } diff --git a/vol-net6/VOL.System/Services/System/Partial/Sys_UserService.cs b/vol-net6/VOL.System/Services/System/Partial/Sys_UserService.cs index 6de300e..f3a8e30 100644 --- a/vol-net6/VOL.System/Services/System/Partial/Sys_UserService.cs +++ b/vol-net6/VOL.System/Services/System/Partial/Sys_UserService.cs @@ -66,7 +66,7 @@ namespace VOL.System.Services Role_Id = user.Role_Id }); user.Token = token; - webResponse.Data = new { token, userName = user.UserTrueName, img = user.HeadImageUrl }; + webResponse.Data = new { token, userName = user.UserTrueName, img = user.HeadImageUrl, userId = user.User_Id }; repository.Update(user, x => x.Token, true); UserContext.Current.LogOut(user.User_Id); @@ -218,6 +218,30 @@ namespace VOL.System.Services return webResponse.OK(null, data); } + + /// + /// 个人中心获取当前用户信息 + /// + /// + public async Task GetUserById(int? userId) + { + if (userId == null) return null; + var user = await base.repository + .FindAsIQueryable(x => x.User_Id == userId) + //.Select(s => new // 只查某些字段,返回类型是object + //{ + // s.UserName, + // s.UserTrueName, + // s.Address, + // s.PhoneNo, + // s.Email, + // s.Remark, + //}) + .FirstOrDefaultAsync(); + return user; + } + + /// /// 设置固定排序方式及显示用户过滤 /// diff --git a/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_ProduceController.cs b/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_ProduceController.cs index 62cc1c2..cc39ddb 100644 --- a/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_ProduceController.cs +++ b/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_ProduceController.cs @@ -11,6 +11,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Http; using VOL.Entity.DomainModels; using VOL.Data.IServices; +using VOL.Core.Enums; +using VOL.Core.Extensions; +using VOL.Core.Filters; namespace VOL.Data.Controllers { diff --git a/vol-vue3/src/api/http.js b/vol-vue3/src/api/http.js index 3ec6bbd..ccf5616 100644 --- a/vol-vue3/src/api/http.js +++ b/vol-vue3/src/api/http.js @@ -12,7 +12,7 @@ import { ElLoading as Loading, ElMessage as Message } from 'element-plus'; let loadingInstance; let loadingStatus = false; if (process.env.NODE_ENV == 'development') { - axios.defaults.baseURL = 'http://192.168.0.187:9991/'; + axios.defaults.baseURL = 'http://127.0.0.1:9991/'; } else if (process.env.NODE_ENV == 'debug') { axios.defaults.baseURL = 'http://127.0.0.1:9991/'; diff --git a/vol-vue3/src/extension/data/config/Data_Config.js b/vol-vue3/src/extension/data/config/Data_Config.js index 8935403..9a7ea43 100644 --- a/vol-vue3/src/extension/data/config/Data_Config.js +++ b/vol-vue3/src/extension/data/config/Data_Config.js @@ -6,7 +6,7 @@ **后台操作见:http://v2.volcore.xyz/document/netCoreDev *****************************************************************************************/ //此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 - +import store from '@/store' let extension = { components: { //查询界面扩展组件 @@ -20,24 +20,44 @@ let extension = { }, tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) buttons: { view: [], box: [], detail: [] }, //扩展的按钮 + // userId: store.state.userInfo.userId || 0, methods: { - //下面这些方法可以保留也可以删除 - onInit() { //框架初始化配置前, - //示例:在按钮的最前面添加一个按钮 - // this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组 - // name: '按钮', //按钮名称 - // icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档) - // type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button - // onClick: function () { - // this.$Message.success('点击了按钮'); - // } - // }); - - //示例:设置修改新建、编辑弹出框字段标签的长度 - // this.boxOptions.labelWidth = 150; + // mounted() { + // console.log(this.userId); + // }, + //下面这些方法可以保留也可以删除 + onInit() { //框架初始化配置前, create执行前执行 + //示例:在按钮的最前面添加一个按钮 + // this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组 + // name: '按钮', //按钮名称 + // icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档) + // type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button + // onClick: function () { + // this.$Message.success('点击了按钮'); + // } + // }); + //示例:设置修改新建、编辑弹出框字段标签的长度 + // this.boxOptions.labelWidth = 150; }, - onInited() { + onInited() { // create 执行后执行 //框架初始化配置后 + let userId = store.state.userInfo.userId || 0; + // console.log(userId); + // 隐藏企业账号列 + this.columns.forEach(column => { + if (column.field == 'Creator' && userId != 1) { + column.hidden = true; + } + }); + // console.log(this.searchFormOptions); + // 隐藏企业筛选框 + this.searchFormOptions.forEach(rowOptions => { + let index = rowOptions.findIndex(m => m.field == "CreateID"); + if (index != -1 && userId != 1) { + rowOptions.splice(index, 1); + } + }) + console.log(this.searchFormOptions); //如果要配置明细表,在此方法操作 //this.detailOptions.columns.forEach(column=>{ }); }, diff --git a/vol-vue3/src/extension/data/machine/Data_Machine.js b/vol-vue3/src/extension/data/machine/Data_Machine.js index 0b28328..826f345 100644 --- a/vol-vue3/src/extension/data/machine/Data_Machine.js +++ b/vol-vue3/src/extension/data/machine/Data_Machine.js @@ -6,7 +6,7 @@ **后台操作见:http://v2.volcore.xyz/document/netCoreDev *****************************************************************************************/ //此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 - +import store from '@/store' let extension = { components: { //查询界面扩展组件 @@ -22,25 +22,39 @@ let extension = { buttons: { view: [], box: [], detail: [] }, //扩展的按钮 methods: { onInit() { //框架初始化配置前, - //设置排序字段 - this.pagination.sortName = "id"; - this.pagination.order = "desc"; + //设置排序字段 + this.pagination.sortName = "id"; + this.pagination.order = "desc"; - //设置页面上显示的按钮个数 - this.maxBtnLength = 3; + //设置页面上显示的按钮个数 + this.maxBtnLength = 3; - // 格式化数据 - this.dataFormatter(); + // 格式化数据 + this.dataFormatter(); }, onInited() { //框架初始化配置后 - let fixeds = ['id','com_status','config_id']; - this.columns.forEach(x=>{ + let fixeds = ['id', 'Creator', 'com_status', 'config_id']; + let userId = store.state.userInfo.userId || 0; + this.columns.forEach(column => { //设置title列固定 - if (fixeds.includes(x.field)) { - x.fixed=true//也可以设置为right,固定到最右边 + if (fixeds.includes(column.field)) { + column.fixed = true//也可以设置为right,固定到最右边 + } + // 隐藏企业账号列 + if (column.field == 'Creator' && userId != 1) { + column.hidden = true; + } + }) + // console.log(this.searchFormOptions); + // 隐藏企业筛选框 + this.searchFormOptions.forEach(rowOptions => { + let index = rowOptions.findIndex(m => m.field == "CreateID"); + if (index != -1 && userId != 1) { + rowOptions.splice(index, 1); } }) + console.log(this.searchFormOptions); //如果要配置明细表,在此方法操作 //this.detailOptions.columns.forEach(column=>{ }); }, @@ -136,7 +150,7 @@ let extension = { column.getColor = (row, column) => { if (row.com_status == 15) { return 'danger'; - } else if (row.com_status == 5){ + } else if (row.com_status == 5) { return 'success'; } else { return ''; @@ -148,9 +162,9 @@ let extension = { column.getColor = (row, column) => { if (row.state == 1) { return 'danger'; - } else if (row.state == 2){ + } else if (row.state == 2) { return 'success'; - } else if (row.state == 3){ + } else if (row.state == 3) { return 'warning'; } else { return ''; diff --git a/vol-vue3/src/extension/data/produce/Data_Produce.js b/vol-vue3/src/extension/data/produce/Data_Produce.js index 3bad0d4..2abd171 100644 --- a/vol-vue3/src/extension/data/produce/Data_Produce.js +++ b/vol-vue3/src/extension/data/produce/Data_Produce.js @@ -6,7 +6,7 @@ **后台操作见:http://v2.volcore.xyz/document/netCoreDev *****************************************************************************************/ //此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 - +import store from '@/store' let extension = { components: { //查询界面扩展组件 @@ -21,24 +21,37 @@ let extension = { tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) buttons: { view: [], box: [], detail: [] }, //扩展的按钮 methods: { - //下面这些方法可以保留也可以删除 + //下面这些方法可以保留也可以删除 onInit() { //框架初始化配置前, - //设置排序字段 - this.pagination.sortName = "id"; - this.pagination.order = "desc"; - - //设置页面上显示的按钮个数 - this.maxBtnLength = 3; - - // 格式化数据 - this.dataFormatter(); + //设置排序字段 + this.pagination.sortName = "id"; + this.pagination.order = "desc"; + + //设置页面上显示的按钮个数 + this.maxBtnLength = 3; + + // 格式化数据 + this.dataFormatter(); }, onInited() { - let fixeds = ['id','com_status','config_id']; - this.columns.forEach(x=>{ + let fixeds = ['id', 'Creator', 'com_status', 'config_id']; + let userId = store.state.userInfo.userId || 0; + this.columns.forEach(column => { //设置title列固定 - if (fixeds.includes(x.field)) { - x.fixed=true//也可以设置为right,固定到最右边 + if (fixeds.includes(column.field)) { + column.fixed = true//也可以设置为right,固定到最右边 + } + // 隐藏企业账号列 + if (column.field == 'Creator' && userId != 1) { + column.hidden = true; + } + }) + // console.log(this.searchFormOptions); + // 隐藏企业筛选框 + this.searchFormOptions.forEach(rowOptions => { + let index = rowOptions.findIndex(m => m.field == "CreateID"); + if (index != -1 && userId != 1) { + rowOptions.splice(index, 1); } }) }, @@ -61,7 +74,7 @@ let extension = { }, rowClick({ row, column, event }) { //单击行时选中当前行 - this.$refs.table.$refs.table.toggleRowSelection(row); + this.$refs.table.$refs.table.toggleRowSelection(row); }, modelOpenAfter(row) { //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据 @@ -139,7 +152,7 @@ let extension = { column.getColor = (row, column) => { if (row.com_status == 15) { return 'danger'; - } else if (row.com_status == 5){ + } else if (row.com_status == 5) { return 'success'; } else { return ''; diff --git a/vol-vue3/src/views/data/config/Data_Config.vue b/vol-vue3/src/views/data/config/Data_Config.vue index b19916c..9470292 100644 --- a/vol-vue3/src/views/data/config/Data_Config.vue +++ b/vol-vue3/src/views/data/config/Data_Config.vue @@ -34,15 +34,15 @@ [{"title":"设备IP","field":"device_ip"}], [{"title":"通讯IP","field":"com_ip","type":"text"}], [{"dataKey":"device_type","data":[],"title":"机床类型","field":"type","type":"select"}]]); - const searchFormFields = ref({"type":"","com_ip":""}); - const searchFormOptions = ref([[{"dataKey":"device_type","data":[],"title":"机床类型","field":"type","type":"select"},{"title":"通讯IP","field":"com_ip","type":"text"}]]); + const searchFormFields = ref({"type":"","com_ip":"","CreateID":[]}); + const searchFormOptions = ref([[{"dataKey":"device_type","data":[],"title":"机床类型","field":"type","type":"select"},{"title":"通讯IP","field":"com_ip","type":"text"},{"dataKey":"company_list","data":[],"title":"企业账号","field":"CreateID","type":"selectList"}]]); const columns = ref([{field:'id',title:'id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'}, - {field:'name',title:'设备名称',type:'string',width:220,align:'left',sort:true}, + {field:'Creator',title:'企业账号',type:'string',width:150,align:'left',sort:true}, + {field:'name',title:'设备名称',type:'string',width:220,align:'left'}, {field:'type',title:'机床类型',type:'short',bind:{ key:'device_type',data:[]},width:120,align:'left'}, {field:'device_ip',title:'设备IP',type:'string',width:220,align:'left'}, {field:'com_ip',title:'通讯IP',type:'string',width:110,align:'left'}, - {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,align:'left'}, - {field:'Creator',title:'Creator',type:'string',width:100,hidden:true,align:'left'}, + {field:'CreateID',title:'企业账号',type:'int',bind:{ key:'company_list',data:[]},width:100,hidden:true,align:'left'}, {field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true}, {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,align:'left'}, {field:'Modifier',title:'Modifier',type:'string',width:100,hidden:true,align:'left'}, diff --git a/vol-vue3/src/views/data/machine/Data_Machine.vue b/vol-vue3/src/views/data/machine/Data_Machine.vue index a89abb0..26fb7ae 100644 --- a/vol-vue3/src/views/data/machine/Data_Machine.vue +++ b/vol-vue3/src/views/data/machine/Data_Machine.vue @@ -29,14 +29,13 @@ url: "/Data_Machine/", sortName: "id" }); - const editFormFields = ref({"config_id":"","com_status":"","run_program_no":"","smode":"","gmode":"","temperature":"","potential":"","current":"","main_rate":"","feed_rate":"","cut_rate":"","state":"","quantity":"","on_time":"","run_time":"","run_time_total":"","quantity_total":""}); + const editFormFields = ref({"config_id":"","com_status":"","run_program_no":"","smode":"","gmode":"","potential":"","current":"","main_rate":"","feed_rate":"","cut_rate":"","state":"","quantity":"","on_time":"","run_time":"","run_time_total":"","quantity_total":""}); const editFormOptions = ref([[{"dataKey":"device_name","data":[],"title":"设备信息","required":true,"field":"config_id","disabled":true,"type":"select"}, {"dataKey":"produce_com_status","data":[],"title":"通讯状态","field":"com_status","type":"select"}, {"title":"加工程序号","field":"run_program_no"}], [{"dataKey":"machine_smode","data":[],"title":"运行模式(西门子)","field":"smode","colSize":6,"type":"select"}, {"dataKey":"machine_gmode","data":[],"title":"运行模式(广数)","field":"gmode","colSize":6,"type":"select"}], - [{"title":"电机温度","field":"temperature","type":"decimal"}, - {"title":"母线电压","field":"potential","type":"decimal"}, + [{"title":"母线电压","field":"potential","type":"decimal"}, {"title":"实际电流","field":"current","type":"decimal"}], [{"title":"主轴倍率","field":"main_rate","type":"decimal"}, {"title":"进给倍率","field":"feed_rate","type":"decimal"}, @@ -47,16 +46,16 @@ {"title":"运行时间","field":"run_time","type":"number"}], [{"title":"累计运行时长","field":"run_time_total","type":"number"}, {"title":"累计加工数","field":"quantity_total","type":"number"}]]); - const searchFormFields = ref({"config_id":"","com_status":"","smode":"","gmode":"","run_program_no":"","state":"","quantity":[null,null],"CreateDate":[null,null]}); - const searchFormOptions = ref([[{"dataKey":"device_name","data":[],"title":"设备信息","field":"config_id","type":"select"},{"title":"加工程序号","field":"run_program_no"},{"dataKey":"produce_com_status","data":[],"title":"通讯状态","field":"com_status","type":"select"}],[{"dataKey":"machine_smode","data":[],"title":"运行模式(西门子)","field":"smode","type":"select"},{"dataKey":"machine_gmode","data":[],"title":"运行模式(广数)","field":"gmode","type":"select"},{"dataKey":"machine_state","data":[],"title":"运行状态","field":"state","type":"select"}],[{"title":"加工数","field":"quantity","type":"range"},{"title":"记录时间","field":"CreateDate","type":"range"}]]); + const searchFormFields = ref({"config_id":"","com_status":"","smode":"","gmode":"","run_program_no":"","state":"","quantity":[null,null],"CreateID":[],"CreateDate":[null,null]}); + const searchFormOptions = ref([[{"dataKey":"device_name","data":[],"title":"设备信息","field":"config_id","type":"select"},{"title":"加工程序号","field":"run_program_no"},{"dataKey":"produce_com_status","data":[],"title":"通讯状态","field":"com_status","type":"select"}],[{"dataKey":"machine_smode","data":[],"title":"运行模式(西门子)","field":"smode","type":"select"},{"dataKey":"machine_gmode","data":[],"title":"运行模式(广数)","field":"gmode","type":"select"},{"dataKey":"machine_state","data":[],"title":"运行状态","field":"state","type":"select"}],[{"title":"加工数","field":"quantity","type":"range"},{"title":"记录时间","field":"CreateDate","type":"range"},{"dataKey":"company_list","data":[],"title":"企业账号","field":"CreateID","type":"selectList"}]]); const columns = ref([{field:'id',title:'id',type:'int',width:80,readonly:true,require:true,align:'left',sort:true}, + {field:'Creator',title:'企业账号',type:'string',width:150,align:'left'}, {field:'config_id',title:'设备信息',type:'int',bind:{ key:'device_name',data:[]},width:110,readonly:true,require:true,align:'left'}, {field:'com_status',title:'通讯状态',type:'short',bind:{ key:'produce_com_status',data:[]},width:110,align:'left'}, {field:'smode',title:'运行模式(西门子)',type:'short',bind:{ key:'machine_smode',data:[]},width:140,align:'left'}, {field:'gmode',title:'运行模式(广数)',type:'short',bind:{ key:'machine_gmode',data:[]},width:140,align:'left'}, {field:'run_program_no',title:'加工程序号',type:'string',width:180,align:'left'}, {field:'state',title:'运行状态',type:'short',bind:{ key:'machine_state',data:[]},width:110,align:'left'}, - {field:'temperature',title:'电机温度',type:'decimal',width:100,align:'left'}, {field:'potential',title:'母线电压',type:'decimal',width:100,align:'left'}, {field:'current',title:'实际电流',type:'decimal',width:100,align:'left'}, {field:'quantity',title:'加工数',type:'bigint',width:100,align:'left'}, @@ -67,12 +66,12 @@ {field:'run_time',title:'运行时间',type:'bigint',width:150,align:'left'}, {field:'run_time_total',title:'累计运行时长',type:'bigint',width:150,align:'left'}, {field:'quantity_total',title:'累计加工数',type:'bigint',width:150,align:'left'}, - {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,align:'left'}, - {field:'Creator',title:'Creator',type:'string',width:100,hidden:true,align:'left'}, + {field:'CreateID',title:'企业账号',type:'int',bind:{ key:'company_list',data:[]},width:100,hidden:true,align:'left'}, {field:'CreateDate',title:'记录时间',type:'datetime',width:180,align:'left',sort:true}, {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,align:'left'}, {field:'Modifier',title:'Modifier',type:'string',width:100,hidden:true,align:'left'}, - {field:'ModifyDate',title:'更新时间',type:'datetime',width:180,align:'left',sort:true}]); + {field:'ModifyDate',title:'更新时间',type:'datetime',width:180,align:'left',sort:true}, + {field:'temperature',title:'电机温度',type:'decimal',width:120,align:'left'}]); const detail = ref({ cnName: "#detailCnName", table: "#detailTable", diff --git a/vol-vue3/src/views/data/produce/Data_Produce.vue b/vol-vue3/src/views/data/produce/Data_Produce.vue index 1e7037d..ecc4eb1 100644 --- a/vol-vue3/src/views/data/produce/Data_Produce.vue +++ b/vol-vue3/src/views/data/produce/Data_Produce.vue @@ -46,9 +46,10 @@ {"title":"工单2良品率","field":"yield_2","type":"decimal"}, {"title":"工单3良品率","field":"yield_3","type":"decimal"}], [{"title":"设备综合效率","field":"oee","type":"decimal"}]]); - const searchFormFields = ref({"config_id":"","program_no":"","com_status":"","status":"","turnout_all":[null,null],"CreateDate":""}); - const searchFormOptions = ref([[{"dataKey":"produce_status","data":[],"title":"运行状态","field":"status","type":"select"},{"title":"程序编号","field":"program_no","type":"number"},{"dataKey":"produce_com_status","data":[],"title":"通讯状态","field":"com_status"}],[{"title":"记录时间","field":"CreateDate","type":"datetime"},{"dataKey":"device_name","data":[],"title":"设备信息","field":"config_id","type":"select"},{"title":"当班产量","field":"turnout_all","type":"range"}]]); + const searchFormFields = ref({"config_id":"","program_no":"","com_status":"","status":"","turnout_all":[null,null],"CreateID":[],"CreateDate":""}); + const searchFormOptions = ref([[{"dataKey":"produce_status","data":[],"title":"运行状态","field":"status","type":"select"},{"title":"程序编号","field":"program_no","type":"number"},{"dataKey":"produce_com_status","data":[],"title":"通讯状态","field":"com_status"}],[{"dataKey":"device_name","data":[],"title":"设备信息","field":"config_id","type":"select"},{"title":"当班产量","field":"turnout_all","type":"range"},{"title":"记录时间","field":"CreateDate","type":"datetime"}],[{"dataKey":"company_list","data":[],"title":"企业账号","field":"CreateID","type":"selectList"}]]); const columns = ref([{field:'id',title:'ID',type:'int',width:110,readonly:true,require:true,align:'left',sort:true}, + {field:'Creator',title:'企业账号',type:'string',width:150,readonly:true,align:'left'}, {field:'config_id',title:'设备信息',type:'int',bind:{ key:'device_name',data:[]},width:120,readonly:true,require:true,align:'left'}, {field:'program_no',title:'程序编号',type:'int',width:150,align:'left'}, {field:'com_status',title:'通讯状态',type:'short',bind:{ key:'produce_com_status',data:[]},width:120,align:'left'}, @@ -65,8 +66,7 @@ {field:'yield_2',title:'工单2良品率',type:'decimal',width:120,align:'left'}, {field:'yield_3',title:'工单3良品率',type:'decimal',width:120,align:'left'}, {field:'oee',title:'设备综合效率',type:'decimal',sort:true,width:120,align:'left'}, - {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,readonly:true,align:'left'}, - {field:'Creator',title:'Creator',type:'string',width:100,hidden:true,readonly:true,align:'left'}, + {field:'CreateID',title:'企业账号',type:'int',bind:{ key:'company_list',data:[]},width:100,hidden:true,readonly:true,align:'left'}, {field:'CreateDate',title:'记录时间',type:'datetime',width:180,readonly:true,align:'left',sort:true}, {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,readonly:true,align:'left'}, {field:'Modifier',title:'Modifier',type:'string',width:100,hidden:true,readonly:true,align:'left'},