Browse Source
# Conflicts: # src/components/DesignForm/public/form/formItem.vue # src/components/DesignForm/tableListPage/formPageCont.vue # src/widget/number/index.vue # src/widget/urllink/index.vuelwx_v27
96 changed files with 5318 additions and 326 deletions
@ -0,0 +1 @@ |
|||
v0.1.0 |
|||
@ -0,0 +1 @@ |
|||
{"Version":"v0.1.0","Time":"2025-08-20T21:59:11Z"} |
|||
@ -0,0 +1,3 @@ |
|||
module github.com/golang/vscode-go/survey |
|||
|
|||
go 1.24.0 |
|||
Binary file not shown.
@ -0,0 +1 @@ |
|||
h1:xb0wfrbGDzAH53rMZHzsRKysbpIE39IbHLf+QSw8VJA= |
|||
@ -0,0 +1 @@ |
|||
{"Version":"v0.20.0","Time":"2025-07-28T18:28:48Z"} |
|||
@ -0,0 +1,9 @@ |
|||
42389416 |
|||
github.com/golang/vscode-go/survey v0.1.0 h1:xb0wfrbGDzAH53rMZHzsRKysbpIE39IbHLf+QSw8VJA= |
|||
github.com/golang/vscode-go/survey v0.1.0/go.mod h1:67MoCjDPlWMr9FZ2d5BhLYR//kGR/bmjhzjy6FXSM74= |
|||
|
|||
go.sum database tree |
|||
45397085 |
|||
Q08DMHCrmZD7Zsiq5TpsB/JTYZmvPijBiIqUxsz+8fY= |
|||
|
|||
— sum.golang.org Az3grl4BXbPgBbxGJxcshVA2zNKOttFAyV8B6prkb9KDELwGDNlx0asydXInM0hqO92L4lcs/neWYXfoZ3iOd1BLfg8= |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@ |
|||
o |
|||
”@m°%q±£T`…ow!^ñ¾Z—{§�Ë�éÐvÍ빜5Ñ1 "sJ®YFØñ Ç |
|||
iÂéè¶9Z•Æ9Æ |
|||
@ -0,0 +1,24 @@ |
|||
vscode-go |
|||
|
|||
The MIT License (MIT) |
|||
|
|||
Original Work Copyright (c) 2015-2020 Microsoft Corporation |
|||
Current Work and Modifications Copyright (c) 2020-present The Go Authors |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is |
|||
furnished to do so, subject to the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be included in all |
|||
copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|||
SOFTWARE. |
|||
@ -0,0 +1,41 @@ |
|||
# Go Developer Survey Configuration |
|||
|
|||
This Go module serves the configuration file for the Go Developer Survey shown in the [VS Code Go extension](https://github.com/golang/vscode-go). |
|||
|
|||
## Purpose |
|||
|
|||
This module exists solely to host the `config.json` file. By hosting it as a Go module, it can be fetched via module proxy, providing a reliable and secure way for the VS Code Go extension to get the latest survey configuration. |
|||
|
|||
This approach is inspired by the Go team's telemetry configuration module. |
|||
|
|||
## `config.json` |
|||
|
|||
The `config.json` file defines the parameters for the Go Developer Survey. It has the following structure: |
|||
|
|||
```json |
|||
{ |
|||
"StartDate": "2023-09-01T00:00:00Z", |
|||
"EndDate": "2023-10-01T00:00:00Z", |
|||
"URL": "https://google.com/survey/url" |
|||
} |
|||
``` |
|||
|
|||
- `StartDate`: The ISO 8601 timestamp for when the survey promotion should start. |
|||
- `EndDate`: The ISO 8601 timestamp for when the survey promotion should end. |
|||
- `URL`: The URL to the survey. |
|||
|
|||
## Usage |
|||
|
|||
This module is not intended to be used as a library. It is fetched by the VS Code Go extension. |
|||
|
|||
## Tagging |
|||
|
|||
The versioning scheme follows semantic versioning, with each change to the configuration being a **minor** version increment. |
|||
|
|||
As this module is in the `survey/` subdirectory of its repository, the git tag **must** be prefixed with `survey/`. This is a requirement for Go modules located in subdirectories. For more details, see the [Go Modules documentation](https://go.dev/ref/mod#vcs-version). |
|||
|
|||
For example, if the most recent tag is `survey/v0.1.0`, the new tag should be `survey/v0.2.0`. |
|||
|
|||
## Release Process |
|||
|
|||
When changes are made to `config.json`, a new version of this module must be released. This is done by creating a new git tag that follows the convention described above. |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"StartDate": "2025-09-09T00:00:00Z", |
|||
"EndDate": "2025-10-01T00:00:00Z", |
|||
"URL": "https://google.qualtrics.com/jfe/form/SV_3wwSstC8vv4Ymkm" |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
module github.com/golang/vscode-go/survey |
|||
|
|||
go 1.24.0 |
|||
@ -0,0 +1,9 @@ |
|||
// The survey package holds the config.json file defining the Go Developer
|
|||
// Survey configuration.
|
|||
//
|
|||
// The survey configuration specifies the survey's start and end dates, and the
|
|||
// URL for the survey.
|
|||
//
|
|||
// This package contains no actual Go code, and exists only so the config.json
|
|||
// file can be served by module proxies.
|
|||
package survey |
|||
@ -0,0 +1,7 @@ |
|||
const allNodePwoer = inject('flowNodePower') |
|||
const currentNodePowerKey = inject('currentNodeKey') |
|||
|
|||
export const ObtainAuthorization = (key:string,types?:number) => { |
|||
console.log("测试是否获取授权-1-->",allNodePwoer) |
|||
console.log("测试是否获取授权-2-->",currentNodePowerKey) |
|||
} |
|||
|
After Width: | Height: | Size: 1.1 KiB |
File diff suppressed because it is too large
@ -0,0 +1,14 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
|
|||
</script> |
|||
<template> |
|||
<div>缓存列表</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,14 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
|
|||
</script> |
|||
<template> |
|||
<div>在线人数</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,14 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
|
|||
</script> |
|||
<template> |
|||
<div>数据监控</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,169 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
|
|||
import { watch, ref, nextTick } from 'vue'; |
|||
import { useRoute, useRouter } from 'vue-router'; |
|||
const route = useRoute(); |
|||
const router = useRouter() |
|||
const cacheMenuList = ref([]) |
|||
const scrollBarRef = ref(null) |
|||
const tagsListRef = ref([]) |
|||
|
|||
// 自动滚动到新增的tag, 出现在视野区域 |
|||
const autoScrollNewTag = () => { |
|||
nextTick(() => { |
|||
// 获取滚动容器 |
|||
let container = scrollBarRef.value.wrapRef; |
|||
// 获取滚动内容的实际宽度(包括超出的内容) |
|||
let scrollWidth = container.scrollWidth; |
|||
// 获取滚动容器的视野宽度 |
|||
let clientWidth = container.clientWidth; |
|||
// 计算滚动值 |
|||
let scrollX = scrollWidth - clientWidth; |
|||
|
|||
scrollBarRef.value.scrollTo({ |
|||
left: scrollX, |
|||
behavior: 'smooth' // 使用平滑滚动 |
|||
}) |
|||
}) |
|||
} |
|||
// 自动滚动到当前激活的菜单, 菜单已存在的情况 |
|||
const autoScrollSelectedTag = () => { |
|||
nextTick(() => { |
|||
let container = scrollBarRef.value.wrapRef; |
|||
// 获取现在的滚动值 偏移值: |
|||
let scrollLeft = container.scrollLeft; |
|||
// 获取容器的偏移值 |
|||
let wrapLeft = container.getBoundingClientRect(); |
|||
// 获取当前激活tag 偏移值 |
|||
let activeTagLeft = container.querySelector('.el-tag--primary').getBoundingClientRect(); |
|||
|
|||
scrollBarRef.value.scrollTo({ |
|||
left: scrollLeft + (activeTagLeft.left - wrapLeft.left), |
|||
behavior: "smooth" |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
// 点击左右箭头实现滚动 |
|||
const scrollArrowHandler = (direction) => { |
|||
// 获取当前的滚动偏移值 |
|||
let scrollLeftX = scrollBarRef.value.wrapRef.scrollLeft; |
|||
|
|||
scrollBarRef.value.scrollTo({ |
|||
left: scrollLeftX + (direction == 'left' ? -100 : 100), |
|||
behavior: 'smooth' // 使用平滑滚动 |
|||
}) |
|||
} |
|||
// 点击菜单 切换路由 |
|||
const navigatorTo = routeParams => { |
|||
router.push({ |
|||
path: routeParams.path |
|||
}) |
|||
} |
|||
// 关闭菜单 |
|||
const deleteCacheMenu = (routeParams, index) => { |
|||
// 判断删除的菜单是否时当前激活的菜单 |
|||
if (routeParams.path === route.path) { |
|||
// 自动过渡下一个 后边有过渡下一个, 否则过渡前一个 |
|||
if (index < cacheMenuList.value.length - 1) { |
|||
router.push({ |
|||
path: cacheMenuList.value[index + 1].path |
|||
}) |
|||
} else if (index == cacheMenuList.value.length - 1 && cacheMenuList.value.length > 1) { |
|||
// 如果删除的是唯一一个tag 则只删除tag, 不跳转路由 排除这种情况 |
|||
router.push({ |
|||
path: cacheMenuList.value[index - 1].path |
|||
}) |
|||
} |
|||
} |
|||
|
|||
cacheMenuList.value.splice(index, 1); |
|||
// 更新缓存 |
|||
localStorage.setItem('menusList', JSON.stringify(cacheMenuList.value)) |
|||
} |
|||
|
|||
// 监听路由变化 |
|||
watch(() => route, (newRoute, oldRoute) => { |
|||
let isExit = cacheMenuList.value.some(item => item.path === newRoute.path) |
|||
|
|||
if (!isExit) { |
|||
cacheMenuList.value.push({ ...newRoute }); |
|||
// 持久化路由缓存 |
|||
localStorage.setItem('menusList', JSON.stringify(cacheMenuList.value)) |
|||
// 如果是新增, 则自动过渡到新增的tag, 即滚动到最后一个tag的位置 |
|||
autoScrollNewTag() |
|||
} else { |
|||
// 如果不是新增, 则自动滚动到当前的tag, 即当前的tag出现在视野区域中 |
|||
autoScrollSelectedTag() |
|||
} |
|||
}, { |
|||
immediate: true, |
|||
deep: true |
|||
}) |
|||
</script> |
|||
|
|||
|
|||
<template> |
|||
<div class="scroll-test"> |
|||
<el-icon @click="scrollArrowHandler('left')"> |
|||
<ArrowLeft /> |
|||
</el-icon> |
|||
<el-scrollbar wrap-class="scroll-wrap" ref="scrollBarRef" > |
|||
<div class="menu-wrapper"> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 1</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 2</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 3</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 4</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 5</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 6</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 7</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 8</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 9</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 10</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 11</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 12</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 13</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 14</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 15</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 16</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 17</el-tag> |
|||
</div> |
|||
</el-scrollbar> |
|||
<el-icon @click="scrollArrowHandler('right')"> |
|||
<ArrowRight /> |
|||
</el-icon> |
|||
</div> |
|||
|
|||
</template> |
|||
|
|||
|
|||
<style lang='scss' scoped> |
|||
.menu-wrapper { |
|||
width: 100%; |
|||
height: 50px; |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
|
|||
.el-tag { |
|||
flex-shrink: 0; |
|||
margin-left: 10px; |
|||
} |
|||
|
|||
.el-scrollbar { |
|||
width: 100%; |
|||
height: 50px !important; |
|||
} |
|||
|
|||
.scroll-test { |
|||
display: flex; |
|||
height: 50px; |
|||
align-items: center; |
|||
width: 100%; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,240 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
const scrollBarRef = ref() |
|||
const setup = reactive({ |
|||
roleId:"1", |
|||
appId:"stzl" |
|||
}) |
|||
const pickuserrole = ref("first") |
|||
const systemTableData = ref([]) |
|||
const roleUserTableData = ref([]) |
|||
const dialogVisible = ref(false) |
|||
// 点击左右箭头实现滚动 |
|||
const scrollArrowHandler = (direction:string) => { |
|||
console.log("scrollBarRef----->",scrollBarRef.value) |
|||
// 获取当前的滚动偏移值 |
|||
let scrollLeftX = scrollBarRef.value.wrapRef.scrollLeft; |
|||
|
|||
scrollBarRef.value.scrollTo({ |
|||
left: scrollLeftX + (direction == 'left' ? -100 : 100), |
|||
behavior: 'smooth' // 使用平滑滚动 |
|||
}) |
|||
} |
|||
//选择角色 |
|||
const pickrole = (val:any) => { |
|||
setup.roleId = val |
|||
} |
|||
//关闭新增角色 |
|||
const roleHandleClose = () =>{ |
|||
dialogVisible.value = false |
|||
} |
|||
//打开新增角色窗口 |
|||
const openHandleRoleBox = () => { |
|||
dialogVisible.value = true |
|||
} |
|||
onMounted(()=>{ |
|||
for(let i=0;i<120;i++){ |
|||
systemTableData.value.push({ |
|||
date:i |
|||
}) |
|||
} |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="roleBox"> |
|||
<el-card shadow="always" class="roleCardBox"> |
|||
<template #header> |
|||
<div class="caerHeader"> |
|||
<svg-icon icon-class="arrow-left" size="30px" @click="scrollArrowHandler('left')"></svg-icon> |
|||
<el-scrollbar ref="scrollBarRef" class="scroBox"> |
|||
<div class="scrollbar-flex-content"> |
|||
<el-tag :type="setup.roleId == '1'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(1)">超级管理员</el-tag> |
|||
<el-tag :type="setup.roleId == '2'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(2)" >管理员</el-tag> |
|||
<el-tag :type="setup.roleId == '3'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(3)" >恒信高科全员权限</el-tag> |
|||
<el-tag :type="setup.roleId == '4'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(4)" >绩效考核管理员</el-tag> |
|||
<el-tag :type="setup.roleId == '5'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(5)" >恒信高科主要负责人</el-tag> |
|||
<el-tag :type="setup.roleId == '6'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(6)" >高管</el-tag> |
|||
<el-tag :type="setup.roleId == '7'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(7)" >内勤</el-tag> |
|||
<el-tag :type="setup.roleId == '8'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(8)" >焦炉热工项目组</el-tag> |
|||
<el-tag :type="setup.roleId == '9'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(9)" >公司排班专员</el-tag> |
|||
<el-tag :type="setup.roleId == '10'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(10)" >质检数据录入员</el-tag> |
|||
<el-tag :type="setup.roleId == '11'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(11)" >数据上传员</el-tag> |
|||
<el-tag :type="setup.roleId == '12'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(12)" >游客</el-tag> |
|||
<el-tag :type="setup.roleId == '13'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(13)" >仓储管理员</el-tag> |
|||
<el-tag :type="setup.roleId == '14'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(14)" >仓储专用</el-tag> |
|||
<el-tag :type="setup.roleId == '15'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(15)" >玖安高科管理员</el-tag> |
|||
<el-tag :type="setup.roleId == '16'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(16)" >生产部调度员</el-tag> |
|||
<el-tag :type="setup.roleId == '17'?'primary':'info'" effect="dark" size="large" closable @click="pickrole(17)" >生产部</el-tag> |
|||
</div> |
|||
</el-scrollbar> |
|||
<el-space wrap> |
|||
<svg-icon icon-class="arrow-right" size="30px" @click="scrollArrowHandler('right')"ss></svg-icon> |
|||
<svg-icon icon-class="add" size="30px" @click="openHandleRoleBox()"></svg-icon> |
|||
</el-space> |
|||
</div> |
|||
</template> |
|||
<el-scrollbar class="cardDobyBox"> |
|||
<el-tabs v-model="setup.appId" tab-position="left" class="demo-tabs"> |
|||
<el-tab-pane label="数通智联化工凭他" name="stzl"> |
|||
|
|||
<el-tabs v-model="pickuserrole" class="demo-tabs" > |
|||
<el-tab-pane label="权限配置" name="first"> |
|||
<el-table |
|||
:data="systemTableData" |
|||
row-key="id" |
|||
border |
|||
default-expand-all |
|||
class="roleTableBox" |
|||
> |
|||
<el-table-column prop="date" label="赋权内容" /> |
|||
<el-table-column prop="name" label="权限选项" > |
|||
<el-checkbox-group v-model="checkList"> |
|||
<el-checkbox label="查看" value="1" /> |
|||
<el-checkbox label="新增" value="2" /> |
|||
<el-checkbox label="修改" value="Value A" /> |
|||
<el-checkbox label="删除" value="Value A" /> |
|||
|
|||
</el-checkbox-group> |
|||
</el-table-column> |
|||
<el-table-column prop="address" label="数据范围"> |
|||
<el-radio-group v-model="radio"> |
|||
<el-radio :value="1">私有</el-radio> |
|||
<el-radio :value="2">本岗位</el-radio> |
|||
<el-radio :value="3">本部门</el-radio> |
|||
<el-radio :value="4">本集团</el-radio> |
|||
<el-radio :value="5">所有</el-radio> |
|||
<el-radio :value="9">指定行政组织</el-radio> |
|||
</el-radio-group> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="butBox"> |
|||
<el-button type="primary">确定赋权</el-button> |
|||
</div> |
|||
|
|||
</el-tab-pane> |
|||
<el-tab-pane label="当前使用人" class="affix-container" name="second"> |
|||
|
|||
<el-table :data="systemTableData" class="roleTableBox" border> |
|||
<el-table-column fixed prop="date" label="照片" width="80" align="center" /> |
|||
<el-table-column fixed prop="name" label="姓名" width="120" align="center" /> |
|||
<el-table-column prop="address" label="工号" width="120" align="center" /> |
|||
<el-table-column prop="address" label="联系方式" width="180" align="center"/> |
|||
<el-table-column prop="address" label="归属行政组织" /> |
|||
<el-table-column fixed="right" prop="address" label="操作" align="center" width="120" > |
|||
<el-space wrap> |
|||
<el-button type="primary" size="small"> |
|||
<svg-icon icon-class="eye-open" /> |
|||
</el-button> |
|||
<el-button type="primary" size="small"> |
|||
<svg-icon icon-class="dels" /> |
|||
</el-button> |
|||
</el-space> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="butBox"> |
|||
<el-button type="success">添加使用人</el-button> |
|||
</div> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
|
|||
|
|||
</el-tab-pane> |
|||
<el-tab-pane label="应用开发" name="Config">系统1</el-tab-pane> |
|||
|
|||
</el-tabs> |
|||
</el-scrollbar> |
|||
</el-card> |
|||
|
|||
<el-dialog |
|||
v-model="dialogVisible" |
|||
title="新增角色" |
|||
width="500" |
|||
:before-close="roleHandleClose" |
|||
draggable |
|||
> |
|||
<el-form label-width="auto" style="max-width: 100%"> |
|||
<el-form-item label="角色名称"> |
|||
<el-input /> |
|||
</el-form-item> |
|||
<el-form-item label="排序"> |
|||
<el-input :min="1" :max="30" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template #footer> |
|||
<div class="dialog-footer"> |
|||
<el-button type="primary" @click="dialogVisible = false">提交</el-button> |
|||
<el-button type="primary" @click="roleHandleClose"> |
|||
取消 |
|||
</el-button> |
|||
</div> |
|||
</template> |
|||
</el-dialog> |
|||
|
|||
|
|||
|
|||
|
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.roleBox{ |
|||
width: 100%; |
|||
height: calc(100vh - 170px); |
|||
padding: 15px 15px 0 15px; |
|||
.roleCardBox{ |
|||
width: 100%; |
|||
height: 100%; |
|||
:deep .el-card__header{ |
|||
padding: 10px; |
|||
} |
|||
.caerHeader{ |
|||
display: flex; |
|||
width: 100%; |
|||
height: 40px; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
color: #c2c0c0; |
|||
overflow: hidden; |
|||
svg{ |
|||
border: 1px solid #c2c0c0; |
|||
border-radius: 5px; |
|||
color: #c2c0c0; |
|||
cursor: pointer; |
|||
} |
|||
.scroBox{ |
|||
width: calc(100% - 105px); |
|||
height: 50px; |
|||
margin-top: 10px; |
|||
span{ |
|||
margin: 4px 3px 0 4px; |
|||
} |
|||
overflow: hidden; |
|||
} |
|||
.scrollbar-flex-content { |
|||
display: flex; |
|||
width: fit-content; |
|||
span{ |
|||
cursor: pointer; |
|||
} |
|||
} |
|||
|
|||
} |
|||
.cardDobyBox{ |
|||
width: 100%; |
|||
height: calc(100vh - 280px); |
|||
} |
|||
.roleTableBox{ |
|||
width: 100%; |
|||
margin-bottom: 10px; |
|||
height: calc(100vh - 400px); |
|||
} |
|||
} |
|||
} |
|||
.butBox{ |
|||
width: 100%; |
|||
text-align: right; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,87 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
|
|||
</script> |
|||
<template> |
|||
<div class="roleBox"> |
|||
<el-card shadow="always" class="roleCardBox"> |
|||
<template #header> |
|||
<div class="caerHeader"> |
|||
<svg-icon icon-class="arrow-left" size="30px"></svg-icon> |
|||
<el-scrollbar class="scroBox"> |
|||
<div class="scrollbar-flex-content"> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 1</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 2</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 3</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 4</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 5</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 6</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 7</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 8</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 9</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 10</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 11</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 12</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 13</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 14</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 15</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 16</el-tag> |
|||
<el-tag type="primary" effect="dark" size="large" closable >Tag 17</el-tag> |
|||
</div> |
|||
</el-scrollbar> |
|||
<el-space wrap> |
|||
<svg-icon icon-class="arrow-right" size="30px"></svg-icon> |
|||
<svg-icon icon-class="add" size="30px" ></svg-icon> |
|||
</el-space> |
|||
</div> |
|||
</template> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.roleBox{ |
|||
width: 100%; |
|||
height: calc(100vh - 170px); |
|||
padding: 15px 15px 0 15px; |
|||
.roleCardBox{ |
|||
width: 100%; |
|||
height: 100%; |
|||
:deep .el-card__header{ |
|||
padding: 10px; |
|||
} |
|||
.caerHeader{ |
|||
display: flex; |
|||
width: 100%; |
|||
height: 40px; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
color: #c2c0c0; |
|||
overflow: hidden; |
|||
svg{ |
|||
border: 1px solid #c2c0c0; |
|||
border-radius: 5px; |
|||
color: #c2c0c0; |
|||
cursor: pointer; |
|||
} |
|||
.scroBox{ |
|||
width: calc(100% - 105px); |
|||
height: 50px; |
|||
margin-top: 10px; |
|||
span{ |
|||
margin: 4px 3px 0 4px; |
|||
} |
|||
overflow: hidden; |
|||
} |
|||
.scrollbar-flex-content { |
|||
display: flex; |
|||
width: fit-content; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,355 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { giveRoleTree,editRoleStatus,getOrgPostTree } from '@/api/role/index' |
|||
import type {RoleListTree,RoleFormInfo,orgAndPostisListTree} from '@/api/role/types' |
|||
import type { TreeNode,TreeInstance } from 'element-plus' |
|||
import { Search } from '@element-plus/icons-vue' |
|||
import { orgInfo } from "@/api/hr/org/type"; |
|||
import { getOrgTreeList } from "@/api/hr/org/index"; |
|||
|
|||
import AddRoleGroup from '@/views/system/monitor/online/roleConfig/addRoleGroup.vue' |
|||
import EditRoleGroup from '@/views/system/monitor/online/roleConfig/editRoleGroup.vue' |
|||
|
|||
const orgTree = ref<orgInfo[]>([]) |
|||
const roleGroupOrInfo = ref(1) |
|||
const searchQuery = ref('') |
|||
const orgWorkRole = ref("org") |
|||
const appSysPick = ref("system") |
|||
const treeRef = ref<TreeInstance>() |
|||
const treeRefOrg = ref<TreeInstance>() |
|||
const roleListdata = ref<RoleListTree[]>([]) |
|||
const orgPostisListdata = ref<orgAndPostisListTree[]>([]) |
|||
const treeBoxHeight = ref(300) |
|||
const treeBoxHeightOrg = ref(300) |
|||
const roleLeft = ref() |
|||
const props = { |
|||
value: 'id', |
|||
label: 'label', |
|||
disabled:'status', |
|||
children: 'children', |
|||
} |
|||
const propsOrg = { |
|||
value: 'id', |
|||
label: 'name', |
|||
disabled:'status', |
|||
children: 'child', |
|||
} |
|||
const propsOrgPost = { |
|||
value: 'id', |
|||
label: 'label', |
|||
disabled:'status', |
|||
children: 'children', |
|||
} |
|||
const roleLoading = ref(false) |
|||
const openRoleGroup = ref(false) |
|||
const orgLoading = ref(false) |
|||
const orgPostLoading = ref(false) |
|||
//搜索角色 |
|||
const onQueryChanged = (query: string) => { |
|||
treeRef.value!.filter(query) |
|||
} |
|||
//搜索行政组织 |
|||
const onQueryChangedOrg = (query: string) => { |
|||
treeRefOrg.value!.filter(query) |
|||
} |
|||
const filterMethod = (query: string, node: any) => node.label!.includes(query) |
|||
const filterMethodOrg = (query: string, node: any) => node.name!.includes(query) |
|||
|
|||
//监测赋权组 |
|||
watch(()=>orgWorkRole.value,(val:string)=>{ |
|||
console.log("监测赋权组",val) |
|||
switch(val){ |
|||
case "org": |
|||
getOrgTreeAry(); |
|||
break; |
|||
case "job": |
|||
getOrgPostisTree() |
|||
break; |
|||
case "role": |
|||
getRoleTree(); |
|||
break; |
|||
default: |
|||
} |
|||
},{ |
|||
deep:true |
|||
}) |
|||
//选中角色节点 |
|||
const pickRoleTree = (data:any) => { |
|||
if(data.status && data.types==1){ |
|||
console.log("监测赋权组------->",data) |
|||
} |
|||
} |
|||
//选择行政组织 |
|||
const pickOrgTree = (data:any) => { |
|||
console.log("监测赋权组------->",data) |
|||
} |
|||
//获取角色树 |
|||
const getRoleTree = () => { |
|||
roleLoading.value = true |
|||
giveRoleTree().then(({data})=>{ |
|||
console.log("监测赋权组------->",data) |
|||
roleListdata.value=data; |
|||
roleLoading.value = false; |
|||
}).finally(()=>{roleLoading.value = false}) |
|||
} |
|||
const editRoleCont = ref<RoleFormInfo>() |
|||
const openEditRoleGroup = ref(false) |
|||
//编辑角色信息 |
|||
const editMyInfoIcon = (data:RoleListTree,types:number) => { |
|||
console.log("编辑角色信息------->",data) |
|||
console.log("编辑角色信息---types---->",types) |
|||
switch(types){ |
|||
case 1: |
|||
editRoleStatusBut(data.id,2) |
|||
break; |
|||
case 2: |
|||
editRoleStatusBut(data.id,1) |
|||
break; |
|||
case 3: |
|||
editRoleCont.value = { |
|||
id:data.id, |
|||
name:data.label, |
|||
type:data.types, |
|||
superior:data.superior, |
|||
sort:data.sort |
|||
} |
|||
openEditRoleGroup.value = true |
|||
break; |
|||
case 4: |
|||
ElMessageBox.confirm( |
|||
"您确定要删除此信息吗?一经删除!数据将不可恢复!请慎重操作!", |
|||
"警告", |
|||
{ |
|||
confirmButtonText: '确定删除', |
|||
cancelButtonText: '取消删除', |
|||
type: 'warning', |
|||
} |
|||
).then(()=>{ |
|||
editRoleStatusBut(data.id,3) |
|||
}) |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
} |
|||
//编辑角色状态 |
|||
const editRoleStatusBut = (id:string|number,types:number) => { |
|||
// console.log("编辑角色状态--->",id) |
|||
editRoleStatus({id:id.toString(),status:types}).then((data:any)=>{ |
|||
if(data.code==0){ |
|||
ElMessage({ |
|||
message: data.msg, |
|||
type: 'success', |
|||
}) |
|||
getRoleTree() |
|||
}else{ |
|||
ElMessage({ |
|||
message: data.msg, |
|||
type: 'success', |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
//添加角色组 |
|||
const addRoleGroup = (types:number) => { |
|||
|
|||
roleGroupOrInfo.value = types |
|||
openRoleGroup.value = true |
|||
} |
|||
//获取行政组织树 |
|||
const getOrgTreeAry = () => { |
|||
roleLoading.value = true |
|||
if(!Array.isArray(orgTree.value) || orgTree.value.length<=0){ |
|||
|
|||
getOrgTreeList({ orgid: 0 }) |
|||
.then(({ data }) => { |
|||
orgTree.value = data |
|||
roleLoading.value = false |
|||
}).finally(()=>{roleLoading.value = false}) |
|||
}else{ |
|||
roleLoading.value = false |
|||
} |
|||
|
|||
} |
|||
//获取行政组织及岗位 |
|||
const getOrgPostisTree = () => { |
|||
orgPostLoading.value=true |
|||
if(!Array.isArray(orgPostisListdata.value) || orgPostisListdata.value.length<=0){ |
|||
|
|||
getOrgPostTree({id:"313"}).then(({data})=>{ |
|||
console.log("获取行政组织及岗位--------->",data) |
|||
orgPostisListdata.value = data |
|||
orgPostLoading.value=false |
|||
}).finally(()=>{orgPostLoading.value=false}) |
|||
}else{ |
|||
orgPostLoading.value=true |
|||
} |
|||
} |
|||
onMounted(()=>{ |
|||
getOrgTreeAry(); |
|||
console.log("高度-----1---->",roleLeft.value?.offsetHeight) |
|||
nextTick(()=>{ |
|||
treeBoxHeight.value = roleLeft.value?.offsetHeight - 140 |
|||
treeBoxHeightOrg.value = roleLeft.value?.offsetHeight - 100 |
|||
}) |
|||
|
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="roleBox"> |
|||
<div ref="roleLeft" class="roleLeft"> |
|||
<el-tabs v-model="orgWorkRole" class="demo-tabs"> |
|||
<el-tab-pane label="行政组织" name="org"> |
|||
<template #label> |
|||
<el-text class="tabsTitle">行政组织</el-text> |
|||
</template> |
|||
<div class="searchBox"> |
|||
<el-input v-model="searchQuery" placeholder="请输入要查找的行政组织" :suffix-icon="Search" @input="onQueryChangedOrg"/> |
|||
</div> |
|||
<el-tree-v2 |
|||
ref="treeRefOrg" |
|||
style="max-width: 350px;" |
|||
:data="orgTree" |
|||
:props="propsOrg" |
|||
:filter-method="filterMethodOrg" |
|||
:height="treeBoxHeightOrg" |
|||
v-loading="roleLoading" |
|||
:highlight-current="true" |
|||
:check-on-click-node="true" |
|||
:expand-on-click-node="false" |
|||
@node-click="pickOrgTree" |
|||
> |
|||
</el-tree-v2> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="岗位" name="job"> |
|||
<template #label> |
|||
<el-text class="tabsTitle">岗位</el-text> |
|||
</template> |
|||
<div class="searchBox"> |
|||
<el-input v-model="searchQuery" placeholder="请输入要查找的行政组织" :suffix-icon="Search" @input="onQueryChangedOrg"/> |
|||
</div> |
|||
<el-tree-v2 |
|||
ref="treeRefOrg" |
|||
style="max-width: 350px;" |
|||
:data="orgPostisListdata" |
|||
:props="propsOrgPost" |
|||
:filter-method="filterMethodOrg" |
|||
:height="treeBoxHeightOrg" |
|||
v-loading="orgPostLoading" |
|||
:highlight-current="true" |
|||
:check-on-click-node="true" |
|||
:expand-on-click-node="false" |
|||
@node-click="pickOrgTree" |
|||
> |
|||
</el-tree-v2> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="角色" name="role"> |
|||
<template #label> |
|||
<el-text class="tabsTitle">角色</el-text> |
|||
</template> |
|||
<div class="butBox"> |
|||
<el-button type="primary" @click="addRoleGroup(1)">新建角色组</el-button> |
|||
<el-button type="primary" @click="addRoleGroup(2)">新建角色</el-button> |
|||
</div> |
|||
<div class="searchBox"> |
|||
<el-input v-model="searchQuery" placeholder="请输入要查找的角色" :suffix-icon="Search" @input="onQueryChanged"/> |
|||
</div> |
|||
<el-tree-v2 |
|||
ref="treeRef" |
|||
style="max-width: 350px;" |
|||
:data="roleListdata" |
|||
:props="props" |
|||
:filter-method="filterMethod" |
|||
:height="treeBoxHeight" |
|||
v-loading="roleLoading" |
|||
:highlight-current="true" |
|||
:check-on-click-node="true" |
|||
:expand-on-click-node="false" |
|||
@node-click="pickRoleTree" |
|||
> |
|||
<template #default="{ node }" > |
|||
<div class="treeRoleBox"> |
|||
<span>{{ node.label }}</span> |
|||
<div class="spanButBox"> |
|||
<el-text v-if="node.disabled" type="warning" size="small" @click.stop="editMyInfoIcon(node.data,1)">禁用</el-text> |
|||
<el-text v-else type="success" size="small" @click.stop="editMyInfoIcon(node.data,2)">启用</el-text> |
|||
<el-text type="primary" size="small" @click.stop="editMyInfoIcon(node.data,3)">编辑</el-text> |
|||
<el-text type="danger" size="small" @click.stop="editMyInfoIcon(node.data,4)">删除</el-text> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
</el-tree-v2> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
<div class="roleright"> |
|||
<el-tabs v-model="appSysPick" class="demo-tabs"> |
|||
<el-tab-pane label="平台" name="system"> |
|||
<template #label> |
|||
<el-text class="tabsTitleCont">平台</el-text> |
|||
</template> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="应用" name="app"> |
|||
<template #label> |
|||
<el-text class="tabsTitleCont">应用</el-text> |
|||
</template> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
<AddRoleGroup v-if="openRoleGroup" v-model:show="openRoleGroup" :group-info="roleGroupOrInfo" @resthandel="getRoleTree" /> |
|||
<EditRoleGroup v-if="openEditRoleGroup" v-model:show="openEditRoleGroup" :group-info="roleGroupOrInfo" :data="editRoleCont" @resthandel="getRoleTree" /> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.roleBox{ |
|||
display: flex; |
|||
width: 100%; |
|||
height: calc(100vh - 170px); |
|||
padding: 15px 20px 0 20px; |
|||
justify-content: space-between; |
|||
.roleLeft{ |
|||
width: 350px; |
|||
height: calc(100vh - 185px); |
|||
background-color: #FFFFFF; |
|||
.butBox{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
padding: 0 10px 10px 10px; |
|||
} |
|||
.searchBox{ |
|||
padding: 0 10px 10px 10px; |
|||
} |
|||
.treeBox{ |
|||
height: calc(100vh - 330px); |
|||
|
|||
} |
|||
} |
|||
.roleright{ |
|||
width: calc(100% - 370px); |
|||
height: calc(100vh - 185px); |
|||
background-color: #FFFFFF; |
|||
} |
|||
.tabsTitle{ |
|||
padding: 0 15px; |
|||
} |
|||
.tabsTitleCont{ |
|||
padding: 0 35px; |
|||
} |
|||
.treeRoleBox{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
width: 100%; |
|||
align-items: center; |
|||
} |
|||
.spanButBox{ |
|||
span{ |
|||
padding: 0 5px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
</style> |
|||
@ -0,0 +1,148 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-23 13:00:55 |
|||
@ 备注: 添加角色组 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import type { RoleFormInfo,RoleListTree } from '@/api/role/types' |
|||
import { giveRoleGroupTree,editRoleCont } from '@/api/role/index' |
|||
import type { FormInstance, FormRules } from 'element-plus' |
|||
const props = defineProps({ |
|||
show:{ |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
groupInfo:{ |
|||
type: Number, |
|||
default: 1, |
|||
} |
|||
}) |
|||
const emits = defineEmits(["update:show","resthandel"]); |
|||
const isShow = computed({ |
|||
get() { |
|||
return props.show; |
|||
}, |
|||
set(val: boolean) { |
|||
emits("update:show", val); |
|||
}, |
|||
}); |
|||
const butLoading = ref(false) |
|||
const treeSelectData = ref<RoleListTree[]>([]) |
|||
const formData = reactive<RoleFormInfo>({ |
|||
id:"0", |
|||
name:"", |
|||
type:"2", |
|||
superior:"0", |
|||
sort:50 |
|||
}) |
|||
const ruleRoleFormRef = ref() |
|||
//表单验证规则 |
|||
const rules = reactive<FormRules<RoleFormInfo>>({ |
|||
name:[{ required: true, message: '请输入角色组名称', trigger: 'blur' },], |
|||
superior:[{ required: true, message: '请选择角色组归属', trigger: 'blur' },] |
|||
}) |
|||
//关闭弹窗 |
|||
const handleClose = () => { |
|||
emits("update:show", false); |
|||
emits("resthandel"); |
|||
treeSelectData.value=[]; |
|||
butLoading.value = false; |
|||
} |
|||
//保存数据 |
|||
const saveData = () =>{ |
|||
butLoading.value = true |
|||
ruleRoleFormRef.value.validate((isValid: boolean)=>{ |
|||
if(isValid){ |
|||
formData.type=formData.type.toString() |
|||
editRoleCont(formData).then((data:any)=>{ |
|||
if(data.code==0){ |
|||
ElMessage({ |
|||
message: data.msg, |
|||
type: 'success', |
|||
}) |
|||
handleClose() |
|||
}else{ |
|||
ElMessage({ |
|||
message: data.msg, |
|||
type: 'success', |
|||
}) |
|||
} |
|||
console.log("保存数据",data) |
|||
}).finally(()=>{ butLoading.value = false}) |
|||
// |
|||
}else{ |
|||
butLoading.value = false |
|||
} |
|||
}) |
|||
} |
|||
onMounted(()=>{ |
|||
if(props.groupInfo == 1){ |
|||
treeSelectData.value.push({ |
|||
id:"0", |
|||
label:"顶级分组", |
|||
types:2, |
|||
status:true, |
|||
superior:0, |
|||
sort:50, |
|||
children:[] |
|||
}) |
|||
} |
|||
|
|||
giveRoleGroupTree().then(({data})=>{ |
|||
treeSelectData.value.push(...data) |
|||
if(props.groupInfo != 1 && Array.isArray(data)){ |
|||
data.forEach((item:any,index:number)=>{ |
|||
if(index == 0){ |
|||
formData.superior = item.id |
|||
|
|||
} |
|||
|
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
</script> |
|||
<template> |
|||
<el-dialog |
|||
v-model="isShow" |
|||
title="编辑角色" |
|||
width="500" |
|||
destroy-on-close |
|||
draggable |
|||
:before-close="handleClose" |
|||
> |
|||
<el-form |
|||
ref="ruleRoleFormRef" |
|||
style="width: 100%" |
|||
:model="formData" |
|||
:rules="rules" |
|||
label-width="auto" |
|||
> |
|||
<el-form-item label="所属角色组" prop="superior"> |
|||
<el-tree-select |
|||
v-model="formData.superior" |
|||
:data="treeSelectData" |
|||
check-strictly |
|||
:render-after-expand="false" |
|||
style="width: 100%" |
|||
node-key="id" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="角色组名称" prop="name"> |
|||
<el-input v-model="formData.name" /> |
|||
</el-form-item> |
|||
<el-form-item label="排序" prop="sort"> |
|||
<el-input-number v-model="formData.sort" :min="1" :max="1000000000000" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template #footer> |
|||
<div class="dialog-footer"> |
|||
<el-button v-loading="butLoading" @click="handleClose">取消</el-button> |
|||
<el-button v-loading="butLoading" type="primary" @click="saveData()">提交</el-button> |
|||
</div> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,160 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-23 13:00:55 |
|||
@ 备注: 添加角色组 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import type { RoleFormInfo,RoleListTree } from '@/api/role/types' |
|||
import { giveRoleGroupTree,editRoleCont } from '@/api/role/index' |
|||
import type { FormInstance, FormRules } from 'element-plus' |
|||
const props = defineProps({ |
|||
show:{ |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
data:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
}, |
|||
groupInfo:{ |
|||
type: Number, |
|||
default: 1, |
|||
} |
|||
}) |
|||
const emits = defineEmits(["update:show","resthandel"]); |
|||
const isShow = computed({ |
|||
get() { |
|||
return props.show; |
|||
}, |
|||
set(val: boolean) { |
|||
emits("update:show", val); |
|||
}, |
|||
}); |
|||
const butLoading = ref(false) |
|||
const treeSelectData = ref<RoleListTree[]>([]) |
|||
const formData = reactive<RoleFormInfo>({ |
|||
id:"0", |
|||
name:"", |
|||
type:"2", |
|||
superior:"0", |
|||
sort:50 |
|||
}) |
|||
|
|||
const ruleRoleFormRef = ref() |
|||
//表单验证规则 |
|||
const rules = reactive<FormRules<RoleFormInfo>>({ |
|||
name:[{ required: true, message: '请输入角色组名称', trigger: 'blur' },], |
|||
superior:[{ required: true, message: '请选择角色组归属', trigger: 'blur' },] |
|||
}) |
|||
//关闭弹窗 |
|||
const handleClose = () => { |
|||
emits("update:show", false); |
|||
emits("resthandel"); |
|||
treeSelectData.value=[]; |
|||
butLoading.value = false; |
|||
} |
|||
//保存数据 |
|||
const saveData = () =>{ |
|||
butLoading.value = true |
|||
ruleRoleFormRef.value.validate((isValid: boolean)=>{ |
|||
if(isValid){ |
|||
editRoleCont(formData).then((data:any)=>{ |
|||
if(data.code==0){ |
|||
ElMessage({ |
|||
message: data.msg, |
|||
type: 'success', |
|||
}) |
|||
handleClose() |
|||
}else{ |
|||
ElMessage({ |
|||
message: data.msg, |
|||
type: 'success', |
|||
}) |
|||
} |
|||
console.log("保存数据",data) |
|||
}).finally(()=>{ butLoading.value = false}) |
|||
// |
|||
}else{ |
|||
butLoading.value = false |
|||
} |
|||
}) |
|||
} |
|||
onMounted(()=>{ |
|||
if(props.data.type == 2){ |
|||
treeSelectData.value.push({ |
|||
id:"0", |
|||
label:"顶级分组", |
|||
types:2, |
|||
status:true, |
|||
superior:0, |
|||
sort:50, |
|||
children:[] |
|||
}) |
|||
} |
|||
giveRoleGroupTree().then(({data})=>{ |
|||
treeSelectData.value.push(...data) |
|||
if(props.data.type != 2 && Array.isArray(data)){ |
|||
data.forEach((item:any,index:number)=>{ |
|||
if(index == 0){ |
|||
formData.superior = item.id |
|||
|
|||
} |
|||
|
|||
}) |
|||
} |
|||
}) |
|||
nextTick(()=>{ |
|||
formData.id = props.data.id |
|||
formData.name = props.data.name |
|||
formData.type = props.data.type |
|||
formData.superior = props.data.superior |
|||
formData.sort = props.data.sort |
|||
}) |
|||
}) |
|||
</script> |
|||
<template> |
|||
<el-dialog |
|||
v-model="isShow" |
|||
title="编辑角色" |
|||
width="500" |
|||
destroy-on-close |
|||
draggable |
|||
:before-close="handleClose" |
|||
> |
|||
<el-form |
|||
ref="ruleRoleFormRef" |
|||
style="width: 100%" |
|||
:model="formData" |
|||
:rules="rules" |
|||
label-width="auto" |
|||
> |
|||
<el-form-item label="所属角色组" prop="superior"> |
|||
<el-tree-select |
|||
v-model="formData.superior" |
|||
:data="treeSelectData" |
|||
check-strictly |
|||
:render-after-expand="false" |
|||
style="width: 100%" |
|||
node-key="id" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="角色组名称" prop="name"> |
|||
<el-input v-model="formData.name" /> |
|||
</el-form-item> |
|||
<el-form-item label="排序" prop="sort"> |
|||
<el-input-number v-model="formData.sort" :min="1" :max="1000000000000" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template #footer> |
|||
<div class="dialog-footer"> |
|||
<el-button v-loading="butLoading" @click="handleClose">取消</el-button> |
|||
<el-button v-loading="butLoading" type="primary" @click="saveData()">提交</el-button> |
|||
</div> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,14 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
|
|||
</script> |
|||
<template> |
|||
<div>缓存监控</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,14 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-10-21 10:06:51 |
|||
@ 备注: 在线人数 |
|||
--> |
|||
<script lang='ts' setup> |
|||
|
|||
</script> |
|||
<template> |
|||
<div>定时任务</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
|
|||
</style> |
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue