Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
9cb9478848
14
src/App.vue
14
src/App.vue
|
@ -81,7 +81,6 @@
|
|||
>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<browserTip ref="browserTip" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -92,7 +91,6 @@ import {
|
|||
} from "@/api/dictionary/dictionary";
|
||||
import Vue from "vue";
|
||||
import i18n from "./lang";
|
||||
import browserTip from "@/views/dictionary/template/browser/tip.vue";
|
||||
export default {
|
||||
name: "App",
|
||||
data() {
|
||||
|
@ -104,21 +102,9 @@ export default {
|
|||
arr: [],
|
||||
};
|
||||
},
|
||||
components: { browserTip },
|
||||
mounted() {
|
||||
this.show = process.env.VUE_APP_OSS_PATH === "/test/dist";
|
||||
},
|
||||
watch: {
|
||||
"$route.path": {
|
||||
handler() {
|
||||
if (this.$route.path === "/login") {
|
||||
// this.$refs.browserTip.open();
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeValue(target, attr, e) {
|
||||
this.$set(target, attr, e);
|
||||
|
|
|
@ -15,6 +15,12 @@
|
|||
>
|
||||
<el-input v-model="form.Title" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('dictionary:browser:form:exploreType')"
|
||||
prop="ExploreType"
|
||||
>
|
||||
<el-input v-model="form.ExploreType" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('dictionary:browser:form:version')"
|
||||
prop="Version"
|
||||
|
@ -95,6 +101,7 @@ export default {
|
|||
Version: null,
|
||||
Title: null,
|
||||
IsDeleted: true,
|
||||
ExploreType: null,
|
||||
DownloadUrl: null,
|
||||
Path: null,
|
||||
FileName: null,
|
||||
|
@ -107,6 +114,13 @@ export default {
|
|||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
ExploreType: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
Version: [
|
||||
{
|
||||
required: true,
|
||||
|
@ -114,6 +128,13 @@ export default {
|
|||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
DownloadUrl: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
},
|
||||
fileList: [],
|
||||
loading: false,
|
||||
|
|
|
@ -43,6 +43,12 @@
|
|||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="ExploreType"
|
||||
:label="$t('dictionary:browser:table:exploreType')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="Version"
|
||||
:label="$t('dictionary:browser:table:version')"
|
||||
|
|
|
@ -1,56 +1,18 @@
|
|||
<template>
|
||||
<base-model :config="config">
|
||||
<div slot="dialog-body">
|
||||
<el-form ref="form" :model="form" label-width="100px" size="small">
|
||||
<el-form-item
|
||||
:label="$t('dictionary:browser:tip:form:title')"
|
||||
prop="Title"
|
||||
>
|
||||
<span>{{ form.Title }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('dictionary:browser:tip:form:version')"
|
||||
prop="Version"
|
||||
>
|
||||
<span>{{ form.Version }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('dictionary:browser:tip:form:downloadUrl')"
|
||||
prop="DownloadUrl"
|
||||
>
|
||||
<a :href="form.DownloadUrl" target="_blank" style="color: #428bca">{{
|
||||
form.DownloadUrl
|
||||
}}</a>
|
||||
</el-form-item>
|
||||
<el-form-item prop="FileName">
|
||||
<a
|
||||
:href="OSSclientConfig.basePath + form.Path"
|
||||
target="_blank"
|
||||
style="color: #428bca"
|
||||
>
|
||||
{{ form.FileName }}
|
||||
</a>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</base-model>
|
||||
<div class="browserTip" v-if="visible">
|
||||
<i class="el-icon-warning-outline"></i>
|
||||
<span v-html="tip"></span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getExploreRecommentInfo } from "@/api/dictionary";
|
||||
import baseModel from "@/components/BaseModel";
|
||||
export default {
|
||||
name: "browserTip",
|
||||
components: { baseModel },
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
visible: false,
|
||||
showClose: true,
|
||||
width: "600px",
|
||||
title: this.$t("dictionary:browser:tip:title"),
|
||||
appendToBody: true,
|
||||
},
|
||||
form: {},
|
||||
tip: this.$t("browser:tip:changeBorwser"),
|
||||
visible: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -68,16 +30,80 @@ export default {
|
|||
},
|
||||
async open() {
|
||||
try {
|
||||
let browserType = this.getExplore();
|
||||
let type = browserType.split(": ")[0];
|
||||
let No = browserType.split(": ")[1].split(".")[0];
|
||||
console.log(type, No);
|
||||
if (type !== "Chrome" && type !== "Edge") {
|
||||
this.tip = this.$t("browser:tip:changeBorwser");
|
||||
return (this.visible = true);
|
||||
}
|
||||
let res = await this.getInfo();
|
||||
if (!res) return this.$t("dictionary:browser:tip:getError");
|
||||
this.form = res;
|
||||
this.config.visible = true;
|
||||
let currentType = res.filter(
|
||||
(item) => item.ExploreType.toLowerCase() === type.toLowerCase()
|
||||
)[0];
|
||||
if (No < currentType.Version) {
|
||||
this.tip = `<span>${this.$t("browser:tip:borwserversionLow")}</span>`;
|
||||
res.forEach((item, index) => {
|
||||
this.tip += `<a href="${item.DownloadUrl}" target="_blank" style="color:#428bca">${item.Title}</a>`;
|
||||
if (index < res.length - 1) {
|
||||
this.tip += "、";
|
||||
}
|
||||
});
|
||||
return (this.visible = true);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
getExplore() {
|
||||
var Sys = {};
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var s;
|
||||
(s = ua.match(/rv:([\d.]+)\) like gecko/))
|
||||
? (Sys.ie = s[1])
|
||||
: (s = ua.match(/msie ([\d\.]+)/))
|
||||
? (Sys.ie = s[1])
|
||||
: (s = ua.match(/edg\/([\d\.]+)/))
|
||||
? (Sys.edge = s[1])
|
||||
: (s = ua.match(/firefox\/([\d\.]+)/))
|
||||
? (Sys.firefox = s[1])
|
||||
: (s = ua.match(/(?:opera|opr).([\d\.]+)/))
|
||||
? (Sys.opera = s[1])
|
||||
: (s = ua.match(/chrome\/([\d\.]+)/))
|
||||
? (Sys.chrome = s[1])
|
||||
: (s = ua.match(/version\/([\d\.]+).*safari/))
|
||||
? (Sys.safari = s[1])
|
||||
: 0;
|
||||
// 根据关系进行判断
|
||||
if (Sys.ie) return "IE: " + Sys.ie;
|
||||
if (Sys.edge) return "Edge: " + Sys.edge;
|
||||
if (Sys.firefox) return "Firefox: " + Sys.firefox;
|
||||
if (Sys.chrome) return "Chrome: " + Sys.chrome;
|
||||
if (Sys.opera) return "Opera: " + Sys.opera;
|
||||
if (Sys.safari) return "Safari: " + Sys.safari;
|
||||
return "Unkonwn";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.browserTip {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background-color: rgba(250, 205, 145, 0.129411764705882);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
color: #555;
|
||||
i {
|
||||
color: red;
|
||||
font-size: 24px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -185,6 +185,7 @@
|
|||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<browserTip ref="browserTip" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -193,10 +194,11 @@ import { mapGetters, mapMutations } from "vuex";
|
|||
import TopLang from "./topLang";
|
||||
// import NoticeMarquee from '../trials/trials-layout/components/noticeMarquee'
|
||||
import Vcode from "vue-puzzle-vcode";
|
||||
import browserTip from "@/views/dictionary/template/browser/tip.vue";
|
||||
import Img1 from "@/assets/pic-2.png";
|
||||
export default {
|
||||
name: "Login",
|
||||
components: { TopLang, Vcode },
|
||||
components: { TopLang, Vcode, browserTip },
|
||||
data() {
|
||||
return {
|
||||
NODE_ENV: process.env.NODE_ENV,
|
||||
|
@ -262,6 +264,7 @@ export default {
|
|||
// this.$updateDictionary()
|
||||
}
|
||||
}
|
||||
this.$refs.browserTip.open();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations({ setLanguage: "lang/setLanguage" }),
|
||||
|
|
Loading…
Reference in New Issue