diff --git a/src/components/ability-card.vue b/src/components/ability-card.vue new file mode 100644 index 0000000000000000000000000000000000000000..0a29b416bec1a03f9ec9b0193295100f54657101 --- /dev/null +++ b/src/components/ability-card.vue @@ -0,0 +1,298 @@ + + + + + \ No newline at end of file diff --git a/src/components/ability-list.vue b/src/components/ability-list.vue new file mode 100644 index 0000000000000000000000000000000000000000..170c19876ddc7c4d6d713d51392b065ae9ceb15c --- /dev/null +++ b/src/components/ability-list.vue @@ -0,0 +1,62 @@ + + + + + \ No newline at end of file diff --git a/src/page/main/develop/account/add/contact-form.vue b/src/page/main/develop/account/add/contact-form.vue index 9a5ac56afe959ec89e49e8823fc823b63be4573a..fad495e0c36450b2d2344d2b3ff8698085055b01 100644 --- a/src/page/main/develop/account/add/contact-form.vue +++ b/src/page/main/develop/account/add/contact-form.vue @@ -54,22 +54,22 @@ const checkPhone = (rule, value, callback) => { }); }; -const checkPhoneRepet = (rule, value, callback) => { - let params = null; - if (props.id){ - params = {id: parseInt(props.id),contact_phone: value,} - }else { - params = {id: 0,contact_phone: value} - } - $axios.post(`/apaas/system/v5/org/check`,params) - .then((res) => { - if (res.data.code == 200) { - callback() - }else { - callback(new Error(res.data.data)) - } - }) -} +// const checkPhoneRepet = (rule, value, callback) => { +// let params = null; +// if (props.id){ +// params = {id: parseInt(props.id),contact_phone: value,} +// }else { +// params = {id: 0,contact_phone: value} +// } +// $axios.post(`/apaas/system/v5/org/check`,params) +// .then((res) => { +// if (res.data.code == 200) { +// callback() +// }else { +// callback(new Error(res.data.data)) +// } +// }) +// } const checkName = (rule, value, callback) => { var reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/ @@ -89,7 +89,7 @@ const contactFormRules = reactive({ contact_phone: [ { required: true, message: '请输入联系人手机号', trigger: 'blur' }, { validator: checkPhone, trigger: 'blur' }, - { validator: checkPhoneRepet, trigger: 'blur' } + // { validator: checkPhoneRepet, trigger: 'blur' } ], contact_email: [ { type: 'email', message: '请输入正确的邮箱', trigger: 'blur' }, diff --git a/src/page/main/develop/account/add/index.vue b/src/page/main/develop/account/add/index.vue index 88db58d5b37a87086214855d7582fdcdc46ea618..2eaab7e2aa63311d74e63bf905a585c547cbe908 100644 --- a/src/page/main/develop/account/add/index.vue +++ b/src/page/main/develop/account/add/index.vue @@ -180,7 +180,13 @@ const continueCreate = () => { } //取消 const cancel = () => { - router.go(-1); + // router.go(-1); + router.push({ + path: "/develop/account", + query: { + id: formData.organization_id + } + }) } const getDetail = () => { diff --git a/src/page/main/develop/account/add/system-form.vue b/src/page/main/develop/account/add/system-form.vue index bad2b687ffc758b5b964d8c85578ac3792a09b17..05fcecc5dd0490bc661c7d3dfa81cc838207c02a 100644 --- a/src/page/main/develop/account/add/system-form.vue +++ b/src/page/main/develop/account/add/system-form.vue @@ -245,10 +245,9 @@ const getOrgTree = () => { const copyText = (data) => { navigator.clipboard.writeText(data).then( function () { - + $message.success("复制成功") }, function () { - } ); } diff --git a/src/page/main/develop/account/index.vue b/src/page/main/develop/account/index.vue index efd683df61b36761ae6f77964aa5084561f970ab..149b01c8de9836ad53f8e59eff72248d883ad796 100644 --- a/src/page/main/develop/account/index.vue +++ b/src/page/main/develop/account/index.vue @@ -20,14 +20,14 @@ />
- +
- + @@ -285,6 +285,7 @@ import directoryForm from './directory-form.vue'; import orgForm from './org-form.vue'; import CryptoJS from "crypto-js"; import { downloadFileFormatNew } from '@/services/helper' +import store from '@/store' const { proxy } = getCurrentInstance() const { $axios,$message } = proxy @@ -428,6 +429,9 @@ import { downloadFileFormatNew } from '@/services/helper' confirm_password: '', }) const search = ref('') + const userInfo = computed(() => { + return store.state.userInfo + }) const validatePass = (rule, value, callback) => { if (value !== passwordForm.password) { callback(new Error("密码输入不一致")) @@ -696,10 +700,16 @@ import { downloadFileFormatNew } from '@/services/helper' .then((res) => { if (res.data.code == 200) { tableRows.value = (res.data.data.org_users.data || []).map(item => { - - item.system_role = item.system_role ? item.system_role.join('、') : ''; + item.system_role = item.system_role ? item.system_role.join('、') : '-'; return item; }); + tableRows.value.forEach(e => { + if (e.is_admin == 4 && userInfo.value.is_admin != 4) { + e.canSelect = 1 + }else { + e.canSelect = 0 + } + }) tableTotal.value = res.data.data.org_users.total; if(params.data_type === 1) { baseInfo[0].value = res.data.data.org_info.organization_type; @@ -735,6 +745,9 @@ import { downloadFileFormatNew } from '@/services/helper' } const stateChange = (row) => { + if (row.is_admin== 4) { + return + } const state = row.state.toString(); $axios.post( `/apaas/system/v5/user/state/${row.id}/${state}`, diff --git a/src/page/main/system/organization/org-user/index.vue b/src/page/main/system/organization/org-user/index.vue index 498c56e9e76b46230cd883392212fbb12c6588e4..07b9ff102b0fa24e0693fdfc3ce0492e9faee796 100644 --- a/src/page/main/system/organization/org-user/index.vue +++ b/src/page/main/system/organization/org-user/index.vue @@ -183,7 +183,12 @@ const continueCreate = () => { } //取消 const cancel = () => { - router.go(-1); + router.push({ + path: "/system/organization", + query: { + id: route.query.orgId + } + }) } const getDetail = () => { $axios.get(`/apaas/system/v5/org/user/${route.query.id}`) diff --git a/src/page/main/system/organization/platform-user/index.vue b/src/page/main/system/organization/platform-user/index.vue index 11055c9767bac2288cec0c20440e4a5bdf750a56..f438071e6a22909727d84486d29055370555bc9f 100644 --- a/src/page/main/system/organization/platform-user/index.vue +++ b/src/page/main/system/organization/platform-user/index.vue @@ -117,15 +117,15 @@ const nextStep = () => { } //账号信息表单检验触发事件 data为null 校验失败 const getPlatformAccountFormData = (data) => { - if(data) { - if(route.query.id) { - Object.assign(formData,data); - let params = { - ...formData, - logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : '', - } - $axios.put(`/apaas/system/v5/org/update/user/${route.query.id}`,params) - .then((res) => { + if(data) { + if(route.query.id) { + Object.assign(formData,data); + let params = { + ...formData, + logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : '', + } + $axios.put(`/apaas/system/v5/org/update/user/${route.query.id}`,params) + .then((res) => { if (res.data.code == 200) { successFlag.value = true; step.value = 3; @@ -133,18 +133,18 @@ const getPlatformAccountFormData = (data) => { $message.error(res.data.data) } }) - }else { - Object.assign(formData,data); - step.value = 2; - } - }else { - + Object.assign(formData,data); + step.value = 2; } + + }else { + + } } //个人信息表单检验触发事件 data为null 校验失败 const getPlatformPersonFormData = (data) => { - if(data) { + if(data) { Object.assign(formData,data); if(route.query.id) { console.log(formData) @@ -163,11 +163,11 @@ const getPlatformPersonFormData = (data) => { }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() - }; + 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) { @@ -213,22 +213,24 @@ const getOrgTree = () => { const getDetail = () => { $axios.get(`/apaas/system/v5/org/user/${route.query.id}`) - .then((res) => { - if (res.data.code == 200) { - const form = res.data.data; - platformAccountFormRef.value.setForm({ - logo: form.logo ? [{url:form.logo}] : [], - system_account: form.system_account, - contact_phone: form.contact_phone, - state: form.state, - contact_name: form.contact_name, - contact_email: form.contact_email, - remark: form.remark, - }) - }else { - $message.error(res.data.data) - } + .then((res) => { + if (res.data.code == 200) { + const form = res.data.data; + console.log(form) + platformAccountFormRef.value.setForm({ + logo: form.logo ? [{url:form.logo}] : [], + system_account: form.system_account, + contact_phone: form.contact_phone, + state: form.state, + contact_name: form.contact_name, + contact_email: form.contact_email, + remark: form.remark, + select_role: form.select_role }) + }else { + $message.error(res.data.data) + } + }) } onBeforeMount(() => { 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 cba6151b6d482f419780ab512728f1657c0d0b15..05c764964c7b8ddac83b2b41961b276aefbce778 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 @@ -22,7 +22,7 @@ - + { } } 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(); - } - }); + 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 validateSystemAccount = (rule, value, callback) => { let params = null; - if (props.id){ - params = {id: parseInt(props.id),system_account: value,} - }else { - params = {system_account: value} - } + if (props.id){ + params = {id: parseInt(props.id),system_account: value,} + }else { + params = {system_account: value} + } $axios.post(`/apaas/system/v5/user/check/account`,params) - .then((res) => { + .then((res) => { if (res.data.code == 200) { - callback() + callback() }else { - callback(new Error(res.data.data)) + callback(new Error(res.data.data)) } - }) + }) } const checkPhoneRepet = (rule, value, callback) => { let params = null; - if (props.id){ - params = {id: parseInt(props.id),contact_phone: value,} - }else { - params = {id: 0,contact_phone: value} - } + if (props.id){ + params = {id: parseInt(props.id),contact_phone: value,} + }else { + params = {id: 0,contact_phone: value} + } $axios.post(`/apaas/system/v5/org/check`,params) - .then((res) => { + .then((res) => { if (res.data.code == 200) { - callback() + callback() }else { - callback(new Error(res.data.data)) + callback(new Error(res.data.data)) } - }) + }) } const platformAccountFormRules = reactive({ @@ -149,7 +149,7 @@ const platformAccountFormRules = reactive({ {min: 8,message: '密码长度不得低于8位',trigger: 'blur'} ], confirm_password: [ - { required: true, message: '请确认密码', trigger: 'blur' }, + { required: true, message: '请确认密码', trigger: 'blur' }, { validator: validatePass, trigger: 'blur' } ], contact_email: [ @@ -159,8 +159,6 @@ const platformAccountFormRules = reactive({ const roleList = ref([]) - - const platformAccountRef = ref(null) const emit = defineEmits(['action']) @@ -186,13 +184,13 @@ const setForm = (data) => { const getRoleList = () => { $axios.get(`/apaas/system/v5/org/select/role?is_admin=3`) - .then((res) => { + .then((res) => { if (res.data.code == 200) { - roleList.value = res.data.data; + roleList.value = res.data.data; }else { } - }) + }) } onBeforeMount(() => { diff --git a/src/page/main/system/organization/tree.vue b/src/page/main/system/organization/tree.vue index 2547b46af27d12969cb2e36e76c7e0951949f9c9..14f926706600408e75eefb9161481e386dcd41c7 100644 --- a/src/page/main/system/organization/tree.vue +++ b/src/page/main/system/organization/tree.vue @@ -34,11 +34,12 @@ -
+ :style="{ top: acTop, left: acLeft, bottom:acBottom }" + >
新建目录
新建组织
@@ -65,23 +66,35 @@ import { reactive, toRefs, ref } from '@vue/reactivity' import { getCurrentInstance, watch, nextTick} from 'vue' import { computed, onBeforeMount, onBeforeUnmount } 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 acTop = ref(0); - const acLeft = ref(0); + const acTop = ref(''); + const acLeft = ref(''); + const acBottom = ref('') const actionFlag = ref(false) const selectData = ref(null) const selectDataParent = ref(null) const mvDataParent = ref([]) const treeRef = ref(null) - + const treeActionRef = ref(null) + const bottomGap = ref(30) //弹窗吸底高度 const orgData = ref([]) + const selectNodeObj = ref(null) + const customNodeClass = (data,node) => { + if (data.data_type == 0) { + return 'noFocus' + }else { + return '' + } + } const defaultProps = { label: 'name', children: 'Child', - value: 'organization_id' + value: 'organization_id', + class: customNodeClass, } const getOrgTree = (data) => { @@ -89,6 +102,11 @@ import { useRouter } from 'vue-router'; .then((res) => { if (res.data.code == 200) { orgData.value = res.data.data || []; + console.log(route.query.id) + if (route.query.id) { + searchItem(orgData.value,route.query.id) + data = selectNodeObj.value + } if(data) { nextTick(() =>{ setCurrentNode(data) @@ -106,7 +124,17 @@ import { useRouter } from 'vue-router'; }) } - + const searchItem = (data,id) => { + data.forEach(e => { + if (e.organization_id == id) { + selectNodeObj.value = e + }else { + if (e.Child) { + searchItem(e.Child,id) + } + } + }) + } const filterTree =(val) => { treeRef.value.filter(val) } @@ -132,13 +160,32 @@ import { useRouter } from 'vue-router'; } const showAction = (e, data,node) => { - const rect = e.target.getBoundingClientRect(); //获取点击的dom的位置 - acTop.value = rect.y - 17 + "px"; - acLeft.value = rect.x + 35 + "px"; + acTop.value = '' + acLeft.value = '' + acBottom.value = '' + var allHeight = document.body.scrollHeight actionFlag.value = true; selectData.value = data; selectDataParent.value = node.parent.data.name ? node.parent.data : null; mvDataParent.value = node.parent.data.Child ? node.parent.data.Child : node.parent.data; + const rect = e.target.getBoundingClientRect(); //获取点击的dom的位置 + nextTick().then(()=>{ + setTimeout(()=>{ + var height = window.getComputedStyle(treeActionRef.value).height + height = parseInt(height) + //判断弹窗位置是否超过屏幕,超过则吸底展示 + if(height+rect.y - 17>allHeight-bottomGap.value){ + console.log(123) + acBottom.value = bottomGap.value+ "px"; + acLeft.value = rect.x + 35 + "px"; + }else{ + acTop.value = rect.y - 17 + "px"; + acLeft.value = rect.x + 35 + "px"; + } + }) + }) + // acTop.value = rect.y - 17 + "px"; + // acLeft.value = rect.x + 35 + "px"; }; const isSticky = (data) => { @@ -157,8 +204,14 @@ import { useRouter } from 'vue-router'; const emit = defineEmits(['action','select']) const handleNodeClick = (node,nodeAttr,treeNode,event) => { - selectData.value = node; - emit('select',{data: selectData,type: 'click'}); + if (node.data_type !== 0) { + selectData.value = node; + emit('select',{data: selectData,type: 'click'}); + }else { + nextTick(() => { + treeRef.value.setCurrentKey(null) + }) + } //只读则无操作事件 closeAction(); } @@ -347,4 +400,7 @@ import { useRouter } from 'vue-router'; color: #616f94; } +.file-tree :deep().noFocus:focus>.el-tree-node__content { + background-color: #fff; +} \ No newline at end of file diff --git a/src/page/main/system/role/index.vue b/src/page/main/system/role/index.vue index f16d2ce3ee166b2d7c9060e8037c11fd16a67cd8..c26447ebb9ba3b872fecdb4b9e3fd217837aa123 100644 --- a/src/page/main/system/role/index.vue +++ b/src/page/main/system/role/index.vue @@ -306,7 +306,7 @@ const getRoleRows = () => { state.tableRows = res.data.data || [] state.tableTotal = res.data.total }else { - ElMessage.error(re.data.data) + ElMessage.error(res.data.data) } }) } // 获取角色列表