更新依赖

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

View File

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

View File

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

View File

@ -264,6 +264,7 @@ export default {
&__body {
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() {
const refs: any = ref<any[]>([]);
@ -13,3 +15,22 @@ export function useRefs() {
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 * 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