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