From e7765b84fc0cc462f78c255dbdba0f3b5c471854 Mon Sep 17 00:00:00 2001 From: hexiaoyong Date: Thu, 27 Oct 2022 20:07:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bg-ui/bg-info.vue | 40 +- src/bg-ui/bg-upload.vue | 2 +- src/bg-ui/index.scss | 10 +- src/page/main/develop/account/add/index.vue | 4 +- .../main/develop/account/detail/index.vue | 118 ++++-- src/page/main/develop/account/index.vue | 51 ++- .../system/organization/directory-form.vue | 121 ++++-- src/page/main/system/organization/index.vue | 360 +++++++++++++++--- .../main/system/organization/org-form.vue | 143 ++++--- .../organization/platform-user/index.vue | 108 ++++-- .../platform-user/platform-account-form.vue | 72 +++- .../platform-user/platform-person-form.vue | 14 +- src/page/main/system/organization/tree.vue | 254 ++++++------ 13 files changed, 878 insertions(+), 419 deletions(-) diff --git a/src/bg-ui/bg-info.vue b/src/bg-ui/bg-info.vue index bc56e09..7c672ca 100644 --- a/src/bg-ui/bg-info.vue +++ b/src/bg-ui/bg-info.vue @@ -18,7 +18,11 @@ width: item.copy ? 'calc(100% - 36px)' : item.download || item.password ? 'calc(100% - 22px)': '100%', color: item.download ? '#3759be' : '#404a62' }" - >{{ item.value }} + > + {{item.value}} + {{secret(item.value)}} + {{ item.value }} + 复制 + text, }); @@ -101,6 +117,15 @@ export default { // 解决第一次点击不生效的问题,如果没有,第一次点击会不生效 clipboard.onClick(e); }, + copyIcon(data) { + navigator.clipboard.writeText(data).then( + function () { + }, + function () { + + } + ); + }, download(url) { const a = document.createElement("a"); // 创建a标签 a.setAttribute("download", ""); // download属性 @@ -114,7 +139,16 @@ export default { item.value = "***************" } this.show = !this.show - } + }, + secret(value) { + const len = value.length; + const str1 = value.substring(0,3); + const str2 = value.substring(value.length-6,value.length); + const passwordStr = value.substring(3,value.length-6).split('').map(item => '*').join(''); + console.log(8888888) + console.log(passwordStr) + return str1+passwordStr+str2 + } }, }; diff --git a/src/bg-ui/bg-upload.vue b/src/bg-ui/bg-upload.vue index 11300f0..fac6eb4 100644 --- a/src/bg-ui/bg-upload.vue +++ b/src/bg-ui/bg-upload.vue @@ -4,7 +4,7 @@ :class="{ 'is-disabled': actionDisabled, 'is-easy': isEasy }" > 0 ? formData.value.logo[0].url : '', password: CryptoJS.AES.encrypt(formData.value.password,"swuE9cmCZQwrkYRV").toString(), business_code: formData.value.business_code, @@ -197,7 +197,7 @@ const continueCreate = () => { systemFormRef.value.clearForm(); contactFormRef.value.clearForm(); step.value = 1; - successFlag = false; + successFlag.value = false; } //取消 const cancel = () => { diff --git a/src/page/main/develop/account/detail/index.vue b/src/page/main/develop/account/detail/index.vue index a4fb31f..119de0b 100644 --- a/src/page/main/develop/account/detail/index.vue +++ b/src/page/main/develop/account/detail/index.vue @@ -16,7 +16,8 @@
- + +
@@ -44,71 +45,75 @@ import { reactive, toRefs, ref, } from '@vue/reactivity' import { getCurrentInstance } from 'vue' import { computed, onBeforeMount } from '@vue/runtime-core' -import { useRouter } from 'vue-router'; - +import { useRoute, useRouter } from 'vue-router'; +const route = useRoute(); +const { proxy } = getCurrentInstance() +const { $axios,$message } = proxy const baseInfo = reactive( - [ - { + [{ name: "所属机构", - value: "某某省/某某市/大数据局", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "业务系统编码", - value: "00000001", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "业务系统名称", - value: "大数据处理系统", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "账号", - value: "admin001", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "AppID", - value: "dasjkjjk", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "AppSecret", - value: "asda*******************jhjh", - nameWidth: 112 + value: "", + copy_icon: true, + secret: true, + nameWidth: 130 }, { name: "创建人", - value: "admin(机构管理员)", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "创建时间", - value: "2022-01-01 10:10:10", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "是否启用", - value: "是", - nameWidth: 112 + value: "", + state: "", + nameWidth: 130 }, { - name: "开发厂商名单", - value: "某某大数据开发商", - nameWidth: 112 + name: "开发厂商名称", + value: "", + nameWidth: 130 }, { name: "访问地址", - value: "http://www.bigdata.com", + value: "", full: true, - nameWidth: 112 + nameWidth: 130 }, { name: "业务系统描述", - value: "系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述", + value: "", full: true, - nameWidth: 112 + nameWidth: 130 }, ] ) @@ -116,31 +121,62 @@ const baseInfo = reactive( const contactInfo = reactive( [{ name: "联系人姓名", - value: "xxx", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "联系人手机号", - value: "15627365265", - nameWidth: 112 + value: "", + nameWidth: 130 }, { name: "联系人邮箱", - value: "http://www.bigdata@163.com", + value: "", full: true, - nameWidth: 112 + nameWidth: 130 }, { name: "备注", - value: "系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述", + value: "", full: true, - nameWidth: 112 + nameWidth: 130 }, - ] - ) + ]) + const logo = ref('') + + const getDetail = () => { + $axios.get(`/apaas/system/v5/user/detail/${route.query.id}`) + .then((res) => { + if (res.data.code == 200) { + const detail = res.data.data; + baseInfo[0].value = detail.organization_name; + baseInfo[1].value = detail.business_code; + baseInfo[2].value = detail.business_name; + baseInfo[3].value = detail.system_account; + baseInfo[4].value = detail.app_id; + baseInfo[5].value = detail.app_secret; + baseInfo[6].value = detail.created_by; + baseInfo[7].value = detail.created_time; + baseInfo[8].value = detail.state === 1 ? '是' : '否'; + baseInfo[8].state = detail.state === 1 ? 'success' : 'default'; + baseInfo[9].value = detail.develop_id; + baseInfo[10].value = detail.access_address; + baseInfo[11].value = detail.business_desc; + + contactInfo[0].value = detail.contact_name; + contactInfo[1].value = detail.contact_phone; + contactInfo[2].value = detail.contact_email; + contactInfo[3].value = detail.remark; + + logo.value = detail.logo; + }else { + $message.error(res.data.msg) + } + }) + } onBeforeMount(() => { - + getDetail() }) diff --git a/src/page/main/develop/account/index.vue b/src/page/main/develop/account/index.vue index 210af30..289756c 100644 --- a/src/page/main/develop/account/index.vue +++ b/src/page/main/develop/account/index.vue @@ -14,13 +14,13 @@
- + \ No newline at end of file diff --git a/src/page/main/system/organization/index.vue b/src/page/main/system/organization/index.vue index 2c2499f..d96df4f 100644 --- a/src/page/main/system/organization/index.vue +++ b/src/page/main/system/organization/index.vue @@ -17,22 +17,39 @@ v-model="search" placeholder="请输入组织名称搜索" :prefix-icon="Search" + @input="searchChange" />
- +
基本信息
- + +
-
- 新建编辑 -
+ + +
\ No newline at end of file diff --git a/src/page/main/system/organization/platform-user/index.vue b/src/page/main/system/organization/platform-user/index.vue index 252df27..c36f61b 100644 --- a/src/page/main/system/organization/platform-user/index.vue +++ b/src/page/main/system/organization/platform-user/index.vue @@ -48,8 +48,11 @@
-
-
平台用户新增成功
+
+ + +
+
{{route.query.id ? (successFlag ? '平台用户编辑成功' : '平台用户编辑失败') : (successFlag ? '平台用户新增成功' : '平台用户新增失败')}}
返回列表 继续创建
@@ -78,8 +81,10 @@ import { useRoute, useRouter } from 'vue-router'; import platformAccountForm from './platform-account-form.vue'; import platformPersonForm from './platform-person-form.vue'; -import { reactive, ref,onBeforeMount,toRefs,computed, onBeforeUnmount, onMounted } from 'vue'; - +import CryptoJS from "crypto-js"; +import { reactive, ref,onBeforeMount,toRefs,computed, onMounted, getCurrentInstance } from 'vue'; +const { proxy } = getCurrentInstance() +const { $axios,$message } = proxy const route = useRoute(); const router = useRouter(); const step = ref(1); @@ -87,18 +92,21 @@ const platformAccountFormRef = ref(null); const plplatformPersonFormRef = ref(null); const formData = reactive({ logo: '', - account: '', - phone: '', + system_account: '', + contact_phone: '', password: '', confirm_password: '', - role: '', - is_use: 1, + select_role: '', + state: '', - name: '', - email: '', + contact_name: '', + contact_email: '', remark: '', }); //账号信息表单+个人信息表单 +const orgId = ref(null); +const successFlag = ref(false) + // 下一步 const nextStep = () => { @@ -107,7 +115,7 @@ const nextStep = () => { //账号信息表单检验触发事件 data为null 校验失败 const getPlatformAccountFormData = (data) => { if(data) { - formData.value = Object.assign(formData,data); + Object.assign(formData,data); step.value = 2; }else { @@ -115,10 +123,40 @@ const getPlatformAccountFormData = (data) => { } //个人信息表单检验触发事件 data为null 校验失败 const getPlatformPersonFormData = (data) => { - if(data) { - formData.value = Object.assign(formData,data); - console.log(formData); - step.value = 3; + if(data) { + Object.assign(formData,data); + if(route.query.id) { + console.log(formData) + let params = { + + } + $axios.post(`/apaas/system/v5/user/update`,params) + .then((res) => { + if (res.data.code == 200) { + successFlag.value = true; + step.value = 3; + }else { + $message.error(res.data.msg) + } + }) + + }else { + const params = {...formData, + organization_id: orgId.value, + logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : '', + is_admin: 3, + password: CryptoJS.AES.encrypt(formData.password,"swuE9cmCZQwrkYRV").toString() + }; + $axios.post(`/apaas/system/v5/org/add/user`,params) + .then((res) => { + if (res.data.code == 200) { + successFlag.value = true; + step.value = 3; + }else { + $message.error(res.data.msg) + } + }) + } } } //上一步 @@ -134,40 +172,30 @@ const continueCreate = () => { platformAccountFormRef.value.clearForm(); plplatformPersonFormRef.value.clearForm(); step.value = 1; + successFlag.value = false; } //取消 const cancel = () => { router.go(-1); } -onBeforeUnmount(()=>{ - +const getOrgTree = () => { + $axios.get(`/apaas/system/v5/org/tree`) + .then((res) => { + if (res.data.code == 200) { + orgId.value = res.data.data[0].organization_id; + }else { + $message.error(res.data.msg) + } + }) + } + +onBeforeMount(() => { + getOrgTree() }) onMounted(() => { if(route.query.type === "1") { - setTimeout(()=> { - platformAccountFormRef.value.setForm({ - org: 'a', - code: 'b', - name: 'b', - desc: 'b', - logo: ['b'], - role: 'b', - account: 'b', - password: 'b', - confirm_password: 'b', - url: 'b', - firm_name: 'b', - is_use: 'b', - - }) - plplatformPersonFormRef.value.setForm({ - contact_user: 'c', - phone: 'c', - email: 'c', - remark: 'c', - }) - },500) + } }) diff --git a/src/page/main/system/organization/platform-user/platform-account-form.vue b/src/page/main/system/organization/platform-user/platform-account-form.vue index d4521d9..bc2e6ed 100644 --- a/src/page/main/system/organization/platform-user/platform-account-form.vue +++ b/src/page/main/system/organization/platform-user/platform-account-form.vue @@ -10,11 +10,11 @@ - - + + - - + + @@ -22,27 +22,35 @@ - - + + + + - - + +