🔨 修改 defineProps 规范.
This commit is contained in:
@@ -5,9 +5,14 @@
|
|||||||
`2024-04-` `release`
|
`2024-04-` `release`
|
||||||
|
|
||||||
* 🐞 修复 批量执行选择模板后默认参数未自动设置
|
* 🐞 修复 批量执行选择模板后默认参数未自动设置
|
||||||
|
* 🐞 修复 主机列表卡片视图重置条件后 tag 消失
|
||||||
|
* 🐞 修复 主机分组授权页面刷新不显示 loading
|
||||||
|
* 🐞 修复 面包屑组件路径显示不全的问题
|
||||||
|
* 🩰 修改 主机终端亮色模式配色
|
||||||
* 🌈 新增 定时执行模块
|
* 🌈 新增 定时执行模块
|
||||||
* 🔨 修改 redisson 配置
|
* 🔨 修改 redisson 配置
|
||||||
* 🔨 规范 orion-ops-framework 配置
|
* 🔨 优化 orion-ops-framework 配置规范化
|
||||||
|
* 🔨 优化 前端 props 命名规范化
|
||||||
|
|
||||||
[如何升级](/about/update.md?id=_v103)
|
[如何升级](/about/update.md?id=_v103)
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
-- 父菜单
|
-- 父菜单
|
||||||
INSERT INTO system_menu
|
INSERT INTO system_menu
|
||||||
(parent_id, name, type, sort, visible, status, cache, creator, updater, deleted)
|
(parent_id, name, type, sort, visible, status, cache, component, creator, updater, deleted)
|
||||||
VALUES
|
VALUES
|
||||||
(0, '${table.comment}管理', 1, 10, 1, 1, 1, '1', '1', 0);
|
(0, '${table.comment}管理', 1, 10, 1, 1, 1, '${vue.moduleEntityFirstLower}Module', '1', '1', 0);
|
||||||
|
|
||||||
-- 设置临时父菜单id
|
-- 设置临时父菜单id
|
||||||
SELECT @TMP_PARENT_ID:=LAST_INSERT_ID();
|
SELECT @TMP_PARENT_ID:=LAST_INSERT_ID();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// 亮色主题配色常量
|
// 亮色主题配色常量
|
||||||
body {
|
body {
|
||||||
--color-bg-header: #232323;
|
--color-bg-header: #232323;
|
||||||
--color-bg-sidebar: #E3E3E3;
|
--color-bg-sidebar: #EBEBEB;
|
||||||
--color-bg-panel: var(--color-bg-sidebar);
|
--color-bg-panel: var(--color-bg-sidebar);
|
||||||
--color-bg-content: #FEFEFE;
|
--color-bg-content: #FEFEFE;
|
||||||
--color-sidebar-icon: #737070;
|
--color-sidebar-icon: #737070;
|
||||||
|
|||||||
@@ -10,18 +10,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
items: {
|
items?: Array<string>;
|
||||||
type: Array as PropType<string[]>,
|
}>(), {
|
||||||
default() {
|
items: () => {
|
||||||
return useRoute().matched
|
return useRoute().matched
|
||||||
.map(s => s.meta?.locale)
|
.map(s => s.meta?.locale as string)
|
||||||
.filter(Boolean) || [];
|
.filter(Boolean) || [];
|
||||||
},
|
},
|
||||||
},
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import type { RadioOption } from '@arco-design/web-vue/es/radio/interface';
|
import type { RadioOption } from '@arco-design/web-vue/es/radio/interface';
|
||||||
import type { SelectOption } from '@arco-design/web-vue/es/select/interface';
|
import type { SelectOption } from '@arco-design/web-vue/es/select/interface';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
import FormWrapper from './form-wrapper.vue';
|
|
||||||
import { updatePreference } from '@/api/user/preference';
|
import { updatePreference } from '@/api/user/preference';
|
||||||
|
import FormWrapper from './form-wrapper.vue';
|
||||||
|
|
||||||
interface OptionsProps {
|
interface OptionsProps {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -36,13 +35,10 @@
|
|||||||
margin?: string;
|
margin?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
defineProps({
|
defineProps<Partial<{
|
||||||
title: String,
|
title: string;
|
||||||
options: {
|
options: Array<OptionsProps>;
|
||||||
type: Array as PropType<OptionsProps[]>,
|
}>>();
|
||||||
default: () => []
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
|
|||||||
@@ -30,29 +30,22 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import type { RadioOption } from '@arco-design/web-vue/es/radio/interface';
|
import type { RadioOption } from '@arco-design/web-vue/es/radio/interface';
|
||||||
import type { SelectOption } from '@arco-design/web-vue/es/select/interface';
|
import type { SelectOption } from '@arco-design/web-vue/es/select/interface';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
type: {
|
type: string;
|
||||||
type: String,
|
name: string;
|
||||||
default: 'switch',
|
defaultValue: string | boolean | number;
|
||||||
},
|
options: Array<RadioOption | SelectOption>;
|
||||||
name: {
|
}>>(), {
|
||||||
type: String,
|
type: 'switch',
|
||||||
default: '',
|
name: '',
|
||||||
},
|
defaultValue: '',
|
||||||
defaultValue: {
|
options: () => []
|
||||||
type: [String, Boolean, Number],
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
type: Array as PropType<Array<RadioOption | SelectOption>>,
|
|
||||||
default: () => []
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['inputChange']);
|
const emit = defineEmits(['inputChange']);
|
||||||
|
|
||||||
const handleChange = (value: unknown) => {
|
const handleChange = (value: unknown) => {
|
||||||
emit('inputChange', {
|
emit('inputChange', {
|
||||||
value,
|
value,
|
||||||
|
|||||||
@@ -16,11 +16,11 @@
|
|||||||
@cancel="() => setVisible(false)">
|
@cancel="() => setVisible(false)">
|
||||||
<div class="preference-containers">
|
<div class="preference-containers">
|
||||||
<!-- 布局设置 -->
|
<!-- 布局设置 -->
|
||||||
<Block :options="layoutOpts" title="布局设置" />
|
<block :options="layoutOpts" title="布局设置" />
|
||||||
<!-- 数据设置 -->
|
<!-- 数据设置 -->
|
||||||
<Block :options="dataOpts" title="数据设置" />
|
<block :options="dataOpts" title="数据设置" />
|
||||||
<!-- 页面视图 -->
|
<!-- 页面视图 -->
|
||||||
<Block :options="viewsOpts" title="页面视图" />
|
<block :options="viewsOpts" title="页面视图" />
|
||||||
</div>
|
</div>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
import Block from './block.vue';
|
|
||||||
import useVisible from '@/hooks/visible';
|
import useVisible from '@/hooks/visible';
|
||||||
import { CardPageSizeOptions, TablePageSizeOptions } from '@/types/const';
|
import { CardPageSizeOptions, TablePageSizeOptions } from '@/types/const';
|
||||||
|
import Block from './block.vue';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const { visible, setVisible } = useVisible();
|
const { visible, setVisible } = useVisible();
|
||||||
|
|||||||
@@ -50,9 +50,8 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { TagProps } from '@/store/modules/tab-bar/types';
|
import type { TagProps } from '@/store/modules/tab-bar/types';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useRouter, useRoute } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useTabBarStore } from '@/store';
|
import { useTabBarStore } from '@/store';
|
||||||
import { DEFAULT_ROUTE_NAME, REDIRECT_ROUTE_NAME } from '@/router/constants';
|
import { DEFAULT_ROUTE_NAME, REDIRECT_ROUTE_NAME } from '@/router/constants';
|
||||||
|
|
||||||
@@ -65,18 +64,10 @@
|
|||||||
all = 'all',
|
all = 'all',
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
itemData: {
|
index: number;
|
||||||
type: Object as PropType<TagProps>,
|
itemData: TagProps;
|
||||||
default: () => {
|
}>();
|
||||||
return {};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
index: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|||||||
@@ -17,14 +17,13 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { TreeNodeData } from '@arco-design/web-vue';
|
import type { TreeNodeData } from '@arco-design/web-vue';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import { computed, onBeforeMount, ref } from 'vue';
|
import { computed, onBeforeMount, ref } from 'vue';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<Partial<{
|
||||||
modelValue: Array as PropType<Array<Number>>,
|
modelValue: Array<number>;
|
||||||
});
|
}>>();
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<a-tree v-if="treeData.length"
|
<a-tree v-if="treeData.length"
|
||||||
ref="tree"
|
ref="tree"
|
||||||
class="tree-container block-tree"
|
class="tree-container block-tree"
|
||||||
|
v-model:checked-keys="checkedKeys"
|
||||||
:blockNode="true"
|
:blockNode="true"
|
||||||
:draggable="editable"
|
:draggable="editable"
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
:checkable="checkable"
|
:checkable="checkable"
|
||||||
v-model:checked-keys="checkedKeys"
|
|
||||||
:check-strictly="true"
|
:check-strictly="true"
|
||||||
@drop="moveGroup">
|
@drop="moveGroup">
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<!-- 名称 -->
|
<!-- 名称 -->
|
||||||
<span v-else
|
<span v-else
|
||||||
class="node-title-wrapper"
|
class="node-title-wrapper"
|
||||||
@click="() => emits('selectNode', node)">
|
@click="() => emits('selectedNode', node)">
|
||||||
{{ node.title }}
|
{{ node.title }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -97,22 +97,13 @@
|
|||||||
import { isString } from '@/utils/is';
|
import { isString } from '@/utils/is';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<Partial<{
|
||||||
loading: Boolean,
|
loading: boolean;
|
||||||
editable: {
|
editable: boolean;
|
||||||
type: Boolean,
|
checkable: boolean;
|
||||||
default: true
|
checkedKeys: Array<number>;
|
||||||
},
|
}>>();
|
||||||
checkable: {
|
const emits = defineEmits(['setLoading', 'selectedNode', 'update:checkedKeys']);
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
checkedKeys: {
|
|
||||||
type: Array<Number>,
|
|
||||||
default: () => []
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const emits = defineEmits(['loading', 'selectNode', 'update:checkedKeys']);
|
|
||||||
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
|
|
||||||
@@ -148,7 +139,7 @@
|
|||||||
// 删除节点
|
// 删除节点
|
||||||
const deleteNode = async (key: number) => {
|
const deleteNode = async (key: number) => {
|
||||||
try {
|
try {
|
||||||
emits('loading', true);
|
emits('setLoading', true);
|
||||||
// 删除
|
// 删除
|
||||||
await deleteHostGroup(key);
|
await deleteHostGroup(key);
|
||||||
// 页面删除
|
// 页面删除
|
||||||
@@ -168,7 +159,7 @@
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
} finally {
|
} finally {
|
||||||
emits('loading', false);
|
emits('setLoading', false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -287,7 +278,7 @@
|
|||||||
dropPosition: number
|
dropPosition: number
|
||||||
}) => {
|
}) => {
|
||||||
try {
|
try {
|
||||||
emits('loading', true);
|
emits('setLoading', true);
|
||||||
// 移动
|
// 移动
|
||||||
await moveHostGroup({
|
await moveHostGroup({
|
||||||
id: dragNode.key as number,
|
id: dragNode.key as number,
|
||||||
@@ -298,25 +289,25 @@
|
|||||||
moveNode(treeData.value, dragNode, dropNode, dropPosition);
|
moveNode(treeData.value, dragNode, dropNode, dropPosition);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
} finally {
|
} finally {
|
||||||
emits('loading', false);
|
emits('setLoading', false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 加载数据
|
// 加载数据
|
||||||
const fetchTreeData = async (force = false) => {
|
const fetchTreeData = async (force = false) => {
|
||||||
try {
|
try {
|
||||||
|
emits('setLoading', true);
|
||||||
const groups = await cacheStore.loadHostGroups(force);
|
const groups = await cacheStore.loadHostGroups(force);
|
||||||
emits('loading', true);
|
|
||||||
treeData.value = groups || [];
|
treeData.value = groups || [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
} finally {
|
} finally {
|
||||||
emits('loading', false);
|
emits('setLoading', false);
|
||||||
}
|
}
|
||||||
// 未选择则选择首个
|
// 未选择则选择首个
|
||||||
if (!tree.value?.getSelectedNodes()?.length && treeData.value.length) {
|
if (!tree.value?.getSelectedNodes()?.length && treeData.value.length) {
|
||||||
await nextTick(() => {
|
await nextTick(() => {
|
||||||
tree.value?.selectNode(treeData.value[0].key);
|
tree.value?.selectNode(treeData.value[0].key);
|
||||||
emits('selectNode', treeData.value[0]);
|
emits('selectedNode', treeData.value[0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,9 +18,11 @@
|
|||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
modelValue: Number,
|
modelValue: number;
|
||||||
authorized: Boolean
|
authorized: boolean;
|
||||||
|
}>>(), {
|
||||||
|
authorized: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|||||||
@@ -18,9 +18,11 @@
|
|||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
modelValue: Number,
|
modelValue: number;
|
||||||
authorized: Boolean
|
authorized: boolean;
|
||||||
|
}>>(), {
|
||||||
|
authorized: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<Partial<{
|
||||||
modelValue: Number
|
modelValue: number
|
||||||
});
|
}>>();
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
|
|||||||
@@ -90,10 +90,10 @@
|
|||||||
import columns from './table.columns';
|
import columns from './table.columns';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
type: String,
|
type: string;
|
||||||
rollback: Function
|
rollback: Function;
|
||||||
});
|
}>();
|
||||||
const emits = defineEmits(['updated']);
|
const emits = defineEmits(['updated']);
|
||||||
|
|
||||||
const pagination = usePagination();
|
const pagination = usePagination();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import type { SelectOptionData } from '@arco-design/web-vue';
|
import type { SelectOptionData } from '@arco-design/web-vue';
|
||||||
import type { TagCreateRequest } from '@/api/meta/tag';
|
import type { TagCreateRequest } from '@/api/meta/tag';
|
||||||
import { ref, computed, onBeforeMount } from 'vue';
|
import { ref, computed, onBeforeMount } from 'vue';
|
||||||
@@ -32,16 +31,15 @@
|
|||||||
import { createTag } from '@/api/meta/tag';
|
import { createTag } from '@/api/meta/tag';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
modelValue: Array as PropType<Array<number>>,
|
modelValue: Array<number>;
|
||||||
placeholder: String,
|
placeholder: string;
|
||||||
limit: Number,
|
limit: number;
|
||||||
type: String,
|
type: string;
|
||||||
allowCreate: Boolean,
|
allowCreate: boolean;
|
||||||
tagColor: {
|
tagColor: Array<string>;
|
||||||
type: Array as PropType<Array<string>>,
|
}>>(), {
|
||||||
default: () => []
|
tagColor: () => []
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue', 'onLimited']);
|
const emits = defineEmits(['update:modelValue', 'onLimited']);
|
||||||
|
|||||||
@@ -22,12 +22,11 @@
|
|||||||
import { labelFilter } from '@/types/form';
|
import { labelFilter } from '@/types/form';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
modelValue: Number,
|
modelValue: number;
|
||||||
allowCreate: {
|
allowCreate: boolean;
|
||||||
type: Boolean,
|
}>>(), {
|
||||||
default: false
|
allowCreate: false,
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue', 'change']);
|
const emits = defineEmits(['update:modelValue', 'change']);
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
import { titleFilter } from '@/types/form';
|
import { titleFilter } from '@/types/form';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
modelValue: Number,
|
modelValue: number;
|
||||||
disabled: Boolean,
|
disabled: boolean;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<a-result v-if="!renderList.length" status="404">
|
<a-result v-if="!renderList.length" status="404">
|
||||||
<template #subtitle>暂无内容</template>
|
<template #subtitle>暂无内容</template>
|
||||||
</a-result>
|
</a-result>
|
||||||
<List :render-list="renderList"
|
<list :render-list="renderList"
|
||||||
:unread-count="unreadCount"
|
:unread-count="unreadCount"
|
||||||
@item-click="handleItemClick" />
|
@item-click="handleItemClick" />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { loading, setLoading } = useLoading(true);
|
const { loading, setLoading } = useLoading(true);
|
||||||
|
|
||||||
const messageType = ref('message');
|
const messageType = ref('message');
|
||||||
const messageData = reactive<{
|
const messageData = reactive<{
|
||||||
renderList: MessageRecord[];
|
renderList: MessageRecord[];
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-list :bordered="false">
|
<a-list :bordered="false">
|
||||||
<a-list-item
|
<a-list-item v-for="item in renderList"
|
||||||
v-for="item in renderList"
|
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
action-layout="vertical"
|
action-layout="vertical"
|
||||||
:style="{
|
:style="{
|
||||||
opacity: item.status ? 0.5 : 1,
|
opacity: item.status ? 0.5 : 1,
|
||||||
}"
|
}">
|
||||||
>
|
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-tag v-if="item.messageType === 0" color="gray">未开始</a-tag>
|
<a-tag v-if="item.messageType === 0" color="gray">未开始</a-tag>
|
||||||
<a-tag v-else-if="item.messageType === 1" color="green">已开通</a-tag>
|
<a-tag v-else-if="item.messageType === 1" color="green">已开通</a-tag>
|
||||||
@@ -65,19 +63,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
import type { MessageListType, MessageRecord } from '@/api/system/message';
|
||||||
import type { MessageRecord, MessageListType } from '@/api/system/message';
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
renderList: {
|
renderList: MessageListType;
|
||||||
type: Array as PropType<MessageListType>,
|
unreadCount?: number;
|
||||||
required: true,
|
}>(), {
|
||||||
},
|
unreadCount: 0,
|
||||||
unreadCount: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['itemClick']);
|
const emit = defineEmits(['itemClick']);
|
||||||
const allRead = () => {
|
const allRead = () => {
|
||||||
emit('itemClick', [...props.renderList]);
|
emit('itemClick', [...props.renderList]);
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import type { SelectOptionData } from '@arco-design/web-vue';
|
import type { SelectOptionData } from '@arco-design/web-vue';
|
||||||
import { computed, onBeforeMount, ref } from 'vue';
|
import { computed, onBeforeMount, ref } from 'vue';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
@@ -24,9 +23,11 @@
|
|||||||
import { labelFilter } from '@/types/form';
|
import { labelFilter } from '@/types/form';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
modelValue: [Number, Array] as PropType<number | Array<number>>,
|
modelValue: number | Array<number>;
|
||||||
multiple: Boolean,
|
multiple: boolean;
|
||||||
|
}>>(), {
|
||||||
|
multiple: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|||||||
@@ -16,16 +16,17 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import type { SelectOptionData } from '@arco-design/web-vue';
|
import type { SelectOptionData } from '@arco-design/web-vue';
|
||||||
import { computed, ref, onMounted } from 'vue';
|
import { computed, ref, onMounted } from 'vue';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
import { labelFilter } from '@/types/form';
|
import { labelFilter } from '@/types/form';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
modelValue: [Number, Array] as PropType<number | Array<number>>,
|
modelValue: number | Array<number>;
|
||||||
multiple: Boolean,
|
multiple: boolean;
|
||||||
|
}>>(), {
|
||||||
|
multiple: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
|||||||
@@ -1,47 +1,44 @@
|
|||||||
<template>
|
<template>
|
||||||
<VCharts
|
<v-charts v-if="renderChart"
|
||||||
v-if="renderChart"
|
|
||||||
:option="options"
|
:option="options"
|
||||||
:autoresize="autoResize"
|
:autoresize="autoResize"
|
||||||
:style="{ width, height }"
|
:style="{ width, height }" />
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, nextTick } from 'vue';
|
import type { ECBasicOption } from 'echarts/types/src/util/types';
|
||||||
|
import { computed, nextTick, ref } from 'vue';
|
||||||
|
import { useAppStore } from '@/store';
|
||||||
import VCharts from 'vue-echarts';
|
import VCharts from 'vue-echarts';
|
||||||
// import { useAppStore } from '@/store';
|
|
||||||
|
|
||||||
defineProps({
|
const props = withDefaults(defineProps<{
|
||||||
options: {
|
options: ECBasicOption,
|
||||||
type: Object,
|
autoResize: boolean,
|
||||||
default() {
|
width: string,
|
||||||
|
height: string,
|
||||||
|
}>(), {
|
||||||
|
options: () => {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
},
|
autoResize: true,
|
||||||
autoResize: {
|
width: '100%',
|
||||||
type: Boolean,
|
height: '100%',
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
width: {
|
|
||||||
type: String,
|
|
||||||
default: '100%',
|
|
||||||
},
|
|
||||||
height: {
|
|
||||||
type: String,
|
|
||||||
default: '100%',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
// const appStore = useAppStore();
|
|
||||||
// const theme = computed(() => {
|
const appStore = useAppStore();
|
||||||
// if (appStore.theme === 'dark') return 'dark';
|
|
||||||
// return '';
|
// 监听暗色模式
|
||||||
// });
|
const theme = computed(() => {
|
||||||
|
if (appStore.theme === 'dark') return 'dark';
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
const renderChart = ref(false);
|
const renderChart = ref(false);
|
||||||
// wait container expand
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
renderChart.value = true;
|
renderChart.value = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { Theme, Options } from './core';
|
import type { Theme, Options } from './core';
|
||||||
import type { CSSProperties, PropType } from 'vue';
|
import type { CSSProperties } from 'vue';
|
||||||
import * as monaco from 'monaco-editor';
|
import * as monaco from 'monaco-editor';
|
||||||
import { createDefaultOptions } from './core';
|
import { createDefaultOptions } from './core';
|
||||||
import { onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
import { onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||||
@@ -28,46 +28,29 @@
|
|||||||
|
|
||||||
const emits = defineEmits(['update:modelValue', 'change', 'editor-mounted']);
|
const emits = defineEmits(['update:modelValue', 'change', 'editor-mounted']);
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
modelValue: {
|
modelValue: string;
|
||||||
type: String,
|
width: string;
|
||||||
},
|
height: string;
|
||||||
width: {
|
readonly: boolean;
|
||||||
type: String,
|
autoFocus: boolean;
|
||||||
default: '100%'
|
language: string;
|
||||||
},
|
suggestions: boolean;
|
||||||
height: {
|
containerClass: string;
|
||||||
type: String,
|
containerStyle: CSSProperties;
|
||||||
default: '100%'
|
theme: Theme | boolean;
|
||||||
},
|
options: Options;
|
||||||
readonly: {
|
}>>(), {
|
||||||
type: Boolean,
|
width: '100%',
|
||||||
default: false
|
height: '100%',
|
||||||
},
|
readonly: false,
|
||||||
autoFocus: {
|
autoFocus: false,
|
||||||
type: Boolean,
|
language: 'json',
|
||||||
default: false
|
suggestions: false,
|
||||||
},
|
theme: true,
|
||||||
language: {
|
options: () => {
|
||||||
type: String,
|
|
||||||
default: 'json',
|
|
||||||
},
|
|
||||||
suggestions: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
containerClass: String,
|
|
||||||
containerStyle: Object as PropType<CSSProperties>,
|
|
||||||
theme: {
|
|
||||||
type: [String, Boolean] as PropType<Theme | boolean>,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
type: Object as PropType<Options>,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
return {};
|
||||||
}
|
},
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const editorContainer = ref();
|
const editorContainer = ref();
|
||||||
|
|||||||
@@ -28,19 +28,14 @@
|
|||||||
import useVisible from '@/hooks/visible';
|
import useVisible from '@/hooks/visible';
|
||||||
import { isString } from '@/utils/is';
|
import { isString } from '@/utils/is';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
width: {
|
width: string | number;
|
||||||
type: [String, Number],
|
height: string;
|
||||||
default: '60%'
|
readonly: boolean;
|
||||||
},
|
}>>(), {
|
||||||
height: {
|
width: '60%',
|
||||||
type: String,
|
height: 'calc(100vh - 240px)',
|
||||||
default: 'calc(100vh - 240px)'
|
readonly: true,
|
||||||
},
|
|
||||||
readonly: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const { visible, setVisible } = useVisible();
|
const { visible, setVisible } = useVisible();
|
||||||
|
|||||||
@@ -32,23 +32,16 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import useVisible from '@/hooks/visible';
|
import useVisible from '@/hooks/visible';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
width: {
|
width: string | number;
|
||||||
type: [String, Number],
|
height: string;
|
||||||
default: '60%'
|
dark: boolean;
|
||||||
},
|
readonly: boolean;
|
||||||
height: {
|
}>>(), {
|
||||||
type: String,
|
width: '60%',
|
||||||
default: 'calc(100vh - 280px)'
|
height: 'calc(100vh - 280px)',
|
||||||
},
|
dark: true,
|
||||||
dark: {
|
readonly: false,
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
readonly: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const { visible, setVisible } = useVisible();
|
const { visible, setVisible } = useVisible();
|
||||||
|
|||||||
@@ -21,17 +21,16 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import type { TabRouterItem } from './types';
|
import type { TabRouterItem } from './types';
|
||||||
import usePermission from '@/hooks/permission';
|
import usePermission from '@/hooks/permission';
|
||||||
import { onMounted, } from 'vue';
|
import { onMounted } from 'vue';
|
||||||
|
|
||||||
const permission = usePermission();
|
const permission = usePermission();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<Partial<{
|
||||||
items: Array as PropType<Array<TabRouterItem>>,
|
items: Array<TabRouterItem>;
|
||||||
modelValue: [String, Number]
|
modelValue: string | number;
|
||||||
});
|
}>>();
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue', 'change']);
|
const emits = defineEmits(['update:modelValue', 'change']);
|
||||||
|
|
||||||
@@ -80,7 +79,7 @@
|
|||||||
height: 32px;
|
height: 32px;
|
||||||
margin: 12px 12px 0 12px;
|
margin: 12px 12px 0 12px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 5px 16px;
|
padding: 6px 18px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 32px;
|
border-radius: 32px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -96,7 +95,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--color-fill-3);
|
background: var(--color-fill-2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- 操作类型 -->
|
<!-- 操作类型 -->
|
||||||
<template #type="{ record }">
|
<template #type="{ record }">
|
||||||
|
<a-tag color="arcoblue">
|
||||||
{{ getDictValue(sftpOperatorTypeKey, record.type) }}
|
{{ getDictValue(sftpOperatorTypeKey, record.type) }}
|
||||||
|
</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- 操作文件 -->
|
<!-- 操作文件 -->
|
||||||
<template #paths="{ record }">
|
<template #paths="{ record }">
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-spin :loading="loading" class="grant-container">
|
<a-spin :loading="loading" class="grant-container">
|
||||||
<!-- 角色列表 -->
|
<!-- 角色列表 -->
|
||||||
<router-roles v-if="type === GrantType.ROLE" outer-class="router-wrapper"
|
<router-roles v-if="type === GrantType.ROLE"
|
||||||
|
outer-class="router-wrapper"
|
||||||
v-model="subjectId"
|
v-model="subjectId"
|
||||||
@change="fetchAuthorizedData" />
|
@change="fetchAuthorizedData" />
|
||||||
<!-- 角色列表 -->
|
<!-- 角色列表 -->
|
||||||
<router-users v-else-if="type === GrantType.USER" outer-class="router-wrapper"
|
<router-users v-else-if="type === GrantType.USER"
|
||||||
|
outer-class="router-wrapper"
|
||||||
v-model="subjectId"
|
v-model="subjectId"
|
||||||
@change="fetchAuthorizedData" />
|
@change="fetchAuthorizedData" />
|
||||||
<!-- 数据列表 -->
|
<!-- 数据列表 -->
|
||||||
@@ -60,10 +62,10 @@
|
|||||||
import RouterRoles from './router-roles.vue';
|
import RouterRoles from './router-roles.vue';
|
||||||
import RouterUsers from './router-users.vue';
|
import RouterUsers from './router-users.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
type: String,
|
type: string;
|
||||||
loading: Boolean,
|
loading: boolean;
|
||||||
});
|
}>();
|
||||||
const emits = defineEmits(['fetch', 'grant']);
|
const emits = defineEmits(['fetch', 'grant']);
|
||||||
|
|
||||||
const subjectId = ref();
|
const subjectId = ref();
|
||||||
|
|||||||
@@ -5,13 +5,12 @@
|
|||||||
@grant="doGrant">
|
@grant="doGrant">
|
||||||
<!-- 分组 -->
|
<!-- 分组 -->
|
||||||
<host-group-tree outer-class="group-main-tree"
|
<host-group-tree outer-class="group-main-tree"
|
||||||
|
v-model:checked-keys="checkedGroups"
|
||||||
:checkable="true"
|
:checkable="true"
|
||||||
:checked-keys="checkedGroups"
|
|
||||||
:editable="false"
|
:editable="false"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@loading="setLoading"
|
@set-loading="setLoading"
|
||||||
@select-node="(e) => selectedGroup = e"
|
@selected-node="(e) => selectedGroup = e" />
|
||||||
@update:checked-keys="updateCheckedGroups" />
|
|
||||||
<!-- 主机列表 -->
|
<!-- 主机列表 -->
|
||||||
<host-list class="group-main-hosts sticky-list" :group="selectedGroup" />
|
<host-list class="group-main-hosts sticky-list" :group="selectedGroup" />
|
||||||
</grant-layout>
|
</grant-layout>
|
||||||
@@ -34,9 +33,9 @@
|
|||||||
import HostList from './host-list.vue';
|
import HostList from './host-list.vue';
|
||||||
import GrantLayout from './grant-layout.vue';
|
import GrantLayout from './grant-layout.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
type: String,
|
type: string;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
|
|
||||||
@@ -44,11 +43,6 @@
|
|||||||
const checkedGroups = ref<Array<number>>([]);
|
const checkedGroups = ref<Array<number>>([]);
|
||||||
const selectedGroup = ref<TreeNodeData>({});
|
const selectedGroup = ref<TreeNodeData>({});
|
||||||
|
|
||||||
// 选择分组
|
|
||||||
const updateCheckedGroups = (e: Array<number>) => {
|
|
||||||
checkedGroups.value = e;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取授权列表
|
// 获取授权列表
|
||||||
const fetchAuthorizedGroup = async (request: AssetAuthorizedDataQueryRequest) => {
|
const fetchAuthorizedGroup = async (request: AssetAuthorizedDataQueryRequest) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -45,9 +45,9 @@
|
|||||||
import { useRowSelection } from '@/types/table';
|
import { useRowSelection } from '@/types/table';
|
||||||
import GrantLayout from './grant-layout.vue';
|
import GrantLayout from './grant-layout.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
type: String,
|
type: string;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
const rowSelection = useRowSelection();
|
const rowSelection = useRowSelection();
|
||||||
|
|||||||
@@ -37,9 +37,10 @@
|
|||||||
import { hostKeyColumns } from '../types/table.columns';
|
import { hostKeyColumns } from '../types/table.columns';
|
||||||
import GrantLayout from './grant-layout.vue';
|
import GrantLayout from './grant-layout.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
type: String,
|
type: string;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
const rowSelection = useRowSelection();
|
const rowSelection = useRowSelection();
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<!-- 表头 -->
|
<!-- 表头 -->
|
||||||
<template #header>
|
<template #header>
|
||||||
<span class="hosts-header-title">组内数据</span>
|
<span class="hosts-header-title">组内数据</span>
|
||||||
<span class="span-blue">{{ props.group?.title }}</span>
|
<span class="span-blue">{{ group?.title }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 空数据 -->
|
<!-- 空数据 -->
|
||||||
<template #empty>
|
<template #empty>
|
||||||
@@ -35,20 +35,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { TreeNodeData } from '@arco-design/web-vue';
|
import type { TreeNodeData } from '@arco-design/web-vue';
|
||||||
import type { HostQueryResponse } from '@/api/asset/host';
|
import type { HostQueryResponse } from '@/api/asset/host';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { getHostGroupRelList } from '@/api/asset/host-group';
|
import { getHostGroupRelList } from '@/api/asset/host-group';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<Partial<{
|
||||||
group: {
|
group: TreeNodeData;
|
||||||
type: Object as PropType<TreeNodeData>,
|
}>>();
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
|
|||||||
@@ -36,9 +36,9 @@
|
|||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<Partial<{
|
||||||
modelValue: Number
|
modelValue: number;
|
||||||
});
|
}>>();
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue', 'change']);
|
const emits = defineEmits(['update:modelValue', 'change']);
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,9 @@
|
|||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<Partial<{
|
||||||
modelValue: Number
|
modelValue: number;
|
||||||
});
|
}>>();
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue', 'change']);
|
const emits = defineEmits(['update:modelValue', 'change']);
|
||||||
|
|
||||||
|
|||||||
@@ -31,14 +31,14 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { HostConfigWrapper } from '../../types/const';
|
import type { HostConfigWrapper } from '../../types/const';
|
||||||
import { HostSshConfig } from './ssh/types/const';
|
import type { HostSshConfig } from './ssh/types/const';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import useVisible from '@/hooks/visible';
|
import useVisible from '@/hooks/visible';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { getHostConfigList } from '@/api/asset/host-config';
|
import { getHostConfigList } from '@/api/asset/host-config';
|
||||||
import { useCacheStore, useDictStore } from '@/store';
|
import { useCacheStore, useDictStore } from '@/store';
|
||||||
import { dictKeys as sshDictKeys } from './ssh/types/const';
|
import { dictKeys } from './ssh/types/const';
|
||||||
import SshConfigForm from './ssh/ssh-config-form.vue';
|
import SshConfigForm from './ssh/ssh-config-form.vue';
|
||||||
|
|
||||||
const { visible, setVisible } = useVisible();
|
const { visible, setVisible } = useVisible();
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
setVisible(true);
|
setVisible(true);
|
||||||
// 加载字典值
|
// 加载字典值
|
||||||
const dictStore = useDictStore();
|
const dictStore = useDictStore();
|
||||||
await dictStore.loadKeys(sshDictKeys);
|
await dictStore.loadKeys(dictKeys);
|
||||||
// 加载配置
|
// 加载配置
|
||||||
const { data } = await getHostConfigList(record.value.id);
|
const { data } = await getHostConfigList(record.value.id);
|
||||||
data.forEach(s => {
|
data.forEach(s => {
|
||||||
|
|||||||
@@ -159,10 +159,10 @@
|
|||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const { toRadioOptions } = useDictStore();
|
const { toRadioOptions } = useDictStore();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
content: Object,
|
content: any;
|
||||||
hostId: Number,
|
hostId: number;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const emits = defineEmits(['submitted']);
|
const emits = defineEmits(['submitted']);
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
<host-group-tree outer-class="tree-card-main"
|
<host-group-tree outer-class="tree-card-main"
|
||||||
ref="tree"
|
ref="tree"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@loading="setLoading"
|
@set-loading="setLoading"
|
||||||
@select-node="selectGroup" />
|
@selected-node="selectGroup" />
|
||||||
</div>
|
</div>
|
||||||
<!-- 身体部分 -->
|
<!-- 身体部分 -->
|
||||||
<a-spin class="simple-card transfer-body"
|
<a-spin class="simple-card transfer-body"
|
||||||
|
|||||||
@@ -53,22 +53,17 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { TransferItem } from '@arco-design/web-vue/es/transfer/interface';
|
import type { TransferItem } from '@arco-design/web-vue/es/transfer/interface';
|
||||||
import type { TreeNodeData } from '@arco-design/web-vue';
|
import type { TreeNodeData } from '@arco-design/web-vue';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import { onMounted, ref, watch, computed } from 'vue';
|
import { onMounted, ref, watch, computed } from 'vue';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
import { getHostGroupRelList } from '@/api/asset/host-group';
|
import { getHostGroupRelList } from '@/api/asset/host-group';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
modelValue: {
|
modelValue: Array<string>;
|
||||||
type: Array<string>,
|
group: TreeNodeData;
|
||||||
default: () => []
|
}>>(), {
|
||||||
},
|
group: () => {
|
||||||
group: {
|
|
||||||
type: Object as PropType<TreeNodeData>,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
return {};
|
||||||
}
|
},
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['loading', 'update:modelValue']);
|
const emits = defineEmits(['loading', 'update:modelValue']);
|
||||||
|
|||||||
@@ -244,7 +244,7 @@
|
|||||||
|
|
||||||
// 重置条件
|
// 重置条件
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
resetObject(formModel, ['extra']);
|
resetObject(formModel, ['queryTag']);
|
||||||
fetchCardData();
|
fetchCardData();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -31,13 +31,13 @@
|
|||||||
import { ref, onBeforeMount } from 'vue';
|
import { ref, onBeforeMount } from 'vue';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
import { dictKeys } from './types/const';
|
import { dictKeys } from './types/const';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { openNewRoute } from '@/router';
|
||||||
import ExecLogTable from './components/exec-log-table.vue';
|
import ExecLogTable from './components/exec-log-table.vue';
|
||||||
import ExecLogClearModal from './components/exec-log-clear-modal.vue';
|
import ExecLogClearModal from './components/exec-log-clear-modal.vue';
|
||||||
import JsonEditorModal from '@/components/view/json-editor/modal/index.vue';
|
import JsonEditorModal from '@/components/view/json-editor/modal/index.vue';
|
||||||
import ShellEditorModal from '@/components/view/shell-editor/modal/index.vue';
|
import ShellEditorModal from '@/components/view/shell-editor/modal/index.vue';
|
||||||
import ExecLogPanelModal from '@/components/exec/log/panel-modal/index.vue';
|
import ExecLogPanelModal from '@/components/exec/log/panel-modal/index.vue';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import { openNewRoute } from '@/router';
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,13 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { SidebarAction } from '../../types/terminal.type';
|
import type { SidebarAction } from '../../types/terminal.type';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
|
|
||||||
defineProps({
|
defineProps<Partial<{
|
||||||
actions: Array as PropType<Array<SidebarAction>>,
|
actions: Array<SidebarAction>;
|
||||||
position: String,
|
position: string;
|
||||||
wrapperClass: String,
|
wrapperClass: string;
|
||||||
iconClass: String,
|
iconClass: string;
|
||||||
});
|
}>>();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -3,19 +3,20 @@
|
|||||||
<div class="sftp-editor-header">
|
<div class="sftp-editor-header">
|
||||||
<!-- 左侧操作 -->
|
<!-- 左侧操作 -->
|
||||||
<div class="sftp-editor-header-left">
|
<div class="sftp-editor-header-left">
|
||||||
<div class="sftp-path-container">
|
|
||||||
<!-- 当前路径 -->
|
|
||||||
<a-tooltip position="top"
|
<a-tooltip position="top"
|
||||||
:mini="true"
|
:mini="true"
|
||||||
:overlay-inverse="true"
|
:overlay-inverse="true"
|
||||||
:auto-fix-position="false"
|
:auto-fix-position="false"
|
||||||
content-class="terminal-tooltip-content"
|
content-class="terminal-tooltip-content"
|
||||||
arrow-class="terminal-tooltip-content"
|
arrow-class="terminal-tooltip-content"
|
||||||
:content="path">
|
content="点击复制">
|
||||||
|
<a-tag class="sftp-path-container pointer"
|
||||||
|
color="green"
|
||||||
|
@click="copy(path, '已复制')">
|
||||||
<span>{{ name }}</span>
|
<span>{{ name }}</span>
|
||||||
|
</a-tag>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<!-- 右侧操作 -->
|
<!-- 右侧操作 -->
|
||||||
<a-space class="sftp-editor-header-right">
|
<a-space class="sftp-editor-header-right">
|
||||||
<!-- 保存 -->
|
<!-- 保存 -->
|
||||||
@@ -56,6 +57,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { ISftpSession } from '../../types/terminal.type';
|
import type { ISftpSession } from '../../types/terminal.type';
|
||||||
|
import { copy } from '@/hooks/copy';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
name: string;
|
name: string;
|
||||||
@@ -95,24 +97,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sftp-path-container {
|
|
||||||
width: 100%;
|
|
||||||
height: @action-size;
|
|
||||||
background: var(--color-fill-2);
|
|
||||||
border-radius: 2px;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 8px;
|
|
||||||
|
|
||||||
span {
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.2;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-action-icon {
|
.header-action-icon {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
|||||||
@@ -60,7 +60,6 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { UserQueryResponse, LoginHistoryQueryResponse } from '@/api/user/user';
|
import type { UserQueryResponse, LoginHistoryQueryResponse } from '@/api/user/user';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { ref, onBeforeMount } from 'vue';
|
import { ref, onBeforeMount } from 'vue';
|
||||||
import { ResultStatus } from '../types/const';
|
import { ResultStatus } from '../types/const';
|
||||||
@@ -69,9 +68,9 @@
|
|||||||
import { dateFormat } from '@/utils';
|
import { dateFormat } from '@/utils';
|
||||||
import { isMobile } from '@/utils/is';
|
import { isMobile } from '@/utils/is';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
user: Object as PropType<UserQueryResponse>,
|
user?: UserQueryResponse;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const list = ref<LoginHistoryQueryResponse[]>([]);
|
const list = ref<LoginHistoryQueryResponse[]>([]);
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { UserUpdateRequest, UserQueryResponse } from '@/api/user/user';
|
import type { UserUpdateRequest, UserQueryResponse } from '@/api/user/user';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import formRules from '../../user/types/form.rules';
|
import formRules from '../../user/types/form.rules';
|
||||||
@@ -59,9 +58,9 @@
|
|||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { updateUser } from '@/api/user/user';
|
import { updateUser } from '@/api/user/user';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
user: Object as PropType<UserQueryResponse>,
|
user?: UserQueryResponse;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
|
|||||||
@@ -33,16 +33,15 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { UserQueryResponse } from '@/api/user/user';
|
import type { UserQueryResponse } from '@/api/user/user';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import { ref, onBeforeMount } from 'vue';
|
import { ref, onBeforeMount } from 'vue';
|
||||||
import { useCacheStore, useDictStore } from '@/store';
|
import { useCacheStore, useDictStore } from '@/store';
|
||||||
import { dictKeys } from '@/views/user/operator-log/types/const';
|
import { dictKeys } from '@/views/user/operator-log/types/const';
|
||||||
import OperatorLogQueryHeader from '@/views/user/operator-log/components/operator-log-query-header.vue';
|
import OperatorLogQueryHeader from '@/views/user/operator-log/components/operator-log-query-header.vue';
|
||||||
import OperatorLogSimpleTable from '@/views/user/operator-log/components/operator-log-simple-table.vue';
|
import OperatorLogSimpleTable from '@/views/user/operator-log/components/operator-log-simple-table.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
user: Object as PropType<UserQueryResponse>,
|
user?: UserQueryResponse;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { UserQueryResponse } from '@/api/user/user';
|
import type { UserQueryResponse } from '@/api/user/user';
|
||||||
import type { UserSessionQueryResponse } from '@/api/user/user';
|
import type { UserSessionQueryResponse } from '@/api/user/user';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { ref, onBeforeMount } from 'vue';
|
import { ref, onBeforeMount } from 'vue';
|
||||||
import { getCurrentUserSessionList, offlineCurrentUserSession } from '@/api/user/mine';
|
import { getCurrentUserSessionList, offlineCurrentUserSession } from '@/api/user/mine';
|
||||||
@@ -78,9 +77,9 @@
|
|||||||
import usePermission from '@/hooks/permission';
|
import usePermission from '@/hooks/permission';
|
||||||
import { getUserSessionList, offlineUserSession } from '@/api/user/user';
|
import { getUserSessionList, offlineUserSession } from '@/api/user/user';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
user: Object as PropType<UserQueryResponse>,
|
user?: UserQueryResponse;
|
||||||
});
|
}>();
|
||||||
|
|
||||||
const list = ref<UserSessionQueryResponse[]>([]);
|
const list = ref<UserSessionQueryResponse[]>([]);
|
||||||
|
|
||||||
|
|||||||
@@ -72,11 +72,10 @@
|
|||||||
import UserSelector from '@/components/user/user/selector/index.vue';
|
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['submit']);
|
const emits = defineEmits(['submit']);
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
visibleUser: {
|
visibleUser: boolean;
|
||||||
type: Boolean,
|
}>>(), {
|
||||||
default: true
|
visibleUser: true,
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
|
|||||||
@@ -81,21 +81,14 @@
|
|||||||
import { replaceHtmlTag, clearHtmlTag } from '@/utils';
|
import { replaceHtmlTag, clearHtmlTag } from '@/utils';
|
||||||
import JsonEditorModal from '@/components/view/json-editor/modal/index.vue';
|
import JsonEditorModal from '@/components/view/json-editor/modal/index.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<Partial<{
|
||||||
handleColumn: {
|
handleColumn: boolean;
|
||||||
type: Boolean,
|
current: boolean;
|
||||||
default: true
|
baseParams: object;
|
||||||
},
|
}>>(), {
|
||||||
current: {
|
baseParams: () => {
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
baseParams: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
return {};
|
||||||
}
|
},
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const pagination = usePagination();
|
const pagination = usePagination();
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
const open = (record: any) => {
|
const open = (record: any) => {
|
||||||
renderForm(record);
|
renderForm(record);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
// 加载用户角色
|
||||||
loadRoles();
|
loadRoles();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,13 @@
|
|||||||
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
@page-change="(page) => fetchTableData(page, pagination.pageSize)"
|
||||||
@page-size-change="(size) => fetchTableData(1, size)"
|
@page-size-change="(size) => fetchTableData(1, size)"
|
||||||
:bordered="false">
|
:bordered="false">
|
||||||
|
<!-- 用户名 -->
|
||||||
|
<template #username="{ record }">
|
||||||
|
<span class="span-blue text-copy"
|
||||||
|
@click="copy(record.username)">
|
||||||
|
{{ record.username }}`
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
<!-- 状态 -->
|
<!-- 状态 -->
|
||||||
<template #status="{ record }">
|
<template #status="{ record }">
|
||||||
<span class="circle" :style="{
|
<span class="circle" :style="{
|
||||||
@@ -166,6 +173,7 @@
|
|||||||
import { usePagination } from '@/types/table';
|
import { usePagination } from '@/types/table';
|
||||||
import { useDictStore, useUserStore } from '@/store';
|
import { useDictStore, useUserStore } from '@/store';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
import { copy } from '@/hooks/copy';
|
||||||
|
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate', 'openResetPassword', 'openGrantRole']);
|
const emits = defineEmits(['openAdd', 'openUpdate', 'openResetPassword', 'openGrantRole']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user