浏览代码

Merge branch 'master' of http://120.26.64.82:3000/BFFE/SZYGM1.0

chenjun 2 年之前
父节点
当前提交
ca0d890c76

+ 12 - 9
src/views/baggageManagement/components/CountBox/index.vue

@@ -17,6 +17,13 @@ const props = defineProps({
     type: Number,
     default: 0,
   },
+  length: {
+    type: Number,
+    default: 6,
+    validator(value: number) {
+      return value > 0
+    },
+  },
   label: {
     type: String,
     default: '总数',
@@ -25,16 +32,12 @@ const props = defineProps({
 const numberBoxes = ref<HTMLInputElement[] | undefined[]>([])
 const numberItems = computed(() => {
   let numberString = props.countNumber.toString()
-  if (numberString.length > 6) {
-    ElMessage({
-      message: `${props.label}过大`,
-      type: 'error',
-      duration: 2 * 1000,
-    })
-    numberString = '999999'
+  if (numberString.length > props.length) {
+    ElMessage.error(`${props.label}过大`)
+    numberString = '9'.repeat(props.length)
   }
-  numberString = '000000' + numberString
-  return numberString.slice(-6).split('')
+  numberString = '0'.repeat(props.length) + numberString
+  return numberString.slice(-props.length).split('')
 })
 watch(numberItems, items => {
   for (let index = 0; index < numberBoxes.value.length; index++) {

+ 6 - 5
src/views/baggageManagement/components/TableSwitch/index.vue

@@ -4,11 +4,7 @@
       v-model="flag"
       size="default"
       style="--el-switch-on-color: #ac014d; --el-switch-off-color: #b1b1b1"
-      @change="
-        (val: number) => {
-          emit('update:flag', val)
-        }
-      "
+      @change="updateFlag"
     />
     <span class="switch-label">{{ label }}</span>
   </div>
@@ -24,7 +20,12 @@ const props = defineProps({
     type: String,
   },
 })
+
 const emit = defineEmits(['update:flag'])
+
+const updateFlag = (val: boolean) => {
+  emit('update:flag', val)
+}
 </script>
 
 <style scoped lang="scss">

+ 4 - 1
src/views/baggageManagement/style/station.scss

@@ -29,6 +29,7 @@
     :deep .el-table-v2 {
       .el-table-v2__header-cell,
       .el-table-v2__row-cell {
+        padding: 0;
         &:not(:last-child) {
           border-right: 1px solid #dfe3ea;
         }
@@ -77,12 +78,14 @@
                 top: 0;
                 left: 0;
                 z-index: 0;
-                background-color: transparent;
+                display: none;
               }
               &.cell-warning .cell-background {
+                display: block;
                 background-color: #f6cda5;
               }
               &.cell-error .cell-background {
+                display: block;
                 background-color: #f38080;
               }
             }