diff --git a/src/assets/css/index.css b/src/assets/css/index.css index 76fbdd61293a785139b1317d75d8a67af0bd6ad1..57b282d9032c42c29746592a026ed006866c8b8f 100644 --- a/src/assets/css/index.css +++ b/src/assets/css/index.css @@ -1513,6 +1513,11 @@ border-radius:8px; font-weight: bold; margin-bottom: 20px; } +.header_info { + font-size: 14px; + color: #404a62; + padding-left: 20px; +} .name_btn { color: #3759be; cursor: pointer; @@ -1527,3 +1532,11 @@ border-radius:8px; font-size: 14px; color: #404a62; } +.icon_eye { + font-size: 12px; + color: #a9b1c7; + margin-right: 8px; + vertical-align: baseline; + cursor: pointer; +} + diff --git a/src/bg-ui/bg-upload-image.vue b/src/bg-ui/bg-upload-image.vue index dfe1d14ca8befa87a283742854382dee87b58cf3..1ed93f55d79b99015d811863c388ef8260e8a7ed 100644 --- a/src/bg-ui/bg-upload-image.vue +++ b/src/bg-ui/bg-upload-image.vue @@ -59,7 +59,7 @@ export default { }, action: { type: String, - default: "/apaas/static/image/upload", + default: "/apaas/common/file/upload", }, autoUpload: { type: Boolean, diff --git a/src/bg-ui/index.scss b/src/bg-ui/index.scss index 7b31c81ed62778a03e43faf168ba02acdcf4337f..380b31ad9407adc2138d8a905e9f54b94aec2ca2 100644 --- a/src/bg-ui/index.scss +++ b/src/bg-ui/index.scss @@ -2045,6 +2045,7 @@ a { background-color: #2b4695; cursor: pointer; user-select: none; + transition: all .3s; > .label { font-size: 12px; diff --git a/src/page/main/develop/account/add/contact-form.vue b/src/page/main/develop/account/add/contact-form.vue index 64fec7b4439252669c9acff7a31965a843f2245f..2cf446edc3d20df4b7f824170673dfc981917295 100644 --- a/src/page/main/develop/account/add/contact-form.vue +++ b/src/page/main/develop/account/add/contact-form.vue @@ -7,16 +7,16 @@ ref="contactRef" style="max-width: 66%" > - - + + - - + + - - + + - + @@ -26,18 +26,30 @@ import { reactive, ref, onMounted } from 'vue' const contactForm = reactive({ - contact_user: '', - phone: '', - email: '', + contact_name: '', + contact_phone: '', + contact_email: '', remark: '', }) +const checkPhone = (rule, value, callback) => { + var phone_ruler = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/; + setTimeout(() => { + if (!phone_ruler.test(value)&&value.length!==0) { + callback(new Error("请输入正确的手机号码")); + } else { + callback(); + } + }); + }; + const contactFormRules = reactive({ - contact_user: [ + contact_name: [ { required: true, message: '请输入联系人姓名', trigger: 'blur' }, ], - phone: [ + contact_phone: [ { required: true, message: '请输入联系人手机号', trigger: 'blur' }, + { validator: checkPhone, trigger: 'blur' }, ], }) const contactRef = ref(null) diff --git a/src/page/main/develop/account/add/index.vue b/src/page/main/develop/account/add/index.vue index 7f7450b406c97481f2f4382206a0b06ea36d3df8..d39e563ea247a325b27634f30cfb3ce1e2006221 100644 --- a/src/page/main/develop/account/add/index.vue +++ b/src/page/main/develop/account/add/index.vue @@ -4,7 +4,7 @@ 开发管理 系统账号管理 - {{ route.query.type === "0" ? '新建' : '编辑'}} + {{ route.query.id ? '编辑' : '新建'}}
@@ -44,14 +44,17 @@
- +
-
-
业务系统新增成功
+
+ + +
+
{{route.query.id ? (successFlag ? '业务系统编辑成功' : '业务系统编辑失败') : (successFlag ? '业务系统新建成功' : '业务系统新建失败')}}
返回列表 - 继续创建 + 继续创建
@@ -78,30 +81,35 @@ import { useRoute, useRouter } from 'vue-router'; import systemForm from './system-form.vue'; import contactForm from './contact-form.vue'; -import { reactive, ref,onBeforeMount,toRefs,computed, onBeforeUnmount, onMounted } from 'vue'; - +import { reactive, ref,onBeforeMount,toRefs,computed, onBeforeUnmount, onMounted, getCurrentInstance } from 'vue'; +import CryptoJS from "crypto-js"; +const { proxy } = getCurrentInstance() +const { $axios,$message } = proxy const route = useRoute(); const router = useRouter(); const step = ref(1); const systemFormRef = ref(null); const contactFormRef = ref(null); const formData = reactive({ - org: '', - code: '', - name: '', - desc: '', + organization_id: '', + business_code: '', + business_name: '', + business_desc: '', logo: '', - role: '', - account: '', + system_role_id: '', + system_account: '', password: '', - url: '', - firm_name: '', - is_use: '', - contact_user: '', - phone: '', - email: '', + confirm_password: '', + access_address: '', + develop_id: '', + state: 1, + + contact_name: '', + contact_phone: '', + contact_email: '', remark: '', }); //业务系统表单+联系人表单 +const successFlag = ref(false) // 下一步 const nextStep = () => { @@ -116,12 +124,64 @@ const getSystemFormData = (data) => { } } -//联系人表单检验触发事件 data为null 校验失败 +//联系人表单检验触发事件 data为null 校验失败 const getContactFormData = (data) => { + if(data) { formData.value = Object.assign(formData,data); - console.log(formData); - step.value = 3; + if(route.query.id) { + console.log(formData) + let params = { + id: parseInt(route.query.id), + business_name: formData.value.business_name, + system_account: formData.value.system_account, + contact_email: formData.value.contact_email, + contact_phone: formData.value.contact_phone, + contact_name: formData.value.contact_name, + logo: formData.value.logo && formData.value.logo.length > 0 ? formData.value.logo[0].url : '', + state: formData.value.state, + business_desc: formData.value.business_desc, + develop_id: formData.value.develop_id, + access_address: formData.value.access_address, + remark: formData.value.remark + } + $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 { + let params = { + organization_id: formData.value.organization_id, + system_role_id: "ab98a936-9046-455b-aba3-4c73671024d0", + logo: formData.value.logo && formData.value.logo.length > 0 ? formData.value.logo[0].url : '', + password: CryptoJS.AES.encrypt(formData.value.password,"swuE9cmCZQwrkYRV").toString(), + business_code: formData.value.business_code, + business_name: formData.value.business_name, + business_desc: formData.value.business_desc, + system_account: formData.value.system_account, + access_address: formData.value.access_address, + develop_id: formData.value.develop_id, + state: formData.value.state, + contact_name: formData.value.contact_name, + contact_phone: formData.value.contact_phone, + contact_email: formData.value.contact_email, + remark: formData.value.remark, + } + $axios.put(`/apaas/system/v5/user/create`,params) + .then((res) => { + if (res.data.code == 200) { + successFlag.value = true; + step.value = 3; + }else { + $message.error(res.data.msg) + } + }) + } } } //上一步 @@ -137,42 +197,54 @@ const continueCreate = () => { systemFormRef.value.clearForm(); contactFormRef.value.clearForm(); step.value = 1; + successFlag = false; } //取消 const cancel = () => { router.go(-1); } -onBeforeUnmount(()=>{ - -}) -onMounted(() => { - if(route.query.type === "1") { - setTimeout(()=> { - systemFormRef.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', - - }) +const getDetail = () => { + $axios.get(`/apaas/system/v5/user/detail/${route.query.id}`) + .then((res) => { + if (res.data.code == 200) { + const form = res.data.data; + systemFormRef.value.setForm({ + organization_id: form.organization_id, + system_role_id: form.system_role_id, + logo: [{url:form.logo}], + business_code: form.business_code, + business_name: form.business_name, + business_desc: form.business_desc, + system_account: form.system_account, + access_address: form.access_address, + develop_id: form.develop_id, + state: form.state, + appid: form.app_id, + appsecret: form.app_secret + + }) + contactFormRef.value.setForm({ - contact_user: 'c', - phone: 'c', - email: 'c', - remark: 'c', + contact_name: form.contact_name, + contact_phone: form.contact_phone, + contact_email: form.contact_email, + remark: form.remark, }) - },500) + }else { + $message.error(res.data.msg) + } + }) } -}) + + onBeforeUnmount(()=>{ + + }) + onMounted(() => { + if(route.query.id) { + getDetail() + } + }) diff --git a/src/page/main/develop/account/add/system-form.vue b/src/page/main/develop/account/add/system-form.vue index 6980b6fc81a3b7e1345380defeef3324f7086ea5..85f047f18f9ede03d925b4701ccfa8004d529688 100644 --- a/src/page/main/develop/account/add/system-form.vue +++ b/src/page/main/develop/account/add/system-form.vue @@ -7,63 +7,94 @@ ref="systemRef" style="max-width: 66%" > - - + + - - + + - - + + + + + + 复制 + + + + 复制 + 重置 - - + + - - + + - - + + - - + + + + - - + + + + - - + + - - + + - - + +