review code.
This commit is contained in:
@@ -8,7 +8,6 @@ import qs from 'query-string';
|
|||||||
*/
|
*/
|
||||||
export interface DictValueCreateRequest {
|
export interface DictValueCreateRequest {
|
||||||
keyId?: number;
|
keyId?: number;
|
||||||
keyName?: string;
|
|
||||||
name?: string;
|
name?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
label?: string;
|
label?: string;
|
||||||
@@ -53,6 +52,7 @@ export interface DictValueQueryResponse extends TableData {
|
|||||||
id?: number;
|
id?: number;
|
||||||
keyId?: number;
|
keyId?: number;
|
||||||
keyName?: string;
|
keyName?: string;
|
||||||
|
keyDescription?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
label?: string;
|
label?: string;
|
||||||
|
|||||||
@@ -120,6 +120,28 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.click-icon-wrapper {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--color-text-2);
|
||||||
|
background: var(--color-fill-2);
|
||||||
|
border-radius: 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
transition: background-color 0.1s cubic-bezier(0, 0, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.click-icon-wrapper:hover {
|
||||||
|
background: var(--color-fill-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-left {
|
||||||
|
color: rgb(var(--arcoblue-6));
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.span-blue {
|
.span-blue {
|
||||||
color: rgb(var(--arcoblue-6));
|
color: rgb(var(--arcoblue-6));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-wrapper {
|
.table-wrapper {
|
||||||
@@ -110,22 +109,6 @@
|
|||||||
padding: 18px 24px 14px 24px;
|
padding: 18px 24px 14px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.click-icon-wrapper {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
color: var(--color-text-2);
|
|
||||||
background: var(--color-fill-2);
|
|
||||||
border-radius: 2px;
|
|
||||||
cursor: pointer;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
transition: background-color 0.1s cubic-bezier(0, 0, 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.click-icon-wrapper:hover {
|
|
||||||
background: var(--color-fill-3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.arco-table-td-content {
|
.arco-table-td-content {
|
||||||
color: rgba(var(--gray-9), .95);
|
color: rgba(var(--gray-9), .95);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|||||||
@@ -20,5 +20,3 @@ export default function useCopy() {
|
|||||||
copied
|
copied
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import useUserStore from './modules/user';
|
|||||||
import useTabBarStore from './modules/tab-bar';
|
import useTabBarStore from './modules/tab-bar';
|
||||||
import useCacheStore from './modules/cache';
|
import useCacheStore from './modules/cache';
|
||||||
import useTipsStore from './modules/tips';
|
import useTipsStore from './modules/tips';
|
||||||
|
// import useDictStore from './modules/dict';
|
||||||
|
|
||||||
const pinia = createPinia();
|
const pinia = createPinia();
|
||||||
|
|
||||||
@@ -15,6 +16,7 @@ export {
|
|||||||
useTabBarStore,
|
useTabBarStore,
|
||||||
useCacheStore,
|
useCacheStore,
|
||||||
useTipsStore,
|
useTipsStore,
|
||||||
|
// useDictStore,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default pinia;
|
export default pinia;
|
||||||
|
|||||||
0
orion-ops-ui/src/store/modules/dict/index.ts
Normal file
0
orion-ops-ui/src/store/modules/dict/index.ts
Normal file
0
orion-ops-ui/src/store/modules/dict/types.ts
Normal file
0
orion-ops-ui/src/store/modules/dict/types.ts
Normal file
@@ -20,9 +20,9 @@
|
|||||||
<!-- 用户名 -->
|
<!-- 用户名 -->
|
||||||
<template #username="{ record }">
|
<template #username="{ record }">
|
||||||
<a-tooltip content="点击复制">
|
<a-tooltip content="点击复制">
|
||||||
<span class="pointer span-blue" @click="copy(record.username)">
|
<span class="pointer span-blue" @click="copy(record.username)">
|
||||||
<icon-copy /> {{ record.username }}
|
<icon-copy /> {{ record.username }}
|
||||||
</span>
|
</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<!-- 秘钥名称 -->
|
<!-- 秘钥名称 -->
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
<!-- 地址 -->
|
<!-- 地址 -->
|
||||||
<template #address="{ record }">
|
<template #address="{ record }">
|
||||||
<a-tooltip content="点击复制">
|
<a-tooltip content="点击复制">
|
||||||
<span class="host-address" @click="copy(record.address)">
|
<span class="host-address" @click="copy(record.address)">
|
||||||
<icon-copy /> {{ record.address }}
|
<icon-copy /> {{ record.address }}
|
||||||
</span>
|
</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<!-- 标签 -->
|
<!-- 标签 -->
|
||||||
|
|||||||
@@ -67,15 +67,15 @@
|
|||||||
<a-tag v-for="definedExtraKey in definedExtraKeys"
|
<a-tag v-for="definedExtraKey in definedExtraKeys"
|
||||||
color="arcoblue"
|
color="arcoblue"
|
||||||
:title="`添加参数 ${definedExtraKey}`"
|
:title="`添加参数 ${definedExtraKey}`"
|
||||||
@click="addExtraParam(definedExtraKey)"
|
@click="addExtraParam(definedExtraKey.name, definedExtraKey.type)"
|
||||||
checkable
|
checkable
|
||||||
checked>
|
checked>
|
||||||
{{ definedExtraKey }}
|
{{ definedExtraKey.name }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
<!-- 添加参数 -->
|
<!-- 添加参数 -->
|
||||||
<a-button title="添加参数"
|
<a-button title="添加参数"
|
||||||
style="width: 180px;"
|
style="width: 180px;"
|
||||||
@click="addExtraParam(undefined)"
|
@click="addExtraParam(undefined,undefined)"
|
||||||
long>
|
long>
|
||||||
<icon-plus />
|
<icon-plus />
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
return {
|
return {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
keyName: undefined,
|
keyName: undefined,
|
||||||
valueType: ValueTypeEnum.STRING.value,
|
valueType: ValueTypeEnum.INTEGER.value,
|
||||||
extraSchema: undefined,
|
extraSchema: undefined,
|
||||||
description: undefined,
|
description: undefined,
|
||||||
};
|
};
|
||||||
@@ -155,13 +155,13 @@
|
|||||||
defineExpose({ openAdd, openUpdate });
|
defineExpose({ openAdd, openUpdate });
|
||||||
|
|
||||||
// 添加额外参数
|
// 添加额外参数
|
||||||
const addExtraParam = (name: string | undefined) => {
|
const addExtraParam = (name: string | undefined, type: any) => {
|
||||||
if (name && extraSchemaArr.value.findIndex(v => v.name === name) != -1) {
|
if (name && extraSchemaArr.value.findIndex(v => v.name === name) != -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
extraSchemaArr.value.push({
|
extraSchemaArr.value.push({
|
||||||
name: name,
|
name: name,
|
||||||
type: ValueTypeEnum.STRING.value
|
type: type || ValueTypeEnum.STRING.value
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -194,11 +194,11 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 不合法
|
// 不合法
|
||||||
if (!new RegExp(/^[a-zA-Z0-9]{2,32}$/).test(extraSchema.name as string)) {
|
if (!new RegExp(/^[a-zA-Z0-9_]{2,32}$/).test(extraSchema.name as string)) {
|
||||||
formRef.value.setFields({
|
formRef.value.setFields({
|
||||||
[`extra${i + 1}`]: {
|
[`extra${i + 1}`]: {
|
||||||
status: 'error',
|
status: 'error',
|
||||||
message: '配置项需要为 2-32 位的数字以及字母'
|
message: '配置项需要为 2-32 位的数字,字母或下滑线'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<!-- 配置项 -->
|
<!-- 配置项 -->
|
||||||
<template #keyName="{ record }">
|
<template #keyName="{ record }">
|
||||||
<span class="pointer" @click="copy(record.keyName)">
|
<span class="pointer" @click="copy(record.keyName)">
|
||||||
<icon-copy class="span-blue" /> {{ record.keyName }}
|
<icon-copy /> {{ record.keyName }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 配置值类型 -->
|
<!-- 配置值类型 -->
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<a-modal v-model:visible="visible"
|
<a-modal v-model:visible="visible"
|
||||||
title-align="start"
|
title-align="start"
|
||||||
width="60%"
|
width="60%"
|
||||||
:body-style="{padding: '16px 4px'}"
|
:body-style="{padding: '16px 8px'}"
|
||||||
:top="80"
|
:top="80"
|
||||||
:title="title"
|
:title="title"
|
||||||
:align-center="false"
|
:align-center="false"
|
||||||
|
|||||||
@@ -1,7 +1,18 @@
|
|||||||
|
import { ValueTypeEnum } from './enum.types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 快捷定义字段
|
* 快捷定义字段
|
||||||
*/
|
*/
|
||||||
export const definedExtraKeys = ['status', 'type', 'color'];
|
export const definedExtraKeys = [{
|
||||||
|
name: 'status',
|
||||||
|
type: ValueTypeEnum.STRING.value
|
||||||
|
}, {
|
||||||
|
name: 'type',
|
||||||
|
type: ValueTypeEnum.STRING.value
|
||||||
|
}, {
|
||||||
|
name: 'color',
|
||||||
|
type: ValueTypeEnum.COLOR.value
|
||||||
|
}];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内置字段
|
* 内置字段
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ export const keyName = [{
|
|||||||
required: true,
|
required: true,
|
||||||
message: '请输入配置项'
|
message: '请输入配置项'
|
||||||
}, {
|
}, {
|
||||||
match: /^[a-zA-Z0-9]{2,32}$/,
|
match: /^[a-zA-Z0-9_]{2,32}$/,
|
||||||
message: '配置项需要为 2-32 位的数字以及字母'
|
message: '配置项需要为 2-32 位的数字,字母或下滑线'
|
||||||
}] as FieldRule[];
|
}] as FieldRule[];
|
||||||
|
|
||||||
export const valueType = [{
|
export const valueType = [{
|
||||||
|
|||||||
@@ -27,6 +27,11 @@
|
|||||||
<!-- 配置名称 -->
|
<!-- 配置名称 -->
|
||||||
<a-form-item field="name" label="配置名称">
|
<a-form-item field="name" label="配置名称">
|
||||||
<a-input v-model="formModel.name" placeholder="请输入配置名称" allow-clear />
|
<a-input v-model="formModel.name" placeholder="请输入配置名称" allow-clear />
|
||||||
|
<span class="item-extra-block pointer"
|
||||||
|
title="同步到值"
|
||||||
|
@click="() => formModel.value = formModel.name">
|
||||||
|
<icon-caret-down style="font-size: 16px" />
|
||||||
|
</span>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- 配置值 -->
|
<!-- 配置值 -->
|
||||||
<a-form-item field="value" label="配置值">
|
<a-form-item field="value" label="配置值">
|
||||||
@@ -68,10 +73,9 @@
|
|||||||
<template v-else-if="ValueTypeEnum.COLOR.value === type">
|
<template v-else-if="ValueTypeEnum.COLOR.value === type">
|
||||||
<a-input v-model="extraValue[name]"
|
<a-input v-model="extraValue[name]"
|
||||||
:placeholder="`请输入 ${name}`"
|
:placeholder="`请输入 ${name}`"
|
||||||
default-value="#"
|
|
||||||
allow-clear
|
allow-clear
|
||||||
hide-button />
|
hide-button />
|
||||||
<span class="color-block" :style="{
|
<span class="item-extra-block" :style="{
|
||||||
background: extraValue[name] === '#' ? undefined : (extraValue[name] || undefined)
|
background: extraValue[name] === '#' ? undefined : (extraValue[name] || undefined)
|
||||||
}" />
|
}" />
|
||||||
</template>
|
</template>
|
||||||
@@ -132,7 +136,7 @@
|
|||||||
const openAdd = () => {
|
const openAdd = () => {
|
||||||
title.value = '添加字典配置值';
|
title.value = '添加字典配置值';
|
||||||
isAddHandle.value = true;
|
isAddHandle.value = true;
|
||||||
renderForm({ ...defaultForm() });
|
renderForm({ ...defaultForm(), keyId: formModel.value.keyId });
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -224,11 +228,14 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.color-block {
|
.item-extra-block {
|
||||||
width: 36px;
|
width: 38px;
|
||||||
height: 30px;
|
height: 32px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background: var(--color-fill-2);
|
background: var(--color-fill-2);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -83,13 +83,19 @@
|
|||||||
<!-- 名称 -->
|
<!-- 名称 -->
|
||||||
<template #name="{ record }">
|
<template #name="{ record }">
|
||||||
<span class="pointer" @click="copy(record.name)">
|
<span class="pointer" @click="copy(record.name)">
|
||||||
<icon-copy class="span-blue" /> {{ record.name }}
|
<icon-copy class="copy-left" />
|
||||||
|
<a-tooltip :content="record.name">
|
||||||
|
<span>{{ record.name }}</span>
|
||||||
|
</a-tooltip>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 值 -->
|
<!-- 值 -->
|
||||||
<template #value="{ record }">
|
<template #value="{ record }">
|
||||||
<span class="pointer" @click="copy(record.value)">
|
<span class="pointer" @click="copy(record.value)">
|
||||||
<icon-copy class="span-blue" /> {{ record.value }}
|
<icon-copy class="copy-left" />
|
||||||
|
<a-tooltip :content="record.value">
|
||||||
|
<span>{{ record.value }}</span>
|
||||||
|
</a-tooltip>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
|
|||||||
@@ -16,20 +16,21 @@ const columns = [
|
|||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
|
render: ({ record }) => {
|
||||||
|
return `${record.keyName} - ${record.keyDescription}`;
|
||||||
|
},
|
||||||
}, {
|
}, {
|
||||||
title: '配置名称',
|
title: '配置名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
slotName: 'name',
|
slotName: 'name',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
tooltip: true,
|
|
||||||
}, {
|
}, {
|
||||||
title: '配置值',
|
title: '配置值',
|
||||||
dataIndex: 'value',
|
dataIndex: 'value',
|
||||||
slotName: 'value',
|
slotName: 'value',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
tooltip: true,
|
|
||||||
}, {
|
}, {
|
||||||
title: '配置描述',
|
title: '配置描述',
|
||||||
dataIndex: 'label',
|
dataIndex: 'label',
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ export const username = [{
|
|||||||
maxLength: 32,
|
maxLength: 32,
|
||||||
message: '用户名长度不能大于32位'
|
message: '用户名长度不能大于32位'
|
||||||
}, {
|
}, {
|
||||||
match: /^[a-zA-Z0-9]{4,32}$/,
|
match: /^[a-zA-Z0-9_]{4,32}$/,
|
||||||
message: '用户名需要为 4-32 位的数字以及字母'
|
message: '用户名需要为 4-32 位的数字,字母或下滑线'
|
||||||
}] as FieldRule[];
|
}] as FieldRule[];
|
||||||
|
|
||||||
export const password = [{
|
export const password = [{
|
||||||
|
|||||||
Reference in New Issue
Block a user