|
@@ -0,0 +1,122 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="AdminHashtagShow"
|
|
|
|
|
+ :style="localOptions.style">
|
|
|
|
|
+ <div class="flex justify-end">
|
|
|
|
|
+ <q-btn flat
|
|
|
|
|
+ color="grey"
|
|
|
|
|
+ @click="$router.go(-1)">
|
|
|
|
|
+ بازگشت
|
|
|
|
|
+ >
|
|
|
|
|
+ </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" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import { shallowRef } from 'vue'
|
|
|
|
|
+import { EntityEdit } from 'quasar-crud'
|
|
|
|
|
+import { mixinWidget } from 'src/mixin/Mixins.js'
|
|
|
|
|
+import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
|
|
+import BtnControl from 'src/components/Control/btn.vue'
|
|
|
|
|
+
|
|
|
|
|
+const BtnControlComp = shallowRef(BtnControl)
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'AdminHashtagShow',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ EntityEdit
|
|
|
|
|
+ },
|
|
|
|
|
+ mixins: [mixinWidget],
|
|
|
|
|
+ data: () => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ mounted: false,
|
|
|
|
|
+ entityLoading: true,
|
|
|
|
|
+ api: null,
|
|
|
|
|
+ entityIdKey: 'id',
|
|
|
|
|
+ entityParamKey: 'id',
|
|
|
|
|
+ showRouteName: 'Admin.Hashtag.Show',
|
|
|
|
|
+ indexRouteName: 'Admin.Hashtag.List',
|
|
|
|
|
+ inputs: [
|
|
|
|
|
+ { type: 'input', name: 'title', responseKey: 'title', label: 'عنوان', placeholder: ' ', col: 'col-md-12 col-12' },
|
|
|
|
|
+ { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'بروزرسانی هشتگ', placeholder: ' ', atClick: () => {}, col: 'col-md-6' }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.api = APIGateway.hashtag.APIAdresses.byId(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
|
|
|
|
|
+ },
|
|
|
|
|
+ edit() {
|
|
|
|
|
+ this.entityLoading = true
|
|
|
|
|
+ this.$refs.entityEdit.editEntity(false)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.$refs.entityEdit.getData()
|
|
|
|
|
+ this.entityLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.$refs.entityEdit.getData()
|
|
|
|
|
+ this.entityLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+.AdminHashtagShow {
|
|
|
|
|
+ .title {
|
|
|
|
|
+ font-style: normal;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ font-size: 24px;
|
|
|
|
|
+ line-height: 140%;
|
|
|
|
|
+ color: #424242;
|
|
|
|
|
+ margin-bottom: 27px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-flow: row;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ .static-title {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ .dynamic-title {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ .back-action {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ :deep(.form) {
|
|
|
|
|
+ padding: 24px;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|