diff --git a/ZR.Admin.WebApi/Controllers/mes/md/MdUnitController.cs b/ZR.Admin.WebApi/Controllers/mes/md/MdUnitController.cs index 05739ff4..06902430 100644 --- a/ZR.Admin.WebApi/Controllers/mes/md/MdUnitController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/md/MdUnitController.cs @@ -55,6 +55,9 @@ namespace ZR.Admin.WebApi.Controllers.mes.md [HttpPost("addUnit")] public IActionResult AddUnitmeasure([FromBody] MdUnit paramss) { + if(paramss == null) { + return ToResponse(new ApiResult((int)ResultCode.NO_DATA, "null")); + } paramss.ToCreate(HttpContext); int result = unitService.InsertUnit(paramss); return SUCCESS(result); diff --git a/ZR.Admin.WebApi/Controllers/mes/op/OperationController.cs b/ZR.Admin.WebApi/Controllers/mes/op/OperationController.cs index 66af6506..1960d4f8 100644 --- a/ZR.Admin.WebApi/Controllers/mes/op/OperationController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/op/OperationController.cs @@ -1,8 +1,10 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.SignalR; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using ZR.Admin.WebApi.Extensions; +using ZR.Admin.WebApi.Hubs; using ZR.Model.mes.md; using ZR.Model.MES.op.DTO; using ZR.Model.MES.op.ZR.Model.mes.md; @@ -18,9 +20,11 @@ namespace ZR.Admin.WebApi.Controllers.MES.md [Route("mes/op/operation")] public class OperationController : BaseController { - IOperationService operationService; + private readonly IOperationService operationService; + public OperationController(IOperationService operationService) { this.operationService= operationService; + } /// /// 获取所有统计信息 @@ -34,6 +38,6 @@ namespace ZR.Admin.WebApi.Controllers.MES.md return ToResponse(new ApiResult(200, "success", OpStatisticsList)); } - + } } diff --git a/ZR.Admin.WebApi/Hubs/MessageHub.cs b/ZR.Admin.WebApi/Hubs/MessageHub.cs index 356cd986..eb746670 100644 --- a/ZR.Admin.WebApi/Hubs/MessageHub.cs +++ b/ZR.Admin.WebApi/Hubs/MessageHub.cs @@ -10,7 +10,7 @@ using ZR.Service.System.IService; namespace ZR.Admin.WebApi.Hubs { /// - /// msghub + /// msghub OperationHub /// public class MessageHub : Hub { diff --git a/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj b/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj index 23b65472..01efaafa 100644 --- a/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj +++ b/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj @@ -18,6 +18,7 @@ + diff --git a/ZR.Model/mes/op/DTO/OpStatisticsDTO.cs b/ZR.Model/mes/op/DTO/OpStatisticsDTO.cs index 2c8edcaa..fb31a916 100644 --- a/ZR.Model/mes/op/DTO/OpStatisticsDTO.cs +++ b/ZR.Model/mes/op/DTO/OpStatisticsDTO.cs @@ -37,7 +37,7 @@ namespace ZR.Model.MES.op.DTO /// /// 生产进度 :ProductedNum/PlanNum*100 /// - public string ProductProgressRate { get; set; } + public int ProductProgressRate { get; set; } /// /// 良品数量 /// diff --git a/ZR.Service/mes/op/OperationService.cs b/ZR.Service/mes/op/OperationService.cs index aae6ca6e..a81a4b67 100644 --- a/ZR.Service/mes/op/OperationService.cs +++ b/ZR.Service/mes/op/OperationService.cs @@ -35,7 +35,7 @@ namespace ZR.Service.MES.op opStatisticsDTO.PlanNum = OpStatistics.PlanNum; opStatisticsDTO.ProductedNum = OpStatistics.ProductedNum; decimal num1 = (decimal) OpStatistics.ProductedNum / (decimal)OpStatistics.PlanNum*100; - opStatisticsDTO.ProductProgressRate = num1.ToString("0.00") ; + opStatisticsDTO.ProductProgressRate = (int)num1 ; opStatisticsDTO.GoodproductsNum = OpStatistics.GoodproductsNum; opStatisticsDTO.DefectiveProductsNum = OpStatistics.DefectiveProductsNum; decimal num2 = (decimal)OpStatistics.DefectiveProductsNum / (decimal)(OpStatistics.GoodproductsNum + OpStatistics.DefectiveProductsNum); diff --git a/ZR.Vue/.env.development b/ZR.Vue/.env.development index 73d9d37e..3b7d6996 100644 --- a/ZR.Vue/.env.development +++ b/ZR.Vue/.env.development @@ -10,6 +10,7 @@ VUE_APP_BASE_API = '/dev-api' #socket API VUE_APP_SOCKET_API = '/msgHub' + # 路由前缀 VUE_APP_ROUTER_PREFIX = '/' diff --git a/ZR.Vue/package.json b/ZR.Vue/package.json index 60c1cfc9..63fe7db3 100644 --- a/ZR.Vue/package.json +++ b/ZR.Vue/package.json @@ -19,7 +19,9 @@ ] }, "dependencies": { - "@microsoft/signalr": "^6.0.2", + "@aspnet/signalr": "^1.0.27", + "@jiaminghi/data-view": "^2.10.0", + "@microsoft/signalr": "^6.0.23", "@riophae/vue-treeselect": "0.4.0", "axios": "^0.21.4", "clipboard": "2.0.8", @@ -40,6 +42,7 @@ "nprogress": "0.2.0", "path-to-regexp": "2.4.0", "quill": "1.3.7", + "save": "^2.9.0", "screenfull": "4.2.0", "sortablejs": "1.8.4", "vue": "2.6.12", diff --git a/ZR.Vue/src/api/operationManagement/operation.js b/ZR.Vue/src/api/operationManagement/operation.js index d6f2e354..41f26121 100644 --- a/ZR.Vue/src/api/operationManagement/operation.js +++ b/ZR.Vue/src/api/operationManagement/operation.js @@ -1,9 +1,6 @@ import request from '@/utils/request' -/** -* 演示分页查询 -* @param {查询条件} data -*/ + export function getOperation(query) { return request({ url: 'mes/op/operation/getOperation', @@ -11,3 +8,11 @@ export function getOperation(query) { params: query, }) } + +export function getOperation1(query) { + return request({ + url: 'mes/op/operation/getOperation1', + method: 'get', + params: query, + }) +} diff --git a/ZR.Vue/src/main.js b/ZR.Vue/src/main.js index 37bf2f09..fada616e 100644 --- a/ZR.Vue/src/main.js +++ b/ZR.Vue/src/main.js @@ -39,6 +39,8 @@ import VXETable from 'vxe-table' import 'vxe-table/lib/style.css' +import dataV from '@jiaminghi/data-view' + // 全局方法挂载 Vue.prototype.getDicts = getDicts @@ -79,7 +81,7 @@ Vue.use(Element, { size: Cookies.get('size') || 'small' // set element-ui default size }) Vue.use(VXETable) - +Vue.use(dataV) DictData.install() diff --git a/ZR.Vue/src/views/OperationManagement/assemblyWorkshop.vue b/ZR.Vue/src/views/OperationManagement/assemblyWorkshop.vue index ecbd813d..b946a56a 100644 --- a/ZR.Vue/src/views/OperationManagement/assemblyWorkshop.vue +++ b/ZR.Vue/src/views/OperationManagement/assemblyWorkshop.vue @@ -33,9 +33,9 @@ @@ -55,7 +55,9 @@ export default { OperationList: [], } }, - created() {}, + created() { + + }, mounted() { this.getData() }, @@ -73,6 +75,12 @@ export default { } }) }, + //hub获取信息 + getOperationList(info) { + console.log('signalR', info) + this.OperationList = info + this.drawChart() + }, //进度条颜色 customColor(row) { if (row <= 20) { @@ -127,45 +135,6 @@ export default { } }) }, - formatDate(value) { - return XEUtils.toDateString(value, 'yyyy-MM-dd HH:mm:ss.S') - }, - changeFilterEvent(event, option, $panel) { - $panel.changeOption(event, !!option.data, option) - }, - showDetailEvent(row) { - this.selectRow = row - this.showDetails = true - }, - clickFooterItem(items, _columnIndex) { - VXETable.modal.alert(`点击了表尾第${_columnIndex}列`) - }, - checkboxChangeEvent() { - this.isAllChecked = this.$refs.xTable.isAllCheckboxChecked() - this.isIndeterminate = this.$refs.xTable.isAllCheckboxIndeterminate() - this.selectRecords = this.$refs.xTable.getCheckboxRecords() - }, - changeAllEvent() { - this.$refs.xTable.setAllCheckboxRow(this.isAllChecked) - this.selectRecords = this.$refs.xTable.getCheckboxRecords() - }, - sumNum(list, field) { - let count = 0 - list.forEach((item) => { - count += Number(item[field]) - }) - return count - }, - footerMethod({ columns, data }) { - return [ - columns.map((column) => { - if (['num'].includes(column.property)) { - return this.sumNum(data, column.property) - } - return null - }), - ] - }, }, } diff --git a/ZR.Vue/src/views/index.vue b/ZR.Vue/src/views/index.vue index ab3216f0..3c00569d 100644 --- a/ZR.Vue/src/views/index.vue +++ b/ZR.Vue/src/views/index.vue @@ -2,7 +2,7 @@
- +
@@ -16,7 +16,7 @@

- +
diff --git a/ZR.Vue/src/views/index_v1.vue b/ZR.Vue/src/views/index_v1.vue index 00550d6e..eb8d1937 100644 --- a/ZR.Vue/src/views/index_v1.vue +++ b/ZR.Vue/src/views/index_v1.vue @@ -88,7 +88,7 @@
- +

{{ item.title }}

diff --git a/ZR.Vue/src/views/kanbanManagement/digitalFlop.vue b/ZR.Vue/src/views/kanbanManagement/digitalFlop.vue new file mode 100644 index 00000000..493646b2 --- /dev/null +++ b/ZR.Vue/src/views/kanbanManagement/digitalFlop.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/ZR.Vue/src/views/kanbanManagement/test1.vue b/ZR.Vue/src/views/kanbanManagement/test1.vue new file mode 100644 index 00000000..910edcdb --- /dev/null +++ b/ZR.Vue/src/views/kanbanManagement/test1.vue @@ -0,0 +1,837 @@ + + + + + diff --git a/ZR.Vue/src/views/kanbanManagement/test2.vue b/ZR.Vue/src/views/kanbanManagement/test2.vue new file mode 100644 index 00000000..da756384 --- /dev/null +++ b/ZR.Vue/src/views/kanbanManagement/test2.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/ZR.Vue/src/views/kanbanManagement/titleBar.vue b/ZR.Vue/src/views/kanbanManagement/titleBar.vue new file mode 100644 index 00000000..3a9e3144 --- /dev/null +++ b/ZR.Vue/src/views/kanbanManagement/titleBar.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/ZR.Vue/vue.config.js b/ZR.Vue/vue.config.js index 8aaa19ab..1367a25a 100644 --- a/ZR.Vue/vue.config.js +++ b/ZR.Vue/vue.config.js @@ -15,9 +15,9 @@ module.exports = { sourceMap: process.env.NODE_ENV == 'production' ? false : true, //开启css source maps功能,前端可以看到css具体的行数 loaderOptions: { sass: { - sassOptions: { outputStyle: "expanded" } - } - } + sassOptions: { outputStyle: 'expanded' }, + }, + }, }, // 部署生产环境和开发环境下的URL。 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 @@ -42,39 +42,37 @@ module.exports = { target: 'http://localhost:8888/', // 后端接口地址 changeOrigin: true, pathRewrite: { - ['^' + process.env.VUE_APP_BASE_API]: '' //需要rewrite的 - } + ['^' + process.env.VUE_APP_BASE_API]: '', //需要rewrite的 + }, }, - "msgHub": { - target: 'http://localhost:8888/msgHub', - ws: true, - changeOrigin: true, - pathRewrite: { - ['^/msgHub']: '' //需要rewrite的 - } - } + msgHub: { + target: 'http://localhost:8888/msgHub', + ws: true, + changeOrigin: true, + pathRewrite: { + ['^/msgHub']: '', //需要rewrite的 + }, + }, + }, - disableHostCheck: true + disableHostCheck: true, }, configureWebpack: { name: name, resolve: { //设置路径别名,@代表根目录, @代表 src/文件夹 alias: { - '@': resolve('src') - } + '@': resolve('src'), + }, }, - plugins: [] + plugins: [], }, chainWebpack(config) { config.plugins.delete('preload') // TODO: need test config.plugins.delete('prefetch') // TODO: need test // set svg-sprite-loader - config.module - .rule('svg') - .exclude.add(resolve('src/assets/icons')) - .end() + config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end() config.module .rule('icons') .test(/\.svg$/) @@ -83,51 +81,49 @@ module.exports = { .use('svg-sprite-loader') .loader('svg-sprite-loader') .options({ - symbolId: 'icon-[name]' + symbolId: 'icon-[name]', }) .end() - config - .when(process.env.NODE_ENV !== 'development', - config => { - config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` - inline: /runtime\..*\.js$/ - }]) - .end() - config - .optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - libs: { - name: 'chunk-libs', - test: /[\\/]node_modules[\\/]/, - priority: 10, - chunks: 'initial' // only package third parties that are initially dependent - }, - elementUI: { - name: 'chunk-elementUI', // split elementUI into a single package - priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app - test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm - }, - commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules - minChunks: 3, // minimum common number - priority: 5, - reuseExistingChunk: true - } - } - }) - config.optimization.runtimeChunk('single'), + config.when(process.env.NODE_ENV !== 'development', (config) => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [ { - from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 - to: './' //到根目录下 - } + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/, + }, + ]) + .end() + config.optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial', // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true, + }, + }, + }) + config.optimization.runtimeChunk('single'), + { + from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 + to: './', //到根目录下 } - ) - } -} \ No newline at end of file + }) + }, +}