mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 06:02:38 +08:00
解决 vite 打包异常问题
This commit is contained in:
parent
13b2788a84
commit
d2b249f9ea
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "front-next",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit --skipLibCheck && vite build",
|
||||
@ -17,6 +17,7 @@
|
||||
"core-js": "^3.6.5",
|
||||
"echarts": "^5.0.2",
|
||||
"element-plus": "1.0.2-beta.35",
|
||||
"glob": "^7.1.6",
|
||||
"js-beautify": "^1.13.5",
|
||||
"lodash": "^4.17.21",
|
||||
"merge": "^2.1.1",
|
||||
@ -27,7 +28,7 @@
|
||||
"socket.io-client": "^4.0.0",
|
||||
"store": "^2.0.12",
|
||||
"uuid": "^8.3.2",
|
||||
"vue": "^3.0.9",
|
||||
"vue": "^3.0.11",
|
||||
"vue-echarts": "^6.0.0-rc.3",
|
||||
"vue-router": "^4.0.5",
|
||||
"vuedraggable": "^4.0.1",
|
||||
@ -39,7 +40,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^4.20.0",
|
||||
"@typescript-eslint/parser": "^4.20.0",
|
||||
"@vitejs/plugin-vue": "^1.1.5",
|
||||
"@vitejs/plugin-vue-jsx": "^1.1.2",
|
||||
"@vitejs/plugin-vue-jsx": "^1.1.3",
|
||||
"@vue/compiler-sfc": "^3.0.5",
|
||||
"eslint": "^7.23.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
@ -50,7 +51,8 @@
|
||||
"sass-loader": "^11.0.1",
|
||||
"svg-sprite-loader": "^6.0.2",
|
||||
"typescript": "^4.1.3",
|
||||
"vite": "^2.1.3",
|
||||
"vite": "^2.1.5",
|
||||
"vite-plugin-style-import": "^0.9.1",
|
||||
"vite-svg-loader": "^1.5.1",
|
||||
"vue-tsc": "^0.0.8"
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
import Crud from "../crud";
|
||||
|
||||
export default {
|
||||
modules: [
|
||||
// 基础模块
|
||||
@ -14,7 +12,6 @@ export default {
|
||||
},
|
||||
{
|
||||
name: "crud",
|
||||
value: Crud,
|
||||
options: {
|
||||
crud: {
|
||||
dict: {
|
||||
|
@ -52,7 +52,7 @@ export default defineComponent({
|
||||
|
||||
setup(props, { emit }) {
|
||||
// 请求服务
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 表单值
|
||||
const form = inject<any>("form");
|
||||
@ -81,7 +81,7 @@ export default defineComponent({
|
||||
|
||||
// 刷新树形列表
|
||||
function refresh() {
|
||||
$service.system.dept
|
||||
service.system.dept
|
||||
.list()
|
||||
.then((res: any[]) => {
|
||||
list.value = deepTree(res);
|
||||
|
@ -9,7 +9,7 @@ export default defineComponent({
|
||||
emits: ["success", "error"],
|
||||
|
||||
setup(_: any, { emit }) {
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
|
||||
// 树形列表
|
||||
@ -17,7 +17,7 @@ export default defineComponent({
|
||||
|
||||
// 刷新列表
|
||||
async function refresh() {
|
||||
return await $service.system.dept.list().then(deepTree);
|
||||
return await service.system.dept.list().then(deepTree);
|
||||
}
|
||||
|
||||
// 转移
|
||||
@ -52,7 +52,7 @@ export default defineComponent({
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
$service.system.user
|
||||
service.system.user
|
||||
.move({
|
||||
departmentId: id,
|
||||
userIds: ids
|
||||
|
@ -63,7 +63,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, inject, onMounted, ref } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ContextMenu } from "/@/crud";
|
||||
import { ContextMenu } from "/@/cool/modules/crud";
|
||||
import { useRefs } from "/@/core";
|
||||
import { deepTree, isArray, revDeepTree, isPc } from "/@/core/utils";
|
||||
|
||||
@ -96,7 +96,7 @@ export default defineComponent({
|
||||
const isDrag = ref<boolean>(false);
|
||||
|
||||
// 请求服务
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 允许托的规则
|
||||
function allowDrag({ data }: any) {
|
||||
@ -109,19 +109,16 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
// 刷新
|
||||
function refresh() {
|
||||
async function refresh() {
|
||||
isDrag.value = false;
|
||||
loading.value = true;
|
||||
|
||||
$service.system.dept
|
||||
.list()
|
||||
.then((res: any[]) => {
|
||||
list.value = deepTree(res);
|
||||
emit("list-change", list.value);
|
||||
})
|
||||
.done(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
await service.system.dept.list().then((res: any[]) => {
|
||||
list.value = deepTree(res);
|
||||
emit("list-change", list.value);
|
||||
});
|
||||
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
// 获取 ids
|
||||
@ -185,7 +182,7 @@ export default defineComponent({
|
||||
],
|
||||
on: {
|
||||
submit: (data: any, { done, close }: any) => {
|
||||
$service.system.dept[method]({
|
||||
service.system.dept[method]({
|
||||
id: e.id,
|
||||
parentId: e.parentId,
|
||||
name: data.name,
|
||||
@ -207,8 +204,8 @@ export default defineComponent({
|
||||
|
||||
// 删除部门
|
||||
function rowDel(e: any) {
|
||||
const del = (f: boolean) => {
|
||||
$service.system.dept
|
||||
const del = async (f: boolean) => {
|
||||
await service.system.dept
|
||||
.delete({
|
||||
ids: [e.id],
|
||||
deleteUser: f
|
||||
@ -222,10 +219,9 @@ export default defineComponent({
|
||||
"删除成功"
|
||||
);
|
||||
}
|
||||
})
|
||||
.done(() => {
|
||||
refresh();
|
||||
});
|
||||
|
||||
refresh();
|
||||
};
|
||||
|
||||
ElMessageBox.confirm(`该操作会删除 “${e.name}” 部门的所有用户,是否确认?`, "提示", {
|
||||
@ -250,7 +246,7 @@ export default defineComponent({
|
||||
ElMessageBox.confirm("部门架构已发生改变,是否保存?", "提示", {
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
const ids: any[] = [];
|
||||
|
||||
const deep = (list: any[], pid: any) => {
|
||||
@ -266,7 +262,7 @@ export default defineComponent({
|
||||
|
||||
deep(list.value, null);
|
||||
|
||||
$service.system.dept
|
||||
await service.system.dept
|
||||
.order(
|
||||
ids.map((e, i) => {
|
||||
return {
|
||||
@ -281,11 +277,10 @@ export default defineComponent({
|
||||
})
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
})
|
||||
.done(() => {
|
||||
refresh();
|
||||
isDrag.value = false;
|
||||
});
|
||||
|
||||
refresh();
|
||||
isDrag.value = false;
|
||||
})
|
||||
.catch(() => null);
|
||||
} else {
|
||||
|
@ -28,7 +28,7 @@ export default defineComponent({
|
||||
emits: ["update:modelValue"],
|
||||
|
||||
setup(props, { emit }) {
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 绑定值
|
||||
const value = ref<any[]>([]);
|
||||
@ -58,7 +58,7 @@ export default defineComponent({
|
||||
}
|
||||
};
|
||||
|
||||
flat($service);
|
||||
flat(service);
|
||||
|
||||
perms
|
||||
.filter((e) => e.includes(":"))
|
||||
|
@ -49,7 +49,7 @@ export default defineComponent({
|
||||
|
||||
setup(props, { emit }) {
|
||||
// 请求服务
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 关键字
|
||||
const keyword = ref<string>("");
|
||||
@ -70,7 +70,7 @@ export default defineComponent({
|
||||
|
||||
// 刷新列表
|
||||
function refresh() {
|
||||
$service.system.menu.list().then((res: any) => {
|
||||
service.system.menu.list().then((res: any) => {
|
||||
const _list = res.filter((e: any) => e.type != 2);
|
||||
|
||||
_list.unshift({
|
||||
|
@ -36,7 +36,7 @@ import { useStore } from "vuex";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { last } from "/@/core/utils";
|
||||
import { useRefs } from "/@/core";
|
||||
import { ContextMenu } from "/@/crud";
|
||||
import { ContextMenu } from "/@/cool/modules/crud";
|
||||
|
||||
export default {
|
||||
name: "cl-process",
|
||||
|
@ -42,7 +42,7 @@ export default defineComponent({
|
||||
emits: ["update:modelValue"],
|
||||
|
||||
setup(props, { emit }) {
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 树形列表
|
||||
const list = ref<any[]>([]);
|
||||
@ -85,7 +85,7 @@ export default defineComponent({
|
||||
|
||||
// 刷新列表
|
||||
function refresh() {
|
||||
$service.system.menu
|
||||
service.system.menu
|
||||
.list()
|
||||
.then((res: any[]) => {
|
||||
list.value = deepTree(res);
|
||||
|
@ -20,7 +20,7 @@ export default defineComponent({
|
||||
|
||||
setup(props, { emit }) {
|
||||
// 请求服务
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 数据列表
|
||||
const list = ref<any[]>([]);
|
||||
@ -45,7 +45,7 @@ export default defineComponent({
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
list.value = await $service.system.role.list();
|
||||
list.value = await service.system.role.list();
|
||||
});
|
||||
|
||||
return {
|
||||
|
@ -62,12 +62,10 @@ export default defineComponent({
|
||||
router.push("/login");
|
||||
}
|
||||
|
||||
function reLogin() {
|
||||
async function reLogin() {
|
||||
isLogout.value = true;
|
||||
|
||||
store.dispatch("userLogout").done(() => {
|
||||
href("/login");
|
||||
});
|
||||
await store.dispatch("userLogout");
|
||||
href("/login");
|
||||
}
|
||||
|
||||
function back() {
|
||||
|
@ -15,10 +15,10 @@ export default defineComponent({
|
||||
setup(_, { emit }) {
|
||||
const base64 = ref("");
|
||||
const svg = ref("");
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
const refresh = () => {
|
||||
$service.open
|
||||
service.open
|
||||
.captcha({
|
||||
height: 36,
|
||||
width: 110
|
||||
|
@ -85,7 +85,7 @@ const actions = {
|
||||
|
||||
// 监测自定义菜单
|
||||
if (!getters.app.conf.customMenu) {
|
||||
store.$service.common
|
||||
store.service.common
|
||||
.permMenu()
|
||||
.then((res: any) => {
|
||||
next(res);
|
||||
|
@ -17,26 +17,21 @@ const getters = {
|
||||
const actions = {
|
||||
// 用户登录
|
||||
userLogin({ commit }: any, form: any): Promise<any> {
|
||||
return store.$service.open.userLogin(form).then((res: Token) => {
|
||||
return store.service.open.userLogin(form).then((res: Token) => {
|
||||
commit("SET_TOKEN", res);
|
||||
return res;
|
||||
});
|
||||
},
|
||||
|
||||
// 用户退出
|
||||
userLogout({ dispatch }: any): Promise<any> {
|
||||
return new Promise((resolve) => {
|
||||
store.$service.common.userLogout().done(() => {
|
||||
dispatch("userRemove").then(() => {
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
});
|
||||
async userLogout({ dispatch }: any): Promise<any> {
|
||||
await store.service.common.userLogout();
|
||||
return dispatch("userRemove");
|
||||
},
|
||||
|
||||
// 用户信息
|
||||
userInfo({ commit }: any): Promise<any> {
|
||||
return store.$service.common.userInfo().then((res: any) => {
|
||||
return store.service.common.userInfo().then((res: any) => {
|
||||
commit("SET_USERINFO", res);
|
||||
return res;
|
||||
});
|
||||
@ -55,7 +50,7 @@ const actions = {
|
||||
// 刷新token
|
||||
refreshToken({ commit, dispatch }: any) {
|
||||
return new Promise((resolve, reject) => {
|
||||
store.$service.open
|
||||
store.service.open
|
||||
.refreshToken(storage.get("refreshToken"))
|
||||
.then((res: any) => {
|
||||
commit("SET_TOKEN", res);
|
||||
|
@ -32,7 +32,7 @@ export default defineComponent({
|
||||
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 表单数据
|
||||
const form = reactive<any>(store.getters.userInfo);
|
||||
@ -41,12 +41,12 @@ export default defineComponent({
|
||||
const saving = ref<boolean>(false);
|
||||
|
||||
// 保存
|
||||
function save() {
|
||||
async function save() {
|
||||
const { headImg, nickName, password } = form;
|
||||
|
||||
saving.value = true;
|
||||
|
||||
$service.common
|
||||
await service.common
|
||||
.userUpdate({
|
||||
headImg,
|
||||
nickName,
|
||||
@ -59,10 +59,9 @@ export default defineComponent({
|
||||
})
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
})
|
||||
.done(() => {
|
||||
saving.value = false;
|
||||
});
|
||||
|
||||
saving.value = false;
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -4,7 +4,7 @@
|
||||
<cl-refresh-btn />
|
||||
|
||||
<el-button
|
||||
v-permission="$service.system.log.permission.clear"
|
||||
v-permission="service.system.log.permission.clear"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="clear"
|
||||
@ -42,13 +42,13 @@
|
||||
import { defineComponent, inject, reactive, ref } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { useRefs } from "/@/core";
|
||||
import { CrudLoad, Table } from "/@/crud/types";
|
||||
import { CrudLoad, Table } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-log",
|
||||
|
||||
setup() {
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
|
||||
// 天数
|
||||
@ -112,13 +112,13 @@ export default defineComponent({
|
||||
|
||||
// crud 加载
|
||||
function onLoad({ ctx, app }: CrudLoad) {
|
||||
ctx.service($service.system.log).done();
|
||||
ctx.service(service.system.log).done();
|
||||
app.refresh();
|
||||
}
|
||||
|
||||
// 保存天数
|
||||
function saveDay() {
|
||||
$service.system.log.setKeep(day.value).then(() => {
|
||||
service.system.log.setKeep(day.value).then(() => {
|
||||
ElMessage.success("保存成功");
|
||||
});
|
||||
}
|
||||
@ -129,7 +129,7 @@ export default defineComponent({
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
$service.system.log
|
||||
service.system.log
|
||||
.clear()
|
||||
.then(() => {
|
||||
ElMessage.success("清空成功");
|
||||
@ -143,12 +143,12 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
// 获取天数
|
||||
$service.system.log.getKeep().then((res: number) => {
|
||||
service.system.log.getKeep().then((res: number) => {
|
||||
day.value = Number(res);
|
||||
});
|
||||
|
||||
return {
|
||||
$service,
|
||||
service,
|
||||
refs,
|
||||
day,
|
||||
table,
|
||||
|
@ -81,7 +81,7 @@ import { useRefs } from "/@/core";
|
||||
import { deepTree } from "/@/core/utils";
|
||||
import { useRouter } from "vue-router";
|
||||
import { defineComponent, inject, reactive } from "vue";
|
||||
import { CrudLoad, Table, Upsert, RefreshOp } from "/@/crud/types";
|
||||
import { CrudLoad, Table, Upsert, RefreshOp } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-menu",
|
||||
@ -89,17 +89,17 @@ export default defineComponent({
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const { refs, setRefs } = useRefs();
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// crud 加载
|
||||
function onLoad({ ctx, app }: CrudLoad) {
|
||||
ctx.service($service.system.menu).done();
|
||||
ctx.service(service.system.menu).done();
|
||||
app.refresh();
|
||||
}
|
||||
|
||||
// 刷新监听
|
||||
function onRefresh(_: any, { render }: RefreshOp) {
|
||||
$service.system.menu.list().then((list: any[]) => {
|
||||
service.system.menu.list().then((list: any[]) => {
|
||||
list.map((e) => {
|
||||
e.permList = e.perms ? e.perms.split(",") : [];
|
||||
});
|
||||
|
@ -37,13 +37,13 @@
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { defineComponent, inject, nextTick, reactive } from "vue";
|
||||
import { useRefs } from "/@/core";
|
||||
import { CrudLoad, Table, Upsert } from "/@/crud/types";
|
||||
import { CrudLoad, Table, Upsert } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-param",
|
||||
|
||||
setup() {
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs } = useRefs();
|
||||
|
||||
// 选项卡
|
||||
@ -159,7 +159,7 @@ export default defineComponent({
|
||||
|
||||
// crud 加载
|
||||
function onLoad({ ctx, app }: CrudLoad) {
|
||||
ctx.service($service.system.param).done();
|
||||
ctx.service(service.system.param).done();
|
||||
app.refresh();
|
||||
}
|
||||
|
||||
|
@ -51,17 +51,17 @@ import { ElMessage } from "element-plus";
|
||||
import { defineComponent, inject, reactive } from "vue";
|
||||
import { checkPerm } from "/@/cool/modules/base";
|
||||
import { useRefs } from "/@/core";
|
||||
import { CrudLoad, RefreshOp, Table } from "/@/crud/types";
|
||||
import { CrudLoad, RefreshOp, Table } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "plugin",
|
||||
|
||||
setup() {
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
const { refs, setRefs } = useRefs();
|
||||
|
||||
// 编辑权限
|
||||
const { config, getConfig, enable } = $service.plugin.info.permission;
|
||||
const { config, getConfig, enable } = service.plugin.info.permission;
|
||||
|
||||
const perms = reactive<any>({
|
||||
edit: checkPerm({
|
||||
@ -72,7 +72,7 @@ export default defineComponent({
|
||||
|
||||
// crud 加载
|
||||
function onLoad({ ctx, app }: CrudLoad) {
|
||||
ctx.service($service.plugin.info)
|
||||
ctx.service(service.plugin.info)
|
||||
.set("dict", {
|
||||
api: {
|
||||
page: "list"
|
||||
@ -98,7 +98,7 @@ export default defineComponent({
|
||||
|
||||
// 开启、关闭
|
||||
function onEnableChange(val: boolean, item: any) {
|
||||
$service.plugin.info
|
||||
service.plugin.info
|
||||
.enable({
|
||||
namespace: item.namespace,
|
||||
enable: val
|
||||
@ -113,7 +113,7 @@ export default defineComponent({
|
||||
|
||||
// 打开配置
|
||||
async function openConf({ name, namespace, view }: any) {
|
||||
const form = await $service.plugin.info.getConfig({
|
||||
const form = await service.plugin.info.getConfig({
|
||||
namespace
|
||||
});
|
||||
|
||||
@ -131,7 +131,7 @@ export default defineComponent({
|
||||
form,
|
||||
on: {
|
||||
submit: (data: any, { close, done }: any) => {
|
||||
$service.plugin.info
|
||||
service.plugin.info
|
||||
.config({
|
||||
namespace,
|
||||
config: data
|
||||
|
@ -22,14 +22,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { CrudLoad, Table, Upsert } from "/@/crud/types";
|
||||
import { CrudLoad, Table, Upsert } from "/@/cool/modules/crud/types";
|
||||
import { defineComponent, inject, reactive } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-role",
|
||||
|
||||
setup() {
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 表单值
|
||||
const form = reactive<any>({
|
||||
@ -153,7 +153,7 @@ export default defineComponent({
|
||||
|
||||
// crud 加载
|
||||
function onLoad({ ctx, app }: CrudLoad) {
|
||||
ctx.service($service.system.role).done();
|
||||
ctx.service(service.system.role).done();
|
||||
app.refresh();
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
<cl-add-btn />
|
||||
<cl-multi-delete-btn />
|
||||
<el-button
|
||||
v-permission="$service.system.user.permission.move"
|
||||
v-permission="service.system.user.permission.move"
|
||||
size="mini"
|
||||
type="success"
|
||||
:disabled="selects.ids.length == 0"
|
||||
@ -71,7 +71,7 @@
|
||||
<!-- 单个转移 -->
|
||||
<template #slot-move-btn="{ scope }">
|
||||
<el-button
|
||||
v-permission="$service.system.user.permission.move"
|
||||
v-permission="service.system.user.permission.move"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="toMove(scope.row)"
|
||||
@ -112,13 +112,13 @@
|
||||
import { computed, defineComponent, inject, reactive, ref, watch } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useRefs } from "/@/core";
|
||||
import { Table, Upsert } from "/@/crud/types";
|
||||
import { Table, Upsert } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "sys-user",
|
||||
|
||||
setup() {
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
const store = useStore();
|
||||
const { refs, setRefs } = useRefs();
|
||||
|
||||
@ -397,7 +397,7 @@ export default defineComponent({
|
||||
|
||||
// crud 加载
|
||||
function onLoad({ ctx, app }: any) {
|
||||
ctx.service($service.system.user).done();
|
||||
ctx.service(service.system.user).done();
|
||||
app.refresh();
|
||||
}
|
||||
|
||||
@ -490,7 +490,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
return {
|
||||
$service,
|
||||
service,
|
||||
refs,
|
||||
isExpand,
|
||||
selects,
|
||||
|
@ -87,7 +87,7 @@ export default defineComponent({
|
||||
setup(_, { emit }) {
|
||||
const store = useStore();
|
||||
const { refs, setRefs } = useRefs();
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
const mitt = inject<any>("mitt");
|
||||
|
||||
// 当前会话
|
||||
@ -196,7 +196,7 @@ export default defineComponent({
|
||||
mitt.emit("message.scrollToBottom");
|
||||
|
||||
// 阅读消息
|
||||
$service.im.message.read({
|
||||
service.im.message.read({
|
||||
ids: [msgId],
|
||||
session: session.value.id
|
||||
});
|
||||
|
@ -128,7 +128,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const { refs, setRefs } = useRefs();
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
const chat = inject<any>("chat");
|
||||
const mitt = inject<any>("mitt");
|
||||
|
||||
@ -270,7 +270,7 @@ export default defineComponent({
|
||||
visible.value = true;
|
||||
};
|
||||
|
||||
$service.im.message
|
||||
service.im.message
|
||||
.page(data)
|
||||
.then((res: any) => {
|
||||
// 防止脏数据
|
||||
|
@ -26,7 +26,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
refresh() {
|
||||
this.$service.im.session.unreadCount().then((res) => {
|
||||
this.service.im.session.unreadCount().then((res) => {
|
||||
this.number = Number(res);
|
||||
});
|
||||
},
|
||||
|
@ -57,13 +57,13 @@ import { computed, defineComponent, inject, onUnmounted, reactive, ref } from "v
|
||||
import { useStore } from "vuex";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { isEmpty } from "/@/core/utils";
|
||||
import { ContextMenu } from "/@/crud";
|
||||
import { ContextMenu } from "/@/cool/modules/crud";
|
||||
import { parseContent } from "../utils";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
const mitt = inject<any>("mitt");
|
||||
|
||||
// 当前会话信息
|
||||
@ -87,32 +87,29 @@ export default defineComponent({
|
||||
const keyWord = ref<string>("");
|
||||
|
||||
// 刷新列表
|
||||
function refresh(params?: any) {
|
||||
async function refresh(params?: any) {
|
||||
loading.value = true;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
$service.im.session
|
||||
.page({
|
||||
...pagination,
|
||||
keyWord: keyWord.value,
|
||||
params,
|
||||
order: "updateTime",
|
||||
sort: "desc"
|
||||
})
|
||||
.then((res: any) => {
|
||||
store.commit("SET_SESSION_LIST", res.list);
|
||||
Object.assign(pagination, res.pagination);
|
||||
const res = await service.im.session
|
||||
.page({
|
||||
...pagination,
|
||||
keyWord: keyWord.value,
|
||||
params,
|
||||
order: "updateTime",
|
||||
sort: "desc"
|
||||
})
|
||||
.then((res: any) => {
|
||||
store.commit("SET_SESSION_LIST", res.list);
|
||||
Object.assign(pagination, res.pagination);
|
||||
return res;
|
||||
})
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
return Promise.reject(err);
|
||||
});
|
||||
|
||||
resolve(res);
|
||||
})
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
reject(err);
|
||||
})
|
||||
.done(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
});
|
||||
loading.value = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
// 搜索关键字
|
||||
@ -166,7 +163,7 @@ export default defineComponent({
|
||||
label: "删除",
|
||||
icon: "el-icon-delete",
|
||||
callback: (_: any, done: Function) => {
|
||||
$service.im.session.delete({
|
||||
service.im.session.delete({
|
||||
ids: id
|
||||
});
|
||||
|
||||
|
@ -23,7 +23,6 @@ export default {
|
||||
el.setAttribute("data-clipboard-text", binding.value);
|
||||
},
|
||||
beforeUpdate: (el: HTMLElement, binding: any) => {
|
||||
console.log(el);
|
||||
el.setAttribute("data-clipboard-text", binding.value);
|
||||
}
|
||||
};
|
||||
|
@ -543,7 +543,7 @@
|
||||
table {
|
||||
th {
|
||||
background-color: #ebeef5;
|
||||
padding: 3px 0;
|
||||
padding: 8px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
0
src/cool/modules/crud/common/index.ts
Normal file
0
src/cool/modules/crud/common/index.ts
Normal file
@ -1,5 +1,5 @@
|
||||
import { defineComponent, inject } from "vue";
|
||||
import { Crud } from "/@/crud/types";
|
||||
import { Crud } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-add-btn",
|
@ -1,5 +1,5 @@
|
||||
import { defineComponent, inject } from "vue";
|
||||
import { Crud } from "/@/crud/types";
|
||||
import { Crud } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-adv-btn",
|
@ -2,7 +2,7 @@ import { useForm, useRefs } from "../hooks/core";
|
||||
import { cloneDeep, deepMerge } from "../utils";
|
||||
import Parse from "../utils/parse";
|
||||
import { renderNode } from "../utils/vnode";
|
||||
import { Browser, Crud, Mitt } from "/@/crud/types";
|
||||
import { Browser, Crud, Mitt } from "/@/cool/modules/crud/types";
|
||||
import { defineComponent, inject, reactive, ref } from "vue";
|
||||
import { useAction } from "./form/helper";
|
||||
|
||||
@ -123,7 +123,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
function onClose() {
|
||||
function onClose2() {
|
||||
emit("close");
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ export default defineComponent({
|
||||
open,
|
||||
onOpened,
|
||||
close,
|
||||
onClose,
|
||||
onClose2,
|
||||
onClosed,
|
||||
reset,
|
||||
clear,
|
||||
@ -197,6 +197,7 @@ export default defineComponent({
|
||||
render(ctx: any) {
|
||||
const browser = inject("browser") as Browser;
|
||||
|
||||
// 渲染表单
|
||||
function renderForm() {
|
||||
return (
|
||||
<el-form
|
||||
@ -230,12 +231,35 @@ export default defineComponent({
|
||||
);
|
||||
}
|
||||
|
||||
const ButtonText: any = {
|
||||
search: "搜索",
|
||||
reset: "重置",
|
||||
clear: "清空",
|
||||
close: "取消"
|
||||
};
|
||||
// 渲染底部
|
||||
function renderFooter() {
|
||||
const btns: any = {
|
||||
search: "搜索",
|
||||
reset: "重置",
|
||||
clear: "清空",
|
||||
close: "取消"
|
||||
};
|
||||
|
||||
return ctx.opList.map((e: any) => {
|
||||
if (btns[e]) {
|
||||
return (
|
||||
<el-button
|
||||
{...{
|
||||
size: ctx.props.size || "small",
|
||||
type: e === "search" ? "primary" : null,
|
||||
onClick: ctx[e]
|
||||
}}>
|
||||
{btns[e]}
|
||||
</el-button>
|
||||
);
|
||||
} else {
|
||||
return renderNode(e, {
|
||||
scope: ctx.form,
|
||||
slots: ctx.$slots
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div class="cl-adv-search">
|
||||
@ -247,32 +271,11 @@ export default defineComponent({
|
||||
{...{
|
||||
onOpened: ctx.onOpened,
|
||||
onClosed: ctx.onClosed,
|
||||
onClose: ctx.onClose,
|
||||
onClose: ctx.onClose2,
|
||||
...ctx.props
|
||||
}}>
|
||||
<div class="cl-adv-search__container">{renderForm()}</div>
|
||||
|
||||
<div class="cl-adv-search__footer">
|
||||
{this.opList.map((e: any) => {
|
||||
if (ButtonText[e]) {
|
||||
return (
|
||||
<el-button
|
||||
{...{
|
||||
size: ctx.props.size || "small",
|
||||
type: e === "search" ? "primary" : null,
|
||||
onClick: ctx[e]
|
||||
}}>
|
||||
{ButtonText[e]}
|
||||
</el-button>
|
||||
);
|
||||
} else {
|
||||
return renderNode(e, {
|
||||
scope: ctx.form,
|
||||
slots: ctx.$slots
|
||||
});
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
<div class="cl-adv-search__footer">{renderFooter()}</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
);
|
@ -1,16 +1,16 @@
|
||||
import { defineComponent, nextTick, onMounted, reactive, ref } from "vue";
|
||||
import { nextTick, onMounted, reactive, ref } from "vue";
|
||||
import { useRefs } from "../../hooks/core";
|
||||
import { contains } from "../../utils";
|
||||
import { ContextMenuItem, ContextMenuOptions } from "/@/crud/types";
|
||||
import { ContextMenuItem, ContextMenuOptions } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
export default {
|
||||
name: "cl-context-menu",
|
||||
|
||||
props: {
|
||||
visible: Boolean
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
setup(props: any) {
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
|
||||
// 菜单是否可见
|
||||
@ -204,4 +204,4 @@ export default defineComponent({
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
@ -18,7 +18,7 @@ export const bootstap = (crud: any, { fn }: any) => {
|
||||
|
||||
ctx.id = id;
|
||||
|
||||
ctx.service = function(s: any) {
|
||||
ctx.service = function (s: any) {
|
||||
if (s) {
|
||||
Object.assign(crud.service, s);
|
||||
crud.service.__proto__ = s.__proto__;
|
||||
@ -31,7 +31,7 @@ export const bootstap = (crud: any, { fn }: any) => {
|
||||
return ctx;
|
||||
};
|
||||
|
||||
ctx.permission = function(d: any) {
|
||||
ctx.permission = function (d: any) {
|
||||
if (isFunction(d)) {
|
||||
merge(permission, d({ service, permission }));
|
||||
} else {
|
||||
@ -47,8 +47,8 @@ export const bootstap = (crud: any, { fn }: any) => {
|
||||
return ctx;
|
||||
};
|
||||
|
||||
ctx.done = function() {
|
||||
console.log("done");
|
||||
ctx.done = function () {
|
||||
console.log("crud done");
|
||||
};
|
||||
|
||||
return { ctx, app };
|
@ -1,6 +1,6 @@
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import { isArray, isObject, isString } from "../../utils";
|
||||
import { ServiceName } from "/@/crud/types";
|
||||
import { ServiceName } from "/@/cool/modules/crud/types";
|
||||
|
||||
export function useRequest({ mitt, props, crud }: any) {
|
||||
// 刷新随机值,避免脏数据
|
||||
@ -92,14 +92,13 @@ export function useRequest({ mitt, props, crud }: any) {
|
||||
}
|
||||
|
||||
resolve(res);
|
||||
done();
|
||||
})
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
reject(err);
|
||||
console.error(err);
|
||||
})
|
||||
.done(() => {
|
||||
done();
|
||||
console.error(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
@ -117,7 +116,7 @@ export function useRequest({ mitt, props, crud }: any) {
|
||||
const reqName = crud.dict.api.delete;
|
||||
|
||||
const params = {
|
||||
ids: selection.map(e => e.id)
|
||||
ids: selection.map((e) => e.id)
|
||||
};
|
||||
|
||||
const next = (params: any) => {
|
@ -10,9 +10,7 @@ export function useDialog({ props, isFullscreen }: any) {
|
||||
nextTick(() => {
|
||||
// 获取元素
|
||||
const dlg: any = document.querySelector(`.cl-dialog--${ctx?.uid}`);
|
||||
const hdr: any = dlg
|
||||
? dlg.querySelector(".el-dialog__header")
|
||||
: null;
|
||||
const hdr: any = dlg ? dlg.querySelector(".el-dialog__header") : null;
|
||||
|
||||
// 设置对话框
|
||||
if (dlg) {
|
||||
@ -34,8 +32,7 @@ export function useDialog({ props, isFullscreen }: any) {
|
||||
if (hdr) {
|
||||
hdr.onmousedown = (e: any) => {
|
||||
// 可视区域大小
|
||||
const { clientWidth, clientHeight } =
|
||||
document.documentElement || document.body;
|
||||
const { clientWidth, clientHeight } = document.documentElement || document.body;
|
||||
|
||||
// Try drag
|
||||
const isDrag = (() => {
|
||||
@ -72,28 +69,23 @@ export function useDialog({ props, isFullscreen }: any) {
|
||||
// Distance
|
||||
const dis = {
|
||||
left: e.clientX - hdr.offsetLeft,
|
||||
top: e.clientY - hdr.offsetTop,
|
||||
top: e.clientY - hdr.offsetTop
|
||||
};
|
||||
|
||||
// Calc left and top of the box
|
||||
const box = (() => {
|
||||
const { left, top } =
|
||||
dlg.currentStyle ||
|
||||
window.getComputedStyle(dlg, null);
|
||||
dlg.currentStyle || window.getComputedStyle(dlg, null);
|
||||
|
||||
if (left.includes("%")) {
|
||||
return {
|
||||
top:
|
||||
+clientHeight *
|
||||
(+top.replace(/%/g, "") / 100),
|
||||
left:
|
||||
+clientWidth *
|
||||
(+left.replace(/%/g, "") / 100),
|
||||
top: +clientHeight * (+top.replace(/%/g, "") / 100),
|
||||
left: +clientWidth * (+left.replace(/%/g, "") / 100)
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
top: +top.replace(/\px/g, ""),
|
||||
left: +left.replace(/\px/g, ""),
|
||||
left: +left.replace(/\px/g, "")
|
||||
};
|
||||
}
|
||||
})();
|
||||
@ -103,11 +95,8 @@ export function useDialog({ props, isFullscreen }: any) {
|
||||
const minLeft = -(clientWidth - dlg.clientWidth) / 2 + pad;
|
||||
const maxLeft =
|
||||
(dlg.clientWidth >= clientWidth / 2
|
||||
? dlg.clientWidth / 2 -
|
||||
(dlg.clientWidth - clientWidth / 2)
|
||||
: dlg.clientWidth / 2 +
|
||||
clientWidth / 2 -
|
||||
dlg.clientWidth) - pad;
|
||||
? dlg.clientWidth / 2 - (dlg.clientWidth - clientWidth / 2)
|
||||
: dlg.clientWidth / 2 + clientWidth / 2 - dlg.clientWidth) - pad;
|
||||
|
||||
const minTop = pad;
|
||||
const maxTop = clientHeight - dlg.clientHeight - pad;
|
||||
@ -145,6 +134,6 @@ export function useDialog({ props, isFullscreen }: any) {
|
||||
};
|
||||
|
||||
return {
|
||||
setDialog,
|
||||
setDialog
|
||||
};
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { defineComponent, h, inject, onMounted, ref, watch, computed } from "vue";
|
||||
import { Browser } from "/@/crud/types";
|
||||
import { Browser } from "/@/cool/modules/crud/types";
|
||||
import { useDialog } from "./helper";
|
||||
import { isArray, isBoolean } from "../../utils";
|
||||
import { renderNode } from "../../utils/vnode";
|
||||
@ -75,11 +75,6 @@ export default defineComponent({
|
||||
return browser.isMini ? true : fullscreen.value;
|
||||
});
|
||||
|
||||
// 对话框内容高度
|
||||
const height = computed(() => {
|
||||
return props.height ? (isFullscreen.value ? `calc(100vh - 46px)` : props.height) : null;
|
||||
});
|
||||
|
||||
// 对话框事件
|
||||
const { setDialog } = useDialog({ isFullscreen, props });
|
||||
|
||||
@ -158,7 +153,6 @@ export default defineComponent({
|
||||
|
||||
return {
|
||||
visible,
|
||||
height,
|
||||
fullscreen,
|
||||
isFullscreen,
|
||||
cacheKey,
|
||||
@ -257,6 +251,9 @@ export default defineComponent({
|
||||
// 自定义样式
|
||||
const customClass = `cl-dialog cl-dialog--${ctx.$.uid} ${ctx.props.customClass || ""}`;
|
||||
|
||||
// 对话框高度
|
||||
const height = ctx.height ? (ctx.isFullscreen ? `calc(100vh - 46px)` : ctx.height) : null;
|
||||
|
||||
return (
|
||||
<div>
|
||||
{h(
|
||||
@ -274,7 +271,7 @@ export default defineComponent({
|
||||
return (
|
||||
<div
|
||||
class="cl-dialog__container"
|
||||
style={{ height: ctx.height }}
|
||||
style={{ height }}
|
||||
key={ctx.cacheKey}>
|
||||
{ctx.$slots.default && ctx.$slots.default()}
|
||||
</div>
|
@ -1,5 +1,5 @@
|
||||
import { defineComponent, inject } from "vue";
|
||||
import { Crud } from "/@/crud/types";
|
||||
import { Crud } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-multi-delete-btn",
|
@ -1,5 +1,5 @@
|
||||
import { h, inject, ref, watch } from "vue";
|
||||
import { Crud, Mitt } from "/@/crud/types";
|
||||
import { Crud, Mitt } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default {
|
||||
name: "cl-pagination",
|
@ -1,5 +1,5 @@
|
||||
import { inject, ref, watch } from "vue";
|
||||
import { Crud } from "/@/crud/types";
|
||||
import { Crud } from "/@/cool/modules/crud/types";
|
||||
import { isArray } from "../utils";
|
||||
|
||||
export default {
|
@ -1,4 +1,4 @@
|
||||
import { Crud } from "/@/crud/types";
|
||||
import { Crud } from "/@/cool/modules/crud/types";
|
||||
import { defineComponent, inject } from "vue";
|
||||
|
||||
export default defineComponent({
|
@ -1,5 +1,5 @@
|
||||
import { Crud } from "/@/crud/types";
|
||||
import { computed, defineComponent, inject, ref } from "vue";
|
||||
import { Crud } from "/@/cool/modules/crud/types";
|
||||
import { defineComponent, inject, ref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-search-key",
|
||||
@ -32,18 +32,11 @@ export default defineComponent({
|
||||
const crud = inject("crud") as Crud;
|
||||
|
||||
// 选中字段
|
||||
const field = ref<string>(props.field);
|
||||
const selectField = ref<string>(props.field);
|
||||
|
||||
// 搜索内容
|
||||
const value = ref<string>(props.modelValue || "");
|
||||
|
||||
// 可选字段列表
|
||||
const fieldList = computed(() => {
|
||||
return props.fieldList.map((e: any, i: number) => {
|
||||
return <el-option key={i} label={e.label} value={e.value} />;
|
||||
});
|
||||
});
|
||||
|
||||
// 搜索
|
||||
function search() {
|
||||
const params: any = {};
|
||||
@ -56,7 +49,7 @@ export default defineComponent({
|
||||
crud.refresh({
|
||||
page: 1,
|
||||
...params,
|
||||
[field.value]: value.value,
|
||||
[selectField.value]: value.value,
|
||||
...newParams
|
||||
});
|
||||
}
|
||||
@ -83,15 +76,14 @@ export default defineComponent({
|
||||
|
||||
// 监听字段选择
|
||||
function onFieldChange() {
|
||||
emit("field-change", field.value);
|
||||
emit("field-change", selectField.value);
|
||||
onInput("");
|
||||
value.value = "";
|
||||
}
|
||||
|
||||
return {
|
||||
value,
|
||||
field,
|
||||
fieldList,
|
||||
selectField,
|
||||
search,
|
||||
onKeydown,
|
||||
onInput,
|
||||
@ -106,10 +98,12 @@ export default defineComponent({
|
||||
class="cl-search-key__select"
|
||||
filterable
|
||||
size="mini"
|
||||
v-model={ctx.field}
|
||||
v-model={ctx.selectField}
|
||||
v-show={ctx.fieldList.length > 0}
|
||||
onChange={ctx.onFieldChange}>
|
||||
{ctx.fieldList}
|
||||
{ctx.fieldList.map((e: any, i: number) => (
|
||||
<el-option key={i} label={e.label} value={e.value} />
|
||||
))}
|
||||
</el-select>
|
||||
|
||||
<el-input
|
@ -1,11 +1,11 @@
|
||||
import { defineComponent, h, inject, nextTick, onMounted, ref } from "vue";
|
||||
import { Crud, Mitt } from "/@/crud/types";
|
||||
import { Crud, Mitt } from "/@/cool/modules/crud/types";
|
||||
import { useRefs } from "../../hooks/core";
|
||||
import { cloneDeep, isArray, isEmpty, isFunction, isNull } from "../../utils";
|
||||
import { renderNode } from "../../utils/vnode";
|
||||
import ContextMenu from "../context-menu/index";
|
||||
import { useElTableApi } from "./helper";
|
||||
import { Browser } from "/@/crud/types";
|
||||
import { Browser } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-table",
|
@ -1,6 +1,6 @@
|
||||
import { ElMessage } from "element-plus";
|
||||
import { defineComponent, h, inject, ref } from "vue";
|
||||
import { Crud } from "/@/crud/types";
|
||||
import { Crud } from "/@/cool/modules/crud/types";
|
||||
import { useFormApi } from "./helper";
|
||||
import { useForm, useRefs } from "../../hooks/core";
|
||||
|
||||
@ -75,39 +75,41 @@ export default defineComponent({
|
||||
|
||||
// 提交
|
||||
function submit(data: any, event?: any) {
|
||||
const next = (data: any) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 获取请求方法
|
||||
const reqName: string = crud.dict.api[isEdit.value ? "update" : "add"];
|
||||
function done() {
|
||||
return event ? event.done() : refs.value.form.done();
|
||||
}
|
||||
|
||||
// 验证请求
|
||||
if (!crud.service[reqName]) {
|
||||
event.done();
|
||||
return reject(`Request function '${reqName}' is not fount!`);
|
||||
}
|
||||
async function next(data: any) {
|
||||
// 获取请求方法
|
||||
const reqName: string = crud.dict.api[isEdit.value ? "update" : "add"];
|
||||
|
||||
// 发送请求
|
||||
crud.service[reqName](data)
|
||||
.then((res: any) => {
|
||||
ElMessage.success("保存成功");
|
||||
close();
|
||||
crud.refresh();
|
||||
resolve(res);
|
||||
})
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
reject(err);
|
||||
})
|
||||
.done(() => {
|
||||
event.done();
|
||||
});
|
||||
});
|
||||
};
|
||||
// 验证请求
|
||||
if (!crud.service[reqName]) {
|
||||
done();
|
||||
return Promise.reject(`Request function '${reqName}' is not fount!`);
|
||||
}
|
||||
|
||||
// 发送请求
|
||||
await crud.service[reqName](data)
|
||||
.then((res: any) => {
|
||||
ElMessage.success("保存成功");
|
||||
close();
|
||||
crud.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
Promise.reject(err);
|
||||
});
|
||||
|
||||
// 请求完成
|
||||
done();
|
||||
}
|
||||
|
||||
// 提交钩子
|
||||
if (props.onSubmit) {
|
||||
props.onSubmit(isEdit.value, data, {
|
||||
done: event.done,
|
||||
done,
|
||||
next,
|
||||
close
|
||||
});
|
||||
@ -205,42 +207,39 @@ export default defineComponent({
|
||||
close();
|
||||
};
|
||||
|
||||
// Submit
|
||||
const next = (data: any) => {
|
||||
// 获取详情
|
||||
const next = async (data: any) => {
|
||||
// 获取请求名称
|
||||
const reqName: any = crud.dict.api.info;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// 验证请求
|
||||
if (!crud.service[reqName]) {
|
||||
reject(`Request function '${reqName}' is not fount!`);
|
||||
done();
|
||||
return null;
|
||||
}
|
||||
// 验证请求
|
||||
if (!crud.service[reqName]) {
|
||||
done();
|
||||
return Promise.reject(`Request function '${reqName}' is not fount!`);
|
||||
}
|
||||
|
||||
// 发送请求
|
||||
crud.service[reqName]({
|
||||
id: data.id
|
||||
// 发送请求
|
||||
await crud.service[reqName]({
|
||||
id: data.id
|
||||
})
|
||||
.then((res: any) => {
|
||||
done(res);
|
||||
|
||||
// 同步打开表单
|
||||
if (props.sync) {
|
||||
open();
|
||||
}
|
||||
|
||||
emit("open", isEdit.value, form);
|
||||
return res;
|
||||
})
|
||||
.then((res: any) => {
|
||||
resolve(res);
|
||||
done(res);
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
return Promise.reject(err);
|
||||
});
|
||||
|
||||
// 同步打开表单
|
||||
if (props.sync) {
|
||||
open();
|
||||
}
|
||||
|
||||
emit("open", isEdit.value, form);
|
||||
})
|
||||
.catch((err: string) => {
|
||||
ElMessage.error(err);
|
||||
reject(err);
|
||||
})
|
||||
.done(() => {
|
||||
hiddenLoading();
|
||||
});
|
||||
});
|
||||
// 隐藏加载框
|
||||
hiddenLoading();
|
||||
};
|
||||
|
||||
// 获取详情钩子
|
@ -13,7 +13,7 @@ const CRUD = {
|
||||
(function () {
|
||||
const browser = reactive<any>({
|
||||
isMini: false,
|
||||
screen: "full",
|
||||
screen: "full"
|
||||
});
|
||||
|
||||
function resize() {
|
||||
@ -47,11 +47,11 @@ const CRUD = {
|
||||
}
|
||||
|
||||
app.config.globalProperties.$crud = {
|
||||
openContextMenu: ContextMenu.open,
|
||||
openContextMenu: ContextMenu.open
|
||||
};
|
||||
|
||||
return {};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
export default CRUD;
|
@ -1,13 +1,6 @@
|
||||
import { TableOptions } from "./table";
|
||||
|
||||
export type ServiceName =
|
||||
| "page"
|
||||
| "list"
|
||||
| "add"
|
||||
| "delete"
|
||||
| "update"
|
||||
| "info"
|
||||
| string;
|
||||
export type ServiceName = "page" | "list" | "add" | "delete" | "update" | "info" | string;
|
||||
|
||||
export interface Service {
|
||||
page?(
|
@ -4,10 +4,7 @@ export interface RefreshOp {
|
||||
* @param list 数据列表
|
||||
* @param pagination 分页信息
|
||||
*/
|
||||
render(
|
||||
list: any[],
|
||||
pagination?: { size?: number; page?: number; total?: number }
|
||||
): void;
|
||||
render(list: any[], pagination?: { size?: number; page?: number; total?: number }): void;
|
||||
|
||||
/**
|
||||
* 继续执行刷新
|
@ -55,9 +55,9 @@ export function dataset(obj: any, key: string, value: any) {
|
||||
let d = obj;
|
||||
|
||||
const arr = flat(
|
||||
key.split(".").map(e => {
|
||||
key.split(".").map((e) => {
|
||||
if (e.includes("[")) {
|
||||
return e.split("[").map(e => e.replace(/"/g, ""));
|
||||
return e.split("[").map((e) => e.replace(/"/g, ""));
|
||||
} else {
|
||||
return e;
|
||||
}
|
@ -7,7 +7,7 @@ import { isString, isBoolean, isFunction } from "./index";
|
||||
* 3 :[prop] is bind form[prop] value
|
||||
* @param {*} value
|
||||
*/
|
||||
export default function(method: string, { value, scope, data = {} }: any) {
|
||||
export default function (method: string, { value, scope, data = {} }: any) {
|
||||
if (data) {
|
||||
data.isAdd = !data.isEdit;
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { AdvSearchItem } from "/@/crud/types";
|
||||
import { AdvSearchItem } from "/@/cool/modules/crud/types";
|
||||
import { defineComponent, ref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ContextMenu } from "/@/crud";
|
||||
import { ContextMenu } from "/@/cool/modules/crud";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { defineComponent } from "vue";
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
import { defineComponent, ref, resolveComponent, h } from "vue";
|
||||
import Test from "./test.vue";
|
||||
import { TestService } from "../../utils/service";
|
||||
import { CrudLoad, FormItem, FormRef } from "/@/crud/types";
|
||||
import { CrudLoad, FormItem, FormRef } from "/@/cool/modules/crud/types";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { QueryList } from "/@/crud/types";
|
||||
import { QueryList } from "/@/cool/modules/crud/types";
|
||||
import { defineComponent, ref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { TableColumn } from "/@/crud/types";
|
||||
import { TableColumn } from "/@/cool/modules/crud/types";
|
||||
import { defineComponent, ref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { UpsertItem, UpsertRef } from "/@/crud/types";
|
||||
import { UpsertItem, UpsertRef } from "/@/cool/modules/crud/types";
|
||||
import { defineComponent, ref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -10,7 +10,13 @@
|
||||
<demo-form />
|
||||
<demo-query />
|
||||
<cl-flex1 />
|
||||
<cl-search-key field="name" />
|
||||
<cl-search-key
|
||||
field="name"
|
||||
:field-list="[
|
||||
{ label: '姓名', value: 'name' },
|
||||
{ label: '年龄', value: 'age' }
|
||||
]"
|
||||
/>
|
||||
<demo-adv-search />
|
||||
</el-row>
|
||||
|
||||
@ -30,7 +36,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { CrudLoad } from "/@/crud/types";
|
||||
import { CrudLoad } from "/@/cool/modules/crud/types";
|
||||
import { TestService } from "../utils/service";
|
||||
import Dialog from "../components/crud/dialog.vue";
|
||||
import ContextMenu from "../components/crud/context-menu.vue";
|
||||
|
@ -218,7 +218,7 @@ import { computed, defineComponent, inject, onMounted, reactive } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import Draggable from "vuedraggable";
|
||||
import { checkPerm } from "/@/cool/modules/base";
|
||||
import { ContextMenu } from "/@/crud";
|
||||
import { ContextMenu } from "/@/cool/modules/crud";
|
||||
import Cron from "../components/cron";
|
||||
import { useRefs } from "/@/core";
|
||||
|
||||
@ -232,7 +232,7 @@ export default defineComponent({
|
||||
|
||||
setup() {
|
||||
const { refs, setRefs } = useRefs();
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 任务列表
|
||||
const list = reactive<any[]>([
|
||||
@ -312,7 +312,7 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
// 权限
|
||||
const perm: any = computed(() => $service.task.info.permission);
|
||||
const perm: any = computed(() => service.task.info.permission);
|
||||
|
||||
// 更多列表
|
||||
function moreList(res: any, { list, pagination }: any) {
|
||||
@ -353,7 +353,7 @@ export default defineComponent({
|
||||
|
||||
item.loading = true;
|
||||
|
||||
const res = await $service.task.info.page(item.params);
|
||||
const res = await service.task.info.page(item.params);
|
||||
|
||||
moreList(res, item);
|
||||
|
||||
@ -374,7 +374,7 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
if (id) {
|
||||
info = await $service.task.info.info({ id });
|
||||
info = await service.task.info.info({ id });
|
||||
}
|
||||
|
||||
if (info.every) {
|
||||
@ -553,7 +553,7 @@ export default defineComponent({
|
||||
data.limit = null;
|
||||
}
|
||||
|
||||
$service.task.info[id ? "update" : "add"]({
|
||||
service.task.info[id ? "update" : "add"]({
|
||||
...info,
|
||||
...data,
|
||||
every: data.every * 1000
|
||||
@ -579,7 +579,7 @@ export default defineComponent({
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
$service.task.info.delete({ ids: [id] }).then(() => {
|
||||
service.task.info.delete({ ids: [id] }).then(() => {
|
||||
refreshTask();
|
||||
});
|
||||
})
|
||||
@ -588,7 +588,7 @@ export default defineComponent({
|
||||
|
||||
// 开始任务
|
||||
function start({ id, type }: any) {
|
||||
$service.task.info
|
||||
service.task.info
|
||||
.start({ id, type })
|
||||
.then(() => {
|
||||
refreshTask();
|
||||
@ -600,7 +600,7 @@ export default defineComponent({
|
||||
|
||||
// 停止任务
|
||||
function stop({ id }: any) {
|
||||
$service.task.info
|
||||
service.task.info
|
||||
.stop({ id })
|
||||
.then(() => {
|
||||
refreshTask();
|
||||
@ -612,7 +612,7 @@ export default defineComponent({
|
||||
|
||||
// 任务执行一次
|
||||
function once({ id }: any) {
|
||||
$service.task.info
|
||||
service.task.info
|
||||
.once({ id })
|
||||
.then(() => {
|
||||
refreshTask();
|
||||
@ -662,7 +662,7 @@ export default defineComponent({
|
||||
|
||||
logs.loading = true;
|
||||
|
||||
const res = await $service.task.info.log(params);
|
||||
const res = await service.task.info.log(params);
|
||||
|
||||
moreList(res, logs);
|
||||
|
||||
|
@ -38,7 +38,11 @@
|
||||
<ul>
|
||||
<li v-if="!browser.isMini">
|
||||
<span>显示一级菜单栏</span>
|
||||
<el-switch v-model="form.conf.showAMenu" size="mini" />
|
||||
<el-switch
|
||||
v-model="form.conf.showAMenu"
|
||||
size="mini"
|
||||
@change="onAMenuChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span>显示路由导航栏</span>
|
||||
@ -150,8 +154,7 @@ export default {
|
||||
conf: {
|
||||
showAMenu: false,
|
||||
showRouteNav: true,
|
||||
showProcess: true,
|
||||
customMenu: false
|
||||
showProcess: true
|
||||
},
|
||||
theme: {
|
||||
color: "",
|
||||
@ -171,7 +174,6 @@ export default {
|
||||
|
||||
watch: {
|
||||
app: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
this.form = cloneDeep(val);
|
||||
@ -195,6 +197,12 @@ export default {
|
||||
this.drawer.visible = false;
|
||||
},
|
||||
|
||||
onAMenuChange() {
|
||||
setTimeout(() => {
|
||||
this.$store.commit("SET_MENU_LIST");
|
||||
}, 0);
|
||||
},
|
||||
|
||||
// 设置主题
|
||||
setTheme({ name, color, label }) {
|
||||
if (this.form.theme.color == color) {
|
||||
|
@ -472,7 +472,7 @@ export default {
|
||||
data.append("file", file);
|
||||
|
||||
// 上传
|
||||
this.$service.common
|
||||
this.service.common
|
||||
.request({
|
||||
url: res.host,
|
||||
method: "POST",
|
||||
@ -504,7 +504,7 @@ export default {
|
||||
host: "/upload"
|
||||
});
|
||||
} else {
|
||||
this.$service.common
|
||||
this.service.common
|
||||
.upload()
|
||||
.then((res) => {
|
||||
next(res);
|
||||
@ -516,7 +516,7 @@ export default {
|
||||
|
||||
this.loading = true;
|
||||
|
||||
upload(req.file)
|
||||
await upload(req.file)
|
||||
.then((url) => {
|
||||
this._onSuccess({ data: url }, { raw: req.file });
|
||||
})
|
||||
@ -528,15 +528,14 @@ export default {
|
||||
if (this.onError) {
|
||||
this.onError(err, req.file);
|
||||
}
|
||||
})
|
||||
.done(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
// 上传模式
|
||||
uploadMode() {
|
||||
return this.$service.common.uploadMode().then((res) => res.mode);
|
||||
return this.service.common.uploadMode().then((res) => res.mode);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -37,8 +37,8 @@ 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 "/@/crud";
|
||||
import { useRefs } from "/@/crud/hooks/core";
|
||||
import { ContextMenu } from "/@/cool/modules/crud";
|
||||
import { useRefs } from "/@/cool/modules/crud/hooks/core";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-upload-space-category",
|
||||
@ -52,7 +52,7 @@ export default defineComponent({
|
||||
setup(_, { emit }) {
|
||||
const store = useStore();
|
||||
const { refs, setRefs }: any = useRefs();
|
||||
const $service: any = inject("service");
|
||||
const service: any = inject("service");
|
||||
const space = inject<any>("space");
|
||||
|
||||
// 数据列表
|
||||
@ -76,7 +76,6 @@ export default defineComponent({
|
||||
watch(
|
||||
() => current.value,
|
||||
(id: number | string) => {
|
||||
console.log(id);
|
||||
emit("update:modelValue", id);
|
||||
emit("change", id);
|
||||
}
|
||||
@ -84,7 +83,7 @@ export default defineComponent({
|
||||
|
||||
// 刷新分类
|
||||
function refresh() {
|
||||
return $service.space.type.list().then((res: any) => {
|
||||
return service.space.type.list().then((res: any) => {
|
||||
res.unshift({
|
||||
name: "全部文件",
|
||||
id: null
|
||||
@ -127,9 +126,9 @@ export default defineComponent({
|
||||
let next = null;
|
||||
|
||||
if (!item.id) {
|
||||
next = $service.space.type.add(data);
|
||||
next = service.space.type.add(data);
|
||||
} else {
|
||||
next = $service.space.type.update({
|
||||
next = service.space.type.update({
|
||||
...data,
|
||||
id: item.id
|
||||
});
|
||||
@ -193,7 +192,7 @@ export default defineComponent({
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
$service.space.type
|
||||
service.space.type
|
||||
.delete({
|
||||
ids: [id]
|
||||
})
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, inject } from "vue";
|
||||
import { ContextMenu } from "/@/crud";
|
||||
import { ContextMenu } from "/@/cool/modules/crud";
|
||||
|
||||
export default defineComponent({
|
||||
name: "cl-upload-space-item",
|
||||
|
@ -77,7 +77,7 @@
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
v-loading="item.loading"
|
||||
:value="item"
|
||||
:modelValue="item"
|
||||
:element-loading-text="item.progress"
|
||||
@select="select"
|
||||
@remove="remove"
|
||||
@ -192,7 +192,7 @@ export default defineComponent({
|
||||
|
||||
setup(props, { emit }) {
|
||||
const store = useStore();
|
||||
const $service = inject<any>("service");
|
||||
const service = inject<any>("service");
|
||||
|
||||
// 是否可见
|
||||
const visible = ref<boolean>(false);
|
||||
@ -268,7 +268,7 @@ export default defineComponent({
|
||||
if (item) {
|
||||
item.url = res.data;
|
||||
|
||||
$service.space.info
|
||||
service.space.info
|
||||
.add({
|
||||
url: res.data,
|
||||
type: item.type,
|
||||
@ -316,13 +316,14 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
// 刷新资源文件
|
||||
function refresh(params: any = {}) {
|
||||
async function refresh(params: any = {}) {
|
||||
// 清空选择
|
||||
clear();
|
||||
|
||||
// 加载中
|
||||
loading.value = true;
|
||||
|
||||
$service.space.info
|
||||
await service.space.info
|
||||
.page({
|
||||
...pagination,
|
||||
...params,
|
||||
@ -338,10 +339,10 @@ export default defineComponent({
|
||||
loading: false
|
||||
};
|
||||
});
|
||||
})
|
||||
.done(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
// 加载完成
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
// 确认选中
|
||||
@ -368,7 +369,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
// 删除选中
|
||||
function remove(item: any) {
|
||||
function remove(item?: any) {
|
||||
// 已选文件 id
|
||||
const ids: number[] = item ? [item.id] : selection.value.map((e: any) => e.id);
|
||||
|
||||
@ -387,7 +388,7 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
// 删除请求
|
||||
$service.space.info
|
||||
service.space.info
|
||||
.delete({
|
||||
ids
|
||||
})
|
||||
|
@ -1,12 +0,0 @@
|
||||
// @ts-ignore
|
||||
Promise.prototype.done = function(cb: Function) {
|
||||
const P: any = this.constructor;
|
||||
|
||||
return this.then(
|
||||
(value: any) => P.resolve(cb()).then(() => value),
|
||||
(reason: any) =>
|
||||
P.resolve(cb()).then(() => {
|
||||
throw reason;
|
||||
})
|
||||
);
|
||||
};
|
@ -10,6 +10,6 @@ async function bootstrap(app: any) {
|
||||
SET_SERVICE(app);
|
||||
SET_MODULE(app);
|
||||
|
||||
router.$plugin?.addViews(store.getters.routes);
|
||||
router.$plugin?.addViews(store.getters.routes || []);
|
||||
}
|
||||
export { Service, Permission, BaseService, bootstrap, useRefs };
|
||||
|
@ -49,7 +49,7 @@ export default function (app: any) {
|
||||
// 注册请求服务
|
||||
if (service) {
|
||||
// @ts-ignore
|
||||
deepMerge(store.$service, service);
|
||||
deepMerge(store.service, service);
|
||||
}
|
||||
|
||||
// 注册指令
|
||||
@ -93,7 +93,7 @@ export default function (app: any) {
|
||||
|
||||
let mod: any = null;
|
||||
|
||||
// Parse
|
||||
// 解析格式
|
||||
if (isString(e)) {
|
||||
mod = {
|
||||
name: e
|
||||
@ -110,21 +110,22 @@ export default function (app: any) {
|
||||
console.error(e, "格式错误");
|
||||
}
|
||||
|
||||
// Set
|
||||
if (mod.value) {
|
||||
if (isFunction(mod.value.install)) {
|
||||
mod.value = mod.value.install(app, mod.options);
|
||||
}
|
||||
} else {
|
||||
// 匹配本地模块
|
||||
if (!mod.value) {
|
||||
const item = local.find((m: any) => m.name === mod.name);
|
||||
|
||||
if (item) {
|
||||
mod.value = item.value;
|
||||
} else {
|
||||
console.error(mod.name, "不是一个有效的模块");
|
||||
}
|
||||
}
|
||||
|
||||
if (!mod.value) {
|
||||
console.error(mod.name, "不是一个有效的模块");
|
||||
// 兼容其他 vue 插件模式
|
||||
if (mod.value) {
|
||||
if (isFunction(mod.value.install)) {
|
||||
mod.value = mod.value.install(app, mod.options);
|
||||
}
|
||||
}
|
||||
|
||||
// 是否开启
|
||||
|
@ -27,12 +27,9 @@ export default function () {
|
||||
) {
|
||||
d.meta.iframeUrl = url;
|
||||
d.component = () =>
|
||||
import(
|
||||
`/@/cool/modules/base/pages/iframe/index.vue`
|
||||
);
|
||||
import(`/@/cool/modules/base/pages/iframe/index.vue`);
|
||||
} else {
|
||||
d.component = () =>
|
||||
import(/* @vite-ignore */ `/@/${url}`);
|
||||
d.component = () => import(/* @vite-ignore */ `/@/${url}`);
|
||||
}
|
||||
} else {
|
||||
d.redirect = "/404";
|
||||
@ -42,7 +39,7 @@ export default function () {
|
||||
// Batch add route
|
||||
router.addRoute("index", d);
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
router.beforeEach((to: any, from: any, next: any) => {
|
||||
@ -59,7 +56,7 @@ export default function () {
|
||||
store.commit("ADD_PROCESS", {
|
||||
keepAlive: to.meta?.keepAlive,
|
||||
label: to.meta?.label || to.name,
|
||||
value: to.fullPath,
|
||||
value: to.fullPath
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@ -83,10 +80,7 @@ export default function () {
|
||||
lock = true;
|
||||
|
||||
if (err.code == "MODULE_NOT_FOUND") {
|
||||
console.error(
|
||||
err.ElMessage.replace("Cannot find module ", ""),
|
||||
"路由组件不存在"
|
||||
);
|
||||
console.error(err.ElMessage.replace("Cannot find module ", ""), "路由组件不存在");
|
||||
|
||||
ElMessage.error(`路由组件路径错误`);
|
||||
} else {
|
||||
|
@ -7,7 +7,7 @@ export default function (app: any) {
|
||||
|
||||
const modules: any = {};
|
||||
|
||||
for (let i in files) {
|
||||
for (const i in files) {
|
||||
const path: string = i.replace("/src/service/", "");
|
||||
const inst: any = files[i].default;
|
||||
|
||||
@ -15,9 +15,9 @@ export default function (app: any) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let list = path.split("/");
|
||||
let parents = list.slice(0, list.length - 1);
|
||||
let name = last(list).replace(".ts", "");
|
||||
const list = path.split("/");
|
||||
const parents = list.slice(0, list.length - 1);
|
||||
const name = last(list).replace(".ts", "");
|
||||
|
||||
let curr: any = modules;
|
||||
let prev: any = null;
|
||||
@ -34,7 +34,7 @@ export default function (app: any) {
|
||||
});
|
||||
|
||||
if (inst) {
|
||||
let service = new inst();
|
||||
const service = new inst();
|
||||
|
||||
if (name == "index") {
|
||||
prev[key] = service;
|
||||
@ -46,6 +46,6 @@ export default function (app: any) {
|
||||
}
|
||||
}
|
||||
|
||||
app.config.globalProperties.$service = store.$service = modules;
|
||||
app.config.globalProperties.service = store.service = modules;
|
||||
app.provide("service", modules);
|
||||
}
|
||||
|
2
src/core/types/index.d.ts
vendored
2
src/core/types/index.d.ts
vendored
@ -2,7 +2,7 @@ import { Store } from "vuex";
|
||||
import { Router } from "vue-router";
|
||||
|
||||
export declare class CoolStore<S> extends Store<S> {
|
||||
$service?: any;
|
||||
service?: any;
|
||||
}
|
||||
|
||||
export declare interface CoolRouter extends Router {
|
||||
|
@ -35,10 +35,7 @@ export default {
|
||||
store.set(key, value);
|
||||
|
||||
if (expires) {
|
||||
store.set(
|
||||
`${key}${this.suffix}`,
|
||||
Date.parse(String(new Date())) + expires * 1000
|
||||
);
|
||||
store.set(`${key}${this.suffix}`, Date.parse(String(new Date())) + expires * 1000);
|
||||
}
|
||||
},
|
||||
|
||||
@ -47,10 +44,7 @@ export default {
|
||||
* @param {string} key 关键字
|
||||
*/
|
||||
isExpired(key: string) {
|
||||
return (
|
||||
(this.getExpiration(key) || 0) - Date.parse(String(new Date())) <=
|
||||
2000
|
||||
);
|
||||
return (this.getExpiration(key) || 0) - Date.parse(String(new Date())) <= 2000;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -83,5 +77,5 @@ export default {
|
||||
*/
|
||||
clearAll() {
|
||||
store.clearAll();
|
||||
},
|
||||
}
|
||||
};
|
||||
|
@ -1,12 +0,0 @@
|
||||
// @ts-nocheck
|
||||
Promise.prototype.done = function (cb: Function) {
|
||||
const P: any = this.constructor;
|
||||
|
||||
return this.then(
|
||||
(value: any) => P.resolve(cb()).then(() => value),
|
||||
(reason: any) =>
|
||||
P.resolve(cb()).then(() => {
|
||||
throw reason;
|
||||
})
|
||||
);
|
||||
};
|
@ -72,15 +72,14 @@ export default defineComponent({
|
||||
const userInfo = computed<any>(() => store.getters.userInfo);
|
||||
|
||||
// 跳转官网
|
||||
function onCommand(name: string) {
|
||||
async function onCommand(name: string) {
|
||||
switch (name) {
|
||||
case "my":
|
||||
router.push("/my/info");
|
||||
break;
|
||||
case "exit":
|
||||
store.dispatch("userLogout").done(() => {
|
||||
href("/login");
|
||||
});
|
||||
await store.dispatch("userLogout");
|
||||
href("/login");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
|
||||
import { createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw } from "vue-router";
|
||||
import { CoolRouter } from "/@/core/types";
|
||||
import { routerMode } from "/@/config/env";
|
||||
|
||||
// 忽略规则
|
||||
const ignore: any = {
|
||||
@ -27,7 +28,7 @@ const routes: Array<RouteRecordRaw> = [
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
history: routerMode == "history" ? createWebHistory() : createWebHashHistory(),
|
||||
routes
|
||||
}) as CoolRouter;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
// @ts-nocheck
|
||||
import path from "path";
|
||||
import type { UserConfig, ConfigEnv } from 'vite';
|
||||
import type { UserConfig, ConfigEnv } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||
import { svgBuilder } from "./src/core/utils/svg";
|
||||
@ -31,27 +30,28 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
server: {
|
||||
port: 9000,
|
||||
hmr: {
|
||||
overlay: true,
|
||||
overlay: true
|
||||
},
|
||||
proxy: {
|
||||
"/dev": {
|
||||
target: "http://127.0.0.1:8001",
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/dev/, "")
|
||||
rewrite: (path) => path.replace(/^\/dev/, "")
|
||||
},
|
||||
|
||||
"/pro": {
|
||||
target: "https://show.cool-admin.com",
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/pro/, "/api")
|
||||
rewrite: (path) => path.replace(/^\/pro/, "/api")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
],
|
||||
exclude: ['vue-demi'],
|
||||
build: {
|
||||
sourcemap: false,
|
||||
polyfillDynamicImport: false
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ["vue-demi"]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
Arguments:
|
||||
D:\node\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js remove @types/node
|
||||
D:\node\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js add vite-plugin-style-import -D
|
||||
|
||||
PATH:
|
||||
C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;D:\Tortoise\bin;C:\Program Files\Git\cmd;C:\Program Files\python;C:\Program Files\python\Scripts;;D:\BtSoft\panel\script;D:\node\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;D:\cool\Microsoft VS Code\bin;C:\Users\Administrator\AppData\Roaming\npm
|
||||
@ -14,7 +14,7 @@ Platform:
|
||||
win32 x64
|
||||
|
||||
Trace:
|
||||
Error: EPERM: operation not permitted, copyfile 'C:\Users\Administrator\AppData\Local\Yarn\Cache\v6\npm-yallist-2.1.2-1c11f9218f076089a47dd512f93c6699a6a81d52-integrity\node_modules\yallist\README.md' -> 'D:\cool\srcs\admin\front-next\node_modules\editorconfig\node_modules\yallist\README.md'
|
||||
Error: EPERM: operation not permitted, unlink 'D:\cool\srcs\admin\front-next\node_modules\esbuild\esbuild.exe'
|
||||
|
||||
npm manifest:
|
||||
{
|
||||
@ -53,6 +53,8 @@ npm manifest:
|
||||
"vuex": "^4.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.14.168",
|
||||
"@types/node": "^14.14.37",
|
||||
"@typescript-eslint/eslint-plugin": "^4.20.0",
|
||||
"@typescript-eslint/parser": "^4.20.0",
|
||||
"@vitejs/plugin-vue": "^1.1.5",
|
||||
@ -378,6 +380,11 @@ Lockfile:
|
||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
|
||||
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
|
||||
|
||||
"@types/lodash@^4.14.168":
|
||||
version "4.14.168"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.168.tgz#fe24632e79b7ade3f132891afff86caa5e5ce008"
|
||||
integrity sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==
|
||||
|
||||
"@types/node@^14.14.37":
|
||||
version "14.14.37"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e"
|
||||
@ -3374,6 +3381,11 @@ Lockfile:
|
||||
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137"
|
||||
integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=
|
||||
|
||||
ts-promise@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/ts-promise/-/ts-promise-2.2.0.tgz#d2ad7ae4b34c17c31bf407cac2b29e4101ae94d1"
|
||||
integrity sha512-zd4uLOBGg6DPqhX8DL1LW2R9AmwCeeCC2OPfUkStUfBxCsuRE1xtcf0eTPfxpEQpl2el9UzsnXoWBnY4V7rRuA==
|
||||
|
||||
tslib@2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c"
|
||||
|
258
yarn.lock
258
yarn.lock
@ -289,6 +289,14 @@
|
||||
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.9.1.tgz#7f554e7368c9ab679a11f4a042ca17149d70cf12"
|
||||
integrity sha512-DvJbbn3dUgMxDnJLH+RZQPnXak1h4ZVYQ7CWiFWjQwBFkVajT4rfw2PdpHLTSTwxrYfnoEXkuBiwkDm6tPMQeA==
|
||||
|
||||
"@rollup/pluginutils@^4.1.0":
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838"
|
||||
integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==
|
||||
dependencies:
|
||||
estree-walker "^2.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@types/component-emitter@^1.2.10":
|
||||
version "1.2.10"
|
||||
resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.10.tgz#ef5b1589b9f16544642e473db5ea5639107ef3ea"
|
||||
@ -379,10 +387,10 @@
|
||||
"@typescript-eslint/types" "4.20.0"
|
||||
eslint-visitor-keys "^2.0.0"
|
||||
|
||||
"@vitejs/plugin-vue-jsx@^1.1.2":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue-jsx/-/plugin-vue-jsx-1.1.2.tgz#d240d8d73c2f8e34f32ade6d06e709a959d1f2a1"
|
||||
integrity sha512-3m+0amZwkn0g/D3OqqTsG2qe82LvIaQYqAi3Klpx2vEdaBU5pgok5Qlp6eMGr6QQRDLa7HAKZbPCVV5yAPfOpg==
|
||||
"@vitejs/plugin-vue-jsx@^1.1.3":
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue-jsx/-/plugin-vue-jsx-1.1.3.tgz#426c68f8a367a603acb82fca6e2b12506ba9fc8e"
|
||||
integrity sha512-R9wsuNDEKTDG5oXJaFictrw9E5uokniGzi6tvyO5Od02tE4TnOPfgY2BeHKB4f4ldgiZRMhdUhNEsgjoWnct6A==
|
||||
dependencies:
|
||||
"@babel/core" "^7.12.10"
|
||||
"@babel/plugin-syntax-import-meta" "^7.10.4"
|
||||
@ -415,6 +423,17 @@
|
||||
html-tags "^3.1.0"
|
||||
svg-tags "^1.0.0"
|
||||
|
||||
"@vue/compiler-core@3.0.11":
|
||||
version "3.0.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.11.tgz#5ef579e46d7b336b8735228758d1c2c505aae69a"
|
||||
integrity sha512-6sFj6TBac1y2cWCvYCA8YzHJEbsVkX7zdRs/3yK/n1ilvRqcn983XvpBbnN3v4mZ1UiQycTvOiajJmOgN9EVgw==
|
||||
dependencies:
|
||||
"@babel/parser" "^7.12.0"
|
||||
"@babel/types" "^7.12.0"
|
||||
"@vue/shared" "3.0.11"
|
||||
estree-walker "^2.0.1"
|
||||
source-map "^0.6.1"
|
||||
|
||||
"@vue/compiler-core@3.0.9":
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.9.tgz#ec7efa676889aee006fc43739ee4a67a952ac623"
|
||||
@ -426,6 +445,14 @@
|
||||
estree-walker "^2.0.1"
|
||||
source-map "^0.6.1"
|
||||
|
||||
"@vue/compiler-dom@3.0.11":
|
||||
version "3.0.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.11.tgz#b15fc1c909371fd671746020ba55b5dab4a730ee"
|
||||
integrity sha512-+3xB50uGeY5Fv9eMKVJs2WSRULfgwaTJsy23OIltKgMrynnIj8hTYY2UL97HCoz78aDw1VDXdrBQ4qepWjnQcw==
|
||||
dependencies:
|
||||
"@vue/compiler-core" "3.0.11"
|
||||
"@vue/shared" "3.0.11"
|
||||
|
||||
"@vue/compiler-dom@3.0.9":
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.9.tgz#1fd554097d9ab36eca73bc6d0d9607fecf94e71c"
|
||||
@ -464,30 +491,35 @@
|
||||
"@vue/compiler-dom" "3.0.9"
|
||||
"@vue/shared" "3.0.9"
|
||||
|
||||
"@vue/reactivity@3.0.9":
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.9.tgz#875f241b8c10262560b190ccdeff2d0ab7053e11"
|
||||
integrity sha512-W1AbGhzphVjY+TL32lQDwLDNvLzZKOcUgaIaLOoALWMtjzN4ExOUJzrR1FC3ynlpMHIEfcUo8GPgfnNmvMGdgQ==
|
||||
"@vue/reactivity@3.0.11":
|
||||
version "3.0.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.11.tgz#07b588349fd05626b17f3500cbef7d4bdb4dbd0b"
|
||||
integrity sha512-SKM3YKxtXHBPMf7yufXeBhCZ4XZDKP9/iXeQSC8bBO3ivBuzAi4aZi0bNoeE2IF2iGfP/AHEt1OU4ARj4ao/Xw==
|
||||
dependencies:
|
||||
"@vue/shared" "3.0.9"
|
||||
"@vue/shared" "3.0.11"
|
||||
|
||||
"@vue/runtime-core@3.0.9":
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.9.tgz#9665f149468355a524a304cb8f260147a4d294e6"
|
||||
integrity sha512-j94xZ/wRZTVhqpoUgmxBTlojnPFu6TTXNw1Vw8oQkW1ZTGD0IwiJe3ycsKd1bpleXEMVt55GzGlCopI33/Gdmg==
|
||||
"@vue/runtime-core@3.0.11":
|
||||
version "3.0.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.11.tgz#c52dfc6acf3215493623552c1c2919080c562e44"
|
||||
integrity sha512-87XPNwHfz9JkmOlayBeCCfMh9PT2NBnv795DSbi//C/RaAnc/bGZgECjmkD7oXJ526BZbgk9QZBPdFT8KMxkAg==
|
||||
dependencies:
|
||||
"@vue/reactivity" "3.0.9"
|
||||
"@vue/shared" "3.0.9"
|
||||
"@vue/reactivity" "3.0.11"
|
||||
"@vue/shared" "3.0.11"
|
||||
|
||||
"@vue/runtime-dom@3.0.9":
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.9.tgz#16a1d001dc746a9f346ee7fb9de90d52ad097b61"
|
||||
integrity sha512-6NCjpwa5hNBFDdokquAgMl2tNEYyQD6kBy9Mh6M2776bxYLXZCqL4/e0UrpBuBiHTrkAlUGODD7PyYGaqH6fyA==
|
||||
"@vue/runtime-dom@3.0.11":
|
||||
version "3.0.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.11.tgz#7a552df21907942721feb6961c418e222a699337"
|
||||
integrity sha512-jm3FVQESY3y2hKZ2wlkcmFDDyqaPyU3p1IdAX92zTNeCH7I8zZ37PtlE1b9NlCtzV53WjB4TZAYh9yDCMIEumA==
|
||||
dependencies:
|
||||
"@vue/runtime-core" "3.0.9"
|
||||
"@vue/shared" "3.0.9"
|
||||
"@vue/runtime-core" "3.0.11"
|
||||
"@vue/shared" "3.0.11"
|
||||
csstype "^2.6.8"
|
||||
|
||||
"@vue/shared@3.0.11":
|
||||
version "3.0.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.11.tgz#20d22dd0da7d358bb21c17f9bde8628152642c77"
|
||||
integrity sha512-b+zB8A2so8eCE0JsxjL24J7vdGl8rzPQ09hZNhystm+KqSbKcAej1A+Hbva1rCMmTTqA+hFnUSDc5kouEo0JzA==
|
||||
|
||||
"@vue/shared@3.0.9":
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.9.tgz#09882d745ded52b07e4481d036659d733edd2a9a"
|
||||
@ -779,6 +811,14 @@ callsites@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
|
||||
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
|
||||
|
||||
camel-case@^4.1.2:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a"
|
||||
integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==
|
||||
dependencies:
|
||||
pascal-case "^3.1.2"
|
||||
tslib "^2.0.3"
|
||||
|
||||
camelcase@^6.0.0:
|
||||
version "6.2.0"
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809"
|
||||
@ -789,6 +829,15 @@ caniuse-lite@^1.0.30001181:
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001204.tgz#256c85709a348ec4d175e847a3b515c66e79f2aa"
|
||||
integrity sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ==
|
||||
|
||||
capital-case@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669"
|
||||
integrity sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==
|
||||
dependencies:
|
||||
no-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
upper-case-first "^2.0.2"
|
||||
|
||||
chainsaw@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98"
|
||||
@ -824,6 +873,24 @@ chalk@^4.0.0:
|
||||
ansi-styles "^4.1.0"
|
||||
supports-color "^7.1.0"
|
||||
|
||||
change-case@^4.1.2:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/change-case/-/change-case-4.1.2.tgz#fedfc5f136045e2398c0410ee441f95704641e12"
|
||||
integrity sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==
|
||||
dependencies:
|
||||
camel-case "^4.1.2"
|
||||
capital-case "^1.0.4"
|
||||
constant-case "^3.0.4"
|
||||
dot-case "^3.0.4"
|
||||
header-case "^2.0.4"
|
||||
no-case "^3.0.4"
|
||||
param-case "^3.0.4"
|
||||
pascal-case "^3.1.2"
|
||||
path-case "^3.0.4"
|
||||
sentence-case "^3.0.4"
|
||||
snake-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
"chokidar@>=2.0.0 <4.0.0":
|
||||
version "3.5.1"
|
||||
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
|
||||
@ -949,6 +1016,15 @@ consolidate@^0.16.0:
|
||||
dependencies:
|
||||
bluebird "^3.7.2"
|
||||
|
||||
constant-case@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1"
|
||||
integrity sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==
|
||||
dependencies:
|
||||
no-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
upper-case "^2.0.2"
|
||||
|
||||
convert-source-map@^1.7.0:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442"
|
||||
@ -1009,6 +1085,13 @@ debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@~4.3.1:
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
debug@^4.3.2:
|
||||
version "4.3.2"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
|
||||
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
|
||||
@ -1122,6 +1205,14 @@ domutils@^1.5.1:
|
||||
dom-serializer "0"
|
||||
domelementtype "1"
|
||||
|
||||
dot-case@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751"
|
||||
integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==
|
||||
dependencies:
|
||||
no-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
duplexer2@~0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
|
||||
@ -1236,6 +1327,11 @@ es-abstract@^1.18.0-next.1:
|
||||
string.prototype.trimstart "^1.0.4"
|
||||
unbox-primitive "^1.0.0"
|
||||
|
||||
es-module-lexer@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.4.1.tgz#dda8c6a14d8f340a24e34331e0fab0cb50438e0e"
|
||||
integrity sha512-ooYciCUtfw6/d2w56UVeqHPcoCFAiJdz5XOkYpv/Txl1HMUozpXjz/2RIQgqwKdXNDPSF1W7mJCFse3G+HDyAA==
|
||||
|
||||
es-to-primitive@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a"
|
||||
@ -1620,7 +1716,7 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
|
||||
dependencies:
|
||||
is-glob "^4.0.1"
|
||||
|
||||
glob@^7.1.3:
|
||||
glob@^7.1.3, glob@^7.1.6:
|
||||
version "7.1.6"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
|
||||
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
|
||||
@ -1760,6 +1856,14 @@ he@^1.1.1:
|
||||
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
|
||||
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
|
||||
|
||||
header-case@^2.0.4:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/header-case/-/header-case-2.0.4.tgz#5a42e63b55177349cf405beb8d775acabb92c063"
|
||||
integrity sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==
|
||||
dependencies:
|
||||
capital-case "^1.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
html-tags@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.1.0.tgz#7b5e6f7e665e9fb41f30007ed9e0d41e97fb2140"
|
||||
@ -2181,6 +2285,13 @@ lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21:
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
||||
lower-case@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28"
|
||||
integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==
|
||||
dependencies:
|
||||
tslib "^2.0.3"
|
||||
|
||||
lru-cache@^4.1.5:
|
||||
version "4.1.5"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
|
||||
@ -2364,6 +2475,14 @@ neo-async@^2.6.2:
|
||||
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
|
||||
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
|
||||
|
||||
no-case@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d"
|
||||
integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==
|
||||
dependencies:
|
||||
lower-case "^2.0.2"
|
||||
tslib "^2.0.3"
|
||||
|
||||
node-releases@^1.1.70:
|
||||
version "1.1.71"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb"
|
||||
@ -2466,6 +2585,14 @@ optionator@^0.9.1:
|
||||
type-check "^0.4.0"
|
||||
word-wrap "^1.2.3"
|
||||
|
||||
param-case@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5"
|
||||
integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==
|
||||
dependencies:
|
||||
dot-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
parchment@^1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/parchment/-/parchment-1.1.4.tgz#aeded7ab938fe921d4c34bc339ce1168bc2ffde5"
|
||||
@ -2488,11 +2615,27 @@ parseuri@0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.6.tgz#e1496e829e3ac2ff47f39a4dd044b32823c4a25a"
|
||||
integrity sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==
|
||||
|
||||
pascal-case@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb"
|
||||
integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==
|
||||
dependencies:
|
||||
no-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
pascalcase@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
|
||||
integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=
|
||||
|
||||
path-case@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/path-case/-/path-case-3.0.4.tgz#9168645334eb942658375c56f80b4c0cb5f82c6f"
|
||||
integrity sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==
|
||||
dependencies:
|
||||
dot-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
@ -2513,7 +2656,7 @@ path-type@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
|
||||
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
|
||||
|
||||
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1:
|
||||
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1, picomatch@^2.2.2:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
|
||||
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
|
||||
@ -2914,6 +3057,15 @@ semver@^7.2.1, semver@^7.3.2:
|
||||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
|
||||
sentence-case@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-3.0.4.tgz#3645a7b8c117c787fde8702056225bb62a45131f"
|
||||
integrity sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==
|
||||
dependencies:
|
||||
no-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
upper-case-first "^2.0.2"
|
||||
|
||||
set-value@^2.0.0, set-value@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
|
||||
@ -2967,6 +3119,14 @@ slice-ansi@^4.0.0:
|
||||
astral-regex "^2.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
|
||||
snake-case@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c"
|
||||
integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==
|
||||
dependencies:
|
||||
dot-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
snapdragon-node@^2.0.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
|
||||
@ -3310,6 +3470,11 @@ tslib@^1.8.1:
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||
|
||||
tslib@^2.0.3:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a"
|
||||
integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==
|
||||
|
||||
tsutils@^3.17.1:
|
||||
version "3.21.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
|
||||
@ -3393,6 +3558,20 @@ unzipper@latest:
|
||||
readable-stream "~2.3.6"
|
||||
setimmediate "~1.0.4"
|
||||
|
||||
upper-case-first@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-2.0.2.tgz#992c3273f882abd19d1e02894cc147117f844324"
|
||||
integrity sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==
|
||||
dependencies:
|
||||
tslib "^2.0.3"
|
||||
|
||||
upper-case@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-2.0.2.tgz#d89810823faab1df1549b7d97a76f8662bae6f7a"
|
||||
integrity sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==
|
||||
dependencies:
|
||||
tslib "^2.0.3"
|
||||
|
||||
uri-js@^4.2.2:
|
||||
version "4.4.1"
|
||||
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
|
||||
@ -3432,6 +3611,17 @@ v8-compile-cache@^2.0.3:
|
||||
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
|
||||
integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==
|
||||
|
||||
vite-plugin-style-import@^0.9.1:
|
||||
version "0.9.1"
|
||||
resolved "https://registry.yarnpkg.com/vite-plugin-style-import/-/vite-plugin-style-import-0.9.1.tgz#259a0358c20628e9814cc6c4cf25f389b5761945"
|
||||
integrity sha512-qQmeglG+3kYjHPq+XhyKOsXrKm1k3zLcEicTeFKcU+mbzhQA6lCaIn9EpBgAd7mSBF5HDiMNClCfpoSkShJMyw==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^4.1.0"
|
||||
change-case "^4.1.2"
|
||||
debug "^4.3.2"
|
||||
es-module-lexer "^0.4.1"
|
||||
magic-string "^0.25.7"
|
||||
|
||||
vite-svg-loader@^1.5.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/vite-svg-loader/-/vite-svg-loader-1.5.1.tgz#90f8fc079ff6651d7be11e07714fbe2dbab9f346"
|
||||
@ -3439,10 +3629,10 @@ vite-svg-loader@^1.5.1:
|
||||
dependencies:
|
||||
"@vue/compiler-sfc" "^3.0.5"
|
||||
|
||||
vite@^2.1.3:
|
||||
version "2.1.3"
|
||||
resolved "https://registry.yarnpkg.com/vite/-/vite-2.1.3.tgz#a31a844d26d3846b5a78f06970d1ea1f8a442955"
|
||||
integrity sha512-bUzArZIUwADVJS/3ywCr4KKFn3a7izs4M87ZDlAlY2V34E4g1kH6p3sVNAh8/IXCn/56fwgMh3rRavPUW7qEQQ==
|
||||
vite@^2.1.5:
|
||||
version "2.1.5"
|
||||
resolved "https://registry.yarnpkg.com/vite/-/vite-2.1.5.tgz#4857da441c62f7982c83cbd5f42a00330f20c9c1"
|
||||
integrity sha512-tYU5iaYeUgQYvK/CNNz3tiJ8vYqPWfCE9IQ7K0iuzYovWw7lzty7KRYGWwV3CQPh0NKxWjOczAqiJsCL0Xb+Og==
|
||||
dependencies:
|
||||
esbuild "^0.9.3"
|
||||
postcss "^8.2.1"
|
||||
@ -3488,14 +3678,14 @@ vue-tsc@^0.0.8:
|
||||
dependencies:
|
||||
unzipper latest
|
||||
|
||||
vue@^3.0.9:
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.9.tgz#c68ffc0e4aa2b0f1905124a9037b6e352de469ad"
|
||||
integrity sha512-MOvqDpvDslMWJo5kyGW1nTsTIPAuSzgVqmlzSQInIEqkHOu16pNbXuTjnG7jc/yIvQYFSQZqv6Pvad0iO5QkyQ==
|
||||
vue@^3.0.11:
|
||||
version "3.0.11"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.11.tgz#c82f9594cbf4dcc869241d4c8dd3e08d9a8f4b5f"
|
||||
integrity sha512-3/eUi4InQz8MPzruHYSTQPxtM3LdZ1/S/BvaU021zBnZi0laRUyH6pfuE4wtUeLvI8wmUNwj5wrZFvbHUXL9dw==
|
||||
dependencies:
|
||||
"@vue/compiler-dom" "3.0.9"
|
||||
"@vue/runtime-dom" "3.0.9"
|
||||
"@vue/shared" "3.0.9"
|
||||
"@vue/compiler-dom" "3.0.11"
|
||||
"@vue/runtime-dom" "3.0.11"
|
||||
"@vue/shared" "3.0.11"
|
||||
|
||||
vuedraggable@^4.0.1:
|
||||
version "4.0.1"
|
||||
|
Loading…
Reference in New Issue
Block a user