huangbin преди 4 години
родител
ревизия
21f9116698
променени са 2 файла, в които са добавени 24 реда и са изтрити 22 реда
  1. 19 20
      src/layout/components/main.vue
  2. 5 2
      src/views/market/spot_trade/components/buy-sell-market/components/sell/index.vue

+ 19 - 20
src/layout/components/main.vue

@@ -1,21 +1,20 @@
 <template>
-    <div class="exposure">
-        <div class="first-menu">
-            <a-menu
-                class="a-menu_container"
-                theme="dark"
-                v-model:selectedKeys="selectedKey"
-                @click="selectMenu"
-                mode="horizontal"
-            >
-                <a-menu-item :key="String(index)" v-for="(item, index) in list">{{ item.title}}</a-menu-item>
-            </a-menu>
-            <div class="menu_right">
-                <!-- <slot></slot> -->
-            </div>
-        </div>
-        <router-view />
+  <div class="exposure">
+    <div class="first-menu">
+      <a-menu class="a-menu_container"
+              theme="dark"
+              v-model:selectedKeys="selectedKey"
+              @click="selectMenu"
+              mode="horizontal">
+        <a-menu-item :key="String(index)"
+                     v-for="(item, index) in list">{{ item.title}}</a-menu-item>
+      </a-menu>
+      <div class="menu_right">
+        <!-- <slot></slot> -->
+      </div>
     </div>
+    <router-view />
+  </div>
 </template>
 
 <script lang="ts">
@@ -32,10 +31,10 @@ export default defineComponent({
         const selectedKey = inject('index');
         // 切换路由
         function selectMenu(value: any) {
-            const index = +value.key;
-            console.log(router);
-
-            router.push({ name: list.value[index].code });
+            if (((selectedKey as unknown) as any).value[0] !== value.key) {
+                const index = +value.key;
+                router.push({ name: list.value[index].code });
+            }
         }
         return { selectMenu, list, selectedKey };
     },

+ 5 - 2
src/views/market/spot_trade/components/buy-sell-market/components/sell/index.vue

@@ -97,8 +97,11 @@ export default defineComponent({
             isDetail: false,
         };
         function handleColumn(columns: ColumnType[]) {
-            const item = columns[1];
-            delete item.width;
+            columns.forEach((item) => {
+                if (item.dataIndex !== 'index') {
+                    delete item.width;
+                }
+            });
             return columns;
         }
         return {