diff --git a/sample-form-manager-ui/admin/src/api/device.js b/sample-form-manager-ui/admin/src/api/device.js index 70e065652b0f0ba1f3571b5e65ba8fddc9ca9878..8c873610c27f24a9c2e018e13f095d8341d024a2 100644 --- a/sample-form-manager-ui/admin/src/api/device.js +++ b/sample-form-manager-ui/admin/src/api/device.js @@ -63,3 +63,12 @@ export const saveDeviceEnable = (data) => { data, }); }; + +// 鍒犻櫎璁惧 +export const delDevice = (params) => { + return request({ + url: `/sampleform/device/delete`, + method: "get", + params, + }); +}; diff --git a/sample-form-manager-ui/admin/src/assets/css/common.less b/sample-form-manager-ui/admin/src/assets/css/common.less index 7b76c1157624ab7784d98d9858248d01b161561f..4a70334893126062a9cd09a985a31a4ffbec50f8 100644 --- a/sample-form-manager-ui/admin/src/assets/css/common.less +++ b/sample-form-manager-ui/admin/src/assets/css/common.less @@ -30,12 +30,25 @@ .bgg { background-color: #1bbc9b; } - +.bgw{ + background-color: #fff; +} /* 鐗堝績 */ .container { width: 1200px; } - +.container_width { + width: 1880px; +} +.container_height { + height: 820px; +} +.w-full{ + width:100%; +} +.h-full{ + height:100% +} /* 寮规€у竷灞€ */ .flex { display: flex; @@ -129,7 +142,9 @@ .ml25 { margin-left: 25px; } - +.mr5 { + margin-right: 5px; +} .mr10 { margin-right: 10px; } @@ -304,22 +319,6 @@ text-align: right; } -/* title */ -.color_title { - margin-left: 15px; - position: relative; - margin-bottom: 15px; -} -.color_title::before { - content: ""; - width: 4px; - height: 20px; - position: absolute; - top: 0px; - left: -16px; - background-color: #1890ff; -} - /** element-ui */ @@ -351,9 +350,12 @@ .gutter { width: 6px !important; } - +.auto-scroll{ + overflow-y: auto; +} ::-webkit-scrollbar { width: 6px; + height: 6px; overflow-y: auto; } @@ -364,7 +366,7 @@ ::-webkit-scrollbar-track { border-radius: 6px; - background: rgba(0, 0, 0, 0); + background: rbga(0, 0, 0, 0); } .autoWidth { @@ -387,29 +389,47 @@ .el-tooltip__popper { max-width: 20%; } -.el-drawer__header{ +.el-drawer__header { margin-bottom: 20px !important; } -.el-drawer__body{ - border-top:1px solid #ececec; +.el-drawer__body { + border-top: 1px solid #ececec; } -.el-button--primary{ +.el-button--primary { background: linear-gradient(90deg, #5ab6ff, #2e9aff) !important; border: none !important; border-color: transparent !important; } -.el-dialog__header{ - .el-dialog__title{ - color: #1890FF !important; +.el-dialog__header { + .el-dialog__title { + color: #1890ff !important; font-size: 18px; font-weight: bold; } - .el-dialog__close{ + .el-dialog__close { color: #188fff !important; font-size: 26px; font-weight: bold; } } -.el-pagination__jump{ +.el-pagination__jump { margin-left: 0px !important; -} \ No newline at end of file +} +.el-tabs__nav-scroll { + padding-left: 15px; + .tab-label { + font-weight: bold; + color: rgba(0, 0, 0, 0.65); + } + .is-active { + .tab-label { + color:#2681e8 + } + } +} +.el-tabs__header{ + margin: 0px !important; +} +// .el-tabs__content { +// padding: 0px 15px 15px 15px; +// } diff --git a/sample-form-manager-ui/admin/src/components/TabHeader.vue b/sample-form-manager-ui/admin/src/components/TabHeader.vue new file mode 100644 index 0000000000000000000000000000000000000000..3c647c3861627e8094ae52bc1ec62ee7ef96ff36 --- /dev/null +++ b/sample-form-manager-ui/admin/src/components/TabHeader.vue @@ -0,0 +1,48 @@ +<template> + <div class="tab-header"> + <i v-if="icon" :class="['mr5', 'primary', icon]"></i> + <span class="label">{{ label }}</span> + </div> +</template> + +<script> +export default { + props: { + icon: { + type: String, + default: "", + }, + label: { + type: String, + default: "", + }, + }, +}; +</script> + +<style lang="less" scoped> +.tab-header { + display: flex; + align-items: center; + width: 100%; + height: 40px; + padding: 0px 15px; + font-size: 14px; + position: relative; + cursor: default; + &::after { + content: ""; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + height: 2px; + background-color: #e4e7ed; + z-index: 1; + } + .label { + font-weight: bold; + color: rgba(0, 0, 0, 0.65); + } +} +</style> \ No newline at end of file diff --git a/sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue b/sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue index 89aff174695bf397ea88f6b6358fb6d5c96cb27b..d71bf2a9e7c777d79289986bddd63628d10b3dfe 100644 --- a/sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue +++ b/sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue @@ -1,9 +1,7 @@ <template> - <div class="device"> - <el-card shadow="never"> - <div slot="header"> - <span>鏍疯〃璁惧</span> - </div> + <div class="device bgw flex flexc"> + <TabHeader icon="el-icon-notebook-2" label="鏁板瓧濉崟璁惧"></TabHeader> + <div class="flex1 pd15 auto-scroll"> <TableHeader> <div slot="left"> <!-- <el-button size="small" type="primary" @click="handleAdd" @@ -141,7 +139,7 @@ </el-table-column> <el-table-column align="center" prop="deviceRemark" label="澶囨敞"> </el-table-column> - <el-table-column align="center" label="鎿嶄綔" width="160"> + <el-table-column align="center" label="鎿嶄綔" width="200"> <template slot-scope="scope"> <div class="flex jca"> <span @@ -162,9 +160,9 @@ <span class="primary pointer" @click="handleEdit(scope.row)" >缂栬緫</span > - <!-- <span class="delete pointer" @click="handleDel(scope.row.id)" + <span class="delete pointer" @click="handleDel(scope.row.id)" >鍒犻櫎</span - > --> + > </div> </template> </el-table-column> @@ -177,7 +175,8 @@ @currentChange="changePagination" @sizeChange="changeSize" ></Pagination> - </el-card> + </div> + <!-- 鏂板璁惧 --> <AddDevice :dict="dict" @@ -196,10 +195,12 @@ import TableHeader from "@/components/TableHeader.vue"; import Pagination from "@/components/Pagination.vue"; import AddMatter from "./modal/AddMatter.vue"; import AddDevice from "./modal/AddDevice.vue"; +import TabHeader from "@/components/TabHeader.vue"; import { getDeviceList, saveDeviceEnable, saveDeviceActive, + delDevice, } from "@/api/device"; import local from "@/utils/local"; export default { @@ -208,6 +209,7 @@ export default { AddDevice, AddMatter, Pagination, + TabHeader, }, data() { return { @@ -326,7 +328,12 @@ export default { type: "warning", }) .then(async () => { - console.log(id); + let res = await delDevice({ id }); + let { code, msg } = res.data; + if (code == 1) { + this.$message.success(msg); + this.getDeviceList(); + } }) .catch(() => { console.log("鍙栨秷鎴愬姛锛�"); @@ -359,11 +366,7 @@ export default { <style lang="less" scoped> .device { width: 100%; - min-height: 100%; - display: flex; - :deep(.el-card) { - height: auto; - } + height: 100%; .select { width: 220px !important; } diff --git a/sample-form-manager-ui/admin/src/pages/hardware/modal/AddDevice.vue b/sample-form-manager-ui/admin/src/pages/hardware/modal/AddDevice.vue index 2dce60d7e79a3405af59fa657068f1733812ad72..376cbaa50bd04374e8f32fc3d25236e55ab972b7 100644 --- a/sample-form-manager-ui/admin/src/pages/hardware/modal/AddDevice.vue +++ b/sample-form-manager-ui/admin/src/pages/hardware/modal/AddDevice.vue @@ -159,10 +159,10 @@ </el-row> </el-form> <span slot="footer" class="dialog-footer"> + <el-button size="small" @click="handleReset">閲� 缃�</el-button> <el-button size="small" type="primary" @click="handleOk" >纭� 瀹�</el-button > - <el-button size="small" @click="handleReset">閲� 缃�</el-button> </span> </el-dialog> </div> diff --git a/sample-form-manager-ui/admin/src/pages/jump/jump.vue b/sample-form-manager-ui/admin/src/pages/jump/jump.vue index 9e240db2e2109ebb6370998fda1c76a35210d531..da9d7b9647b9eebaca26bd455e6a564c9c12dab2 100644 --- a/sample-form-manager-ui/admin/src/pages/jump/jump.vue +++ b/sample-form-manager-ui/admin/src/pages/jump/jump.vue @@ -17,15 +17,16 @@ export default { this.getInfo(); }, methods: { - ...mapMutations(["SET_sysName", "SET_sysLogo", "SET_token"]), + ...mapMutations(["SET_sysName", "SET_sysLogo", "SET_token", "SET_path"]), // 鑾峰彇token鍜岀珯鐐逛俊鎭� async getInfo() { - let { token, siteid, sysName, sysLogo } = this.$route.query; + let { token, siteid, sysName, sysLogo, path } = this.$route.query; if (token) { local.setLocal("sampleSiteId", siteid); this.SET_token(token); this.SET_sysName(sysName); this.SET_sysLogo(sysLogo); + this.SET_path(path); calcMenu(); this.$router.push("/basicsset"); } else { diff --git a/sample-form-manager-ui/admin/src/pages/layouts/Layouts.vue b/sample-form-manager-ui/admin/src/pages/layouts/Layouts.vue index b50f27d630498c330e513664a0f04060d1572cdc..3e3b499383bcf118d188fb624ccc6c0f9d88f0c6 100644 --- a/sample-form-manager-ui/admin/src/pages/layouts/Layouts.vue +++ b/sample-form-manager-ui/admin/src/pages/layouts/Layouts.vue @@ -21,8 +21,23 @@ > </el-breadcrumb> </div> --> - <div class="out-box flex1"> - <router-view></router-view> + <div class="main flex1 flex flexc"> + <!-- <el-tabs :value="activeKey" @tab-click="changeRouter"> + <el-tab-pane v-for="v in subMenus" :key="v.path" :name="v.path"> + <template slot="label"> + <i v-if="v.meta.icon" :class="['mr5', 'primary', v.meta.icon]"></i> + <span class="tab-label">{{ v.meta.title }}</span> + </template> + </el-tab-pane> + </el-tabs> --> + <div class="out-box flex1"> + <keep-alive> + <!-- 闇€瑕佺紦瀛樼殑瑙嗗浘缁勪欢 --> + <router-view v-if="$route.meta.keepAlive"> </router-view> + </keep-alive> + <!-- 涓嶉渶瑕佺紦瀛樼殑瑙嗗浘缁勪欢 --> + <router-view v-if="!$route.meta.keepAlive"> </router-view> + </div> </div> </div> </template> @@ -32,6 +47,7 @@ import Header from "./components/Header.vue"; import { getdeptList } from "@/api/department"; import { mapMutations, mapState } from "vuex"; import local from "@/utils/local"; +import { findBottomSubarrays } from "@/utils"; export default { components: { Header, @@ -41,20 +57,25 @@ export default { systemName: process.env.VUE_APP_sysName, portalUrl: process.env.VUE_APP_API_portal_URL, breads: [], + subMenus: [], }; }, created() { + // this.getSubMenus(); document.title = this.sysName ? this.sysName : this.systemName; // 璁剧疆椤圭洰鏍囬 - this.calcBreads(); + // this.calcBreads(); this.getdeptList(); }, - watch: { - "$route.path"() { - this.calcBreads(); - }, - }, + // watch: { + // "$route.path"() { + // this.calcBreads(); + // }, + // }, computed: { ...mapState(["sysName"]), + activeKey() { + return this.$route.path; + }, }, methods: { ...mapMutations(["SET_deptList"]), @@ -71,6 +92,18 @@ export default { this.breads = [...temp, ...r]; }, + // 鑾峰彇褰撳墠椤跺眰璺敱涓嬬殑鎵€鏈夊瓙璺敱 + getSubMenus() { + let path = this.$route?.meta.activeMenu + ? this.$route.meta.activeMenu + : this.$route.path; + let options = this.$router.options.routes[0].children; + let curRouters = options.filter((v) => v.path == path); + this.subMenus = findBottomSubarrays(curRouters).filter( + (v) => !v.meta.hidden + ); + }, + // 鑾峰彇閮ㄩ棬鍒楄〃 async getdeptList() { let res = await getdeptList({ @@ -85,6 +118,10 @@ export default { this.SET_deptList(data.data); } }, + + changeRouter(e) { + this.$router.push(e.name); + }, }, }; </script> @@ -94,16 +131,22 @@ export default { width: 100%; min-width: 1620px; height: 100%; - padding-bottom: 10px; + padding-bottom: 15px; // .crumbs { // margin: 10px 0px; // width: 98%; // } - .out-box { + + .main { width: 98%; - margin-top: 10px; + margin-top: 15px; + // padding-bottom: 15px; border-radius: 4px; - background-color: #fff; + overflow-y: auto; + // background-color: #fff; + } + .out-box { + // padding: 15px; overflow-y: auto; } } diff --git a/sample-form-manager-ui/admin/src/pages/layouts/components/Header.vue b/sample-form-manager-ui/admin/src/pages/layouts/components/Header.vue index b2d9a903198f5e8d403d11862a4733d5c2ba347c..099fbdf204d2f2a72267f721b4be5ccea41fd0c2 100644 --- a/sample-form-manager-ui/admin/src/pages/layouts/components/Header.vue +++ b/sample-form-manager-ui/admin/src/pages/layouts/components/Header.vue @@ -19,16 +19,43 @@ router text-color="rgba(254, 254, 254, 0.65)" > - <el-menu-item v-for="v in menus" :key="v.path" :index="v.path"> + <template v-for="v in menus"> + <!-- 鏈夊瓙璺敱 --> + <el-submenu + v-if="!v.hideChildrenInMenu && v.children.length" + :key="'a' + v.path" + :index="v.path" + > + <template slot="title"> + <i v-if="v.meta && v.meta.icon" :class="v.meta.icon"></i> + {{ v.meta.title }} + </template> + <el-menu-item + v-for="item in v.children" + :key="item.path" + :index="item.path" + > + <i v-if="item.meta && item.meta.icon" :class="item.meta.icon"></i> + {{ item.meta && item.meta.title }} + </el-menu-item> + </el-submenu> + <!-- 鍗曚釜璺敱 --> + <el-menu-item v-else :key="v.path" :index="v.path"> + <i v-if="v.meta && v.meta.icon" :class="v.meta.icon"></i> + {{ v.meta.title }} + </el-menu-item> + </template> + + <!-- <el-menu-item v-for="v in menus" :key="v.path" :index="v.path"> <i :class="v.meta.icon"></i> {{ v.meta.title }} - </el-menu-item> + </el-menu-item> --> </el-menu> </div> <!-- 杩斿洖闂ㄦ埛 --> <div class="back-btn"> <el-tooltip effect="dark" content="杩斿洖闂ㄦ埛" placement="bottom"> - <a class="pointer" :href="portal"> + <a class="pointer" :href="portal + path"> <i class="el-icon-s-home"></i> 杩斿洖闂ㄦ埛 </a> </el-tooltip> @@ -47,7 +74,7 @@ export default { return { systemName: process.env.VUE_APP_sysName, api: process.env.VUE_APP_API_IMG_URL, - portal: process.env.VUE_APP_API_portal_URL + "/#/home/siteArrange", + portal: process.env.VUE_APP_API_portal_URL, }; }, computed: { @@ -59,7 +86,7 @@ export default { } return path; }, - ...mapState(["menus", "sysName", "sysLogo"]), + ...mapState(["menus", "sysName", "sysLogo", "path"]), }, created() {}, methods: { @@ -78,6 +105,7 @@ export default { // background-color: #2681e8; background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%); color: #fff; + flex-shrink: 0; .left { height: 100%; } @@ -93,31 +121,66 @@ export default { } } /deep/.el-menu { - height: 64px !important; - border: none !important; - background-color: transparent; -} -/deep/.el-menu-item { height: 100% !important; border: none !important; - display: flex; - align-items: center; + background-color: transparent; i { color: rgba(254, 254, 254, 0.65); } + .el-menu-item { + height: 100% !important; + border: none !important; + display: flex; + align-items: center; + color: rgba(254, 254, 254, 0.65); + + &:hover { + // background-color: transparent !important; + color: #fff !important; + background-color: #1890ff !important; + // border-bottom: 2px solid #fff !important; + } + } +} +/deep/.el-submenu { + height: 100% !important; + .el-submenu__title { + height: 100% !important; + display: flex; + align-items: center; + color: rgba(254, 254, 254, 0.65) !important; + border: none !important; + &:hover { + // background-color: transparent !important; + color: #fff !important; + background-color: #1890ff !important; + // border-bottom: 2px solid #fff !important; + } + } +} +.el-menu--horizontal .el-menu .el-menu-item { + color: #909399; &:hover { - // background-color: transparent !important; - background-color: #1890ff !important; - color: #fff !important; - // border-bottom: 2px solid #fff !important; + i { + color: #1890ff; + } + color: #1890ff; } } +.el-menu--horizontal .el-menu .el-menu-item.is-active { + color: #1890ff !important; +} /deep/.is-active { - border: none !important; // border-bottom: 2px solid #fff !important; color: #fff !important; // background-color: transparent !important; background-color: #1890ff !important; + .el-submenu__title { + border: none !important; + color: #fff !important; + // background-color: transparent !important; + background-color: #1890ff !important; + } } </style> \ No newline at end of file diff --git a/sample-form-manager-ui/admin/src/pages/software/basics/BasicsSet.vue b/sample-form-manager-ui/admin/src/pages/software/basics/BasicsSet.vue index 0fdd36222ddf90d9c6cb0132409e361a9d1fd09f..e5b4ea241a30a18024cd1212251d0424509dd8a5 100644 --- a/sample-form-manager-ui/admin/src/pages/software/basics/BasicsSet.vue +++ b/sample-form-manager-ui/admin/src/pages/software/basics/BasicsSet.vue @@ -1,9 +1,7 @@ <template> - <div class="basics-set"> - <el-card class="box-card"> - <div slot="header" class="clearfix"> - <span>鏍疯〃鍩虹璁剧疆</span> - </div> + <div class="basics-set bgw flex flexc"> + <TabHeader icon="el-icon-notebook-2" label="鏍疯〃鍩虹璁剧疆"></TabHeader> + <div class="pd15 flex1 auto-scroll"> <div class="header"> <span class="mr15 title">鐑棬鎼滅储璇嶆眹</span> <span class="tips" @@ -62,15 +60,18 @@ >纭� 瀹� </el-button> </div> - </el-card> + </div> </div> </template> <script> import { getBaseSetInfo, saveBaseSet } from "@/api/baseSet"; import local from "@/utils/local"; - +import TabHeader from "@/components/TabHeader.vue"; export default { + components: { + TabHeader, + }, data() { return { siteId: local.getLocal("sampleSiteId") @@ -172,18 +173,13 @@ export default { <style lang="less" scoped> .basics-set { width: 100%; - min-height: 100%; - display: flex; + height: 100%; .title { font-size: 15px; color: #000; } } -:deep(.el-card) { - height: auto; -} - .header { .tips { font-size: 14px; diff --git a/sample-form-manager-ui/admin/src/pages/software/librarymanage/LibraryManage.vue b/sample-form-manager-ui/admin/src/pages/software/librarymanage/LibraryManage.vue index ef4ede74c467454e9cff1f97d1e6fbf92918cca5..8b273de3af57f37f43acb0dbfaa2cd1a52003fc7 100644 --- a/sample-form-manager-ui/admin/src/pages/software/librarymanage/LibraryManage.vue +++ b/sample-form-manager-ui/admin/src/pages/software/librarymanage/LibraryManage.vue @@ -1,9 +1,7 @@ <template> - <div class="library-manage"> - <el-card class="box-card" shadow="never"> - <div slot="header" class="clearfix"> - <span>鍏叡搴撶鐞�</span> - </div> + <div class="library-manage bgw flex flexc"> + <TabHeader icon="el-icon-notebook-2" label="鍏叡搴撶鐞�"></TabHeader> + <div class="pd15 flex1 auto-scroll"> <TableHeader> <div slot="left"> <!-- <el-button size="small" type="primary" @click="handleAddMaterials" @@ -113,7 +111,8 @@ @currentChange="changePagination" @sizeChange="changeSize" ></Pagination> - </el-card> + </div> + <!-- 娣诲姞鏉愭枡 --> <!-- <AddMaterals ref="AddMaterals" @@ -132,6 +131,7 @@ import TableHeader from "@/components/TableHeader.vue"; import PreviewMaterals from "./modal/PreviewMaterals.vue"; import Pagination from "@/components/Pagination.vue"; +import TabHeader from "@/components/TabHeader.vue"; import { getPubdatumList, delPubdatum } from "@/api/libray"; import { mapGetters } from "vuex"; export default { @@ -139,6 +139,7 @@ export default { TableHeader, PreviewMaterals, Pagination, + TabHeader, }, data() { return { @@ -264,12 +265,8 @@ export default { <style lang="less" scoped> .library-manage { - display: flex; width: 100%; - min-height: 100%; - :deep(.el-card) { - height: auto; - } + height: 100%; .short { overflow: hidden; text-overflow: ellipsis; diff --git a/sample-form-manager-ui/admin/src/pages/software/materials/MaterialsManage.vue b/sample-form-manager-ui/admin/src/pages/software/materials/MaterialsManage.vue index f5a3d3b08b0101e45e96ea934e08480d73fa9b0c..0fffb658411387d77a5bb9f257da17db47cf11e2 100644 --- a/sample-form-manager-ui/admin/src/pages/software/materials/MaterialsManage.vue +++ b/sample-form-manager-ui/admin/src/pages/software/materials/MaterialsManage.vue @@ -1,10 +1,8 @@ <template> - <div class="materias-manage flex"> - <div class="left"> - <el-card class="box-card" shadow="never"> - <div slot="header"> - <span>浜嬮」鍒楄〃</span> - </div> + <div class="materias-manage flex jcb"> + <div class="left h-full bgw flex flexc"> + <TabHeader icon="el-icon-notebook-2" label="浜嬮」鍒楄〃"></TabHeader> + <div class="pd15 flex1 auto-scroll"> <TableHeader> <div slot="left"> <el-button size="small" type="primary" @click="setCurrent">{{ @@ -108,13 +106,11 @@ @currentChange="leftChangePagination" @sizeChange="leftChangeSize" ></Pagination> - </el-card> + </div> </div> - <div class="right"> - <el-card class="box-card" shadow="never"> - <div slot="header"> - <span>鏉愭枡鍒楄〃 </span> - </div> + <div class="right h-full bgw flex flexc"> + <TabHeader icon="el-icon-notebook-2" label="鏉愭枡鍒楄〃"></TabHeader> + <div class="pd15 flex1 auto-scroll"> <!-- 鍐呭 --> <TableHeader> <div slot="left"> @@ -264,39 +260,39 @@ @currentChange="rightChangePagination" @sizeChange="rightChangeSize" ></Pagination> - </el-card> - </div> - <!-- 鏂板鏉愭枡 --> - <AddMaterials - ref="AddMaterials" - :addMaterialsVisible.sync="addMaterialsVisible" - :title="title" - @addSuccess="addSuccess" - ></AddMaterials> - <!-- 棰勮鏉愭枡 --> - <PreviewMaterials - :drawer.sync="drawer" - :materialsInfo="materialsInfo" - ></PreviewMaterials> + </div> + <!-- 鏂板鏉愭枡 --> + <AddMaterials + ref="AddMaterials" + :addMaterialsVisible.sync="addMaterialsVisible" + :title="title" + @addSuccess="addSuccess" + ></AddMaterials> + <!-- 棰勮鏉愭枡 --> + <PreviewMaterials + :drawer.sync="drawer" + :materialsInfo="materialsInfo" + ></PreviewMaterials> - <!-- 鍏叡搴� --> - <CommonLib - ref="CommonLib" - :matterId="activeDep.id" - @ok="addSuccess" - :libVisible.sync="libVisible" - ></CommonLib> - <!-- 鏂板鏂囦欢澶� --> - <AddFolders - ref="AddFolders" - :addFolderVisible.sync="addFolderVisible" - ></AddFolders> - <!-- 鏂囦欢澶� --> - <FolderList - ref="FolderList" - @addSuccess="materialsToFolderOk" - :folderListVisible.sync="folderListVisible" - ></FolderList> + <!-- 鍏叡搴� --> + <CommonLib + ref="CommonLib" + :matterId="activeDep.id" + @ok="addSuccess" + :libVisible.sync="libVisible" + ></CommonLib> + <!-- 鏂板鏂囦欢澶� --> + <AddFolders + ref="AddFolders" + :addFolderVisible.sync="addFolderVisible" + ></AddFolders> + <!-- 鏂囦欢澶� --> + <FolderList + ref="FolderList" + @addSuccess="materialsToFolderOk" + :folderListVisible.sync="folderListVisible" + ></FolderList> + </div> </div> </template> @@ -308,6 +304,7 @@ import CommonLib from "./modal/CommonLib.vue"; import Pagination from "@/components/Pagination.vue"; import AddFolders from "./modal/AddFolders.vue"; import FolderList from "./modal/FolderList.vue"; +import TabHeader from "@/components/TabHeader.vue"; import { getWriteMatterList } from "@/api/matter"; import { getMaterialsList, @@ -325,6 +322,7 @@ export default { Pagination, AddFolders, FolderList, + TabHeader, }, data() { return { @@ -580,7 +578,7 @@ export default { <style lang="less" scoped> .materias-manage { width: 100%; - min-height: 100%; + height: 100%; .short { overflow: hidden; text-overflow: ellipsis; @@ -601,11 +599,11 @@ export default { } .left { - width: 40%; - height: auto; + width: 39%; + border-radius: 4px; } .right { - width: 60%; - height: auto; + width: 59%; + border-radius: 4px; } </style> \ No newline at end of file diff --git a/sample-form-manager-ui/admin/src/pages/software/matter/MatterManage.vue b/sample-form-manager-ui/admin/src/pages/software/matter/MatterManage.vue index 27ac49c50d0bdd1142cdc2a455e6a7c2d788154c..4b1d261befb383bfb370504111e6d829a79b55bb 100644 --- a/sample-form-manager-ui/admin/src/pages/software/matter/MatterManage.vue +++ b/sample-form-manager-ui/admin/src/pages/software/matter/MatterManage.vue @@ -1,11 +1,9 @@ <template> - <div class="matter-manage flex"> + <div class="matter-manage flex jcb"> <!-- 宸� --> - <div class="left"> - <el-card class="box-card" shadow="never"> - <div slot="header"> - <span>鏍疯〃绯荤粺浜嬮」鍒楄〃</span> - </div> + <div class="left h-full bgw flex flexc"> + <TabHeader icon="el-icon-notebook-2" label="鏍疯〃绯荤粺浜嬮」鍒楄〃"></TabHeader> + <div class="pd15 flex1 auto-scroll"> <TableHeader> <div slot="left"> <el-button size="small" type="primary" @click="handleAddMatter" @@ -147,14 +145,20 @@ @currentChange="leftChangePagination" @sizeChange="leftChangeSize" ></Pagination> - </el-card> + </div> + <!-- 鏂板浜嬮」 --> + <AddMatter + ref="AddMatter" + :addMatterVisible.sync="addMatterVisible" + :departmentList="deptList" + :title="title" + @addMatter="getWriteMatterList" + ></AddMatter> </div> <!-- 鍙� --> - <div class="right"> - <el-card class="box-card" shadow="never"> - <div slot="header"> - <span>绔欑偣浜嬮」鍒楄〃 </span> - </div> + <div class="right h-full bgw flex flexc"> + <TabHeader icon="el-icon-notebook-2" label="绔欑偣浜嬮」鍒楄〃"></TabHeader> + <div class="pd15 flex1 auto-scroll"> <!-- 鍐呭 --> <TableHeader> <div slot="left"> @@ -264,16 +268,8 @@ @currentChange="rightChangePagination" @sizeChange="rightChangeSize" ></Pagination> - </el-card> + </div> </div> - <!-- 鏂板浜嬮」 --> - <AddMatter - ref="AddMatter" - :addMatterVisible.sync="addMatterVisible" - :departmentList="deptList" - :title="title" - @addMatter="getWriteMatterList" - ></AddMatter> </div> </template> @@ -281,6 +277,7 @@ import TableHeader from "@/components/TableHeader.vue"; import AddMatter from "./modal/AddMatter.vue"; import Pagination from "@/components/Pagination.vue"; +import TabHeader from "@/components/TabHeader.vue"; import { mapGetters } from "vuex"; import { // getMatterList, @@ -296,6 +293,7 @@ export default { TableHeader, AddMatter, Pagination, + TabHeader, }, data() { return { @@ -518,8 +516,7 @@ export default { <style lang="less" scoped> .matter-manage { width: 100%; - min-height: 100%; - display: flex; + height: 100%; .short { overflow: hidden; text-overflow: ellipsis; @@ -536,11 +533,11 @@ export default { // height: 550px; // } .left { - width: 50%; - height: auto; + width: 49%; + border-radius: 4px; } .right { - width: 50%; - height: auto; + width: 49%; + border-radius: 4px; } </style> diff --git a/sample-form-manager-ui/admin/src/pages/software/skinManage/SkinManage.vue b/sample-form-manager-ui/admin/src/pages/software/skinManage/SkinManage.vue index 396721a379af75fbe6101fc67ee5d510a91dc895..37ce7088cfd28bbe9bcd181feaf3b2589caabb57 100644 --- a/sample-form-manager-ui/admin/src/pages/software/skinManage/SkinManage.vue +++ b/sample-form-manager-ui/admin/src/pages/software/skinManage/SkinManage.vue @@ -1,9 +1,7 @@ <template> - <div class="skin-set"> - <el-card class="box-card"> - <div slot="header" class="clearfix"> - <span>鐨偆绠$悊</span> - </div> + <div class="skin-set bgw flex flexc"> + <TabHeader icon="el-icon-notebook-2" label="鐨偆绠$悊"></TabHeader> + <div class="pd15 flex1 auto-scroll"> <!-- 鐨偆鍒楄〃 --> <div class="skin-box"> <div class="skin-category"> @@ -32,28 +30,29 @@ </div> </div> </div> - - <!-- 鍥剧墖棰勮 --> - <el-image-viewer - v-if="previewImg" - :on-close=" - () => { - (previewImg = false), (previewUrl = ''); - } - " - :url-list="previewUrl" - /> - </el-card> + </div> + <!-- 鍥剧墖棰勮 --> + <el-image-viewer + v-if="previewImg" + :on-close=" + () => { + (previewImg = false), (previewUrl = ''); + } + " + :url-list="previewUrl" + /> </div> </template> <script> import local from "@/utils/local"; import ElImageViewer from "element-ui/packages/image/src/image-viewer"; +import TabHeader from "@/components/TabHeader.vue"; import { getSkinList, useSkin } from "@/api/skin"; export default { components: { ElImageViewer, + TabHeader, }, data() { return { @@ -140,13 +139,10 @@ export default { <style lang="less" scoped> .skin-set { - display: flex; width: 100%; - min-height: 100%; -} -:deep(.el-card) { - height: auto; + height: 100%; } + .skin-category { margin-bottom: 30px; } diff --git a/sample-form-manager-ui/admin/src/pages/system/System.vue b/sample-form-manager-ui/admin/src/pages/system/System.vue index 1f4f273a2f6f90152abcb9135672e4e688f72695..d4e1fbcf39552c32fa331b0b229987ea64492f4f 100644 --- a/sample-form-manager-ui/admin/src/pages/system/System.vue +++ b/sample-form-manager-ui/admin/src/pages/system/System.vue @@ -1,9 +1,12 @@ <template> - <div class="system flex flexc"> + <div class="system bgw flex flexc"> <el-tabs :value="activeKey" @tab-click="changeRouter"> - <el-tab-pane label="绯荤粺鍙傛暟" name="/system/parameter"></el-tab-pane> - <el-tab-pane label="浠诲姟淇℃伅" name="/system/task"></el-tab-pane> - <el-tab-pane label="鎿嶄綔鏃ュ織" name="/system/systemlogs"></el-tab-pane> + <el-tab-pane v-for="v in subMenus" :key="v.path" :name="v.path"> + <template slot="label"> + <i v-if="v.meta.icon" :class="['mr5', 'primary', v.meta.icon]"></i> + <span class="tab-label">{{ v.meta.title }}</span> + </template> + </el-tab-pane> </el-tabs> <div class="system-out-box flex1"> <router-view></router-view> @@ -12,16 +15,36 @@ </template> <script> +import { findBottomSubarrays } from "@/utils"; export default { + data() { + return { + subMenus: [], + }; + }, computed: { activeKey() { return this.$route.path; }, }, + created() { + this.getSubMenus(); + }, methods: { changeRouter(e) { this.$router.push(e.name); }, + // 鑾峰彇褰撳墠椤跺眰璺敱涓嬬殑鎵€鏈夊瓙璺敱 + getSubMenus() { + let path = this.$route?.meta.activeMenu + ? this.$route.meta.activeMenu + : this.$route.path; + let options = this.$router.options.routes[0].children; + let curRouters = options.filter((v) => v.path == path); + this.subMenus = findBottomSubarrays(curRouters).filter( + (v) => !v.meta.hidden + ); + }, }, }; </script> @@ -34,11 +57,8 @@ export default { width: 100%; height: 100%; .system-out-box { - padding: 0px 15px 15px 15px; + padding: 15px; overflow-y: auto; } - /deep/.ant-tabs-nav-container { - border-bottom: 1px solid #f0f0f0 !important; - } } </style> \ No newline at end of file diff --git a/sample-form-manager-ui/admin/src/pages/system/task/TaskSet.vue b/sample-form-manager-ui/admin/src/pages/system/task/TaskSet.vue index 1188810aba0295765d036ade6d6604baaf8ff376..9b9481ae7648da23d8b898736b032eacf8f7bf6f 100644 --- a/sample-form-manager-ui/admin/src/pages/system/task/TaskSet.vue +++ b/sample-form-manager-ui/admin/src/pages/system/task/TaskSet.vue @@ -15,7 +15,7 @@ v-model="searchVal" style="width: 200px" class="ml10 mr10" - placeholder="璇疯緭鍏ュ弬鏁板悕绉版悳绱�" + placeholder="璇疯緭鍏ヤ换鍔″悕绉版悳绱�" @keyup.native.enter="handleSearch" ></el-input> <el-button size="small" type="primary" @click="handleSearch" diff --git a/sample-form-manager-ui/admin/src/router/index.js b/sample-form-manager-ui/admin/src/router/index.js index 4eca095ac9e70cb97aef07cc916550bfef99df72..cdece8c67bc3d6052ad64c5ad4c1f29f323b02e0 100644 --- a/sample-form-manager-ui/admin/src/router/index.js +++ b/sample-form-manager-ui/admin/src/router/index.js @@ -9,153 +9,101 @@ VueRouter.prototype.push = function (location) { return originalPush.call(this, location).catch((err) => err); }; Vue.use(VueRouter); - +/** + * Route 瀵硅薄閰嶇疆: + * hidden锛氭帶鍒惰矾鐢辨槸鍚︽樉绀哄湪鍦ㄨ彍鍗� + * hideChildrenInMenu:寮哄埗鑿滃崟鏄剧ず涓篒tem鑰屼笉鏄疭ubItem + * meta瀵硅薄閰嶇疆: + * title:鏍囬 + * keepAlive:缂撳瓨璇ヨ矾鐢� + * activeMenu:褰撳墠鐨勬縺娲昏矾鐢� + * icon:鍥炬爣 + * hidden锛氭帶鍒惰矾鐢辨槸鍚︽樉绀哄湪鍦ㄨ彍鍗� + */ const routes = [ - { - path: "/jump", - name: "璺宠浆椤�", - component: () => import("@/pages/jump/jump"), - }, { path: "/", - redirect: "/jump", - }, - { - path: "/login", - name: "鐧诲綍椤�", - component: () => import("@/pages/login/login"), - }, -]; - -const router = new VueRouter({ - routes, -}); - -// 鍓嶇疆璺敱鍗+ -router.beforeEach((to, from, next) => { - let islogin = store.getters.token; - if (islogin) { - next(); - } else { - if (to.path === "/jump") { - next(); - } else { - location.href = process.env.VUE_APP_API_portal_URL; - // next({ path: "/login" }); - } - } -}); - -// 鍔ㄦ€佽彍鍗� -const dynamicRouter = [ - { - path: "/basicsset", component: Layouts, - meta: { - icon: "el-icon-setting", - title: "鏍疯〃鍩虹璁剧疆", - }, + redirect: "/jump", children: [ { - path: "", + path: "/basicsset", // name: '鏍疯〃鍩虹璁剧疆', + hideChildrenInMenu: true, component: () => import("@/pages/software/basics/BasicsSet"), + meta: { + icon: "el-icon-setting", + title: "鏍疯〃鍩虹璁剧疆", + }, }, - ], - }, - { - path: "/mattermanage", - component: Layouts, - meta: { - icon: "el-icon-document", - title: "鏍疯〃浜嬮」绠$悊", - }, - children: [ { - path: "", - name: "鏍疯〃浜嬮」绠$悊", + path: "/mattermanage", + // name: "鏍疯〃浜嬮」绠$悊", + hideChildrenInMenu: true, component: () => import("@/pages/software/matter/MatterManage"), + meta: { + icon: "el-icon-document", + title: "鏍疯〃浜嬮」绠$悊", + }, }, - ], - }, - { - path: "/materialsmanage", - component: Layouts, - meta: { - icon: "el-icon-files", - title: "鏍疯〃绠$悊", - }, - children: [ { - path: "", - // name: '鏉愭枡绠$悊', + path: "/materialsmanage", + // name: '鏍疯〃绠$悊', + hideChildrenInMenu: true, component: () => import("@/pages/software/materials/MaterialsManage"), + meta: { + icon: "el-icon-files", + title: "鏍疯〃绠$悊", + }, }, - ], - }, - { - path: "/librarymanage", - component: Layouts, - meta: { - icon: "el-icon-refrigerator", - title: "鍏叡搴撶鐞�", - }, - children: [ { - path: "", + path: "/librarymanage", // name: '鍏叡搴撶鐞�', + hideChildrenInMenu: true, component: () => import("@/pages/software/librarymanage/LibraryManage"), + meta: { + icon: "el-icon-refrigerator", + title: "鍏叡搴撶鐞�", + }, }, - ], - }, - { - path: "/skinmanage", - component: Layouts, - meta: { - icon: "el-icon-orange", - title: "鐨偆绠$悊", - }, - children: [ { - path: "", + path: "/skinmanage", + hideChildrenInMenu: true, component: () => import("@/pages/software/skinManage/SkinManage"), + meta: { + icon: "el-icon-orange", + title: "鐨偆绠$悊", + }, }, - ], - }, - { - path: "/numberwritedevice", - component: Layouts, - meta: { - icon: "el-icon-monitor", - title: "鏁板瓧鏍疯〃璁惧", - }, - children: [ + { - path: "", + path: "/numberwritedevice", // name: '鏁板瓧鏍疯〃璁惧', + hideChildrenInMenu: true, component: () => import("@/pages/hardware/NumberWriteDevice"), + meta: { + icon: "el-icon-monitor", + title: "鏁板瓧鏍疯〃璁惧", + }, }, - ], - }, - { - path: "/system", - component: Layouts, - meta: { - icon: "el-icon-data-board", - title: "绯荤粺璁剧疆", - }, - children: [ + { - path: "", + path: "/system", + hideChildrenInMenu: true, component: () => import("@/pages/system/System.vue"), redirect: "/system/parameter", + meta: { + icon: "el-icon-data-board", + title: "绯荤粺璁剧疆", + }, children: [ { path: "/system/parameter", component: () => import("@/pages/system/parameter/Parameter.vue"), meta: { activeMenu: "/system", - hidden: true, + title: "绯荤粺鍙傛暟", + icon: "el-icon-cpu", }, }, { @@ -163,7 +111,8 @@ const dynamicRouter = [ component: () => import("@/pages/system/task/TaskSet.vue"), meta: { activeMenu: "/system", - hidden: true, + title: "浠诲姟淇℃伅", + icon: "el-icon-bank-card", }, }, { @@ -171,19 +120,187 @@ const dynamicRouter = [ component: () => import("@/pages/system/systemlogs/SystemLogs.vue"), meta: { activeMenu: "/system", - hidden: true, + title: "鎿嶄綔鏃ュ織", + icon: "el-icon-notebook-1", }, }, ], }, ], }, + { + path: "/jump", + name: "璺宠浆椤�", + component: () => import("@/pages/jump/jump"), + }, + { + path: "/", + redirect: "/jump", + }, + { + path: "/login", + name: "鐧诲綍椤�", + component: () => import("@/pages/login/login"), + }, ]; +const router = new VueRouter({ + routes, +}); + +// 鍓嶇疆璺敱鍗+ +router.beforeEach((to, from, next) => { + let islogin = store.getters.token; + if (islogin) { + next(); + } else { + if (to.path === "/jump") { + next(); + } else { + location.href = process.env.VUE_APP_API_portal_URL; + // next({ path: "/login" }); + } + } +}); + +// 鍔ㄦ€佽彍鍗� +// const dynamicRouter = [ +// { +// path: "/basicsset", +// component: Layouts, +// meta: { +// icon: "el-icon-setting", +// title: "鏍疯〃鍩虹璁剧疆", +// }, +// children: [ +// { +// path: "", +// // name: '鏍疯〃鍩虹璁剧疆', +// component: () => import("@/pages/software/basics/BasicsSet"), +// }, +// ], +// }, +// { +// path: "/mattermanage", +// component: Layouts, +// meta: { +// icon: "el-icon-document", +// title: "鏍疯〃浜嬮」绠$悊", +// }, +// children: [ +// { +// path: "", +// name: "鏍疯〃浜嬮」绠$悊", +// component: () => import("@/pages/software/matter/MatterManage"), +// }, +// ], +// }, +// { +// path: "/materialsmanage", +// component: Layouts, +// meta: { +// icon: "el-icon-files", +// title: "鏍疯〃绠$悊", +// }, +// children: [ +// { +// path: "", +// // name: '鏉愭枡绠$悊', +// component: () => import("@/pages/software/materials/MaterialsManage"), +// }, +// ], +// }, +// { +// path: "/librarymanage", +// component: Layouts, +// meta: { +// icon: "el-icon-refrigerator", +// title: "鍏叡搴撶鐞�", +// }, +// children: [ +// { +// path: "", +// // name: '鍏叡搴撶鐞�', +// component: () => import("@/pages/software/librarymanage/LibraryManage"), +// }, +// ], +// }, +// { +// path: "/skinmanage", +// component: Layouts, +// meta: { +// icon: "el-icon-orange", +// title: "鐨偆绠$悊", +// }, +// children: [ +// { +// path: "", +// component: () => import("@/pages/software/skinManage/SkinManage"), +// }, +// ], +// }, +// { +// path: "/numberwritedevice", +// component: Layouts, +// meta: { +// icon: "el-icon-monitor", +// title: "鏁板瓧鏍疯〃璁惧", +// }, +// children: [ +// { +// path: "", +// // name: '鏁板瓧鏍疯〃璁惧', +// component: () => import("@/pages/hardware/NumberWriteDevice"), +// }, +// ], +// }, +// { +// path: "/system", +// component: Layouts, +// meta: { +// icon: "el-icon-data-board", +// title: "绯荤粺璁剧疆", +// }, +// children: [ +// { +// path: "", +// component: () => import("@/pages/system/System.vue"), +// redirect: "/system/parameter", +// children: [ +// { +// path: "/system/parameter", +// component: () => import("@/pages/system/parameter/Parameter.vue"), +// meta: { +// activeMenu: "/system", +// hidden: true, +// }, +// }, +// { +// path: "/system/task", +// component: () => import("@/pages/system/task/TaskSet.vue"), +// meta: { +// activeMenu: "/system", +// hidden: true, +// }, +// }, +// { +// path: "/system/systemlogs", +// component: () => import("@/pages/system/systemlogs/SystemLogs.vue"), +// meta: { +// activeMenu: "/system", +// hidden: true, +// }, +// }, +// ], +// }, +// ], +// }, +// ]; + // 杩囨护鑿滃崟 function menusFilter(arr) { let router = arr.filter((v) => { - if (v.meta && !v.meta.hidden) { + if (!v.hidden) { if (v.children) { v.children = menusFilter(v.children); } @@ -194,10 +311,10 @@ function menusFilter(arr) { } // 鍔ㄦ€佽彍鍗� export function calcMenu() { - dynamicRouter.forEach((v) => { - router.addRoute(v); - }); - let menus = menusFilter(dynamicRouter); + // dynamicRouter.forEach((v) => { + // router.addRoute(v); + // }); + let menus = menusFilter(routes[0].children); store.commit("SET_MENUS", menus); } calcMenu(); diff --git a/sample-form-manager-ui/admin/src/store/index.js b/sample-form-manager-ui/admin/src/store/index.js index 5f2b23e0c11bdf480cc79d07a204f6169449d39d..6005f8f31e0ec541a358955624271c2f375ccc28 100644 --- a/sample-form-manager-ui/admin/src/store/index.js +++ b/sample-form-manager-ui/admin/src/store/index.js @@ -13,8 +13,12 @@ export default new Vuex.Store({ deptList: [], // 閮ㄩ棬鍒楄〃 sysName: "", // 绯荤粺鍚嶇О sysLogo: "", // 绯荤粺logo + path: "", // 闂ㄦ埛璺宠浆杩囨潵鐨勮矾鐢� }, getters: { + SET_path(state, path) { + state.path = path; + }, token(state) { return state.token; }, @@ -24,6 +28,9 @@ export default new Vuex.Store({ deptList(state) { return state.deptList; }, + path(state) { + return state.path; + }, }, mutations: { SET_MENUS(state, menus) { diff --git a/sample-form-manager-ui/admin/src/utils/index.js b/sample-form-manager-ui/admin/src/utils/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4c18863b58755ed1904a4b6f9c85d5fda70ec39d --- /dev/null +++ b/sample-form-manager-ui/admin/src/utils/index.js @@ -0,0 +1,16 @@ +// 閫掑綊鑾峰彇搴曞眰瀛愭暟缁� +export function findBottomSubarrays(arr) { + let bottomSubarrays = []; + function recursiveSearch(subArr) { + for (let item of subArr) { + if (item.children && item.children.length) { + recursiveSearch(item.children); + } else { + bottomSubarrays.push(...subArr); + break; + } + } + } + recursiveSearch(arr); + return bottomSubarrays; +}