yangg 1 天之前
父節點
當前提交
b10dc266b2

+ 1 - 1
src/i18n/pages/login/zh-cn.ts

@@ -10,7 +10,7 @@ export default {
 		two4: '友情链接',
 	},
 	account: {
-		accountPlaceholder1: '请输入登录账号/邮箱/手机号',
+		accountPlaceholder1: '请输入登录账号',
 		accountPlaceholder2: '请输入登录密码',
 		accountPlaceholder3: '请输入验证码',
 		accountPlaceholder4:'请输入新密码',

+ 1 - 0
src/views/system/borrow/component/CollectEquipment/index.vue

@@ -1279,6 +1279,7 @@ function onSubmit() {
       device_id: Number(item.device_no) || 0,
        // 添加异常相关字段
        condition: item.condition, // 异常说明
+       damage_type:item.damage_type,
        photo_urls: item.photos || [], // 异常照片
     }));
     

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

@@ -21,6 +21,9 @@ const BorrowRecords = defineComponent({
 		try {
 			const records = ref([]);
 			const loading = ref(false);
+			const filteredRecords = computed(() =>
+				(records.value || []).filter((item: any) => item?.record_type === 0)
+			);
 			const loadData = async () => {
 				if (!props.form?.id) return;
 				loading.value = true;
@@ -35,7 +38,7 @@ const BorrowRecords = defineComponent({
 			watch(() => props.form?.id, loadData, { immediate: true });
 
 			return () => (
-			<ElTable data={records.value} v-loading={loading.value} style="width: 100%">
+			<ElTable data={filteredRecords.value} v-loading={loading.value} style="width: 100%">
 				<ElTableColumn prop="application_no" label="借用编号" />
 				<ElTableColumn prop="borrower_name" label="借用人" />
 				<ElTableColumn prop="record_type_label" label="状态" />

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

@@ -54,7 +54,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			},
 			rowHandle:{
 				fixed: 'right',
-				width: 220,
+				width: 290,
 				buttons:{
 					remove:{
 						show:true,
@@ -63,7 +63,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show:true,
 					},
 					cancelDamage: {
-						text: '撤销报损',
+						text: '撤销',
 						type: 'danger',
 						order: 98,
 						show: true,
@@ -179,6 +179,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: { placeholder: '请填写设备编码' },
 						rules: [{ required: true, message: '请填写设备编码' }],
 					},
+					editForm:{
+						component: { disabled: true },
+					},
 					viewForm:{
 						component: { placeholder: '' },
 						rules: [{ required: true, message: '' }],

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

@@ -7,7 +7,7 @@
 				<div class="lol-container">
 					<div class="head">
 						<div class="weather">
-							<span id="showTime"></span>
+							<span id="showTime" style="font-size: 20px;"></span>
 							<el-button class="fullscreen-btn" type="text" @click="toggleFullScreen">
 								<el-icon><FullScreen v-if="!isFullscreen"/><Aim v-else/></el-icon>
 							</el-button>
@@ -59,21 +59,21 @@
 										<div class="data-overview">
 											<div class="data-card total-devices">
 												<div class="card-content">
-													<div class="card-title">设备总数</div>
+													<div class="card-title">设备总库存数</div>
 													<div class="card-value">{{ devicedata?.total_devices ?? 0 }}<span
 															class="card-unit"></span></div>
 												</div>
 											</div>
 											<div class="data-card borrowed">
 												<div class="card-content">
-													<div class="card-title">已借出</div>
+													<div class="card-title">在借数</div>
 													<div class="card-value">{{ devicedata?.borrowed_devices ?? 0 }}<span
 															class="card-unit"></span></div>
 												</div>
 											</div>
 											<div class="data-card available">
 												<div class="card-content">
-													<div class="card-title">可用设备</div>
+													<div class="card-title">在库数</div>
 													<div class="card-value">{{ devicedata?.available_devices ?? 0 }}<span
 															class="card-unit"></span></div>
 												</div>
@@ -129,7 +129,7 @@
 									<div class="alltitle">单台设备累计借用次数排名</div>
 									<div class="navboxall">
 										<div class="wraptit">
-											<span>排名</span><span>设备名称</span><span>标签名</span><span>借用次数</span>
+											<span>排名</span><span>设备名称</span><span>设备编号</span><span>借用次数</span>
 										</div>
 										<div class="wrap" :style="isFullscreen?'height: 85%':'height: 60%'">
 											<ul>
@@ -161,7 +161,7 @@
 								</div>
 
 
-								<div v-if="panelSettings.activeUsers" class="boxall" :style="{ height: !panelSettings.deviceBorrowRanking ? '670px' : '310px' }">
+								<div v-if="panelSettings.activeUsers" class="boxall" :style="{ height: !panelSettings.deviceBorrowRanking ? '670px' : '310px', overflow: 'hidden' }">
 									<div class="alltitle">活跃用户排名</div>
 									<div class="navboxall">
 										<div class="wraptit">
@@ -900,21 +900,29 @@ export default defineComponent({
 			echart3.setOption(option);
 		};
 
+		const formatRange = (s) => {
+			const m = String(s).match(/^(\d{1,2})-(\d{1,2})至(\d{1,2})-(\d{1,2})$/);
+			if (!m) return s;
+			const [, m1, d1, m2, d2] = m;
+			return m1 === m2 ? `${m1}-${d1}至${d2}` : `${m1}-${d1}至${m2}-${d2}`;
+			};
 
 		//更新利用趋势图
 		const updateMonthlyUtilizationChart = (monthlyData: Array<{ date: string; utilization_rate: number }>) => {
 			const echart5 = echarts.init(document.getElementById('echart5'));
 			if (!echart5) return;
 			console.log(monthlyData);
+			
+
 			const option = {
 				xAxis: {
 					type: 'category',
-					data: monthlyData.map(item => item.date),
+					data:  monthlyData.map(item => formatRange(item.date)),
 					axisLabel: { 
 						color: '#fff',
-						rotate: 0, // 旋转45度,避免标签重叠
+						rotate: 20, // 旋转45度,避免标签重叠
 						interval: 0, // 显示所有标签
-						fontSize: 10, // 调整字体大小
+						fontSize: 12, // 调整字体大小
 						margin: 15 // 增加标签与轴的距离
 					},
 					axisTick: {
@@ -927,7 +935,7 @@ export default defineComponent({
 				},
 				series: [
 					{
-						name: '月度利用率',
+						name: '利用率',
 						type: 'line', // 或 'bar',看你想要什么样的图
 						data: monthlyData.map(item => item.utilization_rate),
 						smooth: true,

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

@@ -22,14 +22,6 @@
           <el-select multiple clearable v-model="deviceTagIds" placeholder="标签名" collapse-tags style="margin-left: 30%; width: 100px;"
             @change="fetchRanking">
             <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>
@@ -124,6 +116,11 @@ const getList = async () => {
   })
   if (res.code === 2000) {
     labelType.value = res.data
+    // 若未从本地恢复过选择,初始化为“全选”并刷新数据
+    if (!deviceTagIds.value.length && Array.isArray(labelType.value) && labelType.value.length) {
+      deviceTagIds.value = labelType.value.map(item => item.id)
+      fetchRanking()
+    }
   }
 }
 

+ 6 - 6
src/views/system/screenconsole/component/BorrowTrendsChart.vue

@@ -67,9 +67,9 @@
   }
   
   const ranges = [
-    { label: '近一周', value: 'week' },
-    { label: '近一个月', value: 'month' },
-    { label: '近一年', value: 'year' }
+    { label: '周', value: 'week' },
+    { label: '月', value: 'month' },
+    { label: '年', value: 'year' }
   ]
   
   const selectedRange = ref('week')
@@ -101,7 +101,7 @@
       trigger: 'axis'
     },
     legend: {
-      data: ['借用次数', '使用时长']
+      data: ['借用次数']/* , '使用时长' */
     },
     xAxis: {
       type: 'category',
@@ -122,7 +122,7 @@
           color: '#409EFF'
         }
       },
-      {
+     /*  {
         name: '使用时长',
         type: 'bar',
         data: durations,
@@ -130,7 +130,7 @@
         itemStyle: {
           color: '#67C23A'
         }
-      }
+      } */
     ]
   }
 })

+ 5 - 3
src/views/system/studentInfo/crud.tsx

@@ -138,7 +138,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 				},
 				password:{
 					title: '密码',
-					type: 'input',
+					type: 'password',
 					column: {
 						minWidth: 120,
 						show: false,
@@ -162,9 +162,11 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 									const hasLetter = /[a-zA-Z]/.test(value);
 									// 检查是否包含数字
 									const hasNumber = /[0-9]/.test(value);
+									// 检查是否包含特殊符号
+									const hasSpecial = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~]/.test(value);
 									
-									if (!hasLetter || !hasNumber) {
-										callback(new Error('密码必须包含字母和数字'));
+									if (!hasLetter || !hasNumber || !hasSpecial) {
+										callback(new Error('密码必须包含字母、数字和特殊符号'));
 										return;
 									}
 									callback();

+ 33 - 2
src/views/system/teacherInfor/crud.tsx

@@ -123,18 +123,49 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 				},
 				password:{
 					title: '密码',
-					type: 'input',
+					type: 'password',
 					column: {
 						minWidth: 120,
 						show: false,
 					},
 					form: {
 						component: { placeholder: '请填写密码' },
+						/* rules: [
+							{ required: true, message: '请填写密码' },
+							
+						], */
 						
 					},
 					addForm:{ 
 						component:{placeholder: '请填写密码'} ,
-						rules: [{ required: true, message: '请填写密码' }],}, 
+						rules: [{ required: true, message: '请填写密码' },
+							{
+								validator: (rule: any, value: string, callback: Function) => {
+									if (!value) {
+										callback();
+										return;
+									}
+									// 检查密码长度不少于8位
+									if (value.length < 8) {
+										callback(new Error('密码长度不能少于8位'));
+										return;
+									}
+									// 检查是否包含字母
+									const hasLetter = /[a-zA-Z]/.test(value);
+									// 检查是否包含数字
+									const hasNumber = /[0-9]/.test(value);
+									// 检查是否包含特殊符号
+									const hasSpecial = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~]/.test(value);
+									
+									if (!hasLetter || !hasNumber || !hasSpecial) {
+										callback(new Error('密码必须包含字母、数字和特殊符号'));
+										return;
+									}
+									callback();
+								},
+								trigger: 'blur'
+							}
+						],}, 
 					editForm:{
 						show:true,
 					},