Browse Source

feat: 用户管理样式调整

main
xuziqiang 3 months ago
parent
commit
d654588e65
  1. 4
      hx-ai-intelligent/src/icon/deptLink.svg
  2. 4
      hx-ai-intelligent/src/icon/orgLink.svg
  3. 982
      hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
  4. 1
      lib/component/tree/props.ts
  5. 61
      lib/component/tree/tree-api.vue
  6. 10
      lib/saas/asset/icon/noResource.svg
  7. 3
      lib/saas/view/service/error-403.vue
  8. 1
      lib/util/http/axios.ts

4
hx-ai-intelligent/src/icon/deptLink.svg

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="11.989990234375" height="11.1085205078125" viewBox="0 0 11.989990234375 11.1085205078125" fill="none">
<path d="M11.4607 7.93429L10.704 7.93429L10.704 6.36826C10.704 5.93552 10.3055 5.58339 9.81754 5.58339L6.4082 5.58339L6.4082 3.96776L7.62086 3.96776C7.91499 3.96776 8.15565 3.74458 8.15565 3.47179L8.15565 0.495972C8.15565 0.223183 7.91499 0 7.62086 0L4.41207 0C4.11794 0 3.87727 0.223183 3.87727 0.495972L3.87727 3.47179C3.87727 3.74458 4.11794 3.96776 4.41207 3.96776L5.57927 3.96776L5.57927 5.58339L2.18999 5.58339C1.70065 5.58339 1.30357 5.93552 1.30357 6.36826L1.30357 7.93429L0.534798 7.93429C0.240654 7.93429 0 8.15747 0 8.43025L0 10.6125C0 10.8853 0.240654 11.1085 0.534798 11.1085L2.8879 11.1085C3.18204 11.1085 3.4227 10.8853 3.4227 10.6125L3.4227 8.43025C3.4227 8.15747 3.18204 7.93429 2.8879 7.93429L2.13116 7.93429L2.13116 6.37321C2.13651 6.36578 2.15657 6.35213 2.18865 6.35213L5.57793 6.35213L5.57793 7.93429L4.8252 7.93429C4.53107 7.93429 4.29041 8.15747 4.29041 8.43025L4.29041 10.6125C4.29041 10.8853 4.53107 11.1085 4.8252 11.1085L7.17831 11.1085C7.47245 11.1085 7.7131 10.8853 7.7131 10.6125L7.7131 8.43025C7.7131 8.15747 7.47245 7.93429 7.17831 7.93429L6.40553 7.93429L6.40553 6.35213L9.81352 6.35213C9.84561 6.35213 9.86566 6.36578 9.87102 6.37321L9.87102 7.93429L9.10224 7.93429C8.80811 7.93429 8.56744 8.15747 8.56744 8.43026L8.56744 10.6125C8.56744 10.8853 8.80811 11.1085 9.10224 11.1085L11.4553 11.1085C11.7495 11.1085 11.9901 10.8853 11.9901 10.6125L11.9901 8.43026C11.9955 8.15747 11.7548 7.93429 11.4607 7.93429Z" fill="#4388FB" >
</path>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

4
hx-ai-intelligent/src/icon/orgLink.svg

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12.0859375" height="10.474609375" viewBox="0 0 12.0859375 10.474609375" fill="none">
<path d="M11.6831 9.66875L11.2802 9.66875L11.2802 4.02865C11.2802 3.14235 10.5551 2.41719 9.66875 2.41719L7.25156 2.41719L7.25156 9.26588C7.25156 9.49149 7.0743 9.66875 6.8487 9.66875C6.62309 9.66875 6.44583 9.49149 6.44583 9.26588L6.44583 1.61147C6.44583 0.725159 5.72068 0 4.83437 0L2.41719 0C1.53089 0 0.805729 0.725159 0.805729 1.61147L0.805729 9.66875L0.402865 9.66875C0.17726 9.66875 0 9.84601 0 10.0716C0 10.2972 0.17726 10.4745 0.402865 10.4745L11.6831 10.4745C11.9087 10.4745 12.0859 10.2972 12.0859 10.0716C12.0859 9.84601 11.9087 9.66875 11.6831 9.66875ZM4.43151 8.0573L2.82005 8.0573C2.59445 8.0573 2.41719 7.88004 2.41719 7.65443C2.41719 7.42883 2.59445 7.25156 2.82005 7.25156L4.43151 7.25156C4.65711 7.25156 4.83437 7.42883 4.83437 7.65443C4.83437 7.88004 4.65711 8.0573 4.43151 8.0573ZM4.43151 5.64011L2.82005 5.64011C2.59445 5.64011 2.41719 5.46284 2.41719 5.23724C2.41719 5.01164 2.59445 4.83438 2.82005 4.83438L4.43151 4.83438C4.65711 4.83438 4.83437 5.01164 4.83437 5.23724C4.83437 5.46284 4.65711 5.64011 4.43151 5.64011ZM4.43151 3.22292L2.82005 3.22292C2.59445 3.22292 2.41719 3.04565 2.41719 2.82005C2.41719 2.59445 2.59445 2.41719 2.82005 2.41719L4.43151 2.41719C4.65711 2.41719 4.83437 2.59445 4.83437 2.82005C4.83437 3.04565 4.65711 3.22292 4.43151 3.22292ZM10.0716 8.0573L8.46016 8.0573C8.23455 8.0573 8.05729 7.88004 8.05729 7.65443C8.05729 7.42883 8.23455 7.25156 8.46016 7.25156L10.0716 7.25156C10.2972 7.25156 10.4745 7.42883 10.4745 7.65443C10.4745 7.88004 10.2972 8.0573 10.0716 8.0573ZM10.0716 5.64011L8.46016 5.64011C8.23455 5.64011 8.05729 5.46284 8.05729 5.23724C8.05729 5.01164 8.23455 4.83438 8.46016 4.83438L10.0716 4.83438C10.2972 4.83438 10.4745 5.01164 10.4745 5.23724C10.4745 5.46284 10.2972 5.64011 10.0716 5.64011Z" fill="#4388FB" >
</path>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

982
hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue

File diff suppressed because it is too large

1
lib/component/tree/props.ts

@ -38,6 +38,7 @@ export const treeProps = {
blockNode: PropTypes.bool.def(true), blockNode: PropTypes.bool.def(true),
defaultExpandAll: PropTypes.bool.def(true), defaultExpandAll: PropTypes.bool.def(true),
resultField: PropTypes.string.def('data'), resultField: PropTypes.string.def('data'),
header: PropTypes.object,
transform: { transform: {
type: Function, type: Function,
default: (data: any) => data, default: (data: any) => data,

61
lib/component/tree/tree-api.vue

@ -1,13 +1,19 @@
<template> <template>
<a-spin :spinning="treeState.loading"> <a-spin :spinning="treeState.loading">
<div v-if="header" class="ns-tree-title">
<ns-icon :name="header.icon" size="14" />
<span>{{ header.title }}</span>
</div>
<div v-if="!formConfig?.schema"> <div v-if="!formConfig?.schema">
<ns-form ref="formElRef" v-bind="formConfig" :model="formModel" @finish="formFinish" /> <ns-form ref="formElRef" v-bind="formConfig" :model="formModel" @finish="formFinish" />
</div> </div>
<ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys"> <div>
<template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index"> <ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys">
<slot :name="item" v-bind="data || {}"></slot> <template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index">
</template> <slot :name="item" v-bind="data || {}"></slot>
</ns-tree> </template>
</ns-tree>
</div>
</a-spin> </a-spin>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -17,13 +23,14 @@
import { AxiosRequestConfig } from 'axios'; import { AxiosRequestConfig } from 'axios';
import { get } from 'lodash-es'; import { get } from 'lodash-es';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { isEmpty } from 'lodash-es'; import { debounce } from 'lodash-es';
import { treeProps, treeFormProps } from '/nerv-lib/component/tree/props'; import { treeProps, treeFormProps } from '/nerv-lib/component/tree/props';
const formElRef = ref(); const formElRef = ref();
defineOptions({ defineOptions({
name: 'NsTreeApi', name: 'NsTreeApi',
}); });
const props = defineProps(treeProps); const props = defineProps(treeProps);
const treeData = ref<TreeDataItem[]>([]); const treeData = ref<TreeDataItem[]>([]);
const selectedKeys = ref(props.defaultSelectedKeys || []); const selectedKeys = ref(props.defaultSelectedKeys || []);
const { httpRequest } = useApi(); const { httpRequest } = useApi();
@ -32,7 +39,7 @@
const attrs = useAttrs(); const attrs = useAttrs();
const formModel = reactive({}); const formModel = reactive({});
const treeState = reactive({ const treeState = reactive({
loading: true, loading: false,
}); });
const formConfig = computed(() => { const formConfig = computed(() => {
return { return {
@ -40,9 +47,9 @@
...props.formConfig, ...props.formConfig,
}; };
}); });
const formFinish = () => { const formFinish = debounce((data: object) => {
getData(); getData(data);
}; }, 200);
const getBindValue = computed(() => ({ const getBindValue = computed(() => ({
...attrs, ...attrs,
...props, ...props,
@ -55,19 +62,20 @@
return { ...route.params, ...route.query, ...props.defaultParams }; return { ...route.params, ...route.query, ...props.defaultParams };
}); });
const getData = () => { const getData = (params = {}) => {
const { api, transform, resultField } = props; const { api, transform, resultField } = props;
treeData.value = []; treeData.value = [];
if (!api) return; if (!api) return;
setLoading(true); setLoading(true);
httpRequest({ httpRequest({
api, api,
params: httpPrams, params: { ...httpPrams.value, ...params },
pathParams: { ...route.params, ...route.query }, pathParams: { ...route.params, ...route.query, ...params },
requestConfig, requestConfig: { ...requestConfig, data: { ...httpPrams.value, ...params } },
}) })
.then((res) => { .then((res) => {
treeData.value = transform(get(res, resultField)); treeData.value = transform(get(res, resultField));
console.log(treeData.value, 'treeData.value');
}) })
.finally(() => { .finally(() => {
setLoading(false); setLoading(false);
@ -76,4 +84,27 @@
getData(); getData();
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped>
:deep(.ant-form-item) {
margin-bottom: 16px;
}
:deep(.ns-form::after) {
display: none;
}
.ns-tree-title {
font-weight: bold;
user-select: text;
padding: 16px;
margin-bottom: 16px;
padding-bottom: 10px;
border-bottom: 1px solid #e9e9e9;
> span {
padding-left: 6px;
}
& ~ div {
padding: 0 16px !important;
}
}
</style>

10
lib/saas/asset/icon/noResource.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

3
lib/saas/view/service/error-403.vue

@ -3,7 +3,7 @@
<a-layout class="ns-application" style="height: 100%"> <a-layout class="ns-application" style="height: 100%">
<ns-header class="ns-header-menu" /> <ns-header class="ns-header-menu" />
<a-layout> <a-layout>
<ns-sider class="ns-left-menu" /> <!-- <ns-sider class="ns-left-menu" /> -->
<a-layout> <a-layout>
<a-layout-content class="content" :style="{ minHeight: '400px', overflow: 'auto' }"> <a-layout-content class="content" :style="{ minHeight: '400px', overflow: 'auto' }">
<div> <div>
@ -43,6 +43,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding-top: 200px;
img { img {
width: 240px; width: 240px;
height: 240px; height: 240px;

1
lib/util/http/axios.ts

@ -78,6 +78,7 @@ export class NSAxios {
const errCodeMap = new Map<number, any>([ const errCodeMap = new Map<number, any>([
[13, ''], [13, ''],
[1, ''], [1, ''],
[3005, ''],
[10086, () => routerConfig.logout()], [10086, () => routerConfig.logout()],
]); ]);

Loading…
Cancel
Save