Merge remote-tracking branch 'origin/master'
# Conflicts: # ui/src/pages/OrderList.vue
This commit is contained in:
@@ -68,6 +68,13 @@
|
||||
Rol + Departman Yetkilendirme
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
icon="list"
|
||||
label="Liste"
|
||||
@click="goList"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
v-if="canUpdateUser"
|
||||
color="primary"
|
||||
@@ -178,12 +185,15 @@
|
||||
<script setup>
|
||||
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { Notify } from 'quasar'
|
||||
import api from 'src/services/api'
|
||||
import { usePermission } from 'src/composables/usePermission'
|
||||
|
||||
const { canUpdate } = usePermission()
|
||||
const canUpdateUser = canUpdate('user')
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
|
||||
/* ================= STATE ================= */
|
||||
@@ -237,6 +247,27 @@ const columns = [
|
||||
|
||||
let matrixLoading = false
|
||||
|
||||
function goList () {
|
||||
router.push({ name: 'role-dept-permissions-list' })
|
||||
}
|
||||
|
||||
function applyRouteSelection () {
|
||||
const qRole = String(route.query.roleId || '').trim()
|
||||
const qDept = String(route.query.deptCode || '').trim()
|
||||
|
||||
if (/^\d+$/.test(qRole) && Number(qRole) > 0) {
|
||||
roleId.value = qRole
|
||||
}
|
||||
|
||||
if (qDept) {
|
||||
deptCode.value = qDept
|
||||
}
|
||||
|
||||
if (roleId.value && deptCode.value) {
|
||||
loadMatrix()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ================= LOOKUPS ================= */
|
||||
|
||||
@@ -425,14 +456,19 @@ function toggleColumn (key, val) {
|
||||
|
||||
/* ================= INIT ================= */
|
||||
|
||||
onMounted(() => {
|
||||
loadLookups()
|
||||
onMounted(async () => {
|
||||
await loadLookups()
|
||||
applyRouteSelection()
|
||||
})
|
||||
|
||||
watch(roleId, v => console.log('ROLE_ID >>>', v))
|
||||
watch(deptCode, v => console.log('DEPT >>>', v))
|
||||
watch(
|
||||
() => [route.query.roleId, route.query.deptCode],
|
||||
() => {
|
||||
if (!lookupsLoaded.value) return
|
||||
applyRouteSelection()
|
||||
}
|
||||
)
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user