chenhaozhe
2025-12-10 6e03ec14818ddb59f41b09a0b5e22883f04c4c70
pages/index/login.vue
@@ -2,7 +2,7 @@
    <view class="content">
        <image class="bg-img" src="../../static/login.jpg"></image>
        <view class="container">
            <view class="title">智云L-MES制造执行系统</view>
            <view class="title">{{ $t("login.title") }}</view>
            <view class="box">
                <view class="logo">
                    <image src="../../static/logo.png" mode=""></image>
@@ -18,7 +18,17 @@
                        </picker>
                    </view> -->
                    <view class="item">
                        <view class="left">当前组织:</view>
                        <view class="left">{{ $t("login.Language") }}:</view>
                        <picker :range="['中文','English']" :value="Language" @change="onLanguageChangeHandler">
                            <view class="right" style="display: flex;align-items: center;">
                                <input type="text" disabled v-model="Language" placeholder="请选择语言">
                                <uni-icons type="forward" color="#808080"
                                    style="border-left: 1px solid #aaaaaa;padding: 0 8rpx;" size="18"></uni-icons>
                            </view>
                        </picker>
                    </view>
                    <view class="item">
                        <view class="left">{{ $t("login.CurrentOrganization") }}:</view>
                        <picker :range="arrayOrganization" :value="Organization" @change="OrganizationChange">
                            <view class="right" style="display: flex;align-items: center;">
                                <input type="text" disabled v-model="Organization" placeholder="请选择当前组织">
@@ -27,14 +37,15 @@
                            </view>
                        </picker>
                    </view>
                    <view class="item">
                        <view class="left">用户名:</view>
                        <view class="left">{{ $t("login.UserName") }}:</view>
                        <view class="right">
                            <input type="text" v-model="UserName">
                        </view>
                    </view>
                    <view class="item">
                        <view class="left">密 码:</view>
                        <view class="left">{{ $t("login.PassWord") }}:</view>
                        <view class="right">
                            <input type="password" v-model="PassWord">
                        </view>
@@ -46,16 +57,16 @@
                </view>
            </view>
            <uni-popup ref="popup" type="center">
                <uni-popup-dialog title="服务器设置" mode="input" @confirm="confirmHandler" :before-close="true"
                    @close="close">
                <uni-popup-dialog :title="$t('login.ServiceSetting')" mode="input" @confirm="confirmHandler"
                    :before-close="true" @close="close">
                    <view class="popup-content">
                        <input type="text" v-model="serverUrlName" placeholder="请输入服务器名称">
                    </view>
                </uni-popup-dialog>
            </uni-popup>
            <view class="btn" @tap="submit">登 录</view>
            <view class="btn apibtn" @click="openServerSettingHandler">服务器设置</view>
            <view class="btn" @tap="submit">{{$t("login.Login")}}</view>
            <view class="btn apibtn" @click="openServerSettingHandler">{{$t("login.ServiceSetting")}}</view>
        </view>
    </view>
@@ -74,12 +85,15 @@
        components: {
            hFormAlert
        },
        mounted() {
            console.log(uni.getLocale())
        },
        data() {
            return {
                CommonUtils,
                arrayDataBases: [],
                DataBases: '',
                Language: '中文',
                serverUrlandName: {
                    "浙江智云迈思": 'http://47.96.97.237/API/',
                    "温州海诚光学": 'http://122.228.39.234:7177/API/',
@@ -128,6 +142,17 @@
            this.getDataBases()
        },
        methods: {
            onLanguageChangeHandler(e) {
                console.log('e: ', e.detail.value);
                if (e.detail.value == 0) {
                    this.Language = '中文'
                    this.$i18n.locale = 'zh-Hans'
                }
                if (e.detail.value == 1) {
                    this.Language = 'English'
                    this.$i18n.locale = 'en'
                }
            },
            async InitOrgination() {
                console.log("初始化组织")
                await this.$nextTick(() => {
@@ -240,8 +265,7 @@
                        title: '登录中...',
                        mask: true
                    })
                    var data =
                    {
                    var data = {
                        HUserNumber: this.UserName,
                        HPassWord: this.PassWord,
                        HStockOrgID: this.HOrgName,
@@ -382,7 +406,7 @@
            .login {
                width: 100%;
                height: 480rpx;
                height: 520rpx;
                position: absolute;
                top: 90rpx;
                z-index: 0;