ali 3 лет назад
Родитель
Сommit
3fc7824d19

+ 2 - 2
package.json

@@ -51,8 +51,8 @@
     "process": "^0.11.10",
     "quasar": "^2.12.0",
     "quasar-app-extension-q-page-builder": "^0.1.51",
-    "quasar-crud": "^0.3.44",
-    "quasar-form-builder": "^0.1.107",
+    "quasar-crud": "^0.3.45",
+    "quasar-form-builder": "^0.1.108",
     "quasar-template-builder": "^1.0.23",
     "quasar-ui-q-page-builder": "^0.1.51",
     "socket.io-client": "^4.6.1",

+ 7 - 0
src/components/Widgets/ContentCategory/AdminContentCategoryList/AdminContentCategoryList.vue

@@ -110,6 +110,13 @@ export default {
 
 <style scoped lang="scss">
 .AdminContentCategoryList {
+  :deep(.entity-index) {
+    .q-card__section {
+      .q-item {
+        display: none;
+      }
+    }
+  }
   .more-action {
     display: flex;
     flex-flow: row;

+ 41 - 15
src/components/Widgets/ContentCategory/AdminContentCategoryShow/AdminContentCategoryShow.vue

@@ -19,14 +19,29 @@
       <template #after-form-builder>
         <div v-if="contentCategory.id"
              class="q-mt-lg">
-          <admin-content-category-list :key="listKey"
-                                       title="لیست دسته بندی های جزیی"
-                                       :parent="contentCategory.id" />
-          <q-separator class="q-my-lg" />
-          <admin-content-category-create :key="listKey"
-                                         title="ایجاد دسته بندی جزیی"
-                                         :parent="contentCategory.id"
-                                         @onCreated="onCreated" />
+          <q-expansion-item expand-separator
+                            label="لیست دسته بندی ها">
+            <q-card>
+              <q-card-section>
+                <admin-content-category-list :key="listKey"
+                                             title="لیست دسته بندی های جزیی"
+                                             :parent="contentCategory.id" />
+              </q-card-section>
+            </q-card>
+          </q-expansion-item>
+
+          <q-expansion-item expand-separator
+                            label="ایجاد دسته بندی">
+            <q-card>
+              <q-card-section>
+                <admin-content-category-create :key="listKey"
+                                               title="ایجاد دسته بندی جزیی"
+                                               :parent="contentCategory.id"
+                                               @onCreated="onCreated" />
+              </q-card-section>
+            </q-card>
+          </q-expansion-item>
+
         </div>
       </template>
     </entity-edit>
@@ -35,9 +50,10 @@
 
 <script>
 import { shallowRef } from 'vue'
-import { EntityEdit, EntityCreate } from 'quasar-crud'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
+import { EntityEdit, EntityCreate } from 'quasar-crud'
+import { FormBuilderAssist } from 'quasar-form-builder'
 import BtnControl from 'src/components/Control/btn.vue'
 import { ContentCategory } from 'src/models/ContentCategory.js'
 import AdminContentCategoryList from 'src/components/Widgets/ContentCategory/AdminContentCategoryList/AdminContentCategoryList.vue'
@@ -65,12 +81,12 @@ export default {
       entityParamKey: 'id',
       showRouteName: 'AdminPanel.Ticket.Show',
       inputs: [
-        { type: 'input', name: 'title', responseKey: 'title', label: 'عنوان', placeholder: ' ', col: 'col-md-6 col-12' },
-        // { type: 'file', name: 'thumbnail', responseKey: 'thumbnail', label: 'عکس', placeholder: ' ', col: 'col-md-6 col-12' },
-        { type: 'inputEditor', name: 'description', responseKey: 'description', label: 'توضیحات', placeholder: ' ', col: 'col-md-12 col-12' },
+        { type: 'input', name: 'title', responseKey: 'title', label: 'عنوان', value: null, placeholder: ' ', col: 'col-md-6 col-12' },
+        { type: 'file', name: 'thumbnail', responseKey: 'thumbnail', label: 'عکس', value: null, placeholder: ' ', col: 'col-md-6 col-12' },
+        { type: 'inputEditor', name: 'description', responseKey: 'description', label: 'توضیحات', value: null, placeholder: ' ', col: 'col-md-12 col-12' },
+        { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'تایید', placeholder: ' ', ignoreValue: false, atClick: () => {}, col: 'col-12' },
         { type: 'hidden', name: 'parent', responseKey: 'parent', value: null },
-        { type: 'hidden', name: 'id', responseKey: 'id', value: null },
-        { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'تایید', placeholder: ' ', atClick: () => {}, col: 'col-12' }
+        { type: 'hidden', name: 'id', responseKey: 'id', value: null }
       ]
     }
   },
@@ -85,8 +101,17 @@ export default {
   },
   mounted() {
     this.mounted = true
+    this.setActionBtn()
   },
   methods: {
+    setActionBtn () {
+      FormBuilderAssist.setAttributeByName(this.inputs, 'btn', 'atClick', this.edit)
+      // this.inputs.forEach((item, index) => {
+      //   if (item.name === 'btn') {
+      //     this.inputs[index].atClick = this.edit
+      //   }
+      // })
+    },
     afterLoadInputData (data) {
       this.contentCategory = new ContentCategory(data)
       this.contentCategory.loading = false
@@ -94,7 +119,8 @@ export default {
     },
     edit() {
       this.entityLoading = true
-      this.$refs.entityEdit.editEntity()
+      console.log('inputs', this.inputs)
+      this.$refs.entityEdit.editEntity(false)
         .then(() => {
           this.$refs.entityEdit.getData()
           this.entityLoading = false

+ 9 - 9
yarn.lock

@@ -5406,23 +5406,23 @@ quasar-app-extension-q-page-builder@^0.1.51:
   dependencies:
     quasar-ui-q-page-builder "^0.1.51"
 
-quasar-crud@^0.3.44:
-  version "0.3.44"
-  resolved "https://registry.yarnpkg.com/quasar-crud/-/quasar-crud-0.3.44.tgz#1608ac6efd7765d62552580db56b1dc007f62f59"
-  integrity sha512-mil9WbNRzPcJhZsfla7o4jvyHET4AO69+929JhgvblTrbr6Tdnjtg4aRyonguTjq6HOk+499M0biY65+KXk8tQ==
+quasar-crud@^0.3.45:
+  version "0.3.45"
+  resolved "https://registry.yarnpkg.com/quasar-crud/-/quasar-crud-0.3.45.tgz#636bb8f6a20a53d37b2fc0cc48ed3c69d21223ea"
+  integrity sha512-ECSGAmnz3K0frgFmdY1soCKErKs9WW4+TJt+7up7+0msuv8bf9vtyWjPK8ii/hW4tvu5mDsun47ZDhf8HP6JVA==
   dependencies:
     "@quasar/extras" "^1.16.5"
     axios "^1.4.0"
     moment-jalaali "^0.10.0"
     quasar "^2.12.2"
-    quasar-form-builder "^0.1.107"
+    quasar-form-builder "^0.1.108"
     shvl "^3.0.0"
     vue "^3.2.47"
 
-quasar-form-builder@^0.1.107:
-  version "0.1.107"
-  resolved "https://registry.yarnpkg.com/quasar-form-builder/-/quasar-form-builder-0.1.107.tgz#c94bd5960a3181ea4a87b838c1ea8b21c1e20959"
-  integrity sha512-IGLV3P8kf3OR8/KJcI+hrMNkdr/WctNNJyIFk2mOCJupfTeuRTOwWx2ilu3+Q17UAgD3bOOcuIHAy7Oz2x9wcA==
+quasar-form-builder@^0.1.108:
+  version "0.1.108"
+  resolved "https://registry.yarnpkg.com/quasar-form-builder/-/quasar-form-builder-0.1.108.tgz#47c1e5a6bd5b1f6bf9e4806487ec9f435a44e68c"
+  integrity sha512-vnVKFXQpuwLmm5aeRE9fEOgugwqcRPzdZDoR40cjE/Hh0WzPQL+mFnFYiRgAGqIiIR6bt3i/6vZNZHYZpjlLxA==
   dependencies:
     "@quasar/extras" "^1.16.5"
     core-js "^3.31.1"