更新依赖

This commit is contained in:
icssoa 2021-09-27 14:25:49 +08:00
parent 23505b9c65
commit afdb674824
10 changed files with 891 additions and 4935 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "front-next", "name": "front-next",
"version": "0.7.3", "version": "0.7.5",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
@ -11,13 +11,13 @@
"dependencies": { "dependencies": {
"array.prototype.flat": "^1.2.4", "array.prototype.flat": "^1.2.4",
"axios": "^0.21.1", "axios": "^0.21.1",
"cl-admin-crud-vue3": "^0.8.2", "cl-admin-crud-vue3": "^0.9.2",
"clipboard": "^2.0.8", "clipboard": "^2.0.8",
"clone-deep": "^4.0.1", "clone-deep": "^4.0.1",
"codemirror": "^5.62.0", "codemirror": "^5.62.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"echarts": "^5.0.2", "echarts": "^5.0.2",
"element-plus": "^1.1.0-beta.6", "element-plus": "^1.1.0-beta.16",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"glob": "^7.1.6", "glob": "^7.1.6",
"js-beautify": "^1.13.5", "js-beautify": "^1.13.5",

View File

@ -7,7 +7,7 @@ $--color-info: $color-info;
$--font-path: "element-plus/dist/fonts"; $--font-path: "element-plus/dist/fonts";
// 动态主题色开发时可注释会影响页面加载速度 // 动态主题色开发时可注释会影响页面加载速度
// @import "element-plus/packages/theme-chalk/src/index"; @import "element-plus/packages/theme-chalk/src/index";
// 默认主题色 // 默认主题色
@import "element-plus/dist/index.css"; // @import "element-plus/dist/index.css";

View File

@ -14,7 +14,7 @@
<div v-if="visible" class="cl-dept-check__tree"> <div v-if="visible" class="cl-dept-check__tree">
<el-tree <el-tree
ref="treeRef" :ref="setRefs('tree')"
highlight-current highlight-current
node-key="id" node-key="id"
show-checkbox show-checkbox
@ -36,6 +36,7 @@
import { deepTree } from "/@/core/utils"; import { deepTree } from "/@/core/utils";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { defineComponent, inject, nextTick, onMounted, ref, watch } from "vue"; import { defineComponent, inject, nextTick, onMounted, ref, watch } from "vue";
import { useCool } from "/@/core";
export default defineComponent({ export default defineComponent({
name: "cl-dept-check", name: "cl-dept-check",
@ -51,8 +52,7 @@ export default defineComponent({
emits: ["update:modelValue"], emits: ["update:modelValue"],
setup(props, { emit }) { setup(props, { emit }) {
// const { service, refs, setRefs } = useCool();
const service = inject<any>("service");
// //
const form = inject<any>("form"); const form = inject<any>("form");
@ -70,9 +70,7 @@ export default defineComponent({
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
// //
const visible = ref<boolean>(false); const visible = ref<boolean>(true);
const treeRef = ref<any>({});
// //
function refreshTree(val: any[]) { function refreshTree(val: any[]) {
@ -111,12 +109,12 @@ export default defineComponent({
// //
function onCheckChange() { function onCheckChange() {
emit("update:modelValue", treeRef.value.getCheckedKeys()); emit("update:modelValue", refs.value.tree.getCheckedKeys());
} }
// //
watch(keyword, (val: string) => { watch(keyword, (val: string) => {
treeRef.value.filter(val); refs.value.tree.filter(val);
}); });
// //
@ -132,6 +130,8 @@ export default defineComponent({
}); });
return { return {
refs,
setRefs,
form, form,
list, list,
checked, checked,
@ -141,8 +141,7 @@ export default defineComponent({
refresh, refresh,
filterNode, filterNode,
onCheckStrictlyChange, onCheckStrictlyChange,
onCheckChange, onCheckChange
treeRef
}; };
} }
}); });

View File

@ -9,6 +9,7 @@
.el-menu { .el-menu {
border-right: 0; border-right: 0;
background-color: transparent;
.el-sub-menu__title, .el-sub-menu__title,
&-item { &-item {

View File

@ -264,6 +264,7 @@ export default {
&__body { &__body {
height: calc(100% - 63px); height: calc(100% - 63px);
padding: 0 5px;
} }
} }

View File

@ -1,4 +1,6 @@
import { onBeforeUpdate, ref } from "vue"; import { onBeforeUpdate, ref, inject } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useStore } from "vuex";
export function useRefs() { export function useRefs() {
const refs: any = ref<any[]>([]); const refs: any = ref<any[]>([]);
@ -13,3 +15,22 @@ export function useRefs() {
return { refs, setRefs }; return { refs, setRefs };
} }
export function useCool() {
const { refs, setRefs } = useRefs();
const service = inject<any>("service");
const mitt = inject<any>("mitt");
const store = useStore();
const route = useRoute();
const router = useRouter();
return {
store,
route,
router,
refs,
setRefs,
service,
mitt
};
}

1
src/core/hook/index.ts Normal file
View File

@ -0,0 +1 @@
export * from "./core";

View File

@ -39,3 +39,4 @@ function usePermission(list: any[]) {
} }
export { Service, Permission, BaseService, services, bootstrap, useRefs, usePermission }; export { Service, Permission, BaseService, services, bootstrap, useRefs, usePermission };
export * from "./hook";

File diff suppressed because it is too large Load Diff

1769
yarn.lock

File diff suppressed because it is too large Load Diff