Sfoglia il codice sorgente

Merge branch 'master' of http://git.hghweb.ir/ali.s/palizvani-front-vite

ali 2 anni fa
parent
commit
bbd1f72a84

+ 17 - 0
docker-compose-production.yml

@@ -0,0 +1,17 @@
+version: "3.3"
+services:
+  nextjs:
+    build: ./
+    network_mode: "host"
+    restart: "always"
+#  nginx:
+#    build: ./nginx
+#    network_mode: "host"
+#    volumes:
+#      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
+#    depends_on:
+#      - nextjs
+#    ports:
+#      - "8081:80"
+#    ports:
+#      - "${NGINX_PORT}:80"

+ 1 - 0
index.html

@@ -6,6 +6,7 @@
     <meta name="msapplication-tap-highlight" content="no">
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
     <link rel="icon" type="image/png" sizes="96x96" href="/icons/logo.png">
+    <meta name="enamad" content="292249" />
   </head>
   <body>
     <!-- quasar:entry-point -->

+ 1 - 0
src/components/FormBuilderCustumComponents/ContentMedias/ContentMedias.vue

@@ -153,6 +153,7 @@ export default {
   created () {
     FormBuilderAssist.setAttributeByName(this.inputs, 'source_type', 'value', this.sourceType)
     this.inputData = this.value
+    this.medias = new MediaList(this.value)
   },
   methods: {
     onView (media) {

+ 29 - 18
src/components/FormBuilderCustumComponents/PostCategorySelector.vue

@@ -36,7 +36,7 @@ export default {
   props: {
     value: {
       default: () => [],
-      type: [Array, String, Number, Boolean]
+      type: [Array, String, Number, Boolean, Object]
     },
     disable: {
       default: false,
@@ -57,15 +57,19 @@ export default {
   },
   watch: {
     value () {
-      if (this.value.id) {
+      if (this.value?.id) {
         this.getCategories()
-      } else {
+      } else if (this.value) {
         this.inputData = this.value
       }
     },
     mainCategory (newValue) {
       this.subCategory = null
       this.subCategoryOptions = []
+      if (!newValue.item.children) {
+        this.$emit('update:value', newValue.value)
+        return
+      }
       this.subCategoryOptions = newValue.item.children.map(item => {
         return {
           item,
@@ -77,6 +81,10 @@ export default {
     subCategory (newValue) {
       this.bakhshCategory = null
       this.bakhshCategoryOptions = []
+      if (!newValue?.item?.children) {
+        this.$emit('update:value', null)
+        return
+      }
       this.bakhshCategoryOptions = newValue.item.children.map(item => {
         return {
           item,
@@ -94,27 +102,29 @@ export default {
     this.getCategories()
   },
   methods: {
-    setMainCategory () {
-      if (!this.value?.parent?.parent?.id) {
+    setMainCategory (category) {
+      if (!category?.parent?.parent?.id) {
         return
       }
-      this.mainCategory = this.mainCategoryOptions.find(item => item.value === this.value.parent.parent.id)
+      this.mainCategory = this.mainCategoryOptions.find(item => item.value === category.parent.parent.id)
     },
-    setSubCategory () {
-      if (!this.value?.parent?.id) {
+    setSubCategory (category) {
+      if (!category?.parent?.id) {
         return
       }
-      this.subCategory = this.subCategoryOptions.find(item => item.value === this.value.parent.id)
+      this.subCategory = this.subCategoryOptions.find(item => item.value === category.parent.id)
     },
-    setBakhshCategory () {
-      if (!this.value?.id) {
+    setBakhshCategory (category) {
+      if (!category?.id) {
         return
       }
-      this.bakhshCategory = this.bakhshCategoryOptions.find(item => item.value === this.value.id)
+      this.bakhshCategory = this.bakhshCategoryOptions.find(item => item.value === category.id)
     },
     getCategories () {
       this.postCategories.laoding = true
-      APIGateway.postCategory.index({ parent__isnull: 'true', per_page: 99999 })
+      const args = { parent__isnull: 'true', per_page: 99999 }
+      const apiGateway = APIGateway.postCategory.index(args)
+      apiGateway
         .then(postCategories => {
           this.postCategories = new PostCategoryList(postCategories.list)
           this.postCategories.laoding = false
@@ -126,14 +136,15 @@ export default {
             }
           })
 
-          if (this.value?.parent?.parent?.id && this.value.id) {
+          if (this.value?.parent?.parent?.id && this.value?.id) {
+            const category = this.value
             this.$nextTick(() => {
-              this.setMainCategory()
+              this.setMainCategory(category)
               this.$nextTick(() => {
-                this.setSubCategory()
+                this.setSubCategory(category)
                 this.$nextTick(() => {
-                  this.setBakhshCategory()
-                  this.$emit('update:value', this.value.id)
+                  this.setBakhshCategory(category)
+                  this.$emit('update:value', category.id)
                 })
               })
             })

+ 2 - 0
src/components/FormBuilderCustumComponents/TicketCategorySelector.vue

@@ -7,6 +7,7 @@
       <q-select v-model="ticketCategoryType"
                 map-options
                 emit-value
+                :disable="disable"
                 :options="ticketCategoryTypeOptions"
                 :loading="ticketCategoryTypeOptions.laoding" />
     </div>
@@ -17,6 +18,7 @@
       <q-select v-model="ticketCategory"
                 map-options
                 emit-value
+                :disable="disable"
                 :options="ticketCategoryOptions"
                 :loading="ticketCategoryTypeOptions.laoding" />
     </div>

+ 9 - 9
src/components/Template/Header/MainHeader.vue

@@ -33,11 +33,11 @@
                    label="راهنما"
                    :to="{ name: 'Public.Post.List.Guide' }"
                    class="top-menu-item" />
-            <q-btn stretch
-                   flat
-                   label="Shop"
-                   :to="{ name: 'Public.Shop' }"
-                   class="top-menu-item" />
+            <!--<q-btn stretch-->
+            <!--flat-->
+            <!--label="Shop"-->
+            <!--:to="{ name: 'Public.Shop' }"-->
+            <!--class="top-menu-item" />-->
             <q-btn stretch
                    flat
                    label="آرشیو محتوا"
@@ -50,7 +50,7 @@
               <q-menu>
                 <q-list style="min-width: 100px">
                   <q-item v-close-popup
-                          href="https://formafzar.com/form/iv9cq"
+                          href="https://formafzar.ir/form/unfv5"
                           target="_blank"
                           clickable>
                     <q-item-section>کتب سطح یک</q-item-section>
@@ -80,16 +80,16 @@
                     <q-item-section>کتب سطح پنج</q-item-section>
                   </q-item>
                   <q-item v-close-popup
-                          href="https://formafzar.com/form/ch1om"
+                          href="https://formafzar.com/form/q9abs"
                           target="_blank"
                           clickable>
-                    <q-item-section>کتب جریان‌شناسی</q-item-section>
+                    <q-item-section>کتب جریان‌شناسی سطح یک</q-item-section>
                   </q-item>
                   <q-item v-close-popup
                           href="https://formafzar.com/form/xskmo"
                           target="_blank"
                           clickable>
-                    <q-item-section>جریان‌شناسی سطح دو</q-item-section>
+                    <q-item-section>کتب جریان‌شناسی سطح دو</q-item-section>
                   </q-item>
                   <q-item v-close-popup
                           href="https://formafzar.com/form/j3x1d"

+ 12 - 5
src/components/Template/SideBar/Main.vue

@@ -61,19 +61,26 @@ export default {
           show: true
         },
         {
-          title: 'Shop',
-          route: { name: 'Public.Shop' },
+          title: 'آرشیو محتوا',
+          route: { name: 'Public.ContentCategoryParentParent.List' },
           type: 'itemMenu',
           permission: 'all',
           show: true
         },
+        // {
+        //   title: 'Shop',
+        //   route: { name: 'Public.Shop' },
+        //   type: 'itemMenu',
+        //   permission: 'all',
+        //   show: true
+        // },
         {
           title: 'فروشگاه',
           type: 'simpleMenu',
           children: [
             {
               title: 'کتب سطح یک',
-              externalLink: 'https://formafzar.com/form/iv9cq',
+              externalLink: 'https://formafzar.ir/form/unfv5',
               show: true
             },
             {
@@ -97,8 +104,8 @@ export default {
               show: true
             },
             {
-              title: 'کتب جریان‌شناسی',
-              externalLink: 'https://formafzar.com/form/ch1om',
+              title: 'کتب جریان‌شناسی سطح یک',
+              externalLink: 'https://formafzar.com/form/q9abs',
               show: true
             },
             {

+ 1 - 1
src/components/Widgets/Classroom/AdminClassroomCreate/AdminClassroomCreate.vue

@@ -161,7 +161,7 @@ export default {
 
         // { type: 'separator', name: 'space', label: 'موارد زیر در طرح نبودند', className: 'custom-separator', col: 'col-12' },
         // { type: 'select', name: 'audience_role', responseKey: 'audience_role', options: Enums.groups, placeholder: ' ', label: 'نقش', col: 'col-md-4 col-12' },
-
+        { type: 'hidden', name: 'is_ongoing', responseKey: 'is_ongoing', label: 'is_ongoing', value: true, col: 'col-md-3 col-12' },
         { type: 'hidden', name: 'id', responseKey: 'id', label: 'id', col: 'col-md-3 col-12' }
       ]
     }

+ 1 - 0
src/components/Widgets/Classroom/AdminClassroomShow/components/ClassroomInfo.vue

@@ -155,6 +155,7 @@ export default {
         // { type: 'separator', name: 'space', label: 'موارد زیر در طرح نبودند', className: 'custom-separator', col: 'col-12' },
         // { type: 'select', name: 'audience_role', responseKey: 'audience_role', options: Enums.groups, placeholder: ' ', label: 'نقش', col: 'col-md-4 col-12' },
 
+        { type: 'hidden', name: 'is_ongoing', responseKey: 'is_ongoing', label: 'is_ongoing', col: 'col-md-3 col-12' },
         { type: 'hidden', name: 'id', responseKey: 'id', label: 'id', col: 'col-md-3 col-12' }
       ],
       mounted: false,

+ 26 - 20
src/components/Widgets/ContentCategory/ContentCategoryList/ContentCategoryItem.vue

@@ -1,24 +1,27 @@
 <template>
-  <q-card class="ContentCategoryItem"
-          :class="listType"
-          flat>
-    <div class="thumbnail"
-         @click="goToCategoryPageShow">
-      <q-img :src="contentCategory.thumbnail" />
-    </div>
-    <div class="cation">
-      <q-btn color="primary"
-             :to="{name: showCategoryRouteName, params: {category_id: contentCategory.id}}">
-        مشاهده جزییات
-      </q-btn>
-    </div>
-    <div class="title ellipsis-2-lines">
-      {{ contentCategory.title }}
-    </div>
-    <div class="description ellipsis-3-lines">
-      {{ contentCategory.description }}
-    </div>
-  </q-card>
+  <div class="col-md-4 col-sm-6 col-12">
+    <q-card class="ContentCategoryItem"
+            :class="listType"
+            flat>
+      <div class="thumbnail"
+           @click="goToCategoryPageShow">
+        <q-img :src="contentCategory.thumbnail" />
+      </div>
+      <div class="cation">
+        <q-btn color="primary"
+               :to="{name: showCategoryRouteName, params: {category_id: contentCategory.id}}">
+          مشاهده جزییات
+        </q-btn>
+      </div>
+      <div class="title ellipsis-2-lines">
+        {{ contentCategory.title }}
+      </div>
+      <div class="description ellipsis-3-lines">
+        {{ contentCategory.description }}
+      </div>
+    </q-card>
+  </div>
+
 </template>
 
 <script>
@@ -50,10 +53,13 @@ export default {
 
 <style lang="scss" scoped>
 .ContentCategoryItem {
+  background-color: lighten($primary,3%);
   display: flex;
   flex-flow: column;
   position: relative;
   cursor: pointer;
+  //padding: 20px 20px 30px;
+  margin: 8px;
   .thumbnail {
     .q-img {
       width: 100%;

+ 22 - 22
src/components/Widgets/ContentCategory/ContentCategoryList/ContentCategoryList.vue

@@ -218,28 +218,28 @@ export default {
     margin-bottom: 39px;
     margin-top: 50px;
   }
-  :deep(.entity-index) {
-    margin-top: 24px;
-    .quasar-crud-index-table {
-      .q-table__top {
-        display: none;
-      }
-      .q-table__grid-content {
-        $gap: 24px;
-        flex-wrap: wrap;
-        gap: $gap;
-        .ContentCategoryItem {
-          flex: 0 0 calc( 33.33% - #{$gap} );
-          box-sizing: border-box;
-        }
-      }
-      .q-table__bottom {
-        .q-table__control {
-          display: none;
-        }
-      }
-    }
-  }
+  //:deep(.entity-index) {
+  //  margin-top: 24px;
+  //  .quasar-crud-index-table {
+  //    .q-table__top {
+  //      display: none;
+  //    }
+  //    .q-table__grid-content {
+  //      $gap: 24px;
+  //      flex-wrap: wrap;
+  //      gap: $gap;
+  //      .ContentCategoryItem {
+  //        flex: 0 0 calc( 33.33% - #{$gap} );
+  //        box-sizing: border-box;
+  //      }
+  //    }
+  //    .q-table__bottom {
+  //      .q-table__control {
+  //        display: none;
+  //      }
+  //    }
+  //  }
+  //}
   .more-action {
     display: flex;
     flex-flow: row;

+ 8 - 5
src/components/Widgets/Footer/Footer.vue

@@ -132,11 +132,14 @@
                 </router-link>
               </div>
               <div class="footer-logo-item item-alaa">
-                <a href="https://trustseal.enamad.ir/?id=125806&Code=MIc5m5QgNzwT4U7FmBLE"
-                   target="_blank">
-                  <q-img src="https://trustseal.enamad.ir/Content/Images/Star/star1.png?v=5.0.0.47"
-                         alt="enamad.ir"
-                         style="cursor:pointer" />
+                <a referrerpolicy='origin'
+                   target='_blank'
+                   href='https://trustseal.enamad.ir/?id=102265&code=6ZHo5rWng4fOz0irLQaM'>
+                  <img referrerpolicy='origin'
+                       src='https://trustseal.enamad.ir/logo.aspx?id=102265&code=6ZHo5rWng4fOz0irLQaM'
+                       alt='https://www.shahidpalizvani.ir'
+                       style='cursor:pointer'
+                       code='6ZHo5rWng4fOz0irLQaM'>
                 </a>
               </div>
               <div class="footer-logo-item item-enamad">

+ 9 - 4
src/components/Widgets/Notice/NoticeList/NoticeList.vue

@@ -67,7 +67,7 @@
                     {{ getNoticeReceiverModel(inputData.props.row).is_seen ? 'خوانده شده': 'خوانده نشده' }}
                   </div>
                   <div class="entity-index-grid-item__header-creation-time">
-                    {{ getNoticeReceiverModel(inputData.props.row.notice).shamsiDate('creation_time').dateTime }}
+                    {{ ShamsiDate.getDateTime(inputData.props.row.notice_info.creation_time) }}
                   </div>
                 </div>
               </div>
@@ -96,6 +96,7 @@ import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
 import { FormBuilderAssist } from 'quasar-form-builder'
 import Breadcrumbs from 'src/components/Widgets/Breadcrumbs/Breadcrumbs.vue'
+import ShamsiDate from 'src/assets/ShamsiDate.js'
 
 export default {
   name: 'NoticeList',
@@ -113,7 +114,8 @@ export default {
         pageKey: 'page'
       },
       inputs: [
-        { type: 'hidden', name: 'is_seen', value: null }
+        { type: 'hidden', name: 'is_seen', value: null },
+        { type: 'hidden', name: 'notice__type', value: 'IN_APP' }
       ],
       table: {
         columns: [
@@ -152,6 +154,9 @@ export default {
     }
   },
   computed: {
+    ShamsiDate() {
+      return ShamsiDate
+    },
     myNotSeenNotificationsCount: {
       get () {
         return this.$store.getters['Auth/myNotSeenNotificationsCount']
@@ -200,12 +205,12 @@ export default {
     },
     setFilterToRead () {
       this.filterType = 'read'
-      FormBuilderAssist.setAttributeByName(this.inputs, 'is_seen', 'value', 'false')
+      FormBuilderAssist.setAttributeByName(this.inputs, 'is_seen', 'value', 'true')
       this.$refs.entityIndex.search()
     },
     setFilterToNotRead () {
       this.filterType = 'not-read'
-      FormBuilderAssist.setAttributeByName(this.inputs, 'is_seen', 'value', 'true')
+      FormBuilderAssist.setAttributeByName(this.inputs, 'is_seen', 'value', 'false')
       this.$refs.entityIndex.search()
     },
     setFilterToAll () {

+ 4 - 12
src/components/Widgets/Ticket/TicketShow/TicketShow.vue

@@ -119,12 +119,14 @@ import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
 import { FormBuilderAssist } from 'quasar-form-builder'
 import { InstalmentOfferList } from 'src/models/InstalmentOffer.js'
-import { TicketCategory, TicketCategoryList } from 'src/models/TicketCategory.js'
+import { TicketCategoryList } from 'src/models/TicketCategory.js'
 import InvoiceShow from 'src/components/Widgets/Invoice/InvoiceShow/InvoiceShow.vue'
 import InstallmentOffers from 'src/components/Widgets/Ticket/TicketShow/InstallmentOffers.vue'
 import FormBuilderDateTime from 'src/components/FormBuilderCustumComponents/FormBuilderDateTime.vue'
+import TicketCategorySelector from 'src/components/FormBuilderCustumComponents/TicketCategorySelector.vue'
 
 const FormBuilderDateTimeComp = shallowRef(FormBuilderDateTime)
+const TicketCategorySelectorComp = shallowRef(TicketCategorySelector)
 
 export default {
   name: 'TicketShow',
@@ -149,17 +151,7 @@ export default {
       showRouteName: 'Admin.Ticket.Show',
       indexRouteName: 'Admin.Ticket.List',
       inputs: [
-        {
-          type: 'select',
-          name: 'category_info__type',
-          responseKey: 'category_info.type',
-          options: (new TicketCategory()).typeEnums,
-          label: 'معاونت',
-          placeholder: ' ',
-          ignoreValue: true,
-          col: 'col-md-4 col-12'
-        },
-        { type: 'select', name: 'category', responseKey: 'category', placeholder: ' ', options: [], label: 'دسته', col: 'col-md-4 col-12' },
+        { type: TicketCategorySelectorComp, name: 'category', responseKey: 'category_info', col: 'col-md-8 col-12', disable: true },
         { type: 'select', name: 'status', responseKey: 'status', options: (new Ticket()).statusEnums, multiple: false, label: 'وضعیت', placeholder: ' ', col: 'col-md-4 col-12' },
 
         { type: 'file', name: 'attachment', responseKey: 'attachment', placeholder: ' ', label: 'ضمیمه', readonly: true, col: 'col-md-6 col-12' },

+ 28 - 8
src/models/Media.js

@@ -62,20 +62,40 @@ class Media extends Model {
         enumListKey: 'source_typeEnums',
         enums: [
           {
-            label: 'ویدیو',
-            value: 'VIDEO'
+            label: 'صورتحساب',
+            value: 'INVOICE'
           },
           {
-            label: 'متن',
-            value: 'TEXT'
+            label: 'محتوا',
+            value: 'CONTENT'
           },
           {
-            label: 'صوت',
-            value: 'SOUND'
+            label: 'کلاس',
+            value: 'CLASSROOM'
           },
           {
-            label: 'عکس',
-            value: 'IMAGE'
+            label: 'جلسه',
+            value: 'SESSION'
+          },
+          {
+            label: 'تمپلیت جلسه',
+            value: 'SESSION_TEMPLATE'
+          },
+          {
+            label: 'پروژه',
+            value: 'PROJECT'
+          },
+          {
+            label: 'پست',
+            value: 'POST'
+          },
+          {
+            label: 'تنظیمات',
+            value: 'SETTING'
+          },
+          {
+            label: 'رویداد',
+            value: 'EVENT'
           },
           {
             label: 'محصول',