|
@@ -3,11 +3,11 @@
|
|
|
<el-text type="danger">欢迎:{{ userInfos.name }}使用本系统!</el-text>
|
|
|
<el-text type="info" class="ml20">公历:{{ formatDate(now, 'YYYY-mm-dd HH:MM:SS WWW') }}</el-text>
|
|
|
<el-text type="info" class="ml20">农历:{{ getChineseDate() }}</el-text>
|
|
|
-<!-- <el-badge :is-dot="isDot" class="ml20">
|
|
|
- <el-button class="share-button" type="primary" @click="linkOld" :disabled="!userNameEncryption"
|
|
|
- ><SvgIcon name="iconfont icon-daohang" class="mr5" size="18px" /> 一键登录到老系统</el-button
|
|
|
+ <el-badge :is-dot="isDot" class="ml20">
|
|
|
+ <el-button class="share-button" type="primary" @click="linkOld" :disabled="!userNameEncryptionEnCode"
|
|
|
+ ><SvgIcon name="iconfont icon-daohang" class="mr5" size="18px" /> 一键登录到旧系统</el-button
|
|
|
>
|
|
|
- </el-badge>-->
|
|
|
+ </el-badge>
|
|
|
</el-card>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
@@ -35,38 +35,54 @@ const getChineseDate = () => {
|
|
|
};
|
|
|
// 获取加密后的用户名
|
|
|
// encodeURIComponent
|
|
|
-const userNameEncryption = ref('');
|
|
|
+const userNameEncryptionEnCode = ref(''); // 需要转码
|
|
|
+const userNameEncryption = ref(''); // 不需要转码
|
|
|
const getUserName = () => {
|
|
|
- getUserNameApi().then(res => {
|
|
|
- console.log(res)
|
|
|
- getOldWorkTodo();
|
|
|
- }).catch(err => {
|
|
|
-
|
|
|
- })
|
|
|
+ getUserNameApi({ IsUrlEncode: true })
|
|
|
+ .then((res) => {
|
|
|
+ userNameEncryptionEnCode.value = res.result;
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
+ getUserNameApi()
|
|
|
+ .then((res) => {
|
|
|
+ userNameEncryption.value = res.result;
|
|
|
+ getOldWorkTodo();
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
};
|
|
|
// 查询老系统的工单是否有待办 60秒查询一次
|
|
|
const isDot = ref(false);
|
|
|
const getOldWorkTodo = () => {
|
|
|
- axios.get(AppConfigInfo.value.oldHotlineOrderState+userNameEncryption.value).then((res:any)=>{
|
|
|
- console.log(res,'1111')
|
|
|
- }).catch(err=>{
|
|
|
- console.log(err,'222')
|
|
|
- })
|
|
|
- useIntervalFn(() => {
|
|
|
- axios.get(AppConfigInfo.value.oldHotlineOrderState+userNameEncryption.value).then((res:any)=>{
|
|
|
- console.log(res,'1111')
|
|
|
- }).catch(err=>{
|
|
|
- console.log(err,'222')
|
|
|
- })
|
|
|
- },60*1000,{ immediate: true })
|
|
|
-}
|
|
|
+ axios
|
|
|
+ .get(AppConfigInfo.value.oldHotlineOrderState + userNameEncryption.value)
|
|
|
+ .then((res: any) => {
|
|
|
+ console.log('旧系统的查询工单待办返回:',res);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log('旧系统的查询工单待办失败:',err);
|
|
|
+ });
|
|
|
+ useIntervalFn(
|
|
|
+ () => {
|
|
|
+ axios
|
|
|
+ .get(AppConfigInfo.value.oldHotlineOrderState + userNameEncryption.value)
|
|
|
+ .then((res: any) => {
|
|
|
+ console.log('旧系统的查询工单待办返回:',res);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log('旧系统的查询工单待办失败:',err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 60 * 1000,
|
|
|
+ { immediate: true }
|
|
|
+ );
|
|
|
+};
|
|
|
// 一建登录到老系统
|
|
|
const linkOld = () => {
|
|
|
- window.open(AppConfigInfo.value.oldHotlineUrl+userNameEncryption.value);
|
|
|
+ window.open(AppConfigInfo.value.oldHotlineUrl + userNameEncryptionEnCode.value);
|
|
|
};
|
|
|
-onMounted(()=>{
|
|
|
- // getUserName();
|
|
|
-})
|
|
|
+onMounted(() => {
|
|
|
+ getUserName();
|
|
|
+});
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
:deep(.el-badge__content.is-dot) {
|