Jelajahi Sumber

格式化处理

tongshangming 1 tahun lalu
induk
melakukan
2c426207d0

+ 2 - 2
src/components/form/ElSubForm.vue

@@ -31,7 +31,7 @@ const handleDelete = (index: number) => {
 <template>
   <div class="w-full">
     <el-button type="primary" @click="handleAdd" icon="plus" plain class="mb-2" size="default">添加</el-button>
-    <div class="flex item" v-for="(item, index) in formItem.value">
+    <div class="flex item" v-for="(item, index) in formItem.value" :key="index">
       <div class="w-60px">
         <el-button class="index" type="primary" size="small" plain round>#{{ index + 1 }}</el-button>
         <el-button
@@ -47,7 +47,7 @@ const handleDelete = (index: number) => {
 
       <div class="flex-grow">
         <el-form-item
-          v-for="child in formItem.children"
+          v-for="(child, index) in formItem.children"
           :key="index"
           :label="child.label"
           :rules="child.rules"

+ 1 - 1
src/components/splitpanes/PaneModel.vue

@@ -14,7 +14,7 @@ interface configType {
   config?: Props
 }
 
-const props = withDefaults(defineProps<configType>(), {
+withDefaults(defineProps<configType>(), {
   config: () => ({
     size: 20
   })

+ 1 - 1
src/views/form/Basic.vue

@@ -182,7 +182,7 @@ const formConfig = reactive<BasicForm>({
         }
       ],
       events: {
-        change(item: any) {
+        change() {
           formData.name = 'c'
           formConfig.formItems[1].hidden = true
         }

+ 1 - 1
src/views/form/Tab.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import type { BasicForm, ICRUD } from '@/types/form'
+import type { BasicForm } from '@/types/form'
 
 const formData = reactive<any>({})
 

+ 0 - 2
src/views/monitor/MessageNotif.vue

@@ -1,8 +1,6 @@
 <script setup lang="ts">
 import type { BasicForm, ICRUD } from '@/types/form'
 
-const curRow = ref<any>(null)
-
 const CRUD: ICRUD = {
   create(data: any) {
     console.log(data)

+ 4 - 9
src/views/system/Area.vue

@@ -1,14 +1,9 @@
 <script lang="ts" setup>
 import PaneModel from '@/components/splitpanes/PaneModel.vue'
 import { ElTree } from 'element-plus'
-import type { BasicForm, ICRUD } from '@/types/form'
+import type { BasicForm } from '@/types/form'
 import { getAreaList } from '@/api/area'
-interface Tree {
-  id: number
-  label: string
-  children?: Tree[]
-  icon?: string
-}
+
 const config = {
   size: 20,
   lMinSize: 20
@@ -92,10 +87,10 @@ const ruleForm = ref({
 const addArea = () => {
   dialogVisible.value = true
 }
-const submitForm = (data: any) => {
+const submitForm = () => {
   dialogVisible.value = false
 }
-const resetForm = (data: any) => {
+const resetForm = () => {
   dialogVisible.value = false
 }
 </script>

+ 0 - 7
src/views/system/menu.vue

@@ -69,13 +69,6 @@ const handleNodeClick = (val: any) => {
 }
 const changeType = (val: number) => {
   console.log(val)
-  if (val == 1) {
-    const arr = [4, 5, 8, 9, 10]
-  } else if (val == 3) {
-    const arr = [6, 7, 8, 9]
-  } else if (val == 4) {
-    const arr = [5, 6, 7, 8, 9, 10]
-  }
 }
 const formConfig = reactive<BasicForm>({
   span: 24,