|
|
@@ -1,85 +1,75 @@
|
|
|
-<template>
|
|
|
- <breadcrumbs style="margin-top: 29px; margin-bottom: 19px;" />
|
|
|
- <template v-if="mounted">
|
|
|
- <q-card class="barcode-section">
|
|
|
- <q-card-section>
|
|
|
- شناسه ورود به جلسه
|
|
|
- </q-card-section>
|
|
|
- <q-separator />
|
|
|
- <form-builder-bar-code lable=""
|
|
|
- :value="this.national_code" />
|
|
|
- </q-card>
|
|
|
- </template>
|
|
|
- <entity-index v-if="mounted"
|
|
|
- ref="entityIndex"
|
|
|
- v-model:value="inputs"
|
|
|
- :title="listTitle"
|
|
|
- :api="api"
|
|
|
- :table="table"
|
|
|
- :table-keys="tableKeys"
|
|
|
- :table-grid-size="$q.screen.lt.sm"
|
|
|
- :show-expand-button="false"
|
|
|
- :show-reload-button="false"
|
|
|
- :show-search-button="false">
|
|
|
- <template #entity-index-table-cell="{inputData}">
|
|
|
- <template v-if="inputData.col.name === 'number'">
|
|
|
- {{ inputData.rowNumber }}
|
|
|
- </template>
|
|
|
- <template v-if="inputData.col.name === 'status'">
|
|
|
- <div :class="this.getRegistrationStatusTitleClass(inputData.props.row)">
|
|
|
- {{ this.getRegistrationStatusTitle(inputData.props.row) }}
|
|
|
- </div>
|
|
|
+<template class="my-container">
|
|
|
+ <div class="my-container">
|
|
|
+ <breadcrumbs style="margin-top: 29px; margin-bottom: 19px;" />
|
|
|
+ <template v-if="mounted">
|
|
|
+ <q-card class="barcode-section">
|
|
|
+ <q-card-section>
|
|
|
+ شناسه ورود به جلسه
|
|
|
+ </q-card-section>
|
|
|
+ <q-separator />
|
|
|
+ <form-builder-bar-code lable=""
|
|
|
+ :value="this.national_code" />
|
|
|
+ </q-card>
|
|
|
+ </template>
|
|
|
+ <entity-index v-if="mounted"
|
|
|
+ ref="entityIndex"
|
|
|
+ v-model:value="inputs"
|
|
|
+ :title="listTitle"
|
|
|
+ :api="api"
|
|
|
+ :table="table"
|
|
|
+ :table-keys="tableKeys"
|
|
|
+ :table-grid-size="$q.screen.lt.sm"
|
|
|
+ :show-expand-button="false"
|
|
|
+ :show-reload-button="false"
|
|
|
+ :show-search-button="false">
|
|
|
+ <template #before-form-builder>
|
|
|
+ <filters :unitCategories="unitCategories"
|
|
|
+ :units="units"
|
|
|
+ @onUnitCategoriesFilterChanged="onUnitCategoriesFilterChanged"
|
|
|
+ @onUnitsFilterChanged="onUnitsFilterChanged" />
|
|
|
</template>
|
|
|
- <template v-else-if="inputData.col.name === 'action'">
|
|
|
- <q-btn size="md"
|
|
|
- color="primary"
|
|
|
- label="جزییات"
|
|
|
- :to="{name: showPageRouteName, params: {id: inputData.props.row.classroom_info.id}}" />
|
|
|
+ <template #entity-index-table-cell="{inputData}">
|
|
|
+ <template v-if="inputData.col.name === 'number'">
|
|
|
+ {{ inputData.rowNumber }}
|
|
|
+ </template>
|
|
|
+ <template v-if="inputData.col.name === 'status'">
|
|
|
+ <div :class="this.getRegistrationStatusTitleClass(inputData.props.row)">
|
|
|
+ {{ this.getRegistrationStatusTitle(inputData.props.row) }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="inputData.col.name === 'action'">
|
|
|
+ <q-btn size="md"
|
|
|
+ color="primary"
|
|
|
+ label="جزییات"
|
|
|
+ :to="{name: showPageRouteName, params: {id: inputData.props.row.classroom_info.id}}" />
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ inputData.col.value }}
|
|
|
+ </template>
|
|
|
</template>
|
|
|
- <template v-else>
|
|
|
- {{ inputData.col.value }}
|
|
|
+ <template #entity-index-table-item-cell="{inputData}">
|
|
|
+ <q-card class="user-classroom-card-list">
|
|
|
+ <user-classroom-card :registration="inputData.props.row" />
|
|
|
+ </q-card>
|
|
|
</template>
|
|
|
- </template>
|
|
|
- <template #entity-index-table-item-cell="{inputData}">
|
|
|
- <entity-index-grid-item :input-data="inputData">
|
|
|
- <template #col="{col, row}">
|
|
|
- <template v-if="col.name === 'number'">
|
|
|
- {{ inputData.rowNumber }}
|
|
|
- </template>
|
|
|
- <template v-if="col.name === 'status'">
|
|
|
- <div :class="this.getRegistrationStatusTitleClass(row)">
|
|
|
- {{ this.getRegistrationStatusTitle(row) }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-else-if="col.name === 'action'">
|
|
|
- <q-btn size="md"
|
|
|
- color="primary"
|
|
|
- label="جزییات"
|
|
|
- :to="{name: showPageRouteName, params: {id: row.classroom_info.id}}" />
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </entity-index-grid-item>
|
|
|
- </template>
|
|
|
- </entity-index>
|
|
|
+ </entity-index>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
import { EntityIndex } from 'quasar-crud'
|
|
|
import Enums from 'src/assets/Enums/Enums.js'
|
|
|
import { Invoice } from 'src/models/Invoice.js'
|
|
|
import ShamsiDate from 'src/assets/ShamsiDate.js'
|
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
import { FormBuilderAssist } from 'quasar-form-builder'
|
|
|
-import BtnControl from 'src/components/Control/btn.vue'
|
|
|
import { Registration } from 'src/models/Registration.js'
|
|
|
import { mixinAuth, mixinWidget } from 'src/mixin/Mixins.js'
|
|
|
-import EntityIndexGridItem from 'src/components/EntityIndexGridItem.vue'
|
|
|
+import UserClassroomCard from 'src/components/Widgets/Classroom/UserClassroomCard/UserClassroomCard.vue'
|
|
|
import Breadcrumbs from 'src/components/Widgets/Breadcrumbs/Breadcrumbs.vue'
|
|
|
import { TranscriptSheet } from 'src/models/TranscriptSheet'
|
|
|
import FormBuilderBarCode from 'src/components/FormBuilderCustumComponents/FormBuilderBarCode.vue'
|
|
|
-
|
|
|
-const BtnControlComp = shallowRef(BtnControl)
|
|
|
+import Filters from './filters.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'UserPanel.Profile.AllClassrooms',
|
|
|
@@ -87,36 +77,21 @@ export default {
|
|
|
FormBuilderBarCode,
|
|
|
EntityIndex,
|
|
|
Breadcrumbs,
|
|
|
- EntityIndexGridItem
|
|
|
+ UserClassroomCard,
|
|
|
+ Filters
|
|
|
},
|
|
|
mixins: [mixinAuth, mixinWidget],
|
|
|
data () {
|
|
|
return {
|
|
|
mounted: false,
|
|
|
+ unitCategories: [],
|
|
|
+ units: [],
|
|
|
national_code: null,
|
|
|
inputs: [
|
|
|
- {
|
|
|
- type: 'select',
|
|
|
- name: 'category',
|
|
|
- options: [],
|
|
|
- value: null,
|
|
|
- label: 'گروه آموزشی',
|
|
|
- placeholder: ' ',
|
|
|
- col: 'col-md-2 col-12'
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'select',
|
|
|
- name: 'unit',
|
|
|
- responseKey: 'unit',
|
|
|
- options: [],
|
|
|
- value: null,
|
|
|
- label: 'درس',
|
|
|
- placeholder: ' ',
|
|
|
- col: 'col-md-2 col-12'
|
|
|
- },
|
|
|
+ { type: 'hidden', name: 'classroom__unit__category', value: null },
|
|
|
+ { type: 'hidden', name: 'classroom__unit', value: null },
|
|
|
{ type: 'hidden', name: 'classroom__unit__category__type', value: 'TRAINING' },
|
|
|
- { type: 'hidden', name: 'owner', value: null },
|
|
|
- { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'جستجو', placeholder: ' ', atClick: () => {}, col: 'col-md-2 col-12' }
|
|
|
+ { type: 'hidden', name: 'owner', value: null }
|
|
|
],
|
|
|
api: APIGateway.registration.APIAdresses.base,
|
|
|
table: {
|
|
|
@@ -219,12 +194,13 @@ export default {
|
|
|
return 'UserPanel.Profile.ClassroomInfo'
|
|
|
},
|
|
|
selectedCategoryId () {
|
|
|
- return this.getInputValue('category')
|
|
|
+ // return this.getInputValue('category')
|
|
|
+ return 1 // TODO:
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
selectedCategoryId () {
|
|
|
- this.setInputValue('unit', null)
|
|
|
+ // this.setInputValue('unit', null)
|
|
|
this.getUnits(this.selectedCategoryId)
|
|
|
}
|
|
|
},
|
|
|
@@ -236,6 +212,20 @@ export default {
|
|
|
this.mounted = true
|
|
|
},
|
|
|
methods: {
|
|
|
+ onUnitCategoriesFilterChanged (selectedId) {
|
|
|
+ if (selectedId) {
|
|
|
+ this.getUnits(selectedId)
|
|
|
+ } else {
|
|
|
+ this.units = []
|
|
|
+ }
|
|
|
+ FormBuilderAssist.setAttributeByName(this.inputs, 'classroom__unit__category', 'value', selectedId)
|
|
|
+ FormBuilderAssist.setAttributeByName(this.inputs, 'classroom__unit', 'value', null)
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ onUnitsFilterChanged (selectedId) {
|
|
|
+ FormBuilderAssist.setAttributeByName(this.inputs, 'classroom__unit', 'value', selectedId)
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
setClassroomTypeOfInputs () {
|
|
|
FormBuilderAssist.setAttributeByName(this.inputs, 'classroom__unit__category__type', 'value', this.localOptions.classroomType)
|
|
|
|
|
|
@@ -307,7 +297,7 @@ export default {
|
|
|
},
|
|
|
loadInputDataOptions () {
|
|
|
this.getCategories()
|
|
|
- this.getUnits()
|
|
|
+ // this.getUnits()
|
|
|
},
|
|
|
getCategories () {
|
|
|
APIGateway.unitCategory.index({ per_page: 9999, type: this.localOptions.classroomType })
|
|
|
@@ -318,6 +308,7 @@ export default {
|
|
|
label: item.title
|
|
|
}
|
|
|
}))
|
|
|
+ this.unitCategories = categories.list
|
|
|
})
|
|
|
.catch(() => {})
|
|
|
},
|
|
|
@@ -327,7 +318,8 @@ export default {
|
|
|
category__type: this.localOptions.classroomType
|
|
|
})
|
|
|
.then(unitList => {
|
|
|
- this.loadSelectOptions('unit', this.getSelectOptions(unitList.list.list, 'id', 'title'))
|
|
|
+ // this.loadSelectOptions('unit', this.getSelectOptions(unitList.list.list, 'id', 'title'))
|
|
|
+ this.units = unitList.list
|
|
|
})
|
|
|
.catch(() => {
|
|
|
})
|
|
|
@@ -361,6 +353,15 @@ export default {
|
|
|
margin-bottom: 8px;
|
|
|
padding-bottom: 8px;
|
|
|
}
|
|
|
+
|
|
|
+.my-container {
|
|
|
+ :deep(.entity-index) {
|
|
|
+ .entity-crud-formBuilder {
|
|
|
+ padding: 8px 0 0 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.CLEAN_PASSED {
|
|
|
//font-size: 1.1em;
|
|
|
color: green;
|
|
|
@@ -374,4 +375,7 @@ export default {
|
|
|
.FAILED_DUE_TO_PRE_CONDITIONAL{
|
|
|
color: red;
|
|
|
}
|
|
|
+.user-classroom-card-list {
|
|
|
+ margin: 8px 0;
|
|
|
+}
|
|
|
</style>
|