|
|
@@ -1,54 +1,56 @@
|
|
|
<template>
|
|
|
- <div class="add-new-action-row">
|
|
|
- <q-btn color="primary"
|
|
|
- :to="{name: 'Admin.Classroom.Create'}">
|
|
|
- <svg data-name="Close Square"
|
|
|
- xmlns="http://www.w3.org/2000/svg"
|
|
|
- width="20"
|
|
|
- height="20"
|
|
|
- viewBox="0 0 20 20"
|
|
|
- class="q-mr-md">
|
|
|
- <path id="Combined_Shape"
|
|
|
- data-name="Combined Shape"
|
|
|
- d="M5.665,20C2.276,20,0,17.623,0,14.084V5.916C0,2.377,2.276,0,5.665,0h8.67C17.723,0,20,2.377,20,5.916v8.168C20,17.623,17.723,20,14.333,20ZM1.5,5.916v8.168c0,2.683,1.634,4.416,4.164,4.416h8.669c2.532,0,4.167-1.733,4.167-4.416V5.916c0-2.682-1.635-4.415-4.166-4.415H5.665C3.135,1.5,1.5,3.234,1.5,5.916Zm7.968,8a.747.747,0,0,1-.22-.53V10.741H6.611a.75.75,0,0,1-.75-.75.749.749,0,0,1,.75-.75H9.249V6.6a.75.75,0,1,1,1.5,0V9.241h2.639a.75.75,0,0,1,0,1.5H10.748v2.642a.75.75,0,0,1-1.28.53Z"
|
|
|
- fill="#fff" />
|
|
|
- </svg>
|
|
|
- ایجاد دوره آموزشی جدید
|
|
|
- </q-btn>
|
|
|
- </div>
|
|
|
- <entity-index v-model:value="inputs"
|
|
|
- title="لیست دسته بندی ها"
|
|
|
- :api="api"
|
|
|
- :table="table"
|
|
|
- :table-keys="tableKeys"
|
|
|
- :show-expand-button="false"
|
|
|
- :show-reload-button="false"
|
|
|
- :show-search-button="false">
|
|
|
- <template #table-cell="{inputData, showConfirmRemoveDialog}">
|
|
|
- <q-td :props="inputData.props">
|
|
|
- <template v-if="inputData.props.col.name === 'actions'">
|
|
|
+ <div class="AdminClassroomIndex">
|
|
|
+ <div class="add-new-action-row">
|
|
|
+ <q-btn color="primary"
|
|
|
+ :to="{name: 'Admin.Classroom.Create'}">
|
|
|
+ <svg data-name="Close Square"
|
|
|
+ xmlns="http://www.w3.org/2000/svg"
|
|
|
+ width="20"
|
|
|
+ height="20"
|
|
|
+ viewBox="0 0 20 20"
|
|
|
+ class="q-mr-md">
|
|
|
+ <path id="Combined_Shape"
|
|
|
+ data-name="Combined Shape"
|
|
|
+ d="M5.665,20C2.276,20,0,17.623,0,14.084V5.916C0,2.377,2.276,0,5.665,0h8.67C17.723,0,20,2.377,20,5.916v8.168C20,17.623,17.723,20,14.333,20ZM1.5,5.916v8.168c0,2.683,1.634,4.416,4.164,4.416h8.669c2.532,0,4.167-1.733,4.167-4.416V5.916c0-2.682-1.635-4.415-4.166-4.415H5.665C3.135,1.5,1.5,3.234,1.5,5.916Zm7.968,8a.747.747,0,0,1-.22-.53V10.741H6.611a.75.75,0,0,1-.75-.75.749.749,0,0,1,.75-.75H9.249V6.6a.75.75,0,1,1,1.5,0V9.241h2.639a.75.75,0,0,1,0,1.5H10.748v2.642a.75.75,0,0,1-1.28.53Z"
|
|
|
+ fill="#fff" />
|
|
|
+ </svg>
|
|
|
+ ایجاد دوره آموزشی جدید
|
|
|
+ </q-btn>
|
|
|
+ </div>
|
|
|
+ <entity-index v-if="mounted"
|
|
|
+ v-model:value="inputs"
|
|
|
+ title="لیست دسته بندی ها"
|
|
|
+ :api="api"
|
|
|
+ :table="table"
|
|
|
+ :table-keys="tableKeys"
|
|
|
+ :show-expand-button="false"
|
|
|
+ :show-reload-button="false"
|
|
|
+ :show-search-button="false">
|
|
|
+ <template v-slot:entity-index-table-cell="{inputData, showConfirmRemoveDialog}">
|
|
|
+ <template v-if="inputData.col.name === 'actions'">
|
|
|
<div class="action-column-entity-index">
|
|
|
<q-btn size="md"
|
|
|
color="primary"
|
|
|
label="جزییات"
|
|
|
- :to="{name: 'Admin.Classroom.Show', params: {id: inputData.props.row.id}}" />
|
|
|
+ :to="{name: 'Admin.Classroom.Show', params: {id: inputData.props.row.id}}"
|
|
|
+ class="q-mr-md" />
|
|
|
<delete-btn @click="showConfirmRemoveDialog(inputData.props.row, 'id', getRemoveMessage(inputData.props.row))" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- {{ inputData.props.value }}
|
|
|
+ {{ inputData.col.value }}
|
|
|
</template>
|
|
|
- </q-td>
|
|
|
- </template>
|
|
|
- </entity-index>
|
|
|
+ </template>
|
|
|
+ </entity-index>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { shallowRef } from 'vue'
|
|
|
import { EntityIndex } from 'quasar-crud'
|
|
|
import Enums from 'src/assets/Enums/Enums.js'
|
|
|
-import API_ADDRESS from 'src/api/Addresses.js'
|
|
|
import ShamsiDate from 'src/assets/ShamsiDate.js'
|
|
|
+import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
import BtnControl from 'src/components/Control/btn.vue'
|
|
|
import DeleteBtn from 'src/components/Control/DeleteBtn.vue'
|
|
|
|
|
|
@@ -62,6 +64,7 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ mounted: false,
|
|
|
inputs: [
|
|
|
{
|
|
|
type: 'select',
|
|
|
@@ -81,7 +84,7 @@ export default {
|
|
|
},
|
|
|
{ type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'جستجو', props: { atClick: this.search }, col: 'col-md-2' }
|
|
|
],
|
|
|
- api: API_ADDRESS.classroom.base,
|
|
|
+ api: APIGateway.classroom.APIAdresses.base,
|
|
|
table: {
|
|
|
columns: [
|
|
|
{
|
|
|
@@ -166,14 +169,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
+ mounted () {
|
|
|
+ this.mounted = true
|
|
|
this.getUnits()
|
|
|
},
|
|
|
methods: {
|
|
|
getUnits () {
|
|
|
- this.$axios.get(API_ADDRESS.unit.base)
|
|
|
- .then((response) => {
|
|
|
- this.loadSelectOptions('unit', this.getSelectOptions(response.data.results, 'id', 'title'))
|
|
|
+ APIGateway.unit.index({ per_page: 9999 })
|
|
|
+ .then((units) => {
|
|
|
+ this.loadSelectOptions('unit', this.getSelectOptions(units.list.list, 'id', 'title'))
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
loadSelectOptions (name, value) {
|
|
|
@@ -211,12 +218,19 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
-.add-new-action-row {
|
|
|
- display: flex;
|
|
|
- flex-flow: row;
|
|
|
- align-items: center;
|
|
|
- justify-content: flex-end;
|
|
|
- margin-bottom: 22px;
|
|
|
+<style lang="scss" scoped>
|
|
|
+.AdminClassroomIndex {
|
|
|
+ .add-new-action-row {
|
|
|
+ display: flex;
|
|
|
+ flex-flow: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ margin-bottom: 22px;
|
|
|
+ }
|
|
|
+ .action-column-entity-index {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|