add publish function
This commit is contained in:
1 parent
bdf8f363e1
commit
672b5559a2
21 files changed
+268
-19
No files matched your search
@@ -68,15 +68,15 @@ export default defineComponent({
|
||||
.then(
|
||||
async ({
|
||||
data: {
|
||||
access_token,
|
||||
refresh_token,
|
||||
accessToken,
|
||||
refreshToken,
|
||||
user: { id }
|
||||
}
|
||||
}: {
|
||||
data: IWechatLoginStatusResponse;
|
||||
}) => {
|
||||
await this.$store.dispatch('setRefreshToken', refresh_token);
|
||||
await this.$store.dispatch('setAccessToken', access_token);
|
||||
await this.$store.dispatch('setRefreshToken', refreshToken);
|
||||
await this.$store.dispatch('setAccessToken', accessToken);
|
||||
this.getUserInfo(id);
|
||||
}
|
||||
)
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
<success-info v-model:show="succeed" :content="$t('content.message.saved')"></success-info>
|
||||
<div id="vditor" class="vditor" />
|
||||
</div>
|
||||
<el-button type="primary" size="medium" round class="btn btn-publish" @click="publishing = true">
|
||||
{{ $t('common.button.publish') }}
|
||||
</el-button>
|
||||
<el-dialog v-model="publishing">
|
||||
<publication :article-id="id" />
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -13,6 +19,7 @@
|
||||
<script lang="ts">
|
||||
import Vditor from '@/libs/vditor/index';
|
||||
import { Breadcrumb, Loading, SuccessInfo } from '@/components/common/index';
|
||||
import { Publication } from '@/components/content/index';
|
||||
import { defaultOptions } from '@/settings/editor';
|
||||
import '@/libs/vditor/assets/scss/index.scss';
|
||||
import { defineComponent } from 'vue';
|
||||
@@ -20,26 +27,29 @@ import ArticleService from '@/services/content/article/service';
|
||||
import { IArticle, IArticleDetailResponse } from '@/services/content/article/types';
|
||||
|
||||
interface IData {
|
||||
id: string | string[];
|
||||
id: string;
|
||||
vditor: null | Vditor;
|
||||
item: null | IArticle;
|
||||
loading: boolean;
|
||||
succeed: boolean;
|
||||
publishing: boolean;
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Breadcrumb,
|
||||
Loading,
|
||||
SuccessInfo
|
||||
SuccessInfo,
|
||||
Publication
|
||||
},
|
||||
data(): IData {
|
||||
return {
|
||||
id: this.$route.params.id,
|
||||
id: this.$route.params.id.toString(),
|
||||
vditor: null,
|
||||
item: null,
|
||||
loading: false,
|
||||
succeed: false
|
||||
succeed: false,
|
||||
publishing: false
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
@@ -157,4 +167,12 @@ export default defineComponent({
|
||||
background-color: #fff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
&.btn-publish {
|
||||
position: fixed;
|
||||
right: 100px;
|
||||
bottom: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -54,6 +54,7 @@ import { IArticle, IArticleListResponse, IArticleDetailResponse } from '@/servic
|
||||
import { defineComponent } from 'vue';
|
||||
import { RouteQueryAndHash } from 'vue-router';
|
||||
import { DEFAULT_LIMIT } from '@/settings/article';
|
||||
|
||||
interface IData {
|
||||
items: IArticle[];
|
||||
loading: boolean;
|
||||
|
||||
Reference in new issue
Block a user