Преглед изворни кода

fix: model pro 自定义拖拽

lvkun пре 3 година
родитељ
комит
af5fd93299

+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="logo.ico">
-    <title>7788</title>
+    <title>蛟龙云联</title>
   </head>
   <body>
     <noscript>

+ 11 - 0
src/components/FormPro/index.vue

@@ -0,0 +1,11 @@
+<template>
+
+</template>
+
+<script lang='ts' setup >
+
+</script>
+
+<style lang="less" scope >
+
+</style>

+ 2 - 15
src/components/ModalPro/index.vue

@@ -8,12 +8,12 @@
     v-bind="{
       cancelText: '取消',
       okText: '确定',
-      ...propsState
+      ...props
     }"
     :confirmLoading="state.confirmLoading"
   >
     <template #title>
-      <div ref="modalTitleRef" style="width: 100%; cursor: move">{{propsState.label || 'model'}}</div>
+      <div ref="modalTitleRef" style="width: 100%; cursor: move">{{props.label || 'model'}}</div>
     </template>
     <template #modalRender="{ originVNode }">
       <div :style="transformStyle">
@@ -43,19 +43,6 @@ const emit = defineEmits<{
 
 const props = defineProps<ModalProPorps>()
 
-const propsState = reactive(props)
-
-watch(
-  () => props.title,
-  () => {
-    propsState.label = props.title
-    delete propsState.title
-  },
-  {
-    immediate: true
-  }
-)
-
 interface StateProps {
   confirmLoading: boolean
 }

+ 10 - 12
src/components/TablePro/index.vue

@@ -1,12 +1,14 @@
 <template>
-  <a-table
-    style="width: 100%;"
-    v-bind="{...props}"
-    :dataSource="state.data"
-    :loading="state.loading"
-    :pagination="state.pagination"
-    @change="handleTableChange"
-  />
+  <a-row>
+    <a-table
+      style="width: 100%;"
+      v-bind="{...props}"
+      :dataSource="state.data"
+      :loading="state.loading"
+      :pagination="state.pagination"
+      @change="handleTableChange"
+    />
+  </a-row>
 </template>
 
 <script lang="ts" setup >
@@ -55,10 +57,6 @@ watch(
   }
 )
 
-onMounted(() => {
-
-})
-
 </script>
 
 <style>

+ 3 - 4
src/layout/navbar.vue

@@ -1,12 +1,12 @@
 <template>
   <a-layout-header class="header">
       <a-row style="width: 100%;"  >
-        <a-col :span="2" >
+        <a-col :span="3" >
           <div class="logo" >
             logo
           </div>
         </a-col>
-        <a-col :span="20" >
+        <a-col :span="19" >
         <a-menu
           theme="dark"
           mode="horizontal"
@@ -17,13 +17,12 @@
             v-for="route in appRouter.$state.router.navbar.route"
             :key="route.path"
             @click="changeRouter(route.path)"
-
           >
             {{route.name}}
           </a-menu-item>
           </a-menu>
         </a-col>
-        <a-col :span="2" >
+        <a-col :span="1" >
           <user />
         </a-col>
       </a-row>

+ 1 - 1
src/pages/Iot/index.vue

@@ -5,7 +5,7 @@
     <a-button type="primary"  @click="openModal" >上传背景</a-button>
     <modal-pro
       :visible="state.visible"
-      title="我是标题"
+      label="我是标题"
       @ok="ok"
       @close="state.visible = false"
     />