Selaa lähdekoodia

修改客户资料

huangbin 4 vuotta sitten
vanhempi
commit
2946b65625

+ 62 - 14
src/layout/components/main.vue

@@ -1,34 +1,41 @@
 <template>
   <div class="exposure">
-    <firstMenu :list="list"
-               :value="'title'"
-               :selectedKey="selectedKey"
-               @selectMenu="selectMenu" />
+    <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">
 import { defineComponent, inject, Ref } from 'vue';
-import firstMenu from '@/common/components/firstMenu/index.vue';
 import { useRouter } from 'vue-router';
 import { OperationTabMenu } from '@/services/go/commonService/interface';
 
 export default defineComponent({
     name: 'main',
-    components: {
-        firstMenu,
-    },
+    components: {},
     setup() {
         const router = useRouter();
         const list = inject('thirdMenuList') as Ref<OperationTabMenu[]>;
         const selectedKey = inject('index');
-
         // 切换路由
-        function selectMenu(item: OperationTabMenu) {
-            router.push({ name: item.code });
+        function selectMenu(value: any) {
+            const index = +value.key;
+            router.push({ name: list.value[index].code });
         }
-
         return { selectMenu, list, selectedKey };
     },
 });
@@ -37,5 +44,46 @@ export default defineComponent({
 <style lang="less">
 .sexposure {
 }
-</style
->;
+.noBorderBottom {
+    border-bottom: none;
+}
+.first-menu {
+    width: 100%;
+    height: 40px;
+    border-bottom: 1px solid @m-blue0 !important;
+    background-color: @m-black1;
+    .a-menu_container {
+        padding-top: 5px;
+        .flex();
+        height: 34px;
+        line-height: 34px;
+        .ant-menu-item {
+            min-width: 120px;
+            height: 34px;
+            line-height: 34px;
+            background: linear-gradient(0deg, #343d46 0%, #38444f 100%);
+            margin-left: 3px;
+            font-size: 16px;
+            columns: @m-grey2;
+            border-radius: 5px 5px 0px 0px;
+            cursor: pointer;
+            font-family: Adobe Heiti Std;
+            font-weight: normal;
+            &:hover {
+                .noBorderBottom;
+            }
+        }
+        .ant-menu-item-active {
+            .noBorderBottom;
+        }
+        .ant-menu-item-selected {
+            .noBorderBottom;
+            color: @m-white;
+            background: linear-gradient(0deg, #3270d2 0%, #3a87f7 100%);
+            &:hover {
+                color: @m-white;
+            }
+        }
+    }
+}
+</style>;

+ 11 - 15
src/layout/components/top.vue

@@ -22,13 +22,10 @@
   </a-layout>
 </template>
 <script lang="ts">
-import { UserOutlined } from '@ant-design/icons-vue';
-import { defineComponent, ref, provide, unref } from 'vue';
+import { defineComponent, ref, provide } from 'vue';
 import Setting from '@/views/setting/index.vue';
 import CapitalInfo from '@/common/components/capitalInfo/index.vue';
 import SecondMenu from '@/common/components/secondeMenu/index.vue';
-import APP from '@/services';
-import { initData } from '@/common/methods';
 import { useRouter } from 'vue-router';
 import Drawer from '@/common/components/drawer/index.vue';
 import Header from './header.vue';
@@ -36,18 +33,10 @@ import Menu from './menu.vue';
 import Main from './main.vue';
 import { OperationTabMenu } from '@/services/go/commonService/interface';
 
-//     // 配置是否显示下半部分
-//     function setShowBottomPart(code: string): boolean {
-//         // 显示下半部分 这里保存的是市场对应的 code
-//         const show: string[] = [''];
-//         return show.includes(code);
-//     }
-
 export default defineComponent({
     name: 'layout-top',
     components: {
         Setting,
-        UserOutlined,
         CapitalInfo,
         SecondMenu,
         Drawer,
@@ -57,8 +46,8 @@ export default defineComponent({
     },
     setup(props, context) {
         const router = useRouter();
-        const list = ref<OperationTabMenu[]>([]);
-        const index = ref<string[]>(['0']);
+        const list = ref<OperationTabMenu[]>([]); // 右边tab栏 需要的列表数据
+        const index = ref<string[]>(['0']); // 右边tab栏 具体选中的哪一个数据 默认第一个
         // 配置是否显示下半部分
         function setShowBottomPart(code: string) {
             // 显示下半部分 这里保存的是市场对应的 code
@@ -70,11 +59,18 @@ export default defineComponent({
             const temp = router.currentRoute.value.name;
             let name = temp;
             if (temp === 'home') {
+                // 第一次进入项目
                 name = value.code;
             } else {
                 // 这里处理页面刷新,还原 导航栏数据
                 const i = value.children.findIndex((e) => e.code === temp);
-                index.value = [`${i}`];
+                if (i === -1) {
+                    // 切换左边菜单栏
+                    name = value.code;
+                } else {
+                    // 切换右边上面tab 栏
+                    index.value = [`${i}`];
+                }
             }
             list.value = value.children;
             setShowBottomPart(value.code);

+ 9 - 26
src/views/information/custom/list/stop-use/index.vue

@@ -4,8 +4,9 @@
        :loading="loading">
     <filterCustomTable @search="search">
       <a-button class="operBtn"
-                v-if="hasPermission('custom_info_btn_add')"
-                @click="addAction">新增</a-button>
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
     </filterCustomTable>
     <contextMenu :contextMenuList="contextMenuList"
                  :tableList="customList">
@@ -25,25 +26,22 @@
     <CustomDetail />
     <!-- 删除 -->
     <DeleteCustom />
-    <!-- 恢复客户资料 -->@/common/methods
+    <!-- 恢复客户资料 -->
     <RecoverCustom />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
-
+import { defineComponent } from 'vue';
 import { initData } from '@/common/methods/index';
 import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
-import { MenuItem } from '@/common/components/contextMenu/interface';
 import contextMenu from '@/common/components/contextMenu/index.vue';
 import { getCustomList } from '../setup';
-import { openModal } from '@/common/setup/modal/index';
 import CustomDetail from '@/views/information/custom/compoments/detail/index.vue';
 import DeleteCustom from '@/views/information/custom/compoments/delete/index.vue';
 import RecoverCustom from '@/views/information/custom/compoments/recover/index.vue';
 import AddCustom from '@/views/information/custom/compoments/add/index.vue';
-import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
+import { getBtnList } from '@/common/setup/contextMenu/index';
 
 export default defineComponent({
     name: 'custom-normal',
@@ -57,27 +55,13 @@ export default defineComponent({
     },
     setup() {
         const { customList, actionQuery, columns, getColumns, search, loading } = getCustomList();
-        const { hasPermission } = handlePermission('custom_info_normal');
-        const contextMenuList = ref<MenuItem[]>([]);
-
-        const { openAction: addAction } = openModal('custom_info_btn_add');
-
-        detailButton('detail', contextMenuList);
-        const { action: deleteAction } = permissionButton('custom_info_btn_delete', '删除', contextMenuList);
-        const { action: recoverAction } = permissionButton('custom_info_btn_recover', '恢复', contextMenuList);
+        const { commonBtn, forDataBtn } = getBtnList('custom_info_disabled');
 
-        const stop = watchEffect(() => {
-            hasPermission('custom_info_btn_recover') && recoverAction();
-            hasPermission('custom_info_btn_delete') && deleteAction();
-        });
-        onUnmounted(() => {
-            stop();
-        });
         initData(() => {
             actionQuery(4);
             getColumns();
         });
-        return { customList, columns, search, loading, contextMenuList, hasPermission, addAction };
+        return { customList, columns, search, loading, commonBtn, forDataBtn };
     },
 });
 </script>
@@ -85,5 +69,4 @@ export default defineComponent({
 <style lang="less">
 .custom-normal {
 }
-</style
->;
+</style>;