mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 06:02:38 +08:00
添加 useCool
This commit is contained in:
parent
ab623bf1f0
commit
db2a2d71c9
8
.vscode/crud.code-snippets
vendored
8
.vscode/crud.code-snippets
vendored
@ -33,15 +33,13 @@
|
||||
"</template>",
|
||||
"",
|
||||
"<script lang=\"ts\">",
|
||||
"import { defineComponent, inject, reactive } from \"vue\";",
|
||||
"import { defineComponent, reactive } from \"vue\";",
|
||||
"import { CrudLoad, Upsert, Table } from \"cl-admin-crud-vue3/types\";",
|
||||
"import { useRefs } from \"/@/core\";",
|
||||
"import { useCool } from \"/@/core\";",
|
||||
"",
|
||||
"export default defineComponent({",
|
||||
" setup() {",
|
||||
" const { refs, setRefs } = useRefs();",
|
||||
" // 请求服务",
|
||||
" const service = inject<any>(\"service\");",
|
||||
" const { refs, setRefs, service } = useCool();",
|
||||
"",
|
||||
" // 新增、编辑配置",
|
||||
" const upsert = reactive<Upsert>({",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "front-next",
|
||||
"version": "0.8.0",
|
||||
"version": "0.8.1",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
@ -11,7 +11,7 @@
|
||||
"dependencies": {
|
||||
"array.prototype.flat": "^1.2.4",
|
||||
"axios": "^0.21.1",
|
||||
"cl-admin-crud-vue3": "^0.9.3",
|
||||
"cl-admin-crud-vue3": "^0.9.6",
|
||||
"clipboard": "^2.0.8",
|
||||
"clone-deep": "^4.0.1",
|
||||
"codemirror": "^5.62.0",
|
||||
|
@ -21,7 +21,7 @@
|
||||
import { computed, defineComponent } from "vue";
|
||||
import { ElConfigProvider } from "element-plus";
|
||||
import zhCn from "element-plus/lib/locale/lang/zh-cn";
|
||||
import { useStore } from "vuex";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@ -29,7 +29,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const { store } = useCool();
|
||||
const locale = zhCn;
|
||||
const loading = computed(() => store.getters.appLoading);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import { deepTree } from "/@/core/utils";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { defineComponent, h, inject, ref } from "vue";
|
||||
import { defineComponent, h, ref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-dept-move",
|
||||
@ -9,8 +9,7 @@ export default defineComponent({
|
||||
emits: ["success", "error"],
|
||||
|
||||
setup(_: any, { emit }) {
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
const { refs, setRefs, service }: any = useCool();
|
||||
|
||||
// 树形列表
|
||||
const list = ref<any[]>([]);
|
||||
|
@ -64,7 +64,7 @@
|
||||
import { defineComponent, inject, onMounted, ref } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ContextMenu } from "cl-admin-crud-vue3";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import { deepTree, isArray, revDeepTree, isPc } from "/@/core/utils";
|
||||
|
||||
export default defineComponent({
|
||||
@ -84,7 +84,7 @@ export default defineComponent({
|
||||
emits: ["list-change", "row-click", "user-add"],
|
||||
|
||||
setup(props, { emit }) {
|
||||
const { refs, setRefs } = useRefs();
|
||||
const { refs, setRefs } = useCool();
|
||||
|
||||
// 树形列表
|
||||
const list = ref<any[]>([]);
|
||||
|
@ -16,7 +16,7 @@ import { computed, defineComponent, onMounted, ref, watch } from "vue";
|
||||
import Quill from "quill";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import { isNumber } from "/@/core/utils";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-editor-quill",
|
||||
@ -31,7 +31,7 @@ export default defineComponent({
|
||||
emits: ["update:modelValue", "load"],
|
||||
|
||||
setup(props, { emit }) {
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
const { refs, setRefs }: any = useCool();
|
||||
|
||||
let quill: any = null;
|
||||
|
||||
|
@ -1,15 +1,12 @@
|
||||
import { useStore } from "vuex";
|
||||
import { computed, defineComponent, h, ref, watch } from "vue";
|
||||
import "./index.scss";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-menu-slider",
|
||||
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const store = useStore();
|
||||
const { router, route, store } = useCool();
|
||||
|
||||
// 是否可见
|
||||
const visible = ref<boolean>(true);
|
||||
|
@ -16,22 +16,14 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, onMounted, ref } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { firstMenu } from "../../utils";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-menu-topbar",
|
||||
|
||||
setup() {
|
||||
// 缓存
|
||||
const store = useStore();
|
||||
|
||||
// 路由控制
|
||||
const router = useRouter();
|
||||
|
||||
// 当页路由
|
||||
const route = useRoute();
|
||||
const { store, router, route } = useCool();
|
||||
|
||||
// 选中标识
|
||||
const index = ref<string>("0");
|
||||
|
@ -32,20 +32,15 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, reactive, watch } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { last } from "/@/core/utils";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import { ContextMenu } from "cl-admin-crud-vue3";
|
||||
|
||||
export default {
|
||||
name: "cl-process",
|
||||
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const store = useStore();
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
const { refs, setRefs, store, route, router }: any = useCool();
|
||||
|
||||
// 参数配置
|
||||
const menu = reactive<any>({
|
||||
|
@ -17,17 +17,15 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref, watch } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useRoute } from "vue-router";
|
||||
import _ from "lodash";
|
||||
import { isEmpty } from "/@/core/utils";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-route-nav",
|
||||
|
||||
setup() {
|
||||
const route = useRoute();
|
||||
const store = useStore();
|
||||
const { store, route } = useCool();
|
||||
|
||||
// 数据列表
|
||||
const list = ref<any[]>([]);
|
||||
|
@ -33,10 +33,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { useStore } from "vuex";
|
||||
import { computed, defineComponent, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { href } from "/@/core/utils";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
@ -45,8 +44,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
const { store, router } = useCool();
|
||||
|
||||
const url = ref<string>("");
|
||||
const isLogout = ref<boolean>(false);
|
||||
|
@ -56,10 +56,8 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, reactive, ref } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useStore } from "vuex";
|
||||
import Captcha from "./components/captcha.vue";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
cool: {
|
||||
@ -73,9 +71,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const store = useStore();
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
const { refs, setRefs, store, router }: any = useCool();
|
||||
|
||||
const saving = ref<boolean>(false);
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
import { BaseService, Service, Permission } from "/@/core";
|
||||
|
||||
@Service("base/sys/department")
|
||||
@Service({
|
||||
namespace: "base/sys/department",
|
||||
proxy: "/dev"
|
||||
})
|
||||
class SysDepartment extends BaseService {
|
||||
@Permission("order")
|
||||
order(data: any) {
|
||||
|
@ -24,8 +24,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { ElMessage } from "element-plus";
|
||||
import { defineComponent, inject, reactive, ref } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { defineComponent, reactive, ref } from "vue";
|
||||
import { useCool } from "/@/core";
|
||||
import { cloneDeep } from "/@/core/utils";
|
||||
|
||||
export default defineComponent({
|
||||
@ -41,8 +41,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const service = inject<any>("service");
|
||||
const { store, service } = useCool();
|
||||
|
||||
// 表单数据
|
||||
const form = reactive<any>(cloneDeep(store.getters.userInfo));
|
||||
|
@ -39,17 +39,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, inject, reactive, ref } from "vue";
|
||||
import { defineComponent, reactive, ref } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import { CrudLoad, Table } from "cl-admin-crud-vue3/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-log",
|
||||
|
||||
setup() {
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
const { refs, setRefs, service }: any = useCool();
|
||||
|
||||
// 天数
|
||||
const day = ref<number>(1);
|
||||
|
@ -77,19 +77,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import { deepTree } from "/@/core/utils";
|
||||
import { useRouter } from "vue-router";
|
||||
import { defineComponent, inject, reactive } from "vue";
|
||||
import { defineComponent, reactive } from "vue";
|
||||
import { CrudLoad, Table, Upsert, RefreshOp } from "cl-admin-crud-vue3/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-menu",
|
||||
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const { refs, setRefs } = useRefs();
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs, service, router } = useCool();
|
||||
|
||||
// crud 加载
|
||||
function onLoad({ ctx, app }: CrudLoad) {
|
||||
|
@ -35,16 +35,15 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { defineComponent, inject, nextTick, reactive } from "vue";
|
||||
import { useRefs } from "/@/core";
|
||||
import { defineComponent, nextTick, reactive } from "vue";
|
||||
import { useCool } from "/@/core";
|
||||
import { CrudLoad, Table, Upsert } from "cl-admin-crud-vue3/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-param",
|
||||
|
||||
setup() {
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs } = useRefs();
|
||||
const { refs, setRefs, service } = useCool();
|
||||
|
||||
// 选项卡
|
||||
const tab = reactive<any>({
|
||||
|
@ -48,17 +48,16 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { ElMessage } from "element-plus";
|
||||
import { defineComponent, inject, reactive } from "vue";
|
||||
import { defineComponent, reactive } from "vue";
|
||||
import { checkPerm } from "/$/base";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import { CrudLoad, RefreshOp, Table } from "cl-admin-crud-vue3/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "plugin",
|
||||
|
||||
setup() {
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs } = useRefs();
|
||||
const { refs, setRefs, service } = useCool();
|
||||
|
||||
// 编辑权限
|
||||
const { config, getConfig, enable } = service.base.plugin.info.permission;
|
||||
|
@ -102,18 +102,15 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, inject, reactive, ref, watch } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useRefs } from "/@/core";
|
||||
import { computed, defineComponent, reactive, ref, watch } from "vue";
|
||||
import { useCool } from "/@/core";
|
||||
import { Table, Upsert } from "cl-admin-crud-vue3/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-user",
|
||||
|
||||
setup() {
|
||||
const service = inject<any>("service");
|
||||
const store = useStore();
|
||||
const { refs, setRefs } = useRefs();
|
||||
const { refs, setRefs, store, service } = useCool();
|
||||
|
||||
// 是否展开
|
||||
const isExpand = ref<boolean>(true);
|
||||
|
@ -45,8 +45,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, h, inject, onUnmounted, provide, ref } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { computed, defineComponent, h, onUnmounted, provide, ref } from "vue";
|
||||
import { ElNotification } from "element-plus";
|
||||
import dayjs from "dayjs";
|
||||
// import io from "socket.io-client";
|
||||
@ -55,7 +54,7 @@ import Session from "./session.vue";
|
||||
import Message from "./message.vue";
|
||||
import Input from "./input.vue";
|
||||
import { parseContent } from "../utils";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import NotifyMp3 from "../static/notify.mp3";
|
||||
|
||||
export default defineComponent({
|
||||
@ -81,10 +80,7 @@ export default defineComponent({
|
||||
emits: ["message"],
|
||||
|
||||
setup(_, { emit }) {
|
||||
const store = useStore();
|
||||
const { refs, setRefs } = useRefs();
|
||||
const service = inject<any>("service");
|
||||
const mitt = inject<any>("mitt");
|
||||
const { refs, setRefs, service, mitt, store } = useCool();
|
||||
|
||||
// 当前会话
|
||||
const session = computed(() => store.getters.session);
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
// 表情列表
|
||||
const emoji = {
|
||||
@ -130,7 +130,7 @@ export default defineComponent({
|
||||
emits: ["select"],
|
||||
|
||||
setup(_, { emit }) {
|
||||
const store = useStore();
|
||||
const { store } = useCool();
|
||||
|
||||
// 是否可见
|
||||
const visible = ref<boolean>(false);
|
||||
|
@ -42,9 +42,9 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, inject, nextTick, reactive, ref } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import Emoji from "./emoji.vue";
|
||||
import Upload from "./upload.vue";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@ -53,9 +53,10 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const { store, mitt } = useCool();
|
||||
|
||||
// 聊天信息
|
||||
const chat = inject<any>("chat");
|
||||
const mitt = inject<any>("mitt");
|
||||
|
||||
// 输入值
|
||||
const text = ref<string>("");
|
||||
|
@ -113,9 +113,8 @@
|
||||
import { computed, defineComponent, inject, nextTick, onUnmounted, reactive, ref } from "vue";
|
||||
import dayjs from "dayjs";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useStore } from "vuex";
|
||||
import { isString } from "/@/core/utils";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import IconVoice from "./icon-voice.vue";
|
||||
|
||||
import AvatarUrl from "../static/images/custom-avatar.png";
|
||||
@ -126,11 +125,10 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const { refs, setRefs } = useRefs();
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs, service, store, mitt } = useCool();
|
||||
|
||||
// 聊天信息
|
||||
const chat = inject<any>("chat");
|
||||
const mitt = inject<any>("mitt");
|
||||
|
||||
// 当前会话信息
|
||||
const session = computed(() => store.getters.session);
|
||||
|
@ -10,15 +10,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, inject, onBeforeMount, ref } from "vue-demi";
|
||||
import { useRefs } from "/@/core";
|
||||
import { defineComponent, onBeforeMount, ref } from "vue-demi";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-chat-notice",
|
||||
|
||||
setup() {
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs } = useRefs();
|
||||
const { refs, setRefs, service } = useCool();
|
||||
|
||||
const number = ref<number>(0);
|
||||
|
||||
|
@ -53,18 +53,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, inject, onUnmounted, reactive, ref } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { computed, defineComponent, onUnmounted, reactive, ref } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { isEmpty } from "/@/core/utils";
|
||||
import { ContextMenu } from "cl-admin-crud-vue3";
|
||||
import { parseContent } from "../utils";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const service = inject<any>("service");
|
||||
const mitt = inject<any>("mitt");
|
||||
const { store, service, mitt } = useCool();
|
||||
|
||||
// 当前会话信息
|
||||
const session = computed(() => store.getters.session);
|
||||
|
@ -11,9 +11,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ElFile } from "element-plus/lib/el-upload/src/upload.type";
|
||||
import { defineComponent, inject } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
@ -24,11 +23,13 @@ export default defineComponent({
|
||||
emits: ["before-upload", "success"],
|
||||
|
||||
setup(props, { emit }) {
|
||||
const store = useStore();
|
||||
const { store } = useCool();
|
||||
|
||||
// 聊天信息
|
||||
const chat = inject<any>("chat");
|
||||
|
||||
// 上传前
|
||||
function onBeforeUpload(file: ElFile) {
|
||||
function onBeforeUpload(file: any) {
|
||||
// 先添加到列表中,等待上传
|
||||
function next(options = {}) {
|
||||
const data = {
|
||||
|
@ -7,12 +7,12 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, ref } from "vue";
|
||||
import { TableColumn } from "cl-admin-crud-vue3/types";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
import Test2 from "./render/test2";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const { refs, setRefs } = useRefs();
|
||||
const { refs, setRefs } = useCool();
|
||||
|
||||
const columns = ref<TableColumn[]>([
|
||||
{
|
||||
|
@ -214,13 +214,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, inject, onMounted, reactive } from "vue";
|
||||
import { computed, defineComponent, onMounted, reactive } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import Draggable from "vuedraggable/src/vuedraggable";
|
||||
import { checkPerm } from "/$/base";
|
||||
import { ContextMenu } from "cl-admin-crud-vue3";
|
||||
import Cron from "../components/cron";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "task",
|
||||
@ -231,8 +231,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup() {
|
||||
const { refs, setRefs } = useRefs();
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs, service } = useCool();
|
||||
|
||||
// 任务列表
|
||||
const list = reactive<any[]>([
|
||||
|
@ -35,10 +35,9 @@
|
||||
<script lang="ts">
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { computed, defineComponent, inject, ref, watch } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { isEmpty } from "/@/core/utils";
|
||||
import { ContextMenu } from "cl-admin-crud-vue3";
|
||||
import { useRefs } from "/@/core";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-upload-space-category",
|
||||
@ -50,9 +49,8 @@ export default defineComponent({
|
||||
emits: ["update:modelValue", "change"],
|
||||
|
||||
setup(_, { emit }) {
|
||||
const store = useStore();
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
const service: any = inject("service");
|
||||
const { refs, setRefs, service, store }: any = useCool();
|
||||
|
||||
const space = inject<any>("space");
|
||||
|
||||
// 数据列表
|
||||
|
@ -138,13 +138,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, inject, provide, reactive, ref, watch } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { computed, defineComponent, provide, reactive, ref, watch } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ElFile } from "element-plus/lib/el-upload/src/upload.type";
|
||||
import { isEmpty } from "/@/core/utils";
|
||||
import Category from "./category.vue";
|
||||
import FileItem from "./file-item.vue";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-upload-space",
|
||||
@ -191,8 +190,7 @@ export default defineComponent({
|
||||
emits: ["update:modelValue", "confirm"],
|
||||
|
||||
setup(props, { emit }) {
|
||||
const store = useStore();
|
||||
const service = inject<any>("service");
|
||||
const { store, service } = useCool();
|
||||
|
||||
// 是否可见
|
||||
const visible = ref<boolean>(false);
|
||||
@ -262,7 +260,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
// 上传成功
|
||||
function onSuccess(res: any, file: ElFile) {
|
||||
function onSuccess(res: any, file: any) {
|
||||
const item = list.value.find((e: any) => file.uid == e.uid);
|
||||
|
||||
if (item) {
|
||||
|
@ -5,11 +5,11 @@ import { useModule } from "./module";
|
||||
import router from "/@/router";
|
||||
import store from "/@/store";
|
||||
|
||||
const services = useService();
|
||||
const service = useService();
|
||||
|
||||
async function bootstrap(app: any) {
|
||||
app.config.globalProperties.service = store.service = services;
|
||||
app.provide("service", services);
|
||||
app.config.globalProperties.service = store.service = service;
|
||||
app.provide("service", service);
|
||||
|
||||
useRouter();
|
||||
useModule(app);
|
||||
@ -34,8 +34,8 @@ function usePermission(list: any[]) {
|
||||
}
|
||||
}
|
||||
|
||||
deep(services);
|
||||
deep(service);
|
||||
}
|
||||
|
||||
export { Service, Permission, BaseService, services, bootstrap, usePermission };
|
||||
export { Service, Permission, BaseService, service, bootstrap, usePermission };
|
||||
export * from "./hook";
|
||||
|
@ -30,9 +30,9 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import Topbar from "./topbar.vue";
|
||||
import Slider from "./slider.vue";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@ -41,7 +41,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const { store } = useCool();
|
||||
|
||||
// 菜单是否折叠
|
||||
const menuCollapse = computed<boolean>(() => store.getters.menuCollapse);
|
||||
|
@ -13,12 +13,12 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import Logo from "/@/assets/icon/logo/silder-simple.png";
|
||||
import { useCool } from "/@/core";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const { store } = useCool();
|
||||
|
||||
// 菜单是否展开
|
||||
const menuCollapse = computed<any>(() => store.getters.menuCollapse);
|
||||
|
@ -50,14 +50,12 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useStore } from "vuex";
|
||||
import { useCool } from "/@/core";
|
||||
import { href } from "/@/core/utils";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
const { store, router } = useCool();
|
||||
|
||||
// 菜单是否展开
|
||||
const menuCollapse = computed<any>(() => store.getters.menuCollapse);
|
||||
|
@ -1122,10 +1122,10 @@ change-case@^4.1.2:
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
cl-admin-crud-vue3@^0.9.3:
|
||||
version "0.9.3"
|
||||
resolved "https://registry.npmmirror.com/cl-admin-crud-vue3/download/cl-admin-crud-vue3-0.9.3.tgz#9594238d445e93eea8e1c2d1f849e8de6c687ac2"
|
||||
integrity sha1-lZQjjURek+6o4cLR+Eno3mxoesI=
|
||||
cl-admin-crud-vue3@^0.9.6:
|
||||
version "0.9.6"
|
||||
resolved "https://registry.yarnpkg.com/cl-admin-crud-vue3/-/cl-admin-crud-vue3-0.9.6.tgz#735034dd8ec2d38022a77aac695f9553483863d2"
|
||||
integrity sha512-3t2Q0h9BK9jqsboJy3aFYGhwNZREy6HQzCpuIUeVGnxHYT+1TOiTyDmQx8svIS1mL5VrJXNmwO8mzVZFQcOXjQ==
|
||||
dependencies:
|
||||
array.prototype.flat "^1.2.4"
|
||||
core-js "^3.6.5"
|
||||
|
Loading…
Reference in New Issue
Block a user