|  | @@ -170,11 +170,17 @@
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |          <el-dropdown-menu slot="dropdown" class="user-dropdown">
 | 
	
		
			
				|  |  |            <!-- divided -->
 | 
	
		
			
				|  |  | +          <el-dropdown-item v-if="tenantStatus">
 | 
	
		
			
				|  |  | +            <span style="display: block" @click="onTenantChange">{{ tenantName }} <i class="el-icon-sort"></i></span>
 | 
	
		
			
				|  |  | +          </el-dropdown-item>
 | 
	
		
			
				|  |  |            <el-dropdown-item>
 | 
	
		
			
				|  |  |              <span style="display: block" @click="resetPassWord">修改密码</span>
 | 
	
		
			
				|  |  |            </el-dropdown-item>
 | 
	
		
			
				|  |  |            <el-dropdown-item>
 | 
	
		
			
				|  |  | -            <span style="display: block" @click="logout">退出</span>
 | 
	
		
			
				|  |  | +            <span style="display: block" @click="accountSetting">账号设置</span>
 | 
	
		
			
				|  |  | +          </el-dropdown-item>
 | 
	
		
			
				|  |  | +          <el-dropdown-item>
 | 
	
		
			
				|  |  | +            <span style="display: block" @click="logout">安全退出</span>
 | 
	
		
			
				|  |  |            </el-dropdown-item>
 | 
	
		
			
				|  |  |          </el-dropdown-menu>
 | 
	
		
			
				|  |  |        </el-dropdown>
 | 
	
	
		
			
				|  | @@ -256,6 +262,43 @@
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </el-dialog>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    <el-dialog
 | 
	
		
			
				|  |  | +      title="切换机构"
 | 
	
		
			
				|  |  | +      width="500px"
 | 
	
		
			
				|  |  | +      append-to-body
 | 
	
		
			
				|  |  | +      v-if="tenantVisible"
 | 
	
		
			
				|  |  | +      :visible.sync="tenantVisible"
 | 
	
		
			
				|  |  | +    >
 | 
	
		
			
				|  |  | +      <el-form
 | 
	
		
			
				|  |  | +        :model="tenantForm"
 | 
	
		
			
				|  |  | +        label-position="right"
 | 
	
		
			
				|  |  | +        label-width="100px"
 | 
	
		
			
				|  |  | +        ref="tenantForm"
 | 
	
		
			
				|  |  | +      >
 | 
	
		
			
				|  |  | +        <el-form-item
 | 
	
		
			
				|  |  | +          label="选择机构"
 | 
	
		
			
				|  |  | +          :rules="[
 | 
	
		
			
				|  |  | +            { required: true, message: '请选择机构', trigger: 'change' }
 | 
	
		
			
				|  |  | +          ]"
 | 
	
		
			
				|  |  | +          prop="tenantId"
 | 
	
		
			
				|  |  | +        >
 | 
	
		
			
				|  |  | +          <el-select
 | 
	
		
			
				|  |  | +            v-model.trim="tenantForm.tenantId"
 | 
	
		
			
				|  |  | +            filterable
 | 
	
		
			
				|  |  | +            placeholder="请选择机构"
 | 
	
		
			
				|  |  | +            clearable
 | 
	
		
			
				|  |  | +            style="width: 100% !important"
 | 
	
		
			
				|  |  | +          >
 | 
	
		
			
				|  |  | +            <el-option v-for="(item, index) in  tenantList" :key="index" :label="item.name" :value="item.id"></el-option>
 | 
	
		
			
				|  |  | +          </el-select>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +      </el-form>
 | 
	
		
			
				|  |  | +      <div slot="footer" class="dialog-footer">
 | 
	
		
			
				|  |  | +        <el-button @click="tenantVisible = false">取 消</el-button>
 | 
	
		
			
				|  |  | +        <el-button type="primary" @click="submitTenant">确 定</el-button>
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  | +    </el-dialog>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      <portal-target name="AppMain" ref="target">
 | 
	
		
			
				|  |  |        <instructions ref="instructions" @checkShow="checkShow" />
 | 
	
		
			
				|  |  |      </portal-target>
 | 
	
	
		
			
				|  | @@ -273,10 +316,13 @@ import AppLink from "./Sidebar/Link";
 | 
	
		
			
				|  |  |  import { getBelongTopMenuPath } from "@/utils/permission";
 | 
	
		
			
				|  |  |  import instructions from "./instructions";
 | 
	
		
			
				|  |  |  import { validOaUrl } from '@/utils/validate'
 | 
	
		
			
				|  |  | +import { tenantInfoQueryPage } from '@/views/organManager/api'
 | 
	
		
			
				|  |  |  import Cookies from 'js-cookie'
 | 
	
		
			
				|  |  |  import axios from 'axios'
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  | +    const tenantId = sessionStorage.getItem('tenantId')
 | 
	
		
			
				|  |  | +    const tenantName = sessionStorage.getItem('tenantName')
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        username: "",
 | 
	
		
			
				|  |  |        organName: this.$store.getters.organName,
 | 
	
	
		
			
				|  | @@ -292,6 +338,12 @@ export default {
 | 
	
		
			
				|  |  |        timerCount: 60,
 | 
	
		
			
				|  |  |        btnName: "获取验证码",
 | 
	
		
			
				|  |  |        isShowIns: false,
 | 
	
		
			
				|  |  | +      tenantVisible: false,
 | 
	
		
			
				|  |  | +      tenantName: tenantName || null,
 | 
	
		
			
				|  |  | +      tenantForm: {
 | 
	
		
			
				|  |  | +        tenantId: Number(tenantId) || null,
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      tenantList: []
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -308,6 +360,10 @@ export default {
 | 
	
		
			
				|  |  |        //  (route, getBelongTopMenuPath(route))
 | 
	
		
			
				|  |  |        return getBelongTopMenuPath(route);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    tenantStatus() { // 判断是否是平台账号 true 是
 | 
	
		
			
				|  |  | +      const baseTenantId = sessionStorage.getItem('baseTenantId')
 | 
	
		
			
				|  |  | +      return baseTenantId < 0 ? true : false
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted() {
 | 
	
		
			
				|  |  |      // 手动加入
 | 
	
	
		
			
				|  | @@ -326,6 +382,46 @@ export default {
 | 
	
		
			
				|  |  |        this.$router.push(`/login`);
 | 
	
		
			
				|  |  |        window.location.reload();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    async onTenantChange() {
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        const res = await tenantInfoQueryPage({ page: 1, rows: 999 }, )
 | 
	
		
			
				|  |  | +        this.tenantList = res.data?.rows || []
 | 
	
		
			
				|  |  | +        this.tenantVisible = true
 | 
	
		
			
				|  |  | +      } catch(e) {}
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    accountSetting() {
 | 
	
		
			
				|  |  | +      // 账号设置
 | 
	
		
			
				|  |  | +      this.$router.push('/tenantSetting/tenantInfoSetting')
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    submitTenant() {
 | 
	
		
			
				|  |  | +      this.$refs['tenantForm'].validate((res) => {
 | 
	
		
			
				|  |  | +        if(res) {
 | 
	
		
			
				|  |  | +          const tenantForm = this.tenantForm
 | 
	
		
			
				|  |  | +          let tenantName = null
 | 
	
		
			
				|  |  | +          this.tenantList.forEach(item => {
 | 
	
		
			
				|  |  | +            if(item.id == tenantForm.tenantId) {
 | 
	
		
			
				|  |  | +              tenantName = item.name
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +          const tenantId = sessionStorage.getItem('tenantId')
 | 
	
		
			
				|  |  | +          if(tenantId != tenantForm.tenantId) {
 | 
	
		
			
				|  |  | +            //判断是否是当前路由
 | 
	
		
			
				|  |  | +            // if(url == this.$route.path) {
 | 
	
		
			
				|  |  | +              sessionStorage.setItem('tenantId', tenantForm.tenantId)
 | 
	
		
			
				|  |  | +              sessionStorage.setItem('tenantName', tenantName)
 | 
	
		
			
				|  |  | +              this.$router.push({
 | 
	
		
			
				|  |  | +                  path: '/redirect',
 | 
	
		
			
				|  |  | +                  query: this.$route.fullPath
 | 
	
		
			
				|  |  | +              })
 | 
	
		
			
				|  |  | +            // } else {
 | 
	
		
			
				|  |  | +            //     this.$router.push({
 | 
	
		
			
				|  |  | +            //     path: url
 | 
	
		
			
				|  |  | +            //     })
 | 
	
		
			
				|  |  | +            // }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      gotoRecode() {
 | 
	
		
			
				|  |  |        this.$router.push("/journal/journal");
 | 
	
		
			
				|  |  |      },
 |