mirror of
https://gitee.com/vben/vben-web.git
synced 2026-10-06 14:13:10 +08:00
~~
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class='tree-h-right'>
|
||||
<el-dropdown @command='handleCommand'>
|
||||
<el-button style='margin-left: 10px;width: 30px'>
|
||||
<el-button style='margin-left: 8px;width: 30px'>
|
||||
<el-icon class='el-icon--right'>
|
||||
<more-filled />
|
||||
</el-icon>
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, watch } from 'vue';
|
||||
import { defineExpose, onMounted, reactive, ref, watch } from 'vue';
|
||||
import type { ElTree } from 'element-plus';
|
||||
import { Search, MoreFilled } from '@element-plus/icons-vue';
|
||||
import request from '/@/utils/request';
|
||||
|
||||
const props = defineProps({
|
||||
url: String,
|
||||
maInit: Boolean,
|
||||
});
|
||||
|
||||
|
||||
@@ -106,10 +107,18 @@ const nodeClick = (node:any) => {
|
||||
emits('node-click', { id: node.id, name: node.name });
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
initTreeData();
|
||||
if(props.maInit==false){
|
||||
initTreeData();
|
||||
}
|
||||
});
|
||||
|
||||
const init = async () => {
|
||||
await initTreeData();
|
||||
};
|
||||
defineExpose({ init });
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.tree-h-flex {
|
||||
|
||||
+6
-10
@@ -111,22 +111,17 @@ export const treeItemDelete = async (state: any, id: string) => {
|
||||
};
|
||||
|
||||
|
||||
export const tabAdd = (url: string) => {
|
||||
router.push({
|
||||
path: url + '/edit',
|
||||
query: { uuid: uuid() },
|
||||
});
|
||||
};
|
||||
|
||||
export const tabAddx = (data:any) => {
|
||||
export const tabAdd = (url: string,data:any) => {
|
||||
if(!data){
|
||||
data = {};
|
||||
}
|
||||
data.uuid=uuid();
|
||||
router.push({
|
||||
path: data.url + '/edit',
|
||||
path: url + '/edit',
|
||||
query: data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const tabEdit = (url: string, id: string) => {
|
||||
router.push({
|
||||
path: url + '/edit',
|
||||
@@ -150,6 +145,7 @@ export const pageAdd = (url: string) => {
|
||||
window.open(import.meta.env.VITE_PUBLIC_PATH + '#/page/' + url);
|
||||
};
|
||||
|
||||
|
||||
export const pageEdit = (url: string) => {
|
||||
window.open(import.meta.env.VITE_PUBLIC_PATH + '#/page/' + url);
|
||||
};
|
||||
|
||||
+10
-10
@@ -432,17 +432,17 @@ const clearAndcloseModal = () => {
|
||||
}
|
||||
|
||||
/*最近*/
|
||||
.z-org-recently li {
|
||||
width: 33%;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
padding: 5px;
|
||||
list-style-type: none;
|
||||
}
|
||||
/*.z-org-recently li {*/
|
||||
/* width: 33%;*/
|
||||
/* float: left;*/
|
||||
/* cursor: pointer;*/
|
||||
/* padding: 5px;*/
|
||||
/* list-style-type: none;*/
|
||||
/*}*/
|
||||
|
||||
.z-org-recently li:hover {
|
||||
background-color: #f7efec;
|
||||
}
|
||||
/*.z-org-recently li:hover {*/
|
||||
/* background-color: #f7efec;*/
|
||||
/*}*/
|
||||
|
||||
/*搜索查询*/
|
||||
.z-org-search li {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<el-table-column label='备注' prop='notes' />
|
||||
<el-table-column label='操作' width='114' header-align='center' align="right">
|
||||
<template #default="scope">
|
||||
<el-icon @click='tabAddx({url:state.url,pid:scope.row.id,pname:scope.row.name})' style="cursor: pointer;font-size: 18px;top:2px;margin-left: 10px;color: #52C41A"><circle-plus/></el-icon>
|
||||
<el-icon @click='tabAdd(state.url,{pid:scope.row.id,pname:scope.row.name})' style="cursor: pointer;font-size: 18px;top:2px;margin-left: 10px;color: #52C41A"><circle-plus/></el-icon>
|
||||
<el-icon @click='tabEdit(state.url,scope.row.id)' style="cursor: pointer;font-size: 18px;top:2px;margin-left: 11px;color: #2874C5"><edit/></el-icon>
|
||||
<el-icon @click='treeItemDelete(state,scope.row.id)' style="cursor: pointer;font-size: 18px;top:2px;margin-left: 10px;color: #ED6F6F"><delete/></el-icon>
|
||||
</template>
|
||||
@@ -41,7 +41,7 @@
|
||||
<script lang='ts' setup>
|
||||
import { Plus, Delete,Edit,CirclePlus } from '@element-plus/icons-vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { treeDelete,treeItemDelete,treeSelect,treeQuery,tabAdd,tabAddx,tabEdit} from '/@/comps/page/index';
|
||||
import { treeDelete,treeItemDelete,treeSelect,treeQuery,tabAdd,tabEdit} from '/@/comps/page/index';
|
||||
|
||||
const state = reactive({
|
||||
url: '/oa/flow/cate', loading: true, ids: [],
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<el-dialog v-model='state.isShow' title='流程模板选择' width='800px' draggable>
|
||||
<div style='height: 440px'>
|
||||
<el-tabs v-model='activeName' type='card' @tab-click='tabChange'>
|
||||
<el-tab-pane label='快捷选择' name='k1'>
|
||||
<div>
|
||||
<el-input v-model='state.receSearch' placeholder='请输入关键字查询' style='width: 200px;' @keyup.enter='onSearch' />
|
||||
<el-button type='primary' style='margin-left: 10px' @click='onSearch'>查询</el-button>
|
||||
<span style='color:green;margin-left: 10px'>快捷选择这里默认会展示最近使用过的流程模板,也可模糊搜索所有的模板</span>
|
||||
</div>
|
||||
<div style='margin-top: 5px;overflow: auto;height:353px;border: 1px solid #ccc'>
|
||||
<ul class='z-flow-search' style='padding: 2px'>
|
||||
<li v-for='item in receItems' :key='item.id' class='f-flow' @click='receItemClick(item)'>
|
||||
<el-checkbox v-model='item.checked' />
|
||||
<img src='https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1813762643,1914315241&fm=26&gp=0.jpg'>
|
||||
<span class='layui-elip f-flow-name'>{{ item.name }}</span>
|
||||
<span class='layui-elip f-flow-cate'>{{ item.catna }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='按分类选择' name='k2'>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<div style='height: 390px;'>
|
||||
<CateTree :maInit='true' @node-click='nodeClick' url='/oa/flow/cate/tree' ref='cateTreeRef' />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<div style='border: 1px solid #ccc;height: 390px;margin-left: 5px;overflow: auto'>
|
||||
<ul class='z-cate-tree'>
|
||||
<li v-for='item in tierItems' :key='item.id' class='f-flow' title='444444444' @click='tierItemClick(item)'>
|
||||
<el-checkbox v-model='item.checked' />
|
||||
<img src='https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1813762643,1914315241&fm=26&gp=0.jpg'>
|
||||
<span class='layui-elip f-flow-name'>{{ item.name }}</span>
|
||||
<span class='layui-elip f-flow-cate'>{{ item.catna }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='我的收藏' name='k3'>暂不支持,待开发</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class='dialog-footer'>
|
||||
<el-button type='primary' @click='closeModal'>确认</el-button>
|
||||
<el-button @click='state.isShow = false'>取消</el-button>
|
||||
<el-button @click='clearAndcloseModal' style='margin-left: 20px'>清空选择</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { defineExpose, reactive, ref, toRaw, toRefs } from 'vue';
|
||||
import request from '/@/utils/request';
|
||||
import CateTree from '/@/comps/gen/GenTree.vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
let p_flow_type = -1;//
|
||||
let p_tab_key = 'k1';
|
||||
let p_tier_init_flag = false;//层级架构页签初始化标记
|
||||
|
||||
const cateTreeRef = ref();
|
||||
|
||||
const state = reactive({
|
||||
isShow: false,
|
||||
receSearch: '' as string,
|
||||
receItems: [] as any,
|
||||
tierItems: [] as any,
|
||||
seldItem:null,
|
||||
});
|
||||
|
||||
const { receItems, tierItems,seldItem } = toRefs(state);
|
||||
|
||||
const activeName = ref('k1');
|
||||
|
||||
//region z Tab切换
|
||||
async function tabChange(tab: any) {
|
||||
p_tab_key = tab.paneName;
|
||||
if (p_tab_key === 'k2') {
|
||||
if (!p_tier_init_flag) {
|
||||
await cateTreeRef.value.init();
|
||||
p_tier_init_flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
|
||||
//region x.1 最近使用
|
||||
|
||||
async function onSearch() {
|
||||
receItems.value = await request({
|
||||
url: '/oa/flow/temp/list?type=' + p_flow_type,
|
||||
method: 'get',
|
||||
params: { name: state.receSearch },
|
||||
});
|
||||
for (const rItem of receItems.value) {
|
||||
let flag = false;
|
||||
if (!flag) {
|
||||
rItem.checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const receInit = async () => {
|
||||
receItems.value = await request({
|
||||
url: '/gen/org/rece?type=' + p_flow_type,
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
|
||||
function receItemClick(item: any) {
|
||||
item.checked = !item.checked;
|
||||
if(item.checked==true){
|
||||
seldItem.value=item;
|
||||
}else{
|
||||
seldItem.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
|
||||
//region x.2 层级架构
|
||||
|
||||
async function nodeClick(node: any) {
|
||||
if (node && node.id) {
|
||||
tierItems.value = await request({
|
||||
url: '/oa/flow/temp/list?type=' + p_flow_type,
|
||||
method: 'get',
|
||||
params: { catid: node.id },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function tierItemClick(item: any) {
|
||||
item.checked = !item.checked;
|
||||
if(item.checked==true){
|
||||
seldItem.value=item;
|
||||
}else{
|
||||
seldItem.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region x.3 常用群组
|
||||
|
||||
//endregion
|
||||
|
||||
//region x.4 我的收藏
|
||||
|
||||
//endregion
|
||||
|
||||
|
||||
|
||||
//region 与父组件的交互逻辑
|
||||
const openModal = async () => {
|
||||
state.isShow = true;
|
||||
};
|
||||
|
||||
defineExpose({ openModal });
|
||||
|
||||
const emits = defineEmits(['close']);
|
||||
const closeModal = () => {
|
||||
if(seldItem.value==null){
|
||||
ElMessage.warning('请选择一个流程模板再发起流程');
|
||||
return false;
|
||||
}
|
||||
const rawSeldItem = toRaw(seldItem.value) as any;
|
||||
// if (rawSeldItem && rawSeldItem.id) {
|
||||
// //更新后台数据库最近使用的TEMPS
|
||||
// request({
|
||||
// url: '/gen/org/rece',
|
||||
// method: 'post',
|
||||
// data: rawSeldItem,
|
||||
// });
|
||||
// }
|
||||
emits('close', rawSeldItem);
|
||||
state.isShow = false;
|
||||
};
|
||||
|
||||
const clearAndcloseModal = () => {
|
||||
emits('close', null);
|
||||
state.isShow = false;
|
||||
};
|
||||
|
||||
//endregion
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-footer button:first-child {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.layui-elip {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
.f-flow:before,
|
||||
.f-flow:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.f-flow:after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.f-flow input, .f-flow label {
|
||||
float: left;
|
||||
margin-top: 10px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.f-flow img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
float: left;
|
||||
border-radius: 100%;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
|
||||
.f-flow .f-flow-name,
|
||||
.f-flow .f-flow-cate {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.f-flow .f-flow-name {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.f-flow .f-flow-cate {
|
||||
color: #a599b2;
|
||||
}
|
||||
|
||||
/*最近*/
|
||||
|
||||
|
||||
/*搜索查询*/
|
||||
.z-flow-search li {
|
||||
/*width: 280px;*/
|
||||
width: 50%;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
padding: 2px;
|
||||
list-style-type: none;
|
||||
/*margin: 3px;*/
|
||||
}
|
||||
|
||||
.z-flow-search li:hover {
|
||||
background-color: #f7efec;
|
||||
}
|
||||
|
||||
/*流程分类树*/
|
||||
.z-cate-tree li {
|
||||
margin: 3px;
|
||||
cursor: pointer;
|
||||
padding: 3px;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.z-cate-tree li:hover {
|
||||
background-color: #f7efec;
|
||||
}
|
||||
</style>
|
||||
@@ -9,7 +9,7 @@
|
||||
<el-button class='more-button' :icon='state.moreParams?ArrowUp:ArrowDown' plain @click='state.moreParams=!state.moreParams'>更多</el-button>
|
||||
</el-col>
|
||||
<el-col :span='10' style='text-align: right'>
|
||||
<el-button type='success' :icon='Plus' @click='openTempModal()' plain>新增</el-button>
|
||||
<el-button type='success' :icon='Plus' @click='openFlowModal()' plain>新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' :disabled='state.multiple' @click='listDelete(state)' plain>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -25,8 +25,8 @@
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TempModal url='oa/flow/temp/tree' ref='tempModal' @close='tempModalClose'/>
|
||||
<FlowModal ref='flowModalRef' @close='closeFlowModal'/>
|
||||
<TempModal url='oa/flow/temp/tree' ref='tempModal' />
|
||||
|
||||
<el-table height='400' :cell-style="{padding:'2px'}" :row-style="{height: '36px'}" v-loading='state.loading' :data='state.list'
|
||||
border stripe @selection-change='listSelect($event,state)'>
|
||||
@@ -60,7 +60,7 @@ import { Plus, Delete,ArrowDown, ArrowUp } from '@element-plus/icons-vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { listQuery, listDelete, listSelect,pageView} from '/@/comps/page/index';
|
||||
import TempModal from '/@/comps/gen/GenModal.vue';
|
||||
import {ElMessage} from "element-plus";
|
||||
import FlowModal from './FlowModal.vue';
|
||||
|
||||
const state = reactive({
|
||||
url: '/oa/flow/main', loading: true, ids: [], moreParams: false,
|
||||
@@ -69,22 +69,32 @@ const state = reactive({
|
||||
|
||||
onMounted(() => {
|
||||
listQuery(state);
|
||||
console.log(111);
|
||||
});
|
||||
|
||||
|
||||
|
||||
//分类弹框逻辑
|
||||
const tempModal = ref();
|
||||
const openTempModal = () => {
|
||||
tempModal.value.openModal();
|
||||
// const tempModal = ref();
|
||||
// const openTempModal = () => {
|
||||
// tempModal.value.openModal();
|
||||
// };
|
||||
// const tempModalClose=(node:any)=>{
|
||||
// if(node.type=="temp"){
|
||||
// window.open("#/page/ofme?temid="+node.id);
|
||||
// }else if(node.type=="cate"){
|
||||
// ElMessage.info("当前选择的是流程分类,请选择最下级的流程模板节点,比如请假申请");
|
||||
// }
|
||||
// }
|
||||
|
||||
//弹框逻辑
|
||||
const flowModalRef = ref();
|
||||
const openFlowModal = () => {
|
||||
flowModalRef.value.openModal();
|
||||
};
|
||||
const tempModalClose=(node:any)=>{
|
||||
if(node.type=="temp"){
|
||||
window.open("#/page/ofme?temid="+node.id);
|
||||
}else if(node.type=="cate"){
|
||||
ElMessage.info("当前选择的是流程分类,请选择最下级的流程模板节点,比如请假申请");
|
||||
}
|
||||
const closeFlowModal=(node:any)=>{
|
||||
if(node&&node.id){
|
||||
window.open("#/page/ofme?temid="+node.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB |
+345
-331
@@ -1,377 +1,391 @@
|
||||
<template>
|
||||
|
||||
<el-card class='box-card' :body-style="{padding:'2px 8px'}" shadow='never'>
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span='10'>
|
||||
<div style='line-height: 32px'>流程模板</div>
|
||||
</el-col>
|
||||
<el-col :span='14' style='text-align: right'>
|
||||
<el-button type='success' @click='save(state)' plain>保 存</el-button>
|
||||
<el-button type='info' plain>复 制</el-button>
|
||||
<el-button type='info' @click='pageClose' plain>关 闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<CateModal url='oa/flow/cate/tree' ref='cateModal' @close='cateChoose'/>
|
||||
<div style='margin-top: 8px;margin-bottom: 8px'>
|
||||
<el-form ref="formRef" :model='form' label-width='140px'>
|
||||
<el-tabs type='card' v-model='activeName'>
|
||||
<el-tab-pane label='基本信息' name='tab1' class='zform'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='模板名称:' prop='name' :rules="[{ required: true, message: '名称不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.name'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='所属分类:' prop='cate' :rules="[{ required: true, message: '分类不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input :value='form.cate?.name' :suffix-icon='Search' :readonly='true' @click='openCateModal'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='排序号:'>
|
||||
<div class='zinput'>
|
||||
<el-input-number v-model='form.ornum' controls-position='right' style='width: 100%'/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='是否可用:'>
|
||||
<div class='zinput'>
|
||||
<el-switch v-model='form.avtag'>
|
||||
</el-switch>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-card class='box-card' :body-style="{padding:'2px 8px'}" shadow='never'>
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span='10'>
|
||||
<div style='line-height: 32px'>流程模板</div>
|
||||
</el-col>
|
||||
<el-col :span='14' style='text-align: right'>
|
||||
<el-button type='success' @click='save(state)' plain>保 存</el-button>
|
||||
<el-button type='info' plain>复 制</el-button>
|
||||
<el-button type='info' @click='pageClose' plain>关 闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<CateModal url='oa/flow/cate/tree' ref='cateModal' @close='cateChoose' />
|
||||
<div style='margin-top: 8px;margin-bottom: 8px'>
|
||||
<el-form ref='formRef' :model='form' label-width='140px'>
|
||||
<el-tabs type='card' v-model='activeName'>
|
||||
<el-tab-pane label='基本信息' name='tab1' class='zform'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='模板名称:' prop='name' :rules="[{ required: true, message: '名称不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.name'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='所属分类:' prop='cate' :rules="[{ required: true, message: '分类不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input :value='form.cate?.name' :suffix-icon='Search' :readonly='true' @click='openCateModal'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='排序号:'>
|
||||
<div class='zinput'>
|
||||
<el-input-number v-model='form.ornum' controls-position='right' style='width: 100%' />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='是否可用:'>
|
||||
<div class='zinput'>
|
||||
<el-switch v-model='form.avtag'>
|
||||
</el-switch>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label='审批内容' name='tab2'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<v-form-designer ref='vform'/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='审批内容' name='tab2'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<v-form-designer ref='vform' />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label='流程配置' name='tab3'>
|
||||
<div style='width: 100%;height: 720px'>
|
||||
<!-- <Modeler2 @bpmnMounted='bpmnMounted' />-->
|
||||
<Modeler @bpmnMounted='bpmnMounted'/>
|
||||
<Panel/>
|
||||
<BpmnActions/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='流程配置' name='tab3'>
|
||||
<div style='width: 100%;height: 720px'>
|
||||
<!-- <Modeler2 @bpmnMounted='bpmnMounted' />-->
|
||||
<Modeler @bpmnMounted='bpmnMounted' />
|
||||
<Panel />
|
||||
<BpmnActions />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label='权限配置' name='tab4' class='zform'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label='备注:'>
|
||||
<div class='zinput' style='height: auto'>
|
||||
<el-input style="font-family: 'Courier New', Helvetica, Arial, sans-serif; font-size:16px"
|
||||
type='textarea' :rows='4'
|
||||
v-model='form.notes'>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='权限配置' name='tab4' class='zform'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label='备注:'>
|
||||
<div class='zinput' style='height: auto'>
|
||||
<el-input style="font-family: 'Courier New', Helvetica, Arial, sans-serif; font-size:16px"
|
||||
type='textarea' :rows='4'
|
||||
v-model='form.notes'>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label='其他信息' name='tab9' class='zform'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label='备注:'>
|
||||
<div class='zinput' style='height: auto'>
|
||||
<el-input style="font-family: 'Courier New', Helvetica, Arial, sans-serif; font-size:16px"
|
||||
type='textarea' :rows='4'
|
||||
v-model='form.notes'>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-show='form.crtim'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='创建人:'>
|
||||
<div class='zinput'>
|
||||
{{ form.crman ? form.crman.name : '' }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='创建时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.crtim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='更新人:'>
|
||||
<div class='zinput'>
|
||||
{{ form.upman ? form.upman.name : '' }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='更新时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.uptim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-tab-pane label='其他信息' name='tab9' class='zform'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label='备注:'>
|
||||
<div class='zinput' style='height: auto'>
|
||||
<el-input style="font-family: 'Courier New', Helvetica, Arial, sans-serif; font-size:16px"
|
||||
type='textarea' :rows='4'
|
||||
v-model='form.notes'>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-show='form.crtim'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='创建人:'>
|
||||
<div class='zinput'>
|
||||
{{ form.crman ? form.crman.name : '' }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='创建时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.crtim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='更新人:'>
|
||||
<div class='zinput'>
|
||||
{{ form.upman ? form.upman.name : '' }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='更新时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.uptim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
<script lang='ts'>
|
||||
export default {name: 'oaFlowTempEdit'};
|
||||
export default { name: 'oaFlowTempEdit' };
|
||||
</script>
|
||||
<script lang='ts' setup>
|
||||
import {onMounted, reactive, ref, toRefs} from 'vue';
|
||||
import {editInit, pageSave, pageClose} from '/@/comps/page/edit';
|
||||
import {useRoute} from 'vue-router';
|
||||
import { onMounted, reactive, ref, toRefs } from 'vue';
|
||||
import { editInit, pageSave, pageClose } from '/@/comps/page/edit';
|
||||
import { useRoute } from 'vue-router';
|
||||
import Modeler from '/@/comps/Activiti/Modeler';
|
||||
import Panel from '/@/comps/Activiti/panel';
|
||||
import BpmnActions from '/@/comps/Activiti/bpmn-actions';
|
||||
import {BpmnStore} from '/@/bpmn/store';
|
||||
import {NextLoading} from "/@/utils/loading";
|
||||
import { BpmnStore } from '/@/bpmn/store';
|
||||
import { NextLoading } from '/@/utils/loading';
|
||||
import CateModal from '/@/comps/gen/GenModal.vue';
|
||||
import {FormInstance} from "element-plus";
|
||||
import { FormInstance } from 'element-plus';
|
||||
import request from '/@/utils/request';
|
||||
|
||||
const route = useRoute();
|
||||
const formRef = ref<FormInstance>();
|
||||
const activeName = ref('tab1');
|
||||
|
||||
const state = reactive({
|
||||
url: '/oa/flow/temp',
|
||||
params: {path: '', query: ''},
|
||||
form: {avtag: true} as any,
|
||||
url: '/oa/flow/temp',
|
||||
params: { path: '', query: {} as any},
|
||||
form: { avtag: true } as any,
|
||||
});
|
||||
|
||||
const {form} = toRefs(state);
|
||||
|
||||
const { form } = toRefs(state);
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
NextLoading.done();
|
||||
await editInit(state, route);
|
||||
if (form.value.id) {
|
||||
await BpmnStore.importXML(form.value.prxml);
|
||||
} else {
|
||||
await BpmnStore.importXML(defxml);
|
||||
}
|
||||
NextLoading.done();
|
||||
state.params = <any>route;
|
||||
let id = state.params.query?.id;
|
||||
if (id) {
|
||||
state.form = await request({
|
||||
url: state.url + '/one/' + id,
|
||||
method: 'get',
|
||||
});
|
||||
} else {
|
||||
let catid = state.params.query?.catid;
|
||||
if (catid) {
|
||||
state.form.cate = { id: catid, name: state.params.query?.catna };
|
||||
}
|
||||
state.form.avtag = true;
|
||||
}
|
||||
|
||||
if (form.value.id) {
|
||||
await BpmnStore.importXML(form.value.prxml);
|
||||
} else {
|
||||
await BpmnStore.importXML(defxml);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
async function save(state: any) {
|
||||
|
||||
const bpmn = await BpmnStore.getXML();
|
||||
// console.log(typeof (bpmn.xml));
|
||||
// xFlow.value.getData();
|
||||
form.value.vform = JSON.stringify(vform.value.getFormJson());
|
||||
form.value.prxml = bpmn.xml;
|
||||
console.log(bpmn.xml);
|
||||
await pageSave(formRef.value,state);
|
||||
const bpmn = await BpmnStore.getXML();
|
||||
// console.log(typeof (bpmn.xml));
|
||||
// xFlow.value.getData();
|
||||
form.value.vform = JSON.stringify(vform.value.getFormJson());
|
||||
form.value.prxml = bpmn.xml;
|
||||
console.log(bpmn.xml);
|
||||
await pageSave(formRef.value, state);
|
||||
}
|
||||
|
||||
const vform = ref();
|
||||
|
||||
|
||||
const defxml = '<?xml version="1.0" encoding="UTF-8"?>\n' +
|
||||
'<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:activiti="http://activiti.org/bpmn" id="sample-diagram" targetNamespace="http://activiti.org/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">\n' +
|
||||
' <bpmn2:process id="Process_1" name="1" isExecutable="true">\n' +
|
||||
' <bpmn2:startEvent id="N1" name="开始节点">\n' +
|
||||
' <bpmn2:outgoing>L1</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:startEvent>\n' +
|
||||
' <bpmn2:sequenceFlow id="L1" sourceRef="N1" targetRef="N2" />\n' +
|
||||
' <bpmn2:exclusiveGateway id="N9" name="条件分支">\n' +
|
||||
' <bpmn2:documentation>判断审批金额是否大于100</bpmn2:documentation>\n' +
|
||||
' <bpmn2:incoming>L4</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L6</bpmn2:outgoing>\n' +
|
||||
' <bpmn2:outgoing>L5</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:exclusiveGateway>\n' +
|
||||
' <bpmn2:sequenceFlow id="L4" sourceRef="N4" targetRef="N9" />\n' +
|
||||
' <bpmn2:sequenceFlow id="L6" name="王五分支线" sourceRef="N9" targetRef="N6">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:executionListener expression="money<=100" event="take" />\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' </bpmn2:sequenceFlow>\n' +
|
||||
' <bpmn2:sequenceFlow id="L5" name="李四分支线" sourceRef="N9" targetRef="N5">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:executionListener expression="money>100" event="take" />\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' </bpmn2:sequenceFlow>\n' +
|
||||
' <bpmn2:sequenceFlow id="L7" sourceRef="N5" targetRef="N7" />\n' +
|
||||
' <bpmn2:sequenceFlow id="L8" sourceRef="N6" targetRef="N7" />\n' +
|
||||
' <bpmn2:endEvent id="N3" name="结束节点">\n' +
|
||||
' <bpmn2:incoming>L2</bpmn2:incoming>\n' +
|
||||
' </bpmn2:endEvent>\n' +
|
||||
' <bpmn2:sequenceFlow id="L2" sourceRef="N7" targetRef="N3" />\n' +
|
||||
' <bpmn2:sequenceFlow id="L3" sourceRef="N2" targetRef="N4" />\n' +
|
||||
' <bpmn2:userTask id="N2" name="起草节点" activiti:assignee="z3" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:documentation>起草节点,表单数据一般从绑定的表单提取</bpmn2:documentation>\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:formProperty id="userid" type="string" />\n' +
|
||||
' <activiti:formProperty id="money" type="int" />\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="编辑" value="edit" />\n' +
|
||||
' <activiti:property name="撤回" value="back" />\n' +
|
||||
' <activiti:property name="提交" value="commit" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L1</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L3</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' <bpmn2:userTask id="N4" name="张三审批" activiti:assignee="z3" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:documentation>审批节点</bpmn2:documentation>\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="审批" value="approve" />\n' +
|
||||
' <activiti:property name="驳回" value="reject" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L3</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L4</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' <bpmn2:userTask id="N5" name="李四审批" activiti:assignee="l4" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="审批" value="approve" />\n' +
|
||||
' <activiti:property name="驳回" value="reject" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L5</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L7</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' <bpmn2:userTask id="N6" name="王五审批" activiti:assignee="w5" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="审批" value="approve" />\n' +
|
||||
' <activiti:property name="驳回" value="reject" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L6</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L8</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' <bpmn2:userTask id="N7" name="赵六审批" activiti:assignee="zhao6" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:formProperty id="userid" type="string" />\n' +
|
||||
' <activiti:taskListener class="do some thing" event="complete" />\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="审批" value="approve" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L7</bpmn2:incoming>\n' +
|
||||
' <bpmn2:incoming>L8</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L2</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' </bpmn2:process>\n' +
|
||||
' <bpmndi:BPMNDiagram id="BPMNDiagram_1">\n' +
|
||||
' <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_0uh8wmt_di" bpmnElement="L3">\n' +
|
||||
' <di:waypoint x="560" y="200" />\n' +
|
||||
' <di:waypoint x="560" y="250" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_01hb865_di" bpmnElement="L2">\n' +
|
||||
' <di:waypoint x="560" y="670" />\n' +
|
||||
' <di:waypoint x="560" y="732" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_1t81399_di" bpmnElement="L8">\n' +
|
||||
' <di:waypoint x="690" y="550" />\n' +
|
||||
' <di:waypoint x="690" y="630" />\n' +
|
||||
' <di:waypoint x="610" y="630" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_00vdr2t_di" bpmnElement="L7">\n' +
|
||||
' <di:waypoint x="430" y="550" />\n' +
|
||||
' <di:waypoint x="430" y="630" />\n' +
|
||||
' <di:waypoint x="510" y="630" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_1bnjbaa_di" bpmnElement="L5">\n' +
|
||||
' <di:waypoint x="535" y="400" />\n' +
|
||||
' <di:waypoint x="430" y="400" />\n' +
|
||||
' <di:waypoint x="430" y="470" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="456" y="382" width="55" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_12ug1tp_di" bpmnElement="L6">\n' +
|
||||
' <di:waypoint x="585" y="400" />\n' +
|
||||
' <di:waypoint x="690" y="400" />\n' +
|
||||
' <di:waypoint x="690" y="470" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="611" y="382" width="56" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_1miguqf_di" bpmnElement="L4">\n' +
|
||||
' <di:waypoint x="560" y="330" />\n' +
|
||||
' <di:waypoint x="560" y="375" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_1u6pmzo_di" bpmnElement="L1">\n' +
|
||||
' <di:waypoint x="560" y="68" />\n' +
|
||||
' <di:waypoint x="560" y="120" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNShape id="Event_0byql27_di" bpmnElement="N1">\n' +
|
||||
' <dc:Bounds x="542" y="32" width="36" height="36" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="539" y="2" width="43" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Gateway_0qd58o6_di" bpmnElement="N9" isMarkerVisible="true">\n' +
|
||||
' <dc:Bounds x="535" y="375" width="50" height="50" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="538" y="432" width="44" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Event_1h4oob7_di" bpmnElement="N3">\n' +
|
||||
' <dc:Bounds x="542" y="732" width="36" height="36" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="539" y="775" width="43" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_0g48n8q_di" bpmnElement="N2">\n' +
|
||||
' <dc:Bounds x="510" y="120" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_04wpn1b_di" bpmnElement="N4">\n' +
|
||||
' <dc:Bounds x="510" y="250" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_0j8meci_di" bpmnElement="N5">\n' +
|
||||
' <dc:Bounds x="380" y="470" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_0pa1f64_di" bpmnElement="N6">\n' +
|
||||
' <dc:Bounds x="640" y="470" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_0qmb4lo_di" bpmnElement="N7">\n' +
|
||||
' <dc:Bounds x="510" y="590" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' </bpmndi:BPMNPlane>\n' +
|
||||
' </bpmndi:BPMNDiagram>\n' +
|
||||
'</bpmn2:definitions>\n';
|
||||
'<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:activiti="http://activiti.org/bpmn" id="sample-diagram" targetNamespace="http://activiti.org/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">\n' +
|
||||
' <bpmn2:process id="Process_1" name="1" isExecutable="true">\n' +
|
||||
' <bpmn2:startEvent id="N1" name="开始节点">\n' +
|
||||
' <bpmn2:outgoing>L1</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:startEvent>\n' +
|
||||
' <bpmn2:sequenceFlow id="L1" sourceRef="N1" targetRef="N2" />\n' +
|
||||
' <bpmn2:exclusiveGateway id="N9" name="条件分支">\n' +
|
||||
' <bpmn2:documentation>判断审批金额是否大于100</bpmn2:documentation>\n' +
|
||||
' <bpmn2:incoming>L4</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L6</bpmn2:outgoing>\n' +
|
||||
' <bpmn2:outgoing>L5</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:exclusiveGateway>\n' +
|
||||
' <bpmn2:sequenceFlow id="L4" sourceRef="N4" targetRef="N9" />\n' +
|
||||
' <bpmn2:sequenceFlow id="L6" name="王五分支线" sourceRef="N9" targetRef="N6">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:executionListener expression="money<=100" event="take" />\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' </bpmn2:sequenceFlow>\n' +
|
||||
' <bpmn2:sequenceFlow id="L5" name="李四分支线" sourceRef="N9" targetRef="N5">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:executionListener expression="money>100" event="take" />\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' </bpmn2:sequenceFlow>\n' +
|
||||
' <bpmn2:sequenceFlow id="L7" sourceRef="N5" targetRef="N7" />\n' +
|
||||
' <bpmn2:sequenceFlow id="L8" sourceRef="N6" targetRef="N7" />\n' +
|
||||
' <bpmn2:endEvent id="N3" name="结束节点">\n' +
|
||||
' <bpmn2:incoming>L2</bpmn2:incoming>\n' +
|
||||
' </bpmn2:endEvent>\n' +
|
||||
' <bpmn2:sequenceFlow id="L2" sourceRef="N7" targetRef="N3" />\n' +
|
||||
' <bpmn2:sequenceFlow id="L3" sourceRef="N2" targetRef="N4" />\n' +
|
||||
' <bpmn2:userTask id="N2" name="起草节点" activiti:assignee="z3" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:documentation>起草节点,表单数据一般从绑定的表单提取</bpmn2:documentation>\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:formProperty id="userid" type="string" />\n' +
|
||||
' <activiti:formProperty id="money" type="int" />\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="编辑" value="edit" />\n' +
|
||||
' <activiti:property name="撤回" value="back" />\n' +
|
||||
' <activiti:property name="提交" value="commit" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L1</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L3</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' <bpmn2:userTask id="N4" name="张三审批" activiti:assignee="z3" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:documentation>审批节点</bpmn2:documentation>\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="审批" value="approve" />\n' +
|
||||
' <activiti:property name="驳回" value="reject" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L3</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L4</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' <bpmn2:userTask id="N5" name="李四审批" activiti:assignee="l4" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="审批" value="approve" />\n' +
|
||||
' <activiti:property name="驳回" value="reject" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L5</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L7</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' <bpmn2:userTask id="N6" name="王五审批" activiti:assignee="w5" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="审批" value="approve" />\n' +
|
||||
' <activiti:property name="驳回" value="reject" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L6</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L8</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' <bpmn2:userTask id="N7" name="赵六审批" activiti:assignee="zhao6" activiti:candidateUsers="">\n' +
|
||||
' <bpmn2:extensionElements>\n' +
|
||||
' <activiti:formProperty id="userid" type="string" />\n' +
|
||||
' <activiti:taskListener class="do some thing" event="complete" />\n' +
|
||||
' <activiti:properties>\n' +
|
||||
' <activiti:property name="审批" value="approve" />\n' +
|
||||
' </activiti:properties>\n' +
|
||||
' </bpmn2:extensionElements>\n' +
|
||||
' <bpmn2:incoming>L7</bpmn2:incoming>\n' +
|
||||
' <bpmn2:incoming>L8</bpmn2:incoming>\n' +
|
||||
' <bpmn2:outgoing>L2</bpmn2:outgoing>\n' +
|
||||
' </bpmn2:userTask>\n' +
|
||||
' </bpmn2:process>\n' +
|
||||
' <bpmndi:BPMNDiagram id="BPMNDiagram_1">\n' +
|
||||
' <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_0uh8wmt_di" bpmnElement="L3">\n' +
|
||||
' <di:waypoint x="560" y="200" />\n' +
|
||||
' <di:waypoint x="560" y="250" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_01hb865_di" bpmnElement="L2">\n' +
|
||||
' <di:waypoint x="560" y="670" />\n' +
|
||||
' <di:waypoint x="560" y="732" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_1t81399_di" bpmnElement="L8">\n' +
|
||||
' <di:waypoint x="690" y="550" />\n' +
|
||||
' <di:waypoint x="690" y="630" />\n' +
|
||||
' <di:waypoint x="610" y="630" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_00vdr2t_di" bpmnElement="L7">\n' +
|
||||
' <di:waypoint x="430" y="550" />\n' +
|
||||
' <di:waypoint x="430" y="630" />\n' +
|
||||
' <di:waypoint x="510" y="630" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_1bnjbaa_di" bpmnElement="L5">\n' +
|
||||
' <di:waypoint x="535" y="400" />\n' +
|
||||
' <di:waypoint x="430" y="400" />\n' +
|
||||
' <di:waypoint x="430" y="470" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="456" y="382" width="55" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_12ug1tp_di" bpmnElement="L6">\n' +
|
||||
' <di:waypoint x="585" y="400" />\n' +
|
||||
' <di:waypoint x="690" y="400" />\n' +
|
||||
' <di:waypoint x="690" y="470" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="611" y="382" width="56" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_1miguqf_di" bpmnElement="L4">\n' +
|
||||
' <di:waypoint x="560" y="330" />\n' +
|
||||
' <di:waypoint x="560" y="375" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNEdge id="Flow_1u6pmzo_di" bpmnElement="L1">\n' +
|
||||
' <di:waypoint x="560" y="68" />\n' +
|
||||
' <di:waypoint x="560" y="120" />\n' +
|
||||
' </bpmndi:BPMNEdge>\n' +
|
||||
' <bpmndi:BPMNShape id="Event_0byql27_di" bpmnElement="N1">\n' +
|
||||
' <dc:Bounds x="542" y="32" width="36" height="36" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="539" y="2" width="43" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Gateway_0qd58o6_di" bpmnElement="N9" isMarkerVisible="true">\n' +
|
||||
' <dc:Bounds x="535" y="375" width="50" height="50" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="538" y="432" width="44" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Event_1h4oob7_di" bpmnElement="N3">\n' +
|
||||
' <dc:Bounds x="542" y="732" width="36" height="36" />\n' +
|
||||
' <bpmndi:BPMNLabel>\n' +
|
||||
' <dc:Bounds x="539" y="775" width="43" height="14" />\n' +
|
||||
' </bpmndi:BPMNLabel>\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_0g48n8q_di" bpmnElement="N2">\n' +
|
||||
' <dc:Bounds x="510" y="120" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_04wpn1b_di" bpmnElement="N4">\n' +
|
||||
' <dc:Bounds x="510" y="250" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_0j8meci_di" bpmnElement="N5">\n' +
|
||||
' <dc:Bounds x="380" y="470" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_0pa1f64_di" bpmnElement="N6">\n' +
|
||||
' <dc:Bounds x="640" y="470" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' <bpmndi:BPMNShape id="Activity_0qmb4lo_di" bpmnElement="N7">\n' +
|
||||
' <dc:Bounds x="510" y="590" width="100" height="80" />\n' +
|
||||
' </bpmndi:BPMNShape>\n' +
|
||||
' </bpmndi:BPMNPlane>\n' +
|
||||
' </bpmndi:BPMNDiagram>\n' +
|
||||
'</bpmn2:definitions>\n';
|
||||
|
||||
|
||||
//region -----分类弹框逻辑-----
|
||||
const cateModal = ref();
|
||||
const openCateModal = () => {
|
||||
cateModal.value.openModal();
|
||||
cateModal.value.openModal();
|
||||
};
|
||||
const cateChoose = (node: any) => {
|
||||
if (node == null) {
|
||||
form.value.cate = null;
|
||||
} else {
|
||||
form.value.cate = { id: node.id, name: node.name };
|
||||
}
|
||||
};
|
||||
const cateChoose=(node:any)=>{
|
||||
if(node==null){
|
||||
form.value.cate=null;
|
||||
}else{
|
||||
form.value.cate={id:node.id,name:node.name};
|
||||
}
|
||||
}
|
||||
//endregion
|
||||
|
||||
</script>
|
||||
|
||||
@@ -1,85 +1,86 @@
|
||||
<template>
|
||||
<Wrap>
|
||||
<div class='p-left'>
|
||||
<CateTree url='/oa/flow/cate/tree' @node-click='nodeClick'/>
|
||||
</div>
|
||||
<div class='p-right'>
|
||||
<el-card class='box-card'>
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span='14'>
|
||||
<el-input v-model='state.form.name' placeholder='输入名称回车查询' clearable class="list-search" @keyup.enter='listQuery(state)'/>
|
||||
<el-button type='primary' @click='listQuery(state)' plain>查 询</el-button>
|
||||
<el-button class='more-button' :icon='state.moreParams?ArrowUp:ArrowDown' plain @click='state.moreParams=!state.moreParams'>更多</el-button>
|
||||
</el-col>
|
||||
<el-col :span='10' style='text-align: right'>
|
||||
<el-button type='success' :icon='Plus' @click='pageAdd("ofte")' plain>新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' :disabled='state.multiple' @click='listDelete(state)' plain>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-show='state.moreParams' class='more-params'>
|
||||
<el-form :inline='true' label-width='100px'>
|
||||
<el-form-item label='备注'>
|
||||
<el-input v-model='state.form.notes' placeholder='输入备注'/>
|
||||
</el-form-item>
|
||||
<el-form-item label='xxxxx'>
|
||||
<el-input v-model='state.form.xx'/>
|
||||
</el-form-item>
|
||||
<el-form-item/>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<Wrap>
|
||||
<div class='p-left'>
|
||||
<CateTree url='/oa/flow/cate/tree' @node-click='nodeClick' />
|
||||
</div>
|
||||
<div class='p-right'>
|
||||
<el-card class='box-card'>
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span='14'>
|
||||
<el-input v-model='state.form.name' placeholder='输入名称回车查询' clearable class='list-search' @keyup.enter='listQuery(state)' />
|
||||
<el-button type='primary' @click='listQuery(state)' plain>查 询</el-button>
|
||||
<el-button class='more-button' :icon='state.moreParams?ArrowUp:ArrowDown' plain @click='state.moreParams=!state.moreParams'>更多</el-button>
|
||||
</el-col>
|
||||
<el-col :span='10' style='text-align: right'>
|
||||
<el-button type='success' :icon='Plus' @click='pageAdd("ofte?catid="+state.form.catid+"&catna="+state.form.catna)' plain>新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' :disabled='state.multiple' @click='listDelete(state)' plain>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-show='state.moreParams' class='more-params'>
|
||||
<el-form :inline='true' label-width='100px'>
|
||||
<el-form-item label='备注'>
|
||||
<el-input v-model='state.form.notes' placeholder='输入备注' />
|
||||
</el-form-item>
|
||||
<el-form-item label='xxxxx'>
|
||||
<el-input v-model='state.form.xx' />
|
||||
</el-form-item>
|
||||
<el-form-item />
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table height='400' :cell-style="{padding:'2px'}" :row-style="{height: '36px'}" v-loading='state.loading' :data='state.list'
|
||||
border stripe @selection-change='listSelect($event,state)'>
|
||||
<el-table-column type='selection' width='55' align='center'/>
|
||||
<el-table-column label='序号' type='index' width='55' align='center'/>
|
||||
<el-table-column label='模板名称'>
|
||||
<template #default='scope'>
|
||||
<span style='cursor:pointer;color: #3e9ece' @click='pageEdit("ofte?id="+scope.row.id)'>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label='所属分类' prop='catna' width='90'/>
|
||||
<el-table-column label='创建人' prop='crman' width='60'/>
|
||||
<el-table-column label='创建时间' prop='crtim' width='150'/>
|
||||
<el-table-column label='更新人' prop='upman' width='60'/>
|
||||
<el-table-column label='更新时间' prop='uptim' width='150'/>
|
||||
</el-table>
|
||||
<el-table height='400' :cell-style="{padding:'2px'}" :row-style="{height: '36px'}" v-loading='state.loading' :data='state.list'
|
||||
border stripe @selection-change='listSelect($event,state)'>
|
||||
<el-table-column type='selection' width='55' align='center' />
|
||||
<el-table-column label='序号' type='index' width='55' align='center' />
|
||||
<el-table-column label='模板名称'>
|
||||
<template #default='scope'>
|
||||
<span style='cursor:pointer;color: #3e9ece' @click='pageEdit("ofte?id="+scope.row.id)'>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label='所属分类' prop='catna' width='90' />
|
||||
<el-table-column label='创建人' prop='crman' width='60' />
|
||||
<el-table-column label='创建时间' prop='crtim' width='150' />
|
||||
<el-table-column label='更新人' prop='upman' width='60' />
|
||||
<el-table-column label='更新时间' prop='uptim' width='150' />
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
@size-change='listQuery(state)' @current-change='listQuery(state)'
|
||||
class='mt8' :pager-count='5' :page-sizes='[10, 20, 30]' background
|
||||
:total='state.total' v-model:current-page='state.form.page' v-model:page-size='state.form.pageSize'
|
||||
layout='total, sizes, prev, pager, next, jumper'
|
||||
/>
|
||||
<el-pagination
|
||||
@size-change='listQuery(state)' @current-change='listQuery(state)'
|
||||
class='mt8' :pager-count='5' :page-sizes='[10, 20, 30]' background
|
||||
:total='state.total' v-model:current-page='state.form.page' v-model:page-size='state.form.pageSize'
|
||||
layout='total, sizes, prev, pager, next, jumper'
|
||||
/>
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</Wrap>
|
||||
</el-card>
|
||||
</div>
|
||||
</Wrap>
|
||||
</template>
|
||||
<script lang='ts'>
|
||||
export default {name: 'oaFlowTemp'};
|
||||
export default { name: 'oaFlowTemp' };
|
||||
</script>
|
||||
<script lang='ts' setup>
|
||||
import {Plus, Delete, ArrowDown, ArrowUp} from '@element-plus/icons-vue';
|
||||
import {onMounted, reactive} from 'vue';
|
||||
import {listQuery, listDelete, listSelect, pageAdd, pageEdit} from '/@/comps/page/index';
|
||||
import { Plus, Delete, ArrowDown, ArrowUp } from '@element-plus/icons-vue';
|
||||
import { onMounted, reactive } from 'vue';
|
||||
import { listQuery, listDelete, listSelect, pageAdd, pageEdit } from '/@/comps/page/index';
|
||||
import Wrap from '/@/comps/page/Wrap.vue';
|
||||
import CateTree from '/@/comps/gen/GenTree.vue';
|
||||
|
||||
const state = reactive({
|
||||
url: '/oa/flow/temp', loading: true, ids: [], moreParams: false,
|
||||
form: {}, single: true, multiple: true, list: [], total: 0,
|
||||
url: '/oa/flow/temp', loading: true, ids: [], moreParams: false,
|
||||
form: { catid: '', catna: '' }, single: true, multiple: true, list: [], total: 0,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
listQuery(state);
|
||||
listQuery(state);
|
||||
});
|
||||
|
||||
//region a 左侧部门树点击
|
||||
const nodeClick = async (node: any) => {
|
||||
state.form.catid = node.id;
|
||||
await listQuery(state);
|
||||
state.form.catid = node.id;
|
||||
state.form.catna = node.name;
|
||||
await listQuery(state);
|
||||
};
|
||||
//endregion
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label='备注' prop='notes' />
|
||||
<el-table-column label='操作' prop='notes' width='56'>
|
||||
<el-table-column label='操作' prop='notes' width='46' align='center'>
|
||||
<template #default='scope'>
|
||||
<el-icon :size='20' style='top:3px;color: green;cursor: pointer' @click='doOnce(scope.row.id)' title="立即执行一次">
|
||||
<video-play />
|
||||
|
||||
+126
-118
@@ -1,130 +1,138 @@
|
||||
<template>
|
||||
<el-card class='box-card' :body-style="{padding:'2px 8px'}" shadow='never'>
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span='10'>
|
||||
<div style='line-height: 32px'>部门信息</div>
|
||||
</el-col>
|
||||
<el-col :span='14' style='text-align: right'>
|
||||
<el-button type='success' @click='tabSave(formRef,state,proxy,route)' plain>保 存</el-button>
|
||||
<el-button type='info' plain>复 制</el-button>
|
||||
<el-button type='info' @click='tabClose(proxy,route)' plain>关 闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<div style='margin-top: 8px;margin-bottom: 8px'>
|
||||
<el-form ref="formRef" class='zform' :model='form' label-width='140px'>
|
||||
<el-tabs type='card' v-model='activeName'>
|
||||
<el-tab-pane label='基本信息' name='tab1'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='部门名称:' prop='name' :rules="[{ required: true, message: '名称不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.name'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='上级部门:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.panam' @click='openOrgModal' readonly :suffix-icon='Search'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='部门类型:'>
|
||||
<div class='zinput'>
|
||||
<el-select v-model='form.type' style='width: 100%'>
|
||||
<el-option :value='1' label='机构'></el-option>
|
||||
<el-option :value='2' label='部门'></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='排序号:'>
|
||||
<div class='zinput'>
|
||||
<el-input-number v-model='form.ornum' controls-position='right' style='width: 100%'/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='是否可用:'>
|
||||
<div class='zinput'>
|
||||
<el-switch v-model='form.avtag'>
|
||||
</el-switch>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='其他信息' name='tab3'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label='备注:'>
|
||||
<div class='zinput' style='height: auto'>
|
||||
<el-input style="font-family: 'Courier New', Helvetica, Arial, sans-serif; font-size:16px"
|
||||
type='textarea' :rows='4' v-model='form.notes'>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-show='form.crtim'>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='创建时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.crtim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='更新时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.uptim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<OrgModal ref='orgModal' @close='closeOrgModal'/>
|
||||
</el-card>
|
||||
<el-card class='box-card' :body-style="{padding:'2px 8px'}" shadow='never'>
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span='10'>
|
||||
<div style='line-height: 32px'>部门信息</div>
|
||||
</el-col>
|
||||
<el-col :span='14' style='text-align: right'>
|
||||
<el-button type='success' @click='tabSave(formRef,state,proxy,route)' plain>保 存</el-button>
|
||||
<el-button type='info' plain>复 制</el-button>
|
||||
<el-button type='info' @click='tabClose(proxy,route)' plain>关 闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<div style='margin-top: 8px;margin-bottom: 8px'>
|
||||
<el-form ref='formRef' class='zform' :model='form' label-width='140px'>
|
||||
<el-tabs type='card' v-model='activeName'>
|
||||
<el-tab-pane label='基本信息' name='tab1'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='部门名称:' prop='name' :rules="[{ required: true, message: '名称不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.name'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='上级部门:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.pname' @click='openOrgModal' readonly :suffix-icon='Search'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='部门类型:'>
|
||||
<div class='zinput'>
|
||||
<el-select v-model='form.type' style='width: 100%'>
|
||||
<el-option :value='1' label='机构'></el-option>
|
||||
<el-option :value='2' label='部门'></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='排序号:'>
|
||||
<div class='zinput'>
|
||||
<el-input-number v-model='form.ornum' controls-position='right' style='width: 100%' />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='是否可用:'>
|
||||
<div class='zinput'>
|
||||
<el-switch v-model='form.avtag'>
|
||||
</el-switch>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='其他信息' name='tab3'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label='备注:'>
|
||||
<div class='zinput' style='height: auto'>
|
||||
<el-input style="font-family: 'Courier New', Helvetica, Arial, sans-serif; font-size:16px"
|
||||
type='textarea' :rows='4' v-model='form.notes'>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-show='form.crtim'>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='创建时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.crtim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='更新时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.uptim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<OrgModal ref='orgModal' @close='closeOrgModal' />
|
||||
</el-card>
|
||||
</template>
|
||||
<script lang='ts'>
|
||||
export default {name: 'sysOrgDept'};
|
||||
export default { name: 'sysOrgDept' };
|
||||
</script>
|
||||
<script lang='ts' setup>
|
||||
import {Search} from '@element-plus/icons-vue';
|
||||
import {getCurrentInstance, onMounted, reactive, ref, toRefs} from 'vue';
|
||||
import {editInit, tabSave, tabClose} from '/@/comps/page/edit';
|
||||
import {useRoute} from 'vue-router';
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
import { getCurrentInstance, onMounted, reactive, ref, toRefs } from 'vue';
|
||||
import { editInit, tabSave, tabClose } from '/@/comps/page/edit';
|
||||
import { useRoute } from 'vue-router';
|
||||
import OrgModal from '/@/comps/sys/OrgModal.vue';
|
||||
import {FormInstance} from "element-plus";
|
||||
import { FormInstance } from 'element-plus';
|
||||
|
||||
const route = useRoute();
|
||||
const formRef = ref<FormInstance>();
|
||||
const {proxy} = getCurrentInstance() as any;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const activeName = ref('tab1');
|
||||
|
||||
const state = reactive({
|
||||
url: '/sys/org/dept',
|
||||
params: {path: '', query: ''},
|
||||
form: {avtag: true, type: 2} as any,
|
||||
url: '/sys/org/dept',
|
||||
params: { path: '', query: {} as any },
|
||||
form: { avtag: true, type: 2 } as any,
|
||||
});
|
||||
|
||||
const {form} = toRefs(state);
|
||||
const { form } = toRefs(state);
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
await editInit(state, route);
|
||||
if (form.value.parent) {
|
||||
form.value.panam = form.value.parent.name;
|
||||
}
|
||||
state.params = <any>route;
|
||||
let pid = state.params.query?.pid;
|
||||
let pname = state.params.query?.pname;
|
||||
if (pid) {
|
||||
form.value.parent = { id: pid, name: pname };
|
||||
form.value.pname = pname;
|
||||
form.value.pid = pid;
|
||||
}
|
||||
await editInit(state, route);
|
||||
if (form.value.parent) {
|
||||
form.value.pname = form.value.parent.name;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -132,17 +140,17 @@ onMounted(async () => {
|
||||
const orgModal = ref();
|
||||
|
||||
const openOrgModal = () => {
|
||||
orgModal.value.openModal({
|
||||
orgType: 3
|
||||
});
|
||||
orgModal.value.openModal({
|
||||
orgType: 3,
|
||||
});
|
||||
};
|
||||
|
||||
const closeOrgModal = (data: any) => {
|
||||
if (data.orgs && data.orgs.length > 0) {
|
||||
form.value.parent = {id: data.orgs[0].id, name: data.orgs[0].name};
|
||||
form.value.panam = data.orgs[0].name;
|
||||
form.value.pid = data.orgs[0].id;
|
||||
}
|
||||
if (data.orgs && data.orgs.length > 0) {
|
||||
form.value.parent = { id: data.orgs[0].id, name: data.orgs[0].name };
|
||||
form.value.pname = data.orgs[0].name;
|
||||
form.value.pid = data.orgs[0].id;
|
||||
}
|
||||
};
|
||||
//endregion
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<el-button class='more-button' :icon='state.moreParams?ArrowUp:ArrowDown' plain @click='state.moreParams=!state.moreParams'>更多</el-button>
|
||||
</el-col>
|
||||
<el-col :span='11' style='text-align: right'>
|
||||
<el-button type='success' :icon='Plus' @click='tabAdd(state.url)' plain>新增</el-button>
|
||||
<el-button type='success' :icon='Plus' @click='tabAdd(state.url,{pid:state.form.pid,pname:state.form.pname})' plain>新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' :disabled='state.multiple' @click='listDelete(state)' plain>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -78,6 +78,7 @@ onMounted(() => {
|
||||
//region a 左侧部门树点击
|
||||
const nodeClick = async (node: any) => {
|
||||
state.form.pid = node.id;
|
||||
state.form.pname = node.name;
|
||||
await listQuery(state);
|
||||
};
|
||||
//endregion
|
||||
|
||||
@@ -119,6 +119,14 @@ const state = reactive({
|
||||
const {form} = toRefs(state);
|
||||
|
||||
onMounted(async () => {
|
||||
state.params = <any>route;
|
||||
const deptid = state.params.query?.deptid;
|
||||
const deptna = state.params.query?.deptna;
|
||||
if (deptid) {
|
||||
form.value.dept = { id: deptid, name: deptna };
|
||||
form.value.deptid = deptid;
|
||||
form.value.deptna = deptna;
|
||||
}
|
||||
await editInit(state, route);
|
||||
if (form.value.dept) {
|
||||
form.value.deptna = form.value.dept.name;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<el-button class='more-button' :icon='state.moreParams?ArrowUp:ArrowDown' plain @click='state.moreParams=!state.moreParams'>更多</el-button>
|
||||
</el-col>
|
||||
<el-col :span='10' style='text-align: right'>
|
||||
<el-button type='success' :icon='Plus' @click='tabAdd(state.url)' plain>新增</el-button>
|
||||
<el-button type='success' :icon='Plus' @click='tabAdd(state.url,{deptid:state.form.deptid,deptna:state.form.deptna})' plain>新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' :disabled='state.multiple' @click='listDelete(state)' plain>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -77,6 +77,7 @@ onMounted(() => {
|
||||
//region a 左侧部门树点击
|
||||
const nodeClick = async (node: any) => {
|
||||
state.form.deptid = node.id;
|
||||
state.form.deptna = node.name;
|
||||
await listQuery(state);
|
||||
};
|
||||
//endregion
|
||||
|
||||
+158
-150
@@ -1,164 +1,172 @@
|
||||
<template>
|
||||
<el-card class='box-card' :body-style="{padding:'2px 8px'}" shadow='never'>
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span='10'>
|
||||
<div style='line-height: 32px'>用户信息</div>
|
||||
</el-col>
|
||||
<el-col :span='14' style='text-align: right'>
|
||||
<el-button type='success' @click='tabSave(formRef,state,proxy,route)' plain>保 存</el-button>
|
||||
<el-button type='info' plain>复 制</el-button>
|
||||
<el-button type='info' @click='tabClose(proxy,route)' plain>关 闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<div style='margin-top: 8px;margin-bottom: 8px'>
|
||||
<el-form ref="formRef" class='zform' :model='form' label-width='140px'>
|
||||
<el-tabs type='card' v-model='activeName'>
|
||||
<el-tab-pane label='基本信息' name='tab1'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='姓名:' prop='name' :rules="[{ required: true, message: '名称不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.name'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='昵称:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.ninam'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='登录名:' prop='usnam' :rules="[{ required: true, message: '登录名不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.usnam'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='密码:' prop='pacod' :rules="[{ required: true, message: '密码不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input type="password" v-model='form.pacod' show-password></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='所属部门:' prop='deptna' :rules="[{ required: true, message: '所属部门不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.deptna' @click='openOrgModal' readonly :suffix-icon='Search'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='排序号:'>
|
||||
<div class='zinput'>
|
||||
<el-input-number v-model='form.ornum' controls-position='right' style='width: 100%'/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='是否可用:'>
|
||||
<div class='zinput'>
|
||||
<el-switch v-model='form.avtag'>
|
||||
</el-switch>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='职务:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.job'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='手机号:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.monum'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='email:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.email'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='其他信息' name='tab3'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label='备注:'>
|
||||
<div class='zinput' style='height: auto'>
|
||||
<el-input style="font-family: 'Courier New', Helvetica, Arial, sans-serif; font-size:16px"
|
||||
type='textarea' :rows='4' v-model='form.notes'>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-show='form.crtim'>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='创建时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.crtim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='更新时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.uptim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<OrgModal ref='orgModal' @close='closeOrgModal'/>
|
||||
</el-card>
|
||||
<el-card class='box-card' :body-style="{padding:'2px 8px'}" shadow='never'>
|
||||
<template #header>
|
||||
<el-row>
|
||||
<el-col :span='10'>
|
||||
<div style='line-height: 32px'>用户信息</div>
|
||||
</el-col>
|
||||
<el-col :span='14' style='text-align: right'>
|
||||
<el-button type='success' @click='tabSave(formRef,state,proxy,route)' plain>保 存</el-button>
|
||||
<el-button type='info' plain>复 制</el-button>
|
||||
<el-button type='info' @click='tabClose(proxy,route)' plain>关 闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<div style='margin-top: 8px;margin-bottom: 8px'>
|
||||
<el-form ref='formRef' class='zform' :model='form' label-width='140px'>
|
||||
<el-tabs type='card' v-model='activeName'>
|
||||
<el-tab-pane label='基本信息' name='tab1'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='姓名:' prop='name' :rules="[{ required: true, message: '名称不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.name'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='昵称:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.ninam'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='登录名:' prop='usnam' :rules="[{ required: true, message: '登录名不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.usnam'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='密码:' prop='pacod' :rules="[{ required: true, message: '密码不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input type='password' v-model='form.pacod' show-password></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='所属部门:' prop='deptna' :rules="[{ required: true, message: '所属部门不能为空'}]">
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.deptna' @click='openOrgModal' readonly :suffix-icon='Search'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='排序号:'>
|
||||
<div class='zinput'>
|
||||
<el-input-number v-model='form.ornum' controls-position='right' style='width: 100%' />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='是否可用:'>
|
||||
<div class='zinput'>
|
||||
<el-switch v-model='form.avtag'>
|
||||
</el-switch>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='职务:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.job'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='手机号:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.monum'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label='email:'>
|
||||
<div class='zinput'>
|
||||
<el-input v-model='form.email'></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label='其他信息' name='tab3'>
|
||||
<el-row style='border-top: 1px solid #d2d2d2;'>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label='备注:'>
|
||||
<div class='zinput' style='height: auto'>
|
||||
<el-input style="font-family: 'Courier New', Helvetica, Arial, sans-serif; font-size:16px"
|
||||
type='textarea' :rows='4' v-model='form.notes'>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-show='form.crtim'>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='创建时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.crtim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label='更新时间:'>
|
||||
<div class='zinput'>
|
||||
{{ form.uptim }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<OrgModal ref='orgModal' @close='closeOrgModal' />
|
||||
</el-card>
|
||||
</template>
|
||||
<script lang='ts'>
|
||||
export default {name: 'sysOrgUser'};
|
||||
export default { name: 'sysOrgUser' };
|
||||
</script>
|
||||
<script lang='ts' setup>
|
||||
import {Search} from '@element-plus/icons-vue';
|
||||
import {getCurrentInstance, onMounted, reactive, ref, toRefs} from 'vue';
|
||||
import {editInit, tabSave, tabClose} from '/@/comps/page/edit';
|
||||
import {useRoute} from 'vue-router';
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
import { getCurrentInstance, onMounted, reactive, ref, toRefs } from 'vue';
|
||||
import { editInit, tabSave, tabClose } from '/@/comps/page/edit';
|
||||
import { useRoute } from 'vue-router';
|
||||
import OrgModal from '/@/comps/sys/OrgModal.vue';
|
||||
import {FormInstance} from "element-plus";
|
||||
import { FormInstance } from 'element-plus';
|
||||
|
||||
const route = useRoute();
|
||||
const formRef = ref<FormInstance>();
|
||||
const {proxy} = getCurrentInstance() as any;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const activeName = ref('tab1');
|
||||
|
||||
const state = reactive({
|
||||
url: '/sys/org/user',
|
||||
params: {path: '', query: ''},
|
||||
form: {avtag: true} as any,
|
||||
url: '/sys/org/user',
|
||||
params: { path: '', query: {} as any },
|
||||
form: { avtag: true } as any,
|
||||
});
|
||||
|
||||
const {form} = toRefs(state);
|
||||
const { form } = toRefs(state);
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
await editInit(state, route);
|
||||
if (form.value.dept) {
|
||||
form.value.deptna = form.value.dept.name;
|
||||
}
|
||||
state.params = <any>route;
|
||||
const deptid = state.params.query?.deptid;
|
||||
const deptna = state.params.query?.deptna;
|
||||
if (deptid) {
|
||||
form.value.dept = { id: deptid, name: deptna };
|
||||
form.value.deptid = deptid;
|
||||
form.value.deptna = deptna;
|
||||
}
|
||||
await editInit(state, route);
|
||||
if (form.value.dept) {
|
||||
form.value.deptna = form.value.dept.name;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -166,15 +174,15 @@ onMounted(async () => {
|
||||
const orgModal = ref();
|
||||
|
||||
const openOrgModal = () => {
|
||||
orgModal.value.openModal({orgType: 3});
|
||||
orgModal.value.openModal({ orgType: 3 });
|
||||
};
|
||||
|
||||
const closeOrgModal = (data: any) => {
|
||||
if (data.orgs && data.orgs.length > 0) {
|
||||
form.value.dept = {id: data.orgs[0].id, name: data.orgs[0].name};
|
||||
form.value.deptna = data.orgs[0].name;
|
||||
form.value.deptid = data.orgs[0].id;
|
||||
}
|
||||
if (data.orgs && data.orgs.length > 0) {
|
||||
form.value.dept = { id: data.orgs[0].id, name: data.orgs[0].name };
|
||||
form.value.deptna = data.orgs[0].name;
|
||||
form.value.deptid = data.orgs[0].id;
|
||||
}
|
||||
};
|
||||
//endregion
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<el-button class='more-button' :icon='state.moreParams?ArrowUp:ArrowDown' plain @click='state.moreParams=!state.moreParams'>更多</el-button>
|
||||
</el-col>
|
||||
<el-col :span='10' style='text-align: right'>
|
||||
<el-button type='success' :icon='Plus' @click='tabAdd(state.url)' plain>新增</el-button>
|
||||
<el-button type='success' :icon='Plus' @click='tabAdd(state.url,{deptid:state.form.deptid,deptna:state.form.deptna})' plain>新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' :disabled='state.multiple' @click='listDelete(state)' plain>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -78,6 +78,7 @@ onMounted(() => {
|
||||
//region a 左侧部门树点击
|
||||
const nodeClick = async (node: any) => {
|
||||
state.form.deptid = node.id;
|
||||
state.form.deptna = node.name;
|
||||
await listQuery(state);
|
||||
};
|
||||
//endregion
|
||||
|
||||
@@ -19,20 +19,21 @@
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||
<el-table-column type='selection' width='55' align='center' />
|
||||
<el-table-column label='序号' type='index' width='55' align='center' />
|
||||
<el-table-column label='名称' width='180'>
|
||||
<el-table-column label='名称' width='250'>
|
||||
<template #default='scope'>
|
||||
<span style='cursor:pointer;color: #3e9ece' @click='toggle(scope.row)'>{{ scope.row.name }}</span>
|
||||
<span style='cursor:pointer;color:#972fcb' @click='toggle(scope.row)'>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label='类型' prop='type' width='70'>
|
||||
<el-table-column label='类型' prop='type' width='60' header-align='center'>
|
||||
<template #default="scope">
|
||||
<el-tag v-show="scope.row.type==='D'" type="success" size="small">目录</el-tag>
|
||||
<el-tag v-show="scope.row.type==='M'" type="warning" size="small">菜单</el-tag>
|
||||
<el-tag v-show="scope.row.type==='B'" type="info" size="small">按钮</el-tag>
|
||||
<el-tag v-show="scope.row.type==='B'" type="primary" size="small">按钮</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label='更新时间' prop='uptim' width='160' />
|
||||
<el-table-column label='备注' prop='notes' />
|
||||
<el-table-column label='创建时间' prop='crtim' width='150' />
|
||||
<el-table-column label='更新时间' prop='uptim' width='150' />
|
||||
<el-table-column label='操作' width='114' header-align='center' align="right">
|
||||
<template #default="scope">
|
||||
<el-icon @click='drawer.open({pid:scope.row.id,pname:scope.row.name})' v-show="scope.row.type==='D'||scope.row.type==='M'" style="cursor: pointer;font-size: 18px;top:2px;margin-left: 10px;color: #52C41A"><circle-plus/></el-icon>
|
||||
|
||||
Reference in New Issue
Block a user