|
@@ -56,10 +56,11 @@
|
|
|
style="max-width: 600px"
|
|
|
:data="roleTreedata"
|
|
|
show-checkbox
|
|
|
- default-expand-all
|
|
|
+
|
|
|
node-key="id"
|
|
|
highlight-current
|
|
|
:props="defaultProps"
|
|
|
+ :default-checked-keys="defaultCheckedKeys"
|
|
|
/>
|
|
|
</hc-dialog>
|
|
|
</template>
|
|
@@ -67,7 +68,7 @@
|
|
|
<script setup>
|
|
|
import { onMounted, ref, watch } from 'vue'
|
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
|
- import { getList, grant, grantTree, remove } from '~api/system/role.js'
|
|
|
+ import { getList, getRole, grant, grantTree, remove } from '~api/system/role.js'
|
|
|
import { arrToId, formValidate, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
onMounted(()=>{
|
|
|
getTableData()
|
|
@@ -130,8 +131,22 @@ const rowEditClick = (row)=>{
|
|
|
modalTitle.value = '编辑'
|
|
|
addModal.value = true
|
|
|
baseForm.value = { ...row }
|
|
|
+ getRoleDetail(row.id)
|
|
|
+ defaultCheckedKeys.value = []
|
|
|
getRoleTreedata()
|
|
|
}
|
|
|
+const getRoleDetail = async (id)=>{
|
|
|
+ const { error, code, data } = await getRole(
|
|
|
+ id,
|
|
|
+ )
|
|
|
+
|
|
|
+ if (!error && code === 200) {
|
|
|
+ console.log(data, 'data')
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
const rowDelClick = ()=>{
|
|
|
HcDelMsg( async ( resolve) => {
|
|
|
await removeRole()
|
|
@@ -169,7 +184,7 @@ const defaultProps = {
|
|
|
children: 'children',
|
|
|
label: 'title',
|
|
|
}
|
|
|
-
|
|
|
+const defaultCheckedKeys = ref([])
|
|
|
const roleTreedata = ref([])
|
|
|
const getRoleTreedata = async () => {
|
|
|
const { error, code, data } = await grantTree()
|