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

+ 3 - 0
src/views/system/allusers/crud.tsx

@@ -266,6 +266,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}),
 					form: {
 						component: { placeholder: '请填写租户' },
+
+
+						
 						rules: [{ required: false, message: '请填写租户' }],
 					},
 				},

+ 14 - 5
src/views/system/device/crud.tsx

@@ -491,7 +491,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 
 					}
 				},
-				/* warehouse:{
+				warehouse:{
 					title:'存放仓库',
 					search: { show: true },
 					type:"dict-select",
@@ -505,7 +505,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: { placeholder: '请选择存放仓库' },
 						rules: [{ required: true, message: '请选择存放仓库' }],
 					}
-				}, */
+				},
 				status:{
 					title:'是否可见',
 					type: 'dict-switch',
@@ -518,10 +518,19 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							inactiveText: '',
 							style: '--el-switch-on-color: var(--el-color-primary); --el-switch-off-color: #dcdfe6',
 							onChange: compute((context) => {
+								let isInitialized = false;
+								// 延迟设置初始化完成标志,避免初始化时触发
+								setTimeout(() => {
+									isInitialized = true;
+								}, 100);
+								
 								return () => {
-									api.UpdateObjStatus(context.row).then((res:APIResponseData) => {
-										successMessage(res.msg as string);
-									});
+									// 只有在初始化完成后才执行API调用
+									if (isInitialized) {
+										api.UpdateObjStatus(context.row).then((res:APIResponseData) => {
+											successMessage(res.msg as string);
+										});
+									}
 								};
 							}),
 						},

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

@@ -1,4 +1,4 @@
-import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet,dict, UserPageQuery,compute } from '@fast-crud/fast-crud';
+import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet,dict, UserPageQuery,compute, InfoReq, EditReq, DelReq } from '@fast-crud/fast-crud';
 import * as api from './api';
 import { auth } from '/@/utils/authFunction';
 import { computed } from 'vue';
@@ -184,7 +184,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					dict: dict({
 						data: [
 							{ label: '启用', value: true },
-							{ label: '禁用', value: false },
+							{ label: '禁用', value: false,color: "danger" },
 						],
 					}),
 					form: {

+ 1 - 1
src/views/system/devicedamage/crud.tsx

@@ -210,7 +210,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					dict: dict({
-						url: '/api/system/device/',
+						url: '/api/system/device/?has_inventory=1',
 						value: 'id',
 						label: 'name',
 					}),

+ 7 - 7
src/views/system/devicemaintenance/crud.tsx

@@ -196,7 +196,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 						minWidth: 120,
 					},
 					dict: dict({
-						url: '/api/system/device/',
+						url: '/api/system/device/?has_inventory=1',
 						value: 'id',
 						label: 'name',
 					}),
@@ -586,14 +586,14 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 					title: '维修状态',
 					type: 'dict-select',
 					column: {
-						show:false,
+						show:true,
 						minWidth: 120,
 					},
 					dict: dict({
 						data: [
-							{ label: '待维修', value: 1 },
-							{ label: '维修中', value: 2 },
-							{ label: '维修完成', value: 3 },
+							{ label: '待维修', value: 1 ,color: "warning"},
+							{ label: '维修中', value: 2 ,color: "primary"},
+							{ label: '维修完成', value: 3,color: "success" },
 						],
 					}),
 					form: {
@@ -612,7 +612,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 						rules: [{ required: true, message: '' }],
 					}
 				},
-				status_display:{
+				/* status_display:{
 					title: '维修状态',
 					type: 'input',
 					column: {
@@ -627,7 +627,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 						component: { placeholder: '' },
 						rules: [{ required: true, message: '' }],
 					}
-				},
+				}, */
 				remark:{
 					title: '备注',
 					type: 'input',

+ 22 - 21
src/views/system/devicemanual/crud.tsx

@@ -167,7 +167,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					dict: dict({
-						url: '/api/system/device/',
+						url: '/api/system/device/?has_inventory=1',
 						value: 'id',
 						label: 'name',
 					}),
@@ -236,42 +236,43 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show:true,
 					},
 				}, */
-				article_title: {//article_title
-					title: '文章标题',//'设备名称',
-					search: {
-						show: true,
-					},
-					treeNode: true,
+				
+				
+				device_name:{
+					title: '设备名称',
 					type: 'input',
 					column: {
 						minWidth: 120,
 					},
 					form: {
-						show:true,
-						rules: [
-							// 表单校验规则
-							{ required: true, message: '名称必填项' },
-						],
-						component: {
-							placeholder: '请输入名称',
-						},
+						show:false,
+						component: { placeholder: '请填设备名称' },
+						rules: [{ required: false, message: '请填写设备名称' }],
 					},
 					viewForm:{
 						component: { placeholder: '' },
 						rules: [{ required: true, message: '' }],
 					}
 				},
-				
-				device_name:{
-					title: '设备名称',
+				article_title: {//article_title
+					title: '手册标题',//'设备名称',
+					search: {
+						show: true,
+					},
+					treeNode: true,
 					type: 'input',
 					column: {
 						minWidth: 120,
 					},
 					form: {
-						show:false,
-						component: { placeholder: '请填设备名称' },
-						rules: [{ required: false, message: '请填写设备名称' }],
+						show:true,
+						rules: [
+							// 表单校验规则
+							{ required: true, message: '手册标题必填项' },
+						],
+						component: {
+							placeholder: '请输入手册标题',
+						},
 					},
 					viewForm:{
 						component: { placeholder: '' },

+ 1 - 1
src/views/system/devicepreserve/crud.tsx

@@ -226,7 +226,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					dict: dict({
-						url: '/api/system/device/',
+						url: '/api/system/device/?has_inventory=1',
 						value: 'id',
 						label: 'name',
 					}),

+ 1 - 1
src/views/system/devicepreserveplan/crud.tsx

@@ -219,7 +219,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					dict: dict({
-						url: '/api/system/device/',
+						url: '/api/system/device/?has_inventory=1',
 						value: 'id',
 						label: 'name',
 					}),

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

@@ -5,22 +5,28 @@
       <!--  <div class="more">更多</div> -->
     </div>
     <div class="panel-header">
-      <el-row :gutter="24">
-        <el-col :span="6">
-          <el-select v-model="borrowType" clearable placeholder="借用类型" style="width: 140px;" @change="fetchRanking">
+      <el-row :gutter="16">
+        <el-col :span="4">
+          <el-select v-model="borrowType" clearable placeholder="借用类型" style="width: 100%;" @change="fetchRanking">
             <el-option label="全部" value="all" />
             <el-option label="常规借用" value="regular" />
             <el-option label="课堂借用" value="classroom" />
             <el-option label="特殊借用" value="special" />
           </el-select>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="10">
           <el-date-picker v-model="dateRange" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" clearable
-            @change="fetchRanking" />
+            @change="fetchRanking" style="width: 100%;" />
         </el-col>
-        <el-col :span="6">
-          <el-select multiple clearable v-model="deviceTagIds" placeholder="标签名" collapse-tags style="margin-left: 30%; width: 100px;"
-            @change="fetchRanking">
+        <el-col :span="10">
+          <el-select 
+            multiple 
+             
+            v-model="deviceTagIds" 
+            placeholder="标签名" 
+            style="width: 270px;"
+            @change="fetchRanking"
+            class="select-tags">
             <el-option v-for="item in labelType" :key="item.id" :label="item.name" :value="item.id" >
             </el-option>
           </el-select>
@@ -256,6 +262,7 @@ onMounted(() => {
 }
 
 .panel-header {
+  width: 100%;
   display: flex;
   align-items: center;
   flex-wrap: wrap;
@@ -290,4 +297,36 @@ onMounted(() => {
 :deep(.el-table__inner-wrapper::before) {
   display: none;
 }
+
+/* 多选下拉框样式优化 */
+:deep(.el-select__tags) {
+  max-width: 100%;
+  overflow: hidden;
+  white-space: nowrap;
+  flex-wrap: nowrap;
+}
+
+:deep(.el-tag) {
+  margin-right: 6px;
+  margin-bottom: 0;
+  max-width: 120px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+:deep(.el-select__input) {
+  min-width: 60px;
+}
+:deep(.select-tags .el-select__selection){
+  overflow: auto;
+  flex-wrap: nowrap;
+  /* 隐藏滚动条 */
+  scrollbar-width: none; /* Firefox */
+  -ms-overflow-style: none; /* IE and Edge */
+}
+
+:deep(.select-tags .el-select__selection)::-webkit-scrollbar {
+  display: none; /* Chrome, Safari and Opera */
+}
 </style>