Merge branch 'ts' into dev

# Conflicts:
#	package.json
#	src/layout/components/TagsView/index.vue
This commit is contained in:
LiuHao 2023-05-06 09:25:05 +08:00
commit bf4a8543ca
23 changed files with 239 additions and 164 deletions

View File

@ -70,11 +70,11 @@
"unplugin-auto-import": "0.13.0", "unplugin-auto-import": "0.13.0",
"unplugin-icons": "0.15.1", "unplugin-icons": "0.15.1",
"unplugin-vue-components": "0.23.0", "unplugin-vue-components": "0.23.0",
"vite": "4.3.1",
"vite-plugin-compression": "0.5.1", "vite-plugin-compression": "0.5.1",
"vite-plugin-svg-icons": "2.0.1", "vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-setup-extend": "^0.4.0", "vite-plugin-vue-setup-extend": "^0.4.0",
"vitest": "^0.29.7", "vitest": "^0.29.7",
"vite": "4.3.1",
"vue-eslint-parser": "9.1.0", "vue-eslint-parser": "9.1.0",
"vue-tsc": "0.35.0" "vue-tsc": "0.35.0"
} }

View File

@ -5,7 +5,7 @@ import { AxiosPromise } from 'axios';
// 查询OSS对象存储列表 // 查询OSS对象存储列表
export function listOss(query: OssQuery): AxiosPromise<OssVO[]> { export function listOss(query: OssQuery): AxiosPromise<OssVO[]> {
return request({ return request({
url: '/system/oss/list', url: '/resource/oss/list',
method: 'get', method: 'get',
params: query params: query
}); });
@ -14,7 +14,7 @@ export function listOss(query: OssQuery): AxiosPromise<OssVO[]> {
// 查询OSS对象基于id串 // 查询OSS对象基于id串
export function listByIds(ossId: string | number): AxiosPromise<OssVO[]> { export function listByIds(ossId: string | number): AxiosPromise<OssVO[]> {
return request({ return request({
url: '/system/oss/listByIds/' + ossId, url: '/resource/oss/listByIds/' + ossId,
method: 'get' method: 'get'
}); });
} }
@ -22,7 +22,7 @@ export function listByIds(ossId: string | number): AxiosPromise<OssVO[]> {
// 删除OSS对象存储 // 删除OSS对象存储
export function delOss(ossId: string | number | Array<string | number>) { export function delOss(ossId: string | number | Array<string | number>) {
return request({ return request({
url: '/system/oss/' + ossId, url: '/resource/oss/' + ossId,
method: 'delete' method: 'delete'
}); });
} }

View File

@ -5,7 +5,7 @@ import { AxiosPromise } from 'axios';
// 查询对象存储配置列表 // 查询对象存储配置列表
export function listOssConfig(query: OssConfigQuery): AxiosPromise<OssConfigVO[]> { export function listOssConfig(query: OssConfigQuery): AxiosPromise<OssConfigVO[]> {
return request({ return request({
url: '/system/oss/config/list', url: '/resource/oss/config/list',
method: 'get', method: 'get',
params: query params: query
}); });
@ -14,7 +14,7 @@ export function listOssConfig(query: OssConfigQuery): AxiosPromise<OssConfigVO[]
// 查询对象存储配置详细 // 查询对象存储配置详细
export function getOssConfig(ossConfigId: string | number): AxiosPromise<OssConfigVO> { export function getOssConfig(ossConfigId: string | number): AxiosPromise<OssConfigVO> {
return request({ return request({
url: '/system/oss/config/' + ossConfigId, url: '/resource/oss/config/' + ossConfigId,
method: 'get' method: 'get'
}); });
} }
@ -22,7 +22,7 @@ export function getOssConfig(ossConfigId: string | number): AxiosPromise<OssConf
// 新增对象存储配置 // 新增对象存储配置
export function addOssConfig(data: OssConfigForm) { export function addOssConfig(data: OssConfigForm) {
return request({ return request({
url: '/system/oss/config', url: '/resource/oss/config',
method: 'post', method: 'post',
data: data data: data
}); });
@ -31,7 +31,7 @@ export function addOssConfig(data: OssConfigForm) {
// 修改对象存储配置 // 修改对象存储配置
export function updateOssConfig(data: OssConfigForm) { export function updateOssConfig(data: OssConfigForm) {
return request({ return request({
url: '/system/oss/config', url: '/resource/oss/config',
method: 'put', method: 'put',
data: data data: data
}); });
@ -40,7 +40,7 @@ export function updateOssConfig(data: OssConfigForm) {
// 删除对象存储配置 // 删除对象存储配置
export function delOssConfig(ossConfigId: string | number | Array<string | number>) { export function delOssConfig(ossConfigId: string | number | Array<string | number>) {
return request({ return request({
url: '/system/oss/config/' + ossConfigId, url: '/resource/oss/config/' + ossConfigId,
method: 'delete' method: 'delete'
}); });
} }
@ -53,7 +53,7 @@ export function changeOssConfigStatus(ossConfigId: string | number, status: stri
configKey configKey
}; };
return request({ return request({
url: '/system/oss/config/changeStatus', url: '/resource/oss/config/changeStatus',
method: 'put', method: 'put',
data: data data: data
}); });

View File

@ -1,6 +1,6 @@
#app { #app {
.main-container { .main-container {
min-height: 100%; height: 100%;
transition: margin-left 0.28s; transition: margin-left 0.28s;
margin-left: $base-sidebar-width; margin-left: $base-sidebar-width;
position: relative; position: relative;

View File

@ -2,13 +2,9 @@
<div> <div>
<template v-for="(item, index) in options"> <template v-for="(item, index) in options">
<template v-if="values.includes(item.value)"> <template v-if="values.includes(item.value)">
<span <span v-if="item.elTagType == 'default' || item.elTagType == ''" :key="item.value" :index="index" :class="item.elTagClass">
v-if="item.elTagType == 'default' || item.elTagType == ''" {{ item.label + " " }}
:key="item.value" </span>
:index="index"
:class="item.elTagClass"
>{{ item.label }}</span
>
<el-tag <el-tag
v-else v-else
:disable-transitions="true" :disable-transitions="true"
@ -16,16 +12,21 @@
:index="index" :index="index"
:type="item.elTagType === 'primary' ? '' : item.elTagType" :type="item.elTagType === 'primary' ? '' : item.elTagType"
:class="item.elTagClass" :class="item.elTagClass"
>{{ item.label }}</el-tag
> >
{{ item.label + " " }}
</el-tag>
</template> </template>
</template> </template>
<template v-if="unmatch && showValue">
{{ unmatchArray }}
</template>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { PropType } from 'vue'; import { PropType } from 'vue';
const props = defineProps({ const props = defineProps({
// //
options: { options: {
@ -33,16 +34,63 @@ const props = defineProps({
default: null, default: null,
}, },
// //
value: [Number, String, Array], value: [Number, String, Array] as PropType<number | string | Array<number | string>>,
}) // value
showValue: {
type: Boolean as PropType<boolean>,
default: true,
},
});
const values = computed(() => { const values = computed(() => {
if (props.value !== null && typeof props.value !== 'undefined') { if (props.value !== null && typeof props.value !== "undefined") {
return Array.isArray(props.value) ? props.value : [String(props.value)]; return Array.isArray(props.value) ? props.value : [String(props.value)];
} else { } else {
return []; return [];
} }
}) });
const unmatch = computed(() => {
if (props.value !== null && typeof props.value !== "undefined") {
//
if (!Array.isArray(props.value)) {
if (props.options.some((v) => v.value == props.value)) {
return false;
}
return true;
}
return true;
}
// value
return false;
});
const unmatchArray = computed(() => {
//
const itemUnmatchArray: Array<string | number> = [];
if (props.value !== null && typeof props.value !== "undefined") {
//
if (!Array.isArray(props.value)) {
itemUnmatchArray.push(props.value);
} else {
// Array
props.value.forEach((item) => {
if (!props.options.some((v) => v.value == item)) {
itemUnmatchArray.push(item);
}
});
}
}
// value
return handleArray(itemUnmatchArray);
});
const handleArray = (array: Array<string | number>) => {
if (array.length === 0) return "";
return array.reduce((pre, cur) => {
return pre + " " + cur;
});
}
</script> </script>
<style scoped> <style scoped>

View File

@ -68,7 +68,7 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const upload = reactive<UploadOption>({ const upload = reactive<UploadOption>({
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
url: import.meta.env.VITE_APP_BASE_API + '/system/oss/upload' url: import.meta.env.VITE_APP_BASE_API + '/resource/oss/upload'
}) })
const myQuillEditor = ref(); const myQuillEditor = ref();

View File

@ -78,7 +78,7 @@ const number = ref(0);
const uploadList = ref<any[]>([]); const uploadList = ref<any[]>([]);
const baseUrl = import.meta.env.VITE_APP_BASE_API; const baseUrl = import.meta.env.VITE_APP_BASE_API;
const uploadFileUrl = ref(baseUrl + "/system/oss/upload"); // const uploadFileUrl = ref(baseUrl + "/resource/oss/upload"); //
const headers = ref({ Authorization: "Bearer " + getToken() }); const headers = ref({ Authorization: "Bearer " + getToken() });
const fileList = ref<any[]>([]); const fileList = ref<any[]>([]);

View File

@ -2,7 +2,7 @@
<div class="relative" :style="{ width: width }"> <div class="relative" :style="{ width: width }">
<el-input v-model="modelValue" readonly @click="visible = !visible" placeholder="点击选择图标"> <el-input v-model="modelValue" readonly @click="visible = !visible" placeholder="点击选择图标">
<template #prepend> <template #prepend>
<svg-icon :icon-class="modelValue as string"></svg-icon> <svg-icon :icon-class="modelValue as string" />
</template> </template>
</el-input> </el-input>
@ -19,7 +19,7 @@
<el-scrollbar height="w-[200px]"> <el-scrollbar height="w-[200px]">
<ul class="icon-list"> <ul class="icon-list">
<el-tooltip v-for="(iconName, index) in iconNames" :key="index" :content="iconName" placement="bottom" effect="light"> <el-tooltip v-for="(iconName, index) in iconNames" :key="index" :content="iconName" placement="bottom" effect="light">
<li class="icon-item" @click="selectedIcon(iconName)"> <li :class="['icon-item', {active: modelValue == iconName}]" @click="selectedIcon(iconName)">
<svg-icon color="var(--el-text-color-regular)" :icon-class="iconName" /> <svg-icon color="var(--el-text-color-regular)" :icon-class="iconName" />
</li> </li>
</el-tooltip> </el-tooltip>
@ -63,7 +63,6 @@ const filterIcons = () => {
iconNames.value = icons; iconNames.value = icons;
} }
} }
/** /**
* 选择图标 * 选择图标
* @param iconName 选择的图标名称 * @param iconName 选择的图标名称
@ -101,5 +100,9 @@ const selectedIcon = (iconName: string) => {
transform: scaleX(1.1); transform: scaleX(1.1);
} }
} }
.active {
border-color: var(--el-color-primary);
color: var(--el-color-primary);
}
} }
</style> </style>

View File

@ -76,7 +76,7 @@ const dialogImageUrl = ref("");
const dialogVisible = ref(false); const dialogVisible = ref(false);
const baseUrl = import.meta.env.VITE_APP_BASE_API; const baseUrl = import.meta.env.VITE_APP_BASE_API;
const uploadImgUrl = ref(baseUrl + "/system/oss/upload"); // const uploadImgUrl = ref(baseUrl + "/resource/oss/upload"); //
const headers = ref({ Authorization: "Bearer " + getToken() }); const headers = ref({ Authorization: "Bearer " + getToken() });
const fileList = ref<any[]>([]); const fileList = ref<any[]>([]);

View File

@ -104,7 +104,7 @@ const setVisibleNumber = () => {
visibleNumber.value = parseInt(String(width / 85)); visibleNumber.value = parseInt(String(width / 85));
} }
const handleSelect = (key: string, keyPath: string[]) => { const handleSelect = (key: string) => {
currentIndex.value = key; currentIndex.value = key;
const route = routers.value.find(item => item.path === key); const route = routers.value.find(item => item.path === key);
if (isHttp(key)) { if (isHttp(key)) {
@ -112,7 +112,13 @@ const handleSelect = (key: string, keyPath: string[]) => {
window.open(key, "_blank"); window.open(key, "_blank");
} else if (!route || !route.children) { } else if (!route || !route.children) {
// //
router.push({ path: key, fullPath: '' }); const routeMenu = childrenMenus.value.find(item => item.path === key);
if (routeMenu && routeMenu.query) {
let query = JSON.parse(routeMenu.query);
router.push({ path: key, query: query });
} else {
router.push({ path: key });
}
appStore.toggleSideBarHide(true); appStore.toggleSideBarHide(true);
} else { } else {
// //

View File

@ -56,3 +56,25 @@ watch(()=> useSettingsStore().animationEnable, (val) => {
} }
} }
</style> </style>
<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
.fixed-header {
padding-right: 6px;
}
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background-color: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background-color: #c0c0c0;
border-radius: 3px;
}
</style>

View File

@ -96,7 +96,7 @@ defineExpose({
bottom: 0px; bottom: 0px;
} }
:deep(.el-scrollbar__wrap) { :deep(.el-scrollbar__wrap) {
height: 49px; height: 39px;
} }
} }
</style> </style>

View File

@ -246,9 +246,10 @@ onMounted(() => {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
height: 26px; height: 26px;
line-height: 26px; line-height: 23px;
background-color: var(--el-bg-color); background-color: var(--el-bg-color);
border: 1px solid var(--el-border-color-light); border: 1px solid var(--el-border-color-light);
color: #495060;
padding: 0 8px; padding: 0 8px;
font-size: 12px; font-size: 12px;
margin-left: 5px; margin-left: 5px;

View File

@ -1,9 +1,16 @@
<template> <template>
<div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }"> <div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }">
<el-scrollbar> <div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<side-bar v-if="!sidebar.hide" class="sidebar-container" /> <side-bar v-if="!sidebar.hide" class="sidebar-container" />
<div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container"> <div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container">
<!-- <el-scrollbar>
<div :class="{ 'fixed-header': fixedHeader }">
<navbar ref="navbarRef" @setLayout="setLayout" />
<tags-view v-if="needTagsView" />
</div>
<app-main />
<settings ref="settingRef" />
</el-scrollbar> -->
<div :class="{ 'fixed-header': fixedHeader }"> <div :class="{ 'fixed-header': fixedHeader }">
<navbar ref="navbarRef" @setLayout="setLayout" /> <navbar ref="navbarRef" @setLayout="setLayout" />
<tags-view v-if="needTagsView" /> <tags-view v-if="needTagsView" />
@ -11,7 +18,6 @@
<app-main /> <app-main />
<settings ref="settingRef" /> <settings ref="settingRef" />
</div> </div>
</el-scrollbar>
</div> </div>
</template> </template>
@ -78,18 +84,6 @@ const setLayout = () => {
height: 100%; height: 100%;
width: 100%; width: 100%;
.el-scrollbar {
height: 100%;
}
:deep(.el-scrollbar__bar).is-vertical {
z-index: 10;
}
:deep(.el-scrollbar__wrap) {
overflow-x: hidden;
}
&.mobile.openSidebar { &.mobile.openSidebar {
position: fixed; position: fixed;
top: 0; top: 0;

View File

@ -9,7 +9,7 @@ const baseURL = import.meta.env.VITE_APP_BASE_API;
let downloadLoadingInstance: LoadingInstance; let downloadLoadingInstance: LoadingInstance;
export default { export default {
async oss(ossId: string | number) { async oss(ossId: string | number) {
const url = baseURL + '/system/oss/download/' + ossId; const url = baseURL + '/resource/oss/download/' + ossId;
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' }); downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
try { try {
const res = await axios({ const res = await axios({

View File

@ -134,7 +134,7 @@ export const dynamicRoutes: RouteOption[] = [
path: '/system/oss-config', path: '/system/oss-config',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['monitor:job:list'], permissions: ['system:oss:list'],
children: [ children: [
{ {
path: 'index', path: 'index',

View File

@ -13,6 +13,7 @@ declare module 'vue-router' {
title: string; title: string;
icon: string; icon: string;
}; };
query?: string;
} & RouteRecordRaw; } & RouteRecordRaw;
interface _RouteLocationBase { interface _RouteLocationBase {

View File

@ -232,7 +232,7 @@ const handleAdd = (row?: DeptVO) => {
nextTick(() => { nextTick(() => {
reset(); reset();
if (row && row.deptId) { if (row && row.deptId) {
form.value.parentId = row?.parentId; form.value.parentId = row?.deptId;
} }
}) })
} }

View File

@ -63,7 +63,7 @@
:total="total" :total="total"
v-model:page="queryParams.pageNum" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="handleQuery" @pagination="getList"
/> />
<select-user ref="selectRef" :roleId="queryParams.roleId" @ok="handleQuery" /> <select-user ref="selectRef" :roleId="queryParams.roleId" @ok="handleQuery" />
</el-card> </el-card>

View File

@ -95,7 +95,7 @@
v-model:total="total" v-model:total="total"
v-model:page="queryParams.pageNum" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="handleQuery" @pagination="getList"
/> />
</el-card> </el-card>

View File

@ -146,7 +146,7 @@
:total="total" :total="total"
v-model:page="queryParams.pageNum" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="handleQuery" @pagination="getList"
/> />
</el-card> </el-card>
</el-col> </el-col>

View File

@ -168,7 +168,7 @@ const getFormPromise = (form: any) => {
}); });
} }
const close = () => { const close = () => {
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: route.query.pageNum } }; const obj = {path: "/tool/gen", query: {t: Date.now(), pageNum: route.query.pageNum}};
proxy?.$tab.closeOpenPage(obj); proxy?.$tab.closeOpenPage(obj);
} }
@ -177,7 +177,6 @@ const close = () => {
if (tableId) { if (tableId) {
// //
const res = await getGenTable(tableId); const res = await getGenTable(tableId);
res.data.info.parentMenuId = Number(res.data.info.parentMenuId);
columns.value = res.data.rows; columns.value = res.data.rows;
info.value = res.data.info; info.value = res.data.info;
tables.value = res.data.tables; tables.value = res.data.tables;

View File

@ -226,7 +226,7 @@ import { listMenu } from '@/api/system/menu';
import { ComponentInternalInstance, PropType } from 'vue'; import { ComponentInternalInstance, PropType } from 'vue';
interface MenuOptionsType { interface MenuOptionsType {
menuId: number; menuId: number | string;
menuName: string; menuName: string;
children: MenuOptionsType[] | undefined; children: MenuOptionsType[] | undefined;
} }
@ -252,11 +252,11 @@ const table = computed(() => props.tables);
// //
const rules = ref({ const rules = ref({
tplCategory: [{ required: true, message: "请选择生成模板", trigger: "blur" }], tplCategory: [{required: true, message: "请选择生成模板", trigger: "blur"}],
packageName: [{ required: true, message: "请输入生成包路径", trigger: "blur" }], packageName: [{required: true, message: "请输入生成包路径", trigger: "blur"}],
moduleName: [{ required: true, message: "请输入生成模块名", trigger: "blur" }], moduleName: [{required: true, message: "请输入生成模块名", trigger: "blur"}],
businessName: [{ required: true, message: "请输入生成业务名", trigger: "blur" }], businessName: [{required: true, message: "请输入生成业务名", trigger: "blur"}],
functionName: [{ required: true, message: "请输入生成功能名", trigger: "blur" }] functionName: [{required: true, message: "请输入生成功能名", trigger: "blur"}]
}); });
const subSelectChange = () => { const subSelectChange = () => {
infoForm.value.subTableFkName = ""; infoForm.value.subTableFkName = "";
@ -280,6 +280,7 @@ const setSubTableColumns = (value: string) => {
/** 查询菜单下拉树结构 */ /** 查询菜单下拉树结构 */
const getMenuTreeselect = async () => { const getMenuTreeselect = async () => {
const res = await listMenu(); const res = await listMenu();
res.data.forEach(m => m.menuId = m.menuId.toString());
const data = proxy?.handleTree<MenuOptionsType>(res.data, "menuId"); const data = proxy?.handleTree<MenuOptionsType>(res.data, "menuId");
if (data) { if (data) {
menuOptions.value = data menuOptions.value = data