Compare commits
No commits in common. "caf00a8e136fd849e6bd892e4779803ce482f2e9" and "eb109d408e65fdc53bef55bb72ca2af3d7ee61e0" have entirely different histories.
caf00a8e13
...
eb109d408e
|
|
@ -39,21 +39,10 @@ export const LoginRoute: AppRouteRecordRaw = {
|
||||||
title: t('routes.basic.login'),
|
title: t('routes.basic.login'),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
export const H5HtmlRoute: AppRouteRecordRaw = {
|
|
||||||
path: '/h5html',
|
|
||||||
name: 'h5html',
|
|
||||||
component: () => import('@/views/demo/h5html/index.vue'),
|
|
||||||
meta: {
|
|
||||||
title: t('routes.basic.h5html'),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Basic routing without permission
|
// Basic routing without permission
|
||||||
// 未经许可的基本路由
|
// 未经许可的基本路由
|
||||||
export const basicRoutes = [
|
export const basicRoutes = [
|
||||||
H5HtmlRoute,
|
|
||||||
LoginRoute,
|
LoginRoute,
|
||||||
RootRoute,
|
RootRoute,
|
||||||
...mainOutRoutes,
|
...mainOutRoutes,
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ const transform: AxiosTransform = {
|
||||||
if (options.errorMessageMode === 'modal') {
|
if (options.errorMessageMode === 'modal') {
|
||||||
createErrorModal({ title: t('sys.api.errorTip'), content: timeoutMsg });
|
createErrorModal({ title: t('sys.api.errorTip'), content: timeoutMsg });
|
||||||
} else if (options.errorMessageMode === 'message') {
|
} else if (options.errorMessageMode === 'message') {
|
||||||
// createMessage.error(timeoutMsg);
|
createMessage.error(timeoutMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(timeoutMsg || t('sys.api.apiRequestFailed'));
|
throw new Error(timeoutMsg || t('sys.api.apiRequestFailed'));
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@
|
||||||
}
|
}
|
||||||
getOutKeyList({tableNames: fieldTableValue.value, dbCode: receivedData.dbCode}).then((data: AreaRespVO[]) => {
|
getOutKeyList({tableNames: fieldTableValue.value, dbCode: receivedData.dbCode}).then((data: AreaRespVO[]) => {
|
||||||
let arr: any[] = []
|
let arr: any[] = []
|
||||||
if(data && data[0]){
|
if(data[0]){
|
||||||
data[0].db_codecolumnsList.forEach(item =>{
|
data[0].db_codecolumnsList.forEach(item =>{
|
||||||
arr.push({
|
arr.push({
|
||||||
label: item.dbColumnName,
|
label: item.dbColumnName,
|
||||||
|
|
|
||||||
|
|
@ -8,43 +8,7 @@ import { ComponentType } from '@/components/Form/src/types';
|
||||||
|
|
||||||
import { componentMap as Cmp } from '../components';
|
import { componentMap as Cmp } from '../components';
|
||||||
import { Component } from 'vue';
|
import { Component } from 'vue';
|
||||||
import { getDeptList,getAccountList,getPosGroupList } from '@/api/demo/system';
|
|
||||||
|
|
||||||
//获取部门列表数据
|
|
||||||
const deptTreeData = await Promise.all([getDeptListData()])
|
|
||||||
function getDeptListData(){
|
|
||||||
let param = {
|
|
||||||
page: 1,
|
|
||||||
limit: 9999
|
|
||||||
};
|
|
||||||
return getDeptList( param ).then( data => {
|
|
||||||
return data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取职级列表数据
|
|
||||||
const positionTreeData = await Promise.all([getPositionListData()])
|
|
||||||
function getPositionListData(){
|
|
||||||
let param = {
|
|
||||||
page: 1,
|
|
||||||
limit: 9999
|
|
||||||
};
|
|
||||||
return getPosGroupList( param ).then( data => {
|
|
||||||
return data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//获取人员选择列表数据
|
|
||||||
const userTreeData = await Promise.all([getUserListData()])
|
|
||||||
function getUserListData(){
|
|
||||||
let param = {
|
|
||||||
page: 1,
|
|
||||||
limit: 9999
|
|
||||||
};
|
|
||||||
return getAccountList( param ).then( data => {
|
|
||||||
return data.items
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const componentMap = new Map<string, Component>();
|
const componentMap = new Map<string, Component>();
|
||||||
|
|
||||||
//如果有其它控件,可以在这里初始化
|
//如果有其它控件,可以在这里初始化
|
||||||
|
|
@ -92,33 +56,41 @@ export const customComponents: IVFormComponent[] = [
|
||||||
componentProps: {},
|
componentProps: {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'TreeSelect',
|
component: 'Select',
|
||||||
label: '职级选择',
|
label: '公司选择',
|
||||||
icon: 'gg:select',
|
icon: 'gg:select',
|
||||||
field: '',
|
field: '',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
fieldNames:{
|
options: [
|
||||||
children: 'children',
|
{
|
||||||
label: 'name',
|
label: '选项1',
|
||||||
value: 'id',
|
value: '1',
|
||||||
},
|
},
|
||||||
treeData: positionTreeData[0],
|
{
|
||||||
|
label: '选项2',
|
||||||
|
value: '2',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'TreeSelect',
|
component: 'Select',
|
||||||
label: '部门选择',
|
label: '部门选择',
|
||||||
icon: 'clarity:tree-view-line',
|
icon: 'gg:select',
|
||||||
field: '',
|
field: '',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
fieldNames:{
|
options: [
|
||||||
children: 'children',
|
{
|
||||||
label: 'name',
|
label: '选项1',
|
||||||
value: 'id',
|
value: '1',
|
||||||
},
|
},
|
||||||
treeData: deptTreeData[0],
|
{
|
||||||
|
label: '选项2',
|
||||||
|
value: '2',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -128,11 +100,16 @@ export const customComponents: IVFormComponent[] = [
|
||||||
field: '',
|
field: '',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
fieldNames:{
|
options: [
|
||||||
label: 'name',
|
{
|
||||||
value: 'account',
|
label: '选项1',
|
||||||
},
|
value: '1',
|
||||||
options: userTreeData[0],
|
},
|
||||||
|
{
|
||||||
|
label: '选项2',
|
||||||
|
value: '2',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
import { BasicColumn, FormSchema } from '@/components/Table';
|
|
||||||
import { h } from 'vue';
|
|
||||||
import { Tag } from 'ant-design-vue';
|
|
||||||
|
|
||||||
export const columns: BasicColumn[] = [
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '名称',
|
|
||||||
dataIndex: 'name',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '分类',
|
|
||||||
dataIndex: 'category',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '类型',
|
|
||||||
dataIndex: 'formType',
|
|
||||||
width: 80,
|
|
||||||
customRender: ({ record }) => {
|
|
||||||
const status = record.formType;
|
|
||||||
const enable = ~~status === 0;
|
|
||||||
const color = enable ? '#67c23a' : '#e6a23c';
|
|
||||||
const text = enable ? '常规表单' : '视图表单';
|
|
||||||
return h(Tag, { color: color }, () => text);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建人',
|
|
||||||
dataIndex: 'createUserName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建时间',
|
|
||||||
dataIndex: 'createDate'
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: '备注',
|
|
||||||
// dataIndex: 'remark',
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [
|
|
||||||
{
|
|
||||||
field: 'key',
|
|
||||||
label: '关键字',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
@ -1,121 +0,0 @@
|
||||||
<template>
|
|
||||||
<BasicTable @register="registerTable">
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="column.key === 'action'">
|
|
||||||
<TableAction :actions="[
|
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '删除',
|
|
||||||
color: 'error',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否删除该数据',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
]" />
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
<template #toolbar>
|
|
||||||
<a-button type="primary" @click="handleAddForm(eFormPreview!)"> 新增 </a-button>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
</BasicTable>
|
|
||||||
|
|
||||||
<VformRender ref="eFormPreview" :formConfig="formConfig" @renderdata="renderdata" />
|
|
||||||
|
|
||||||
</template>
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { onMounted, ref, nextTick, unref,reactive } from 'vue';
|
|
||||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
|
||||||
import { getFormGroupList,getBaseConfigList } from '@/api/formdesign/index';
|
|
||||||
import { columns, searchFormSchema } from './index.data';
|
|
||||||
import { cloneDeep } from 'lodash-es';
|
|
||||||
import VformRender from '../form-design/components/VformRender/index.vue';
|
|
||||||
import { IFormConfig,IToolbarMethods } from '../form-design/typings/v-form-component';
|
|
||||||
|
|
||||||
const eFormPreview = ref<null | IToolbarMethods>(null);
|
|
||||||
|
|
||||||
const [registerTable, { reload, getSelectRows }] = useTable({
|
|
||||||
title: '表单列表',
|
|
||||||
api: getFormGroupList,
|
|
||||||
rowKey: 'f_Id',
|
|
||||||
columns,
|
|
||||||
formConfig: {
|
|
||||||
labelWidth: 120,
|
|
||||||
schemas: searchFormSchema,
|
|
||||||
},
|
|
||||||
useSearchForm: true,
|
|
||||||
showTableSetting: true,
|
|
||||||
bordered: true,
|
|
||||||
beforeFetch: (data) => {
|
|
||||||
// 接口请求前 参数处理
|
|
||||||
var temp = {
|
|
||||||
page: data.page,
|
|
||||||
limit: data.limit,
|
|
||||||
keyWord: data.key,
|
|
||||||
category: data.f_Category
|
|
||||||
};
|
|
||||||
return temp;
|
|
||||||
},
|
|
||||||
afterFetch: (data) => {
|
|
||||||
|
|
||||||
},
|
|
||||||
handleSearchInfoFn(info) {
|
|
||||||
return info;
|
|
||||||
},
|
|
||||||
actionColumn: {
|
|
||||||
width: 180,
|
|
||||||
title: '操作',
|
|
||||||
dataIndex: 'action',
|
|
||||||
// slots: { customRender: 'action' },
|
|
||||||
fixed: undefined,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const formConfig = ref<IFormConfig>({
|
|
||||||
// 表单配置
|
|
||||||
schemas: [],
|
|
||||||
layout: 'horizontal',
|
|
||||||
labelLayout: 'flex',
|
|
||||||
labelWidth: 100,
|
|
||||||
labelCol: {},
|
|
||||||
wrapperCol: {},
|
|
||||||
currentItem: {
|
|
||||||
component: '',
|
|
||||||
componentProps: {},
|
|
||||||
},
|
|
||||||
activeKey: 1,
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleAddForm = (Modal: IToolbarMethods) => {
|
|
||||||
console.log('formConfig',formConfig)
|
|
||||||
const config = cloneDeep(formConfig.value);
|
|
||||||
Modal?.showModal(config);
|
|
||||||
}
|
|
||||||
function handleEdit(record: Recordable) {
|
|
||||||
|
|
||||||
}
|
|
||||||
function handleDelete(record: Recordable) {
|
|
||||||
// openAccountModal(true, {
|
|
||||||
// record,
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
function getPublicForm(){
|
|
||||||
getBaseConfigList({ id: "ed985a1e-b007-43d1-af14-be4e44018c8b" }).then((res: AreaRespVO[]) =>{
|
|
||||||
let obj = JSON.parse(res.scheme.scheme)
|
|
||||||
console.log('res',obj.formInfo)
|
|
||||||
formConfig.value.schemas = obj.formInfo.schemas
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//表单填写数据
|
|
||||||
function renderdata(e){
|
|
||||||
console.log('renderdata',e)
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getPublicForm()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
@ -104,14 +104,9 @@
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
function getPublicForm(){
|
function getPublicForm(){
|
||||||
getBaseConfigList({ id: "e03bd1db-7a4f-43b2-9e8a-f6cd8c2126be" }).then((res: AreaRespVO[]) =>{
|
getBaseConfigList({ id: "ed985a1e-b007-43d1-af14-be4e44018c8b" }).then((res: AreaRespVO[]) =>{
|
||||||
let obj = JSON.parse(res.scheme.scheme)
|
let obj = JSON.parse(res.scheme.scheme)
|
||||||
console.log('res',obj.formInfo)
|
console.log('res',obj.formInfo)
|
||||||
if(obj.formInfo.schemas){
|
|
||||||
obj.formInfo.schemas.forEach(item =>{
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
formConfig.value.schemas = obj.formInfo.schemas
|
formConfig.value.schemas = obj.formInfo.schemas
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,8 @@
|
||||||
beforeFetch: (data) => {
|
beforeFetch: (data) => {
|
||||||
// 接口请求前 参数处理
|
// 接口请求前 参数处理
|
||||||
var temp = {
|
var temp = {
|
||||||
page: data.page,
|
pageIndex: data.page,
|
||||||
limit: data.limit,
|
pageSize: data.limit,
|
||||||
keyWord: data.key,
|
keyWord: data.key,
|
||||||
dbCode: receiceDbCode.value
|
dbCode: receiceDbCode.value
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -230,8 +230,29 @@ export const formSchema: FormSchema[] = [
|
||||||
colProps: {
|
colProps: {
|
||||||
span: 24,
|
span: 24,
|
||||||
},
|
},
|
||||||
|
// componentProps: () => {
|
||||||
|
// return {
|
||||||
|
// api: getDataBaseCodeList,
|
||||||
|
// // 接口返回数据
|
||||||
|
// resultField: 'result',
|
||||||
|
// labelField: 'text',
|
||||||
|
// valueField: 'value',
|
||||||
|
|
||||||
|
// };
|
||||||
|
// }
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
// api: () => {
|
||||||
|
// return new Promise((resolve) => {
|
||||||
|
// resolve([
|
||||||
|
// {
|
||||||
|
// title: 'Parent Node',
|
||||||
|
// value: '0-0',
|
||||||
|
// },
|
||||||
|
// ]);
|
||||||
|
// });
|
||||||
|
// },
|
||||||
api: () => getDataBaseCodeList().then((data: AreaRespVO[]) => {
|
api: () => getDataBaseCodeList().then((data: AreaRespVO[]) => {
|
||||||
|
console.log('aaaaadata',data)
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
resolve(data);
|
resolve(data);
|
||||||
});
|
});
|
||||||
|
|
@ -243,8 +264,15 @@ export const formSchema: FormSchema[] = [
|
||||||
console.log('ApiTreeSelect====>:', e, v);
|
console.log('ApiTreeSelect====>:', e, v);
|
||||||
},
|
},
|
||||||
onLoadData: ({ treeData, resolve, treeNode }) => {
|
onLoadData: ({ treeData, resolve, treeNode }) => {
|
||||||
|
console.log('treeNode====>:', treeNode);
|
||||||
|
console.log('treeData====>:', treeData);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
// const children: Recordable[] = [
|
||||||
|
// { title: `Child Node ${treeNode.eventKey}-0`, value: `${treeNode.eventKey}-0` },
|
||||||
|
// { title: `Child Node ${treeNode.eventKey}-1`, value: `${treeNode.eventKey}-1` },
|
||||||
|
// ];
|
||||||
const children: Recordable[] = []
|
const children: Recordable[] = []
|
||||||
|
console.log('children',children)
|
||||||
treeData.value.forEach(item =>{
|
treeData.value.forEach(item =>{
|
||||||
if(item.id == treeNode.id){
|
if(item.id == treeNode.id){
|
||||||
if(item.childNodes){
|
if(item.childNodes){
|
||||||
|
|
@ -257,6 +285,7 @@ export const formSchema: FormSchema[] = [
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log('children22',children)
|
||||||
children.forEach((item) => {
|
children.forEach((item) => {
|
||||||
item.isLeaf = false;
|
item.isLeaf = false;
|
||||||
item.children = [];
|
item.children = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue