Merge pull request 'master' (#47) from master into uesr
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/47
This commit is contained in:
1306
package-lock.json
generated
1306
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -38,6 +38,7 @@
|
|||||||
"@codemirror/lang-sql": "^6.5.4",
|
"@codemirror/lang-sql": "^6.5.4",
|
||||||
"@vitejs/plugin-vue": "^4.2.1",
|
"@vitejs/plugin-vue": "^4.2.1",
|
||||||
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"unplugin-auto-import": "^0.15.3",
|
"unplugin-auto-import": "^0.15.3",
|
||||||
"unplugin-vue-components": "^0.24.1",
|
"unplugin-vue-components": "^0.24.1",
|
||||||
"vite": "^4.3.4",
|
"vite": "^4.3.4",
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ export const getRoleExcludeMenuId = (params) => {
|
|||||||
params
|
params
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 新增修改
|
||||||
|
export const operate = (data) => {
|
||||||
|
if(data.roleId) return editRole(data)
|
||||||
|
return addRole(data)
|
||||||
|
}
|
||||||
|
|
||||||
// 新增角色
|
// 新增角色
|
||||||
export const addRole = (data) => {
|
export const addRole = (data) => {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -224,16 +224,18 @@ html, body, #app, .el-container, .el-aside, .el-main {
|
|||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.branch-merge {
|
.branch-merge {
|
||||||
font-size: 12px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 38px;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
font-size: 12px;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin: -20px auto 0;
|
margin: -20px auto 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
box-shadow: 0 0 5px 0 #d8d8d8;
|
box-shadow: 0 0 5px 0 #d8d8d8;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -246,6 +248,10 @@ html, body, #app, .el-container, .el-aside, .el-main {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.el-icon{
|
||||||
|
width: 1.4em;
|
||||||
|
height: 1.4em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button {
|
.el-button {
|
||||||
@@ -263,7 +269,7 @@ html, body, #app, .el-container, .el-aside, .el-main {
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
width: 2px;
|
width: 2px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #CACACA;
|
background-color: #000000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,7 +445,10 @@ html, body, #app, .el-container, .el-aside, .el-main {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
.fen-icon{
|
||||||
|
width: 1.8em;
|
||||||
|
height: 1.7em;
|
||||||
|
}
|
||||||
.middle-icon {
|
.middle-icon {
|
||||||
width: 1.4em;
|
width: 1.4em;
|
||||||
height: 1.4em;
|
height: 1.4em;
|
||||||
|
|||||||
1
src/assets/svg/fenzhi.svg
Normal file
1
src/assets/svg/fenzhi.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711286414943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="24248" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M480.246 771.968a128 128 0 1 0 63.488 0 32.32 32.32 0 0 0 0.256-3.96800001c0-75.648 51.392-140.16 180.672-249.59999999 96.256-81.408 102.528-86.912 132.416-118.912C903.414 349.76 927.99 304.25599999 927.99 256c0-1.34399999-0.064-2.688-0.256-3.968a128 128 0 1 0-63.488 0 32.32 32.32 0 0 0-0.256 3.96800001c0 28.672-17.408 60.8-53.76 99.83999999-27.264 29.248-33.6 34.816-126.912 113.728-60.992 51.648-106.816 94.71999999-139.328 135.04L543.99 256.00000001c0-1.34399999-0.064-2.688-0.256-3.96800001a128 128 0 1 0-63.488 0 32.32 32.32 0 0 0-0.256 3.968L479.99 604.608c-32.512-40.32-78.336-83.392-139.328-135.03999999-93.312-78.912-99.648-84.48-126.912-113.72800001-36.352-39.04-53.76-71.168-53.76-99.84 0-1.34399999-0.064-2.688-0.256-3.968a128 128 0 1 0-63.488 0 32.32 32.32 0 0 0-0.25600001 3.968c0 48.256 24.576 93.76 70.91200001 143.488 29.888 32 36.16 37.504 132.416 118.976C428.598 627.84 479.98999999 692.352 479.99 768a32.32 32.32 0 0 0 0.256 3.968zM511.99 192a64 64 0 1 1 0-128 64 64 0 0 1 0 128z m384 0a64 64 0 1 1 0-128 64 64 0 0 1 0 128z m-768 0a64 64 0 1 1 0-128 64 64 0 0 1 0 128z m384 768a64 64 0 1 1 0-128 64 64 0 0 1 0 128z" p-id="24249" fill="#2E7CF0"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -19,7 +19,7 @@
|
|||||||
v-loading="localData.loading"
|
v-loading="localData.loading"
|
||||||
:row-key="tableConfig?.rowKey || 'id'"
|
:row-key="tableConfig?.rowKey || 'id'"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
table-layout="fixed"
|
table-layout="auto"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
@selection-change="selectionChange"
|
@selection-change="selectionChange"
|
||||||
|
|||||||
@@ -3,20 +3,24 @@
|
|||||||
<router-view v-slot="{ Component, route }">
|
<router-view v-slot="{ Component, route }">
|
||||||
<transition name="fade-transform" type="transition" appear mode="out-in">
|
<transition name="fade-transform" type="transition" appear mode="out-in">
|
||||||
<div>
|
<div>
|
||||||
<keep-alive>
|
<template v-if="!route.meta.noCache">
|
||||||
|
<keep-alive>
|
||||||
|
<suspense>
|
||||||
|
<component :is="Component" :key="route.fullPath" />
|
||||||
|
<template #fallback>
|
||||||
|
<div>Loading...</div>
|
||||||
|
</template>
|
||||||
|
</suspense>
|
||||||
|
</keep-alive>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<suspense>
|
<suspense>
|
||||||
<component v-if="!route.meta.noCache" :is="Component" :key="route.fullPath" />
|
<component :is="Component" :key="route.fullPath" />
|
||||||
<template #fallback>
|
<template #fallback>
|
||||||
<div>Loading...</div>
|
<div>Loading...</div>
|
||||||
</template>
|
</template>
|
||||||
</suspense>
|
</suspense>
|
||||||
</keep-alive>
|
</template>
|
||||||
<suspense>
|
|
||||||
<component v-if="route.meta.noCache" :is="Component" :key="route.fullPath" />
|
|
||||||
<template #fallback>
|
|
||||||
<div>Loading...</div>
|
|
||||||
</template>
|
|
||||||
</suspense>
|
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</router-view>
|
</router-view>
|
||||||
|
|||||||
@@ -73,56 +73,56 @@ const handleViewDetails = (noticeId) => {
|
|||||||
viewForm.value = res.data
|
viewForm.value = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const setWsUrl=(url)=>{
|
// const setWsUrl=(url)=>{
|
||||||
return (window.location.protocol === 'http:' ? "ws://" : "wss://")+window.location.host + import.meta.env.VITE_BASE_URL + url;
|
// return (window.location.protocol === 'http:' ? "ws://" : "wss://")+window.location.host + import.meta.env.VITE_BASE_URL + url;
|
||||||
}
|
// }
|
||||||
const initWebSocket = () => {
|
// const initWebSocket = () => {
|
||||||
try {
|
// try {
|
||||||
//怎么区分http https /url(全局url) 封装url 只填个url?
|
// //怎么区分http https /url(全局url) 封装url 只填个url?
|
||||||
const wsUrl=setWsUrl('/notice-ws/notice')
|
// const wsUrl=setWsUrl('/notice-ws/notice')
|
||||||
const socket = new WebSocket(wsUrl)
|
// const socket = new WebSocket(wsUrl)
|
||||||
// 2. ws.send()给服务器发送信息
|
// // 2. ws.send()给服务器发送信息
|
||||||
//连接发生错误的回调方法
|
// //连接发生错误的回调方法
|
||||||
socket.onerror = function () {
|
// socket.onerror = function () {
|
||||||
console.log("ws连接发生错误");
|
// console.log("ws连接发生错误");
|
||||||
};
|
// };
|
||||||
//连接成功建立的回调方法
|
// //连接成功建立的回调方法
|
||||||
socket.onopen = function () {
|
// socket.onopen = function () {
|
||||||
let authInfo = {
|
// let authInfo = {
|
||||||
token: getToken(),
|
// token: getToken(),
|
||||||
type: "auth",
|
// type: "auth",
|
||||||
cluster: "notice"
|
// cluster: "notice"
|
||||||
}
|
// }
|
||||||
socket.send(JSON.stringify(authInfo))
|
// socket.send(JSON.stringify(authInfo))
|
||||||
console.log("ws连接成功");
|
// console.log("ws连接成功");
|
||||||
}
|
// }
|
||||||
//接收到消息的回调方法
|
// //接收到消息的回调方法
|
||||||
socket.onmessage = function (event) {
|
// socket.onmessage = function (event) {
|
||||||
let data = JSON.parse(event.data)
|
// let data = JSON.parse(event.data)
|
||||||
console.log('测试铃铛',data)
|
// console.log('测试铃铛',data)
|
||||||
if (data.type === 'notice') {
|
// if (data.type === 'notice') {
|
||||||
noticeList.value.push(data.notice)
|
// noticeList.value.push(data.notice)
|
||||||
total.value += 1
|
// total.value += 1
|
||||||
} else if(!data.type&&data.cluster==="notice"){
|
// } else if(!data.type&&data.cluster==="notice"){
|
||||||
noticeList.value.push(data)
|
// noticeList.value.push(data)
|
||||||
total.value += 1
|
// total.value += 1
|
||||||
}
|
// }
|
||||||
// console.log("服务器返回的信息: ", JSON.parse(event.data));
|
// // console.log("服务器返回的信息: ", JSON.parse(event.data));
|
||||||
}
|
// }
|
||||||
//连接关闭的回调方法
|
// //连接关闭的回调方法
|
||||||
socket.onclose = function () {
|
// socket.onclose = function () {
|
||||||
// initWebSocket()
|
// // initWebSocket()
|
||||||
console.log("ws连接关闭");
|
// console.log("ws连接关闭");
|
||||||
}
|
// }
|
||||||
setInterval(() => {
|
// setInterval(() => {
|
||||||
socket.send(JSON.stringify(send))
|
// socket.send(JSON.stringify(send))
|
||||||
}, 30000)
|
// }, 30000)
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
console.log(e)
|
// console.log(e)
|
||||||
console.log("ws连接失败");
|
// console.log("ws连接失败");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
initWebSocket()
|
// initWebSocket()
|
||||||
|
|
||||||
const searchNotifyList = () => {
|
const searchNotifyList = () => {
|
||||||
let params = {
|
let params = {
|
||||||
|
|||||||
@@ -70,6 +70,15 @@ const router = createRouter({
|
|||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/workflow/process',
|
||||||
|
name: 'process',
|
||||||
|
component: () => import('@/views/workflow/process/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '流程管理',
|
||||||
|
breadcrumb: true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/workflow/process/edit',
|
path: '/workflow/process/edit',
|
||||||
name: 'processAdd',
|
name: 'processAdd',
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ export const useProcessStore = defineStore('process', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const addProcess = (val) => {
|
const addProcess = (val) => {
|
||||||
console.log("添加节点成功")
|
|
||||||
processData.value.process.push(val)
|
processData.value.process.push(val)
|
||||||
}
|
}
|
||||||
const delProcess = (delNode) => {
|
const delProcess = (delNode) => {
|
||||||
@@ -109,4 +108,4 @@ export const useProcessStore = defineStore('process', () => {
|
|||||||
getAssignedUser,
|
getAssignedUser,
|
||||||
addAssignedUser
|
addAssignedUser
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ const getList = async () => {
|
|||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
}else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ const getList = async () => {
|
|||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
}else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -247,6 +247,8 @@ const getList = async () => {
|
|||||||
list.value = res.data.rows;
|
list.value = res.data.rows;
|
||||||
total.value = res.data.total;
|
total.value = res.data.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
}else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -318,3 +320,8 @@ const handleCurrentChange = (val) => {
|
|||||||
};
|
};
|
||||||
getList();
|
getList();
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
:deep(.el-breadcrumb__item){
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -271,6 +271,8 @@ const getList = async () => {
|
|||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
}else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleSearch()" :icon="Search">搜索</el-button>
|
<el-button type="primary" @click="getList" :icon="Search">搜索</el-button>
|
||||||
<el-button @click="handleReset" :icon="Refresh">重置</el-button>
|
<el-button @click="handleReset" :icon="Refresh">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -160,10 +160,7 @@ const formRules = ref({
|
|||||||
{required: true, message: "系统内置不能为空", trigger: "change"},
|
{required: true, message: "系统内置不能为空", trigger: "change"},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
//搜索功能
|
|
||||||
const handleSearch = () => {
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
//重置搜索
|
//重置搜索
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
queryForm.value.resetFields()
|
queryForm.value.resetFields()
|
||||||
|
|||||||
@@ -182,8 +182,12 @@ const getEditOption = (deptId) => {
|
|||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getDeptList(queryParams).then(res => {
|
getDeptList(queryParams).then(res => {
|
||||||
list.value = res.data
|
if (res.code === 1000) {
|
||||||
loading.value = false
|
list.value = res.data
|
||||||
|
loading.value = false
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const getDetail = (deptId) => {
|
const getDetail = (deptId) => {
|
||||||
|
|||||||
@@ -44,8 +44,10 @@
|
|||||||
<el-table-column prop="createTime" label="创建时间"/>
|
<el-table-column prop="createTime" label="创建时间"/>
|
||||||
<el-table-column label="操作" prop="operation">
|
<el-table-column label="操作" prop="operation">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="primary" v-if="scope.row.menuType!=='B'" size="mini" @click="handleAdd(scope.row)" link>新增</el-button>
|
<el-button type="primary" v-if="scope.row.menuType!=='B'" size="mini" @click="handleAdd(scope.row)" link>新增
|
||||||
<div v-else style="display: inline-block"> </div>
|
</el-button>
|
||||||
|
<div v-else style="display: inline-block">
|
||||||
|
</div>
|
||||||
<el-button type="primary" size="mini" @click="handleEdit(scope.row.menuId)" link>修改</el-button>
|
<el-button type="primary" size="mini" @click="handleEdit(scope.row.menuId)" link>修改</el-button>
|
||||||
<el-button type="primary" size="mini" @click="handleAssignRoles(scope.row)" link>分配角色</el-button>
|
<el-button type="primary" size="mini" @click="handleAssignRoles(scope.row)" link>分配角色</el-button>
|
||||||
<popover-delete :name="scope.row.menuName" :type="'菜单'" @delete="handleDel(scope.row.menuId)"/>
|
<popover-delete :name="scope.row.menuName" :type="'菜单'" @delete="handleDel(scope.row.menuId)"/>
|
||||||
@@ -230,8 +232,12 @@ const getSelectIcon = (val) => {
|
|||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getMenuList(queryParams).then(res => {
|
getMenuList(queryParams).then(res => {
|
||||||
list.value = res.data
|
if (res.code === 1000) {
|
||||||
loading.value = false
|
list.value = res.data
|
||||||
|
loading.value = false
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ const getList = async () => {
|
|||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg);
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
});
|
}).catch(err => {
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
};
|
};
|
||||||
//查看详情
|
//查看详情
|
||||||
const handleViewDetails = (noticeId) => {
|
const handleViewDetails = (noticeId) => {
|
||||||
|
|||||||
@@ -332,7 +332,9 @@ const getList = async () => {
|
|||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg);
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
});
|
}).catch(err => {
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
};
|
};
|
||||||
//查看公告详情
|
//查看公告详情
|
||||||
const handleViewDetails = async (row) => {
|
const handleViewDetails = async (row) => {
|
||||||
|
|||||||
@@ -141,12 +141,16 @@ const getList = async () => {
|
|||||||
...queryParams,
|
...queryParams,
|
||||||
...pageInfo
|
...pageInfo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
res.data.rows = res.data.rows.sort((a, b) => {
|
if (res.code === 1000) {
|
||||||
return a.postSort - b.postSort
|
res.data.rows = res.data.rows.sort((a, b) => {
|
||||||
})
|
return a.postSort - b.postSort
|
||||||
total.value = res.data.total;
|
})
|
||||||
list.value = res.data.rows
|
total.value = res.data.total;
|
||||||
loading.value = false
|
list.value = res.data.rows
|
||||||
|
loading.value = false
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleReset = (instance) => {
|
const handleReset = (instance) => {
|
||||||
|
|||||||
230
src/views/system/role/add.vue
Normal file
230
src/views/system/role/add.vue
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
<template>
|
||||||
|
<div v-loading="loading">
|
||||||
|
<baseTitle title="角色信息录入"></baseTitle>
|
||||||
|
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
|
||||||
|
<baseTitle title="分配菜单"></baseTitle>
|
||||||
|
<fvCheckbox :options="localData.checkOptions" v-model="localData.checkList" @change="checkBoxChange" />
|
||||||
|
<el-input v-model="localData.filterText" placeholder="请输入关键词" style="width: 400px;" />
|
||||||
|
<div class="menu-assign">
|
||||||
|
<el-tree
|
||||||
|
ref="menuTree"
|
||||||
|
:data="localData.menuData"
|
||||||
|
:filter-node-method="filterMenu"
|
||||||
|
:props="localData.menuTreeProps"
|
||||||
|
:check-strictly="localData.checkStrictly"
|
||||||
|
show-checkbox
|
||||||
|
node-key="menuId"
|
||||||
|
@check-change="checkChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="oper-page-btn">
|
||||||
|
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||||
|
<el-button type="primary" @click="handleBack">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="jsx">
|
||||||
|
import { useTagsView } from '@/stores/tagsview.js'
|
||||||
|
import { useAuthStore } from '@/stores/userstore.js'
|
||||||
|
import fvRadio from '@/fvcomponents/fvRadio/index.vue'
|
||||||
|
import { ElLoading, ElNotification } from 'element-plus';
|
||||||
|
import { getMenuList } from '@/api/system/menuman.js'
|
||||||
|
import { getRoleDetail, operate} from "@/api/role/role";
|
||||||
|
|
||||||
|
const tagsViewStore = useTagsView()
|
||||||
|
const authStore = useAuthStore()
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const form = ref(null)
|
||||||
|
const menuTree = ref(null)
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
const isExpand = ref('展开')
|
||||||
|
const isAllChose = ref('全选')
|
||||||
|
const localData = reactive({
|
||||||
|
filterText: '',
|
||||||
|
menuData: [],
|
||||||
|
menuTreeProps: {
|
||||||
|
value: "menuId",
|
||||||
|
label: 'menuName',
|
||||||
|
children: 'children'
|
||||||
|
},
|
||||||
|
checkStrictly: false,
|
||||||
|
checkList: ['3'],
|
||||||
|
checkOptions: [
|
||||||
|
{
|
||||||
|
label: isExpand.value,
|
||||||
|
value: '1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: isAllChose.value,
|
||||||
|
value: '2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '父子联动',
|
||||||
|
value: '3'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
const schame = computed(()=>{
|
||||||
|
let arr = [
|
||||||
|
{
|
||||||
|
label: '角色名称',
|
||||||
|
prop: 'roleName',
|
||||||
|
component: 'el-input',
|
||||||
|
props: {
|
||||||
|
placeholder: '请输入'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '角色权限',
|
||||||
|
prop: 'roleKey',
|
||||||
|
component: 'el-input',
|
||||||
|
props: {
|
||||||
|
placeholder: '请输入'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '显示顺序',
|
||||||
|
prop: 'roleSort',
|
||||||
|
component: 'el-input',
|
||||||
|
props: {
|
||||||
|
placeholder: '请输入',
|
||||||
|
type: 'number'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '状态',
|
||||||
|
prop: 'state',
|
||||||
|
component: markRaw(fvRadio),
|
||||||
|
props: {
|
||||||
|
cacheKey: 'normal_disable'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '是否为模版',
|
||||||
|
prop: 'template',
|
||||||
|
component: markRaw(fvRadio),
|
||||||
|
props: {
|
||||||
|
options: [
|
||||||
|
{ label: '是', value: true },
|
||||||
|
{ label: '否', value: false },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
|
return !authStore.roles.includes('superAdmin') ? arr.slice(-1) : arr
|
||||||
|
})
|
||||||
|
|
||||||
|
const rules = reactive({
|
||||||
|
roleName: [{required: true, message: '请输入', trigger: 'change'}],
|
||||||
|
roleKey: [{required: true, message: '请输入', trigger: 'change'}],
|
||||||
|
roleSort: [{required: true, message: '请输入', trigger: 'change'}],
|
||||||
|
})
|
||||||
|
|
||||||
|
const getInstance = (e) => {
|
||||||
|
form.value = e
|
||||||
|
}
|
||||||
|
|
||||||
|
const init = async () => {
|
||||||
|
form.value.setValues({state: '1', template: false})
|
||||||
|
const { data } = await getMenuList()
|
||||||
|
localData.menuData = data
|
||||||
|
}
|
||||||
|
|
||||||
|
const getInfo = async () => {
|
||||||
|
if(!route.query.id) return
|
||||||
|
const { data } = await getRoleDetail(route.query.id)
|
||||||
|
data.menuIds.forEach(key=>{
|
||||||
|
menuTree.value.setChecked(key, true, false)
|
||||||
|
})
|
||||||
|
if(route.query.isAdd) {
|
||||||
|
delete data.roleId
|
||||||
|
delete data.roleName
|
||||||
|
delete data.roleKey
|
||||||
|
}
|
||||||
|
form.value.setValues(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterMenu = (value, data) => {
|
||||||
|
if(!value) return true
|
||||||
|
return data.menuName.includes(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const checkChange = (data) => {
|
||||||
|
// 获取已选
|
||||||
|
const checkedKeys = menuTree.value.getCheckedKeys()
|
||||||
|
// 获取半选
|
||||||
|
const halfCheckedKeys = menuTree.value.getHalfCheckedKeys()
|
||||||
|
return [...checkedKeys, ...halfCheckedKeys]
|
||||||
|
}
|
||||||
|
|
||||||
|
const checkBoxChange = (val) => {
|
||||||
|
localData.checkStrictly = val.includes('3')
|
||||||
|
let nodes = menuTree.value.store.nodesMap
|
||||||
|
if (val.includes('1')) {
|
||||||
|
for (const node in nodes) {
|
||||||
|
nodes[node].expanded = true;
|
||||||
|
}
|
||||||
|
isExpand.value = '折叠'
|
||||||
|
} else {
|
||||||
|
for (const node in nodes) {
|
||||||
|
nodes[node].expanded = false;
|
||||||
|
}
|
||||||
|
isExpand.value = '展开'
|
||||||
|
}
|
||||||
|
if (val.includes('2')) {
|
||||||
|
menuTree.value.setCheckedNodes(localData.menuData)
|
||||||
|
isAllChose.value = '不全选'
|
||||||
|
} else {
|
||||||
|
menuTree.value.setCheckedNodes([])
|
||||||
|
isAllChose.value = '全选'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
const loading = ElLoading.service({fullscreen: true})
|
||||||
|
const { isValidate } = await form.value.validate()
|
||||||
|
if(!isValidate) return Promise.reject()
|
||||||
|
const values = form.value.getValues()
|
||||||
|
values.menuIds = checkChange()
|
||||||
|
operate(values).then(res=>{
|
||||||
|
ElNotification({
|
||||||
|
title: route.query.isAdd ? '新增' : '编辑',
|
||||||
|
message: res.msg,
|
||||||
|
type: res.code === 1000 ? 'success' : 'error'
|
||||||
|
})
|
||||||
|
loading.close()
|
||||||
|
res.code === 1000 ? tagsViewStore.delViewAndGoView('/system/role') : null
|
||||||
|
}).finally(()=>{
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleBack = () => {
|
||||||
|
history.back()
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(localData, (val)=>{
|
||||||
|
menuTree.value.filter(val.filterText)
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted( async ()=>{
|
||||||
|
loading.value = true
|
||||||
|
await init()
|
||||||
|
if(route.query.id) {
|
||||||
|
await getInfo()
|
||||||
|
}
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.menu-assign {
|
||||||
|
width: 400px;
|
||||||
|
max-height: 500px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,222 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
||||||
<!-- 角色管理 -->
|
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
||||||
<el-form :model="queryParams" class="query-form" inline ref="roleForm">
|
|
||||||
<el-form-item label="角色名称" prop="roleName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.roleName"
|
|
||||||
placeholder="请输入角色名称"
|
|
||||||
clearable
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="权限字符" prop="roleKey">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.roleKey"
|
|
||||||
placeholder="请输入权限字符"
|
|
||||||
clearable
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="状态" prop="state">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.state"
|
|
||||||
placeholder="请选择角色状态"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in cacheStore.getDict('normal_disable')"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="登录时间" prop="dateValue">
|
|
||||||
<el-config-provider>
|
|
||||||
<el-date-picker
|
|
||||||
v-model="dateValue"
|
|
||||||
type="datetimerange"
|
|
||||||
:shortcuts="shortcuts"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
/>
|
|
||||||
</el-config-provider>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="getList" :icon="Search">搜索</el-button>
|
|
||||||
<el-button @click="handleReset" :icon="Refresh">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div class="table-header-btn">
|
|
||||||
<el-button type="primary" @click="handleAdd" :icon="Plus">新增</el-button>
|
|
||||||
</div>
|
|
||||||
<div class="table">
|
|
||||||
<el-table
|
|
||||||
:data="list"
|
|
||||||
ref="table"
|
|
||||||
row-key="roleId"
|
|
||||||
:lazy="true"
|
|
||||||
v-loading="loading"
|
|
||||||
v-tabh
|
|
||||||
>
|
|
||||||
<el-table-column label="序号" type="index" align="center" width="60"/>
|
|
||||||
<!-- <el-table-column prop="roleId" label="角色编号" align="center"/>-->
|
|
||||||
<el-table-column prop="roleName" label="角色名称" align="center"/>
|
|
||||||
<el-table-column prop="roleKey" label="角色权限" align="center"/>
|
|
||||||
<el-table-column prop="dataScope" label="数据范围" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-text v-if="scope.row.dataScope == '1'">所有数据权限</el-text>
|
|
||||||
<el-text v-if="scope.row.dataScope == '2'">自定义数据权限</el-text>
|
|
||||||
<el-text v-if="scope.row.dataScope == '3'">本部门数据权限</el-text>
|
|
||||||
<el-text v-if="scope.row.dataScope == '4'">本部门及以下数据权限</el-text>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="roleSort" label="显示顺序" align="center" width="100px"/>
|
|
||||||
<el-table-column prop="state" label="状态" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<tag dict-type="normal_disable" :value="scope.row.state"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="createTime" label="创建时间" align="center"/>
|
|
||||||
<el-table-column label="操作" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button type="primary" size="mini" @click="handleEdit(scope.row.roleId)" link>修改
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" size="mini" @click="handleAssignedUser(scope.row)" link>分配用户
|
|
||||||
</el-button>
|
|
||||||
<popover-delete :name="scope.row.roleName" :type="'角色'"
|
|
||||||
@delete="handleDel(scope.row.roleId)"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<paging :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[10, 20, 30, 40,50]"
|
|
||||||
:total="total" @changeSize="handleSizeChange" @goPage="handleCurrentChange"/>
|
|
||||||
|
|
||||||
<el-dialog v-model="isVisited" :title="title" width="700px">
|
|
||||||
<el-form :model="form" ref="formInstance" label-width="100px" :rules="rules">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="角色名称" prop="roleName">
|
|
||||||
<el-input v-model="form.roleName" placeholder="请输入角色名称"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="角色权限" prop="roleKey">
|
|
||||||
<el-input v-model="form.roleKey" placeholder="请输入角色权限"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="显示顺序" prop="roleSort">
|
|
||||||
<el-input-number v-model="form.roleSort"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="数据范围" prop="dataScope">
|
|
||||||
<el-radio-group v-model="form.dataScope" size="mini">
|
|
||||||
<el-radio
|
|
||||||
v-for="role in [{value:'1',label:'所有数据权限'},{value:'2',label:'自定义数据权限'},{value:'3',label:'本部门数据权限'},{value:'4',label:'本部门及以下数据权限'}]"
|
|
||||||
:key="role.value" :label="role.value">
|
|
||||||
{{ role.label }}
|
|
||||||
</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="状态" prop="state">
|
|
||||||
<el-radio-group v-model="form.state" size="mini">
|
|
||||||
<el-radio v-for="role in cacheStore.getDict('normal_disable')" :key="role.value"
|
|
||||||
:label="role.value">
|
|
||||||
{{ role.label }}
|
|
||||||
</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="菜单权限" prop="menuIds">
|
|
||||||
<div style="display: flex;flex-direction: column">
|
|
||||||
<el-checkbox-group v-model="checkList" @change="changeCheckbox">
|
|
||||||
<el-checkbox label="1">{{ isExpand }}</el-checkbox>
|
|
||||||
<el-checkbox label="2">{{ isAllChose }}</el-checkbox>
|
|
||||||
<el-checkbox label="3">父子联动</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
<div class="dialog-tree ">
|
|
||||||
<el-tree
|
|
||||||
:data="treeData"
|
|
||||||
:props="treeProps"
|
|
||||||
node-key="menuId"
|
|
||||||
ref="tree"
|
|
||||||
:check-strictly="checkStrictly"
|
|
||||||
show-checkbox
|
|
||||||
@check-change="handleCheckChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span>
|
|
||||||
<el-button @click="handleCancel">取消</el-button>
|
|
||||||
<el-button type="primary" @click="handleSubmit(formInstance)">确定</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup lang="jsx">
|
||||||
import {Plus} from "@element-plus/icons-vue";
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||||
import {useRouter} from 'vue-router'
|
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
|
||||||
import {useCacheStore} from "@/stores/cache.js";
|
|
||||||
import {getMenuList} from '@/api/system/menuman.js'
|
|
||||||
import {getRoleList, getRoleDetail, deleteRole, addRole, editRole} from "@/api/role/role";
|
|
||||||
import {Search, Refresh, EditPen, Delete, User} from '@element-plus/icons-vue'
|
|
||||||
import Tag from '@/components/Tag.vue'
|
import Tag from '@/components/Tag.vue'
|
||||||
import Paging from "@/components/pagination/index.vue";
|
import { ElMessageBox, ElNotification } from 'element-plus';
|
||||||
|
import { deleteRole } from "@/api/role/role";
|
||||||
|
import { useAuthStore } from '@/stores/userstore.js'
|
||||||
|
|
||||||
|
const authStore = useAuthStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const pageInfo = reactive({
|
|
||||||
pageSize: 10,
|
|
||||||
pageNum: 1
|
|
||||||
})
|
|
||||||
const cacheStore = useCacheStore();
|
|
||||||
const queryParams = reactive({
|
|
||||||
roleName: "",
|
|
||||||
roleKey: "",
|
|
||||||
state: "",
|
|
||||||
startTime: '',
|
|
||||||
endTime: ''
|
|
||||||
});
|
|
||||||
const treeData = ref([])
|
|
||||||
const tree = ref()
|
|
||||||
const isExpand = ref('展开')
|
|
||||||
const isAllChose = ref('全选')
|
|
||||||
const table = ref()
|
|
||||||
const menuIds = ref([])
|
|
||||||
const checkStrictly = ref(false)
|
|
||||||
const rules = reactive({
|
|
||||||
roleName: [
|
|
||||||
{required: true, message: '请输入角色名称', trigger: 'blur'},
|
|
||||||
],
|
|
||||||
roleKey: [
|
|
||||||
{required: true, message: '请输入角色权限', trigger: 'blur'},
|
|
||||||
],
|
|
||||||
roleSort: [
|
|
||||||
{required: true, message: '请选择显示顺序', trigger: 'blur'},
|
|
||||||
]
|
|
||||||
})
|
|
||||||
const checkList = ref(['3'])
|
|
||||||
const treeProps = {
|
|
||||||
value: "menuId",
|
|
||||||
label: 'menuName',
|
|
||||||
children: 'children'
|
|
||||||
}
|
|
||||||
const dateValue = ref()
|
|
||||||
const total = ref()
|
|
||||||
const shortcuts = [
|
const shortcuts = [
|
||||||
{
|
{
|
||||||
text: '上周',
|
text: '上周',
|
||||||
@@ -246,239 +42,233 @@ const shortcuts = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const loading = ref(true);
|
|
||||||
const roleForm = ref();
|
const searchConfig = reactive([
|
||||||
const list = ref([]);
|
{
|
||||||
const isVisited = ref(false);
|
label: '角色名称',
|
||||||
const title = ref();
|
prop: 'roleName',
|
||||||
const form = ref();
|
component: 'el-input',
|
||||||
const formInstance = ref();
|
props: {
|
||||||
//重置from表单
|
placeholder: '请输入',
|
||||||
const restForm = () => {
|
clearable: true
|
||||||
form.value = {
|
|
||||||
roleId: '',
|
|
||||||
roleName: null,
|
|
||||||
roleSort: 0,
|
|
||||||
state: '1',
|
|
||||||
roleKey: null,
|
|
||||||
dataScope: '1',
|
|
||||||
menuIds: []
|
|
||||||
};
|
|
||||||
};
|
|
||||||
const getList = async () => {
|
|
||||||
let params = {
|
|
||||||
...queryParams,
|
|
||||||
...pageInfo
|
|
||||||
}
|
|
||||||
let date = dateValue.value
|
|
||||||
if (date !== undefined && date !== null) {
|
|
||||||
params.startTime = date[0]
|
|
||||||
params.endTime = date[1]
|
|
||||||
}
|
|
||||||
loading.value = true
|
|
||||||
getRoleList(params).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
res.data.rows = res.data.rows.sort((a, b) => {
|
|
||||||
return a.roleSort - b.roleSort
|
|
||||||
})
|
|
||||||
list.value = res.data.rows
|
|
||||||
total.value = res.data.total
|
|
||||||
loading.value = false
|
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
};
|
{
|
||||||
|
label: '权限字符',
|
||||||
|
prop: 'roleKey',
|
||||||
|
component: 'el-input',
|
||||||
|
props: {
|
||||||
|
placeholder: '请输入',
|
||||||
|
clearable: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '状态',
|
||||||
|
prop: 'state',
|
||||||
|
component: shallowRef(fvSelect),
|
||||||
|
props: {
|
||||||
|
placeholder: '请选择',
|
||||||
|
clearable: true,
|
||||||
|
cacheKey: 'normal_disable'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '登录时间',
|
||||||
|
prop: 'dateValue',
|
||||||
|
component: 'el-date-picker',
|
||||||
|
props: {
|
||||||
|
placeholder: '请选择',
|
||||||
|
clearable: true,
|
||||||
|
type: 'datetimerange',
|
||||||
|
startPlaceholder: '开始日期',
|
||||||
|
endPlaceholder: '结束日期',
|
||||||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
shortcuts: shortcuts
|
||||||
|
}
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
const tableIns = ref()
|
||||||
|
|
||||||
//重置功能
|
const auths = {
|
||||||
const handleReset = () => {
|
edit: ['admin:role:edit'],
|
||||||
dateValue.value = []
|
del: ['admin:role:del'],
|
||||||
roleForm.value.resetFields()
|
add: ['admin:role:add'],
|
||||||
getList()
|
}
|
||||||
|
|
||||||
|
const tableConfig = reactive({
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
prop: 'roleName',
|
||||||
|
label: '角色名称',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'roleKey',
|
||||||
|
label: '角色权限',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'template',
|
||||||
|
label: '是否为模版角色',
|
||||||
|
align: 'center',
|
||||||
|
currentRender: ({row, index}) => (<Tag dictType={'yes_no'} value={row.template ? '1' : '0'} />)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'roleSort',
|
||||||
|
label: '显示顺序',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'state',
|
||||||
|
label: '状态',
|
||||||
|
align: 'center',
|
||||||
|
currentRender: ({row, index}) => (<Tag dictType={'normal_disable'} value={row.state} />)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'oper',
|
||||||
|
label: '操作',
|
||||||
|
align: 'right',
|
||||||
|
currentRender: ({row, index}) => {
|
||||||
|
let btn = [{label: '修改', auth: auths.edit, func: ()=>handleEdit(row) , type: 'primary'}]
|
||||||
|
row.template ?
|
||||||
|
btn.push(
|
||||||
|
{
|
||||||
|
label: '使用模版',
|
||||||
|
auth: auths.edit,
|
||||||
|
func: ()=>handleUseTemp(row),
|
||||||
|
type: 'primary'
|
||||||
|
}
|
||||||
|
) :
|
||||||
|
btn.push(
|
||||||
|
{
|
||||||
|
label: '分配用户',
|
||||||
|
auth: auths.edit,
|
||||||
|
func: ()=>handleAssign(row),
|
||||||
|
type: 'primary'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if(authStore.roles.includes('superAdmin')) {
|
||||||
|
btn.push({label: '删除', auth: auths.edit, func: ()=>handleDel(row) , type: 'danger'})
|
||||||
|
} else if(!row.template) {
|
||||||
|
btn.push({label: '删除', auth: auths.edit, func: ()=>handleDel(row) , type: 'danger'})
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div style={{width: '100%'}}>
|
||||||
|
{
|
||||||
|
btn.map(item=>(
|
||||||
|
<el-button
|
||||||
|
type={item.type}
|
||||||
|
v-perm={item.auth}
|
||||||
|
onClick={()=>item.func()}
|
||||||
|
link
|
||||||
|
>
|
||||||
|
{item.label}
|
||||||
|
</el-button>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
api: '/admin/role',
|
||||||
|
btns: [{name: '新增', key: 'add', auth: auths.add, type: 'primary'}],
|
||||||
|
params: {}
|
||||||
|
})
|
||||||
|
|
||||||
|
const search = (val) => {
|
||||||
|
let obj = {...val}
|
||||||
|
if(obj.dateValue) {
|
||||||
|
obj.startTime = obj.dateValue[0]
|
||||||
|
obj.endTime = obj.dateValue[1]
|
||||||
|
delete obj.dateValue
|
||||||
|
}
|
||||||
|
tableConfig.params = obj
|
||||||
|
tableIns.value.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatDataScope = (dataScope) => {
|
||||||
|
let text = '--'
|
||||||
|
switch(dataScope) {
|
||||||
|
case '1': text = '所有数据权限'
|
||||||
|
break
|
||||||
|
case '2': text = '自定义数据权限'
|
||||||
|
break
|
||||||
|
case '3': text = '本部门数据权限'
|
||||||
|
break
|
||||||
|
case '4': text = '本部门及以下数据权限'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return text
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加功能
|
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
if( tree.value!==undefined){
|
router.push({
|
||||||
tree.value.setCheckedKeys([])
|
path: '/system/roleadd',
|
||||||
}
|
query: {
|
||||||
// getMenu()
|
isAdd: 1
|
||||||
getMenuList().then(res => {
|
|
||||||
treeData.value = res.data
|
|
||||||
})
|
|
||||||
restForm();
|
|
||||||
rules.roleKey[0].required = true
|
|
||||||
title.value = "新增角色";
|
|
||||||
isVisited.value = true;
|
|
||||||
nextTick(()=>{
|
|
||||||
// 清空校验
|
|
||||||
formInstance.value.clearValidate()
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
//修改功能
|
|
||||||
const handleEdit = (roleId) => {
|
|
||||||
restForm();
|
|
||||||
//查看详情
|
|
||||||
getRoleDetail(roleId).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
console.log('角色详情', res.data)
|
|
||||||
rules.roleKey[0].required = false
|
|
||||||
menuIds.value = res.data.menuIds
|
|
||||||
form.value = res.data
|
|
||||||
title.value = "修改角色";
|
|
||||||
isVisited.value = true;
|
|
||||||
nextTick(()=>{
|
|
||||||
// 清空校验
|
|
||||||
formInstance.value.clearValidate()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
getMenu()
|
|
||||||
};
|
|
||||||
//删除功能
|
|
||||||
const handleDel = (roleId) => {
|
|
||||||
// ElMessageBox.confirm(`确认删除角色名称为${row.roleName}的数据吗?`, "系统提示", {
|
|
||||||
// confirmButtonText: "确定",
|
|
||||||
// cancelButtonText: "取消",
|
|
||||||
// type: "warning",
|
|
||||||
// }).then(() => {
|
|
||||||
deleteRole(roleId).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg);
|
|
||||||
getList();
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// });
|
|
||||||
};
|
|
||||||
//分配用户
|
|
||||||
const handleAssignedUser = (row) => {
|
|
||||||
//路由跳转,携带参数
|
|
||||||
router.push('/role-auth/user/' + row.roleId+'/'+ row.roleName)
|
|
||||||
}
|
|
||||||
//获取菜单名称
|
|
||||||
const getMenu = async () => {
|
|
||||||
let params = {
|
|
||||||
...queryParams
|
|
||||||
}
|
|
||||||
getMenuList(params).then(res => {
|
|
||||||
tree.value.setCheckedKeys(menuIds.value)
|
|
||||||
treeData.value = res.data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//多选框事件
|
|
||||||
const changeCheckbox = (checked) => {
|
|
||||||
//父子联动
|
|
||||||
checkStrictly.value = checked.indexOf("3") === -1;
|
|
||||||
let nodes = tree.value.store.nodesMap;
|
|
||||||
console.log('checked',checked)
|
|
||||||
//展开/折叠
|
|
||||||
if (checked.indexOf("1") === 1) {
|
|
||||||
for (const node in nodes) {
|
|
||||||
nodes[node].expanded = true;
|
|
||||||
}
|
|
||||||
isExpand.value = '折叠'
|
|
||||||
} else {
|
|
||||||
for (const node in nodes) {
|
|
||||||
nodes[node].expanded = false;
|
|
||||||
}
|
|
||||||
isExpand.value = '展开'
|
|
||||||
}
|
|
||||||
//全选/全不选
|
|
||||||
if (checked.indexOf("2") === 1) {
|
|
||||||
tree.value.setCheckedNodes(treeData.value)
|
|
||||||
isAllChose.value = '不全选'
|
|
||||||
} else {
|
|
||||||
tree.value.setCheckedNodes([])
|
|
||||||
isAllChose.value = '全选'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//点击新增/修改弹窗上的tree节点的左边选择框
|
|
||||||
const handleCheckChange = (data) => {
|
|
||||||
form.value.menuIds = tree.value.getCheckedKeys()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//取消操作
|
|
||||||
const handleCancel = () => {
|
|
||||||
restForm();
|
|
||||||
isVisited.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmit = async (formInstance) => {
|
|
||||||
if (!formInstance) return;
|
|
||||||
formInstance.validate(async (valid) => {
|
|
||||||
if (!valid) return;
|
|
||||||
if (title.value == "新增角色") {
|
|
||||||
console.log('新增角色', form.value)
|
|
||||||
addRole(form.value).then(res => {
|
|
||||||
console.log('res', res)
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg);
|
|
||||||
getList();
|
|
||||||
isVisited.value = false;
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// form.value.menuIds = tree.value.getCheckedKeys()
|
|
||||||
console.log('form.value修改', form.value)
|
|
||||||
editRole(form.value).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg);
|
|
||||||
isVisited.value = false;
|
|
||||||
getList();
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//切换每页显示条数
|
|
||||||
const handleSizeChange = (val) => {
|
const handleEdit = (row) => {
|
||||||
pageInfo.pageSize = val
|
router.push({
|
||||||
getList()
|
path: '/system/roleedit',
|
||||||
|
query: {
|
||||||
|
id: row.roleId
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
//点击页码进行分页功能
|
|
||||||
const handleCurrentChange = (val) => {
|
const handleUseTemp = (row) => {
|
||||||
pageInfo.pageNum = val
|
router.push({
|
||||||
getList()
|
path: '/system/roleadd',
|
||||||
|
query: {
|
||||||
|
id: row.roleId,
|
||||||
|
isAdd: 1
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
getList();
|
|
||||||
|
const handleAssign = (row) => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDel = (row) => {
|
||||||
|
if (!(row.template && authStore.roles.includes('superAdmin'))) {
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: '模版角色只能由超级管理员删除!',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ElMessageBox.confirm('确定删除该条数据吗?', '确定删除', {
|
||||||
|
type: 'warning',
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消'
|
||||||
|
}).then(async res => {
|
||||||
|
const { code, msg } = await deleteRole(row.roleId)
|
||||||
|
ElNotification({
|
||||||
|
title: '删除',
|
||||||
|
message: msg,
|
||||||
|
type: code === 1000 ? 'success' : 'error'
|
||||||
|
})
|
||||||
|
tableIns.value.refresh()
|
||||||
|
}).catch(()=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
const headBtnClick = (key) => {
|
||||||
|
switch(key) {
|
||||||
|
case 'add': handleAdd()
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.dialog-tree {
|
|
||||||
border: 1px solid #ad8383;
|
|
||||||
height: 300px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
.dialog-tree::-webkit-scrollbar {
|
|
||||||
width: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 滚动条轨道
|
</style>
|
||||||
.dialog-tree::-webkit-scrollbar-track {
|
|
||||||
background: rgb(239, 239, 239);
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 小滑块
|
|
||||||
.dialog-tree::-webkit-scrollbar-thumb {
|
|
||||||
background: rgba(80, 81, 82, 0.29);
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.el-input-number {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tree-select {
|
|
||||||
:deep(.el-select) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -113,11 +113,12 @@ const getList = () => {
|
|||||||
}
|
}
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getMappingList(params).then(res => {
|
getMappingList(params).then(res => {
|
||||||
// console.log('res',res)
|
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
|
}else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -118,11 +118,12 @@ const getList = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
loading.value = false
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
loading.value = false
|
||||||
|
}).catch(err => {
|
||||||
|
loading.value = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,11 +140,12 @@ const getList = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
loading.value = false
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
loading.value = false
|
||||||
|
}).catch(err => {
|
||||||
|
loading.value = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//切换每页显示条数
|
//切换每页显示条数
|
||||||
|
|||||||
@@ -12,22 +12,25 @@
|
|||||||
<user-picker :multiple="multiple" ref="userPicker" title="请选择人员" v-model:value="userList" @ok="selected"/>
|
<user-picker :multiple="multiple" ref="userPicker" title="请选择人员" v-model:value="userList" @ok="selected"/>
|
||||||
<span class="placeholder"> {{ placeholder }}</span>
|
<span class="placeholder"> {{ placeholder }}</span>
|
||||||
<div style="display: flex;">
|
<div style="display: flex;">
|
||||||
<div class="userStyle" v-for="(user, i) in userList" :key="i">
|
<role-items v-model="userList"/>
|
||||||
<span @click="delDept(i)">×</span>
|
<!-- <div class="userStyle" v-for="(user, i) in userList" :key="i">-->
|
||||||
<el-avatar :src="user.avatar"/>
|
<!-- <span @click="delDept(i)">×</span>-->
|
||||||
<el-tooltip class="item" effect="dark" :content="user.name" placement="bottom-start">
|
<!--<!– <el-avatar :src="user.avatar"/>–>-->
|
||||||
<span>{{ user.name }}</span>
|
<!-- <el-tooltip class="item" effect="dark" :content="user.name" placement="bottom-start">-->
|
||||||
</el-tooltip>
|
<!-- <span>{{ user.name }}</span>-->
|
||||||
</div>
|
<!-- </el-tooltip>-->
|
||||||
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="perm === 'R'">
|
<template v-else-if="perm === 'R'">
|
||||||
<div style="display: flex;">
|
<div style="display: flex;">
|
||||||
<div v-for="(user, i) in userList" :key="i" class="view_user">
|
<!-- class="view_user"-->
|
||||||
<el-avatar :src="user.avatar"/>
|
<div v-for="(user, i) in userList" :key="i" >
|
||||||
<el-tooltip effect="dark" :content="user.name" placement="bottom-start">
|
<!-- <el-avatar :src="user.avatar"/>-->
|
||||||
<span>{{ user.name }}</span>
|
<el-tag>{{ user.name }}</el-tag>
|
||||||
</el-tooltip>
|
<!-- <el-tooltip effect="dark" :content="user.name" placement="bottom-start">-->
|
||||||
|
<!-- <span>{{ user.name }}</span>-->
|
||||||
|
<!-- </el-tooltip>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -37,7 +40,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import UserPicker from "../../process/common/UserPicker.vue";
|
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||||
|
import RoleItems from "@/views/workflow/process/common/RoleItems.vue";
|
||||||
import {computed, defineProps} from "vue";
|
import {computed, defineProps} from "vue";
|
||||||
const emit = defineEmits(["input"])
|
const emit = defineEmits(["input"])
|
||||||
const showPickerSelect = ref(false)
|
const showPickerSelect = ref(false)
|
||||||
|
|||||||
@@ -120,10 +120,12 @@ const getList = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
loading.value = false
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
loading.value = false
|
||||||
|
}).catch(err => {
|
||||||
|
loading.value = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -204,10 +204,12 @@ const getList = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
loading.value = false
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
loading.value = false
|
||||||
|
}).catch(err => {
|
||||||
|
loading.value = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ const visible = ref(false)
|
|||||||
const timer = ref(null)
|
const timer = ref(null)
|
||||||
const validComponents = ref(['processSetting', 'formDesign', 'processDesign'])
|
const validComponents = ref(['processSetting', 'formDesign', 'processDesign'])
|
||||||
// const activeSelect = ref('formDesign')
|
// const activeSelect = ref('formDesign')
|
||||||
const activeSelect = ref('processSetting')
|
// const activeSelect = ref('processSetting')
|
||||||
|
const activeSelect = ref('processDesign')
|
||||||
const validVisible = ref(false)
|
const validVisible = ref(false)
|
||||||
const validStep = ref(0)
|
const validStep = ref(0)
|
||||||
const validResult = ref({})
|
const validResult = ref({})
|
||||||
@@ -289,7 +290,7 @@ const doPublish = () => {
|
|||||||
addProcessDefinition(template).then(res => {
|
addProcessDefinition(template).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
ElMessage.success(res.msg)
|
ElMessage.success(res.msg)
|
||||||
// this.$router.push("/formsPanel")
|
router.push("/workflow/process")
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
import {useProcessStore} from '@/stores/processStore.js'
|
import {useProcessStore} from '@/stores/processStore.js'
|
||||||
import {computed, defineExpose} from "vue";
|
import {computed, defineExpose} from "vue";
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
console.log(processStore.getDesign)
|
|
||||||
|
|
||||||
const processData = computed(() => {
|
const processData = computed(() => {
|
||||||
return processStore.getDesign()
|
return processStore.getDesign()
|
||||||
@@ -27,4 +26,4 @@ defineExpose({
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import MergeNode from './nodes/MergeNode.vue'
|
|||||||
import DelayNode from './nodes/DelayNode.vue'
|
import DelayNode from './nodes/DelayNode.vue'
|
||||||
import AddBranchNode from './nodes/AddBranchNode.vue'
|
import AddBranchNode from './nodes/AddBranchNode.vue'
|
||||||
|
|
||||||
|
import {debounce} from 'lodash'
|
||||||
import {defineExpose, h, render, ref} from 'vue'
|
import {defineExpose, h, render, ref} from 'vue'
|
||||||
import DefaultProps from "./DefaultNodeProps"
|
import DefaultProps from "./DefaultNodeProps"
|
||||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||||
@@ -47,7 +48,6 @@ const init = () => {
|
|||||||
|
|
||||||
// 初始化map集合,以便数据整理
|
// 初始化map集合,以便数据整理
|
||||||
const initMapping = (node) => {
|
const initMapping = (node) => {
|
||||||
console.log("初始化数据", node)
|
|
||||||
node.forEach(nodeItem => {
|
node.forEach(nodeItem => {
|
||||||
processStore.nodeMap.set(nodeItem.id, nodeItem)
|
processStore.nodeMap.set(nodeItem.id, nodeItem)
|
||||||
processStore.parentMap.set(nodeItem.parentId, nodeItem)
|
processStore.parentMap.set(nodeItem.parentId, nodeItem)
|
||||||
@@ -290,7 +290,7 @@ const selectNode = (node) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//处理节点插入逻辑
|
//处理节点插入逻辑
|
||||||
const insertNode = (type, parentNode) => {
|
const insertNode = debounce((type, parentNode) => {
|
||||||
//插入新节点
|
//插入新节点
|
||||||
let id = getRandomId();
|
let id = getRandomId();
|
||||||
updateParentId(id, parentNode.id)
|
updateParentId(id, parentNode.id)
|
||||||
@@ -321,9 +321,8 @@ const insertNode = (type, parentNode) => {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.log('开始刷新')
|
|
||||||
init()
|
init()
|
||||||
}
|
}, 100)
|
||||||
/**
|
/**
|
||||||
* 更新父id
|
* 更新父id
|
||||||
* @param newId
|
* @param newId
|
||||||
@@ -476,7 +475,7 @@ const addBranchNode = (node) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//删除当前节点
|
//删除当前节点
|
||||||
const delNode = (node) => {
|
const delNode = debounce((node) => {
|
||||||
//获取该节点的父节点
|
//获取该节点的父节点
|
||||||
let parentNode = processStore.nodeMap.get(node.parentId)
|
let parentNode = processStore.nodeMap.get(node.parentId)
|
||||||
if (parentNode) {
|
if (parentNode) {
|
||||||
@@ -489,8 +488,7 @@ const delNode = (node) => {
|
|||||||
} else {
|
} else {
|
||||||
ElMessage.warning("出现错误,找不到上级节点😥")
|
ElMessage.warning("出现错误,找不到上级节点😥")
|
||||||
}
|
}
|
||||||
}
|
}, 100)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从dom中删除
|
* 从dom中删除
|
||||||
@@ -667,9 +665,8 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
|
|
||||||
.process-end {
|
.process-end {
|
||||||
width: 60px;
|
width: 77px;
|
||||||
margin: 0 auto;
|
margin: 0 auto 20px auto;
|
||||||
margin-bottom: 20px;
|
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
@@ -690,8 +687,8 @@ defineExpose({
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
/*border-top: 2px solid #cccccc;
|
//border-top: 2px solid #cccccc;
|
||||||
border-bottom: 2px solid #cccccc;*/
|
//border-bottom: 2px solid #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.branch-node-item {
|
.branch-node-item {
|
||||||
@@ -700,8 +697,8 @@ defineExpose({
|
|||||||
//background: #f5f6f6;
|
//background: #f5f6f6;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-top: 2px solid #cccccc;
|
border-top: 2px solid #000000;
|
||||||
border-bottom: 2px solid #cccccc;
|
border-bottom: 2px solid #000000;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
@@ -711,7 +708,7 @@ defineExpose({
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
width: 2px;
|
width: 2px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #CACACA;
|
background-color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.line-top-left, .line-top-right, .line-bot-left, .line-bot-right {
|
.line-top-left, .line-top-right, .line-bot-left, .line-bot-right {
|
||||||
@@ -746,6 +743,10 @@ defineExpose({
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
border-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
.add-branch-btn-el {
|
.add-branch-btn-el {
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ getDepartmentTreeList();
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$containWidth: 278px;
|
$containWidth: 264px;
|
||||||
|
|
||||||
///deep/ .el-tree-node {
|
///deep/ .el-tree-node {
|
||||||
// .is-leaf + .el-checkbox .el-checkbox__inner {
|
// .is-leaf + .el-checkbox .el-checkbox__inner {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-popover :visible="visible" placement="bottom-start" title="添加流程节点" width="350">
|
<el-popover :visible="visible" placement="bottom-start" title="添加流程节点" width="306">
|
||||||
<div class="node-select">
|
<div class="node-select">
|
||||||
<div @click="addApprovalNode">
|
<div @click="addApprovalNode">
|
||||||
<el-icon style="color:rgb(255, 148, 62);">
|
<el-icon style="color:rgb(255, 148, 62);">
|
||||||
@@ -39,18 +39,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button :icon="Plus" slot="reference" type="primary" @click="visible = !visible" size="small" circle></el-button>
|
<!-- <el-button :icon="Plus" slot="reference" type="primary" @click="visible = !visible" size="small"-->
|
||||||
|
<!-- circle></el-button>-->
|
||||||
|
<el-icon @click="visible = !visible" color="#fff" style="background-color:#2E7CF0;border-radius: 50%;cursor: pointer" ><Plus /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {Plus } from '@element-plus/icons-vue'
|
import {Plus, Clock, SetUp, Operation, Share, Promotion, Coordinate} from '@element-plus/icons-vue'
|
||||||
|
|
||||||
const emit = defineEmits(['insertNode'])
|
const emit = defineEmits(['insertNode'])
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
document.addEventListener('click', nullBlockClick)
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* 点击空白处, 清除选项选中状态
|
||||||
|
*/
|
||||||
|
const nullBlockClick = (e) => {
|
||||||
|
if(!(e.target.tagName==='svg'||e.target.tagName==='path')){
|
||||||
|
disVisible()
|
||||||
|
}
|
||||||
|
}
|
||||||
const addApprovalNode = () => {
|
const addApprovalNode = () => {
|
||||||
emit('insertNode', "APPROVAL")
|
emit('insertNode', "APPROVAL")
|
||||||
disVisible()
|
disVisible()
|
||||||
@@ -93,6 +104,7 @@ const disVisible = () =>{
|
|||||||
background-color: #F8F9F9;
|
background-color: #F8F9F9;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
width: 130px;
|
width: 130px;
|
||||||
|
line-height: 7px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
<el-tag class="role-item" v-model="_value" v-for="(role, index) in _value" :key="index + '_role'"
|
<el-tag class="role-item" v-model="_value" v-for="(role, index) in _value" :key="index + '_role'"
|
||||||
closable size="mini" @close="removeRoleItem(index)">
|
closable size="mini" @close="removeRoleItem(index)">
|
||||||
{{ role.roleName }}
|
{{ role.name }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ defineExpose({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$containWidth: 278px;
|
$containWidth: 264px;
|
||||||
.el-dialog__body {
|
.el-dialog__body {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
<div class="tree">
|
<div class="tree">
|
||||||
<el-tree :data="dataList" ref="tree" :props="defaultProps" empty-text="" node-key="value"
|
<el-tree :data="dataList" ref="tree" :props="defaultProps" empty-text="" node-key="value"
|
||||||
:default-expanded-keys="expandedKeys" lazy accordion
|
:default-expanded-keys="expandedKeys" lazy accordion
|
||||||
@node-click="handleChange"
|
@node-click="handleChange" @node-expand="handleChange"
|
||||||
>
|
>
|
||||||
<template #default="{ node, data }">
|
<template #default="{ node, data }">
|
||||||
<div class="tree-node">
|
<div class="tree-node">
|
||||||
<div v-if="data.type === 0" style="display: flex;align-items: center;padding: 3px 0">
|
<div v-if="data.type === 0" style="display: flex;align-items: center;padding: 3px 0">
|
||||||
<el-avatar :src="data.avatar"></el-avatar>
|
<!-- <el-avatar :src="data.avatar"></el-avatar>-->
|
||||||
{{ node.label }}
|
{{ node.label }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="data.type ===1">
|
<div v-else-if="data.type ===1">
|
||||||
@@ -44,7 +44,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,7 +55,7 @@
|
|||||||
<div class="org-items" style="height: 350px;">
|
<div class="org-items" style="height: 350px;">
|
||||||
<el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/>
|
<el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/>
|
||||||
<div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-item">
|
<div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-item">
|
||||||
<el-avatar :src="selectItem.avatar" style="margin-right: 5px;"></el-avatar>
|
<!-- <el-avatar :src="selectItem.avatar" style="margin-right: 5px;"></el-avatar>-->
|
||||||
{{ selectItem.name}}
|
{{ selectItem.name}}
|
||||||
<i class="el-icon-close" @click="noSelected(selectItem)"></i>
|
<i class="el-icon-close" @click="noSelected(selectItem)"></i>
|
||||||
</div>
|
</div>
|
||||||
@@ -110,9 +109,13 @@ const expandedKeys = ref([]);
|
|||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
value: "value",
|
value: "value",
|
||||||
label: "name",
|
label: "name",
|
||||||
children: "children"
|
children: "children",
|
||||||
// isLeaf: function (data, node) {
|
isLeaf:(data, node) => {
|
||||||
// return data.type === 0;
|
if (node.level === 2) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
const emit = defineEmits();
|
const emit = defineEmits();
|
||||||
|
|
||||||
@@ -187,20 +190,31 @@ const showUserPicker = () => {
|
|||||||
const handleChange = (item, data, node) => {
|
const handleChange = (item, data, node) => {
|
||||||
//渲染子节点用户或部门及用户数据
|
//渲染子节点用户或部门及用户数据
|
||||||
selectItem = item;
|
selectItem = item;
|
||||||
if(expandedKeys.value.indexOf(item.value)==-1){
|
if (data.expanded) {
|
||||||
expandedKeys.value.push(item.value);
|
if(expandedKeys.value.indexOf(item.value)===-1){
|
||||||
}else {
|
expandedKeys.value.push(item.value);
|
||||||
return;
|
if (item.type !== 0) {
|
||||||
}
|
chooseId.value = item.id;
|
||||||
if (data.expanded === true) {
|
getList();
|
||||||
if (item.type !== 0) {
|
return;
|
||||||
chooseId.value = item.id;
|
}
|
||||||
getList();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(expandedKeys.value.indexOf(item.value)==-1){
|
||||||
|
// expandedKeys.value.push(item.value);
|
||||||
|
// }else {
|
||||||
|
// if (data.expanded === true) {
|
||||||
|
// if (item.type !== 0) {
|
||||||
|
// chooseId.value = item.id;
|
||||||
|
// getList();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
//仅选择用户
|
//仅选择用户
|
||||||
if (item.avatar !== null) {
|
if (item.type === 0) {
|
||||||
if (props.multiple) {
|
if (props.multiple) {
|
||||||
//不添加重复的数据到右边
|
//不添加重复的数据到右边
|
||||||
for (let i = 0; i < selectList.value.length; i++) {
|
for (let i = 0; i < selectList.value.length; i++) {
|
||||||
@@ -249,14 +263,14 @@ defineExpose({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$containWidth: 278px;
|
$containWidth: 264px;
|
||||||
:deep(.tree) {
|
:deep(.tree) {
|
||||||
.el-tree {
|
.el-tree {
|
||||||
.el-tree-node {
|
.el-tree-node {
|
||||||
.el-tree-node__children {
|
.el-tree-node__children {
|
||||||
.el-tree-node {
|
.el-tree-node {
|
||||||
.el-tree-node__content {
|
.el-tree-node__content {
|
||||||
height: 45px !important;
|
//height: 45px !important;
|
||||||
|
|
||||||
.tree-node {
|
.tree-node {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
选择人员
|
选择人员
|
||||||
</el-button>
|
</el-button>
|
||||||
<user-picker title="请选择系统角色" :multiple="false" ref="sysRolePicker" :v-model="assignedUser" @ok="selectedUser"/>
|
<user-picker title="请选择系统角色" :multiple="false" ref="sysRolePicker" :v-model="assignedUser" @ok="selectedUser"/>
|
||||||
<avatar-ellipsis :row="3" :user-info="assignedUser"/>
|
<!-- <ellipsis :row="3" :user-info="assignedUser"/>-->
|
||||||
|
<role-items v-model="assignedUser"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="nodeProps.assignedType === 'SELF_SELECT'">
|
<div v-else-if="nodeProps.assignedType === 'SELF_SELECT'">
|
||||||
<el-radio-group size="mini" v-model="nodeProps.selfSelect.multiple">
|
<el-radio-group size="mini" v-model="nodeProps.selfSelect.multiple">
|
||||||
@@ -42,11 +43,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="nodeProps.assignedType === 'ROLE'">
|
<div v-else-if="nodeProps.assignedType === 'ROLE'">
|
||||||
<el-button size="mini" icon="Plus" type="primary" @click="showRolePicker()" round>
|
<el-button size="mini" icon="Plus" type="primary" @click="showRolePicker" round>
|
||||||
选择系统角色
|
选择系统角色
|
||||||
</el-button>
|
</el-button>
|
||||||
<role-picker title="请选择人员" :multiple="false" ref="rolePicker" :v-model="roleList" @ok="selectedRole"/>
|
<role-picker title="请选择人员" :multiple="false" ref="rolePicker" :v-model="roleList" @ok="selectedRole"/>
|
||||||
<role-items v-model="nodeProps.roleList"/>
|
<role-items v-model="roleList"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="nodeProps.assignedType === 'FORM_USER'">
|
<div v-else-if="nodeProps.assignedType === 'FORM_USER'">
|
||||||
<el-form-item label="选择表单联系人项" prop="text" class="approve-end">
|
<el-form-item label="选择表单联系人项" prop="text" class="approve-end">
|
||||||
@@ -73,7 +74,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<user-picker title="请指定用户" :multiple="false" ref="toUserPicker" :v-model="nobodyAssignedUser"
|
<user-picker title="请指定用户" :multiple="false" ref="toUserPicker" :v-model="nobodyAssignedUser"
|
||||||
@ok="selectNoSetUser"/>
|
@ok="selectNoSetUser"/>
|
||||||
<avatar-ellipsis :row="3" :user-info="nobodyAssignedUser"/>
|
<ellipsis :row="3" :user-info="nobodyAssignedUser"/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -216,7 +217,7 @@
|
|||||||
import {useProcessStore} from '@/stores/processStore.js'
|
import {useProcessStore} from '@/stores/processStore.js'
|
||||||
import UserPicker from '../common/UserPicker.vue'
|
import UserPicker from '../common/UserPicker.vue'
|
||||||
import RolePicker from '../common/RolePicker.vue'
|
import RolePicker from '../common/RolePicker.vue'
|
||||||
import AvatarEllipsis from '../common/AvatarEllipsis.vue'
|
import Ellipsis from '../common/Ellipsis.vue'
|
||||||
import RoleItems from "../common/RoleItems.vue";
|
import RoleItems from "../common/RoleItems.vue";
|
||||||
import {computed, defineProps} from 'vue'
|
import {computed, defineProps} from 'vue'
|
||||||
|
|
||||||
@@ -375,8 +376,8 @@ const selectedRole = (select) => {
|
|||||||
let roleInfoList = []
|
let roleInfoList = []
|
||||||
for (let val of select) {
|
for (let val of select) {
|
||||||
let userInfo = {
|
let userInfo = {
|
||||||
roleId: val.roleId,
|
value: val.roleId,
|
||||||
roleName: val.roleName
|
name: val.roleName
|
||||||
}
|
}
|
||||||
roleInfoList.push(userInfo)
|
roleInfoList.push(userInfo)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,10 +161,12 @@ const getList = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
list.value = res.data.rows
|
list.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
loading.value = false
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
loading.value = false
|
||||||
|
}).catch(err => {
|
||||||
|
loading.value = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const assignedUser = computed(() => {
|
|||||||
|
|
||||||
const headerBgc = computed(() => {
|
const headerBgc = computed(() => {
|
||||||
if (props.mode === 'design' || props.mode === 'view') {
|
if (props.mode === 'design' || props.mode === 'view') {
|
||||||
return '#ff943e'
|
return '#F0A32E'
|
||||||
} else {
|
} else {
|
||||||
return props.config.props.headerBgc
|
return props.config.props.headerBgc
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ const content = computed(() => {
|
|||||||
case "ROLE":
|
case "ROLE":
|
||||||
if (config.roleList.length > 0) {
|
if (config.roleList.length > 0) {
|
||||||
return config.roleList.map(role => {
|
return config.roleList.map(role => {
|
||||||
return role.roleName;
|
return role.name;
|
||||||
}).join("、")
|
}).join("、")
|
||||||
} else {
|
} else {
|
||||||
return '指定角色(未设置)'
|
return '指定角色(未设置)'
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import {Promotion} from '@element-plus/icons-vue'
|
|||||||
|
|
||||||
const headerBgc = computed(() => {
|
const headerBgc = computed(() => {
|
||||||
if (props.mode === 'design' || props.mode === 'view') {
|
if (props.mode === 'design' || props.mode === 'view') {
|
||||||
return '#3296fa'
|
return '#2EC2F0'
|
||||||
} else {
|
} else {
|
||||||
return props.config.props.headerBgc
|
return props.config.props.headerBgc
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,18 +149,18 @@ const designStart = () => {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
.node-body-main-header {
|
.node-body-main-header {
|
||||||
padding: 10px 0px 5px;
|
padding: 10px 0 5px;
|
||||||
font-size: xx-small;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
.title {
|
.title {
|
||||||
color: #718dff;
|
color: #2E7CF0;
|
||||||
|
height: auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
.name {
|
.name {
|
||||||
display: inline-block;
|
height: auto;
|
||||||
height: 14px;
|
|
||||||
width: 130px;
|
|
||||||
margin-left: 2px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,9 @@
|
|||||||
import InsertButton from '../common/InsertButton.vue'
|
import InsertButton from '../common/InsertButton.vue'
|
||||||
import Ellipsis from '../common/Ellipsis.vue'
|
import Ellipsis from '../common/Ellipsis.vue'
|
||||||
import {ValueType} from '@/views/workflow/form/ComponentsConfigExport.js'
|
import {ValueType} from '@/views/workflow/form/ComponentsConfigExport.js'
|
||||||
import {ArrowRightBold,ArrowLeftBold,CopyDocument,CloseBold,Warning} from '@element-plus/icons-vue'
|
import {ArrowRightBold, ArrowLeftBold, CopyDocument, CloseBold, Warning} from '@element-plus/icons-vue'
|
||||||
import {defineProps, defineEmits, defineExpose} from "vue";
|
import {defineProps, defineEmits, defineExpose} from "vue";
|
||||||
|
|
||||||
const emit = defineEmits()
|
const emit = defineEmits()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -112,7 +113,7 @@ const content = computed(() => {
|
|||||||
return String(confitions).replaceAll(',', (props.config.props.groupsType === 'AND' ? ' 且 ' : ' 或 '))
|
return String(confitions).replaceAll(',', (props.config.props.groupsType === 'AND' ? ' 且 ' : ' 或 '))
|
||||||
})
|
})
|
||||||
|
|
||||||
const designState = computed(()=>{
|
const designState = computed(() => {
|
||||||
return props.mode === 'design'
|
return props.mode === 'design'
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -146,23 +147,23 @@ const getOrdinaryConditionContent = (subCondition) => {
|
|||||||
//校验数据配置的合法性
|
//校验数据配置的合法性
|
||||||
const validate = (err) => {
|
const validate = (err) => {
|
||||||
const defineProps = props.config.props
|
const defineProps = props.config.props
|
||||||
if (defineProps.groups.length <= 0){
|
if (defineProps.groups.length <= 0) {
|
||||||
showError.value = true
|
showError.value = true
|
||||||
errorInfo.value = '请设置分支条件'
|
errorInfo.value = '请设置分支条件'
|
||||||
err.push(`${defineProps.config.name} 未设置条件`)
|
err.push(`${defineProps.config.name} 未设置条件`)
|
||||||
}else {
|
} else {
|
||||||
for (let i = 0; i < defineProps.groups.length; i++) {
|
for (let i = 0; i < defineProps.groups.length; i++) {
|
||||||
if (defineProps.groups[i].cids.length === 0){
|
if (defineProps.groups[i].cids.length === 0) {
|
||||||
showError.value = true
|
showError.value = true
|
||||||
errorInfo.value = `请设置条件组${groupNames.value[i]}内的条件`
|
errorInfo.value = `请设置条件组${groupNames.value[i]}内的条件`
|
||||||
err.push(`条件 ${props.config.name} 条件组${groupNames.value[i]}内未设置条件`)
|
err.push(`条件 ${props.config.name} 条件组${groupNames.value[i]}内未设置条件`)
|
||||||
break
|
break
|
||||||
}else {
|
} else {
|
||||||
let conditions = defineProps.groups[i].conditions
|
let conditions = defineProps.groups[i].conditions
|
||||||
for (let ci = 0; ci < conditions.length; ci++) {
|
for (let ci = 0; ci < conditions.length; ci++) {
|
||||||
let subc = conditions[ci]
|
let subc = conditions[ci]
|
||||||
showError.value = subc.value.length === 0;
|
showError.value = subc.value.length === 0;
|
||||||
if (showError.value){
|
if (showError.value) {
|
||||||
errorInfo.value = `请完善条件组${groupNames.value[i]}内的${subc.title}条件`
|
errorInfo.value = `请完善条件组${groupNames.value[i]}内的${subc.title}条件`
|
||||||
err.push(`条件 ${props.config.name} 条件组${groupNames.value[i]}内${subc.title}条件未完善`)
|
err.push(`条件 ${props.config.name} 条件组${groupNames.value[i]}内${subc.title}条件未完善`)
|
||||||
return false
|
return false
|
||||||
@@ -247,17 +248,22 @@ defineExpose({
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
.node-body-main-header {
|
.node-body-main-header {
|
||||||
padding: 10px 0px 5px;
|
padding: 10px 0 5px;
|
||||||
font-size: xx-small;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
color: #15bca3;
|
|
||||||
display: inline-block;
|
|
||||||
height: 14px;
|
|
||||||
width: 125px;
|
width: 125px;
|
||||||
|
color: #2E7CF0;
|
||||||
|
height: auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.name {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.level {
|
.level {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 15px;
|
right: 15px;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const errorInfo = ref('')
|
|||||||
|
|
||||||
const headerBgc = computed(() => {
|
const headerBgc = computed(() => {
|
||||||
if (props.mode === 'design' || props.mode === 'view') {
|
if (props.mode === 'design' || props.mode === 'view') {
|
||||||
return '#f25643'
|
return '#F05D2E'
|
||||||
} else {
|
} else {
|
||||||
return props.config.props.headerBgc
|
return props.config.props.headerBgc
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +1,59 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="{'node': true, 'root': isRoot || !show, 'node-error-state': showError}">
|
<div :class="{'node': true, 'root': isRoot || !show, 'node-error-state': showError}">
|
||||||
<div v-if="show" @click="emit('selected')" :class="{'node-body': true, 'error': showError}">
|
<div v-if="show" @click="emit('selected')" :class="{'node-body': true, 'error': showError}">
|
||||||
<div class="node-body-header" :style="{'background-color': headerBgc}">
|
<div class="node-body-header" :style="{'background-color': headerBgc}">
|
||||||
<el-icon v-if="headerIcon" size="15">
|
<el-icon v-if="headerIcon" size="20">
|
||||||
<component :is="headerIcon"/>
|
<component :is="headerIcon"/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<ellipsis class="name" hover-tip :content="title"/>
|
<ellipsis class="name" hover-tip :content="title"/>
|
||||||
<el-icon v-if="!isRoot && designState" size="15" style="float:right;" @click="emit('delNode')">
|
<el-icon v-if="!isRoot && designState" size="20" style="float:right;cursor: pointer" @click.stop="emit('delNode')">
|
||||||
<Close/>
|
<Close/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</div>
|
|
||||||
<div class="node-body-content">
|
|
||||||
<el-icon v-if="leftIcon">
|
|
||||||
<component :is="leftIcon"/>
|
|
||||||
</el-icon>
|
|
||||||
<template v-if="selectUser.show && mode === 'view'">
|
|
||||||
<div class="avatar_button">
|
|
||||||
<avatar-ellipsis :row="3" v-if="userInfo.length > 0" :user-info="userInfo"/>
|
|
||||||
<el-button type="primary" :icon="Plus" circle/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-else-if="showAvatar">
|
|
||||||
<span class="placeholder" v-if="userInfo.length === 0">{{ placeholder }}</span>
|
|
||||||
<avatar-ellipsis :row="3" :user-info="userInfo" v-else/>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<span class="placeholder" v-if="(content || '').trim() === ''">{{ placeholder }}</span>
|
|
||||||
<ellipsis :row="3" :content="content" v-else/>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<div class="node-error" v-if="showError">
|
|
||||||
<el-tooltip effect="dark" :content="errorInfo" placement="top-start">
|
|
||||||
<el-icon><Warning /></el-icon>
|
|
||||||
</el-tooltip>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="node-body-content">
|
||||||
|
<el-icon v-if="leftIcon">
|
||||||
|
<component :is="leftIcon"/>
|
||||||
|
</el-icon>
|
||||||
|
<template v-if="selectUser.show && mode === 'view'">
|
||||||
|
<div class="avatar_button">
|
||||||
|
<avatar-ellipsis :row="3" v-if="userInfo.length > 0" :user-info="userInfo"/>
|
||||||
|
<el-button type="primary" :icon="Plus" circle/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="showAvatar">
|
||||||
|
<span class="placeholder" v-if="userInfo.length === 0">{{ placeholder }}</span>
|
||||||
|
<div v-else v-for="item in userInfo" class="circle-user">
|
||||||
|
<span >{{item.name}}</span>
|
||||||
|
</div>
|
||||||
|
<!-- <avatar-ellipsis :row="3" :user-info="userInfo"/>-->
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span class="placeholder" v-if="(content || '').trim() === ''">{{ placeholder }}</span>
|
||||||
|
<ellipsis :row="3" :content="content" v-else/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="node-error" v-if="showError">
|
||||||
|
<el-tooltip effect="dark" :content="errorInfo" placement="top-start">
|
||||||
|
<el-icon>
|
||||||
|
<Warning/>
|
||||||
|
</el-icon>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="node-footer">
|
<div class="node-footer">
|
||||||
<div v-if="merge" class="branch-merge">
|
<div v-if="merge" class="branch-merge">
|
||||||
<img data-v-1e7b1da5=""
|
<svg-icon name="fenzhi" :class-name="'fen-icon'"/>
|
||||||
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABXlJREFUeF7tmm2IVGUUx3/nLkQUqxmkpAVhSPUllZX8EEGhvVgZQWCU6wcpsqi2mXtnoaBwoqLCufeO9oJYUJQiFZWlZPQCfYiIXkylstTyS1oWWeYWCe6cuLsz7t3r3Ll3du6907oz35bnPM9z/r895zznmWeECf6RCa6fDoBOBExwAp0UmOAB0CmCnRTopECbCZi2nivK1CMD7FpXlH+ydqctKZBz9QyjwkqFG4HzfKK/0gpvl/ulmBWIzAHkVmlRDFY2EihwwLFkRhYQxgzAtHW2CpcBc4CpOsg26eK7yVPYVFwu/9ZzPufq2VLhQBxhAk85lvSF2Y5l/3prjQlAvqR3IjwJTKqz6DeGssQuyLfBsbyjz6PcFgeAZyOwzLFk/QnrjHH/RACYtj6ncHuUCDWYXs7Lz367XEn3inB+1NzauMLGsiW3+u1b2b9lAH22LuiCD2IJED5yTbmiZpt3dAbKT7Hmjhjtdi25oPZnK/uH7dtUCpi2vqVwQ1wRWuHhWkW3StpTEb6IO3fIThhwTemuzWll/0QA5G39FTgrtghhs2vKELA7inra6d38HXvusOEnriWXHo+iFvZvGUDfap3VdYzdzQgIHmd5W7cBc2Ovoax1C3KXZ5/E/i3VgCQciNMD+J1Ug55yXjxo7QfgOdFKCvjyeL/C9MgoEBa5przrt0ti/+C+mRVB/8amrWsU7m2Ql/c5lqwJjre9CDZ1DMFnriXzw0SatvZW4FqBW6o2vwGvCGxyLPmw3rym9g8cwy0XQV8Ix2qEgH0C1ziWNCyceVu1uvZrriVLGqVGsainHO7mRyDynlCvEWupCI7Kxcat6BFg+OwW9ohyfSMIcQF44v/sZovAlRH1I7QVTwyAt1Cjy8hfh9hYvepGQogDoI74HYbSXzHwusTYl7FEAURVcdPWN+NAiAJQTzzCda4p+6N8iDPe1CkQZ8FAtY+E0AhA2uKHszTlT1QkhAHIQnwmAKr1IjQS6gHISnxmABpBCALIUnymAMIgKHxf6wMmH6E3cNTtSLLgZXoKNOgAR6UDyqyq7esKk3znfOriM48AXzc5AmGE1EFgWvXPTMS3DcAJ6TA6XDIT31YAoRCEc5JqcuKc8Kn3AVFO+E4BryvJVHzbI8BzwAdgi2vJ4ihgSY//nyIg8jqctPi2RYBp61wV5qsyR2BFVdhBhBe0wtdisNU15VAagoNrZh4BOVsfFcVCODVUoLBn6E2hIBvShpApgLyt3nvhRXFFCWxwLOmNaz8Wu8wA5G31ntQWNOukwD2OJc80Oy+ufSYAciVdJsJLcZ0K2nV1MbuUk51jnd9oXuoACmW9eHCQj49/T+j3RtiJslPgFxXmoVxe11nhPdeUq8clANPWPoXVQef9D6e1saEHVINHUBYF7Q1lnl2QL5OGkHoE5G19GRhVyBQ+L1tyST0xoa/Iygq3IOvGI4BdwIWjHBeecE15IExM3tYfgJmBOetcU2o9Q2IcsoiAw8Gf0qhyU7kgb4QCcPRTlNGvSspmtzD81J7kJ30AJX0fYeHo2seLjiXLG0TA78CZ/nGFB8uWPJakeG+t9AE4+jjK/XGLWtgTusBix5It4w5ArqRLRTjhl14IW40KD/kre66ki0R4p57IrgozS/2yb9wByDvqhbKX07Xv/oIavMfOP6pFb0pdgcqrbkFuTlp8JingbRIaBfEUHUOYltbtMPUaUNNo2rpeYWk8zSNWqvSmeSvMDIAnybT1boWnY0I4aigL7YJ4bXRqn0wBeCqG7gYVVqFcFapKWXt0gP5nizKQmvLqwpkDqAkaanmhB4MelOkI27XCDjHY7pqyN23htfXbBiArgVH7dABEETrZxzsRcLL/h6P0/Qc1qphfvB2K3wAAAABJRU5ErkJggg=="
|
<!-- <img data-v-1e7b1da5=""-->
|
||||||
alt="">
|
<!-- src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABXlJREFUeF7tmm2IVGUUx3/nLkQUqxmkpAVhSPUllZX8EEGhvVgZQWCU6wcpsqi2mXtnoaBwoqLCufeO9oJYUJQiFZWlZPQCfYiIXkylstTyS1oWWeYWCe6cuLsz7t3r3Ll3du6907oz35bnPM9z/r895zznmWeECf6RCa6fDoBOBExwAp0UmOAB0CmCnRTopECbCZi2nivK1CMD7FpXlH+ydqctKZBz9QyjwkqFG4HzfKK/0gpvl/ulmBWIzAHkVmlRDFY2EihwwLFkRhYQxgzAtHW2CpcBc4CpOsg26eK7yVPYVFwu/9ZzPufq2VLhQBxhAk85lvSF2Y5l/3prjQlAvqR3IjwJTKqz6DeGssQuyLfBsbyjz6PcFgeAZyOwzLFk/QnrjHH/RACYtj6ncHuUCDWYXs7Lz367XEn3inB+1NzauMLGsiW3+u1b2b9lAH22LuiCD2IJED5yTbmiZpt3dAbKT7Hmjhjtdi25oPZnK/uH7dtUCpi2vqVwQ1wRWuHhWkW3StpTEb6IO3fIThhwTemuzWll/0QA5G39FTgrtghhs2vKELA7inra6d38HXvusOEnriWXHo+iFvZvGUDfap3VdYzdzQgIHmd5W7cBc2Ovoax1C3KXZ5/E/i3VgCQciNMD+J1Ug55yXjxo7QfgOdFKCvjyeL/C9MgoEBa5przrt0ti/+C+mRVB/8amrWsU7m2Ql/c5lqwJjre9CDZ1DMFnriXzw0SatvZW4FqBW6o2vwGvCGxyLPmw3rym9g8cwy0XQV8Ix2qEgH0C1ziWNCyceVu1uvZrriVLGqVGsainHO7mRyDynlCvEWupCI7Kxcat6BFg+OwW9ohyfSMIcQF44v/sZovAlRH1I7QVTwyAt1Cjy8hfh9hYvepGQogDoI74HYbSXzHwusTYl7FEAURVcdPWN+NAiAJQTzzCda4p+6N8iDPe1CkQZ8FAtY+E0AhA2uKHszTlT1QkhAHIQnwmAKr1IjQS6gHISnxmABpBCALIUnymAMIgKHxf6wMmH6E3cNTtSLLgZXoKNOgAR6UDyqyq7esKk3znfOriM48AXzc5AmGE1EFgWvXPTMS3DcAJ6TA6XDIT31YAoRCEc5JqcuKc8Kn3AVFO+E4BryvJVHzbI8BzwAdgi2vJ4ihgSY//nyIg8jqctPi2RYBp61wV5qsyR2BFVdhBhBe0wtdisNU15VAagoNrZh4BOVsfFcVCODVUoLBn6E2hIBvShpApgLyt3nvhRXFFCWxwLOmNaz8Wu8wA5G31ntQWNOukwD2OJc80Oy+ufSYAciVdJsJLcZ0K2nV1MbuUk51jnd9oXuoACmW9eHCQj49/T+j3RtiJslPgFxXmoVxe11nhPdeUq8clANPWPoXVQef9D6e1saEHVINHUBYF7Q1lnl2QL5OGkHoE5G19GRhVyBQ+L1tyST0xoa/Iygq3IOvGI4BdwIWjHBeecE15IExM3tYfgJmBOetcU2o9Q2IcsoiAw8Gf0qhyU7kgb4QCcPRTlNGvSspmtzD81J7kJ30AJX0fYeHo2seLjiXLG0TA78CZ/nGFB8uWPJakeG+t9AE4+jjK/XGLWtgTusBix5It4w5ArqRLRTjhl14IW40KD/kre66ki0R4p57IrgozS/2yb9wByDvqhbKX07Xv/oIavMfOP6pFb0pdgcqrbkFuTlp8JingbRIaBfEUHUOYltbtMPUaUNNo2rpeYWk8zSNWqvSmeSvMDIAnybT1boWnY0I4aigL7YJ4bXRqn0wBeCqG7gYVVqFcFapKWXt0gP5nizKQmvLqwpkDqAkaanmhB4MelOkI27XCDjHY7pqyN23htfXbBiArgVH7dABEETrZxzsRcLL/h6P0/Qc1qphfvB2K3wAAAABJRU5ErkJggg=="-->
|
||||||
|
<!-- alt="">-->
|
||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<insert-button v-if="designState" @insertNode="type => emit('insertNode', type)"/>
|
<insert-button v-if="designState" @insertNode="type => emit('insertNode', type)"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <user-picker v-if="selectUser.show" title="请选择系统用户" :multiple="selectUser.multiple" ref="userPicker"-->
|
<!-- <user-picker v-if="selectUser.show" title="请选择系统用户" :multiple="selectUser.multiple" ref="userPicker"-->
|
||||||
<!-- :selected="_userInfo"-->
|
<!-- :selected="_userInfo"-->
|
||||||
<!-- @ok="selectedUser"/>-->
|
<!-- @ok="selectedUser"/>-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -55,18 +61,19 @@
|
|||||||
import InsertButton from '../common/InsertButton.vue'
|
import InsertButton from '../common/InsertButton.vue'
|
||||||
import Ellipsis from '../common/Ellipsis.vue'
|
import Ellipsis from '../common/Ellipsis.vue'
|
||||||
import AvatarEllipsis from '../common/AvatarEllipsis.vue'
|
import AvatarEllipsis from '../common/AvatarEllipsis.vue'
|
||||||
import {defineProps,defineEmits} from "vue";
|
import SvgIcon from '@/components/svgIcon/index.vue'
|
||||||
|
import {Close, Warning, Plus} from '@element-plus/icons-vue'
|
||||||
|
|
||||||
const emit = defineEmits(['insertNode'])
|
const emit = defineEmits(['insertNode'])
|
||||||
import {Close,Warning,Plus} from '@element-plus/icons-vue'
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
//是否为根节点
|
//是否为根节点
|
||||||
isRoot: {
|
isRoot: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
nodeId:{
|
nodeId: {
|
||||||
type:String,
|
type: String,
|
||||||
default:()=>{
|
default: () => {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -144,7 +151,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const designState = computed(()=>{
|
const designState = computed(() => {
|
||||||
return props.mode === 'design'
|
return props.mode === 'design'
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -165,11 +172,19 @@ const init = () => {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
init()
|
// init()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.circle-user{
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid #ACACAC;
|
||||||
|
}
|
||||||
.root {
|
.root {
|
||||||
&:before {
|
&:before {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
@@ -185,19 +200,19 @@ init()
|
|||||||
&:before {
|
&:before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -12px;
|
top: -9px;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
-webkit-transform: translateX(-50%);
|
-webkit-transform: translateX(-50%);
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
width: 0;
|
width: 0;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 8px 6px 4px;
|
border-width: 8px 6px 4px;
|
||||||
border-color: #CACACA transparent transparent;
|
border-color: #000000 transparent transparent;
|
||||||
background: #F5F5F7;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.node-body {
|
.node-body {
|
||||||
cursor: pointer;
|
|
||||||
min-height: 63px;
|
min-height: 63px;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
@@ -216,6 +231,7 @@ init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
.node-body-header {
|
.node-body-header {
|
||||||
|
text-align: center;
|
||||||
border-top-left-radius: 5px;
|
border-top-left-radius: 5px;
|
||||||
border-top-right-radius: 5px;
|
border-top-right-radius: 5px;
|
||||||
padding: 5px 15px;
|
padding: 5px 15px;
|
||||||
@@ -227,13 +243,15 @@ init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
height: 14px;
|
//height: 14px;
|
||||||
width: 150px;
|
//width: 150px;
|
||||||
display: inline-block
|
display: inline-block;
|
||||||
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.node-body-content {
|
.node-body-content {
|
||||||
|
cursor: pointer;
|
||||||
padding: 18px;
|
padding: 18px;
|
||||||
color: #656363;
|
color: #656363;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -243,6 +261,7 @@ init()
|
|||||||
display: flex;
|
display: flex;
|
||||||
//flex: 1;
|
//flex: 1;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<node title="发起人" :is-root="true" :mode="mode" :content="content" show-avatar :user-info="config.props.assignedUser"
|
<node title="发起人" :is-root="true" :mode="mode" :content="content" show-avatar :user-info="config.props.assignedUser"
|
||||||
@selected="emit('selected')" @insertNode="type => emit('insertNode', type)"
|
@selected="emit('selected')" @insertNode="type => emit('insertNode', type)"
|
||||||
placeholder="所有人" :header-bgc="config.props.headerBgc" :header-icon="UserFilled"/>
|
placeholder="所有人" :header-bgc="headerBgc" :header-icon="UserFilled"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import Node from './Node.vue'
|
import Node from './Node.vue'
|
||||||
import {UserFilled} from '@element-plus/icons-vue'
|
import {UserFilled} from '@element-plus/icons-vue'
|
||||||
import {defineExpose, defineProps} from "vue";
|
import {computed, defineExpose, defineProps} from "vue";
|
||||||
const emit = defineEmits(['insertNode','selected'])
|
const emit = defineEmits(['insertNode','selected'])
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -34,6 +34,14 @@ const content = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const headerBgc = computed(() => {
|
||||||
|
if (props.mode === 'design' || props.mode === 'view') {
|
||||||
|
return '#2E7CF0'
|
||||||
|
} else {
|
||||||
|
return props.config.props.headerBgc
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
console.log("调用成功")
|
console.log("调用成功")
|
||||||
|
|||||||
@@ -31,12 +31,11 @@ const preview = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const headerBgc = computed(() => {
|
const headerBgc = computed(() => {
|
||||||
return '#47bc82'
|
if (props.mode === 'design' || props.mode === 'view') {
|
||||||
// if (preview || !viewer) {
|
return '#BE2EF0'
|
||||||
// return '#ff943e'
|
} else {
|
||||||
// } else {
|
return props.config.props.headerBgc
|
||||||
// return props.config.props.headerBgc
|
}
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
const content = computed(() => {
|
const content = computed(() => {
|
||||||
return '请设置触发器'
|
return '请设置触发器'
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import {useProcessStore} from '@/stores/processStore.js'
|
|||||||
import Paging from "@/components/pagination/index.vue";
|
import Paging from "@/components/pagination/index.vue";
|
||||||
import {useCacheStore} from '@/stores/cache.js'
|
import {useCacheStore} from '@/stores/cache.js'
|
||||||
import PointTag from "@/components/PointTag.vue";
|
import PointTag from "@/components/PointTag.vue";
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
const dictStore = useCacheStore()
|
const dictStore = useCacheStore()
|
||||||
@@ -100,9 +101,15 @@ const getList = async () => {
|
|||||||
}
|
}
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getTaskList(params).then(res => {
|
getTaskList(params).then(res => {
|
||||||
list.value = res.data.rows
|
if (res.code === 1000) {
|
||||||
total.value = res.data.total
|
list.value = res.data.rows
|
||||||
|
total.value = res.data.total
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg)
|
||||||
|
}
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
}).catch(err => {
|
||||||
|
loading.value = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,21 +69,21 @@ export default defineConfig({
|
|||||||
strictPort: false,
|
strictPort: false,
|
||||||
open: true,
|
open: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api/admin': {
|
// '/api/admin': {
|
||||||
target: 'http://dev-mosr.frp.feashow.cn/',
|
// target: 'http://dev-mosr.frp.feashow.cn/',
|
||||||
// target: 'http://192.168.31.175:8000',
|
// // target: 'http://192.168.31.175:8000',
|
||||||
changeOrigin: true,
|
// changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, '')
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
},
|
// },
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://mosr.feashow.cn',
|
target: 'http://mosr.feashow.cn',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
'/api/notice-ws': {
|
// '/api/notice-ws': {
|
||||||
target: 'ws://mosr.feashow.cn/api/notice-ws',
|
// target: 'ws://mosr.feashow.cn/api/notice-ws',
|
||||||
ws: true,
|
// ws: true,
|
||||||
changeOrigin: true,
|
// changeOrigin: true,
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user