li.shaoyi 3 år sedan
förälder
incheckning
09f1532709

+ 6 - 6
src/business/customer/index.ts

@@ -55,7 +55,7 @@ export function useCustomer(queryType: CustomerQueryType) {
 export function useCustomerForm(selectedRow?: Ermcp.CustomerInfoRsp) {
     const loginUserId = sessionData.getLoginInfo('UserID')
     const loading = ref(false)
-    const formItem = ref<Proto.CustomerInfoOperateReq>({
+    const formData = ref<Proto.CustomerInfoOperateReq>({
         operatetype: 1,
         userinfotype: UserInfoType.Enterprise,
         userid: loginUserId,
@@ -80,7 +80,7 @@ export function useCustomerForm(selectedRow?: Ermcp.CustomerInfoRsp) {
 
     if (selectedRow?.userid) {
         const { userinfotype, userid, username, nickname, cardtype, cardnum, cardfrontphotourl, cardbackphotourl, legalpersonname, mobile, address, email, taxpayernum, proxystatementurl, contactname, telphone, provinceid, cityid, districtid, remark, customername } = selectedRow
-        formItem.value = {
+        formData.value = {
             operatetype: 2,
             userinfotype,
             userid,
@@ -114,7 +114,7 @@ export function useCustomerForm(selectedRow?: Ermcp.CustomerInfoRsp) {
             // 正常状态的修改
             return userInfoOperate({
                 data: {
-                    ...formItem.value,
+                    ...formData.value,
                     operatesrc: 2,
                     operateid: loginUserId,
                 },
@@ -123,11 +123,11 @@ export function useCustomerForm(selectedRow?: Ermcp.CustomerInfoRsp) {
                 }
             })
         } else {
-            const { userinfotype, cardtype, username, customername, nickname } = formItem.value
+            const { userinfotype, cardtype, username, customername, nickname } = formData.value
             // 新增或未提交状态的修改
             return customerInfoOperate({
                 data: {
-                    ...formItem.value,
+                    ...formData.value,
                     username: username || customername,
                     customername: customername || username,
                     nickname: nickname || username,
@@ -141,7 +141,7 @@ export function useCustomerForm(selectedRow?: Ermcp.CustomerInfoRsp) {
     }
 
     return {
-        formItem,
+        formData,
         loading,
         updateCustomerInfo,
     }

+ 2 - 16
src/components/base/modal/index.less

@@ -29,22 +29,8 @@
     }
 
     &__container {
-        display       : inline-flex;
-        flex-direction: column;
-        max-width     : 100%;
-        max-height    : 100%;
-    }
-
-    &__container &__header,
-    &__container &__footer {
-        &:empty {
-            display: none;
-        }
-    }
-
-    &__container &__body {
-        flex      : 1;
-        overflow-y: auto;
+        max-width : 100vw;
+        max-height: 100vh;
     }
 
     /* 全屏 */

+ 105 - 88
src/components/base/modal/index.vue

@@ -5,110 +5,127 @@
             <div :class="['app-modal__mask', transitionClass]" :style="transitionStyles"></div>
             <div :class="['app-modal__wrapper', direction]" @click.self="onMask">
                 <div :class="['app-modal__container', transitionClass]" :style="containerStyles">
-                    <div class="app-modal__header">
-                        <slot name="header"></slot>
-                    </div>
-                    <div class="app-modal__body">
-                        <slot></slot>
-                    </div>
-                    <div class="app-modal__footer">
-                        <slot name="footer"></slot>
-                    </div>
+                    <slot></slot>
                 </div>
             </div>
         </div>
     </teleport>
 </template>
 
-<script lang="ts" setup>
-import { computed, watch, PropType } from 'vue';
+<script lang="ts">
+import { defineComponent, computed, watch, PropType } from 'vue'
 import { useModal } from './index'
 
-const emit = defineEmits(['mask', 'opened', 'closed']);
-
-const props = defineProps({
-    show: {
-        type: Boolean,
-        default: false,
-    },
-    // 窗口关闭后是否刷新
-    refresh: {
-        type: Boolean,
-        default: false,
-    },
-    // 是否可以点击遮罩关闭窗口
-    closeOnClickMask: {
-        type: Boolean,
-        default: true,
-    },
-    // 窗口插入到指定元素
-    teleport: {
-        type: String,
-        default: 'body',
-    },
-    // 绝对定位
-    fixed: {
-        type: Boolean,
-        default: true,
-    },
-    // 遮罩堆叠顺序
-    zIndex: {
-        type: Number,
-        default: 1000,
-    },
-    // 窗口动画时间
-    delay: {
-        type: Number,
-        default: 300,
-    },
-    // 窗口弹出方向
-    direction: {
-        type: String as PropType<'full' | 'center' | 'left' | 'right' | 'top' | 'bottom' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom'>,
-        default: 'center',
+export default defineComponent({
+    inheritAttrs: false,
+    emits: ['mask', 'opened', 'closed'],
+    props: {
+        show: {
+            type: Boolean,
+            default: false,
+        },
+        // 窗口关闭后是否刷新
+        refresh: {
+            type: Boolean,
+            default: false,
+        },
+        // 是否可以点击遮罩关闭窗口
+        closeOnClickMask: {
+            type: Boolean,
+            default: true,
+        },
+        // 窗口插入到指定元素
+        teleport: {
+            type: String,
+            default: 'body',
+        },
+        // 绝对定位
+        fixed: {
+            type: Boolean,
+            default: true,
+        },
+        // 遮罩堆叠顺序
+        zIndex: {
+            type: Number,
+            default: 1000,
+        },
+        // 窗口动画时间
+        delay: {
+            type: Number,
+            default: 300,
+        },
+        // 窗口弹出方向
+        direction: {
+            type: String as PropType<'full' | 'center' | 'left' | 'right' | 'top' | 'bottom' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom'>,
+            default: 'center',
+        },
+        // 窗口宽度
+        width: {
+            type: [Number, String],
+            default: 'auto',
+        },
+        // 窗口高度
+        height: {
+            type: [Number, String],
+            default: 'auto',
+        },
     },
-    // 窗口宽度
-    width: {
-        type: [Number, String],
-        default: 'auto',
-    },
-})
+    setup(props, { emit }) {
+        const { visible, transitionClass, transitionStyles, transition } = useModal(props.show, props.delay);
 
-const { visible, transitionClass, transitionStyles, transition } = useModal(props.show, props.delay);
+        const modalStyles = computed(() => ({
+            position: props.fixed ? 'fixed' : 'absolute',
+            zIndex: props.zIndex,
+        }))
 
-const modalStyles = computed(() => ({
-    position: props.fixed ? 'fixed' : 'absolute',
-    zIndex: props.zIndex,
-}))
+        const containerStyles = computed(() => {
+            const getWidth = () => {
+                const width = props.width.toString();
+                if (width.endsWith('%')) {
+                    return width;
+                }
+                return width === 'auto' ? width : width + 'px';
+            }
+            const getHeight = () => {
+                const height = props.height.toString();
+                if (height.endsWith('%')) {
+                    return height;
+                }
+                return height === 'auto' ? height : height + 'px';
+            }
+            return {
+                ...transitionStyles.value,
+                width: getWidth(),
+                height: getHeight(),
+            }
+        })
 
-const containerStyles = computed(() => {
-    const getWidth = () => {
-        const width = props.width.toString();
-        if (width.endsWith('%')) {
-            return width;
+        // 点击遮罩事件
+        const onMask = () => {
+            if (props.closeOnClickMask) {
+                emit('mask');
+            }
         }
-        return width === 'auto' ? width : width + 'px';
-    }
-    return {
-        ...transitionStyles.value,
-        width: getWidth(),
-    }
-})
 
-// 点击遮罩事件
-const onMask = () => {
-    if (props.closeOnClickMask) {
-        emit('mask');
-    }
-}
+        watch(() => props.show, (isShow) => {
+            transition(isShow, () => {
+                if (isShow) {
+                    emit('opened');
+                } else {
+                    emit('closed', props.refresh);
+                }
+            })
+        })
 
-watch(() => props.show, (isShow) => {
-    transition(isShow, () => {
-        if (isShow) {
-            emit('opened');
-        } else {
-            emit('closed', props.refresh);
+        return {
+            visible,
+            transitionClass,
+            transitionStyles,
+            modalStyles,
+            containerStyles,
+            onMask,
         }
-    })
+    }
 })
 </script>
 

+ 1 - 2
src/components/base/tabs/index.less

@@ -31,7 +31,6 @@
     }
 
     &__container {
-        flex      : 1;
-        overflow-y: auto;
+        height: 100%;
     }
 }

+ 2 - 2
src/components/base/tabs/index.vue

@@ -9,9 +9,9 @@
             </ul>
             <slot name="navbar"></slot>
         </div>
-        <div class="app-tabs__container">
+        <el-scrollbar view-class="app-tabs__container" always>
             <slot></slot>
-        </div>
+        </el-scrollbar>
     </div>
 </template>
 

+ 45 - 19
src/hooks/datatable/index.ts

@@ -4,15 +4,21 @@ import { FilterValue, FilterSelect, FilterInput, FilterButton } from './interfac
 export function useDataTable<T>() {
     // 数据源
     const dataSource = shallowRef<T[]>([])
+    // 总记录条数
+    const total = shallowRef(0)
+    // 当前页码
+    const pageIndex = shallowRef(1)
+    // 每页条数
+    const pageSize = shallowRef(20)
     // 过滤筛选值
-    const filters = shallowRef<FilterValue<T>[]>([])
+    const filters = shallowRef<FilterValue<T, keyof T>[]>([])
     // 过滤选项
-    const filterOptons: { selectList: FilterSelect<T>[], inputList: FilterInput<T>[], buttonList: FilterButton[] } = reactive({
+    const filterOptons: { selectList: FilterSelect<T, keyof T>[], inputList: FilterInput<T, keyof T>[], buttonList: FilterButton[] } = reactive({
         selectList: [],
         inputList: [],
         buttonList: [
-            { lable: '查询', className: 'el-button--info', onClick: () => onFilter() }, // 这里 className 不应该使用框架样式,以后再处理
             { lable: '重置', className: 'el-button--info', onClick: () => resetFilter() },
+            { lable: '查询', className: 'el-button--info', onClick: () => onFilter() }, // 这里 className 不应该使用框架样式,以后再解决
         ]
     })
 
@@ -25,10 +31,10 @@ export function useDataTable<T>() {
                     return e.keys.some((key) => {
                         const value = row[key]
                         if (typeof value === 'number') {
-                            return e.filteredValue.includes(String(value))
+                            return e.filteredValue.includes(value)
                         }
                         return e.filteredValue.some((text) => {
-                            return String(value).toLowerCase().indexOf(text) >= 0
+                            return String(value).toLowerCase().indexOf(String(text)) >= 0
                         })
                     })
                 })
@@ -39,20 +45,24 @@ export function useDataTable<T>() {
         }
     })
 
-    // 本地过滤,支持多条件查询
     const onFilter = () => {
-        const options: FilterValue<T>[] = []
-        filterOptons.selectList.forEach((item) => {
-            const { key, selectedValue } = item;
+        filters.value = getFilterParam()
+    }
+
+    // 获取过滤参数,支持多条件查询
+    const getFilterParam = () => {
+        const options: FilterValue<T, keyof T>[] = []
+        filterOptons.selectList.forEach((e) => {
+            const { key, selectedValue } = e;
             if (selectedValue !== undefined) {
                 options.push({
                     keys: [key],
-                    filteredValue: [selectedValue.toString()],
+                    filteredValue: [selectedValue],
                 })
             }
         })
-        filterOptons.inputList.forEach((item) => {
-            const { keys, value } = item;
+        filterOptons.inputList.forEach((e) => {
+            const { keys, value } = e;
             if (value) {
                 options.push({
                     keys,
@@ -60,13 +70,25 @@ export function useDataTable<T>() {
                 })
             }
         })
-        filters.value = options
-        console.log('表格过滤参数', options)
+        return options
     }
 
-    // 远程搜索
-    const onSearch = () => {
-        console.log('用于远程搜索')
+    // 获取查询参数,支持多条件查询
+    const getQueryParam = () => {
+        const params: { [K in keyof T]?: T[K] } = {}
+        filterOptons.selectList.forEach((e) => {
+            if (e.selectedValue) {
+                params[e.key] = e.selectedValue
+            }
+        })
+        filterOptons.inputList.forEach((e) => {
+            e.keys.forEach((key) => {
+                if (e.value) {
+                    params[key] = e.value
+                }
+            })
+        })
+        return params
     }
 
     // 重置过滤项
@@ -78,8 +100,12 @@ export function useDataTable<T>() {
 
     return {
         dataList,
-        onFilter,
-        onSearch,
+        total,
+        pageIndex,
+        pageSize,
+        getFilterParam,
+        getQueryParam,
+        resetFilter,
         ...toRefs(filterOptons),
     }
 }

+ 12 - 11
src/hooks/datatable/interface.ts

@@ -1,33 +1,34 @@
 /** 
  * 数据过滤项
  */
-export interface FilterValue<T> {
-    keys: (keyof T)[], // 多条件字段
-    filteredValue: string[], // 多选过滤或模糊查询
+export interface FilterValue<T, K extends keyof T> {
+    keys: K[], // 多条件字段
+    filteredValue: (T[K])[], // 多选过滤或模糊查询
 }
 
 /** 
  * 过滤选择框
  */
-export interface FilterSelect<T> {
-    key: keyof T,
+export interface FilterSelect<T, K extends keyof T> {
+    key: K,
     label?: string,
-    selectedValue?: string | number,
+    selectedValue?: T[K],
     placeholder?: string,
     options: {
         label: string,
-        value: string | number,
+        value: T[K],
     }[],
-    onChange?: (value: string | number) => void
+    onChange?: (value: T[K]) => void
 }
 
 /** 
  * 过滤输入框
  */
-export interface FilterInput<T> {
-    keys: (keyof T)[],
+export interface FilterInput<T, K extends keyof T> {
+    keys: K[],
     label?: string,
-    value?: string,
+    value?: T[K],
+    type?: 'text' | 'number',
     placeholder?: string
 }
 

+ 8 - 1
src/packages/mobile/components/modules/trade/index.less

@@ -1,7 +1,14 @@
 .app-trade {
-    .app-modal__container {
+    &__wrapper {
+        display         : flex;
+        flex-direction  : column;
         width           : 100%;
         height          : 100%;
         background-color: #f7f7f7;
     }
+
+    &__body {
+        flex      : 1;
+        overflow-y: auto;
+    }
 }

+ 10 - 6
src/packages/mobile/components/modules/trade/index.vue

@@ -1,10 +1,14 @@
 <template>
-    <app-modal class="app-trade" direction="right" :show="showModal">
-        <template #header>
-            <app-navbar title="挂牌求购" @back="closed" />
-        </template>
-        <AddressEdit show-postal show-delete show-set-default show-search-result
-            :area-columns-placeholder="['请选择', '请选择', '请选择']" />
+    <app-modal class="app-trade" direction="right" height="100%" v-model:show="showModal">
+        <div class="app-trade__wrapper">
+            <div class="app-trade__header">
+                <app-navbar title="挂牌求购" @back="closed" />
+            </div>
+            <div class="app-trade__body">
+                <AddressEdit show-postal show-delete show-set-default show-search-result
+                    :area-columns-placeholder="['请选择', '请选择', '请选择']" />
+            </div>
+        </div>
     </app-modal>
 </template>
 

+ 48 - 32
src/packages/pc/components/base/drawer/index.less

@@ -1,57 +1,73 @@
 .app-drawer {
-    .app-modal__container {
-        min-width    : 320px;
-        color        : #fff;
-        border-radius: 4px;
-        background   : linear-gradient(#084258 0, #102e45 38px, #102e45 100%);
-        box-shadow   : 0 0 20px 0 rgba(0, 0, 0, .15);
+    &__wrapper {
+        display       : flex;
+        flex-direction: column;
+        max-height    : 100vh;
+        min-width     : 320px;
+        color         : #fff;
+        border-radius : 4px;
+        background    : linear-gradient(#084258 0, #102e45 38px, #102e45 100%);
+        box-shadow    : 0 0 20px 0 rgba(0, 0, 0, .15);
+        overflow      : hidden;
     }
 
-    .app-modal__header {
+    &__header {
         position   : relative;
         height     : 38px;
         line-height: 38px;
-        font-size  : 16px;
         text-align : center;
+
+        h1 {
+            font-size: 16px;
+        }
+
+        .el-icon {
+            position : absolute;
+            top      : 50%;
+            right    : 24px;
+            transform: translate3d(0, -50%, 0);
+            font-size: 16px;
+            cursor   : pointer;
+        }
     }
 
-    .app-modal__body {
+    &__body {
+        flex            : 1;
+        overflow-y      : auto;
         background-color: #0f1a25;
         padding         : 24px;
+        padding-bottom  : 0;
+
+        &:last-child {
+            padding-bottom: 24px;
+        }
     }
 
-    .app-modal__footer {
+    &__footer {
         text-align      : center;
         background-color: #0f1a25;
         padding         : 24px;
     }
 
-    &__close {
-        position : absolute;
-        top      : 50%;
-        right    : 24px;
-        transform: translate3d(0, -50%, 0);
-        cursor   : pointer;
+    &.border &__wrapper {
+        padding    : 8px;
+        padding-top: 0;
     }
 
-    &.border &__close {
-        left : 10px;
-        right: auto;
-    }
-
-    &.border {
-        .app-modal__container {
-            padding    : 8px;
-            padding-top: 0;
+    &.border &__header {
+        .el-icon {
+            left : 10px;
+            right: auto;
         }
+    }
 
-        .app-modal__body {
-            padding: 20px;
-        }
+    &.border &__body {
+        padding: 20px;
+    }
 
-        .app-modal__footer {
-            padding    : 20px;
-            padding-top: 0;
-        }
+    &.border &__footer {
+        padding    : 20px;
+        padding-top: 0;
     }
+
 }

+ 14 - 12
src/packages/pc/components/base/drawer/index.vue

@@ -1,18 +1,20 @@
 <!-- 抽屉弹框组件 -->
 <template>
   <app-modal :class="['app-drawer', border && 'border']" :show="show" :close-on-click-mask="false" @mask="close">
-    <template #header>
-      <div class="app-drawer__title">{{ title }}</div>
-      <el-icon class="app-drawer__close" @click="close">
-        <Close />
-      </el-icon>
-    </template>
-    <template #default>
-      <slot></slot>
-    </template>
-    <template #footer>
-      <slot name="footer"></slot>
-    </template>
+    <div class="app-drawer__wrapper" v-loading="loading">
+      <div class="app-drawer__header">
+        <h1>{{ title }}</h1>
+        <el-icon @click="close">
+          <Close />
+        </el-icon>
+      </div>
+      <div class="app-drawer__body">
+        <slot></slot>
+      </div>
+      <div class="app-drawer__footer" v-if="$slots.footer">
+        <slot name="footer"></slot>
+      </div>
+    </div>
   </app-modal>
 </template>
 

+ 4 - 3
src/packages/pc/components/base/pagination/index.vue

@@ -10,7 +10,7 @@
 <script lang="ts" setup>
 import { reactive } from 'vue'
 
-const emit = defineEmits(['update:pageSize', 'update:pageIndex', 'pageChange'])
+const emit = defineEmits(['update:pageSize', 'update:pageIndex', 'change'])
 const props = defineProps({
     // 总条数
     total: {
@@ -20,7 +20,7 @@ const props = defineProps({
     // 每页条数
     pageSize: {
         type: Number,
-        default: 30
+        default: 20
     },
     // 当前页数
     pageIndex: {
@@ -37,12 +37,13 @@ const page = reactive({
 const handleSizeChange = (val: number) => {
     page.size = val;
     emit('update:pageSize', val);
+    emit('change', val);
 }
 
 const handleCurrentChange = (val: number) => {
     page.index = val;
     emit('update:pageIndex', val);
-    emit('pageChange', val);
+    emit('change', val);
 }
 </script>
 

+ 1 - 1
src/packages/pc/components/base/table-filter/index.less

@@ -15,6 +15,6 @@
     }
 
     .el-input {
-        width: 200px;
+        width: 160px;
     }
 }

+ 6 - 1
src/packages/pc/components/base/table-filter/index.vue

@@ -16,7 +16,8 @@
         <slot name="after"></slot>
       </el-form-item>
       <el-form-item>
-        <el-button :class="item.className" v-for="(item, i) in buttonList" :key="i" @click="item.onClick">
+        <el-button :class="item.className" v-for="(item, i) in buttonList" :key="i" :loading="loading"
+          @click="item.onClick">
           {{ item.lable}}
         </el-button>
       </el-form-item>
@@ -42,6 +43,10 @@ defineProps({
     type: Array as PropType<FilterButton[]>,
     default: () => [],
   },
+  loading: {
+    type: Boolean,
+    default: false
+  },
 })
 </script>
 

+ 1 - 1
src/packages/pc/components/base/table/index.vue

@@ -74,7 +74,7 @@ export default defineComponent({
     const updateColumn = (value: Ermcp.TableColumn[]) => emit('update:columns', value)
 
     expose({
-      getRef: tableRef
+      elTable: tableRef
     })
 
     return {

+ 9 - 46
src/packages/pc/components/layouts/main/index.less

@@ -1,52 +1,15 @@
 .app-main {
-    display       : flex;
-    flex-direction: column;
-    height        : 100%;
-
-    &__navbar {
-        z-index         : 1;
-        display         : flex;
-        align-items     : center;
-        background-color: #fff;
-        border-top      : 1px solid #f2f2f2;
-        box-shadow      : 0 2px 16px 0 rgba(0, 0, 0, .1);
-        padding         : 8px 20px 0 20px;
-
-        .el-menu {
-            flex: 1;
-
-            &--horizontal {
-                border-bottom: 0;
-            }
-
-            .el-menu-item {
-                height                 : 40px;
-                //line-height: 40px; bug 会导致鼠标经过严重卡顿
-                min-width              : auto;
-                color                  : #777;
-                border-top-left-radius : 4px;
-                border-top-right-radius: 4px;
-
-                &:not(:first-child) {
-                    margin-left: 4px;
-                }
-
-                &:hover {
-                    color           : inherit;
-                    background-color: var(--tabbar-hover);
-                }
+    &__container {
+        height: 100%;
+    }
 
-                &.is-active {
-                    color           : #fff !important;
-                    background-color: var(--tabbar-active);
-                    border-bottom   : 0;
-                }
-            }
-        }
+    /* teleport 为空时隐藏元素 */
+    &__teleport:empty {
+        display: none;
     }
 
-    &__container {
-        flex      : 1;
-        overflow-y: auto;
+    /* teleport 非空时隐藏兄弟元素 */
+    &__teleport:not(:empty)+&__container {
+        display: none;
     }
 }

+ 9 - 8
src/packages/pc/components/layouts/main/index.vue

@@ -1,12 +1,13 @@
 <template>
-    <app-tabs class="app-tabs--primary" :data-list="threeMenus" v-model:data-index="dataIndex" @change="onTabChange">
-        <template #navbar>
-            <slot></slot>
-        </template>
-        <!-- 三级路由 -->
-        <router-view v-slot="{ Component, route }">
-            <component :is="Component" :key="route.fullPath" />
-        </router-view>
+    <app-tabs class="app-main app-tabs--primary" :data-list="threeMenus" v-model:data-index="dataIndex"
+        @change="onTabChange">
+        <div id="appMainTeleport" class="app-main__container app-main__teleport"></div>
+        <div class="app-main__container">
+            <!-- 三级路由 -->
+            <router-view v-slot="{ Component, route }">
+                <component :is="Component" :key="route.fullPath" />
+            </router-view>
+        </div>
     </app-tabs>
 </template>
 

+ 10 - 0
src/packages/pc/components/layouts/page/index.less

@@ -43,4 +43,14 @@
         flex-direction: column;
         overflow      : hidden;
     }
+
+    /* teleport 为空时隐藏元素 */
+    &__wrapper &__teleport:empty {
+        display: none;
+    }
+
+    /* teleport 非空时隐藏兄弟元素 */
+    &__wrapper &__teleport:not(:empty)+&__main {
+        display: none;
+    }
 }

+ 1 - 0
src/packages/pc/components/layouts/page/index.vue

@@ -13,6 +13,7 @@
       <div class="app-page__sidebar">
         <app-sidebar v-model:collapse="isCollapse" />
       </div>
+      <div id="appPageTeleport" class="app-page__main app-page__teleport"></div>
       <div class="app-page__main">
         <!-- 二级路由 -->
         <router-view v-slot="{ Component, route }">

+ 6 - 3
src/packages/pc/components/layouts/view/index.less

@@ -1,8 +1,5 @@
 .app-view {
     flex                      : 1;
-    display                   : flex;
-    flex-direction            : column;
-    height                    : 100%;
     overflow                  : auto;
     -webkit-overflow-scrolling: touch;
 
@@ -14,6 +11,12 @@
         }
     }
 
+    &--flex {
+        display       : flex;
+        flex-direction: column;
+        height        : 100%;
+    }
+
     &--flex &__main {
         flex    : 1;
         overflow: hidden;

+ 3 - 1
src/packages/pc/components/modules/auth-operation/index.vue

@@ -45,7 +45,7 @@
 </template>
 
 <script lang="ts" setup>
-import { onMounted, shallowRef, PropType, computed, watch } from 'vue'
+import { onMounted, onUnmounted, onDeactivated, shallowRef, PropType, computed, watch } from 'vue'
 import { useAuth } from '@/hooks/auth'
 
 const emit = defineEmits(['click', 'closed'])
@@ -123,6 +123,8 @@ const closeComponent = (isCallback?: boolean) => {
 watch(() => props.contextmenu, (val) => contextmenuOption.value = val)
 
 onMounted(() => auth.value = getAuthButton())
+onUnmounted(() => closeComponent())
+onDeactivated(() => closeComponent())
 </script>
 
 <style lang="less">

+ 23 - 23
src/packages/pc/views/setting/customer/main/components/edit/index.vue

@@ -1,83 +1,83 @@
 <!-- 新增客户资料 -->
 <template>
     <app-drawer :title="selectedRow.userid ? '修改客户资料' : '新增客户资料'" :width="880" v-model:show="show" :refresh="refresh">
-        <el-form ref="formRef" class="el-form--horizontal" label-width="130px" label-position="left" :model="formItem"
+        <el-form ref="formRef" class="el-form--horizontal" label-width="130px" label-position="left" :model="formData"
             :rules="formRules">
             <el-form-item label="客户类型" prop="userinfotype">
-                <el-select v-model="formItem.userinfotype" :disabled="selectedRow.userid > 0">
+                <el-select v-model="formData.userinfotype" :disabled="selectedRow.userid > 0">
                     <el-option :label="item.label" :value="item.value" v-for="(item, index) in getUserInfoTypeList()"
                         :key="index" />
                 </el-select>
             </el-form-item>
             <!-- 个人 -->
-            <template v-if="formItem.userinfotype === UserInfoType.Customer">
+            <template v-if="formData.userinfotype === UserInfoType.Customer">
                 <el-form-item label="姓名" prop="username">
-                    <el-input placeholder="请输入" v-model="formItem.username" />
+                    <el-input placeholder="请输入" v-model="formData.username" />
                 </el-form-item>
                 <el-form-item label="身份证号码">
-                    <el-input placeholder="请输入" v-model="formItem.cardnum" />
+                    <el-input placeholder="请输入" v-model="formData.cardnum" />
                 </el-form-item>
                 <el-form-item label="手机号码" prop="mobilephone">
-                    <el-input placeholder="请输入" v-model="formItem.mobilephone" />
+                    <el-input placeholder="请输入" v-model="formData.mobilephone" />
                 </el-form-item>
                 <el-form-item label="身份证正面照">
                     <app-upload />
                 </el-form-item>
                 <el-form-item label="邮箱">
-                    <el-input placeholder="请输入" v-model="formItem.email" />
+                    <el-input placeholder="请输入" v-model="formData.email" />
                 </el-form-item>
                 <el-form-item label="身份证反面照">
                     <app-upload />
                 </el-form-item>
             </template>
             <!-- 企业 -->
-            <template v-if="formItem.userinfotype === UserInfoType.Enterprise">
+            <template v-if="formData.userinfotype === UserInfoType.Enterprise">
                 <el-form-item label="企业名称" prop="customername">
-                    <el-input placeholder="请输入" v-model="formItem.customername" />
+                    <el-input placeholder="请输入" v-model="formData.customername" />
                 </el-form-item>
                 <el-form-item label="企业简称" prop="nickname">
-                    <el-input placeholder="请输入" v-model="formItem.nickname" />
+                    <el-input placeholder="请输入" v-model="formData.nickname" />
                 </el-form-item>
                 <el-form-item label="证件类型">
-                    <el-select v-model="formItem.cardtype">
+                    <el-select v-model="formData.cardtype">
                         <el-option :label="item.label" :value="item.value" v-for="(item, index) in getCardType()"
                             :key="index" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="法定代表人">
-                    <el-input placeholder="请输入" v-model="formItem.legalpersonname" />
+                    <el-input placeholder="请输入" v-model="formData.legalpersonname" />
                 </el-form-item>
                 <el-form-item label="证件号码">
-                    <el-input placeholder="请输入" v-model="formItem.cardnum" />
+                    <el-input placeholder="请输入" v-model="formData.cardnum" />
                 </el-form-item>
                 <el-form-item label="纳税人识别号">
-                    <el-input placeholder="请输入" v-model="formItem.taxpayernum" />
+                    <el-input placeholder="请输入" v-model="formData.taxpayernum" />
                 </el-form-item>
                 <el-form-item label="营业执照">
                     <app-upload />
                 </el-form-item>
                 <el-form-item label="联系人">
-                    <el-input placeholder="请输入" v-model="formItem.contactname" />
+                    <el-input placeholder="请输入" v-model="formData.contactname" />
                 </el-form-item>
                 <el-form-item label="联系人手机号" prop="mobilephone">
-                    <el-input placeholder="请输入" v-model="formItem.mobilephone" />
+                    <el-input placeholder="请输入" v-model="formData.mobilephone" />
                 </el-form-item>
             </template>
             <el-form-item label="联系电话">
-                <el-input placeholder="请输入" v-model="formItem.telphone" />
+                <el-input placeholder="请输入" v-model="formData.telphone" />
             </el-form-item>
             <el-form-item class="el-form-item--row" label="通讯地址">
                 <div class="el-form-item--col">
-                    <el-select v-model="formItem.provinceid"></el-select>
-                    <el-select v-model="formItem.cityid"></el-select>
-                    <el-select v-model="formItem.districtid"></el-select>
+                    <el-select v-model="formData.provinceid"></el-select>
+                    <el-select v-model="formData.cityid"></el-select>
+                    <el-select v-model="formData.districtid"></el-select>
                 </div>
             </el-form-item>
             <el-form-item class="el-form-item--row">
-                <el-input placeholder="请输入" v-model="formItem.ipaddress" />
+                <el-input placeholder="请输入" v-model="formData.ipaddress" />
             </el-form-item>
             <el-form-item class="el-form-item--row" label="备注">
-                <el-input placeholder="请输入" v-model="formItem.remark" />
+                <el-input placeholder="请输入" v-model="formData.remark" />
             </el-form-item>
         </el-form>
         <template #footer>
@@ -103,7 +103,7 @@ const props = defineProps({
     }
 })
 
-const { formItem, loading, updateCustomerInfo } = useCustomerForm(props.selectedRow)
+const { formData, loading, updateCustomerInfo } = useCustomerForm(props.selectedRow)
 const show = ref(true)
 const refresh = ref(false)
 const formRef = ref<FormInstance>()

+ 1 - 1
src/packages/pc/views/system/menu/index.vue

@@ -58,7 +58,7 @@ const columns = ref([
 
 // 展开或收起表格
 const tableExpandAll = () => {
-    const table = tableRef.value.getRef
+    const table = tableRef.value.elTable
     isRowExpansion.value = !isRowExpansion.value
 
     const toggleRowExpansionAll = (data: Ermcp.UserMenu[]) => {

+ 2 - 2
src/services/socket/quote/index.ts

@@ -25,8 +25,8 @@ function quoteServerMiddleware(params: QuoteRequest): Promise<Proto.QuoteRsp[]>
                 if (raw.content) {
                     parseSubscribeRsp(raw.content).then((res) => {
                         resolve(res);
-                    }).catch((err) => {
-                        console.warn('报文解析失败', err);
+                    }).catch(() => {
+                        console.warn('报文解析失败', raw);
                         reject('报文解析失败')
                     })
                 } else {

+ 2 - 3
src/services/socket/trade/index.ts

@@ -15,7 +15,6 @@ function getProtoHeader(funCode: keyof typeof FunCode, header?: IMessageHead, ma
     const protoHeader: IMessageHead = {
         FunCode: FunCode[funCode],
         UUID: v4(),
-        AccessID: 0,
         UserID: sessionData.getLoginInfo('UserID'),
         ...(header ?? {})
     }
@@ -47,8 +46,8 @@ function tradeServerMiddleware<Req, Rsp>(reqCode: keyof typeof FunCode, rspCode:
                     Protobuf.responseDecode<Rsp>(rspCode, raw.content).then((res) => {
                         console.log(rspCode, FunCode[rspCode], res);
                         resolve(res);
-                    }).catch((msg) => {
-                        console.warn(rspCode, msg);
+                    }).catch(() => {
+                        console.warn(rspCode, raw);
                         reject('报文解析失败');
                     })
                 },