Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import qs from 'query-string';
|
import qs from 'query-string';
|
||||||
import { DataGrid, Pagination } from '@/types/global';
|
import { DataGrid, Pagination } from '@/types/global';
|
||||||
|
import { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${table.comment}创建请求
|
* ${table.comment}创建请求
|
||||||
@@ -48,7 +49,7 @@ export interface ${vue.featureEntity}QueryRequest extends Pagination {
|
|||||||
/**
|
/**
|
||||||
* ${table.comment}查询响应
|
* ${table.comment}查询响应
|
||||||
*/
|
*/
|
||||||
export interface ${vue.featureEntity}QueryResponse {
|
export interface ${vue.featureEntity}QueryResponse extends TableData {
|
||||||
#foreach($field in ${table.fields})
|
#foreach($field in ${table.fields})
|
||||||
#if("$field.propertyType" == "String")
|
#if("$field.propertyType" == "String")
|
||||||
${field.propertyName}?: string;
|
${field.propertyName}?: string;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
v-model:selectedKeys="selectedKeys"
|
v-model:selectedKeys="selectedKeys"
|
||||||
:row-selection="rowSelection"
|
:row-selection="rowSelection"
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
:pagination="pagination"
|
:pagination="pagination as PaginationProps"
|
||||||
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
||||||
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
||||||
:bordered="false">
|
:bordered="false">
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { batchDelete${vue.featureEntity}, delete${vue.featureEntity}, get${vue.featureEntity}Page, ${vue.featureEntity}QueryRequest, ${vue.featureEntity}QueryResponse } from '@/api/${vue.module}/${vue.feature}';
|
import { batchDelete${vue.featureEntity}, delete${vue.featureEntity}, get${vue.featureEntity}Page, ${vue.featureEntity}QueryRequest, ${vue.featureEntity}QueryResponse } from '@/api/${vue.module}/${vue.feature}';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message, PaginationProps } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
import { defaultPagination, defaultRowSelection } from '@/types/table';
|
import { defaultPagination, defaultRowSelection } from '@/types/table';
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
import {} from '../types/const';
|
import {} from '../types/const';
|
||||||
import { toOptions } from '@/utils/enum';
|
import { toOptions } from '@/utils/enum';
|
||||||
|
|
||||||
const tableRenderData = ref<${vue.featureEntity}QueryResponse[]>();
|
const tableRenderData = ref<${vue.featureEntity}QueryResponse[]>([]);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate']);
|
const emits = defineEmits(['openAdd', 'openUpdate']);
|
||||||
|
|
||||||
|
|||||||
3764
orion-ops-ui/pnpm-lock.yaml
generated
3764
orion-ops-ui/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { DataGrid, Pagination } from '@/types/global';
|
import { DataGrid, Pagination } from '@/types/global';
|
||||||
|
import { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机身份创建请求
|
* 主机身份创建请求
|
||||||
@@ -33,7 +34,7 @@ export interface HostIdentityQueryRequest extends Pagination {
|
|||||||
/**
|
/**
|
||||||
* 主机身份查询响应
|
* 主机身份查询响应
|
||||||
*/
|
*/
|
||||||
export interface HostIdentityQueryResponse {
|
export interface HostIdentityQueryResponse extends TableData {
|
||||||
id?: number;
|
id?: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { DataGrid, Pagination } from '@/types/global';
|
import { DataGrid, Pagination } from '@/types/global';
|
||||||
|
import { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机秘钥创建请求
|
* 主机秘钥创建请求
|
||||||
@@ -32,7 +33,7 @@ export interface HostKeyQueryRequest extends Pagination {
|
|||||||
/**
|
/**
|
||||||
* 主机秘钥查询响应
|
* 主机秘钥查询响应
|
||||||
*/
|
*/
|
||||||
export interface HostKeyQueryResponse {
|
export interface HostKeyQueryResponse extends TableData {
|
||||||
id?: number;
|
id?: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
publicKey?: string;
|
publicKey?: string;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { DataGrid, Pagination } from '@/types/global';
|
import { DataGrid, Pagination } from '@/types/global';
|
||||||
|
import { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机创建请求
|
* 主机创建请求
|
||||||
@@ -35,7 +36,7 @@ export interface HostQueryRequest extends Pagination {
|
|||||||
/**
|
/**
|
||||||
* 主机查询响应
|
* 主机查询响应
|
||||||
*/
|
*/
|
||||||
export interface HostQueryResponse {
|
export interface HostQueryResponse extends TableData {
|
||||||
id?: number;
|
id?: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单创建请求
|
* 菜单创建请求
|
||||||
@@ -35,7 +36,7 @@ export interface MenuQueryRequest {
|
|||||||
/**
|
/**
|
||||||
* 菜单查询响应
|
* 菜单查询响应
|
||||||
*/
|
*/
|
||||||
export interface MenuQueryResponse {
|
export interface MenuQueryResponse extends TableData {
|
||||||
id?: number;
|
id?: number;
|
||||||
parentId?: number;
|
parentId?: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { UserState } from '@/store/modules/user/types';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登陆请求
|
* 登陆请求
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { DataGrid, Pagination } from '@/types/global';
|
import { DataGrid, Pagination } from '@/types/global';
|
||||||
|
import { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色创建请求
|
* 角色创建请求
|
||||||
@@ -38,7 +39,7 @@ export interface RoleQueryRequest extends Pagination {
|
|||||||
/**
|
/**
|
||||||
* 角色查询响应
|
* 角色查询响应
|
||||||
*/
|
*/
|
||||||
export interface RoleQueryResponse {
|
export interface RoleQueryResponse extends TableData {
|
||||||
id?: number;
|
id?: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { DataGrid, Pagination } from '@/types/global';
|
import { DataGrid, Pagination } from '@/types/global';
|
||||||
|
import { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户创建请求
|
* 用户创建请求
|
||||||
@@ -42,7 +43,7 @@ export interface UserQueryRequest extends Pagination {
|
|||||||
/**
|
/**
|
||||||
* 用户查询响应
|
* 用户查询响应
|
||||||
*/
|
*/
|
||||||
export interface UserQueryResponse {
|
export interface UserQueryResponse extends TableData {
|
||||||
id?: number;
|
id?: number;
|
||||||
username?: string;
|
username?: string;
|
||||||
nickname?: string;
|
nickname?: string;
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
const value = computed({
|
const value = computed<number>({
|
||||||
get() {
|
get() {
|
||||||
return props.modelValue;
|
return props.modelValue as number;
|
||||||
},
|
},
|
||||||
set(e) {
|
set(e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
const value = computed({
|
const value = computed<number>({
|
||||||
get() {
|
get() {
|
||||||
return props.modelValue;
|
return props.modelValue as number;
|
||||||
},
|
},
|
||||||
set(e) {
|
set(e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
v-if="type === 'number'"
|
v-if="type === 'number'"
|
||||||
:style="{ width: '80px' }"
|
:style="{ width: '80px' }"
|
||||||
size="small"
|
size="small"
|
||||||
:default-value="defaultValue"
|
:default-value="defaultValue as number"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
/>
|
/>
|
||||||
<a-switch
|
<a-switch
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
async function readMessage(data: MessageListType) {
|
async function readMessage(data: MessageListType) {
|
||||||
const ids = data.map((item) => item.id);
|
const ids = data.map((item) => item.id);
|
||||||
await setMessageStatus({ ids });
|
await setMessageStatus({ ids });
|
||||||
fetchSourceData();
|
await fetchSourceData();
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderList = computed(() => {
|
const renderList = computed(() => {
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
};
|
};
|
||||||
const formatUnreadLength = (type: string) => {
|
const formatUnreadLength = (type: string) => {
|
||||||
const list = getUnreadList(type);
|
const list = getUnreadList(type);
|
||||||
return list.length ? `(${list.length})` : ``;
|
return list.length ? `(${list.length})` : '';
|
||||||
};
|
};
|
||||||
const handleItemClick = (items: MessageListType) => {
|
const handleItemClick = (items: MessageListType) => {
|
||||||
if (renderList.value.length) readMessage([...items]);
|
if (renderList.value.length) readMessage([...items]);
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
@select="actionSelect">
|
@select="actionSelect">
|
||||||
<span
|
<span
|
||||||
class="arco-tag arco-tag-size-medium arco-tag-checked"
|
class="arco-tag arco-tag-size-medium arco-tag-checked"
|
||||||
:class="{ 'link-activated': itemData.fullPath === $route.fullPath }"
|
:class="{ 'link-activated': itemData?.fullPath === $route.fullPath }"
|
||||||
@click="goto(itemData)">
|
@click="goto(itemData as TagProps)">
|
||||||
<span class="tag-link">
|
<span class="tag-link">
|
||||||
{{ itemData.title }}
|
{{ itemData.title }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="arco-icon-hover arco-tag-icon-hover arco-icon-hover-size-medium arco-tag-close-btn"
|
class="arco-icon-hover arco-tag-icon-hover arco-icon-hover-size-medium arco-tag-close-btn"
|
||||||
@click.stop="tagClose(itemData, index)">
|
@click.stop="tagClose(itemData as TagProps, index)">
|
||||||
<icon-close />
|
<icon-close />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<a-select v-model:model-value="value"
|
<a-select v-model:model-value="value"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:options="optionData"
|
:options="optionData"
|
||||||
:limit=limit
|
:limit="limit as number"
|
||||||
@exceed-limit="onLimited"
|
@exceed-limit="onLimited"
|
||||||
multiple
|
multiple
|
||||||
:allow-create="allowCreate"
|
:allow-create="allowCreate"
|
||||||
@@ -17,13 +17,13 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, PropType } from 'vue';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
import { Message, SelectOptionData } from '@arco-design/web-vue';
|
import { Message, SelectOptionData } from '@arco-design/web-vue';
|
||||||
import { createTag, TagCreateRequest, TagType } from '@/api/meta/tag';
|
import { createTag, TagCreateRequest } from '@/api/meta/tag';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: Array,
|
modelValue: Array as PropType<Array<number>>,
|
||||||
placeholder: String,
|
placeholder: String,
|
||||||
limit: Number,
|
limit: Number,
|
||||||
type: String,
|
type: String,
|
||||||
@@ -32,9 +32,9 @@
|
|||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
const value = computed({
|
const value = computed<Array<number>>({
|
||||||
get() {
|
get() {
|
||||||
return props.modelValue;
|
return props.modelValue as Array<number>;
|
||||||
},
|
},
|
||||||
async set(e) {
|
async set(e) {
|
||||||
await checkCreateTag(e as Array<any>);
|
await checkCreateTag(e as Array<any>);
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
|
|
||||||
// 超出限制
|
// 超出限制
|
||||||
const onLimited = () => {
|
const onLimited = () => {
|
||||||
Message.warning(`最多选择${props.limit}个tag`);
|
Message.warning(`最多选择${ props.limit }个tag`);
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ import { Message } from '@arco-design/web-vue';
|
|||||||
|
|
||||||
export default function useCopy() {
|
export default function useCopy() {
|
||||||
const { isSupported, copy: c, text, copied } = useClipboard();
|
const { isSupported, copy: c, text, copied } = useClipboard();
|
||||||
const copy = (value: string, tips = `${value} 已复制`) => {
|
const copy = async (value: string, tips = `${ value } 已复制`) => {
|
||||||
return c(value)
|
try {
|
||||||
.then(() => {
|
await c(value);
|
||||||
if (tips) {
|
if (tips) {
|
||||||
Message.success(tips);
|
Message.success(tips);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
} catch {
|
||||||
Message.error('复制失败');
|
Message.error('复制失败');
|
||||||
});
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
isSupported,
|
isSupported,
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<HostIdentityUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<HostIdentityUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
:pagination="pagination"
|
:pagination="pagination as PaginationProps"
|
||||||
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
||||||
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
||||||
:bordered="false">
|
:bordered="false">
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { deleteHostIdentity, getHostIdentityPage, HostIdentityQueryRequest, HostIdentityQueryResponse } from '@/api/asset/host-identity';
|
import { deleteHostIdentity, getHostIdentityPage, HostIdentityQueryRequest, HostIdentityQueryResponse } from '@/api/asset/host-identity';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message, PaginationProps } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
import { defaultPagination } from '@/types/table';
|
import { defaultPagination } from '@/types/table';
|
||||||
@@ -133,9 +133,9 @@
|
|||||||
const { copy } = useCopy();
|
const { copy } = useCopy();
|
||||||
const { hasAnyPermission } = usePermission();
|
const { hasAnyPermission } = usePermission();
|
||||||
|
|
||||||
const tableRenderData = ref<HostIdentityQueryResponse[]>();
|
const tableRenderData = ref<HostIdentityQueryResponse[]>([]);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate', 'openViewKey']);
|
const emits = defineEmits(['openAdd', 'openUpdate', 'openKeyView']);
|
||||||
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
const pagination = reactive(defaultPagination());
|
const pagination = reactive(defaultPagination());
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<HostKeyUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<HostKeyUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
@@ -173,12 +173,14 @@
|
|||||||
|
|
||||||
// 选择公钥文件
|
// 选择公钥文件
|
||||||
const selectPublicFile = async (fileList: FileItem[]) => {
|
const selectPublicFile = async (fileList: FileItem[]) => {
|
||||||
|
// FIXME
|
||||||
formModel.publicKey = await readFileText(fileList[0].file as File);
|
formModel.publicKey = await readFileText(fileList[0].file as File);
|
||||||
formRef.value.clearValidate('publicKey');
|
formRef.value.clearValidate('publicKey');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择私钥文件
|
// 选择私钥文件
|
||||||
const selectPrivateFile = async (fileList: FileItem[]) => {
|
const selectPrivateFile = async (fileList: FileItem[]) => {
|
||||||
|
// FIXME
|
||||||
formModel.privateKey = await readFileText(fileList[0].file as File);
|
formModel.privateKey = await readFileText(fileList[0].file as File);
|
||||||
formRef.value.clearValidate('privateKey');
|
formRef.value.clearValidate('privateKey');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -45,14 +45,10 @@
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
:pagination="pagination"
|
:pagination="pagination as PaginationProps"
|
||||||
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
||||||
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
||||||
:bordered="false">
|
:bordered="false">
|
||||||
<!-- 名称 -->
|
|
||||||
<template #name="{ record }">
|
|
||||||
<span class="span-blue">{{ record.name }}</span>
|
|
||||||
</template>
|
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
<template #handle="{ record }">
|
<template #handle="{ record }">
|
||||||
<div class="table-handle-wrapper">
|
<div class="table-handle-wrapper">
|
||||||
@@ -97,12 +93,12 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { deleteHostKey, getHostKeyPage, HostKeyQueryRequest, HostKeyQueryResponse } from '@/api/asset/host-key';
|
import { deleteHostKey, getHostKeyPage, HostKeyQueryRequest, HostKeyQueryResponse } from '@/api/asset/host-key';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message, PaginationProps } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
import { defaultPagination } from '@/types/table';
|
import { defaultPagination } from '@/types/table';
|
||||||
|
|
||||||
const tableRenderData = ref<HostKeyQueryResponse[]>();
|
const tableRenderData = ref<HostKeyQueryResponse[]>([]);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate', 'openView']);
|
const emits = defineEmits(['openAdd', 'openUpdate', 'openView']);
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,9 @@
|
|||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
|
|
||||||
const record = ref();
|
const record = ref();
|
||||||
const config = ref<Record<string, any>>({});
|
const config = ref<Record<string, any>>({
|
||||||
|
SSH: undefined
|
||||||
|
});
|
||||||
|
|
||||||
// 打开
|
// 打开
|
||||||
const open = async (e: any) => {
|
const open = async (e: any) => {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
label="用户名"
|
label="用户名"
|
||||||
:rules="usernameRules"
|
:rules="usernameRules"
|
||||||
label-col-flex="60px"
|
label-col-flex="60px"
|
||||||
:help="AuthTypeEnum.IDENTITY.value === formModel.authType ? '将使用主机身份的用户名' : null">
|
:help="AuthTypeEnum.IDENTITY.value === formModel.authType ? '将使用主机身份的用户名' : undefined">
|
||||||
<a-input v-model="formModel.username"
|
<a-input v-model="formModel.username"
|
||||||
:disabled="AuthTypeEnum.IDENTITY.value === formModel.authType"
|
:disabled="AuthTypeEnum.IDENTITY.value === formModel.authType"
|
||||||
placeholder="请输入用户名" />
|
placeholder="请输入用户名" />
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
label="主机密码"
|
label="主机密码"
|
||||||
:rules="passwordRules"
|
:rules="passwordRules"
|
||||||
label-col-flex="60px">
|
label-col-flex="60px">
|
||||||
|
<!-- FIXME -->
|
||||||
<a-input-password v-model="formModel.password"
|
<a-input-password v-model="formModel.password"
|
||||||
:disabled="!formModel.useNewPassword && formModel.hasPassword"
|
:disabled="!formModel.useNewPassword && formModel.hasPassword"
|
||||||
placeholder="主机密码" />
|
placeholder="主机密码" />
|
||||||
@@ -157,7 +158,7 @@
|
|||||||
version: undefined,
|
version: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<HostSshConfig & Record<string, any>>({
|
const formModel = reactive<HostSshConfig & Record<string, any>>({
|
||||||
username: undefined,
|
username: undefined,
|
||||||
port: undefined,
|
port: undefined,
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<HostUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<HostUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
:pagination="pagination"
|
:pagination="pagination as PaginationProps"
|
||||||
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
||||||
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
||||||
:bordered="false">
|
:bordered="false">
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { deleteHost, getHostPage, HostQueryRequest, HostQueryResponse } from '@/api/asset/host';
|
import { deleteHost, getHostPage, HostQueryRequest, HostQueryResponse } from '@/api/asset/host';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message, PaginationProps } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
import { tagColor } from '../types/const';
|
import { tagColor } from '../types/const';
|
||||||
@@ -170,11 +170,11 @@
|
|||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
|
|
||||||
const tagSelector = ref();
|
const tagSelector = ref();
|
||||||
const tableRenderData = ref<HostQueryResponse[]>();
|
const tableRenderData = ref<HostQueryResponse[]>([]);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate', 'openUpdateConfig']);
|
const emits = defineEmits(['openAdd', 'openUpdate', 'openUpdateConfig']);
|
||||||
|
|
||||||
const pagination = reactive(defaultPagination());
|
const pagination = reactive<PaginationProps>(defaultPagination());
|
||||||
const { copy } = useCopy();
|
const { copy } = useCopy();
|
||||||
const { toggle: toggleFavorite } = useFavorite('HOST');
|
const { toggle: toggleFavorite } = useFavorite('HOST');
|
||||||
|
|
||||||
|
|||||||
@@ -30,4 +30,6 @@ export interface HostSshConfig {
|
|||||||
charset?: string;
|
charset?: string;
|
||||||
fileNameCharset?: string;
|
fileNameCharset?: string;
|
||||||
fileContentCharset?: string;
|
fileContentCharset?: string;
|
||||||
|
useNewPassword?: boolean;
|
||||||
|
hasPassword?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const userInfo = computed(() => {
|
const userInfo = computed(() => {
|
||||||
return {
|
return {
|
||||||
name: userStore.name,
|
name: userStore.nickname,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<a-form-item v-if="formModel.type !== MenuTypeEnum.FUNCTION.value"
|
<a-form-item v-if="formModel.type !== MenuTypeEnum.FUNCTION.value"
|
||||||
field="icon"
|
field="icon"
|
||||||
label="菜单图标">
|
label="菜单图标">
|
||||||
<icon-picker v-model:icon="formModel.icon">
|
<icon-picker v-model:icon="formModel.icon as string">
|
||||||
<template #iconSelect>
|
<template #iconSelect>
|
||||||
<a-input v-model="formModel.icon" placeholder="请选择菜单图标" />
|
<a-input v-model="formModel.icon" placeholder="请选择菜单图标" />
|
||||||
</template>
|
</template>
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<MenuUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<MenuUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -181,13 +181,13 @@
|
|||||||
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<MenuQueryRequest>({
|
const formModel = reactive<MenuQueryRequest>({
|
||||||
name: undefined,
|
name: undefined,
|
||||||
status: undefined
|
status: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
const tableRef = ref<any>();
|
const tableRef = ref();
|
||||||
const expandStatus = ref<boolean>(false);
|
const expandStatus = ref<boolean>(false);
|
||||||
|
|
||||||
const tableRenderData = ref<MenuQueryResponse[]>([]);
|
const tableRenderData = ref<MenuQueryResponse[]>([]);
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
import { onUnmounted, ref } from 'vue';
|
import { onUnmounted, ref } from 'vue';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
|
|
||||||
const table = ref<any>();
|
const table = ref();
|
||||||
const modal = ref<any>();
|
const modal = ref();
|
||||||
|
|
||||||
// 卸载时清除 menu cache
|
// 卸载时清除 menu cache
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<RoleUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<RoleUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
const { visible, setVisible } = useVisible();
|
const { visible, setVisible } = useVisible();
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
|
|
||||||
const tree = ref<any>();
|
const tree = ref();
|
||||||
const roleRecord = reactive<Record<string, any>>({
|
const roleRecord = reactive<Record<string, any>>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
@@ -88,7 +88,9 @@
|
|||||||
// 渲染对象
|
// 渲染对象
|
||||||
const renderRecord = (record: any) => {
|
const renderRecord = (record: any) => {
|
||||||
Object.keys(roleRecord).forEach(k => {
|
Object.keys(roleRecord).forEach(k => {
|
||||||
|
if (record.hasOwnProperty(k)) {
|
||||||
roleRecord[k] = record[k];
|
roleRecord[k] = record[k];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -52,20 +52,18 @@
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
:pagination="pagination"
|
:pagination="pagination as PaginationProps"
|
||||||
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
||||||
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
||||||
:bordered="false">
|
:bordered="false">
|
||||||
<!-- 名称 -->
|
|
||||||
<template #name="{ record }">
|
|
||||||
<span class="span-blue">{{ record.name }}</span>
|
|
||||||
</template>
|
|
||||||
<!-- 编码 -->
|
<!-- 编码 -->
|
||||||
<template #code="{ record }">
|
<template #code="{ record }">
|
||||||
<a-tag>{{ record.code }}</a-tag>
|
<a-tag>{{ record.code }}</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- 状态 -->
|
<!-- 状态 -->
|
||||||
<template #status="{ record }">
|
<template #status="{ record }">
|
||||||
|
<!-- FIXME -->
|
||||||
|
<span class="circle"></span>
|
||||||
<a-tag :color="getEnumValue(record.status, RoleStatusEnum,'color')">
|
<a-tag :color="getEnumValue(record.status, RoleStatusEnum,'color')">
|
||||||
{{ getEnumValue(record.status, RoleStatusEnum) }}
|
{{ getEnumValue(record.status, RoleStatusEnum) }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
@@ -129,14 +127,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { deleteRole, getRolePage, updateRoleStatus, RoleQueryRequest, RoleQueryResponse } from '@/api/user/role';
|
import { deleteRole, getRolePage, updateRoleStatus, RoleQueryRequest, RoleQueryResponse } from '@/api/user/role';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message, PaginationProps } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
import { RoleStatusEnum } from '../types/enum.types';
|
import { RoleStatusEnum } from '../types/enum.types';
|
||||||
import { toOptions, getEnumValue, toggleEnumValue, toggleEnum } from '@/utils/enum';
|
import { toOptions, getEnumValue, toggleEnumValue, toggleEnum } from '@/utils/enum';
|
||||||
import { defaultPagination } from '@/types/table';
|
import { defaultPagination } from '@/types/table';
|
||||||
|
|
||||||
const tableRenderData = ref<RoleQueryResponse[]>();
|
const tableRenderData = ref<RoleQueryResponse[]>([]);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate', 'openGrant']);
|
const emits = defineEmits(['openAdd', 'openUpdate', 'openGrant']);
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<UserUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<UserUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<Record<string, any>>(defaultForm());
|
const formModel = reactive<Record<string, any>>(defaultForm());
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<Record<string, any>>(defaultForm());
|
const formModel = reactive<Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
// 打开
|
// 打开
|
||||||
|
|||||||
@@ -66,16 +66,13 @@
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
:pagination="pagination"
|
:pagination="pagination as PaginationProps"
|
||||||
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
||||||
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
@page-size-change="(size) => fetchTableData(pagination.current, size)"
|
||||||
:bordered="false">
|
:bordered="false">
|
||||||
<!-- 用户名 -->
|
|
||||||
<template #username="{ record }">
|
|
||||||
<span class="span-blue">{{ record.username }}</span>
|
|
||||||
</template>
|
|
||||||
<!-- 状态 -->
|
<!-- 状态 -->
|
||||||
<template #status="{ record }">
|
<template #status="{ record }">
|
||||||
|
<!-- FIXME -->
|
||||||
<a-tag :color="getEnumValue(record.status, UserStatusEnum,'color')">
|
<a-tag :color="getEnumValue(record.status, UserStatusEnum,'color')">
|
||||||
{{ getEnumValue(record.status, UserStatusEnum) }}
|
{{ getEnumValue(record.status, UserStatusEnum) }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
@@ -150,7 +147,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { deleteUser, getUserPage, updateUserStatus, UserQueryRequest, UserQueryResponse } from '@/api/user/user';
|
import { deleteUser, getUserPage, updateUserStatus, UserQueryRequest, UserQueryResponse } from '@/api/user/user';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message, PaginationProps } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
import { UserStatusEnum } from '../types/enum.types';
|
import { UserStatusEnum } from '../types/enum.types';
|
||||||
@@ -158,7 +155,7 @@
|
|||||||
import { toOptions, getEnumValue } from '@/utils/enum';
|
import { toOptions, getEnumValue } from '@/utils/enum';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
|
|
||||||
const tableRenderData = ref<UserQueryResponse[]>();
|
const tableRenderData = ref<UserQueryResponse[]>([]);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate', 'openResetPassword', 'openGrantRole']);
|
const emits = defineEmits(['openAdd', 'openUpdate', 'openResetPassword', 'openGrantRole']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user