kllay 1 день назад
Родитель
Сommit
acb5f4f3aa

+ 2 - 1
src/layout/navBars/breadcrumb/user.vue

@@ -58,7 +58,8 @@
 			></i>
 		</div>
     <div>
-      <span v-if="!isSocketOpen">
+      <!-- <span v-if="!isSocketOpen"> -->
+	<span v-if="false">
         <el-popconfirm
           width="250"
           ref="onlinePopoverRef"

+ 4 - 3
src/views/system/device/crud.tsx

@@ -470,7 +470,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}
 				},
 				warranty_expiration: {
-					title: '质保期',
+					title: '质保期',
 					type: 'date',
 					search: { show: false },
 					column: { minWidth: 120 ,
@@ -500,8 +500,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						}
 					},
 					form: {
-						component: { placeholder: '请选择质保期' },
-						rules: [{ required: false, message: '请选择质保期' }],
+						component: { placeholder: '请选择质保期' },
+						rules: [{ required: false, message: '请选择质保期' }],
 					},
 					valueResolve({ form, value }) {
 						form.warranty_expiration = value ? dayjs(value).format('YYYY-MM-DD') : null;
@@ -682,6 +682,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: { placeholder: '请输入维修' }
 					},
 					viewForm:{
+						show:true,
 						component: { placeholder: '' },
 						rules: [{ required: true, message: '' }],
 					}

+ 5 - 2
src/views/system/deviceclass/crud.tsx

@@ -50,7 +50,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show:true,
 					},
 					edit:{
-						show:false,
+						show:true,
 					}
 
 				}
@@ -81,6 +81,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title:'分类编码',
 					type:'input',
 					column: {
+						show:false,
 						minWidth: 120,
 					},
 					form: {
@@ -128,9 +129,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}
 				},
 				parent:{
-					title: '父级',
+					title: '设备父级',
 					type: 'input',
 					column: {
+						show:false,
 						minWidth: 120,
 					},
 					form: {
@@ -146,6 +148,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '排序',
 					type: 'input',
 					column: {
+						show:false,
 						minWidth: 120,
 					},
 					form: {

+ 9 - 8
src/views/system/devicedamage/crud.tsx

@@ -190,14 +190,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}
 				},
 				quantity:{
-					title: '库存数量',
+					title: '报废数量',
 					type: 'input',
 					column: {
 						minWidth: 120,
 					},
 					form: {
-						component: { placeholder: '请填写库存数量'},
-						rules: [{ required: false, message: '请填写库存数量' }],
+						component: { placeholder: '请填写报废数量'},
+						rules: [{ required: false, message: '请填写报废数量' }],
 					},
 					editForm:{
 						component: { disabled: true },
@@ -220,11 +220,12 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						],
 					}),
 					column: {
+						show:false,
 						minWidth: 120,
 					},
 					form: {
 						value:0,
-						show:true,
+						show:false,
 						component: { placeholder: '请填写报损类型'},
 						rules: [{ required: false, message: '请填写报损类型' }],
 					},
@@ -237,14 +238,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}
 				},
 				damage_reason:{
-					title: '原因',
+					title: '报废原因',
 					type: 'input',
 					column: {
 						minWidth: 120,
 					},
 					form: {
-						component: { placeholder: '请填写原因' },
-						rules: [{ required: false, message: '请填写原因' }],
+						component: { placeholder: '请填写报废原因' },
+						rules: [{ required: false, message: '请填写报废原因' }],
 					},
 					viewForm:{
 						component: { placeholder: '' },
@@ -280,7 +281,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						})
 					}
 				},
-				responsible_person:{
+				reporter_name:{
 					title: '负责人',
 					type: 'input',
 					column: {

+ 2 - 0
src/views/system/devicelabel/crud.tsx

@@ -104,6 +104,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					form: {
+						value:'#FF5722',
+						show:false,
 						component: { placeholder: '请填写标签颜色' },
 						rules: [{ required: true, message: '请填写标签颜色' }],
 					},

+ 61 - 25
src/views/system/devicemaintenance/crud.tsx

@@ -97,6 +97,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 					treeNode: true,
 					type: 'input',
 					column: {
+						show:false,
 						minWidth: 120,
 					},
 					form: {
@@ -114,41 +115,42 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 						rules: [{ required: true, message: '' }],
 					}
 				},
-				device:{
-					title: '设备id',
-					type: 'dict-select',
+				
+				device_code:{
+					title: '设备编号',
+					type: 'input',
 					column: {
-						show:false,
+						show:true,
 						minWidth: 120,
 					},
-					dict: dict({
-						url: '/api/system/device/',
-						value: 'id',
-						label: 'name',
-					}),
 					form: {
-						component: { placeholder: '请填写设备id' },
-						rules: [{ required: true, message: '请填写设备id' }],
-					},
-					editForm:{
-						component: { disabled: true },
+						show:true,
+						component: { placeholder: '请填写设备编号' },
+						rules: [{ required: true, message: '请填写设备编号' }],
 					},
 					viewForm:{
 						component: { placeholder: '' },
 						rules: [{ required: true, message: '' }],
 					}
 				},
-				device_code:{
-					title: '设备编码',
-					type: 'input',
+				device:{
+					title: '设备名称',
+					type: 'dict-select',
 					column: {
 						show:false,
 						minWidth: 120,
 					},
+					dict: dict({
+						url: '/api/system/device/',
+						value: 'id',
+						label: 'name',
+					}),
 					form: {
-						show:true,
-						component: { placeholder: '请填写设备编码' },
-						rules: [{ required: true, message: '请填写设备编码' }],
+						component: { placeholder: '请填写设备名称' },
+						rules: [{ required: true, message: '请填写设备名称' }],
+					},
+					editForm:{
+						component: { disabled: true },
 					},
 					viewForm:{
 						component: { placeholder: '' },
@@ -207,7 +209,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 					},
 					form: {
 						value:1,
-						show:true,
+						show:false,
 						component: { placeholder: '请填写排序'},
 						rules: [{ required: false, message: '请填写排序' }],
 					},
@@ -220,14 +222,14 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 					}
 				},
 				damage_reason:{
-					title: '原因',
+					title: '维修原因',
 					type: 'input',
 					column: {
 						minWidth: 120,
 					},
 					form: {
-						component: { placeholder: '请填写原因' },
-						rules: [{ required: false, message: '请填写原因' }],
+						component: { placeholder: '请填写维修原因' },
+						rules: [{ required: false, message: '请填写维修原因' }],
 					},
 					viewForm:{
 						component: { placeholder: '' },
@@ -235,7 +237,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 					}
 				},
 				estimated_loss:{
-					title: '维修费用',
+					title: '维修费用(元)',
 					type: 'input',
 					column: {
 						minWidth: 120,
@@ -252,6 +254,9 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 							return form && form.damage_type === 1;
 						})
 					},
+					addForm:{
+						show:false,
+					},
 					viewForm:{
 						component: { placeholder: '' },
 						rules: [{ required: true, message: '' }],
@@ -262,12 +267,43 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 					}
 				},
 				responsible_person:{
+					title: '维修人',
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						component: { placeholder: '请填写维修人' },
+						rules: [{ required: false, message: '请填写维修人' }],
+					},
+					viewForm:{
+						component: { placeholder: '' },
+						rules: [{ required: true, message: '' }],
+					}
+				},
+				responsible_phone:{
+					title: '维修人联系方式',
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						component: { placeholder: '请填写维修人联系方式' },
+						rules: [{ required: false, message: '请填写维修人联系方式' }],
+					},
+					viewForm:{
+						component: { placeholder: '' },
+						rules: [{ required: true, message: '' }],
+					}
+				},
+				reporter_name:{
 					title: '负责人',
 					type: 'input',
 					column: {
 						minWidth: 120,
 					},
 					form: {
+						show:false,
 						component: { placeholder: '请填写负责人' },
 						rules: [{ required: false, message: '请填写负责人' }],
 					},

+ 42 - 18
src/views/system/home/index.vue

@@ -146,10 +146,10 @@
 												start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD"
 												value-format="YYYY-MM-DD" @change="fetchRankings" />
 
-												 <el-select clearable v-model="deviceTagId" placeholder="标签类型" 
-													@change="fetchRankings">
-													<el-option v-for="item in labelType" :key="item.id" :label="item.name" :value="item.id" />
-												</el-select>
+											<el-select multiple clearable v-model="deviceTagId" placeholder="标签" 
+											@change="fetchRankings">
+											<el-option v-for="item in labelType" :key="item.id" :label="item.name" :value="item.id" />
+											</el-select>
 
 										</div>
 
@@ -172,10 +172,10 @@
 
 
 								<div v-if="panelSettings.activeUsers" class="boxall" :style="{ height: !panelSettings.deviceBorrowRanking ? '670px' : '320px' }">
-									<div class="alltitle">活跃用户</div>
+									<div class="alltitle">活跃用户排名</div>
 									<div class="navboxall">
 										<div class="wraptit">
-											<span>排名</span><span>用户名</span><span>总借用次数</span>
+											<span>排名</span><span>用户名</span><span>学号/工号</span><span>总借用次数</span>
 										</div>
 										<div class="wrap" style="height:85%;">
 											<ul>
@@ -184,6 +184,7 @@
 														style="display: flex;justify-content: space-between; width: 100%;">
 														<span>{{ index + 1 }}</span>
 														<span>{{ hero.user_name }}</span>
+														<span>{{ hero.user_code }}</span>
 														<span>{{ hero.borrow_count }}</span>
 													</div>
 												</li>
@@ -818,7 +819,9 @@ export default defineComponent({
 				tooltip: {
 					trigger: 'axis',
 					axisPointer: {
-						lineStyle: { color: '#57617B' }
+						// lineStyle: { color: '#57617B' }
+						type: 'shadow', 
+        				shadowStyle: { color: 'rgba(0,0,0,0.1)' }
 					}
 				},
 				legend: {
@@ -828,15 +831,15 @@ export default defineComponent({
 					itemGap: 20
 				},
 				grid: {
-					left: '0',
-					right: '20',
-					top: '10',
-					bottom: '20',
+					left: '40',
+					right: '40',
+					top: '20',
+					bottom: '40',
 					containLabel: true
 				},
 				xAxis: [{
 					type: 'category',
-					boundaryGap: false,
+					boundaryGap: true,
 					axisLabel: {
 						show: true,
 						textStyle: {
@@ -847,6 +850,8 @@ export default defineComponent({
 					axisLine: {
 						lineStyle: { color: 'rgba(255,255,255,.1)' }
 					},
+					axisTick: { alignWithLabel: true },
+					// boundaryGap: true,
 					// data: trendData.map(item => item.date.substring(5))
 					data: monthlyData.map(item => item.date)
 				}],
@@ -865,15 +870,25 @@ export default defineComponent({
 				series: [
 					{
 						name: '借用次数',
-						type: 'line',
-						smooth: true,
+						type: 'bar',
+						barWidth: 12, 
+						itemStyle: {
+						color: '#409EFF' 
+						},
+						barCategoryGap: '30%',
+						// smooth: true,
 						// data: trendData.map(item => item.borrow_count)
 						data: monthlyData.map(item => item.borrow_count)
 					},
 					{
 						name: '借用时长',
-						type: 'line',
-						smooth: true,
+						type: 'bar',
+						barWidth: 12, 
+						itemStyle: {
+						color: '#67C23A'
+						},
+						barCategoryGap: '30%',
+						// smooth: true,
 						// data: trendData.map(item => item.total_duration)
 						data: monthlyData.map(item => item.total_duration)
 					}
@@ -1433,7 +1448,7 @@ $homeNavLengh: 8;
 
 
 		.lol-container {
-			border-radius: 16px;
+			border-radius: 32px;
 
 			color: #fff;
 			background: #000d4a; // url(/@/assets/img/bg.png) center top
@@ -1462,7 +1477,7 @@ $homeNavLengh: 8;
 
 					.fullscreen-btn {
 						color: #fff;
-						font-size: 20px;
+						font-size: 32px;
 						padding: 0;
 						margin-left: 10px;
 
@@ -1470,6 +1485,15 @@ $homeNavLengh: 8;
 							color: #409EFF;
 						}
 					}
+					.fullscreen-btn i {
+						font-size: 28px !important; 
+						line-height: 1;
+						}
+					.fullscreen-btn svg {
+						width: 28px;
+						height: 28px;
+						transition: transform 0.2s ease;
+						}
 				}
 			}
 

+ 3 - 2
src/views/system/screenconsole/api.ts

@@ -43,9 +43,10 @@ export function GetUtilizationList() {
 }
 
 
-export function GetBorrowTrends() {
+export function GetBorrowTrends(obj:string) {
 	return request({
-		url: apiPrefix+'borrow_trends/',
+		url: apiPrefix+'borrow_trends/?period='+obj,
+		// url: apiPrefix+'borrow_trends/',
 		method: 'get',
 	});
 }

+ 21 - 5
src/views/system/screenconsole/component/BorrowRankingList.vue

@@ -19,9 +19,18 @@
             @change="fetchRanking" />
         </el-col>
         <el-col :span="6">
-          <el-select clearable v-model="deviceTagId" placeholder="标签类型" style="margin-left: 30%; width: 140px;"
+          <el-select multiple clearable v-model="deviceTagIds" placeholder="标签名" style="margin-left: 30%; width: 140px;"
             @change="fetchRanking">
-            <el-option v-for="item in labelType" :key="item.id" :label="item.name" :value="item.id" />
+            <el-option v-for="item in labelType" :key="item.id" :label="item.name" :value="item.id" >
+              <template #default>
+                  <el-checkbox
+                    :label="item.name"
+                    :checked="deviceTagIds.includes(item.id)"
+                  >
+                    {{ item.name }}
+                  </el-checkbox>
+                </template>
+            </el-option>
           </el-select>
         </el-col>
       </el-row>
@@ -62,7 +71,9 @@ const borrowType = ref('all')
 const dateRange = ref<[string, string] | null>(null)
 const keyword = ref('')
 const rankingData = ref<RankingItem[]>([])
-const deviceTagId = ref('')
+// const deviceTagId = ref('')
+const deviceTagIds = ref<number[]>([])
+
 
 const fetchRanking = async () => {
   const params: Record<string, any> = {
@@ -77,9 +88,14 @@ const fetchRanking = async () => {
   if (keyword.value) {
     params.keyword = keyword.value
   }
-  if (deviceTagId.value) {
-    params.tag_id = deviceTagId.value
+  // if (deviceTagId.value) {
+  //   params.tag_id = deviceTagId.value
+  // }
+  if (deviceTagIds.value.length) {
+    params.tag_id = deviceTagIds.value
+    // console.log("params.tag_id::",params.tag_id)
   }
+
   const res = await api.GetBorrowRanking(params)
   if (res.code === 2000) {
     rankingData.value = res.data.borrow_count_ranking

+ 106 - 45
src/views/system/screenconsole/component/BorrowTrendsChart.vue

@@ -31,7 +31,8 @@
     CanvasRenderer
   } from 'echarts/renderers'
   import {
-    LineChart
+    // LineChart,
+    BarChart
   } from 'echarts/charts'
   import {
     TitleComponent,
@@ -41,15 +42,24 @@
   } from 'echarts/components'
   import * as api from '../api'
   
-  use([
-    CanvasRenderer,
-    LineChart,
-    TitleComponent,
-    TooltipComponent,
-    GridComponent,
-    LegendComponent
-  ])
+  // use([
+  //   CanvasRenderer,
+  //   LineChart,
+  //   TitleComponent,
+  //   TooltipComponent,
+  //   GridComponent,
+  //   LegendComponent
+  // ])
   
+  use([
+  CanvasRenderer,
+  BarChart, 
+  TitleComponent,
+  TooltipComponent,
+  GridComponent,
+  LegendComponent
+])
+
   interface BorrowTrend {
     date: string
     borrow_count: number
@@ -66,8 +76,8 @@
   const rawData = ref<BorrowTrend[]>([])
   
   const fetchData = async () => {
-    // const res = await api.GetBorrowTrends(selectedRange.value)
-    const res = await api.GetBorrowTrends()
+    const res = await api.GetBorrowTrends(selectedRange.value)
+    // const res = await api.GetBorrowTrends()
     if (res.code === 2000) {
       rawData.value = res.data.trends
     } else {
@@ -79,43 +89,94 @@
   onMounted(fetchData)
   
   const hasData = computed(() => rawData.value.length > 0)
-  
+
+
   const chartOption = computed(() => {
-    const dates = rawData.value.map(item => item.date)
-    const borrowCounts = rawData.value.map(item => item.borrow_count)
-    const durations = rawData.value.map(item => item.total_duration)
-  
-    return {
-      tooltip: {
-        trigger: 'axis'
-      },
-      legend: {
-        data: ['借用次数', '使用时长']
-      },
-      xAxis: {
-        type: 'category',
-        data: dates
-      },
-      yAxis: {
-        type: 'value',
-        name: '数量'
+  const dates = rawData.value.map(item => item.date)
+  const borrowCounts = rawData.value.map(item => item.borrow_count)
+  const durations = rawData.value.map(item => item.total_duration)
+
+  return {
+    tooltip: {
+      trigger: 'axis'
+    },
+    legend: {
+      data: ['借用次数', '使用时长']
+    },
+    xAxis: {
+      type: 'category',
+      data: dates,
+      axisTick: { alignWithLabel: true }
+    },
+    yAxis: {
+      type: 'value',
+      name: '数量'
+    },
+    series: [
+      {
+        name: '借用次数',
+        type: 'bar',
+        data: borrowCounts,
+        barWidth: '40%',
+        itemStyle: {
+          color: '#409EFF'
+        }
       },
-      series: [
-        {
-          name: '借用次数',
-          type: 'line',
-          data: borrowCounts,
-          smooth: true
-        },
-        {
-          name: '使用时长',
-          type: 'line',
-          data: durations,
-          smooth: true
+      {
+        name: '使用时长',
+        type: 'bar',
+        data: durations,
+        barWidth: '40%',
+        itemStyle: {
+          color: '#67C23A'
         }
-      ]
-    }
-  })
+      }
+    ]
+  }
+})
+
+
+  
+  // const chartOption = computed(() => {
+  //   const dates = rawData.value.map(item => item.date)
+  //   const borrowCounts = rawData.value.map(item => item.borrow_count)
+  //   const durations = rawData.value.map(item => item.total_duration)
+  
+  //   return {
+  //     tooltip: {
+  //       trigger: 'axis'
+  //     },
+  //     legend: {
+  //       data: ['借用次数', '使用时长']
+  //     },
+  //     xAxis: {
+  //       type: 'category',
+  //       data: dates
+  //     },
+  //     yAxis: {
+  //       type: 'value',
+  //       name: '数量'
+  //     },
+  //     series: [
+  //       {
+  //         name: '借用次数',
+  //         type: 'line',
+  //         data: borrowCounts,
+  //         smooth: true
+  //       },
+  //       {
+  //         name: '使用时长',
+  //         type: 'line',
+  //         data: durations,
+  //         smooth: true
+  //       }
+  //     ]
+  //   }
+  // })
+
+
+
+
   </script>
   
   <style scoped>