mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
更新依赖
This commit is contained in:
parent
23505b9c65
commit
afdb674824
@ -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",
|
||||
|
@ -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";
|
||||
|
@ -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
|
||||
};
|
||||
}
|
||||
});
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
.el-menu {
|
||||
border-right: 0;
|
||||
background-color: transparent;
|
||||
|
||||
.el-sub-menu__title,
|
||||
&-item {
|
||||
|
@ -264,6 +264,7 @@ export default {
|
||||
|
||||
&__body {
|
||||
height: calc(100% - 63px);
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
1
src/core/hook/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from "./core";
|
@ -39,3 +39,4 @@ function usePermission(list: any[]) {
|
||||
}
|
||||
|
||||
export { Service, Permission, BaseService, services, bootstrap, useRefs, usePermission };
|
||||
export * from "./hook";
|
||||
|
4001
yarn-error.log
4001
yarn-error.log
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user