fix: 运维管理 证书管理修复部分bug,远程升级修复部分bug

This commit is contained in:
jackhoo_98 2023-03-17 09:54:52 +08:00
parent b11d8eaa0d
commit f85bb9fc82
7 changed files with 43 additions and 45 deletions

View File

@ -225,9 +225,9 @@ const changeValue = (index: number, type: string) => {
}
};
const changeCheckbox = (index: number, type: string) => {
const changeCheckbox = async (index: number, type: string) => {
// console.log(1, getTargetData(index, type).check,getTargetData(index, type));
//使setTimeout
//Dom setTimeout await nextTick()
setTimeout(() => {
// console.log(2, getTargetData(index, type).check,getTargetData(index, type));
let startIndex = 0;
@ -235,8 +235,8 @@ const changeCheckbox = (index: number, type: string) => {
const currentCheck = getTargetData(index, type).check;
if (!currentCheck) return;
for (let i = index; i >= 0; i--) {
const preDatCheck = getTargetData(i, type).check;
if (!preDatCheck) {
const preDataCheck = getTargetData(i, type).check;
if (!preDataCheck) {
startIndex = i;
break;
}

View File

@ -269,7 +269,7 @@ const validatorVersionOrder = async (_: Record<string, any>, value: string) => {
if (value && !!signMethod && productId) {
const res = await validateVersion(productId, value);
if (res.status === 200) {
Promise.reject(res.result ? '版本序号已存在' : '');
return Promise.reject(res.result ? '版本序号已存在' : '');
}
}
}

View File

@ -22,7 +22,7 @@
@cancel="handleCancel"
@ok="handleOk"
>
<Search
<pro-search
:columns="columns"
target="search"
@search="handleSearch"
@ -44,6 +44,7 @@
>
<template #headerTitle>
<j-checkbox
v-if="checkAllData.length !== 0"
v-model:checked="state.checkAll"
:indeterminate="state.indeterminate"
@change="onCheckAllChange"
@ -194,7 +195,11 @@ const onCheckAllChange = (e: any) => {
_selectedRowKeys.value = state.checkedList;
};
const onSelectChange = (record: T[], selected: boolean, selectedRows: T[]) => {
const onSelectChange = (
record: T[any],
selected: boolean,
selectedRows: T[any],
) => {
_selectedRowKeys.value = selected
? [...getSetRowKey(selectedRows)]
: _selectedRowKeys.value.filter((item: T) => item !== record?.id);

View File

@ -1,6 +1,6 @@
<template>
<page-container>
<Search :columns="columns" target="search" @search="handleSearch" />
<pro-search :columns="columns" target="search" @search="handleSearch" />
<j-pro-table
ref="tableRef"
model="TABLE"

View File

@ -1,39 +1,35 @@
<template>
<j-spin :spinning="loading">
<div>
<j-textarea
:rows="4"
@change="textChange"
v-model:value="keystoreBase64"
:placeholder="placeholder"
/>
<j-upload
accept=".pem"
listType="text"
:action="NETWORK_CERTIFICATE_UPLOAD"
:headers="{
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
}"
:showUploadList="false"
@change="handleChange"
<j-textarea
:rows="4"
@change="textChange"
v-model:value="keystoreBase64"
:placeholder="placeholder"
/>
<j-upload
accept=".pem"
listType="text"
:action="NETWORK_CERTIFICATE_UPLOAD"
:headers="{
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
}"
:showUploadList="false"
@change="handleChange"
>
<j-button style="margin-top: 10px">
<AIcon type="UploadOutlined" />
上传文件</j-button
>
<j-button style="margin-top: 10px">
<upload-outlined />
上传文件</j-button
>
</j-upload>
</div>
</j-upload>
</j-spin>
</template>
<script setup lang="ts" name="CertificateFile">
import { UploadOutlined } from '@ant-design/icons-vue';
import { message } from 'ant-design-vue';
import type { UploadChangeParam } from 'ant-design-vue';
import { LocalStore } from '@/utils/comm';
import { TOKEN_KEY } from '@/utils/variable';
import { NETWORK_CERTIFICATE_UPLOAD } from '@/api/link/certificate';
import type { UploadProps } from 'ant-design-vue';
const emit = defineEmits(['update:modelValue', 'change']);

View File

@ -25,7 +25,6 @@
</j-radio-button>
</j-radio-group>
</j-form-item>
<j-form-item
label="证书名称"
v-bind="validateInfos.name"
@ -154,9 +153,9 @@ const onSubmit = () => {
loading.value = true;
const response =
id === ':id'
? await save(params)
: await update({ ...params, id });
if (response.status === 200) {
? await save(params).catch(() => {})
: await update({ ...params, id }).catch(() => {});
if (response?.status === 200) {
message.success('操作成功');
router.push('/iot/link/certificate');
}
@ -180,9 +179,9 @@ const handleChange = (info: UploadChangeParam) => {
const detail = async (id: string) => {
if (id !== ':id') {
loading.value = true;
const res = await queryDetail(id);
const res: any = await queryDetail(id);
if (res.success) {
const result = res.result as FormDataType;
const result: any = res.result;
const type = result.type.value as TypeObjType;
formData.value = {
...result,
@ -207,12 +206,6 @@ detail(id);
height: 100%;
}
}
.form-upload-button {
margin-top: 10px;
}
.form-submit {
background-color: @primary-color !important;
}
}
.doc {

View File

@ -1,7 +1,11 @@
<template>
<page-container>
<div>
<Search :columns="columns" target="search" @search="handleSearch" />
<pro-search
:columns="columns"
target="search"
@search="handleSearch"
/>
<j-pro-table
ref="tableRef"
model="TABLE"