소스 검색

fix
http://git.hghweb.ir/ali.s/palizvani-front-vite/issues/432

http://git.hghweb.ir/ali.s/palizvani-front-vite/issues/430

http://git.hghweb.ir/ali.s/palizvani-front-vite/issues/429

http://git.hghweb.ir/ali.s/palizvani-front-vite/issues/427

hgh 2 년 전
부모
커밋
f9bfd7f645

+ 21 - 6
src/components/Widgets/Content/AdminContentList/AdminContentList.vue

@@ -16,7 +16,7 @@
                   :show-search-button="false"
                   :show-expand-button="false"
                   :show-reload-button="false">
-      <template #entity-index-table-cell="{inputData}">
+      <template #entity-index-table-cell="{inputData, showConfirmRemoveDialog}">
         <template v-if="inputData.col.name === 'number'">
           {{ inputData.rowNumber }}
         </template>
@@ -25,10 +25,14 @@
                  width="100px" />
         </template>
         <template v-else-if="inputData.col.name === 'action'">
-          <q-btn color="primary"
-                 :to="{name: 'Admin.Content.Show', params: {id: inputData.props.row.id}}">
-            مشاهده جزییات
-          </q-btn>
+          <div class="action-column-entity-index">
+            <q-btn color="primary"
+                   :to="{name: 'Admin.Content.Show', params: {id: inputData.props.row.id}}">
+              مشاهده جزییات
+            </q-btn>
+            <delete-btn @click="showConfirmRemoveDialog(inputData.props.row, 'id', getRemoveMessage(inputData.props.row))" />
+          </div>
+
         </template>
         <template v-else>
           {{ inputData.col.value }}
@@ -42,10 +46,11 @@
 import { EntityIndex } from 'quasar-crud'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
+import DeleteBtn from 'src/components/Control/DeleteBtn.vue'
 
 export default {
   name: 'AdminContentList',
-  components: { EntityIndex },
+  components: { DeleteBtn, EntityIndex },
   mixins: [mixinWidget],
   data: () => {
     return {
@@ -103,6 +108,11 @@ export default {
   },
   mounted() {
     this.mounted = true
+  },
+  methods: {
+    getRemoveMessage (row) {
+      return 'آیا از حذف ' + row.title + ' اطمینان دارید؟'
+    }
   }
 }
 </script>
@@ -115,5 +125,10 @@ export default {
     justify-content: flex-end;
     margin-bottom: 10px;
   }
+  .action-column-entity-index {
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+  }
 }
 </style>

+ 20 - 6
src/components/Widgets/ContentCategory/AdminContentCategoryList/AdminContentCategoryList.vue

@@ -17,7 +17,7 @@
                   :show-search-button="false"
                   :show-expand-button="false"
                   :show-reload-button="false">
-      <template #entity-index-table-cell="{inputData}">
+      <template #entity-index-table-cell="{inputData, showConfirmRemoveDialog}">
         <template v-if="inputData.col.name === 'number'">
           {{ inputData.rowNumber }}
         </template>
@@ -26,10 +26,13 @@
                  width="100px" />
         </template>
         <template v-else-if="inputData.col.name === 'action'">
-          <q-btn color="primary"
-                 :to="{name: 'Admin.ContentCategory.Show', params: {id: inputData.props.row.id}}">
-            مشاهده جزییات
-          </q-btn>
+          <div class="action-column-entity-index">
+            <q-btn color="primary"
+                   :to="{name: 'Admin.ContentCategory.Show', params: {id: inputData.props.row.id}}">
+              مشاهده جزییات
+            </q-btn>
+            <delete-btn @click="showConfirmRemoveDialog(inputData.props.row, 'id', getRemoveMessage(inputData.props.row))" />
+          </div>
         </template>
         <template v-else>
           {{ inputData.col.value }}
@@ -45,10 +48,11 @@ import { EntityIndex } from 'quasar-crud'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
 import { FormBuilderAssist } from 'quasar-form-builder'
+import DeleteBtn from 'components/Control/DeleteBtn.vue'
 
 export default {
   name: 'AdminContentCategoryList',
-  components: { EntityIndex },
+  components: { DeleteBtn, EntityIndex },
   mixins: [mixinWidget],
   props: {
     title: {
@@ -125,6 +129,11 @@ export default {
   },
   mounted() {
     this.mounted = true
+  },
+  methods: {
+    getRemoveMessage (row) {
+      return 'آیا از حذف ' + row.title + ' اطمینان دارید؟'
+    }
   }
 }
 </script>
@@ -144,5 +153,10 @@ export default {
     justify-content: flex-end;
     margin-bottom: 10px;
   }
+  .action-column-entity-index {
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+  }
 }
 </style>

+ 24 - 6
src/components/Widgets/Post/AdminPostList/AdminPostList.vue

@@ -16,7 +16,7 @@
                   :show-search-button="false"
                   :show-expand-button="false"
                   :show-reload-button="false">
-      <template #entity-index-table-cell="{inputData}">
+      <template #entity-index-table-cell="{inputData, showConfirmRemoveDialog}">
         <template v-if="inputData.col.name === 'number'">
           {{ inputData.rowNumber }}
         </template>
@@ -25,10 +25,14 @@
                  width="100px" />
         </template>
         <template v-else-if="inputData.col.name === 'action'">
-          <q-btn color="primary"
-                 :to="{name: 'Admin.Post.Show', params: {id: inputData.props.row.id}}">
-            مشاهده جزییات
-          </q-btn>
+          <div class="action-column-entity-index">
+            <q-btn color="primary"
+                   :to="{name: 'Admin.Post.Show', params: {id: inputData.props.row.id}}">
+              مشاهده جزییات
+            </q-btn>
+            <delete-btn @click="showConfirmRemoveDialog(inputData.props.row, 'id', getRemoveMessage(inputData.props.row))" />
+          </div>
+
         </template>
         <template v-else>
           {{ inputData.col.value }}
@@ -42,10 +46,11 @@
 import { EntityIndex } from 'quasar-crud'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
+import DeleteBtn from 'src/components/Control/DeleteBtn.vue'
 
 export default {
   name: 'AdminPostList',
-  components: { EntityIndex },
+  components: { DeleteBtn, EntityIndex },
   mixins: [mixinWidget],
   data: () => {
     return {
@@ -103,6 +108,14 @@ export default {
   },
   mounted() {
     this.mounted = true
+  },
+  methods: {
+    search () {
+      this.$refs.entityIndex.search()
+    },
+    getRemoveMessage (row) {
+      return 'آیا از حذف ' + row.title + ' اطمینان دارید؟'
+    }
   }
 }
 </script>
@@ -115,5 +128,10 @@ export default {
     justify-content: flex-end;
     margin-bottom: 10px;
   }
+  .action-column-entity-index {
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+  }
 }
 </style>

+ 20 - 6
src/components/Widgets/PostCategory/AdminPostCategoryList/AdminPostCategoryList.vue

@@ -17,7 +17,7 @@
                   :show-search-button="false"
                   :show-expand-button="false"
                   :show-reload-button="false">
-      <template #entity-index-table-cell="{inputData}">
+      <template #entity-index-table-cell="{inputData, showConfirmRemoveDialog}">
         <template v-if="inputData.col.name === 'number'">
           {{ inputData.rowNumber }}
         </template>
@@ -26,10 +26,13 @@
                  width="100px" />
         </template>
         <template v-else-if="inputData.col.name === 'action'">
-          <q-btn color="primary"
-                 :to="{name: 'Admin.PostCategory.Show', params: {id: inputData.props.row.id}}">
-            مشاهده جزییات
-          </q-btn>
+          <div class="action-column-entity-index">
+            <q-btn color="primary"
+                   :to="{name: 'Admin.PostCategory.Show', params: {id: inputData.props.row.id}}">
+              مشاهده جزییات
+            </q-btn>
+            <delete-btn @click="showConfirmRemoveDialog(inputData.props.row, 'id', getRemoveMessage(inputData.props.row))" />
+          </div>
         </template>
         <template v-else>
           {{ inputData.col.value }}
@@ -45,10 +48,11 @@ import { EntityIndex } from 'quasar-crud'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
 import { FormBuilderAssist } from 'quasar-form-builder'
+import DeleteBtn from 'components/Control/DeleteBtn.vue'
 
 export default {
   name: 'AdminPostCategoryList',
-  components: { EntityIndex },
+  components: { DeleteBtn, EntityIndex },
   mixins: [mixinWidget],
   props: {
     title: {
@@ -125,6 +129,11 @@ export default {
   },
   mounted() {
     this.mounted = true
+  },
+  methods: {
+    getRemoveMessage (row) {
+      return 'آیا از حذف ' + row.title + ' اطمینان دارید؟'
+    }
   }
 }
 </script>
@@ -144,5 +153,10 @@ export default {
     justify-content: flex-end;
     margin-bottom: 10px;
   }
+  .action-column-entity-index {
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+  }
 }
 </style>