|
@@ -1,37 +1,38 @@
|
|
<template>
|
|
<template>
|
|
<fs-page>
|
|
<fs-page>
|
|
<el-row class="mx-2">
|
|
<el-row class="mx-2">
|
|
- <el-col xs="24" :sm="8" :md="6" :lg="4" :xl="4" class="p-1">
|
|
|
|
|
|
+ <el-col :lg="4" :md="6" :sm="8" :xl="4" class="p-1" xs="24">
|
|
<el-card :body-style="{ height: '100%' }">
|
|
<el-card :body-style="{ height: '100%' }">
|
|
<p class="font-mono font-black text-center text-xl pb-5">
|
|
<p class="font-mono font-black text-center text-xl pb-5">
|
|
部门列表
|
|
部门列表
|
|
- <el-tooltip effect="dark" :content="content" placement="right">
|
|
|
|
|
|
+ <el-tooltip :content="content" effect="dark" placement="right">
|
|
<el-icon>
|
|
<el-icon>
|
|
<QuestionFilled/>
|
|
<QuestionFilled/>
|
|
</el-icon>
|
|
</el-icon>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</p>
|
|
</p>
|
|
<el-input v-model="filterText" :placeholder="placeholder"/>
|
|
<el-input v-model="filterText" :placeholder="placeholder"/>
|
|
- <el-tree ref="treeRef" class="font-mono font-bold leading-6 text-7xl" :data="data" :props="treeProps"
|
|
|
|
- :filter-node-method="filterNode" icon="ArrowRightBold" :indent="38" highlight-current @node-click="onTreeNodeClick">
|
|
|
|
|
|
+ <el-tree ref="treeRef" :data="data" :filter-node-method="filterNode" :indent="38"
|
|
|
|
+ :props="treeProps" class="font-mono font-bold leading-6 text-7xl" highlight-current icon="ArrowRightBold"
|
|
|
|
+ @node-click="onTreeNodeClick">
|
|
<template #default="{ node, data }">
|
|
<template #default="{ node, data }">
|
|
- <element-tree-line :node="node" :showLabelLine="false" :indent="32">
|
|
|
|
|
|
+ <element-tree-line :indent="32" :node="node" :showLabelLine="false">
|
|
<span v-if="data.status" class="text-center font-black font-normal">
|
|
<span v-if="data.status" class="text-center font-black font-normal">
|
|
- <SvgIcon name="iconfont icon-shouye" color="var(--el-color-primary)"/> {{ node.label }}
|
|
|
|
|
|
+ <SvgIcon color="var(--el-color-primary)" name="iconfont icon-shouye"/> {{ node.label }}
|
|
</span>
|
|
</span>
|
|
<span v-else color="var(--el-color-primary)"> <SvgIcon name="iconfont icon-shouye"/> {{
|
|
<span v-else color="var(--el-color-primary)"> <SvgIcon name="iconfont icon-shouye"/> {{
|
|
node.label
|
|
node.label
|
|
- }} </span>
|
|
|
|
|
|
+ }} </span>
|
|
</element-tree-line>
|
|
</element-tree-line>
|
|
</template>
|
|
</template>
|
|
</el-tree>
|
|
</el-tree>
|
|
</el-card>
|
|
</el-card>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col xs="24" :sm="16" :md="18" :lg="20" :xl="20" class="p-1">
|
|
|
|
|
|
+ <el-col :lg="20" :md="18" :sm="16" :xl="20" class="p-1" xs="24">
|
|
<el-card :body-style="{ height: '100%' }">
|
|
<el-card :body-style="{ height: '100%' }">
|
|
<fs-crud ref="crudRef" v-bind="crudBinding">
|
|
<fs-crud ref="crudRef" v-bind="crudBinding">
|
|
<template #actionbar-right>
|
|
<template #actionbar-right>
|
|
- <importExcel api="api/system/user/" v-auth="'user:Import'">导入</importExcel>
|
|
|
|
|
|
+ <importExcel v-auth="'user:Import'" api="api/system/user/">导入</importExcel>
|
|
</template>
|
|
</template>
|
|
</fs-crud>
|
|
</fs-crud>
|
|
</el-card>
|
|
</el-card>
|
|
@@ -41,15 +42,16 @@
|
|
</fs-page>
|
|
</fs-page>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
-<script lang="ts" setup name="user">
|
|
|
|
-import {useExpose, useCrud} from '@fast-crud/fast-crud';
|
|
|
|
-import {createCrudOptions} from './crud';
|
|
|
|
|
|
+<script lang="ts" name="user" setup>
|
|
|
|
+import { useExpose, useCrud } from '@fast-crud/fast-crud';
|
|
|
|
+import { createCrudOptions } from './crud';
|
|
import * as api from './api';
|
|
import * as api from './api';
|
|
-import {ElTree} from 'element-plus';
|
|
|
|
-import {ref, onMounted, watch, toRaw, h} from 'vue';
|
|
|
|
|
|
+import { ElTree } from 'element-plus';
|
|
|
|
+import { ref, onMounted, watch, toRaw, h } from 'vue';
|
|
import XEUtils from 'xe-utils';
|
|
import XEUtils from 'xe-utils';
|
|
-import {getElementLabelLine} from 'element-tree-line';
|
|
|
|
-import importExcel from '/@/components/importExcel/index.vue'
|
|
|
|
|
|
+import { getElementLabelLine } from 'element-tree-line';
|
|
|
|
+import importExcel from '/@/components/importExcel/index.vue';
|
|
|
|
+
|
|
|
|
|
|
const ElementTreeLine = getElementLabelLine(h);
|
|
const ElementTreeLine = getElementLabelLine(h);
|
|
|
|
|
|
@@ -74,7 +76,7 @@ const treeRef = ref<InstanceType<typeof ElTree>>();
|
|
const treeProps = {
|
|
const treeProps = {
|
|
children: 'children',
|
|
children: 'children',
|
|
label: 'name',
|
|
label: 'name',
|
|
- icon: 'icon',
|
|
|
|
|
|
+ icon: 'icon'
|
|
};
|
|
};
|
|
|
|
|
|
watch(filterText, (val) => {
|
|
watch(filterText, (val) => {
|
|
@@ -98,7 +100,7 @@ const getData = () => {
|
|
const result = XEUtils.toArrayTree(responseData, {
|
|
const result = XEUtils.toArrayTree(responseData, {
|
|
parentKey: 'parent',
|
|
parentKey: 'parent',
|
|
children: 'children',
|
|
children: 'children',
|
|
- strict: true,
|
|
|
|
|
|
+ strict: true
|
|
});
|
|
});
|
|
|
|
|
|
data.value = result;
|
|
data.value = result;
|
|
@@ -107,8 +109,8 @@ const getData = () => {
|
|
|
|
|
|
//树形点击事件
|
|
//树形点击事件
|
|
const onTreeNodeClick = (node: any) => {
|
|
const onTreeNodeClick = (node: any) => {
|
|
- const {id} = node;
|
|
|
|
- crudExpose.doSearch({form: {dept: id}});
|
|
|
|
|
|
+ const { id } = node;
|
|
|
|
+ crudExpose.doSearch({ form: { dept: id } });
|
|
};
|
|
};
|
|
|
|
|
|
// 页面打开后获取列表数据
|
|
// 页面打开后获取列表数据
|
|
@@ -121,11 +123,11 @@ const crudRef = ref();
|
|
// crud 配置的ref
|
|
// crud 配置的ref
|
|
const crudBinding = ref();
|
|
const crudBinding = ref();
|
|
// 暴露的方法
|
|
// 暴露的方法
|
|
-const {crudExpose} = useExpose({crudRef, crudBinding});
|
|
|
|
|
|
+const { crudExpose } = useExpose({ crudRef, crudBinding });
|
|
// 你的crud配置
|
|
// 你的crud配置
|
|
-const {crudOptions} = createCrudOptions({crudExpose});
|
|
|
|
|
|
+const { crudOptions } = createCrudOptions({ crudExpose });
|
|
// 初始化crud配置
|
|
// 初始化crud配置
|
|
-const {resetCrudOptions} = useCrud({crudExpose, crudOptions});
|
|
|
|
|
|
+const { resetCrudOptions } = useCrud({ crudExpose, crudOptions });
|
|
|
|
|
|
// 页面打开后获取列表数据
|
|
// 页面打开后获取列表数据
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -147,6 +149,6 @@ onMounted(() => {
|
|
}
|
|
}
|
|
|
|
|
|
.font-normal {
|
|
.font-normal {
|
|
- font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
|
|
|
|
|
|
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|