From 19d472bfb3e280d1513d1e8811af5625c2c5307d Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Tue, 21 Oct 2025 16:04:23 +0800
Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8D=8F=E8=AE=AE=E5=92=8C?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9A=90=E7=A7=81=E9=87=87=E9=9B=86=E8=AF=B4?=
=?UTF-8?q?=E6=98=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/dictionary.js | 17 +
src/components/AGR/fun.js | 37 +++
src/components/AGR/index.js | 7 +
src/components/AGR/index.vue | 57 ++++
src/main.js | 2 +
.../AgreementTemplate/TemplateForm.vue | 150 +++++++++
.../components/AgreementTemplate/index.vue | 304 ++++++++++++++++++
src/views/dictionary/attachment/index.vue | 5 +-
src/views/login/index.vue | 37 ++-
src/views/system/login-log/detail.vue | 37 ++-
10 files changed, 631 insertions(+), 22 deletions(-)
create mode 100644 src/components/AGR/fun.js
create mode 100644 src/components/AGR/index.js
create mode 100644 src/components/AGR/index.vue
create mode 100644 src/views/dictionary/attachment/components/AgreementTemplate/TemplateForm.vue
create mode 100644 src/views/dictionary/attachment/components/AgreementTemplate/index.vue
diff --git a/src/api/dictionary.js b/src/api/dictionary.js
index 963cb84c..4c16f173 100644
--- a/src/api/dictionary.js
+++ b/src/api/dictionary.js
@@ -1428,9 +1428,26 @@ export function addOrUpdateUserAgreement(data) {
data
})
}
+// 隐私政策和用户协议-删除
export function deleteUserAgreement(id) {
return request({
url: `/UserAgreement/deleteUserAgreement/${id}`,
method: 'delete',
})
}
+// 隐私政策和用户协议-详情
+export function getUserAgreementById(data) {
+ return request({
+ url: `/UserAgreement/getUserAgreementById`,
+ method: 'post',
+ data
+ })
+}
+// 隐私政策和用户协议-当前版本
+export function getCurrentVersionUserAgreements(data) {
+ return request({
+ url: `/UserAgreement/getCurrentVersionUserAgreements`,
+ method: 'post',
+ data
+ })
+}
diff --git a/src/components/AGR/fun.js b/src/components/AGR/fun.js
new file mode 100644
index 00000000..a7aca4f9
--- /dev/null
+++ b/src/components/AGR/fun.js
@@ -0,0 +1,37 @@
+import Vue from "vue";
+import AGRCOMP from "./index.vue";
+
+const MFAConstructor = Vue.extend(AGRCOMP);
+let MFAINSTANCELIST = [];
+const AGR = options => {
+ const { Id, callBack, cancelBack } = options;
+ if (!Id) throw `Id is requred.but ${Id}`
+ const id = `AGR${new Date().getTime()}`;
+ const instance = new MFAConstructor();
+ MFAINSTANCELIST.push(instance)
+ instance.id = id;
+ instance.vm = instance.$mount();
+ if (instance.vm.visible) return;
+ document.body.appendChild(instance.vm.$el);
+ instance.vm.open({ Id });
+ instance.vm.$on("success", (Id) => {
+ if (callBack) callBack(Id)
+ });
+ instance.vm.$on("closed", () => {
+ if (cancelBack) cancelBack();
+ document.body.removeChild(instance.vm.$el);
+ instance.vm.$destroy();
+ let index = MFAINSTANCELIST.findIndex(item => item.id === id);
+ MFAINSTANCELIST.splice(index, 1)
+ });
+ return instance.vm;
+}
+AGR.close = () => {
+ if (MFAINSTANCELIST.length <= 0) return;
+ MFAINSTANCELIST.forEach(item => {
+ document.body.removeChild(item.vm.$el);
+ item.vm.$destroy();
+ })
+ MFAINSTANCELIST = [];
+}
+export default AGR;
\ No newline at end of file
diff --git a/src/components/AGR/index.js b/src/components/AGR/index.js
new file mode 100644
index 00000000..203bfe87
--- /dev/null
+++ b/src/components/AGR/index.js
@@ -0,0 +1,7 @@
+import AGRCOMP from "./index.vue";
+import AGR from "./fun";
+
+export default Vue => {
+ Vue.component(AGRCOMP.name, AGRCOMP);
+ Vue.prototype.$AGR = AGR;
+};
\ No newline at end of file
diff --git a/src/components/AGR/index.vue b/src/components/AGR/index.vue
new file mode 100644
index 00000000..99abf7d2
--- /dev/null
+++ b/src/components/AGR/index.vue
@@ -0,0 +1,57 @@
+
+
+
+
+ {{ agreement.FileName }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index 66fff15a..b82918cf 100644
--- a/src/main.js
+++ b/src/main.js
@@ -61,6 +61,8 @@ import Onlyoffice from '@/components/Preview_onlyoffice/index'
Vue.use(Onlyoffice)
import Video from '@/components/Preview_video/index'
Vue.use(Video)
+import AGR from '@/components/AGR/index'
+Vue.use(AGR)
import MFA from '@/components/MFA/index'
Vue.use(MFA)
import FB from '@/components/feedBack/index'
diff --git a/src/views/dictionary/attachment/components/AgreementTemplate/TemplateForm.vue b/src/views/dictionary/attachment/components/AgreementTemplate/TemplateForm.vue
new file mode 100644
index 00000000..d9a783cb
--- /dev/null
+++ b/src/views/dictionary/attachment/components/AgreementTemplate/TemplateForm.vue
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/dictionary/attachment/components/AgreementTemplate/index.vue b/src/views/dictionary/attachment/components/AgreementTemplate/index.vue
new file mode 100644
index 00000000..fa978fcb
--- /dev/null
+++ b/src/views/dictionary/attachment/components/AgreementTemplate/index.vue
@@ -0,0 +1,304 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('common:button:search') }}
+
+
+
+ {{ $t('common:button:reset') }}
+
+
+
+ {{ $t('common:button:new') }}
+
+
+
+
+
+
+
+
+
+ {{
+ $fd(
+ 'UserAgreementType',
+ scope.row.UserAgreementTypeEnum
+ )
+ }}
+
+
+
+
+
+
+
+
+
+ {{ $t('dictionary:agreement:button:view')
+ }}
+
+
+
+
+
+
+
+
+
+ {{
+ $fd(
+ 'YesOrNo',
+ scope.row.IsCurrentVersion
+ )
+ }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('dictionary:agreement:button:setCurrentVersion') }}
+
+
+ {{ $t('common:button:edit') }}
+
+
+ {{ $t('common:button:delete') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/dictionary/attachment/index.vue b/src/views/dictionary/attachment/index.vue
index d5313858..9450d0ef 100644
--- a/src/views/dictionary/attachment/index.vue
+++ b/src/views/dictionary/attachment/index.vue
@@ -8,6 +8,7 @@
+
@@ -28,6 +29,7 @@ import EmailTemplate from './components/EmailTemplate'
import CommonTemplate from './components/CommonTemplate'
import SignatureTemplate from './components/SignatureTemplate'
import ToolsTemplate from './components/ToolsTemplate'
+import AgreementTemplate from './components/AgreementTemplate'
import VueOfficeDocx from '@vue-office/docx'
import '@vue-office/docx/lib/index.css'
import VueOfficeExcel from '@vue-office/excel'
@@ -44,7 +46,8 @@ export default {
VueOfficeDocx,
VueOfficeExcel,
PreviewFile,
- ToolsTemplate
+ ToolsTemplate,
+ AgreementTemplate
},
data() {
return {
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index c3231d89..16a77aab 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -84,6 +84,14 @@
" size="medium" @click.native.prevent="handleLogin">
{{ $t('login:button:login') }}
+
+ {{ $t('login:message:PrivacyPolicy') }}
+ {{ $t('login:message:UserAgreement')
+ }}
+ {{ $t('login:message:and') }}
+ {{
+ $t('login:message:PrivacyPolicyName') }}
+
- {{ $t('login:message:PrivacyPolicy') }}
- 《{{ $t('login:message:PrivacyPolicyName') }}》
-
@@ -185,6 +189,9 @@ import Vcode from 'vue-puzzle-vcode'
import browserTip from '@/views/dictionary/template/browser/tip.vue'
import Img1 from '@/assets/pic-2.png'
import toggleRole from '@/components/toggleRole'
+import {
+ getCurrentVersionUserAgreements,
+} from '@/api/dictionary'
export default {
name: 'Login',
components: { TopLang, Vcode, browserTip, toggleRole },
@@ -232,6 +239,7 @@ export default {
Img1,
toggleRoleVisible: false,
toggleRoleLoading: false,
+ Agreement: []
}
},
computed: {
@@ -260,7 +268,6 @@ export default {
zzSessionStorage.setItem('loginType', this.loginType)
localStorage.setItem('location', this.location)
// zh-CN navigator.language
- console.log(navigator.language, 'navigator.language')
if (navigator.language !== 'zh-CN' && navigator.language !== 'zh-TW') {
this.$i18n.locale = 'en'
this.setLanguage('en')
@@ -282,9 +289,29 @@ export default {
}
}
this.$refs.browserTip.open()
+ this.getAgreementList()
},
methods: {
...mapMutations({ setLanguage: 'lang/setLanguage' }),
+ viewAgreement(type) {
+ let find = this.Agreement.find(item => item.IsCurrentVersion && item.UserAgreementTypeEnum === type)
+ if (!find) return this.$confirm(this.$t('login:message:noAgreement').replace('xxx', this.$fd('UserAgreementType', type)))
+ this.$AGR({
+ Id: find.Id
+ })
+ },
+ getAgreementList() {
+ getCurrentVersionUserAgreements({
+ PageIndex: 1,
+ PageSize: 20,
+ IsCurrentVersion: true
+ })
+ .then((res) => {
+ this.Agreement = res.Result
+ })
+ .catch(() => {
+ })
+ },
openAbout() {
this.aboutVisible = true
},
diff --git a/src/views/system/login-log/detail.vue b/src/views/system/login-log/detail.vue
index 162e1710..1c554693 100644
--- a/src/views/system/login-log/detail.vue
+++ b/src/views/system/login-log/detail.vue
@@ -2,26 +2,18 @@
-
-
+
+
- {{
+ {{
+ $t('dictionary:agreement:button:view')
+ }}
+ {{
scope.row.value
}}
-
+
{{ item.UserTypeShortName
}}{{ $t('system:loginLog:form:symbol')
}}{{ $fd('IsEnable', !item.IsUserRoleDisabled) }}
@@ -74,6 +66,9 @@ export default {
'PositionName',
'DepartmentName',
'UserRoleList',
+ 'UserAgreementTypeEnum',
+ 'FileVersion',
+ 'UserAgreementId',
],
}
},
@@ -96,12 +91,22 @@ export default {
if (key === 'Status') {
o.value = this.$fd('IsUserEnable', obj[key])
}
+ if (key === 'UserAgreementTypeEnum') {
+ o.value = this.$fd('UserAgreementType', obj[key])
+ }
curData.push(o)
}
})
return curData
},
},
+ methods: {
+ view(row) {
+ this.$AGR({
+ Id: row.value
+ })
+ },
+ }
}