|
|
@@ -9,21 +9,44 @@
|
|
|
>
|
|
|
</q-btn>
|
|
|
</div>
|
|
|
- <entity-edit v-if="mounted"
|
|
|
- ref="entityEdit"
|
|
|
- v-model:value="inputs"
|
|
|
- title="اطلاعات محتوا"
|
|
|
- :api="api"
|
|
|
- :entity-id-key="entityIdKey"
|
|
|
- :entity-param-key="entityParamKey"
|
|
|
- :show-route-name="showRouteName"
|
|
|
- :show-close-button="false"
|
|
|
- :show-edit-button="false"
|
|
|
- :show-expand-button="false"
|
|
|
- :show-save-button="false"
|
|
|
- :show-reload-button="false"
|
|
|
- :redirect-after-edit="false"
|
|
|
- :after-load-input-data="afterLoadInputData" />
|
|
|
+ <q-card flat>
|
|
|
+ <q-tabs v-model="tab"
|
|
|
+ align="left">
|
|
|
+ <q-tab name="content"
|
|
|
+ label="جزییات محتوا" />
|
|
|
+ <q-tab name="contentTag"
|
|
|
+ label="فیش برداری" />
|
|
|
+ </q-tabs>
|
|
|
+ </q-card>
|
|
|
+ <q-tab-panels v-if="mounted"
|
|
|
+ v-model="tab">
|
|
|
+ <q-tab-panel name="content"
|
|
|
+ class="q-pa-none">
|
|
|
+ <entity-edit ref="entityEdit"
|
|
|
+ v-model:value="inputs"
|
|
|
+ title="اطلاعات محتوا"
|
|
|
+ :api="api"
|
|
|
+ :entity-id-key="entityIdKey"
|
|
|
+ :entity-param-key="entityParamKey"
|
|
|
+ :show-route-name="showRouteName"
|
|
|
+ :show-close-button="false"
|
|
|
+ :show-edit-button="false"
|
|
|
+ :show-expand-button="false"
|
|
|
+ :show-save-button="false"
|
|
|
+ :show-reload-button="false"
|
|
|
+ :redirect-after-edit="false"
|
|
|
+ :after-load-input-data="afterLoadInputData" />
|
|
|
+ </q-tab-panel>
|
|
|
+ <q-tab-panel name="contentTag"
|
|
|
+ class="q-pa-none">
|
|
|
+ <admin-content-topic-create :content="contentId"
|
|
|
+ :redirect="false"
|
|
|
+ @created="onTopicCreated" />
|
|
|
+ <q-separator class="q-my-md" />
|
|
|
+ <admin-content-topic-list :key="topicListKey"
|
|
|
+ :content-id="contentId" />
|
|
|
+ </q-tab-panel>
|
|
|
+ </q-tab-panels>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -35,6 +58,8 @@ import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
import BtnControl from 'src/components/Control/btn.vue'
|
|
|
import ContentMedias from 'src/components/FormBuilderCustumComponents/ContentMedias/ContentMedias.vue'
|
|
|
import ContentCategorySelector from 'src/components/FormBuilderCustumComponents/ContentCategorySelector.vue'
|
|
|
+import AdminContentTopicList from 'src/components/Widgets/Content/AdminContentTopicList/AdminContentTopicList.vue'
|
|
|
+import AdminContentTopicCreate from 'src/components/Widgets/Content/AdminContentTopicCreate/AdminContentTopicCreate.vue'
|
|
|
|
|
|
const BtnControlComp = shallowRef(BtnControl)
|
|
|
const ContentMediasComp = shallowRef(ContentMedias)
|
|
|
@@ -43,14 +68,18 @@ const ContentCategorySelectorComp = shallowRef(ContentCategorySelector)
|
|
|
export default {
|
|
|
name: 'AdminContentShow',
|
|
|
components: {
|
|
|
- EntityEdit
|
|
|
+ EntityEdit,
|
|
|
+ AdminContentTopicList,
|
|
|
+ AdminContentTopicCreate
|
|
|
},
|
|
|
mixins: [mixinWidget],
|
|
|
- data: () => {
|
|
|
+ data () {
|
|
|
return {
|
|
|
mounted: false,
|
|
|
entityLoading: true,
|
|
|
- api: null,
|
|
|
+ topicListKey: Date.now(),
|
|
|
+ api: APIGateway.content.APIAdresses.byId(this.$route.params.id),
|
|
|
+ tab: 'content',
|
|
|
entityIdKey: 'id',
|
|
|
entityParamKey: 'id',
|
|
|
showRouteName: 'Admin.Content.Show',
|
|
|
@@ -61,25 +90,19 @@ export default {
|
|
|
{ type: ContentCategorySelectorComp, name: 'category', responseKey: 'category_info', col: 'col-md-12 col-12' },
|
|
|
{ type: 'inputEditor', name: 'description', responseKey: 'description', label: 'توضیحات', col: 'col-md-12 col-12' },
|
|
|
{ type: ContentMediasComp, name: 'medias', responseKey: 'medias_info', col: 'col-md-12 col-12' },
|
|
|
- { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'ویرایش محتوا', placeholder: ' ', ignoreValue: true, atClick: () => {}, col: 'col-md-6' }
|
|
|
+ { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'ویرایش محتوا', placeholder: ' ', ignoreValue: true, atClick: this.edit, col: 'col-md-6' }
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- this.api = APIGateway.content.APIAdresses.byId(this.$route.params.id)
|
|
|
+ computed: {
|
|
|
+ contentId () {
|
|
|
+ return parseInt(this.$route.params.id)
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.setActionBtn()
|
|
|
this.mounted = true
|
|
|
},
|
|
|
methods: {
|
|
|
- setActionBtn () {
|
|
|
- this.inputs.forEach((item, index) => {
|
|
|
- if (item.name === 'btn') {
|
|
|
- this.inputs[index].atClick = this.edit
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
afterLoadInputData () {
|
|
|
this.entityLoading = false
|
|
|
},
|
|
|
@@ -94,6 +117,9 @@ export default {
|
|
|
this.$refs.entityEdit.getData()
|
|
|
this.entityLoading = false
|
|
|
})
|
|
|
+ },
|
|
|
+ onTopicCreated () {
|
|
|
+ this.topicListKey = Date.now()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -101,6 +127,12 @@ export default {
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.AdminContentShow {
|
|
|
+ .more-action {
|
|
|
+ display: flex;
|
|
|
+ flex-flow: row;
|
|
|
+ justify-content: flex-start;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
.title {
|
|
|
font-style: normal;
|
|
|
font-weight: 700;
|