merge
commit
999dbe5438
|
|
@ -4,8 +4,8 @@ enum Api {
|
|||
tableList = '/api/BaseDataAuthGetPageList/permission/data/page',
|
||||
getDetailData = '/api/BaseDataAuthGetEntity/permission/data',
|
||||
addData = '/api/BaseDataAuthAddForm/permission/data',
|
||||
editData = '/api/BaseDataAuthUpdateForm/permission/data',
|
||||
delData = '/api/BaseDataAuthDeleteForm/permission/data',
|
||||
editData = '/api/BaseDataAuthUpdateForm/permission/data/',
|
||||
delData = '/api/BaseDataAuthDeleteForm/permission/data/',
|
||||
}
|
||||
export const getTablesListData = (params?: AccountParams) => {
|
||||
return defHttp.get<AccountListGetResultModel>({
|
||||
|
|
@ -27,13 +27,13 @@ export const addTableData = (params?: AccountParams) => {
|
|||
};
|
||||
export const editTableData = (params?: AccountParams) => {
|
||||
return defHttp.post<AccountListGetResultModel>({
|
||||
url: Api.editData,
|
||||
url: Api.editData + params.id,
|
||||
params,
|
||||
});
|
||||
};
|
||||
export const delTableData = (params?: AccountParams) => {
|
||||
return defHttp.post<AccountListGetResultModel>({
|
||||
url: Api.delData,
|
||||
url: Api.delData + params.id,
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ export interface AccountListItem {
|
|||
* @description: Request list return value
|
||||
*/
|
||||
export interface AccountParams {
|
||||
id: string;
|
||||
key: string;
|
||||
page: any;
|
||||
limit: any;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
<template>
|
||||
<div>
|
||||
<div style="display:flex;margin-bottom:10px">
|
||||
<div v-if="tableData.ifShow">
|
||||
<div style="display: flex; margin-bottom: 10px">
|
||||
{{ tableData.label }}
|
||||
<div style="margin-left:10px">
|
||||
<a-radio-group :disabled="tableData.componentProps.disabled" v-model:value="noTitleKey" :options="tableData.componentProps.options" @change="onTabChange($event,tableData.field)"/>
|
||||
<div style="margin-left: 10px">
|
||||
<a-radio-group
|
||||
:disabled="tableData.componentProps.disabled"
|
||||
v-model:value="noTitleKey"
|
||||
:options="tableData.componentProps.options"
|
||||
@change="onTabChange($event, tableData.field)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <a-card
|
||||
|
|
@ -13,9 +18,7 @@
|
|||
v-show="noTitleKey === item.value"
|
||||
:title="item.label"
|
||||
> -->
|
||||
<a-card
|
||||
style="width: 100%"
|
||||
>
|
||||
<a-card style="width: 100%">
|
||||
<BasicForm ref="cardRef" @register="registerForm" @change="changeForm" />
|
||||
<template v-if="Object.keys(childItem).length > 0">
|
||||
<CardGourp
|
||||
|
|
@ -23,6 +26,7 @@
|
|||
:parentValue="props.parentValue"
|
||||
:formData="props.formData"
|
||||
v-if="childItem"
|
||||
:callModal="props.callModal"
|
||||
/>
|
||||
</template>
|
||||
</a-card>
|
||||
|
|
@ -49,6 +53,10 @@
|
|||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
callModal: {
|
||||
type: Boolean,
|
||||
default: () => (false),
|
||||
},
|
||||
});
|
||||
const noTitleKey = ref(0);
|
||||
const formColumns = [];
|
||||
|
|
@ -59,6 +67,10 @@
|
|||
let cardFormData = props.formData;
|
||||
const nowTime = ref(dayjs().format('YYYY-MM-DD HH:mm:ss'));
|
||||
const userName = localStorage.getItem('fireUserLoginName');
|
||||
const cardRef = ref<any>();
|
||||
if(props.callModal){
|
||||
tableData.ifShow = true
|
||||
}
|
||||
const [registerForm, { getFieldsValue, setFieldsValue, updateSchema, resetFields, validate }] =
|
||||
useForm({
|
||||
labelWidth: 100,
|
||||
|
|
@ -87,8 +99,8 @@
|
|||
{ deep: true },
|
||||
);
|
||||
const onTabChange = (event, field) => {
|
||||
let value = event.target.value
|
||||
subTableDataStore.setOneGroupData(field, value)
|
||||
let value = event.target.value;
|
||||
subTableDataStore.setOneGroupData(field, value);
|
||||
noTitleKey.value = value;
|
||||
var currentIndex = (childGourp.value || []).findIndex((element) => element.index === value);
|
||||
|
||||
|
|
@ -146,20 +158,39 @@
|
|||
});
|
||||
});
|
||||
nextTick(() => {
|
||||
if(Object.keys(subTableDataStore.getGroupData).includes(tableData.field)){
|
||||
noTitleKey.value = subTableDataStore.getGroupData[tableData.field].toString()
|
||||
onTabChange({target:{value: noTitleKey.value}},tableData.field)
|
||||
}else{
|
||||
noTitleKey.value = tableData.componentProps.options[0].value
|
||||
onTabChange({target:{value: noTitleKey.value}},tableData.field)
|
||||
if (Object.keys(subTableDataStore.getGroupData).includes(tableData.field)) {
|
||||
noTitleKey.value = subTableDataStore.getGroupData[tableData.field].toString();
|
||||
if (tableData.ifShow) {
|
||||
onTabChange({ target: { value: noTitleKey.value } }, tableData.field);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
noTitleKey.value = tableData.componentProps.options[0].value;
|
||||
if (tableData.ifShow) {
|
||||
onTabChange({ target: { value: noTitleKey.value } }, tableData.field);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (tableData.ifShow) {
|
||||
setTimeout(() => {
|
||||
resetFields();
|
||||
}, 10);
|
||||
}
|
||||
|
||||
function changeForm() {
|
||||
subTableDataStore.setGroupData(getFieldsValue());
|
||||
}
|
||||
|
||||
async function verify() {
|
||||
try {
|
||||
const data = await validate();
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
verify,
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
:data="cardGroupData[index]"
|
||||
:formData="cardGourpFormData"
|
||||
:parentValue="cardGroupData[index].field"
|
||||
ref="groupRef"
|
||||
/>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
|
@ -53,6 +54,7 @@
|
|||
:data="cardGroupData[0]"
|
||||
:formData="cardGourpFormData"
|
||||
:parentValue="cardGroupData[0].field"
|
||||
ref="groupRef"
|
||||
/>
|
||||
</template>
|
||||
<!-- todo 创建/修改 人/时间 -->
|
||||
|
|
@ -142,6 +144,9 @@
|
|||
if (configElement.field == element.field) {
|
||||
element.componentProps.disabled = !configElement.disabled;
|
||||
element.ifShow = configElement.ifShow;
|
||||
if (configElement.required) {
|
||||
element.itemProps.required = configElement.required;
|
||||
}
|
||||
}
|
||||
if (element.columns) {
|
||||
element.columns.forEach((child) => {
|
||||
|
|
@ -149,6 +154,9 @@
|
|||
if (configElement.field == t.field) {
|
||||
t.componentProps.disabled = !configElement.disabled;
|
||||
t.ifShow = configElement.ifShow;
|
||||
if (configElement.required) {
|
||||
t.itemProps.required = configElement.required;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -366,7 +374,9 @@
|
|||
});
|
||||
}
|
||||
}
|
||||
const groupRef = ref();
|
||||
async function getForm() {
|
||||
// console.log(groupRef.value.verify());
|
||||
try {
|
||||
let values = await validate();
|
||||
for (const key in values) {
|
||||
|
|
|
|||
|
|
@ -95,6 +95,31 @@
|
|||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</template>
|
||||
<template v-else-if="['CardGroup'].includes(schema.component)">
|
||||
<div style="width: 100%">
|
||||
<div style="display: flex">
|
||||
{{ schema.label }}
|
||||
<div style="margin-left: 10px">
|
||||
<a-radio-group
|
||||
v-model:value="noTitleKey"
|
||||
:options="schema.componentProps.options"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<template v-for="(item, index) in schema.componentProps.options" :key="index">
|
||||
<a-card style="width: 100%" v-show="noTitleKey === item.value">
|
||||
<FormRender
|
||||
v-for="(childItem, k) in item.children"
|
||||
:key="k"
|
||||
:schema="childItem"
|
||||
:formData="formData"
|
||||
:formConfig="formConfig"
|
||||
:setFormModel="setFormModel"
|
||||
/>
|
||||
</a-card>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<VFormItem
|
||||
v-if="(isCreateOrModifyComponent && schema.display) || !isCreateOrModifyComponent"
|
||||
|
|
@ -162,6 +187,10 @@
|
|||
let subTableId = ref(null);
|
||||
let subTableData = ref([]);
|
||||
let subTableList = ref([]);
|
||||
const noTitleKey = ref('0')
|
||||
if(props.schema.component === 'CardGroup'){
|
||||
noTitleKey.value = props.schema.componentProps.options[0].value
|
||||
}
|
||||
|
||||
// if (props.formConfig.schemas) {
|
||||
// props.formConfig.schemas.forEach((item) => {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
:data="cardGroupData[index]"
|
||||
:formData="cardGourpFormData"
|
||||
:parentValue="cardGroupData[index].field"
|
||||
:callModal="true"
|
||||
/>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
|
@ -63,6 +64,7 @@
|
|||
:data="cardGroupData[0]"
|
||||
:formData="cardGourpFormData"
|
||||
:parentValue="cardGroupData[0].field"
|
||||
:callModal="true"
|
||||
/>
|
||||
</template>
|
||||
<template v-for="(item, index) in buttonLayout" :key="index">
|
||||
|
|
|
|||
|
|
@ -219,12 +219,14 @@
|
|||
const arr: any = [];
|
||||
formScheme.value.formInfo.tabList.forEach((item, index) => {
|
||||
item.schemas.forEach((val) => {
|
||||
if (val.columns) {
|
||||
if (val.columns && (val.component === "Grid" && val.type === "subTable")) {
|
||||
val.columns.forEach((col) => {
|
||||
col.children.forEach((chil) => {
|
||||
arr.push(chil);
|
||||
});
|
||||
});
|
||||
}else if(val.component && val.component !== "Grid"){
|
||||
arr.push(val);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -233,12 +235,14 @@
|
|||
if (formScheme.value.formInfo.tabList && formScheme.value.formInfo.tabList.length == 1) {
|
||||
const arr: any = [];
|
||||
formScheme.value.formInfo.tabList[0].schemas.forEach((item) => {
|
||||
if (item.columns) {
|
||||
if (item.columns && (item.component === "Grid" && item.type === "subTable")) {
|
||||
item.columns.forEach((col) => {
|
||||
col.children.forEach((chil) => {
|
||||
arr.push(chil);
|
||||
});
|
||||
});
|
||||
}else if(item.component && item.component !== "Grid"){
|
||||
arr.push(item)
|
||||
}
|
||||
});
|
||||
formScheme.value.formInfo.schemas = arr;
|
||||
|
|
|
|||
|
|
@ -211,6 +211,9 @@
|
|||
if (item.type == 'subTable') {
|
||||
item.columns = changeCloums(item.columns, tableData);
|
||||
}
|
||||
if (item.columns) {
|
||||
item.columns = changeCloums(item.columns, tableData);
|
||||
}
|
||||
if (
|
||||
item.component != 'CardGroup' &&
|
||||
item.component != 'Grid' &&
|
||||
|
|
@ -245,6 +248,9 @@
|
|||
if (list.type == 'subTable') {
|
||||
list.columns = changeCloums(list.columns, tableData);
|
||||
}
|
||||
if (list.columns) {
|
||||
list.columns = changeCloums(list.columns, tableData);
|
||||
}
|
||||
if (
|
||||
list.component != 'CardGroup' &&
|
||||
list.component != 'Grid' &&
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@
|
|||
functionGetForm,
|
||||
functionDeleteForm,
|
||||
} from '@/api/demo/formScheme';
|
||||
import { cardNestStructure } from '@/views/demo/onlineform/util.ts';
|
||||
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
|
||||
|
|
@ -216,7 +217,8 @@
|
|||
createMessage.error('预览失败');
|
||||
return;
|
||||
}
|
||||
formConfig.value.schemas = scheme.formInfo.schemas;
|
||||
scheme.formInfo.tabList = cardNestStructure(scheme.formInfo.tabList);
|
||||
formConfig.value.schemas = scheme.formInfo.tabList[0].schemas;
|
||||
eFormPreview.value.showModal(cloneDeep(formConfig.value));
|
||||
}
|
||||
// 表单列表-历史记录
|
||||
|
|
|
|||
|
|
@ -47,6 +47,11 @@
|
|||
try {
|
||||
const values = await validate();
|
||||
let query = values;
|
||||
if (query.id) {
|
||||
query.id = Number(query.id);
|
||||
} else {
|
||||
query.id = 0;
|
||||
}
|
||||
// 调用接口
|
||||
if (!unref(isUpdate)) {
|
||||
const data = await addDept(query);
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ export const formGroupSchema: FormSchema[] = [
|
|||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'id',
|
||||
label: '名称',
|
||||
label: '部门id',
|
||||
component: 'Input',
|
||||
ifShow:false
|
||||
ifShow: true,
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
|
|
|
|||
|
|
@ -26,7 +26,11 @@
|
|||
<a-input v-model:value="formData.name" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="title" label="对象类型" name="objectType">
|
||||
<a-radio-group v-model:value="formData.objectType" name="radioGroup">
|
||||
<a-radio-group
|
||||
v-model:value="formData.objectType"
|
||||
name="radioGroup"
|
||||
@change="radioObjectChange"
|
||||
>
|
||||
<a-radio value="2">角色</a-radio>
|
||||
<a-radio value="1">用户</a-radio>
|
||||
</a-radio-group>
|
||||
|
|
@ -38,6 +42,14 @@
|
|||
placeholder="请选择"
|
||||
:options="roleOptions"
|
||||
/>
|
||||
<a-select
|
||||
v-if="formData.objectType == '1'"
|
||||
v-model:value="formData.objectId"
|
||||
show-search
|
||||
placeholder="请选择"
|
||||
:options="userOptions"
|
||||
:filter-option="filterOption"
|
||||
/>
|
||||
</a-form-item>
|
||||
<div
|
||||
style="margin: 0 25px 0 60px"
|
||||
|
|
@ -56,6 +68,7 @@
|
|||
v-model:value="item.f_FieldId"
|
||||
placeholder="请选择"
|
||||
:options="fieldOptions"
|
||||
:field-names="{ label: 'label', value: 'key' }"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -121,24 +134,30 @@
|
|||
MinusOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { formSchema } from './index.data';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
const { createMessage } = useMessage();
|
||||
import { fun_GetPageList } from '@/api/demo/formModule';
|
||||
import { getRoleListByPage } from '@/api/demo/system';
|
||||
import { getAccountList } from '@/api/demo/system';
|
||||
import { fun_GetPageList } from '@/api/demo/formModule';
|
||||
import { addTableData, editTableData } from '@/api/permission/data';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
||||
const isUpdate = ref(true);
|
||||
const labelCol = { span: 4 };
|
||||
const wrapperCol = { span: 19 };
|
||||
const formData: any = ref({
|
||||
code: '',
|
||||
codeName: '',
|
||||
name: '',
|
||||
objectId: '',
|
||||
objectName: '',
|
||||
objectType: '2',
|
||||
type: 2,
|
||||
formula: {
|
||||
formula: '',
|
||||
conditions: [],
|
||||
|
|
@ -147,6 +166,7 @@
|
|||
const formRef = ref();
|
||||
const codeOptions: any = ref([]);
|
||||
const roleOptions: any = ref([]);
|
||||
const userOptions: any = ref([]);
|
||||
const fieldOptions: any = ref([]);
|
||||
const symbolOptions: any = ref([
|
||||
{ label: '等于', value: '1' },
|
||||
|
|
@ -161,13 +181,14 @@
|
|||
{ label: '不包含于', value: '10' },
|
||||
]);
|
||||
const fieldTypeOptions: any = ref([
|
||||
{ label: '文本', value: '1' },
|
||||
{ label: '文本(string)', value: '1' },
|
||||
{ label: '登录者ID', value: '2' },
|
||||
{ label: '登录者账号', value: '3' },
|
||||
{ label: '登录者部门', value: '4' },
|
||||
{ label: '登录者部门及下属部门', value: '5' },
|
||||
{ label: '登录者岗位', value: '6' },
|
||||
{ label: '登录者角色', value: '7' },
|
||||
{ label: '文本(int)', value: '10' },
|
||||
]);
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
|
|
@ -175,9 +196,25 @@
|
|||
isUpdate.value = !!data?.isUpdate;
|
||||
getCodeListData(); //获取功能列表
|
||||
getRoleListData(); //获取角色列表
|
||||
getUserListData(); //获取用户
|
||||
if (unref(isUpdate)) {
|
||||
console.log('formData', formData);
|
||||
formData.value = data.record;
|
||||
formData.value.objectType = data.record.objectType.toString();
|
||||
formData.value.formula = JSON.parse(data.record.formula);
|
||||
} else {
|
||||
formData.value = {
|
||||
code: '',
|
||||
codeName: '',
|
||||
name: '',
|
||||
objectId: '',
|
||||
objectName: '',
|
||||
objectType: '2',
|
||||
type: 2,
|
||||
formula: {
|
||||
formula: '',
|
||||
conditions: [],
|
||||
},
|
||||
};
|
||||
}
|
||||
});
|
||||
const getTitle = computed(() =>
|
||||
|
|
@ -190,25 +227,25 @@
|
|||
f_FieldValue: '',
|
||||
f_Symbol: '1',
|
||||
};
|
||||
formData.formula.conditions.push(obj);
|
||||
formData.value.formula.conditions.push(obj);
|
||||
}
|
||||
function delRoleClick(e) {
|
||||
console.log('1111', e);
|
||||
formData.formula.conditions.splice(e, 1);
|
||||
formData.value.formula.conditions.splice(e, 1);
|
||||
}
|
||||
function radioObjectChange() {
|
||||
formData.value.objectId = '';
|
||||
}
|
||||
function codeChange(e) {
|
||||
console.log('eee', e);
|
||||
console.log('codeOptions', codeOptions.value);
|
||||
codeOptions.value.forEach((item) => {
|
||||
if (item.value == e) {
|
||||
fieldOptions.value = item.column;
|
||||
formData.formula.conditions = [];
|
||||
formData.value.formula.conditions = [];
|
||||
}
|
||||
});
|
||||
console.log('fieldOptions', fieldOptions)
|
||||
}
|
||||
function getCodeListData() {
|
||||
fun_GetPageList().then((res: Recordable) => {
|
||||
console.log('1111', res);
|
||||
const arr: any = [];
|
||||
if (res.items) {
|
||||
res.items.forEach((item) => {
|
||||
|
|
@ -217,9 +254,11 @@
|
|||
value: item.id,
|
||||
column: JSON.parse(item.scheme).table.columns,
|
||||
});
|
||||
if (formData.value.code == item.id) {
|
||||
fieldOptions.value = JSON.parse(item.scheme).table.columns;
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log('llllll', arr);
|
||||
codeOptions.value = arr;
|
||||
});
|
||||
}
|
||||
|
|
@ -230,13 +269,27 @@
|
|||
res.items.forEach((item) => {
|
||||
arr.push({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
value: item.id.toString(),
|
||||
});
|
||||
});
|
||||
}
|
||||
roleOptions.value = arr;
|
||||
});
|
||||
}
|
||||
function getUserListData() {
|
||||
getAccountList({ page: 1, limit: 999999 }).then((res: Recordable) => {
|
||||
const arr: any = [];
|
||||
if (res.items) {
|
||||
res.items.forEach((item) => {
|
||||
arr.push({
|
||||
label: item.name,
|
||||
value: item.id.toString(),
|
||||
});
|
||||
});
|
||||
}
|
||||
userOptions.value = arr;
|
||||
});
|
||||
}
|
||||
|
||||
const rules = reactive({
|
||||
code: [{ required: true, message: '请选择功能', trigger: 'blur' }],
|
||||
|
|
@ -250,8 +303,19 @@
|
|||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
console.log('values', formData, toRaw(formData));
|
||||
const params = formData.value;
|
||||
if (formData.value.objectType == '1') {
|
||||
const objectObj = userOptions.value.filter((ele) => ele.value == params.objectId);
|
||||
console.log('objectObj', objectObj);
|
||||
params.objectName = objectObj[0].label;
|
||||
} else {
|
||||
const objectObj = roleOptions.value.filter((ele) => ele.value == params.objectId);
|
||||
console.log('objectObj', objectObj);
|
||||
params.objectName = objectObj[0].label;
|
||||
}
|
||||
|
||||
const codeObj = codeOptions.value.filter((ele) => ele.value == params.code);
|
||||
params.codeName = codeObj[0].label;
|
||||
if (!unref(isUpdate)) {
|
||||
addTableData(params).then((res: any) => {
|
||||
closeDrawer();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { BasicColumn, FormSchema } from '@/components/Table';
|
||||
import { h } from 'vue';
|
||||
import { Tag } from 'ant-design-vue';
|
||||
import { getRoleListByPage } from '@/api/demo/system';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '编码',
|
||||
dataIndex: 'code',
|
||||
dataIndex: 'codeName',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
|
|
@ -21,10 +22,11 @@ export const columns: BasicColumn[] = [
|
|||
let color = '';
|
||||
let text = '';
|
||||
const formType = record.objectType;
|
||||
if (formType === 2) {
|
||||
if (formType == 2 || formType == '2') {
|
||||
color = 'green';
|
||||
text = '角色';
|
||||
} else if (formType === 1) {
|
||||
}
|
||||
if (formType == 1 || formType == '1') {
|
||||
color = 'yellow';
|
||||
text = '用户';
|
||||
}
|
||||
|
|
@ -33,7 +35,7 @@ export const columns: BasicColumn[] = [
|
|||
},
|
||||
{
|
||||
title: '授权对象',
|
||||
dataIndex: 'objectId',
|
||||
dataIndex: 'objectName',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
|
|
@ -44,10 +46,11 @@ export const columns: BasicColumn[] = [
|
|||
let color = '';
|
||||
let text = '';
|
||||
const formType = record.type;
|
||||
if (formType === 2) {
|
||||
if (formType == 2 || formType == '2') {
|
||||
color = 'green';
|
||||
text = '自定义表单';
|
||||
} else if (formType === 1) {
|
||||
}
|
||||
if (formType == 1 || formType == '1') {
|
||||
color = 'yellow';
|
||||
text = '普通';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted } from 'vue';
|
||||
import { nextTick, onMounted, ref } from 'vue';
|
||||
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { PageWrapper } from '@/components/Page';
|
||||
|
|
@ -40,6 +40,7 @@
|
|||
// api
|
||||
import { columns, searchFormSchema } from './index.data';
|
||||
import { getTablesListData, getDetailsData, delTableData } from '@/api/permission/data';
|
||||
import { getRoleListByPage } from '@/api/demo/system';
|
||||
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
|
||||
|
|
@ -103,15 +104,15 @@
|
|||
id: record.id,
|
||||
};
|
||||
createConfirm({
|
||||
iconType: 'info',
|
||||
iconType: 'warning',
|
||||
title: '删除',
|
||||
content: '确定要删除当前表单吗?',
|
||||
content: '确定要删除此条数据吗?',
|
||||
onOk: async () => {
|
||||
let result = await delTableData(query);
|
||||
if (result) {
|
||||
createMessage.success('表单删除成功!');
|
||||
createMessage.success('删除成功!');
|
||||
} else {
|
||||
createMessage.error('表单删除失败!');
|
||||
createMessage.error('删除失败!');
|
||||
}
|
||||
reload();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -718,4 +718,5 @@
|
|||
::v-deep .full-modal .ant-modal-body{
|
||||
height:95%!important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -48,12 +48,15 @@
|
|||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { getDetail } from '@/api/sys/WFSchemeInfo';
|
||||
import { flowStore } from '@/store/modules/flow';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const flowWfDataStore = flowStore();
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
const auditOpen = ref(false);
|
||||
const processId = ref('');
|
||||
const route = useRoute();
|
||||
searchInfo.category = route.query.category;
|
||||
const [registerTable, { reload }] = useTable({
|
||||
api: getLoadMyCompletedPage,
|
||||
columns: [
|
||||
|
|
|
|||
|
|
@ -38,10 +38,13 @@
|
|||
import { getLoadMyDelegatePage } from '@/api/sys/WFTask';
|
||||
import { Tag } from 'ant-design-vue';
|
||||
import { Look } from './process/page';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const auditOpen = ref(false);
|
||||
const processId = ref('');
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
const route = useRoute();
|
||||
searchInfo.category = route.query.category;
|
||||
const [registerTable] = useTable({
|
||||
api: getLoadMyDelegatePage,
|
||||
columns: [
|
||||
|
|
|
|||
|
|
@ -44,11 +44,14 @@
|
|||
import { getLoadMyDraftPage, deleteDraft } from '@/api/sys/WFProcess';
|
||||
import { Initiate } from './process/page';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
const { createMessage } = useMessage();
|
||||
const auditOpen = ref(false);
|
||||
const processId = ref('');
|
||||
const route = useRoute();
|
||||
searchInfo.category = route.query.category;
|
||||
const [registerTable, { reload }] = useTable({
|
||||
api: getLoadMyDraftPage,
|
||||
columns: [
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@
|
|||
:color="btn.type"
|
||||
:type="btn.type ? btn.type : 'primary'"
|
||||
@click="handleBtnClick(btn)"
|
||||
>{{ btn.name }}</a-button
|
||||
>{{ btn.name }} {{ btn.code }}</a-button
|
||||
>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
|
@ -148,6 +148,31 @@
|
|||
</a-timeline>
|
||||
</a-drawer>
|
||||
</div>
|
||||
<a-modal
|
||||
v-model:open="rejectOpen"
|
||||
width="50%"
|
||||
title="驳回节点选择"
|
||||
@ok="rejectHandleOk"
|
||||
:destroyOnClose="true"
|
||||
>
|
||||
<div class="l-from-body">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
labelAlign="left"
|
||||
:label-col="rejectLabelCol"
|
||||
:wrapper-col="rejectWrapperCol"
|
||||
>
|
||||
<a-form-item label="驳回到">
|
||||
<a-select
|
||||
v-model:value="NextId"
|
||||
placeholder="驳回节点选择"
|
||||
:field-names="{ label: 'name', value: 'id' }"
|
||||
:options="rejectRelations"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</a-modal>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
|
||||
|
|
@ -180,7 +205,8 @@
|
|||
const formBoxRef = ref<any>();
|
||||
const emit = defineEmits(['closeModel']);
|
||||
const keyValue = ref('');
|
||||
|
||||
const rejectLabelCol = { span: 5 };
|
||||
const rejectWrapperCol = { span: 17 };
|
||||
const flowWfDataStore = flowStore();
|
||||
const prefixCls = 'preview-box';
|
||||
const flowContent = ref('');
|
||||
|
|
@ -194,6 +220,8 @@
|
|||
const processVisble = ref(false);
|
||||
const AsyncComponent = ref();
|
||||
const pcForm = ref();
|
||||
const NextId = ref('');
|
||||
const rejectRelations = ref([]);
|
||||
const props = defineProps({
|
||||
processId: String,
|
||||
taskId: String,
|
||||
|
|
@ -268,6 +296,7 @@
|
|||
const auditName = ref('audit');
|
||||
const auditTitleVal = ref('审批栏');
|
||||
const auditNameVal = ref('审批意见');
|
||||
const rejectOpen = ref(false);
|
||||
function changeActive(activeKey) {
|
||||
if (activeKey == 'flow') {
|
||||
processVisble.value = true;
|
||||
|
|
@ -283,6 +312,7 @@
|
|||
}
|
||||
|
||||
async function getTaskInfo() {
|
||||
rejectRelations.value = [];
|
||||
let query: any = {
|
||||
id: props.taskId,
|
||||
};
|
||||
|
|
@ -294,6 +324,14 @@
|
|||
let content = JSON.parse(data.scheme.content);
|
||||
let wfData = content.wfData;
|
||||
console.log(wfData);
|
||||
const finishedTaskSet = Array.from(new Set(data.flowViewer.finishedTaskSet));
|
||||
finishedTaskSet.forEach((item) => {
|
||||
wfData.forEach((element) => {
|
||||
if (item == element.id && element.id != data.task.unitId) {
|
||||
rejectRelations.value.push(element);
|
||||
}
|
||||
});
|
||||
});
|
||||
const auditNode = wfData.find((t) => t.id == data.task.unitId);
|
||||
console.log(auditNode);
|
||||
if (auditNode.auditTitle) {
|
||||
|
|
@ -504,6 +542,7 @@
|
|||
const currentNode: currentNodeObject =
|
||||
wfData.find((t) => t.id == designerData.task.unitId) || {};
|
||||
designerData.currentNode = currentNode;
|
||||
console.log('currentNode', currentNode);
|
||||
// 设置审核按钮
|
||||
const btns: taskBtnsType[] = [];
|
||||
if (currentNode.type == 'bpmn:StartEvent') {
|
||||
|
|
@ -583,7 +622,7 @@
|
|||
const funName = btn.code;
|
||||
const res = await pcForm.value[funName]();
|
||||
console.log(res);
|
||||
handleCreateFlow(processId);
|
||||
handleSubmit(btn);
|
||||
} else {
|
||||
handleSubmit(btn);
|
||||
}
|
||||
|
|
@ -616,8 +655,11 @@
|
|||
des: formData.value.des,
|
||||
});
|
||||
} else {
|
||||
console.log(designerData.currentNode.rejectType);
|
||||
console.log(btn.code);
|
||||
if (designerData.currentNode.rejectType == '2' && btn.code == 'disagree') {
|
||||
designerData.selectRejectNodeVisible = true;
|
||||
rejectOpen.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -630,7 +672,7 @@
|
|||
// return;
|
||||
// }
|
||||
}
|
||||
res = await auditFun();
|
||||
// res = await auditFun();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -706,6 +748,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function handlerShowGeomtrys(){
|
||||
// 根据ids获取图斑
|
||||
try{
|
||||
|
|
@ -737,6 +780,21 @@
|
|||
createMessage.error("当前数据没有图斑!");
|
||||
}
|
||||
}
|
||||
// 驳回到指定节点
|
||||
async function rejectHandleOk() {
|
||||
const data = await audit(props.taskId, {
|
||||
code: designerData.currentBtn.code,
|
||||
name: designerData.currentBtn.name,
|
||||
des: formData.value.des,
|
||||
NextId: NextId.value,
|
||||
});
|
||||
if (data) {
|
||||
closePage();
|
||||
return createMessage.success('成功');
|
||||
} else {
|
||||
return createMessage.error('失败');
|
||||
}
|
||||
}
|
||||
onBeforeMount(() => {
|
||||
getTaskInfo();
|
||||
});
|
||||
|
|
@ -822,6 +880,7 @@
|
|||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .ant-modal-footer{
|
||||
display:none!important;
|
||||
height:0px!important;
|
||||
|
|
@ -843,4 +902,9 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
.l-from-body {
|
||||
padding: 10px 30px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@
|
|||
import { Audit } from './process/page';
|
||||
import { flowStore } from '@/store/modules/flow';
|
||||
import { Preview } from '../create/index';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const flowWfDataStore = flowStore();
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
|
|
@ -72,7 +73,8 @@
|
|||
const auditOpen = ref(false);
|
||||
const previewOpen = ref(false);
|
||||
const childRecord = ref();
|
||||
// searchInfo.name = 'deded';
|
||||
const route = useRoute();
|
||||
searchInfo.category = route.query.category;
|
||||
const [registerTable, { reload }] = useTable({
|
||||
api: getLoadMyUncompletedPage,
|
||||
columns: [
|
||||
|
|
|
|||
Loading…
Reference in New Issue