From e591a92436fd7698cbc4c6e13df1463a63ac4720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B4=8B=E5=B7=9D?= <604737071@qq.com> Date: Tue, 23 Apr 2024 15:22:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=AF=B9=E6=8E=A5=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=8E=9F?= =?UTF-8?q?=E5=9E=8B=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf-ui/src/components/DictTag/index.vue | 54 +- sf-ui/src/views/FDS/installationList/add.vue | 17 +- sf-ui/src/views/FDS/installationList/edit.vue | 14 - .../FDS/publishList/components/addPack.vue | 38 +- sf-ui/src/views/deployment/module/index.vue | 352 ++++++++---- sf-ui/src/views/deployment/publish/index.vue | 525 ++++++++++-------- 6 files changed, 590 insertions(+), 410 deletions(-) diff --git a/sf-ui/src/components/DictTag/index.vue b/sf-ui/src/components/DictTag/index.vue index a0fd66f..c583e95 100644 --- a/sf-ui/src/components/DictTag/index.vue +++ b/sf-ui/src/components/DictTag/index.vue @@ -5,19 +5,19 @@ {{ item.label + " " }}{{ item.label + ' ' }} - {{ item.label + " " }} + {{ item.label + ' ' }} @@ -29,61 +29,63 @@ From d6d992ca44a021c3d44dcb6856b74b83f11fc508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B4=8B=E5=B7=9D?= <604737071@qq.com> Date: Tue, 23 Apr 2024 16:38:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=AF=B9=E6=8E=A5=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=8C=85=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf-ui/src/store/modules/user.js | 35 ++- sf-ui/src/utils/application.js | 41 ++- sf-ui/src/views/FDS/installationList/add.vue | 22 +- .../src/views/FDS/installationList/detail.vue | 8 +- sf-ui/src/views/FDS/installationList/edit.vue | 22 +- .../src/views/FDS/installationList/index.vue | 68 ++--- .../FDS/publishList/components/addPack.vue | 24 +- sf-ui/src/views/deployment/module/index.vue | 153 ++++++------ .../deployment/publish/component/detail.vue | 235 ++++++++++++++++++ sf-ui/src/views/deployment/publish/index.vue | 112 +++++++-- 10 files changed, 526 insertions(+), 194 deletions(-) create mode 100644 sf-ui/src/views/deployment/publish/component/detail.vue diff --git a/sf-ui/src/store/modules/user.js b/sf-ui/src/store/modules/user.js index a53c413..70fa8da 100644 --- a/sf-ui/src/store/modules/user.js +++ b/sf-ui/src/store/modules/user.js @@ -1,6 +1,12 @@ -import { login, logout, getInfo } from '@/api/login' -import { getToken, setToken, removeToken } from '@/utils/auth' -import { getApplicationId, setApplicationId, removeApplicationId } from '@/utils/application' +import { getInfo, login, logout } from '@/api/login' +import { getToken, removeToken, setToken } from '@/utils/auth' +import { + getApplicationId, + removeApplicationId, + removeApplicationName, + setApplicationId, + setApplicationName +} from '@/utils/application' const user = { state: { @@ -10,7 +16,7 @@ const user = { roles: [], permissions: [], applicationId: getApplicationId(), - applicationInfo: {}, // 用户选中的项目/应用 + applicationInfo: {} // 用户选中的项目/应用 }, mutations: { @@ -30,10 +36,10 @@ const user = { state.permissions = permissions }, SET_APPLICATION: (state, applicationInfo) => { - const { id } = applicationInfo; - state.applicationId = id || ''; - state.applicationInfo = applicationInfo; - }, + const { id } = applicationInfo + state.applicationId = id || '' + state.applicationInfo = applicationInfo + } }, actions: { @@ -59,7 +65,7 @@ const user = { return new Promise((resolve, reject) => { getInfo().then(res => { const user = res.user - const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; + const avatar = (user.avatar == '' || user.avatar == null) ? require('@/assets/images/profile.jpg') : process.env.VUE_APP_BASE_API + user.avatar if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 commit('SET_ROLES', res.roles) commit('SET_PERMISSIONS', res.permissions) @@ -106,11 +112,16 @@ const user = { // 设置选中的项目应用信息 SetApplication({ commit }, applicationInfo) { commit('SET_APPLICATION', applicationInfo) - const { id } = applicationInfo || {}; + const { id, appName } = applicationInfo || {} if (id) { - setApplicationId(applicationInfo.id); + setApplicationId(applicationInfo.id) } else { - removeApplicationId(); + removeApplicationId() + } + if (appName) { + setApplicationName(applicationInfo.appName) + } else { + removeApplicationName() } } } diff --git a/sf-ui/src/utils/application.js b/sf-ui/src/utils/application.js index 250e16d..bb027b2 100644 --- a/sf-ui/src/utils/application.js +++ b/sf-ui/src/utils/application.js @@ -1,6 +1,7 @@ -import Cookies from "js-cookie"; +import Cookies from 'js-cookie' -const ApplicationKey = "Admin-Application-Id"; +const ApplicationKey = 'Admin-Application-Id' +const ApplicationKeywords = 'Admin-Application-Name' /** * 获取应用项目ID @@ -8,7 +9,16 @@ const ApplicationKey = "Admin-Application-Id"; * @returns {string} 返回从Cookie中获取的应用项目ID。 */ export function getApplicationId() { - return Cookies.get(ApplicationKey); + return Cookies.get(ApplicationKey) +} + +/** + * 获取应用项目ID + * 该函数从Cookie中检索与应用项目相关的关键信息。 + * @returns {string} 返回从Cookie中获取的应用项目ID。 + */ +export function getApplicationName() { + return Cookies.get(ApplicationKeywords) } /** @@ -17,7 +27,16 @@ export function getApplicationId() { * @return {boolean|Object} 返回Cookie设置的结果。成功则返回true,失败则返回设置失败的对象。 */ export function setApplicationId(ApplicationId) { - return Cookies.set(ApplicationKey, ApplicationId); + return Cookies.set(ApplicationKey, ApplicationId) +} + +/** + * 设置应用项目名称到Cookie中 + * @param {string} ApplicationId - 需要设置的应用项目名称。 + * @return {boolean|Object} 返回Cookie设置的结果。成功则返回true,失败则返回设置失败的对象。 + */ +export function setApplicationName(ApplicationName) { + return Cookies.set(ApplicationKeywords, ApplicationName) } /** @@ -26,5 +45,15 @@ export function setApplicationId(ApplicationId) { * @returns {boolean} 返回删除操作的结果。如果删除成功,则返回true;如果删除失败,则返回false。 */ export function removeApplicationId() { - return Cookies.remove(ApplicationKey); -} \ No newline at end of file + return Cookies.remove(ApplicationKey) +} + +/** + * 移除应用Name的Cookie + * 本函数用于删除与应用相关的Name Cookie。 + * @returns {boolean} 返回删除操作的结果。如果删除成功,则返回true;如果删除失败,则返回false。 + */ +export function removeApplicationName() { + return Cookies.remove(ApplicationKeywords) +} + diff --git a/sf-ui/src/views/FDS/installationList/add.vue b/sf-ui/src/views/FDS/installationList/add.vue index df18c95..3f20339 100644 --- a/sf-ui/src/views/FDS/installationList/add.vue +++ b/sf-ui/src/views/FDS/installationList/add.vue @@ -8,15 +8,15 @@
- - - {{ item.label }} - - - + + + + + + + + + @@ -26,7 +26,7 @@ - @@ -64,7 +64,7 @@ export default { data() { return { formData: { - uploadingType: 'OffLineUploading', + uploadingType: 'OnLineUploading', sysApkName: undefined, version: undefined, sysApk: null, diff --git a/sf-ui/src/views/FDS/installationList/detail.vue b/sf-ui/src/views/FDS/installationList/detail.vue index 2213aa4..8e93a32 100644 --- a/sf-ui/src/views/FDS/installationList/detail.vue +++ b/sf-ui/src/views/FDS/installationList/detail.vue @@ -27,11 +27,11 @@ 登录模块 {{ form.createTime }} - - - + + + {{ form.created }} - 日志日志 + 关 闭 diff --git a/sf-ui/src/views/FDS/installationList/edit.vue b/sf-ui/src/views/FDS/installationList/edit.vue index 42fb55c..a3cdea0 100644 --- a/sf-ui/src/views/FDS/installationList/edit.vue +++ b/sf-ui/src/views/FDS/installationList/edit.vue @@ -8,15 +8,15 @@
- - - {{ item.label }} - - - + + + + + + + + + @@ -27,8 +27,8 @@ - diff --git a/sf-ui/src/views/FDS/installationList/index.vue b/sf-ui/src/views/FDS/installationList/index.vue index 1ac9418..2eed7b7 100644 --- a/sf-ui/src/views/FDS/installationList/index.vue +++ b/sf-ui/src/views/FDS/installationList/index.vue @@ -1,25 +1,25 @@ diff --git a/sf-ui/src/views/deployment/publish/index.vue b/sf-ui/src/views/deployment/publish/index.vue index 144cfd4..5094cc1 100644 --- a/sf-ui/src/views/deployment/publish/index.vue +++ b/sf-ui/src/views/deployment/publish/index.vue @@ -65,6 +65,19 @@ >修改 + + + 批量发布 + + + 删除 - - - - 导出 + >批量删除 @@ -93,8 +95,8 @@ - - + + @@ -130,6 +132,36 @@ @@ -294,13 +332,16 @@ import { addPublish, delPublish, getPublish, listPublish, updatePublish } from '@/api/deployment/publish' import Cookies from 'js-cookie' import AddPack from '@/views/FDS/publishList/components/addPack.vue' +import DetailModal from './component/detail.vue' import { listEnvironment } from '@/api/deployment/environment' +import { getApplicationName } from '@/utils/application' export default { name: 'Publish', dicts: ['release_environment', 'sys_yes_no', 'release_strategy', 'release_user_type'], components: { - AddPack + AddPack, + DetailModal }, data() { return { @@ -323,6 +364,8 @@ export default { // 是否显示弹出层 open: false, packOpen: false, + openDetail: false, + detailId: '', environmentList: [], // 查询参数 queryParams: { @@ -396,14 +439,16 @@ export default { // 取消按钮 cancel() { this.open = false + this.loading = false this.reset() + }, // 表单重置 reset() { this.form = { id: null, applyId: Cookies.get('Admin-Application-Id'), - appName: null, + appName: getApplicationName(), systemType: null, apkId: null, appStoreAddress: null, @@ -471,12 +516,14 @@ export default { delete data.explain updatePublish(data).then(response => { this.$modal.msgSuccess('修改成功') + this.loading = false this.open = false this.getList() }) } else { addPublish(this.form).then(response => { this.$modal.msgSuccess('新增成功') + this.loading = false this.open = false this.getList() }) @@ -516,6 +563,7 @@ export default { /** 关闭包选择框*/ closeAddPack() { + this.packOpen = false }, @@ -530,8 +578,24 @@ export default { // 选择系统做一些逻辑判断 changeSys(sysType) { this.form.systemType = sysType - } + }, + /**下载安装包*/ + handleDownload() { + }, + /**下架*/ + handleDown() { + + }, + /**发布*/ + handlePublish() { + + }, + /**详情*/ + handleDetail(row) { + this.detailId = row.id + this.openDetail = true + } } }