| | |
| | | </el-menu-item> |
| | | <el-sub-menu v-else :index="navMenu.path"> |
| | | <template #title> |
| | | <el-icon v-if="navMenu.meta&&navMenu.meta.icon"><component :is="navMenu.meta.icon || 'el-icon-menu'"/></el-icon> |
| | | <!-- <el-icon v-if="navMenu.meta&&navMenu.meta.icon"><component :is="navMenu.meta.icon || 'el-icon-menu'"/></el-icon> --> |
| | | <span>{{navMenu.meta.title}}</span> |
| | | <span v-if="navMenu.meta.tag" class="menu-tag">{{navMenu.meta.tag}}</span> |
| | | </template> |
| | |
| | | hasChildren(item) { |
| | | return item.children && !item.children.every(item => item.meta.hidden) |
| | | } |
| | | }, |
| | | mounted(){ |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | if (to.matched.length == 0) { |
| | | router.push(to.fullPath); |
| | | } |
| | | console.log(menuRouter,router) |
| | | isGetRouter = true; |
| | | } |
| | | beforeEach(to, from) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Author: lzhe lzhe@example.com |
| | | * @Date: 2024-03-26 10:28:33 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-04-02 17:48:31 |
| | | * @FilePath: /smart-web/src/views/master/person/main/index.vue |
| | | * @Description: è¿æ¯é»è®¤è®¾ç½®,请设置`customMade`, æå¼koroFileHeaderæ¥çé
ç½® è¿è¡è®¾ç½®: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| | | --> |
| | | <template> |
| | | <div class="dict-main"> |
| | | <el-form :inline="true" :model="searchData" abel-width="120px"> |
| | | <el-form-item label="åå
¸ç¼å·"> |
| | | <el-input v-model="searchData.code" placeholder="åå
¸ç¼å·" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="åå
¸åç§°"> |
| | | <el-input v-model="searchData.dictValue" placeholder="åå
¸åç§°" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="searchclick">æç´¢</el-button> |
| | | <el-button @click="searchClearBtn">æ¸
空</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <div class="dict-Btn"> |
| | | <div class="dict-btn-bottom"> |
| | | <el-button type="primary" @click="addData">+ æ°å¢</el-button> |
| | | <el-button type="danger" plain @click="delData">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="dict-table"> |
| | | <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column prop="code" label="åå
¸ç¼å·"> |
| | | <template #default="scope"> |
| | | <el-check-tag type="info" checked @change="table_allocation(scope.row, scope.$index)">{{scope.row.code}}</el-check-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="dictValue" label="åå
¸åç§°"></el-table-column> |
| | | <el-table-column prop="sort" label="åå
¸æåº"></el-table-column> |
| | | <el-table-column prop="isSealed" label="å°å"> |
| | | <template #default="scope"> |
| | | <div>{{scope.row.isSealed == 0?"å¦":"æ¯"}}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="æä½"> |
| | | <template #default="scope"> |
| | | <el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">æ¥ç</el-button> |
| | | <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">ç¼è¾</el-button> |
| | | <el-button text type="primary" size="small" @click="table_del(scope.row, scope.$index)">å é¤</el-button> |
| | | <el-button text type="primary" size="small" @click="table_allocation(scope.row, scope.$index)">åå
¸é
ç½®</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination |
| | | style="margin-top: 12px;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage4" |
| | | :page-sizes="[15, 50, 100]" |
| | | :page-size="15" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | <script> |
| | | export default { |
| | | name: "attach", |
| | | data(){ |
| | | return { |
| | | getModalData: [], |
| | | selection: [], |
| | | total: 0, |
| | | searchData: { |
| | | code: "", |
| | | dictValue: "", |
| | | current: "1", |
| | | size: "15" |
| | | }, |
| | | dialog: { |
| | | save: false, |
| | | allocation: false |
| | | }, |
| | | leftActive: true, |
| | | input: '', |
| | | options: [{ |
| | | value: 'é项1', |
| | | label: 'é»éç³' |
| | | }], |
| | | input3: '', |
| | | tableData: [] |
| | | } |
| | | }, |
| | | created(){ |
| | | |
| | | }, |
| | | mounted(){ |
| | | this.searchBtn(); |
| | | }, |
| | | components: { |
| | | |
| | | }, |
| | | methods: { |
| | | codeClick() { |
| | | |
| | | }, |
| | | addDictSuccess(addDictForm) { |
| | | this.searchClearBtn(); |
| | | }, |
| | | searchClearBtn() { |
| | | this.searchData = { |
| | | code: "", |
| | | dictValue: "", |
| | | current: "1", |
| | | size: "15" |
| | | } |
| | | this.searchBtn(); |
| | | }, |
| | | searchclick() { |
| | | this.searchData.current = "1"; |
| | | this.searchData.size = "15"; |
| | | this.searchBtn(); |
| | | }, |
| | | searchBtn() { |
| | | this.$HTTP.get("/api/blade-system/dict/parent-list",this.searchData).then(res=> { |
| | | if(res.code == 200) { |
| | | this.tableData = res.data.records; |
| | | this.total = res.data.total; |
| | | } |
| | | }) |
| | | }, |
| | | //åå
¸é
ç½® |
| | | table_allocation(row) { |
| | | this.dialog.allocation = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.allocationDialog.open('edit').setData(row); |
| | | }) |
| | | }, |
| | | //å é¤ |
| | | table_del(row) { |
| | | var that = this; |
| | | this.$confirm(`ç¡®å®å°éæ©æ°æ®å é¤?`, '', { |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$HTTP.post("/api/blade-system/dict/remove?ids="+row.id).then(res=> { |
| | | if(res.code == 200) { |
| | | that.$message.success("æä½æå"); |
| | | that.searchBtn(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | }, |
| | | //æ·»å |
| | | addData(){ |
| | | this.dialog.save = true |
| | | this.$nextTick(() => { |
| | | this.$refs.saveDialog.open() |
| | | }) |
| | | }, |
| | | table_edit(row){ |
| | | this.dialog.save = true |
| | | this.$HTTP.get("/api/blade-system/dict/detail?id="+row.id).then(res=> { |
| | | if(res.code == 200) { |
| | | this.dialog.save = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.saveDialog.open('edit').setData(res.data); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | //æ¥ç |
| | | table_show(row){ |
| | | this.dialog.save = true |
| | | this.$nextTick(() => { |
| | | this.$refs.saveDialog.open('show').setData(row) |
| | | }) |
| | | }, |
| | | handleSelectionChange(selection) { |
| | | this.selection = selection; |
| | | }, |
| | | delData() { |
| | | if(this.selection.length == 0) { |
| | | this.$message({ |
| | | message: 'è¯·éæ©è³å°ä¸æ¡æ°æ®', |
| | | type: 'warning' |
| | | }); |
| | | return; |
| | | } |
| | | var selStr = ""; |
| | | this.selection.map(item=> { |
| | | selStr += item.id + "," |
| | | }) |
| | | selStr = selStr.replace(/,$/, ''); |
| | | var that = this; |
| | | this.$HTTP.post("/api/blade-system/dict/remove?ids="+selStr).then(res=> { |
| | | if(res.code == 200) { |
| | | that.$message.success("æä½æå"); |
| | | that.searchclick(); |
| | | } |
| | | }) |
| | | }, |
| | | changeDepartment() { |
| | | this.departmentVisible = true; |
| | | }, |
| | | changeTab(name) { |
| | | if(name == 1) { |
| | | this.leftActive = true; |
| | | }else { |
| | | this.leftActive = false; |
| | | } |
| | | }, |
| | | handleSizeChange(val) { |
| | | console.log(`æ¯é¡µ ${val} æ¡`); |
| | | this.searchData.current = "1"; |
| | | this.searchData.size = val; |
| | | this.searchBtn(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | console.log(`å½å页: ${val}`); |
| | | this.searchData.current = val; |
| | | this.searchBtn(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .dict-main { |
| | | background-color: #fff; |
| | | margin: 8px; |
| | | padding: 8px; |
| | | } |
| | | .dict-Btn { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | border-bottom: 1px solid #dcdfe6; |
| | | margin-bottom: 8px; |
| | | padding-left: 8px; |
| | | padding-right: 8px; |
| | | } |
| | | .searchStatus { |
| | | margin-right: 6px; |
| | | width: 200px; |
| | | } |
| | | .dict-btn-bottom { |
| | | padding-left: 8px; |
| | | padding-right: 8px; |
| | | margin-bottom: 8px; |
| | | } |
| | | .dict-table { |
| | | padding-left: 8px; |
| | | padding-right: 8px; |
| | | margin-bottom: 8px; |
| | | |
| | | } |
| | | .multipleTableRef { |
| | | margin-bottom: 8px; |
| | | } |
| | | </style> |
| | |
| | | this.dashboard = this.$TOOL.data.get("USER_INFO").dashboard || '0'; |
| | | }, |
| | | mounted(){ |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | onMounted(){ |
| | |
| | | |
| | | <script> |
| | | export default { |
| | | title: "ä¿¡æ¯å¡", |
| | | icon: "el-icon-setting", |
| | | description: "åå·¥èä½ä¿¡æ¯ãè´¦å·ä¿¡æ¯ãç³»ç»çæ¬å¿«éæ¥ç", |
| | | data() { |
| | | return { |
| | | |
| | |
| | | <div> |
| | | <el-card shadow="hover" header="å¿«æ·å
¥å£"> |
| | | <ul> |
| | | <li><div>人工-é¨é¨</div></li> |
| | | <li v-for="(item,index) in titleList"> |
| | | <div @click="goPage(item)">{{item.name}}</div> |
| | | </li> |
| | | <li><div class="addMenu" @click="showDrawer">+ æ·»å èå</div></li> |
| | | </ul> |
| | | </el-card> |
| | |
| | | <div v-for="(value,key,index) in menuList"> |
| | | <div class="parent-children-title">{{key}}</div> |
| | | <div class="parent-children"> |
| | | <span v-for="item in value"> |
| | | {{item}} |
| | | <div class="triangle-topright"></div> |
| | | <el-icon class="icon-topright"><Select /></el-icon> |
| | | <span v-for="(item,index1) in value" @click="addChecked(item,key,index1)" > |
| | | <div class="parent-name">{{item.name}}</div> |
| | | <div class="triangle-topright" v-if="item.checked"></div> |
| | | <el-icon class="icon-topright" v-if="item.checked"><Select /></el-icon> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div class="drawer-foot"> |
| | | <el-button @click="closeDrawer">åæ¶</el-button> |
| | | <el-button type="primary" @click="drawerConfirm">ç¡®å®</el-button> |
| | | </div> |
| | | </el-drawer> |
| | | </div> |
| | |
| | | icons.push(key) |
| | | } |
| | | export default { |
| | | title: "å¿«æ·å
¥å£", |
| | | icon: "el-icon-data-line", |
| | | description: "æ·»å 常ç¨èåå
¥å£", |
| | | data() { |
| | | return { |
| | | direction: "rtl", |
| | | titleList: [], |
| | | drawer: false, |
| | | menuList: {} |
| | | menuList: {}, |
| | | CARD_INFO: [], |
| | | firstMenuList: [], //åå¨åå§åçæ°æ® |
| | | setCard: [], |
| | | workid: "" |
| | | } |
| | | }, |
| | | components: {...ElementPlusIconsVue}, |
| | | mounted() { |
| | | var data = this.$TOOL.data.get("MENU"); |
| | | var obj = {}; |
| | | data.forEach((item,index)=> { |
| | | if(item.name != "å·¥ä½å°") { |
| | | obj[item.name] = this.getLastLevelNames(item.children); |
| | | } |
| | | }) |
| | | this.menuList = obj; |
| | | this.getCard(); |
| | | }, |
| | | methods: { |
| | | drawerConfirm() { |
| | | var list = []; |
| | | for(var key in this.menuList) { |
| | | this.menuList[key].forEach(item=> { |
| | | if(item.checked) { |
| | | list.push(item.id); |
| | | } |
| | | }) |
| | | } |
| | | this.setCard.forEach(item=> { |
| | | if(item.cardKey == "Entrance") { |
| | | item.textContent = list.join(","); |
| | | } |
| | | }) |
| | | var obj = { |
| | | workbenchId: this.workid, |
| | | workbenchCardAddVOList: this.setCard |
| | | } |
| | | this.$HTTP.post(`/api/blade-system/workbench-card/create-workbench-card`,obj).then(res=> { |
| | | if(res.code == 200) { |
| | | this.drawer = false; |
| | | this.menuList = {}; |
| | | this.getCard(); //éæ°è·åå¿«æ·èå |
| | | } |
| | | }) |
| | | //console.log(this.setCard,222) |
| | | }, |
| | | getCard() { //è·åå¿«æ·èå |
| | | this.$HTTP.get(`/api/blade-system/workbench-card/list?workbenchId=${this.workid}`).then(res=> { |
| | | if(res.code == 200) { |
| | | this.setCard = res.data; |
| | | res.data.forEach(item=> { |
| | | if(item.cardKey == "Entrance") { |
| | | this.$TOOL.data.set("CARD_INFO", item.textContent); |
| | | } |
| | | }) |
| | | this.init(); //æ ¹æ®è·åçå¿«æ·èååèåç¡®å®æåä¸çº§åå¾éç¶æ |
| | | } |
| | | }) |
| | | }, |
| | | init() { |
| | | this.titleList = []; |
| | | var data = this.$TOOL.data.get("MENU"); |
| | | this.workid = data[0].children[0].id; //è®°å½ç¬¬ä¸ä¸ªchildrençid |
| | | this.CARD_INFO = this.$TOOL.data.get("CARD_INFO").split(","); |
| | | var obj = {}; |
| | | //åæåä¸çº§èå |
| | | data.forEach((item,index)=> { |
| | | if(item.name != "å·¥ä½å°") { |
| | | obj[item.name] = this.getLastLevelNames(item.children); |
| | | } |
| | | }) |
| | | this.menuList = obj; |
| | | this.firstMenuList = JSON.parse(JSON.stringify(obj)); //åå¨åå§åçæ°æ® |
| | | // è·åtitle |
| | | for(var key in this.menuList) { |
| | | this.menuList[key].forEach(item=> { |
| | | if(item.checked) { |
| | | this.titleList.push(item) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | addChecked(item,key,index1) { |
| | | this.menuList[key][index1].checked = !this.menuList[key][index1].checked; |
| | | }, |
| | | goPage(item) { |
| | | this.$router.push(item.path); |
| | | }, |
| | | getLastLevelNames(tree) { |
| | | const lastLevelNames = []; |
| | | |
| | | var that = this; |
| | | const lastLevelNames = []; |
| | | //,checked: this.$TOOL.data.get("CARD_INFO").split(",").include(item.id) |
| | | tree.forEach(item => { |
| | | if (item.children) { |
| | | // éå½è°ç¨ï¼å¤çåèå项 |
| | |
| | | lastLevelNames.push(...childLastLevelNames); |
| | | } else { |
| | | // å½å项没æåèåé¡¹ï¼æ¯æåä¸å±ï¼æ·»å å
¶åç§° |
| | | lastLevelNames.push(item.name); |
| | | lastLevelNames.push({name:item.name,id: item.id,checked: that.CARD_INFO.includes(item.id),path: item.path}); |
| | | } |
| | | }); |
| | | |
| | |
| | | showDrawer() { |
| | | this.drawer = true; |
| | | }, |
| | | closeDrawer() { |
| | | this.menuList = JSON.parse(JSON.stringify(this.firstMenuList)); |
| | | this.drawer = false; |
| | | }, |
| | | handleClose(done) { |
| | | this.$confirm('确认å
³éï¼').then(_ => { |
| | | done(); |
| | | }).catch(_ => {}); |
| | | } |
| | | this.menuList = JSON.parse(JSON.stringify(this.firstMenuList)); |
| | | done(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | ul {list-style: none;margin-bottom: 10px;overflow: hidden;} |
| | | ul li {float: left;margin-bottom: 8px;} |
| | | ul li div {border: 1px solid #3b8e8e;margin-top: 10px;height: 43px;margin-left: 10px;display: flex;align-items: center;justify-content: center;color: #3b8e8e;padding: 7px 15px;border-radius: 2px;border-radius: 2px;white-space: nowrap;cursor: pointer;} |
| | | ul li div,.addMenu{border: 1px solid #3b8e8e;margin-top: 10px;height: 43px;margin-left: 10px;display: flex;align-items: center;justify-content: center;color: #3b8e8e;border-radius: 2px;border-radius: 2px;white-space: nowrap;cursor: pointer;min-width: 112px;} |
| | | ul li div:hover {background-color: #ebf4f4;} |
| | | .addMenu {border: 1px dashed #3b8e8e;} |
| | | ..addMenu:hover {border: 1px dashed #104E8B;} |
| | | .parent-children-title {margin-left: 10px;margin-top: 24px;font-weight: 700;font-size: 14px;text-align: left;color: #333;} |
| | | .parent-children {display: flex;flex-direction: row;flex-wrap: wrap;justify-content: flex-start;align-items: flex-start;padding-left: 10px;box-sizing: border-box;} |
| | | .parent-children span {margin-left: 10px;margin-top: 10px;width: 22%;border: 0.5px solid #20B2AA;border-radius: 2px;height: 43px;display: flex;align-items: center;justify-content: center;cursor: pointer;position: relative;} |
| | | .parent-children span {margin-left: 10px;margin-top: 10px;width: 22%;border: 0.5px solid #20B2AA;border-radius: 2px;height: 43px;display: flex;align-items: center;justify-content: center;cursor: pointer;position: relative;min-width: 112px;} |
| | | .parent-children span:hover {border: 1px solid #104E8B;} |
| | | .triangle-topright {width: 0;height: 0;border-top: 28px solid #3b8e8e;border-left: 28px solid transparent;position: absolute;right: 0;top: 0;} |
| | | .icon-topright {position: absolute;right: 2px;top: 2px;z-index: 2;color: #fff;} |
| | | .drawer-foot {text-align: right;margin-top: 8px;margin-bottom: 8px;margin-right: 20px;} |
| | | </style> |
| | |
| | | |
| | | <script> |
| | | export default { |
| | | title: "å
Œ", |
| | | icon: "el-icon-setting", |
| | | description: "ç³»ç»å
éç¥ãå
¬åéç¥å¿«éæ¥ç", |
| | | data() { |
| | | return { |
| | | |
| | |
| | | }); |
| | | } |
| | | }) |
| | | //è·åèå |
| | | await this.$HTTP.get("/api/blade-system/menu/routes?" + this.$TOOL.qsStringify({"appCode": "CPS"})).then(res=> { |
| | | if(res.data.length==0){ |
| | | this.islogin = false |
| | |
| | | }); |
| | | } |
| | | var transformedArray = addComponentToLastLevel(res.data); |
| | | transformedArray[0].path = "/home"; |
| | | transformedArray[0].children = [{ |
| | | component: "home", |
| | | meta: {title: "å·¥ä½å°", icon: 'el-icon-menu', affix: true}, |
| | | name: "å·¥ä½å°", |
| | | path: "/dashboard" |
| | | }] |
| | | // this.$HTTP.get("/api/blade-system/workbench/list?status=1").then(resp=> { |
| | | // if(resp.data.length) { |
| | | // console.log(resp.data,resp.data[0].name,333); |
| | | // resp.data.forEach(item=> { |
| | | // item.component = "home"; |
| | | // item.meta = {title: item.nam, icon: 'el-icon-menu', affix: true}; |
| | | // item.path = "/dashboard"; |
| | | // item.parentId = item.id; |
| | | // }) |
| | | // transformedArray[0].path = "/home"; |
| | | // transformedArray[0].children = resp.data; |
| | | // } |
| | | // }) |
| | | //ç»æ |
| | | var obj = { |
| | | dashboardGrid: ["welcome", "ver", "time", "progress", "echarts", "about"], |
| | | menu: transformedArray, |
| | | permissions: ["list.add", "list.edit", "list.delete", "user.add", "user.edit", "user.delete"] |
| | | } |
| | | console.log(transformedArray,123) |
| | | // this.$API.system.menu.myMenus.get().then(resp=> { |
| | | // Object.assign({},transformedArray,resp.data.menu); |
| | | // this.$TOOL.data.set("MENU", obj.menu) |
| | | // this.$TOOL.data.set("PERMISSIONS", obj.permissions) |
| | | // this.$TOOL.data.set("DASHBOARDGRID", obj.dashboardGrid) |
| | | // }); |
| | | this.$TOOL.data.set("MENU", obj.menu) |
| | | this.$TOOL.data.set("PERMISSIONS", obj.permissions) |
| | | this.$TOOL.data.set("DASHBOARDGRID", obj.dashboardGrid) |
| | | //è·åå¤ä¸ªå·¥ä½å° |
| | | this.$HTTP.get("/api/blade-system/workbench/list?status=1").then(resp=> { |
| | | if(resp.data.length) { |
| | | //console.log(resp.data,resp.data[0].name,333); |
| | | resp.data.forEach((item,index)=> { |
| | | item.component = "home"; |
| | | item.meta = {title: item.name, icon: 'el-icon-menu', affix: true}; |
| | | item.path = "/dashboard"; |
| | | item.parentId = item.id; |
| | | }) |
| | | transformedArray[0].path = "/home"; |
| | | transformedArray[0].children = resp.data; |
| | | var obj = { |
| | | dashboardGrid: ["welcome", "ver", "time", "progress", "echarts", "about"], |
| | | menu: transformedArray, |
| | | permissions: ["list.add", "list.edit", "list.delete", "user.add", "user.edit", "user.delete"] |
| | | } |
| | | this.$TOOL.data.set("MENU", obj.menu) |
| | | this.$TOOL.data.set("PERMISSIONS", obj.permissions) |
| | | this.$TOOL.data.set("DASHBOARDGRID", obj.dashboardGrid) |
| | | console.log(transformedArray,222) |
| | | |
| | | this.$router.replace({ |
| | | path: '/' |
| | | }) |
| | | this.$message.success("Login Success ç»å½æå") |
| | | this.islogin = false; |
| | | } |
| | | }) |
| | | }) |
| | | this.$router.replace({ |
| | | path: '/' |
| | | }) |
| | | this.$message.success("Login Success ç»å½æå") |
| | | this.islogin = false; |
| | | |
| | | } |
| | | } |
| | | } |