|
|
|
@ -16,11 +16,10 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mt-5">
|
|
|
|
|
<PermissionSetStep
|
|
|
|
|
@prev="handleStepPrev"
|
|
|
|
|
@next="handleStep2Next"
|
|
|
|
|
v-show="current === 0"
|
|
|
|
|
v-if="state.initSetp1"
|
|
|
|
|
:ApiData="checkedKeys"
|
|
|
|
|
:ApiData="ApiData"
|
|
|
|
|
/>
|
|
|
|
|
<Authorization
|
|
|
|
|
@prev="handleStepPrev"
|
|
|
|
@ -51,17 +50,13 @@
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
import PermissionSetStep from './PermissionSetStep.vue'
|
|
|
|
|
import Authorization from './Authorization.vue'
|
|
|
|
|
import { RejectTenantApply } from './api'
|
|
|
|
|
import { getPermission, getInfo } from '/@/api/system/tenant'
|
|
|
|
|
import { useUserStore } from '/@/store/modules/user'
|
|
|
|
|
import { getClientPermissionTreeList } from './api'
|
|
|
|
|
import { getPermission, GetAuthList } from '/@/api/system/tenant'
|
|
|
|
|
|
|
|
|
|
import { UpdatePermission } from '/@/api/system/tenant'
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
// 记录当前的tenantId
|
|
|
|
|
tenantId.value = userStore.getUserInfo?.tenantId
|
|
|
|
|
console.log('Mounted', userStore.getUserInfo)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const tenantId = ref('')
|
|
|
|
|
const treeData = ref([])
|
|
|
|
|
const { notification, createConfirm, createMessage } = useMessage()
|
|
|
|
|
// 声明Emits
|
|
|
|
|
const emit = defineEmits(['success', 'register'])
|
|
|
|
@ -82,57 +77,39 @@
|
|
|
|
|
permissionIds: [],
|
|
|
|
|
permissionAuthList: [],
|
|
|
|
|
})
|
|
|
|
|
const ShowData = reactive({
|
|
|
|
|
address: '',
|
|
|
|
|
adminUserCode: '',
|
|
|
|
|
auditNote: '',
|
|
|
|
|
auditStatus: '',
|
|
|
|
|
auditTime: '',
|
|
|
|
|
chief: '',
|
|
|
|
|
contractBeginDate: '',
|
|
|
|
|
contractEndDate: '',
|
|
|
|
|
email: '',
|
|
|
|
|
id: '',
|
|
|
|
|
name: '',
|
|
|
|
|
phone: '',
|
|
|
|
|
pinYinCode: '',
|
|
|
|
|
taxNo: '',
|
|
|
|
|
tel: '',
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
async function initData() {
|
|
|
|
|
console.log('initData')
|
|
|
|
|
|
|
|
|
|
const res: API.DataResult = await getInfo({ id: applyId.value })
|
|
|
|
|
const e = await getClientPermissionTreeList()
|
|
|
|
|
treeData.value = e.data
|
|
|
|
|
const res: API.DataResult = await GetAuthList({ id: tenantId.value })
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
ShowData.address = res.data.address
|
|
|
|
|
ShowData.adminUserCode = res.data.adminUserCode
|
|
|
|
|
ShowData.auditNote = res.data.auditNote
|
|
|
|
|
ShowData.auditStatus = res.data.auditStatus
|
|
|
|
|
ShowData.auditTime = res.data.auditTime
|
|
|
|
|
ShowData.chief = res.data.chief
|
|
|
|
|
ShowData.contractBeginDate = res.data.contractBeginDate
|
|
|
|
|
ShowData.contractEndDate = res.data.contractEndDate
|
|
|
|
|
ShowData.email = res.data.email
|
|
|
|
|
ShowData.id = res.data.id
|
|
|
|
|
ShowData.name = res.data.name
|
|
|
|
|
ShowData.phone = res.data.phone
|
|
|
|
|
ShowData.pinYinCode = res.data.pinYinCode
|
|
|
|
|
ShowData.taxNo = res.data.taxNo
|
|
|
|
|
ShowData.tel = res.data.tel
|
|
|
|
|
console.log(res)
|
|
|
|
|
ApiData.permissionAuthList = res.data
|
|
|
|
|
}
|
|
|
|
|
console.log(tenantId)
|
|
|
|
|
|
|
|
|
|
const res2: API.DataResult = await getPermission({ id: tenantId.value })
|
|
|
|
|
if (res2.succeeded) {
|
|
|
|
|
console.log(res2)
|
|
|
|
|
checkedKeys.value = []
|
|
|
|
|
// res2.data.forEach((item) => {
|
|
|
|
|
// console.log(item, 'item')
|
|
|
|
|
// treeData.value.forEach((item2) => {
|
|
|
|
|
// console.log(item2, 'item2')
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// WebcheckedKeys = res2.succeeded
|
|
|
|
|
console.log(res2.data)
|
|
|
|
|
checkedKeys.value = res2.data
|
|
|
|
|
ApiData.permissionIds = res2.data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
|
|
|
|
console.log('closeModal')
|
|
|
|
|
tenantId.value = data.record.id
|
|
|
|
|
ApiData.tenantId = tenantId.value
|
|
|
|
|
ApiData.permissionIds = []
|
|
|
|
|
ApiData.permissionAuthList = []
|
|
|
|
|
|
|
|
|
|
checkedKeys.value = []
|
|
|
|
|
current.value = 0
|
|
|
|
|
state.initSetp1 = true
|
|
|
|
@ -153,9 +130,9 @@
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function handleStepPrev(stepValues) {
|
|
|
|
|
current.value--
|
|
|
|
|
console.log(current.value)
|
|
|
|
|
console.log(ApiData)
|
|
|
|
|
|
|
|
|
|
current.value--
|
|
|
|
|
if (current.value == 0) {
|
|
|
|
|
state.initSetp1 = true
|
|
|
|
|
state.initSetp2 = false
|
|
|
|
@ -232,5 +209,5 @@
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const getTitle = computed(() => (!unref(isUpdate) ? '' : '企业用户审批'))
|
|
|
|
|
const getTitle = computed(() => (!unref(isUpdate) ? '' : '权限模块授权'))
|
|
|
|
|
</script>
|
|
|
|
|