整理代码!
This commit is contained in:
		@@ -22,6 +22,7 @@ module.exports = {
 | 
			
		||||
    extends:["eslint:recommended",],
 | 
			
		||||
    rules:{
 | 
			
		||||
        indent: ["warn", 4,],
 | 
			
		||||
        "space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
 | 
			
		||||
        "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
			
		||||
        "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
			
		||||
        "no-unused-vars": "warn",
 | 
			
		||||
@@ -73,7 +74,7 @@ module.exports = {
 | 
			
		||||
            ],
 | 
			
		||||
            rules: {
 | 
			
		||||
                indent: ["warn", 4,],
 | 
			
		||||
                // "space-in-parens": ["error", "always", { exceptions: ["empty",], },],
 | 
			
		||||
                "space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
 | 
			
		||||
                "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
			
		||||
                "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
			
		||||
                "no-unused-vars": "warn",
 | 
			
		||||
@@ -136,7 +137,7 @@ module.exports = {
 | 
			
		||||
                "plugin:@typescript-eslint/recommended",
 | 
			
		||||
            ],
 | 
			
		||||
            rules: {
 | 
			
		||||
                "space-in-parens": ["error", "always", { exceptions: ["empty",], },],
 | 
			
		||||
                "space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
 | 
			
		||||
                "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
			
		||||
                "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
			
		||||
                "@typescript-eslint/indent": ["error", 4,],
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ export default {
 | 
			
		||||
            default: () => [],
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
    setup(props)
 | 
			
		||||
    setup( props )
 | 
			
		||||
    {
 | 
			
		||||
        const ui = reactive({
 | 
			
		||||
        });
 | 
			
		||||
@@ -34,8 +34,8 @@ export default {
 | 
			
		||||
        // 设置图表
 | 
			
		||||
        const initCharts = () =>
 | 
			
		||||
        {
 | 
			
		||||
            const chartDom = document.getElementById("chartWrapper");
 | 
			
		||||
            const myChart = echarts.init(chartDom as HTMLDivElement);
 | 
			
		||||
            const chartDom = document.getElementById( "chartWrapper" );
 | 
			
		||||
            const myChart = echarts.init( chartDom as HTMLDivElement );
 | 
			
		||||
            const option = {
 | 
			
		||||
                xAxis: {
 | 
			
		||||
                    type: "category",
 | 
			
		||||
@@ -53,7 +53,7 @@ export default {
 | 
			
		||||
                ],
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            option && myChart.setOption(option);
 | 
			
		||||
            option && myChart.setOption( option );
 | 
			
		||||
 | 
			
		||||
            window.onresize = function ()
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -36,9 +36,9 @@ export default {
 | 
			
		||||
            default: "",
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
    setup(props)
 | 
			
		||||
    setup( props )
 | 
			
		||||
    {
 | 
			
		||||
        const percentage = Number(props.percentage).valueOf();
 | 
			
		||||
        const percentage = Number( props.percentage ).valueOf();
 | 
			
		||||
 | 
			
		||||
        const ui = reactive({
 | 
			
		||||
            percentage,
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ class StaffInfo
 | 
			
		||||
        return this._stuffCode;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public set stuffCode(stuffCode: string)
 | 
			
		||||
    public set stuffCode( stuffCode: string )
 | 
			
		||||
    {
 | 
			
		||||
        this._stuffCode = stuffCode;
 | 
			
		||||
    }
 | 
			
		||||
@@ -44,7 +44,7 @@ class StaffInfo
 | 
			
		||||
        return this._stuffName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public set stuffName(stuffName: string)
 | 
			
		||||
    public set stuffName( stuffName: string )
 | 
			
		||||
    {
 | 
			
		||||
        this._stuffName = stuffName;
 | 
			
		||||
    }
 | 
			
		||||
@@ -54,12 +54,12 @@ class StaffInfo
 | 
			
		||||
        return this._p13uid;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public set P13UID(p13uid: string)
 | 
			
		||||
    public set P13UID( p13uid: string )
 | 
			
		||||
    {
 | 
			
		||||
        this._p13uid = p13uid;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public set departmentCode(departmentCode: string)
 | 
			
		||||
    public set departmentCode( departmentCode: string )
 | 
			
		||||
    {
 | 
			
		||||
        this._departmentCode = departmentCode;
 | 
			
		||||
    }
 | 
			
		||||
@@ -69,7 +69,7 @@ class StaffInfo
 | 
			
		||||
        return this._departmentCode;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public set departmentName(departmentName: string)
 | 
			
		||||
    public set departmentName( departmentName: string )
 | 
			
		||||
    {
 | 
			
		||||
        this._departmentName = departmentName;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,13 @@
 | 
			
		||||
        <span class="company-name">CPIC</span>
 | 
			
		||||
        <div class="version-wrapper">
 | 
			
		||||
            <span>测试版</span>
 | 
			
		||||
            <span>3.6.7 x64 Build 202208301257</span>
 | 
			
		||||
            <span>Build-202303251257</span>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="button-wrapper">
 | 
			
		||||
            <component
 | 
			
		||||
                :is="'user'"
 | 
			
		||||
                class="icons"
 | 
			
		||||
            />
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</template>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-02-15 09:25:52
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @LastEditTime: 2023-03-23 16:32:01
 | 
			
		||||
 * @LastEditTime: 2023-03-24 14:34:52
 | 
			
		||||
 * @FilePath: /task_schedule/src/main.js
 | 
			
		||||
 * @Description:
 | 
			
		||||
 *
 | 
			
		||||
@@ -21,17 +21,17 @@ import "./assets/css/index.scss";
 | 
			
		||||
// element-plus
 | 
			
		||||
import ElementPlus from "element-plus";
 | 
			
		||||
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
 | 
			
		||||
import("element-plus/dist/index.css");
 | 
			
		||||
import( "element-plus/dist/index.css" );
 | 
			
		||||
 | 
			
		||||
const app = createApp(App);
 | 
			
		||||
const app = createApp( App );
 | 
			
		||||
 | 
			
		||||
// 注册element-plus的图标
 | 
			
		||||
for (const [key, component,] of Object.entries(ElementPlusIconsVue))
 | 
			
		||||
for ( const [key, component,] of Object.entries( ElementPlusIconsVue ))
 | 
			
		||||
{
 | 
			
		||||
    app.component(key, component);
 | 
			
		||||
    app.component( key, component );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
app.use(ElementPlus);
 | 
			
		||||
app.use(router);
 | 
			
		||||
app.use(store);
 | 
			
		||||
app.mount("#app");
 | 
			
		||||
app.use( ElementPlus );
 | 
			
		||||
app.use( router );
 | 
			
		||||
app.use( store );
 | 
			
		||||
app.mount( "#app" );
 | 
			
		||||
 
 | 
			
		||||
@@ -38,7 +38,7 @@ const routes = [
 | 
			
		||||
            title: "总览",
 | 
			
		||||
            icon: "house",
 | 
			
		||||
        },
 | 
			
		||||
        component: ()=> import("../layout/Index.vue"),
 | 
			
		||||
        component: ()=> import( "../layout/Index.vue" ),
 | 
			
		||||
        children:[
 | 
			
		||||
            {
 | 
			
		||||
                path:"/desktop",
 | 
			
		||||
@@ -47,7 +47,7 @@ const routes = [
 | 
			
		||||
                    title:"工作台",
 | 
			
		||||
                    icon: "house",
 | 
			
		||||
                },
 | 
			
		||||
                component: ()=> import("../views/Desktop.vue"),
 | 
			
		||||
                component: ()=> import( "../views/Desktop.vue" ),
 | 
			
		||||
            },
 | 
			
		||||
        ],
 | 
			
		||||
    },
 | 
			
		||||
@@ -59,7 +59,7 @@ const routes = [
 | 
			
		||||
            title:"数据管理",
 | 
			
		||||
            icon: "document",
 | 
			
		||||
        },
 | 
			
		||||
        component: ()=> import("../layout/Index.vue"),
 | 
			
		||||
        component: ()=> import( "../layout/Index.vue" ),
 | 
			
		||||
        children:[
 | 
			
		||||
            {
 | 
			
		||||
                path:"/staff_data",
 | 
			
		||||
@@ -68,7 +68,7 @@ const routes = [
 | 
			
		||||
                    title:"坐席管理",
 | 
			
		||||
                    icon: "user",
 | 
			
		||||
                },
 | 
			
		||||
                component: ()=> import("../views/StaffManagement.vue"),
 | 
			
		||||
                component: ()=> import( "../views/StaffManagement.vue" ),
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path:"/archievement_data",
 | 
			
		||||
@@ -77,7 +77,7 @@ const routes = [
 | 
			
		||||
                    title:"数据管理",
 | 
			
		||||
                    icon: "document",
 | 
			
		||||
                },
 | 
			
		||||
                component: ()=> import("../views/DataManagement.vue"),
 | 
			
		||||
                component: ()=> import( "../views/DataManagement.vue" ),
 | 
			
		||||
            },
 | 
			
		||||
        ],
 | 
			
		||||
    },
 | 
			
		||||
@@ -104,12 +104,12 @@ function hasOnlyChild( children )
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const routes = children.filter((item)=>
 | 
			
		||||
    const routes = children.filter(( item )=>
 | 
			
		||||
    {
 | 
			
		||||
        return !item.hidden;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    if ( routes.length === 1)
 | 
			
		||||
    if ( routes.length === 1 )
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
import { type AxiosResponse } from "axios";
 | 
			
		||||
import { service as instance } from "./api/request.js";
 | 
			
		||||
import { API_URL } from "./api/config.js";
 | 
			
		||||
import { cleanStaffInfo } from "./api/localStorage.js";
 | 
			
		||||
import { cleanStaffInfo, clearCallerInfo } from "./api/localStorage.js";
 | 
			
		||||
 | 
			
		||||
// @ts-expect-error 之后再补充类型文件
 | 
			
		||||
import { router } from "../router/index.js";
 | 
			
		||||
@@ -38,6 +38,7 @@ async function login( data: LoginInfo ): Promise<AxiosResponse<any, any>>
 | 
			
		||||
function logout(): void
 | 
			
		||||
{
 | 
			
		||||
    cleanStaffInfo();
 | 
			
		||||
    clearCallerInfo();
 | 
			
		||||
 | 
			
		||||
    void router.push( "/login" );
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -10,6 +10,7 @@
 | 
			
		||||
import { StaffInfo } from "@/data/cpicxim/StaffInfo.js";
 | 
			
		||||
 | 
			
		||||
const STUFF_ITEM = "stuff_info";
 | 
			
		||||
const CALLER_ITEM = "call_info";
 | 
			
		||||
const USER_TYPE_ITEM = "user_type";
 | 
			
		||||
 | 
			
		||||
function loadStaffInfo(): StaffInfo
 | 
			
		||||
@@ -61,10 +62,28 @@ function getUserType(): string
 | 
			
		||||
    return userType;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function saveCallerInfo( callerCode: string ): void
 | 
			
		||||
{
 | 
			
		||||
    window.localStorage.setItem( CALLER_ITEM, callerCode );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getCallerInfo(): string
 | 
			
		||||
{
 | 
			
		||||
    return window.localStorage.getItem( CALLER_ITEM ) ?? "";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function clearCallerInfo(): void
 | 
			
		||||
{
 | 
			
		||||
    window.localStorage.removeItem( CALLER_ITEM );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export {
 | 
			
		||||
    loadStaffInfo,
 | 
			
		||||
    saveStaffInfo,
 | 
			
		||||
    cleanStaffInfo,
 | 
			
		||||
    saveUserType,
 | 
			
		||||
    getUserType
 | 
			
		||||
    getUserType,
 | 
			
		||||
    saveCallerInfo,
 | 
			
		||||
    getCallerInfo,
 | 
			
		||||
    clearCallerInfo
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@ function getParamsFromURL( url: string ): stringkey
 | 
			
		||||
    // 拆分属性
 | 
			
		||||
    const paramArray: string[] = paramString.split( "&" );
 | 
			
		||||
 | 
			
		||||
    paramArray.forEach( ( item ) =>
 | 
			
		||||
    paramArray.forEach(( item ) =>
 | 
			
		||||
    {
 | 
			
		||||
        if ( item.length === 0 )
 | 
			
		||||
        {
 | 
			
		||||
@@ -76,7 +76,7 @@ function getParamsFromURL( url: string ): stringkey
 | 
			
		||||
        const param = item.split( "=" );
 | 
			
		||||
 | 
			
		||||
        paramObj[param[0]] = param[1] ?? "";
 | 
			
		||||
    } );
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return paramObj;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -30,11 +30,11 @@ interface Archievement
 | 
			
		||||
 */
 | 
			
		||||
function queryDepartmentArchievement( render: any ): void
 | 
			
		||||
{
 | 
			
		||||
    instance.request( {
 | 
			
		||||
    instance.request({
 | 
			
		||||
        method: "post",
 | 
			
		||||
        url: API_URL.URL_DEPARTMENT_ARCHIEVEMENT,
 | 
			
		||||
    } )
 | 
			
		||||
        .then( ( response ) =>
 | 
			
		||||
    })
 | 
			
		||||
        .then(( response ) =>
 | 
			
		||||
        {
 | 
			
		||||
            const archievement: Archievement = {
 | 
			
		||||
                success: false,
 | 
			
		||||
@@ -60,11 +60,11 @@ function queryDepartmentArchievement( render: any ): void
 | 
			
		||||
            archievement.backward_list = data.backward_list ?? [];
 | 
			
		||||
 | 
			
		||||
            render( data );
 | 
			
		||||
        } )
 | 
			
		||||
        .catch( ( error ) =>
 | 
			
		||||
        })
 | 
			
		||||
        .catch(( error ) =>
 | 
			
		||||
        {
 | 
			
		||||
            console.log( error );
 | 
			
		||||
        } );
 | 
			
		||||
        });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export { queryDepartmentArchievement, type Archievement };
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,7 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { computed, reactive, onBeforeMount } from "vue";
 | 
			
		||||
import { useRouter } from "vue-router";
 | 
			
		||||
import { loadStaffInfo } from "@/utils/api/localStorage.js";
 | 
			
		||||
import { getCallerInfo } from "@/utils/api/localStorage.js";
 | 
			
		||||
import { ElMessage } from "element-plus";
 | 
			
		||||
import { type Archievement, queryDepartmentArchievement } from "@/utils/archievement.js";
 | 
			
		||||
import ArchievementChart from "@/components/ArchievementChartComponent.vue";
 | 
			
		||||
@@ -78,7 +78,7 @@ export default {
 | 
			
		||||
    setup()
 | 
			
		||||
    {
 | 
			
		||||
        const router = useRouter();
 | 
			
		||||
        const staffInfo = loadStaffInfo();
 | 
			
		||||
        const callerInfo = getCallerInfo();
 | 
			
		||||
        const ui = reactive({
 | 
			
		||||
            chartData: [0,], // 业绩表
 | 
			
		||||
            totalArchievement: 0, // 总业绩
 | 
			
		||||
@@ -92,21 +92,21 @@ export default {
 | 
			
		||||
 | 
			
		||||
        const getTotalArchievement = computed(() =>
 | 
			
		||||
        {
 | 
			
		||||
            const cnyFormat = new Intl.NumberFormat("zh-cn",
 | 
			
		||||
            const cnyFormat = new Intl.NumberFormat( "zh-cn",
 | 
			
		||||
                {
 | 
			
		||||
                    style: "currency",
 | 
			
		||||
                    currency: "CNY",
 | 
			
		||||
                    minimumFractionDigits: 0,
 | 
			
		||||
                });
 | 
			
		||||
            const archievement = cnyFormat.format(ui.totalArchievement);
 | 
			
		||||
            const archievement = cnyFormat.format( ui.totalArchievement );
 | 
			
		||||
 | 
			
		||||
            return archievement;
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        // 绘制数据
 | 
			
		||||
        const renderData = (data:Archievement) =>
 | 
			
		||||
        const renderData = ( data:Archievement ) =>
 | 
			
		||||
        {
 | 
			
		||||
            console.log("部门业绩数据", data);
 | 
			
		||||
            console.log( "部门业绩数据", data );
 | 
			
		||||
 | 
			
		||||
            ui.chartData = data.mensual_archievement_list;
 | 
			
		||||
            ui.totalArchievement = data.total_archievement;
 | 
			
		||||
@@ -116,20 +116,20 @@ export default {
 | 
			
		||||
            // 更新UI
 | 
			
		||||
            ui.showUI = false;
 | 
			
		||||
 | 
			
		||||
            setTimeout(() => { ui.showUI = true; }, 0);
 | 
			
		||||
            setTimeout(() => { ui.showUI = true; }, 0 );
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        // 退出桌面霸屏
 | 
			
		||||
        const logoutDesktopArchievement = () =>
 | 
			
		||||
        {
 | 
			
		||||
            console.log("111");
 | 
			
		||||
            console.log( "111" );
 | 
			
		||||
            logout();
 | 
			
		||||
 | 
			
		||||
            // router.push("/login");
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        // 检查存储的登录信息,不存在则返回登录页面
 | 
			
		||||
        if (staffInfo.P13UID === "")
 | 
			
		||||
        if ( callerInfo === "" )
 | 
			
		||||
        {
 | 
			
		||||
            ElMessage({
 | 
			
		||||
                message: "登录信息失效,请重新登录!",
 | 
			
		||||
@@ -137,12 +137,12 @@ export default {
 | 
			
		||||
                center: true,
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            router.push("/login");
 | 
			
		||||
            router.push( "/login" );
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        onBeforeMount(() =>
 | 
			
		||||
        {
 | 
			
		||||
            queryDepartmentArchievement(renderData);
 | 
			
		||||
            queryDepartmentArchievement( renderData );
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        return { ui, getTotalArchievement, renderData, logoutDesktopArchievement, };
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { reactive, onBeforeMount } from "vue";
 | 
			
		||||
import { useRouter } from "vue-router";
 | 
			
		||||
import { loadStaffInfo, saveStaffInfo, getUserType, saveUserType } from "@/utils/api/localStorage";
 | 
			
		||||
import { loadStaffInfo, saveStaffInfo, getUserType, saveUserType, getCallerInfo, saveCallerInfo } from "@/utils/api/localStorage";
 | 
			
		||||
import { login } from "@/utils/account";
 | 
			
		||||
import { ElMessage } from "element-plus";
 | 
			
		||||
import { StaffInfo } from "@/data/cpicxim/StaffInfo";
 | 
			
		||||
@@ -93,16 +93,19 @@ export default {
 | 
			
		||||
 | 
			
		||||
        const savedP13uid = () =>
 | 
			
		||||
        {
 | 
			
		||||
            window.localStorage.setItem("stuff_account", ui.account);
 | 
			
		||||
            window.localStorage.setItem( "stuff_account", ui.account );
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         *
 | 
			
		||||
         */
 | 
			
		||||
        const onLogin = () =>
 | 
			
		||||
        {
 | 
			
		||||
            // 保存用户类型
 | 
			
		||||
            saveUserType(ui.currentMenu);
 | 
			
		||||
            saveUserType( ui.currentMenu );
 | 
			
		||||
 | 
			
		||||
            // 判断是坐席还是内勤
 | 
			
		||||
            if (ui.currentMenu === "cpicxim_staff")
 | 
			
		||||
            if ( ui.currentMenu === "cpicxim_staff" )
 | 
			
		||||
            {
 | 
			
		||||
                // 是内勤员工
 | 
			
		||||
                const info = {
 | 
			
		||||
@@ -110,12 +113,12 @@ export default {
 | 
			
		||||
                    password: ui.password,
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                login(info)
 | 
			
		||||
                    .then((response) =>
 | 
			
		||||
                login( info )
 | 
			
		||||
                    .then(( response ) =>
 | 
			
		||||
                    {
 | 
			
		||||
                        const data = response.data ?? { success: false, };
 | 
			
		||||
 | 
			
		||||
                        if (data.success === true)
 | 
			
		||||
                        if ( data.success === true )
 | 
			
		||||
                        {
 | 
			
		||||
                        // 提示登录成功,并保存到localStorage,然后路由跳转
 | 
			
		||||
                            ElMessage({
 | 
			
		||||
@@ -134,10 +137,10 @@ export default {
 | 
			
		||||
                                data.staff_info.p13section_office_nameuid ?? ""
 | 
			
		||||
                            );
 | 
			
		||||
 | 
			
		||||
                            saveStaffInfo(staffInfo);
 | 
			
		||||
                            saveStaffInfo( staffInfo );
 | 
			
		||||
 | 
			
		||||
                            // 跳转路由
 | 
			
		||||
                            router.push("/desktop");
 | 
			
		||||
                            router.push( "/desktop" );
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
@@ -148,40 +151,49 @@ export default {
 | 
			
		||||
                            });
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        console.log(data);
 | 
			
		||||
                        console.log( data );
 | 
			
		||||
                    })
 | 
			
		||||
                    .catch((error) =>
 | 
			
		||||
                    .catch(( error ) =>
 | 
			
		||||
                    {
 | 
			
		||||
                        debugger;
 | 
			
		||||
                        console.log(`登录失败,返回信息:${error}`);
 | 
			
		||||
                        console.log( `登录失败,返回信息:${error}` );
 | 
			
		||||
                    });
 | 
			
		||||
            }
 | 
			
		||||
            else if (ui.currentMenu === "tele_saler")
 | 
			
		||||
            else if ( ui.currentMenu === "tele_saler" )
 | 
			
		||||
            {
 | 
			
		||||
                // 坐席
 | 
			
		||||
                saveCallerInfo( ui.account );
 | 
			
		||||
 | 
			
		||||
                // 跳转路由
 | 
			
		||||
                router.push( "/desktop_archievement" );
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        onBeforeMount(() =>
 | 
			
		||||
        {
 | 
			
		||||
            const staffInfo = loadStaffInfo();
 | 
			
		||||
            const staffType = getUserType();
 | 
			
		||||
 | 
			
		||||
            // 判断是否已经记录了P13账号,有则提示已登录,然后跳转路由
 | 
			
		||||
            if (staffInfo.P13UID !== "")
 | 
			
		||||
            // 判断已登录的信息是坐席还是内勤
 | 
			
		||||
            if ( staffType === "tele_saler" )
 | 
			
		||||
            {
 | 
			
		||||
                ElMessage({
 | 
			
		||||
                    message: `已登录账号:${staffInfo.stuffName}`,
 | 
			
		||||
                    type: "success",
 | 
			
		||||
                    center: true,
 | 
			
		||||
                });
 | 
			
		||||
                const callInfo = getCallerInfo();
 | 
			
		||||
 | 
			
		||||
                // 跳转路由
 | 
			
		||||
                // router.push("/desktop_archievement");
 | 
			
		||||
                // 判断是否已经记录了P13账号,有则提示已登录,然后跳转路由
 | 
			
		||||
                if ( callInfo !== "" )
 | 
			
		||||
                {
 | 
			
		||||
                    ElMessage({
 | 
			
		||||
                        message: `已登录账号:${callInfo}`,
 | 
			
		||||
                        type: "success",
 | 
			
		||||
                        center: true,
 | 
			
		||||
                    });
 | 
			
		||||
 | 
			
		||||
                    // 跳转路由
 | 
			
		||||
                    router.push( "/desktop_archievement" );
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        const onToggleMenu = (type: string) =>
 | 
			
		||||
        const onToggleMenu = ( type: string ) =>
 | 
			
		||||
        {
 | 
			
		||||
            ui.currentMenu = type;
 | 
			
		||||
        };
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user