diff --git a/src/components/piAsset/index.vue b/src/components/piAsset/index.vue index e3ef373..719da0f 100644 --- a/src/components/piAsset/index.vue +++ b/src/components/piAsset/index.vue @@ -1,8 +1,8 @@ diff --git a/src/components/piUpload/file.vue b/src/components/piUpload/file.vue index ef443e7..2314f80 100644 --- a/src/components/piUpload/file.vue +++ b/src/components/piUpload/file.vue @@ -40,7 +40,7 @@ const props = defineProps({ name: { type: String, default: config.filename }, data: { type: Object, default: () => {} }, accept: { type: String, default: "" }, - maxSize: { type: Number, default: config.maxSiz }, + maxSize: { type: Number, default: config.maxSize }, limit: { type: Number, default: 0 }, autoUpload: { type: Boolean, default: true }, showFileList: { type: Boolean, default: true }, diff --git a/src/components/piUpload/index.vue b/src/components/piUpload/index.vue index ccfef9b..62e9ab1 100644 --- a/src/components/piUpload/index.vue +++ b/src/components/piUpload/index.vue @@ -75,7 +75,7 @@ const props = defineProps({ name: { type: String, default: config.filename }, data: { type: Object, default: () => {} }, accept: { type: String, default: "image/gif, image/jpeg, image/png" }, - maxSize: { type: Number, default: config.maxSiz }, + maxSize: { type: Number, default: config.maxSize }, limit: { type: Number, default: 1 }, autoUpload: { type: Boolean, default: true }, showFileList: { type: Boolean, default: false }, diff --git a/src/components/piUpload/multiple.vue b/src/components/piUpload/multiple.vue index bea76cf..f83cdb7 100644 --- a/src/components/piUpload/multiple.vue +++ b/src/components/piUpload/multiple.vue @@ -62,7 +62,7 @@ const props = defineProps({ name: { type: String, default: config.filename }, data: { type: Object, default: () => {} }, accept: { type: String, default: "image/gif, image/jpeg, image/png" }, - maxSize: { type: Number, default: config.maxSiz }, + maxSize: { type: Number, default: config.maxSize }, limit: { type: Number, default: 0 }, autoUpload: { type: Boolean, default: true }, showFileList: { type: Boolean, default: true }, diff --git a/src/config/tableCard.ts b/src/config/tableCard.ts new file mode 100644 index 0000000..a9351cd --- /dev/null +++ b/src/config/tableCard.ts @@ -0,0 +1,23 @@ +import tools from '@/utils/tools' + +export default { + successCode: 0, //请求完成代码 + pageSize: 12, //表格每一页条数 + pageSizes: [12, 24, 48, 72, 96, 120], //表格可设置的一页条数 + paginationLayout: "total, sizes, prev, pager, next, jumper", //表格分页布局,可设置"total, sizes, prev, pager, next, jumper" + parseData: function (res) { //数据分析 + return { + data: res.data, //分析无分页的数据字段结构 + rows: res.data, //分析行数据字段结构 + total: res.count, //分析总数字段结构 + msg: res.msg, //分析描述字段结构 + code: res.code //分析状态字段结构 + } + }, + request: { //请求规定字段 + page: 'page', //规定当前分页字段 + pageSize: 'limit', //规定一页条数字段 + prop: 'prop', //规定排序字段名字段 + order: 'order' //规定排序规格字段 + } +} diff --git a/src/config/upload.ts b/src/config/upload.ts index 184b092..96f795a 100644 --- a/src/config/upload.ts +++ b/src/config/upload.ts @@ -1,7 +1,5 @@ import API from "@/api"; -//上传配置 - export default { api: API.system.upload, //上传请求API对象 filename: "file", //form请求时文件的key diff --git a/src/layout/components/tags.vue b/src/layout/components/tags.vue index ff42f65..c01ebc3 100644 --- a/src/layout/components/tags.vue +++ b/src/layout/components/tags.vue @@ -22,33 +22,54 @@ - {{t('menu.refresh')}} + {{ t('menu.refresh') }}
  • - {{t('menu.closeTab')}} + {{ t('menu.closeTab') }}
  • - {{t('menu.closeOtherTabs')}} + {{ t('menu.closeOtherTabs') }} +
  • + +
  • + + + + {{ t('menu.closeLeft') }} +
  • + +
  • + + + + {{ t('menu.closeRight') }} +
  • + +
  • + + + + {{ t('menu.closeAll') }}

  • - {{t('menu.maximize')}} + {{ t('menu.maximize') }}
  • - {{t('menu.openInNewWindow')}} + {{ t('menu.openInNewWindow') }}
  • @@ -82,8 +103,9 @@ let contextMenuItem = ref(null) let left = ref(0) let top = ref(0) let tagList = viewTags.viewTags - let tipDisplayed = ref(false) +let showLeft = ref(true) +let showRight = ref(true) if (dashboardRoute) { dashboardRoute.fullPath = dashboardRoute.path @@ -172,7 +194,7 @@ function isActive(r) { //关闭tag function closeSelectedTag(tag, autoPushLatestView = true) { - const nowTagIndex = tagList.findIndex(item => item.fullPath == tag.fullPath) + const nowTagIndex = tagList.findIndex(item => item.fullPath === tag.fullPath) viewTags.removeViewTags(tag) iframe.removeIframeList(tag) keepAlive.removeKeepLive(tag.name) @@ -188,6 +210,17 @@ function closeSelectedTag(tag, autoPushLatestView = true) { //tag右键 function openContextMenu(e, tag) { + // 关闭左侧,关闭右侧处理 + showLeft.value = true + showRight.value = true + const index = tagList.findIndex(i => i.fullPath === tag.fullPath); + if (index === 0) { + showLeft.value = false + } + if (index + 1 === tagList.length) { + showRight.value = false + } + // 后续处理 contextMenuItem = tag; contextMenuVisible.value = true; left.value = e.clientX + 1; @@ -214,7 +247,7 @@ function refreshTab() { const nowTag = contextMenuItem; contextMenuVisible.value = false //判断是否当前路由,否的话跳转 - if (route.fullPath != nowTag.fullPath) { + if (route.fullPath !== nowTag.fullPath) { router.push({ path: nowTag.fullPath, query: nowTag.query @@ -244,7 +277,7 @@ function closeTabs() { function closeOtherTabs() { var nowTag = contextMenuItem; //判断是否当前路由,否的话跳转 - if (route.fullPath != nowTag.fullPath) { + if (route.fullPath !== nowTag.fullPath) { router.push({ path: nowTag.fullPath, query: nowTag.query @@ -252,7 +285,7 @@ function closeOtherTabs() { } var tags = [...tagList]; tags.forEach(tag => { - if (tag.meta && tag.meta.affix || nowTag.fullPath == tag.fullPath) { + if (tag.meta && tag.meta.affix || nowTag.fullPath === tag.fullPath) { return true } else { closeSelectedTag(tag, false) @@ -261,6 +294,74 @@ function closeOtherTabs() { contextMenuVisible.value = false } +// 关闭左侧 +function closeLeft() { + const nowTag = contextMenuItem; + //判断是否当前路由,否的话跳转 + if (route.fullPath !== nowTag.fullPath) { + router.push({ + path: nowTag.fullPath, + query: nowTag.query + }) + } + const tags = [...tagList]; + let flag = true; + tags.forEach(tag => { + if (nowTag.fullPath === tag.fullPath) { + flag = false + } + if ((tag.meta && tag.meta.affix) || !flag) { + return true + } else { + closeSelectedTag(tag, false) + } + }) + contextMenuVisible.value = false +} + +// 关闭右侧 +function closeRight() { + const nowTag = contextMenuItem; + //判断是否当前路由,否的话跳转 + if (route.fullPath !== nowTag.fullPath) { + router.push({ + path: nowTag.fullPath, + query: nowTag.query + }) + } + const tags = [...tagList]; + let flag = false; + tags.forEach(tag => { + if (nowTag.fullPath === tag.fullPath) { + flag = true + } + if ((tag.meta && tag.meta.affix) || !flag) { + return true + } else { + closeSelectedTag(tag, false) + } + }) + contextMenuVisible.value = false +} + +// 关闭所有 +function closeAll() { + const tags = [...tagList]; + tags.forEach(tag => { + if (tag.meta && tag.meta.affix) { + return true + } else { + closeSelectedTag(tag, false) + } + }) + // 跳转到后台首页 + router.push({ + path: dashboardRoute.fullPath, + query: dashboardRoute.query + }) + contextMenuVisible.value = false +} + //TAB 最大化 function maximize() { var nowTag = contextMenuItem; diff --git a/src/pi.ts b/src/pi.ts index bcaea2d..430807d 100644 --- a/src/pi.ts +++ b/src/pi.ts @@ -37,7 +37,7 @@ export default { app.component(`ElIcon${icon}`, elIcons[icon]) } //统一注册sc-icon图标 - for(let icon in piIcons.default){ + for (let icon in piIcons.default) { app.component(`PiIcon${icon}`, piIcons.default[icon]) } diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 648c906..ade4cce 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -17,7 +17,7 @@ diff --git a/src/views/system/dict_data/index.vue b/src/views/system/dict_data/index.vue index a6fefd1..3dffc18 100644 --- a/src/views/system/dict_data/index.vue +++ b/src/views/system/dict_data/index.vue @@ -75,11 +75,14 @@ const {proxy} = getCurrentInstance() const tableRef = ref(null) const dialogRef = ref(null) const route = useRoute() +const props = defineProps({ + id: {type: String} +}) let dialogShow = ref(false) let selection = ref([]) let search = ref({ - dict_id: route.query.id ? parseInt(route.query.id) : null, + dict_id: parseInt(props.id), dict_label: null, status: null, })