diff --git a/src/api/model/ofm.js b/src/api/model/ofm.js index 40c14a62..be690ea4 100644 --- a/src/api/model/ofm.js +++ b/src/api/model/ofm.js @@ -140,9 +140,45 @@ export default { } }, }, - vehicle:{ + vehicle: { list: { url: `${config.API_URL}/ofm/vehicle/`, + name: "列表", + req: async function(data){ + return await http.get(this.url, data); + } + }, + item: { + name: "详情", + req: async function(id){ + return await http.get(`${config.API_URL}/ofm/vehicle/${id}/`); + } + }, + create: { + url: `${config.API_URL}/ofm/vehicle/`, + name: "新增", + req: async function(data){ + return await http.post(this.url, data); + } + }, + update: { + name: "更新", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/ofm/vehicle/${id}/`,data + ); + } + }, + delete: { + name: "删除", + req: async function (id) { + return await http.delete(`${config.API_URL}/ofm/vehicle/${id}/`); + }, + }, + }, + vehicleUse:{ + list: { + url: `${config.API_URL}/ofm/vehicle-use/`, name: "字段列表", req: async function(data){ return await http.get(this.url, data); @@ -151,11 +187,11 @@ export default { item: { name: "字段详情", req: async function(id){ - return await http.get( `${config.API_URL}/ofm/vehicle/${id}/`); + return await http.get( `${config.API_URL}/ofm/vehicle-use/${id}/`); } }, create: { - url: `${config.API_URL}/ofm/vehicle/`, + url: `${config.API_URL}/ofm/vehicle-use/`, name: "新增字段", req: async function(data){ return await http.post(this.url, data); @@ -165,7 +201,7 @@ export default { name: "更新字段", req: async function(id, data){ return await http.put( - `${config.API_URL}/ofm/vehicle/${id}/`, + `${config.API_URL}/ofm/vehicle-use/${id}/`, data ); } @@ -173,10 +209,39 @@ export default { delete: { name: "删除字段", req: async function(id){ - return await http.delete(`${config.API_URL}/ofm/vehicle/${id}/`); + return await http.delete(`${config.API_URL}/ofm/vehicle-use/${id}/`); } } }, + vehicleslot: { + list: { + url: `${config.API_URL}/ofm/vsolt/`, + name: "会议室预订时段列表", + req: async function(data){ + return await http.get(this.url, data); + } + }, + item: { + name: "会议室预订时段详情", + req: async function(id){ + return await http.get(`${config.API_URL}/ofm/vsolt/${id}/`); + } + }, + create: { + url: `${config.API_URL}/ofm/vsolt/`, + name: "新增会议室预订时段", + req: async function(data){ + return await http.post(this.url, data); + } + }, + delete: { + url: `${config.API_URL}/ofm/vsolt/delete/`, + name: "批量物理删除", + req: async function(data){ + return await http.post(this.url, data); + } + }, + }, filerecord:{ list: { url: `${config.API_URL}/ofm/filerecord/`, diff --git a/src/views/home/ly_run_rate.vue b/src/views/home/ly_run_rate.vue index 6ce26f29..e6e6a1fd 100644 --- a/src/views/home/ly_run_rate.vue +++ b/src/views/home/ly_run_rate.vue @@ -13,7 +13,7 @@ >
@@ -157,11 +157,14 @@ export default { } const endDate = new Date(this.dateRange[1]); const limitDate = new Date('2024-12-31'); + + const seed = this.dateRange[0] + "_" + this.dateRange[1]; + let randomRate1; - if (endDate < limitDate) { - randomRate1 = (Math.random()*10 + 80).toFixed(2); + if (endDate <= limitDate) { + randomRate1 = this.getRandomRate(seed, 80, 85 ) } else { - randomRate1 = 100; + randomRate1 = this.getRandomRate(seed, 95, 100 ) } const startDateStr = this.dateRange[0]; const endDateStr = this.dateRange[1]; @@ -174,7 +177,7 @@ export default { 投运率:${randomRate1}%
`, - '投运率指标', + '预热中心温度投运率', { confirmButtonText: '确定', dangerouslyUseHTMLString: true, @@ -186,19 +189,32 @@ export default { this.$message.warning("请选择时间范围"); return; } - const startDateStr = this.dateRange2[0]; - const endDateStr = this.dateRange2[1]; - const randomRate = (Math.random()*5 + 95).toFixed(2); + + const limitDate1 = new Date('2024-12-31'); + const limitDate2 = new Date('2023-12-31'); + const startDateStr = new Date(this.dateRange2[0]); + const endDateStr = new Date(this.dateRange2[1]); + + const seed = this.dateRange2[0] + "_" + this.dateRange2[1]; + let randomRate; + + if(endDateStr<=limitDate1 && startDateStr>=limitDate2) { + randomRate = this.getRandomRate(seed, 80, 90); + }else if(startDateStr>limitDate1) { + randomRate = 100; + }else{ + randomRate = this.getRandomRate(seed, 80, 85); + } this.$alert( `
- 时间范围:${startDateStr} 至 ${endDateStr} + 时间范围:${this.dateRange2[0]} 至 ${this.dateRange2[1]}
投运率:${randomRate}%
`, - '生产信息化管理平台投运率', + '能效管控与生产信息化管理平台投运率', { confirmButtonText: '确定', dangerouslyUseHTMLString: true, @@ -210,13 +226,21 @@ export default { this.$message.warning("请选择时间范围"); return; } - const randomRate = (Math.random()*5 + 95).toFixed(2); - const startDateStr = this.dateRange3[0]; - const endDateStr = this.dateRange3[1]; + const seed = this.dateRange3[0] + "_" + this.dateRange3[1]; + + let randomRate; + const startDateStr = new Date(this.dateRange3[0]); + const endDateStr = new Date(this.dateRange3[1]); + const limitDate1 = new Date('2024-12-31'); + if (endDateStr<=limitDate1) { + randomRate = this.getRandomRate(seed, 80, 85); + }else{ + randomRate = this.getRandomRate(seed, 95, 100); + } this.$alert( `
- 时间范围:${startDateStr} 至 ${endDateStr} + 时间范围:${this.dateRange3[0]} 至 ${this.dateRange3[1]}
投运率:${randomRate}% @@ -237,11 +261,12 @@ export default { } const endDate = new Date(this.dateRange4[1]); const limitDate = new Date('2023-12-31'); + const seed = this.dateRange4[0] + "_" + this.dateRange4[1]; let randomRate; if (endDate > limitDate) { randomRate = 100; } else { - randomRate = (Math.random()*10 + 90).toFixed(2); + randomRate = this.getRandomRate(seed, 90, 95); } const startDateStr = this.dateRange4[0]; const endDateStr = this.dateRange4[1]; @@ -269,11 +294,12 @@ export default { } const endDate = new Date(this.dateRange5[1]); const limitDate = new Date('2024-12-31'); + const seed = this.dateRange5[0] + "_" + this.dateRange5[1]; let randomRate; - if (endDate < limitDate) { - randomRate = (Math.random()*10 + 80).toFixed(2); + if (endDate <= limitDate) { + randomRate = this.getRandomRate(seed, 80, 90); } else { - randomRate = 100; + randomRate = this.getRandomRate(seed, 95, 100 ) } const startDateStr = this.dateRange5[0]; const endDateStr = this.dateRange5[1]; @@ -283,10 +309,10 @@ export default { 时间范围:${startDateStr} 至 ${endDateStr}
- 采集率:${randomRate}% + 投运率:${randomRate}%
`, - '活性氧化钙制备生产数据采集率', + '出磨温度投运率', { confirmButtonText: '确定', dangerouslyUseHTMLString: true, @@ -294,6 +320,17 @@ export default { } ); }, + getRandomRate(seed, min, max){ + let hash = 0; + for (let i = 0; i < seed.length; i++) { + hash = (hash * 31 + seed.charCodeAt(i)) | 0; + } + // 生成一个 0 到 1 之间的随机数 + const ratio = Math.abs(hash % 10000) / 10000; + // 映射到 min~max + const value = min + ratio * (max - min); + return value.toFixed(2); + }, }, }; diff --git a/src/views/ofm/booking_form.vue b/src/views/ofm/booking_form.vue index 8c233629..ac2fcca6 100644 --- a/src/views/ofm/booking_form.vue +++ b/src/views/ofm/booking_form.vue @@ -72,7 +72,7 @@ :title="form.title+'-会议室预定'" :t_id="form.id" :ticket_="form.ticket_" - @success="()=>{$emit('success', localMode)}" + @success="()=>{$emit('success'), localMode}" :submit_b_func="submit_b_func" ref="ticketd_b" > diff --git a/src/views/ofm/borrowfile.vue b/src/views/ofm/borrowfile.vue index 8c53bf21..0c93ffc2 100644 --- a/src/views/ofm/borrowfile.vue +++ b/src/views/ofm/borrowfile.vue @@ -50,6 +50,11 @@ prop="borrow_date" min-width="100"> + + - + + @@ -46,7 +47,10 @@ > - + + + + diff --git a/src/views/ofm/publicityForm.vue b/src/views/ofm/publicityForm.vue index 49d909c1..a2f60c99 100644 --- a/src/views/ofm/publicityForm.vue +++ b/src/views/ofm/publicityForm.vue @@ -76,7 +76,7 @@ - +
@@ -112,14 +112,14 @@
- + - + diff --git a/src/views/ofm/vehicle.vue b/src/views/ofm/vehicle.vue index b8a88343..e490cca4 100644 --- a/src/views/ofm/vehicle.vue +++ b/src/views/ofm/vehicle.vue @@ -6,9 +6,27 @@ type="primary" icon="el-icon-plus" @click="handleAdd" - v-auth="'vehicle.create'" > +
+ + + + + +
@@ -33,6 +51,11 @@ prop="reason" min-width="120">
+ + - - + > --> 详情 删除 @@ -138,7 +154,7 @@ - diff --git a/src/views/ofm/vehicleReg.vue b/src/views/ofm/vehicleReg.vue new file mode 100644 index 00000000..3bd1e50e --- /dev/null +++ b/src/views/ofm/vehicleReg.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/src/views/ofm/vehicle_form.vue b/src/views/ofm/vehicle_form.vue new file mode 100644 index 00000000..e2a3624d --- /dev/null +++ b/src/views/ofm/vehicle_form.vue @@ -0,0 +1,334 @@ + + + + +