浏览代码

fixed #118

ali 3 年之前
父节点
当前提交
4a031fa664

+ 12 - 3
src/components/Widgets/Ticket/AdminTicketShow/AdminTicketShow.vue

@@ -72,6 +72,9 @@
                                 :text="[message.body]"
                                 :sent="!isUserMessage(authenticatedUser, message)">
                   <template v-slot:stamp>
+                    <div>
+                      {{ miladiToShamsi(message.creation_time) }}
+                    </div>
                     <q-btn icon="clear"
                            round
                            color="red"
@@ -139,6 +142,7 @@
 import { shallowRef } from 'vue'
 import { EntityEdit } from 'quasar-crud'
 import { User } from 'src/models/User.js'
+import Assist from 'src/assets/js/Assist.js'
 import { Ticket } from 'src/models/Ticket.js'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
@@ -199,10 +203,12 @@ export default {
           ],
           label: 'معاونت',
           placeholder: ' ',
-          col: 'col-md-4 col-12'
+          col: 'col-md-6 col-12'
         },
-        { type: 'select', name: 'category', responseKey: 'category', placeholder: ' ', options: [], label: 'دسته', col: 'col-md-4 col-12' },
-        { type: 'select', name: 'status', responseKey: 'status', options: (new Ticket()).statusEnums, multiple: false, label: 'وضعیت', placeholder: ' ', readonly: true, col: 'col-md-4 col-12' },
+        { type: 'select', name: 'category', responseKey: 'category', placeholder: ' ', options: [], label: 'دسته', col: 'col-md-6 col-12' },
+        { type: 'select', name: 'status', responseKey: 'status', options: (new Ticket()).statusEnums, multiple: false, label: 'وضعیت', placeholder: ' ', readonly: true, col: 'col-md-6 col-12' },
+        { type: 'dateTime', name: 'creation_time', responseKey: 'creation_time', placeholder: ' ', label: 'تاریخ ایجاد', readonly: true, col: 'col-md-6 col-12' },
+
         { type: 'input', name: 'title', responseKey: 'title', label: 'عنوان', placeholder: ' ', readonly: true, col: 'col-md-12 col-12' },
         { type: 'inputEditor', name: 'body', responseKey: 'body', label: 'متن', placeholder: ' ', readonly: true, col: 'col-md-12 col-12' },
         { type: 'hidden', name: 'source_type', responseKey: 'source_type', value: null },
@@ -252,6 +258,9 @@ export default {
       })
   },
   methods: {
+    miladiToShamsi (miladi) {
+      return Assist.miladiToShamsi(miladi)
+    },
     isUserMessage (authenticatedUser, message) {
       return authenticatedUser.id === message.creator_info.id
     },

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

@@ -55,7 +55,13 @@
                               :name="isUserMessage(authenticatedUser, message) ? message.creator_info.firstname + ' ' + message.creator_info.lastname : 'کارشناس'"
                               :text="[message.body]"
                               text-html
-                              :sent="!isUserMessage(authenticatedUser, message)" />
+                              :sent="!isUserMessage(authenticatedUser, message)">
+                <template v-slot:stamp>
+                  <div>
+                    {{ miladiToShamsi(message.creation_time) }}
+                  </div>
+                </template>
+              </q-chat-message>
               <div>
                 <q-input v-model="replyText"
                          bottom-slots
@@ -100,6 +106,7 @@
 <script>
 import { EntityShow } from 'quasar-crud'
 import { User } from 'src/models/User.js'
+import Assist from 'src/assets/js/Assist.js'
 import { Ticket } from 'src/models/Ticket.js'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
@@ -145,10 +152,11 @@ export default {
           label: 'معاونت',
           placeholder: ' ',
           ignoreValue: true,
-          col: 'col-md-4 col-12'
+          col: 'col-md-6 col-12'
         },
-        { type: 'select', name: 'category', responseKey: 'category', placeholder: ' ', options: [], label: 'دسته', col: 'col-md-4 col-12' },
-        { type: 'select', name: 'status', responseKey: 'status', options: (new Ticket()).statusEnums, multiple: false, label: 'وضعیت', placeholder: ' ', col: 'col-md-4 col-12' },
+        { type: 'select', name: 'category', responseKey: 'category', placeholder: ' ', options: [], label: 'دسته', col: 'col-md-6 col-12' },
+        { type: 'select', name: 'status', responseKey: 'status', options: (new Ticket()).statusEnums, multiple: false, label: 'وضعیت', placeholder: ' ', col: 'col-md-6 col-12' },
+        { type: 'dateTime', name: 'creation_time', responseKey: 'creation_time', placeholder: ' ', label: 'تاریخ ایجاد', readonly: true, col: 'col-md-6 col-12' },
         { type: 'input', name: 'title', responseKey: 'title', label: 'عنوان', placeholder: ' ', col: 'col-md-12 col-12' },
         { type: 'inputEditor', name: 'body', responseKey: 'body', label: 'متن', placeholder: ' ', col: 'col-md-12 col-12' },
         { type: 'hidden', name: 'source_id', responseKey: 'source_id', value: null },
@@ -189,6 +197,9 @@ export default {
       })
   },
   methods: {
+    miladiToShamsi (miladi) {
+      return Assist.miladiToShamsi(miladi)
+    },
     isUserMessage (authenticatedUser, message) {
       return authenticatedUser.id === message.creator_info.id
     },