update order style
This commit is contained in:
1 parent
a42b794706
commit
9f0f5b769b
11 files changed
+92
-9
No files matched your search
@@ -52,3 +52,8 @@ body {
|
||||
.color-primary {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
}
|
||||
@@ -114,7 +114,6 @@ import { ElPopover, ElInput, ElSelect, ElButton, ElTooltip, ElOption, ElMessage
|
||||
import { ERROR_CODE_DUPLICATION, ERROR_CODE_UNVERIFIED } from '@/constants/errorCode';
|
||||
import { getVerificationUrl } from '@/utils';
|
||||
import ApplicationConfirm from '@/components/application/Confirm.vue';
|
||||
import { ROUTE_AUTH_LOGIN } from '@/router/constants';
|
||||
|
||||
interface IData {
|
||||
value: {
|
||||
@@ -127,12 +126,10 @@ interface IData {
|
||||
export default defineComponent({
|
||||
name: 'ApiForm',
|
||||
components: {
|
||||
FontAwesomeIcon,
|
||||
ElPopover,
|
||||
ElInput,
|
||||
ElSelect,
|
||||
ElButton,
|
||||
ElTooltip,
|
||||
ElOption,
|
||||
ApplicationConfirm
|
||||
},
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<el-tooltip effect="dark" :content="$t('application.message.rotateCredential')" placement="top-start">
|
||||
<el-popconfirm
|
||||
:title="$t('application.message.rotateCredentialConfirm')"
|
||||
:confirm-button-text="$t('common.button.confirm')"
|
||||
:cancel-button-text="$t('common.button.cancel')"
|
||||
:width="290"
|
||||
@confirm="onConfirm"
|
||||
>
|
||||
<template #reference>
|
||||
<font-awesome-icon icon="fa-solid fa-arrows-rotate" class="icon-rotate" />
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import { ElTooltip, ElPopconfirm } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RotateCredential',
|
||||
components: {
|
||||
FontAwesomeIcon,
|
||||
ElTooltip,
|
||||
ElPopconfirm
|
||||
},
|
||||
emits: ['rotate'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
onConfirm() {
|
||||
this.$emit('rotate');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.icon-rotate {
|
||||
cursor: pointer;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -46,5 +46,6 @@ export default defineComponent({
|
||||
.icon-check,
|
||||
.icon-copy {
|
||||
margin-left: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :model-value="visible" :title="$t('application.title.buyService')" width="60%" center>
|
||||
<el-dialog :model-value="visible" :title="$t('application.title.buyService')" width="500px" center>
|
||||
<el-form label-width="120px">
|
||||
<el-form-item v-if="application?.api?.title" :label="$t('application.field.service')">
|
||||
{{ application?.api?.title }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :model-value="visible" :title="$t('application.title.buyService')" width="60%" center>
|
||||
<el-dialog :model-value="visible" :title="$t('application.title.buyService')" width="500px" center>
|
||||
<el-row class="paycodes">
|
||||
<el-col :span="12">
|
||||
<div class="paycode wechat">
|
||||
|
||||
@@ -10,5 +10,10 @@ export default {
|
||||
readPolicy: '我已阅读并同意',
|
||||
policy: '《数据技术服务使用协议》',
|
||||
notAgreePolicy: '您尚未同意《数据技术服务使用协议》',
|
||||
confirmApplying: '申请服务确认'
|
||||
confirmApplying: '申请服务确认',
|
||||
rotateCredential: '重置密钥',
|
||||
rotateCredentialConfirm: '你确定要重置密钥吗?重置后不可恢复',
|
||||
idDoesNotExist: '申请不存在',
|
||||
rotateCredentialSuccessfully: '密钥重置成功',
|
||||
rotateCredentialFailed: '密钥重置失败,请联系处理'
|
||||
};
|
||||
@@ -35,6 +35,10 @@ class ApplicationOperator {
|
||||
async delete(id: string): Promise<AxiosResponse<null>> {
|
||||
return await httpClient.delete(`/${this.key}/${id}`);
|
||||
}
|
||||
|
||||
async rotateCredential(id: string): Promise<AxiosResponse<IApplicationDetailResponse>> {
|
||||
return await httpClient.post(`/${this.key}/${id}/rotate-credential/`);
|
||||
}
|
||||
}
|
||||
|
||||
export const applicationOperator = new ApplicationOperator();
|
||||
@@ -55,6 +55,9 @@
|
||||
<span class="copy">
|
||||
<copy-to-clipboard :content="scope?.row?.credential?.token" />
|
||||
</span>
|
||||
<span class="rotate">
|
||||
<rotate-credential @rotate="onRotateCredential(scope.row)" />
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="scope?.row?.credential?.type === credentialType.IDENTITY">
|
||||
<span class="key"
|
||||
@@ -68,7 +71,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<el-table-column min-width="300px">
|
||||
<template #default="scope">
|
||||
<div class="float-right">
|
||||
<el-button v-if="scope.row?.api?.document_id" @click="onGoDocument(scope?.row)">
|
||||
@@ -101,6 +104,7 @@ import { defineComponent } from 'vue';
|
||||
import {
|
||||
applicationOperator,
|
||||
IApplication,
|
||||
IApplicationDetailResponse,
|
||||
IApplicationListResponse,
|
||||
IApplicationType,
|
||||
ICredentialType,
|
||||
@@ -108,8 +112,9 @@ import {
|
||||
} from '@/operators';
|
||||
import Pagination from '@/components/common/Pagination.vue';
|
||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||
import RotateCredential from '@/components/application/RotateCredential.vue';
|
||||
import CreateOrder from '@/components/order/Create.vue';
|
||||
import { ElTable, ElRow, ElCol, ElTableColumn, ElButton, ElCard, ElMenu, ElMenuItem } from 'element-plus';
|
||||
import { ElTable, ElRow, ElCol, ElTableColumn, ElButton, ElCard, ElMenu, ElMenuItem, ElMessage } from 'element-plus';
|
||||
import { ROUTE_DOCUMENT_DETAIL } from '@/router/constants';
|
||||
|
||||
interface IData {
|
||||
@@ -134,6 +139,7 @@ export default defineComponent({
|
||||
components: {
|
||||
Pagination,
|
||||
CopyToClipboard,
|
||||
RotateCredential,
|
||||
CreateOrder,
|
||||
ElTable,
|
||||
ElRow,
|
||||
@@ -202,6 +208,23 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
},
|
||||
onRotateCredential(application: IApplication) {
|
||||
const id = application.id;
|
||||
if (!id) {
|
||||
ElMessage.error(this.$t('application.message.idDoesNotExist'));
|
||||
return;
|
||||
}
|
||||
applicationOperator
|
||||
.rotateCredential(id)
|
||||
.then(({ data: data }: { data: IApplicationDetailResponse }) => {
|
||||
console.log('rotate successfully');
|
||||
ElMessage.success(this.$t('application.message.rotateCredentialSuccessfully'));
|
||||
application.credential = data.credential;
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage.error(this.$t('application.message.rotateCredentialFailed'));
|
||||
});
|
||||
},
|
||||
onGoDocument(application: IApplication) {
|
||||
const documentId = application?.api?.document_id;
|
||||
this.$router.push({
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<el-table-column min-width="300px">
|
||||
<template #default="scope">
|
||||
<div class="float-right">
|
||||
<el-button
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
faCheck as faSolidCheck,
|
||||
faCube as faSolidCube,
|
||||
faStore as faSolidStore,
|
||||
faArrowsRotate as faSolidArrowsRotate,
|
||||
faUpRightFromSquare as faSolidUpRightFromSquare
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
@@ -20,3 +21,4 @@ library.add(faRegularIdCard);
|
||||
library.add(faSolidCube);
|
||||
library.add(faSolidStore);
|
||||
library.add(faSolidUpRightFromSquare);
|
||||
library.add(faSolidArrowsRotate);
|
||||
Reference in new issue
Block a user