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",
|
"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",
|
||||||
|
@ -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";
|
||||||
|
@ -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
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -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 {
|
||||||
|
@ -264,6 +264,7 @@ export default {
|
|||||||
|
|
||||||
&__body {
|
&__body {
|
||||||
height: calc(100% - 63px);
|
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() {
|
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
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 { 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