ออกคำสั่ง ==> ปรับ route.meta.Key

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-02 14:48:23 +07:00
parent 27b3a9e446
commit f395ae40d6
3 changed files with 17 additions and 32 deletions

View file

@ -234,7 +234,6 @@ async function getActive() {
.get(config.API.activeOrganization)
.then(async (res) => {
const data = res.data.result;
formActive.activeId = data.activeId;
formActive.activeName = data.activeName;
formActive.draftId = data.draftId;

View file

@ -47,7 +47,9 @@ const mixin = useCounterMixin(); //เรียกฟังก์ชันกล
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
const route = useRoute();
const checkRoutePermisson = ref<boolean>(route.name == "disciplineOrderDatailOnly");
const checkRoutePermisson = ref<boolean>(
route.name == "disciplineOrderDatailOnly"
);
const myForm = ref<QForm | null>(null);
const filterRef = ref<QInput>();
const filter = ref<string>("");
@ -256,7 +258,6 @@ const clickClose = async () => {
};
// popup
const clickAdd = async () => {
await nodeTree();
selected.value = "";
rowsModal.value = [];
selectedModal.value = [];
@ -269,29 +270,7 @@ const clickAdd = async () => {
const clickDelete = (id: string) => {
dialogRemove($q, () => deleteData(id));
};
// tree
const nodeTree = async () => {
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res) => {
const data = res.data.result;
nodesTree.value = data;
if (data.length > 0) {
expanded.value = [data[0].id];
}
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
//
const onSelected = async (id: string) => {
await listModal(id);
};
//
const deleteData = async (id: string) => {
await http
@ -365,7 +344,14 @@ const fetchOrder = async (id: string) => {
<q-card>
<q-card-section>
<div class="col-12 row q-py-sm items-center">
<q-btn v-if="!checkRoutePermisson" flat round color="primary" @click="clickAdd" icon="mdi-plus">
<q-btn
v-if="!checkRoutePermisson"
flat
round
color="primary"
@click="clickAdd"
icon="mdi-plus"
>
<q-tooltip>เพมขอม</q-tooltip>
</q-btn>
<q-space />
@ -429,7 +415,7 @@ const fetchOrder = async (id: string) => {
<q-tr :props="props" class="cursor-pointer">
<q-td auto-width>
<q-btn
v-if="!checkRoutePermisson"
v-if="!checkRoutePermisson"
dense
size="12px"
flat
@ -496,7 +482,7 @@ const fetchOrder = async (id: string) => {
</q-form>
</q-card-section>
<q-separator v-if="!checkRoutePermisson"/>
<q-separator v-if="!checkRoutePermisson" />
<q-card-actions align="right" v-if="!checkRoutePermisson">
<q-btn
outline

View file

@ -8,7 +8,7 @@ export default [
component: MainOrder,
meta: {
Auth: true,
Key: [10],
Key: "COMMAND",
Role: "order",
},
},
@ -18,7 +18,7 @@ export default [
component: DetailPage,
meta: {
Auth: true,
Key: [10],
Key: "COMMAND",
Role: "order",
},
},
@ -28,7 +28,7 @@ export default [
component: DetailPage,
meta: {
Auth: true,
Key: [10],
Key: "COMMAND",
Role: "order",
},
},