Compare commits
2 Commits
56af7453d4
...
85c7be74cb
| Author | SHA1 | Date |
|---|---|---|
|
|
85c7be74cb | |
|
|
7f3532c47a |
|
|
@ -0,0 +1,14 @@
|
|||
import { SysDataItemLoadModel } from './model/dbsourceModel';
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
// 获取字典分类列表
|
||||
Get_SysDataItemLoad = '/api/SysDataItem/Load',
|
||||
}
|
||||
|
||||
// 获取字典分类列表
|
||||
export function Get_SysDataItemLoad() {
|
||||
return defHttp.get<SysDataItemLoadModel>({
|
||||
url: Api.Get_SysDataItemLoad,
|
||||
});
|
||||
}
|
||||
|
|
@ -53,6 +53,8 @@ enum Api {
|
|||
GetAllRoleList = '/system/getAllRoleList',
|
||||
LoadPositionByOrg = '/api/SysPosition/LoadPositionByOrg',
|
||||
LoadDataBaseLinkTree = '/api/SysDatabaseLink/LoadDataBaseLinkTree',
|
||||
GetPosInfo = '/api/SysPosition/Get',
|
||||
UpdatePosition = '/api/SysPosition/Update',
|
||||
}
|
||||
|
||||
export const getPositionsTree = (params: AccountParams) =>
|
||||
|
|
@ -142,6 +144,16 @@ export function addPosition(params) {
|
|||
);
|
||||
}
|
||||
|
||||
export function updatePosition(params) {
|
||||
return defHttp.post(
|
||||
{
|
||||
url: Api.UpdatePosition,
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export function addDept(params) {
|
||||
return defHttp.post(
|
||||
{
|
||||
|
|
@ -274,8 +286,11 @@ export const isAccountExist = (account: string) =>
|
|||
|
||||
export const getLoadPositionByOrg = (params?: PositionByOrgParams) =>
|
||||
defHttp.get<RolePageListGetResultModel>({ url: Api.LoadPositionByOrg, params });
|
||||
|
||||
|
||||
export const getLoadDataBaseLinkTree = (params) =>
|
||||
defHttp.get({ url: Api.LoadDataBaseLinkTree, params });
|
||||
|
||||
export const getPosInfo = (params) =>
|
||||
defHttp.get({ url: Api.GetPosInfo, params });
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ enum Api {
|
|||
*/
|
||||
export const getFormsTypeList = (params?: selectParams) =>
|
||||
defHttp.get<DemoOptionsItem[]>({ url: Api.FORMSTYPES_LIST, params });
|
||||
|
||||
export const getFormGroupList = (params: AccountParams) =>
|
||||
defHttp.get<AccountListGetResultModel>({ url: Api.FORMS_LIST, params });
|
||||
export const getDataBaseTableList = (params: AccountParams) =>
|
||||
|
|
@ -51,3 +52,4 @@ export const importDataBaseTable = (params: NoOptionsParam) =>
|
|||
});
|
||||
export const getDataBaseCodeList = (params: NoOptionsParam) =>
|
||||
defHttp.get<AccountListGetResultModel>({ url: Api.GETDATABASETABLE_LIST, params });
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
ref="startRef"
|
||||
:element="data.currentWfNode"
|
||||
:pageType="props.pageType"
|
||||
:schemeCode="props.schemeCode"
|
||||
:class="data.currentWfNode.type == 'bpmn:StartEvent' ? '' : 'hidden'"
|
||||
></start-event-option>
|
||||
<!-- 审核节点 -->
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<IconPicker v-model:value="formState.icon" />
|
||||
</a-form-item>
|
||||
<a-form-item label="图标颜色" name="color">
|
||||
<a-input type="color" v-model="formState.color" placeholder="请输入"></a-input>
|
||||
<a-input type="color" :key="formState.color" :default-value="formState.color" v-model="formState.color" placeholder="请输入" @change="e=>colorChange(e.target.value)"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="模板分类" name="category">
|
||||
<a-select
|
||||
|
|
@ -266,6 +266,9 @@
|
|||
icon: [{ required: true, message: '请选择图标' }],
|
||||
color: [{ required: true, message: '请选择颜色' }],
|
||||
};
|
||||
function colorChange(color){
|
||||
formState.value.color = color
|
||||
}
|
||||
async function getSQL() {
|
||||
const data = await getLoadDataBaseLinkTree();
|
||||
data.forEach((element) => {
|
||||
|
|
|
|||
|
|
@ -33,31 +33,35 @@
|
|||
/>
|
||||
</a-form-item>
|
||||
<a-divider plain="true">表单添加</a-divider>
|
||||
<a-tabs v-model:activeKey="node.formType" type="card" size="small" centered="true">
|
||||
<a-tabs
|
||||
v-model:activeKey="node.formType"
|
||||
type="card"
|
||||
size="small"
|
||||
centered="true"
|
||||
@change="tabsChange"
|
||||
>
|
||||
<a-tab-pane key="1" tab="自定义表单">
|
||||
<a-space direction="vertical" size="middle" class="site-space-compact-wrapper">
|
||||
<a-space-compact block>
|
||||
<a-input v-model:value="node.formCode" placeholder="请选择表单" readonly />
|
||||
<a-button>选择</a-button>
|
||||
<a-input v-model:value="data.formName" placeholder="请选择表单" readonly />
|
||||
<a-button @click="handleShow">选择</a-button>
|
||||
</a-space-compact>
|
||||
<a-space-compact block>
|
||||
<a-select
|
||||
v-model:value="node.formVerison"
|
||||
placeholder="请选择表单版本"
|
||||
@change="updateWfData('formVerison')"
|
||||
>
|
||||
<a-select-option value="shanghai">Zone one</a-select-option>
|
||||
<a-select-option value="beijing">Zone two</a-select-option>
|
||||
</a-select>
|
||||
@change="custmerformVerisonChange"
|
||||
:options="data.formVerisons"
|
||||
:fieldNames="{ value: 'id', label: 'createDate' }"
|
||||
></a-select>
|
||||
</a-space-compact>
|
||||
<a-space-compact block>
|
||||
<a-select
|
||||
v-model:value="node.formRelationId"
|
||||
placeholder="请选择流程关联字段"
|
||||
@change="updateWfData('formRelationId')"
|
||||
:options="data.formRelations"
|
||||
>
|
||||
<a-select-option value="shanghai">Zone one</a-select-option>
|
||||
<a-select-option value="beijing">Zone two</a-select-option>
|
||||
</a-select>
|
||||
</a-space-compact>
|
||||
</a-space>
|
||||
|
|
@ -98,7 +102,7 @@
|
|||
</template>
|
||||
<template v-else-if="['required', 'isEdit', 'isLook'].includes(column.dataIndex)">
|
||||
<div>
|
||||
<a-switch v-model:checked="record[column.dataIndex]" />
|
||||
<a-switch v-model:checked="record[column.dataIndex]" size="small" />
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
|
@ -110,15 +114,18 @@
|
|||
:pagination="false"
|
||||
v-else
|
||||
>
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="['label', 'field'].includes(column.dataIndex)">
|
||||
<div>
|
||||
{{ text }}
|
||||
<a-input
|
||||
v-model:value="record[column.dataIndex]"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="['required', 'isEdit', 'isLook'].includes(column.dataIndex)">
|
||||
<div>
|
||||
<a-switch v-model:checked="record[column.dataIndex]" />
|
||||
<a-switch v-model:checked="record[column.dataIndex]" size="small"/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'operation'">
|
||||
|
|
@ -142,17 +149,30 @@
|
|||
>
|
||||
</a-space>
|
||||
</a-form>
|
||||
<a-modal
|
||||
width="60%"
|
||||
wrap-class-name="full-modal"
|
||||
v-model:open="data.formOpen"
|
||||
title="添加岗位"
|
||||
@ok="formHandleOk"
|
||||
>
|
||||
<SelectForm ref="formRef"></SelectForm>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, defineProps, computed, inject, ref, watch, h, onMounted } from 'vue';
|
||||
import { reactive, defineProps, ref, watch, h, onMounted } from 'vue';
|
||||
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons-vue';
|
||||
import { getDetail } from '@/api/sys/WFSchemeInfo';
|
||||
import { flowStore } from '@/store/modules/flow';
|
||||
import { SelectForm } from '@/components/SelectForm/index';
|
||||
import { functionGetSchemePageList } from '@/api/demo/formScheme';
|
||||
import { functionLoadFormPage } from '@/api/demo/formScheme';
|
||||
|
||||
const flowWfDataStore = flowStore();
|
||||
const labelCol = { span: 7 };
|
||||
const wrapperCol = { span: 17 };
|
||||
// 表单选择声明
|
||||
const props = defineProps({
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
|
|
@ -163,7 +183,17 @@
|
|||
pageType: String,
|
||||
pageView: String,
|
||||
});
|
||||
const data = reactive({
|
||||
console.log(props)
|
||||
interface dataType {
|
||||
columns: any;
|
||||
formRelations: any;
|
||||
elementData: any;
|
||||
componentDisabled: boolean;
|
||||
formOpen: boolean;
|
||||
formVerisons: any;
|
||||
formName: string;
|
||||
}
|
||||
const data: dataType = reactive({
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
|
|
@ -189,8 +219,21 @@
|
|||
formRelations: [],
|
||||
elementData: props.element,
|
||||
componentDisabled: props.pageType == 'detail' ? true : false,
|
||||
formOpen: false,
|
||||
formVerisons: [],
|
||||
formName: '',
|
||||
});
|
||||
let node = ref({});
|
||||
let node: any = ref({});
|
||||
watch(
|
||||
() => node.value.formCode,
|
||||
(newVal, oldVal) => {
|
||||
console.log(newVal)
|
||||
if(newVal){
|
||||
getFormList()
|
||||
getVersions()
|
||||
}
|
||||
},
|
||||
);
|
||||
watch(
|
||||
() => props.element,
|
||||
(newVal, oldVal) => {
|
||||
|
|
@ -217,8 +260,115 @@
|
|||
}
|
||||
},
|
||||
);
|
||||
// 编辑时获取表单名称,表单版本
|
||||
async function getFormList(){
|
||||
const list = await functionLoadFormPage({
|
||||
page:1,
|
||||
limit:1000
|
||||
})
|
||||
list.items.forEach(element => {
|
||||
if(element.id == node.value.formCode){
|
||||
data.formName = element.name
|
||||
}
|
||||
});
|
||||
console.log(list)
|
||||
}
|
||||
// 切换自定义表单和系统表单
|
||||
function tabsChange(val) {
|
||||
data.formName = '';
|
||||
node.value.formCode = '';
|
||||
node.value.formVerison = '';
|
||||
node.value.formRelationId = '';
|
||||
node.value.formUrl = '';
|
||||
node.value.formAppUrl = '';
|
||||
node.value.authFields = [];
|
||||
node.value.formRelations = [];
|
||||
}
|
||||
// 表单选择打开
|
||||
function handleShow() {
|
||||
data.formOpen = true;
|
||||
}
|
||||
// 表单选择
|
||||
const formRef = ref<any>();
|
||||
async function formHandleOk() {
|
||||
let obj = formRef.value.getRow();
|
||||
node.value.formCode = obj[0].id;
|
||||
data.formName = obj[0].name;
|
||||
node.value.formVerison = '';
|
||||
node.value.formRelationId = '';
|
||||
node.value.formUrl = '';
|
||||
node.value.formAppUrl = '';
|
||||
node.value.authFields = [];
|
||||
node.value.formRelations = [];
|
||||
getVersions()
|
||||
data.formOpen = false;
|
||||
}
|
||||
async function getVersions(){
|
||||
const list = await functionGetSchemePageList({
|
||||
schemeInfoId: node.value.formCode,
|
||||
});
|
||||
data.formVerisons = list.items;
|
||||
if(node.value.formVerison){
|
||||
custmerformVerisonChange(node.value.formVerison)
|
||||
}
|
||||
|
||||
}
|
||||
// 表单版本更改
|
||||
async function custmerformVerisonChange(val) {
|
||||
let obj;
|
||||
data.formVerisons.forEach((element) => {
|
||||
if (element.id == val) {
|
||||
obj = element;
|
||||
}
|
||||
});
|
||||
loadFormScheme(obj.scheme);
|
||||
}
|
||||
function loadFormScheme(strScheme) {
|
||||
const scheme = JSON.parse(strScheme);
|
||||
const fields: {
|
||||
field?: string;
|
||||
label?: string;
|
||||
required: boolean;
|
||||
isEdit: boolean;
|
||||
isLook: boolean;
|
||||
}[] = [];
|
||||
const rfields: {
|
||||
label?: string;
|
||||
value?: string;
|
||||
}[] = [];
|
||||
console.log('scheme.formInfo.schemas');
|
||||
console.log(scheme.formInfo.schemas);
|
||||
scheme.formInfo.schemas.forEach(
|
||||
(element: { label?: string; field?: string; component: any; itemProps: any }) => {
|
||||
if (['InputGuid'].includes(element.component)) {
|
||||
rfields.push({
|
||||
label: element.label,
|
||||
// value:element.prop
|
||||
value: element.field,
|
||||
});
|
||||
}
|
||||
if (!['Divider'].includes(element.component) && !element.itemProps.hidden) {
|
||||
fields.push({
|
||||
// prop:element.prop,
|
||||
field: element.field,
|
||||
label: element.label,
|
||||
// table:element.table,
|
||||
required: element.itemProps.required,
|
||||
isEdit: true,
|
||||
isLook: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
console.log(rfields);
|
||||
console.log(fields);
|
||||
|
||||
data.formRelations = rfields;
|
||||
node.value.authFields = fields;
|
||||
}
|
||||
function updateWfData(key) {
|
||||
flowWfDataStore.updataWfDataNode(node.value.id, key, node.value[key]);
|
||||
// flowWfDataStore.updataWfDataNode(node.value.id, key, node.value[key]);
|
||||
}
|
||||
function handleAddAuthField() {
|
||||
node.value.authFields.push({
|
||||
|
|
@ -232,9 +382,6 @@
|
|||
function handleDeleteAuthField(key) {
|
||||
node.value.authFields = node.value.authFields.filter((item) => item.field !== key);
|
||||
}
|
||||
|
||||
defineExpose({});
|
||||
onMounted(() => {});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.site-space-compact-wrapper {
|
||||
|
|
@ -259,6 +406,41 @@
|
|||
button {
|
||||
width: 20%;
|
||||
}
|
||||
.ant-btn-dangerous {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.l-rblock {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
.l-page-pane {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: 794px;
|
||||
overflow: hidden auto;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
margin: auto;
|
||||
padding: 24px;
|
||||
}
|
||||
.addDataBaseTableBox {
|
||||
border: 1px dashed #f0f0f0;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
margin-top: -20px;
|
||||
&:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
}
|
||||
.connectTableTitle {
|
||||
padding-top: 20px;
|
||||
}
|
||||
.formLine {
|
||||
height: 50px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
import { getAllRoleList, isAccountExist } from '@/api/demo/system';
|
||||
import { BasicColumn, FormSchema } from '@/components/Table';
|
||||
|
||||
/**
|
||||
* transform mock data
|
||||
* {
|
||||
* 0: '华东分部',
|
||||
* '0-0': '华东分部-研发部'
|
||||
* '0-1': '华东分部-市场部',
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '分类',
|
||||
dataIndex: 'category',
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'keyword',
|
||||
label: '关键字',
|
||||
component: 'Input',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
export { default as SelectForm } from './index.vue';
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
<template>
|
||||
<div class="select-account">
|
||||
<div class="m-4 mr-0 overflow-hidden bg-white">
|
||||
<BasicTree title="表单分类" ref="asyncExpandTreeRef" toolbar search treeWrapperClassName="h-[calc(100%-35px)] overflow-auto" loadData
|
||||
:clickRowToExpand="false" :treeData="treeData" :fieldNames="{ key: 'itemValue', title: 'itemName' }"
|
||||
@select="handleSelect" />
|
||||
</div>
|
||||
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'category'">
|
||||
{{ findModuleName(treeData, record.category) }}
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '预览',
|
||||
onClick: () => {
|
||||
previewModal(record);
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive ,onMounted, ref ,nextTick,unref} from 'vue';
|
||||
|
||||
import { BasicTree, TreeItem } from '@/components/Tree';
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { getAccountList, deleteAccount } from '@/api/demo/system';
|
||||
import { PageWrapper } from '@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { functionLoadFormSort, functionLoadFormPage } from '@/api/demo/formScheme';
|
||||
|
||||
|
||||
import { columns, searchFormSchema } from './account.data';
|
||||
|
||||
defineOptions({ name: 'AccountManagement' });
|
||||
|
||||
|
||||
const emit = defineEmits(['select']);
|
||||
|
||||
const treeData = ref < TreeItem[] > ([]);
|
||||
const asyncExpandTreeRef = ref < Nullable < TreeActionType >> (null);
|
||||
|
||||
async function fetch() {
|
||||
treeData.value = (await functionLoadFormSort()) as unknown as TreeItem[];
|
||||
// 展开全部
|
||||
nextTick(() => {
|
||||
unref(asyncExpandTreeRef)?.expandAll(true);
|
||||
});
|
||||
}
|
||||
|
||||
const searchInfo = reactive < Recordable > ({});
|
||||
const [registerTable, { reload, updateTableDataRecord, getSelectRows, clearSelectedRowKeys }] = useTable({
|
||||
title: '账号列表',
|
||||
api: functionLoadFormPage,
|
||||
rowKey: 'id',
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
},
|
||||
rowSelection: {//多选框
|
||||
type: 'radio',
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
tableSetting: { fullScreen: true },
|
||||
isCanResizeParent: true,
|
||||
handleSearchInfoFn(info) {
|
||||
console.log('handleSearchInfoFn', info);
|
||||
return info;
|
||||
},
|
||||
});
|
||||
function handleSelect(orgId = '') {
|
||||
searchInfo.category = orgId[0];
|
||||
reload();
|
||||
}
|
||||
// 分类
|
||||
function findModuleName(modules, pmoduleId) {
|
||||
for (const module of modules) {
|
||||
if (module.itemValue === pmoduleId) {
|
||||
return module.itemName;
|
||||
}
|
||||
if (Array.isArray(module.children) && module.children.length > 0) {
|
||||
const foundName = findModuleName(module.children, pmoduleId);
|
||||
if (foundName) {
|
||||
return foundName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
function getRow() {
|
||||
let rows = getSelectRows();
|
||||
console.log(rows)
|
||||
return rows
|
||||
}
|
||||
defineExpose({
|
||||
getRow
|
||||
})
|
||||
onMounted(()=>{
|
||||
fetch()
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
.select-account{
|
||||
display: flex;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="previewModal" :title="getTitle" width="700px">
|
||||
<!-- <p class="h-20" v-for="index in 20" :key="index">根据屏幕高度自适应</p> -->
|
||||
{{ scheme }}
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '@/components/Modal';
|
||||
|
||||
const scheme = ref('');
|
||||
const [previewModal, { setModalProps }] = useModalInner(async (data) => {
|
||||
scheme.value = data.scheme;
|
||||
setModalProps({ confirmLoading: false });
|
||||
console.log(scheme.value);
|
||||
});
|
||||
</script>
|
||||
|
|
@ -48,8 +48,11 @@ import md5 from 'js-md5'
|
|||
try {
|
||||
const values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
values.password = md5(values.password)
|
||||
if(values.password){
|
||||
values.password = md5(values.password)
|
||||
}
|
||||
const data = await addAccount(values);
|
||||
console.log(data)
|
||||
if (data) {
|
||||
// TODO custom api
|
||||
closeModal();
|
||||
|
|
|
|||
|
|
@ -39,25 +39,19 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'createTime',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '所属部门',
|
||||
dataIndex: 'organizations',
|
||||
// customRender: ({ value }) => {
|
||||
// return deptMap[value];
|
||||
// },
|
||||
},
|
||||
// {
|
||||
// title: '所属部门',
|
||||
// dataIndex: 'organizations',
|
||||
// // customRender: ({ value }) => {
|
||||
// // return deptMap[value];
|
||||
// // },
|
||||
// },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'account',
|
||||
label: '用户名',
|
||||
component: 'Input',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
field: 'nickname',
|
||||
label: '昵称',
|
||||
field: 'key',
|
||||
label: '关键字',
|
||||
component: 'Input',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@
|
|||
onOk: async () => {
|
||||
const data = await deleteAccount(query);
|
||||
if (data) {
|
||||
return createMessage.success('删除成功');
|
||||
handleSuccess();
|
||||
return createMessage.success('删除成功');
|
||||
} else {
|
||||
return createMessage.error('删除失败');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
resetFields();
|
||||
setModalProps({ confirmLoading: false });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
|
||||
if (unref(isUpdate)) {
|
||||
setFieldsValue({
|
||||
...data.record,
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@
|
|||
import { useModal } from '@/components/Modal';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
|
||||
import {DeptTree} from './page';
|
||||
import {DeptModal} from './page';
|
||||
import {PosGroupModal} from './page';
|
||||
import {PermissionBtn} from '@/components/PermissionBtn/index';
|
||||
import { DeptTree } from './page';
|
||||
import { DeptModal } from './page';
|
||||
import { PosGroupModal } from './page';
|
||||
import { PermissionBtn } from '@/components/PermissionBtn/index';
|
||||
import { columns, searchFormSchema } from './dept.data';
|
||||
|
||||
defineOptions({ name: 'DeptManagement' });
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
const [registerPosGroupModal, { openModal: openPosGroupModal }] = useModal();
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
|
||||
const [registerTable, { reload, getSelectRows }] = useTable({
|
||||
const [registerTable, { reload, getSelectRows, clearSelectedRowKeys }] = useTable({
|
||||
title: '部门列表',
|
||||
api: getOrgList,
|
||||
rowKey: 'id',
|
||||
|
|
@ -99,8 +99,8 @@
|
|||
onOk: async () => {
|
||||
const data = await deleteDept(query);
|
||||
if (data) {
|
||||
return createMessage.success('删除成功');
|
||||
handleSuccess();
|
||||
return createMessage.success('删除成功');
|
||||
} else {
|
||||
return createMessage.error('删除失败');
|
||||
}
|
||||
|
|
@ -130,6 +130,7 @@
|
|||
reload();
|
||||
}
|
||||
function handleSuccess() {
|
||||
clearSelectedRowKeys();
|
||||
childRef.value.fetch();
|
||||
reload();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
const { createMessage } = useMessage();
|
||||
import { addPosGroup, editMenu, addPosition, editButton } from '@/api/demo/system';
|
||||
import { addPosGroup, editMenu, addPosition, getPosInfo ,updatePosition} from '@/api/demo/system';
|
||||
|
||||
defineOptions({ name: 'MenuDrawer' });
|
||||
|
||||
|
|
@ -31,21 +31,25 @@
|
|||
showActionButtonGroup: false,
|
||||
baseColProps: { lg: 12, md: 24 },
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
resetFields();
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
|
||||
if (unref(isUpdate)) {
|
||||
let obj: {
|
||||
type?: string;
|
||||
} = {};
|
||||
obj = await getPosInfo({
|
||||
id: data.record.id,
|
||||
});
|
||||
obj.type = data.record.type;
|
||||
setFieldsValue({
|
||||
...data.record,
|
||||
...obj,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
|
|
@ -53,7 +57,7 @@
|
|||
// TODO custom api
|
||||
if (values.type == 1) {
|
||||
delete values.type;
|
||||
// 新增菜单
|
||||
// 新增职级组
|
||||
if (!unref(isUpdate)) {
|
||||
const data = await addPosGroup(values);
|
||||
if (data) {
|
||||
|
|
@ -64,17 +68,17 @@
|
|||
return createMessage.error('新增失败');
|
||||
}
|
||||
} else {
|
||||
const data = await editMenu(values);
|
||||
if (data) {
|
||||
closeDrawer();
|
||||
emit('success');
|
||||
return createMessage.success('编辑成功');
|
||||
} else {
|
||||
return createMessage.error('编辑失败');
|
||||
}
|
||||
// const data = await editMenu(values);
|
||||
// if (data) {
|
||||
// closeDrawer();
|
||||
// emit('success');
|
||||
// return createMessage.success('编辑成功');
|
||||
// } else {
|
||||
// return createMessage.error('编辑失败');
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
// 新增按钮
|
||||
// 新增职级
|
||||
delete values.type;
|
||||
if (!unref(isUpdate)) {
|
||||
const data = await addPosition(values);
|
||||
|
|
@ -86,7 +90,7 @@
|
|||
return createMessage.error('新增失败');
|
||||
}
|
||||
} else {
|
||||
const data = await editButton(values);
|
||||
const data = await updatePosition(values);
|
||||
if (data) {
|
||||
closeDrawer();
|
||||
emit('success');
|
||||
|
|
|
|||
|
|
@ -67,34 +67,34 @@
|
|||
}
|
||||
const btnList = router.currentRoute.value.meta.elements;
|
||||
const actionList: TreeActionItem[] = [];
|
||||
btnList.forEach((element) => {
|
||||
if (element.domId == 'btnEdit') {
|
||||
actionList.push({
|
||||
render: (node) => {
|
||||
return h(FormOutlined, {
|
||||
class: 'ml-2',
|
||||
onClick: () => {
|
||||
emit('edit', node);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
} else if (element.domId == 'btnDelete') {
|
||||
actionList.push({
|
||||
render: (node) => {
|
||||
return h(DeleteOutlined, {
|
||||
class: 'ml-2',
|
||||
onClick: () => {
|
||||
selectItemId.value = node.id;
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
// btnList.forEach((element) => {
|
||||
// if (element.domId == 'btnEdit') {
|
||||
// actionList.push({
|
||||
// render: (node) => {
|
||||
// return h(FormOutlined, {
|
||||
// class: 'ml-2',
|
||||
// onClick: () => {
|
||||
// emit('edit', node);
|
||||
// },
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// } else if (element.domId == 'btnDelete') {
|
||||
// actionList.push({
|
||||
// render: (node) => {
|
||||
// return h(DeleteOutlined, {
|
||||
// class: 'ml-2',
|
||||
// onClick: () => {
|
||||
// selectItemId.value = node.id;
|
||||
// openModal(true, {
|
||||
// isUpdate: false,
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
function createIcon({ level }) {
|
||||
if (level === 1) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
});
|
||||
}
|
||||
async function editGroup(record: Recordable) {
|
||||
console.log('record',record)
|
||||
record.type = '1'
|
||||
openDrawer(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
|
|
|
|||
|
|
@ -138,7 +138,23 @@
|
|||
});
|
||||
designerData.delegateUsers = data;
|
||||
}
|
||||
async function handleSaveDraft() {}
|
||||
async function handleSaveDraft() {
|
||||
var querys = {
|
||||
schemeCode: designerData.isDraft ? '' : code,
|
||||
userId: formData.userId,
|
||||
title: formData.title,
|
||||
processId: buildGUID(),
|
||||
};
|
||||
const data = await saveDraft(querys);
|
||||
querys.schemeCode = '';
|
||||
designerData.isDraft = true;
|
||||
if (data) {
|
||||
closePreview();
|
||||
return createMessage.success('保存草稿成功');
|
||||
} else {
|
||||
return createMessage.error('保存草稿失败');
|
||||
}
|
||||
}
|
||||
async function handleCreateFlow() {
|
||||
var querys = {
|
||||
schemeCode: designerData.isDraft ? '' : code,
|
||||
|
|
@ -154,9 +170,9 @@
|
|||
const data = await create(querys);
|
||||
if (data) {
|
||||
closePreview();
|
||||
return createMessage.success('新增成功');
|
||||
return createMessage.success('发起流程成功');
|
||||
} else {
|
||||
return createMessage.error('新增失败');
|
||||
return createMessage.error('发起流程失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue