王克恕 3 rokov pred
rodič
commit
ee505be482

+ 81 - 78
imcs-ui/src/main.js

@@ -1,78 +1,81 @@
-import Vue from 'vue'
-
-import 'normalize.css/normalize.css' // a modern alternative to CSS resets
-import Element from 'element-ui'
-import './styles/element-variables.scss'
-
-import '@/styles/index.scss' // global css
-
-/*****本项目【共通css】****/
-import './styles/common.css'
-
-import App from './App'
-import store from './store'
-import router from './router'
-
-import i18n from './lang' // internationalization
-import './icons' // icon
-import './utils/error-log' // error log
-import request from '@/utils/request'
-
-import * as filters from './filters' // global filters
-import { hasPermission, hasNoPermission, hasAnyPermission } from './utils/permissionDirect'
-import uploader from 'vue-simple-uploader'
-
-import VueLazyload from 'vue-lazyload'
-
-// 打印
-import Print from 'vue-print-nb'
-
-/************************ WKS添加本项目常量和方法(start)***************************/
-// 导入项目需要的【常量和方法】
-import PluginsWks from './components/Plugins/Plugins'
-//通过全局方法 Vue.use() 使用插件
-Vue.use(PluginsWks)
-/************************ WKS添加本项目常量和方法(end)***************************/
-
-Vue.use(VueLazyload)
-
-const Plugins = [
-  hasPermission,
-  hasNoPermission,
-  hasAnyPermission
-]
-
-Plugins.map((plugin) => {
-  Vue.use(plugin)
-})
-
-Vue.use(Element, {
-  i18n: (key, value) => i18n.t(key, value)
-})
-Vue.use(uploader)
-
-Vue.prototype.$post = request.post
-Vue.prototype.$get = request.get
-Vue.prototype.$put = request.put
-Vue.prototype.$delete = request.delete
-Vue.prototype.$download = request.download
-Vue.prototype.$upload = request.upload
-Vue.prototype.$login = request.login
-
-// register global utility filters
-Object.keys(filters).forEach(key => {
-  Vue.filter(key, filters[key])
-})
-
-// 注册打印
-Vue.use(Print) 
-
-Vue.config.productionTip = false
-
-new Vue({
-  el: '#app',
-  router,
-  store,
-  i18n,
-  render: h => h(App)
-})
+import Vue from 'vue'
+
+import 'normalize.css/normalize.css' // a modern alternative to CSS resets
+import Element from 'element-ui'
+import './styles/element-variables.scss'
+
+import '@/styles/index.scss' // global css
+
+/*****本项目【共通css】****/
+import './styles/common.css'
+
+import App from './App'
+import store from './store'
+import router from './router'
+
+import i18n from './lang' // internationalization
+import './icons' // icon
+import './utils/error-log' // error log
+import request from '@/utils/request'
+
+import * as filters from './filters' // global filters
+import { hasPermission, hasNoPermission, hasAnyPermission } from './utils/permissionDirect'
+import uploader from 'vue-simple-uploader'
+
+import VueLazyload from 'vue-lazyload'
+// 日期格式化
+import $moment from 'moment' //引入文件
+Vue.use($moment);//赋值使用。this.$moment()
+
+// 打印
+import Print from 'vue-print-nb'
+
+/************************ WKS添加本项目常量和方法(start)***************************/
+// 导入项目需要的【常量和方法】
+import PluginsWks from './components/Plugins/Plugins'
+//通过全局方法 Vue.use() 使用插件
+Vue.use(PluginsWks)
+/************************ WKS添加本项目常量和方法(end)***************************/
+
+Vue.use(VueLazyload)
+
+const Plugins = [
+  hasPermission,
+  hasNoPermission,
+  hasAnyPermission
+]
+
+Plugins.map((plugin) => {
+  Vue.use(plugin)
+})
+
+Vue.use(Element, {
+  i18n: (key, value) => i18n.t(key, value)
+})
+Vue.use(uploader)
+
+Vue.prototype.$post = request.post
+Vue.prototype.$get = request.get
+Vue.prototype.$put = request.put
+Vue.prototype.$delete = request.delete
+Vue.prototype.$download = request.download
+Vue.prototype.$upload = request.upload
+Vue.prototype.$login = request.login
+
+// register global utility filters
+Object.keys(filters).forEach(key => {
+  Vue.filter(key, filters[key])
+})
+
+// 注册打印
+Vue.use(Print) 
+
+Vue.config.productionTip = false
+
+new Vue({
+  el: '#app',
+  router,
+  store,
+  i18n,
+  render: h => h(App)
+})

+ 73 - 62
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/PprogResource.vue

@@ -56,7 +56,7 @@
 								</template>
 							</div>
 							<!-- 备注文字 -->
-							<div class="timeItemDesc">
+							<div class="timeItemDesc" :style="{left: obj.leftNums+'%'}">
 								<div>{{ obj.bomDesc ? obj.bomDesc : '' }}</div>
 								<div>{{ obj.procedureNo ? obj.procedureNo : '' }}</div>
 								<div>{{ obj.planTime ? obj.planTime : '' }}</div>
@@ -227,7 +227,7 @@ export default {
   	
   	// 初始化,填充数据
   	initTimeDom() {
-  		for(let i = 0; i < 10; i++) {
+  		for(let i = 0; i < 15; i++) {
   			this.timeDomList.push({
   				id: "WS"+ Math.random(),  // 随机数据
   				isFull: false   // 是否填充颜色,默认不填充
@@ -250,6 +250,7 @@ export default {
 	  			planTime: '',  // 计划时间
 				procedureNo: '',  // 工序编码
 				bomDesc: '', // 零件的名称
+				leftNums: 6.66, // 文字偏移量
 				child: []
 			}
   		]
@@ -266,52 +267,65 @@ export default {
   				let expectStartTime = this.getHourSecend(ymd, item.expectStartTime.substr(11,5));
   				// 背景模块,截止时间
   				let expectEndTime = this.getHourSecend(ymd, item.expectEndTime.substr(11,5));
-  				
   				let flag = this.intervalInclusion([filedTime, filedTime + 30], [expectStartTime, expectEndTime]);
-  				// cell【被包含】在时间段中
-  				/*if(flag == '1') {
-  					arr[0].child.forEach((item, index) => {
-						item.isFull = true;
+  				// cell【包含-startEnd】在时间段中
+  				if(flag == '1') {
+  					// 文字偏移量
+  					let leftNums = 0;
+  					// console.log("时间点:",[filedTime, filedTime + 30], [expectStartTime, expectEndTime], flag, item);
+  					arr[0].child.forEach((obj, index) => {
+  						let modal = filedTime + (index+1)*2;
+						// 小模块,【被包含】在起止时间区间
+						if( modal <= expectEndTime && modal >= expectStartTime){
+							obj.isFull = true;
+							// 计算第一次值
+							if(!leftNums){
+								leftNums = index+1;
+							}
+						}
+					})
+  					arr[0].planTime = item.planTime;
+					arr[0].procedureNo = item.procedureNo;
+					arr[0].bomDesc = item.bomDesc;
+					arr[0].leftNums = leftNums*6.66;
+  				}
+  				// interval【有交集】终止点,在cell中,
+  				if(flag == '2') {
+  					arr[0].child.forEach((obj, index) => {
+						let modal = filedTime + (index+1)*2;
+						// 小模块,【有交集】终止点,在cell中,
+						if( modal <= expectEndTime){
+							obj.isFull = true;
+						}
 					})
   				}
-  				if(flag == '2') {  // cell,办包含【起止点】
-  					arr[0].child.forEach((item, index) => {
-						item.isFull = true;
+  				
+  				// interval【有交集】起始点,在cell中
+  				if(flag == '3') {
+  					// 文字偏移量
+  					let leftNums = 0;
+  					arr[0].child.forEach((obj, index) => {
+						let modal = filedTime + (index+1)*2;
+						// 小模块,【有交集】起始点,在cell中
+						if( modal >= expectStartTime){
+							obj.isFull = true;
+							// 计算第一次值
+							if(!leftNums){
+								leftNums = index+1;
+							}
+						}
 					})
 					arr[0].planTime = item.planTime;
 					arr[0].procedureNo = item.procedureNo;
 					arr[0].bomDesc = item.bomDesc;
-  				}*/
-  				// 【开始时间】在cell里
-  				if(expectStartTime > filedTime && expectStartTime < filedTime + 30){
-  					// 【截止时间】在这个cell里
-  					if(expectEndTime > filedTime && expectEndTime < filedTime + 30) {
-  						arr[0].child.forEach((item, index) => {
-  							if(expectEndTime < filedTime + (index+1)*3){
-  								item.isFull = true;
-  							}
-  						})
-  						arr[0].planTime = item.planTime;
-  						arr[0].procedureNo = item.procedureNo;
-  						arr[0].bomDesc = item.bomDesc;
-  					} else {  // 【截止时间】不在这个cell里
-  						arr[0].child.forEach(item => {
-  							item.isFull = true;
-  						})
-  						arr[0].planTime = item.planTime;
-  						arr[0].procedureNo = item.procedureNo;
-  						arr[0].bomDesc = item.bomDesc;
-  					}
-  				} else {  // 【开始时间】。不在这个cell里面
-  					// 【截止时间】在这个cell里
-  					if(expectEndTime > filedTime && expectEndTime < filedTime + 30) {
-  						arr[0].child.forEach(item => {
-  							item.isFull = true;
-  						})
-  						arr[0].planTime = item.planTime;
-  						arr[0].procedureNo = item.procedureNo;
-  						arr[0].bomDesc = item.bomDesc;
-  					}
+					arr[0].leftNums = leftNums*6.66;
+  				}
+  				
+  				// cell【完全包含】,比cell大的多
+  				if(flag == '4') {
+  					arr[0].child.forEach((obj, index) => {
+						obj.isFull = true;
+					})
   				}
   			})
   		}
@@ -322,31 +336,25 @@ export default {
   	
 	/**
 	 * 比较2个区间数据,是否包含
-	 * @param {Array} interval:需要检查的区间
-	 * @param {Array} inclusion:根区间。(inclusion是否包含于inclusion
+	 * @param {Array} cell:需要检查的区间
+	 * @param {Array} startEnd:根区间。(startEnd是否包含于cell
 	 * */
-	intervalInclusion(interval, inclusion){
-		/*if(!interval){
-			// interval = [120, 150]  // 【被包含】
-			// interval = [90, 120]  // 【有交集】
-			interval = [590, 620]  // 【有交集】
-			// interval = [700, 730]  // 【无关联】
-		}
-		if(!inclusion){
-			inclusion = [100, 600],
-		}*/
-		// interval【被包含】,第二个参数,肯定是大于第一个参数的(固定)。
-		if (interval[0] >= inclusion[0] && interval[1] <= inclusion[1]) {
+	intervalInclusion(cell, startEnd){
+		// cell【包含-startEnd】,第二个参数,肯定是大于第一个参数的(固定)。
+		if (startEnd[0] >= cell[0] && startEnd[0] < cell[1] && startEnd[1] >cell[0] && startEnd[1] <=cell[1]) {
 			return "1";
 		} else {
-			// interval【有交集】起始点不在。
-			if(interval[0] < inclusion[0] && interval[1] > inclusion[0]) {
-				return "2";
-			} else if(interval[0] > inclusion[0] && interval[0] <= inclusion[1]){
-				// interval【有交集】结束点不在。
+			// cell【有交集】终止点,在cell中,
+			if(startEnd[1] > cell[0] && startEnd[1] <= cell[1] && startEnd[0] < cell[0]) {
 				return "2";
+			} else if( startEnd[0] >= cell[0] && startEnd[0] < cell[1] && startEnd[1] > cell[1]){
+				// cell【有交集】起始点,在cell中
+				return "3";
+			} else if(cell[0] > startEnd[0] && cell[1] < startEnd[1]){
+				// cell【完全包含】,比cell大的多
+				return "4";
 			} else {
-				// interval【无关联】
+				// cell【无关联】
 				return "0";
 			}
 		}
@@ -437,7 +445,9 @@ export default {
 		width: 100%;
 		.timeItem {
 			display: inline-block;
-			width: 10%;
+			width: -moz-calc(100%/15);
+			width: -webkit-calc(100%/15);
+			width: calc(100%/15);
 			height: 70px;
 		}
 		.tiActive{
@@ -450,6 +460,7 @@ export default {
 		left: 10px;
 		font-size: 12px;
 		line-height: 16px;
+		min-width: 120px;
 		color: white;
 		z-index: 999;
 		text-align: left;