| | |
| | | |
| | | # Basic interface address SPA |
| | | VITE_GLOB_API_URL=http://localhost:9528/api |
| | | VITE_GLOB_SYS_API_URL=http://localhost:9528 |
| | | #VITE_GLOB_API_URL=http://172.18.8.56:9633/api |
| | | # VITE_GLOB_API_URL=http://localhost:9633/api |
| | | #Tsk Interface address |
| | |
| | | # VITE_GLOB_API_URL=/basic-api |
| | | # VITE_GLOB_API_URL=http://172.18.8.55:9533/api |
| | | VITE_GLOB_API_URL=http://47.115.28.255:9520/api |
| | | VITE_GLOB_SYS_API_URL=http://47.115.28.255:9520 |
| | | # VITE_GLOB_API_URL=http://localhost:9527/api |
| | | #Tsk Interface address |
| | | # VITE_GLOB_TSK_API_URL=http://172.18.8.55:9533/api |
| | |
| | | import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; |
| | | |
| | | export type AD_INFO = { |
| | | nation?: string; |
| | | province?: string; |
| | |
| | | USER_NAME: string; |
| | | USER_PWD: string; |
| | | CREATE_TIME: string; |
| | | STATUS_CODE:any; |
| | | STATUS_CODE: any; |
| | | } |
| | | |
| | | export interface UserGPListItem { |
| | |
| | | HALF_CHECK: string; |
| | | } |
| | | |
| | | export type EntityParams = { |
| | | Namespace?: string; |
| | | StartWith?: string; |
| | | }; |
| | | |
| | | export interface EntityList { |
| | | Total: number; |
| | | Data: EntityListItem[]; |
| | | } |
| | | |
| | | export interface EntityListItem { |
| | | FullName: string; |
| | | Namespace: string; |
| | | Name: string; |
| | | Properties: EntityPropertie[]; |
| | | } |
| | | |
| | | export interface EntityPropertie { |
| | | Name: string; |
| | | Type: string; |
| | | } |
| | | |
| | | export interface SYS_LOW_CODE { |
| | | ID: string; |
| | | CREATE_TIME: Date; |
| | | CREATE_USER: string; |
| | | UPDATE_TIME: Date; |
| | | UPDATE_USER: string; |
| | | GHOST_ROW: boolean; |
| | | AUTH_ORG: string; |
| | | AUTH_PROD: string; |
| | | AUTH_WH: string; |
| | | SEARCH_FORM_JSON: string; |
| | | BASE_FORM_JSON: string; |
| | | FORM_JSON: string; |
| | | ASSEMBLY_NAME: string; |
| | | SEARCH_ASSY_NAME: string; |
| | | CRUD_ASSY_NAME: string; |
| | | } |
| | | |
| | | /** |
| | | * @description: Request list return value |
| | | */ |
| | |
| | | export type RoleListGetResultModel = RoleListItem[]; |
| | | export type ParamsListGetResultModel = BasicFetchResult<ParamsListItem>; |
| | | export type LoginLogPageListGetResultModel = BasicFetchResult<LoginLogListItem>; |
| | | export type EntityListGetResultModel = BasicFetchResult<EntityPropertie>; |
| | |
| | | import { UserConfigFn } from 'vite'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import { buildUUID } from '../../utils/uuid'; |
| | | import { DateFormat } from '../../utils/dataformat'; |
| | | import { ApiAction, ApiActionJob, ApiActionPage } from '../model/baseModel'; |
| | |
| | | LoginLogPageListGetResultModel, |
| | | iSYS_ROLE_ORG, |
| | | iSYS_ROLE_WH, |
| | | EntityParams, |
| | | EntityList, |
| | | } from './model/systemModel'; |
| | | import { defHttp } from '/@/utils/http/axios'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | |
| | | //导å
¥ |
| | | ValidateTableImport = '/SMT/ValidateTableImport', |
| | | SaveValidateTableImport = '/SMT/SaveValidateTableImport', |
| | | GetEntityNameList = '/System/Entitys/Get', |
| | | } |
| | | |
| | | const globSetting = useGlobSetting(); |
| | | |
| | | /** |
| | | * çæapiaction,带å页 |
| | |
| | | export function getClassName<T>(ctor: new () => T): string { |
| | | return ctor.name; |
| | | } |
| | | |
| | | export const getEntityList = (params?: EntityParams) => |
| | | defHttp.get<EntityList>( |
| | | { url: Api.GetEntityNameList, params }, |
| | | { |
| | | isTransformResponse: false, |
| | | apiUrl: globSetting.sysApiUrl, |
| | | }, |
| | | ); |
| | | |
| | | export async function getEntityNameList(params?: EntityParams) { |
| | | const data = await defHttp.get<EntityList>( |
| | | { url: Api.GetEntityNameList, params }, |
| | | { |
| | | isTransformResponse: false, |
| | | apiUrl: globSetting.sysApiUrl, |
| | | }, |
| | | ); |
| | | const model = { |
| | | items: data.Data, |
| | | total: data.Total, |
| | | }; |
| | | return model; |
| | | } |
| | | |
| | | export async function getEntityPropertieList(params?: EntityParams) { |
| | | const data = await defHttp.get<EntityList>( |
| | | { url: Api.GetEntityNameList, params }, |
| | | { |
| | | isTransformResponse: false, |
| | | apiUrl: globSetting.sysApiUrl, |
| | | }, |
| | | ); |
| | | const model = { |
| | | items: data.Data.filter((x) => x.Name == params?.StartWith)[0].Properties, |
| | | total: data.Total, |
| | | }; |
| | | return model; |
| | | } |
| | | |
| | | /* éç¨è·åå®ä½è®°å½ */ |
| | | export const getEntity = async (params: { sqlcmd: string; entityName: string }) => { |
| | | const usParams = genAction(params.entityName, { |
| | | QueryAble_T: '', |
| | | where: params.sqlcmd, |
| | | order: '', |
| | | }); |
| | | return await defHttp.post( |
| | | { url: Api.QueryUrl, params: usParams }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false, |
| | | }, |
| | | ); |
| | | }; |
| | |
| | | * è·å宿¶åºåå页å表 |
| | | */ |
| | | export const getWmsItemHisListByPage = async (params: WmsItemPageParams) => { |
| | | let order = '' |
| | | let order = ''; |
| | | if (params.order != undefined) { |
| | | order = params.order == 'descend' ? (params.field + ' desc') : params.field |
| | | order = params.order == 'descend' ? params.field + ' desc' : params.field; |
| | | } |
| | | let sqlcmd = '1=1'; |
| | | if (params?.SN != undefined && params?.SN != '') { |
| | |
| | | if (params?.TRACE_INFO != undefined && params?.TRACE_INFO != '') { |
| | | sqlcmd += " And TRACE_INFO like '" + params?.TRACE_INFO + "%'"; |
| | | } |
| | | var option ={ |
| | | UserId:useUserStore().getUserInfo.userId as string, |
| | | ByOrg:true, |
| | | OrgCode:useUserStore().getUserInfo.orgCode as string |
| | | } |
| | | const option = { |
| | | UserId: useUserStore().getUserInfo.userId as string, |
| | | ByOrg: true, |
| | | OrgCode: useUserStore().getUserInfo.orgCode as string, |
| | | }; |
| | | //const rParams = genActionPage('V_WMS_ITEM_HIS', sqlcmd, params.page, params.pageSize); |
| | | if(!isNullOrEmpty(params.page)){ |
| | | const usParams = genAction('V_WMS_ITEM_HIS', { |
| | | QueryAble_T: '', |
| | | where: sqlcmd, |
| | | order: order, |
| | | page: { |
| | | pageAble_T: 'string', |
| | | draw: 1, |
| | | pageIndex: params.page, |
| | | pageSize: params.pageSize, |
| | | },option |
| | | },option); |
| | | if (!isNullOrEmpty(params.page)) { |
| | | const usParams = genAction( |
| | | 'V_WMS_ITEM_HIS', |
| | | { |
| | | QueryAble_T: '', |
| | | where: sqlcmd, |
| | | order: order, |
| | | page: { |
| | | pageAble_T: 'string', |
| | | draw: 1, |
| | | pageIndex: params.page, |
| | | pageSize: params.pageSize, |
| | | }, |
| | | option, |
| | | }, |
| | | option, |
| | | ); |
| | | return getWmsItemListByPageAsync(usParams); |
| | | }else{ |
| | | const usParams = genAction('V_WMS_ITEM_HIS', { |
| | | QueryAble_T: '', |
| | | where: sqlcmd, |
| | | option |
| | | },option); |
| | | } else { |
| | | const usParams = genAction( |
| | | 'V_WMS_ITEM_HIS', |
| | | { |
| | | QueryAble_T: '', |
| | | where: sqlcmd, |
| | | option, |
| | | }, |
| | | option, |
| | | ); |
| | | return getWmsItemListByPageAsync(usParams); |
| | | } |
| | | |
| | | }; |
| | | async function getWmsItemListByPageAsync(params: any) { |
| | | const data = await defHttp.post( |
| | | { url: Api.QueryUrl, params,timeout: 10*60*1000 }, |
| | | { url: Api.QueryUrl, params, timeout: 10 * 60 * 1000 }, |
| | | { |
| | | isTransformResponse: false, |
| | | }, |
| | | ); |
| | | let model = {} |
| | | if(isNullOrEmpty(data.Data.page)){ |
| | | model = { |
| | | let model = {}; |
| | | if (isNullOrEmpty(data.Data.page)) { |
| | | model = { |
| | | items: data.Data.Items, |
| | | }; |
| | | }else{ |
| | | model = { |
| | | } else { |
| | | model = { |
| | | items: data.Data.page.data, |
| | | total: data.Data.page.totals, |
| | | }; |
| | | } |
| | | |
| | | |
| | | return model; |
| | | } |
| | | |
| | | |
| | | //䏿å表 |
| | | // STATUSs ä»åºç¶æ |
| | |
| | | // apiUrl: globSetting.taskApiUrl |
| | | }, |
| | | ); |
| | | }; |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1717145055695" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4247" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M524.8 64c4.693 0 8.533 3.84 8.533 8.533v418.134h418.134c4.693 0 8.533 3.84 8.533 8.533v46.933a8.533 8.533 0 0 1-8.533 8.534H533.333V972.8a8.533 8.533 0 0 1-8.533 8.533h-46.933a8.533 8.533 0 0 1-8.534-8.533V554.667H51.2a8.533 8.533 0 0 1-8.533-8.534V499.2c0-4.693 3.84-8.533 8.533-8.533h418.133V72.533c0-4.693 3.84-8.533 8.534-8.533H524.8z" fill="#0a6fa4" p-id="4248"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1717145761846" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7020" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M85.33 469.33h853.33v85.33H85.33z" p-id="7021" fill="#0a6fa4"></path></svg> |
| | |
| | | VITE_GLOB_MAP_KEY, |
| | | VITE_GLOB_TSK_API_URL, |
| | | VITE_GLOB_DOWNLOAD_URL, |
| | | VITE_GLOB_SYS_API_URL, |
| | | } = getAppEnvConfig(); |
| | | |
| | | // Take global configuration |
| | | const glob: Readonly<GlobConfig> = { |
| | | title: VITE_GLOB_APP_TITLE, |
| | | apiUrl: VITE_GLOB_API_URL, |
| | | sysApiUrl: VITE_GLOB_SYS_API_URL, |
| | | taskApiUrl: VITE_GLOB_TSK_API_URL, |
| | | shortName: VITE_GLOB_APP_TITLE.replace(/\s/g, '_').replace(/-/g, '_'), |
| | | urlPrefix: VITE_GLOB_API_URL_PREFIX, |
| | |
| | | antdLocale, |
| | | }, |
| | | apiMessage: { |
| | | ...(await defHttp.get({ url: `${Api.GetLanguage}?locale=en` }, { isTransformResponse: false })), |
| | | ...(await defHttp.get( |
| | | { url: `${Api.GetLanguage}?locale=en-us` }, |
| | | { isTransformResponse: false }, |
| | | )), |
| | | antdLocale, |
| | | }, |
| | | dateLocale: null, |
| | |
| | | }, |
| | | apiMessage: { |
| | | ...(await defHttp.get( |
| | | { url: `${Api.GetLanguage}?locale=zh-CN` }, |
| | | { url: `${Api.GetLanguage}?locale=zh-cn` }, |
| | | { isTransformResponse: false }, |
| | | )), |
| | | antdLocale, |
| | |
| | | const { |
| | | VITE_GLOB_APP_TITLE, |
| | | VITE_GLOB_API_URL, |
| | | VITE_GLOB_SYS_API_URL, |
| | | VITE_GLOB_API_URL_PREFIX, |
| | | VITE_GLOB_UPLOAD_URL, |
| | | VITE_GLOB_MAP_KEY, |
| | |
| | | return { |
| | | VITE_GLOB_APP_TITLE, |
| | | VITE_GLOB_API_URL, |
| | | VITE_GLOB_SYS_API_URL, |
| | | VITE_GLOB_TSK_API_URL, |
| | | VITE_GLOB_API_URL_PREFIX, |
| | | VITE_GLOB_UPLOAD_URL, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <BasicModal |
| | | width="800px" |
| | | :height="600" |
| | | v-bind="$attrs" |
| | | @register="register" |
| | | title="å®ä½å表" |
| | | @ok="handleSubmit" |
| | | > |
| | | <!-- <div class="pt-3px pr-3px"> |
| | | <BasicForm @register="registerForm" :model="model" /> |
| | | </div> --> |
| | | <div> |
| | | <BasicTable @register="registerTable"> |
| | | <!-- <template #toolbar> |
| | | <a-button type="primary" @click="handleCreate"> æ°å¢çç¹ </a-button> |
| | | </template> --> |
| | | </BasicTable> |
| | | </div> |
| | | </BasicModal> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { ref, unref } from 'vue'; |
| | | import { BasicModal, useModalInner } from '/@/components/Modal'; |
| | | import { FormSchema } from '/@/components/Form/index'; |
| | | import { BasicTable, BasicColumn, useTable } from '/@/components/Table'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { getEntityNameList } from '/@/api/tigerapi/system'; |
| | | |
| | | const { t } = useI18n(); |
| | | const schemas: FormSchema[] = [ |
| | | { |
| | | field: 'StartWith', |
| | | component: 'Input', |
| | | label: 'å®ä½å', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ]; |
| | | |
| | | //å表 |
| | | const ItemColumns: BasicColumn[] = [ |
| | | { |
| | | title: t('å®ä½å'), |
| | | dataIndex: 'Name', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | { |
| | | title: t('å®ä½å
¨å'), |
| | | dataIndex: 'FullName', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('å½å空é´'), |
| | | dataIndex: 'Namespace', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | ]; |
| | | const emit = defineEmits(['success', 'register']); |
| | | const checkedKeys = ref<Array<string | number>>([]); |
| | | const [registerTable, { reload, getForm }] = useTable({ |
| | | title: 'å®ä½å表', |
| | | api: getEntityNameList, |
| | | searchInfo: { StartWith: '', Namespace: 'Tiger.Model' }, |
| | | columns: ItemColumns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas, |
| | | }, |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | // pagination: { pageSize: 8 }, |
| | | rowKey: 'Name', |
| | | rowSelection: { |
| | | selectedRowKeys: checkedKeys, |
| | | |
| | | type: 'checkbox', |
| | | // getCheckboxProps(record: Recordable) { |
| | | // // Demo: 第ä¸è¡ï¼id为0ï¼çéæ©æ¡ç¦ç¨ |
| | | // if (record.id === '0') { |
| | | // return { disabled: true }; |
| | | // } else { |
| | | // return { disabled: false }; |
| | | // } |
| | | // }, |
| | | onSelect: onSelect, |
| | | onSelectAll: onSelectAll, |
| | | }, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | // actionColumn: { |
| | | // width: 80, |
| | | // title: 'æä½', |
| | | // dataIndex: 'action', |
| | | // slots: { customRender: 'action' }, |
| | | // fixed: 'right' //undefined, |
| | | // }, |
| | | }); |
| | | const [register, { setModalProps, closeModal }] = useModalInner((data) => { |
| | | setModalProps({ confirmLoading: false }); |
| | | data && onDataReceive(data); |
| | | }); |
| | | |
| | | async function onDataReceive(data) { |
| | | console.log('Data Received', data); |
| | | getForm().resetFields(); |
| | | checkedKeys.value = []; |
| | | reload(); |
| | | // æ¹å¼1; |
| | | // setFieldsValue({ |
| | | // field2: data.data, |
| | | // field1: data.info, |
| | | // }); |
| | | } |
| | | |
| | | async function handleSubmit() { |
| | | try { |
| | | var values = ''; |
| | | // checkedKeys.value.forEach(element => { |
| | | // values+=element; |
| | | // }); |
| | | values = checkedKeys.value.join(','); |
| | | closeModal(); |
| | | emit('success', { |
| | | isUpdate: unref(false), |
| | | values: { values, id: 0 }, |
| | | }); |
| | | } finally { |
| | | setModalProps({ confirmLoading: false }); |
| | | } |
| | | } |
| | | function onSelect(record, selected) { |
| | | if (selected) { |
| | | checkedKeys.value = [...checkedKeys.value, record.Name]; |
| | | } else { |
| | | checkedKeys.value = checkedKeys.value.filter((Name) => Name !== record.Name); |
| | | } |
| | | } |
| | | function onSelectAll(selected, selectedRows, changeRows) { |
| | | const changeIds = changeRows.map((item) => item.Name); |
| | | if (selected) { |
| | | checkedKeys.value = [...checkedKeys.value, ...changeIds]; |
| | | } else { |
| | | checkedKeys.value = checkedKeys.value.filter((Name) => { |
| | | return !changeIds.includes(Name); |
| | | }); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | </BasicModal> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, unref } from 'vue'; |
| | | <script lang="ts" setup> |
| | | import { ref, unref } from 'vue'; |
| | | import { BasicModal, useModalInner } from '/@/components/Modal'; |
| | | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
| | | import { getTreeList } from '/@/api/tigerapi/dept'; |
| | | import { BasicTable, BasicColumn, TableAction, useTable } from '/@/components/Table'; |
| | | import { getItemListByPage } from '/@/api/tigerapi/wms/inventory'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | |
| | | ]; |
| | | |
| | | //ç©æå表 |
| | | export const ItemColumns: BasicColumn[] = [ |
| | | const ItemColumns: BasicColumn[] = [ |
| | | { |
| | | title: t('ç©æç¼ç '), |
| | | dataIndex: 'ITEM_CODE', |
| | |
| | | // resizable:true, |
| | | // } |
| | | ]; |
| | | export default defineComponent({ |
| | | components: { BasicModal, BasicForm, BasicTable, TableAction }, |
| | | props: { |
| | | userData: { type: Object }, |
| | | |
| | | const emit = defineEmits(['success', 'register']); |
| | | const checkedKeys = ref<Array<string | number>>([]); |
| | | const [registerTable, { reload, getForm }] = useTable({ |
| | | title: 'ç©æå表', |
| | | api: getItemListByPage, |
| | | columns: ItemColumns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas, |
| | | }, |
| | | emit: ['success', 'register'], |
| | | setup(_, { emit }) { |
| | | const modelRef = ref({}); |
| | | const [ |
| | | registerForm, |
| | | { |
| | | // setFieldsValue, |
| | | // setProps |
| | | updateSchema, |
| | | //validate |
| | | }, |
| | | ] = useForm({ |
| | | labelWidth: 120, |
| | | schemas, |
| | | showActionButtonGroup: false, |
| | | actionColOptions: { |
| | | span: 24, |
| | | }, |
| | | }); |
| | | const checkedKeys = ref<Array<string | number>>([]); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: 'ç©æå表', |
| | | api: getItemListByPage, |
| | | columns: ItemColumns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas, |
| | | }, |
| | | useSearchForm: true, |
| | | showTableSetting: true, |
| | | rowKey: 'ITEM_CODE', |
| | | rowSelection: { |
| | | selectedRowKeys: checkedKeys, |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | rowKey: 'ITEM_CODE', |
| | | rowSelection: { |
| | | selectedRowKeys: checkedKeys, |
| | | |
| | | type: 'checkbox', |
| | | // getCheckboxProps(record: Recordable) { |
| | | // // Demo: 第ä¸è¡ï¼id为0ï¼çéæ©æ¡ç¦ç¨ |
| | | // if (record.id === '0') { |
| | | // return { disabled: true }; |
| | | // } else { |
| | | // return { disabled: false }; |
| | | // } |
| | | // }, |
| | | onSelect: onSelect, |
| | | onSelectAll: onSelectAll, |
| | | }, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | // actionColumn: { |
| | | // width: 80, |
| | | // title: 'æä½', |
| | | // dataIndex: 'action', |
| | | // slots: { customRender: 'action' }, |
| | | // fixed: 'right' //undefined, |
| | | // }, |
| | | }); |
| | | const [register, { setModalProps, closeModal }] = useModalInner((data) => { |
| | | setModalProps({ confirmLoading: false }); |
| | | data && onDataReceive(data); |
| | | }); |
| | | |
| | | async function onDataReceive(data) { |
| | | console.log('Data Received', data); |
| | | // æ¹å¼1; |
| | | // setFieldsValue({ |
| | | // field2: data.data, |
| | | // field1: data.info, |
| | | // }); |
| | | |
| | | // // æ¹å¼2 |
| | | modelRef.value = { field2: data.data, field1: data.info }; |
| | | const treeData = await getTreeList(); |
| | | updateSchema([ |
| | | { |
| | | field: 'USER_PWD', |
| | | show: !unref(false), |
| | | }, |
| | | { |
| | | field: 'ORG_CODE', |
| | | componentProps: { treeData }, |
| | | }, |
| | | ]); |
| | | // setProps({ |
| | | // model:{ field2: data.data, field1: data.info } |
| | | // }) |
| | | } |
| | | |
| | | // function handleVisibleChange(v) { |
| | | // v && props.userData && nextTick(() => onDataReceive(props.userData)); |
| | | // } |
| | | |
| | | async function handleSubmit() { |
| | | try { |
| | | var values = ''; |
| | | // checkedKeys.value.forEach(element => { |
| | | // values+=element; |
| | | // }); |
| | | values = checkedKeys.value.join(','); |
| | | closeModal(); |
| | | emit('success', { |
| | | isUpdate: unref(false), |
| | | values: { values, id: 0 }, |
| | | }); |
| | | } finally { |
| | | setModalProps({ confirmLoading: false }); |
| | | } |
| | | } |
| | | function onSelect(record, selected) { |
| | | if (selected) { |
| | | checkedKeys.value = [...checkedKeys.value, record.ITEM_CODE]; |
| | | } else { |
| | | checkedKeys.value = checkedKeys.value.filter( |
| | | (ITEM_CODE) => ITEM_CODE !== record.ITEM_CODE, |
| | | ); |
| | | } |
| | | } |
| | | function onSelectAll(selected, selectedRows, changeRows) { |
| | | const changeIds = changeRows.map((item) => item.ITEM_CODE); |
| | | if (selected) { |
| | | checkedKeys.value = [...checkedKeys.value, ...changeIds]; |
| | | } else { |
| | | checkedKeys.value = checkedKeys.value.filter((ITEM_CODE) => { |
| | | return !changeIds.includes(ITEM_CODE); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | return { |
| | | register, |
| | | schemas, |
| | | registerForm, |
| | | model: modelRef, |
| | | handleSubmit, |
| | | registerTable, |
| | | onSelect, |
| | | onSelectAll, |
| | | }; |
| | | type: 'checkbox', |
| | | // getCheckboxProps(record: Recordable) { |
| | | // // Demo: 第ä¸è¡ï¼id为0ï¼çéæ©æ¡ç¦ç¨ |
| | | // if (record.id === '0') { |
| | | // return { disabled: true }; |
| | | // } else { |
| | | // return { disabled: false }; |
| | | // } |
| | | // }, |
| | | onSelect: onSelect, |
| | | onSelectAll: onSelectAll, |
| | | }, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | // actionColumn: { |
| | | // width: 80, |
| | | // title: 'æä½', |
| | | // dataIndex: 'action', |
| | | // slots: { customRender: 'action' }, |
| | | // fixed: 'right' //undefined, |
| | | // }, |
| | | }); |
| | | const [register, { setModalProps, closeModal }] = useModalInner((data) => { |
| | | setModalProps({ confirmLoading: false }); |
| | | data && onDataReceive(data); |
| | | }); |
| | | |
| | | async function onDataReceive(data) { |
| | | console.log('Data Received', data); |
| | | // æ¹å¼1; |
| | | // setFieldsValue({ |
| | | // field2: data.data, |
| | | // field1: data.info, |
| | | // }); |
| | | checkedKeys.value = []; |
| | | getForm().resetFields(); |
| | | reload(); |
| | | } |
| | | |
| | | // function handleVisibleChange(v) { |
| | | // v && props.userData && nextTick(() => onDataReceive(props.userData)); |
| | | // } |
| | | |
| | | async function handleSubmit() { |
| | | try { |
| | | var values = ''; |
| | | // checkedKeys.value.forEach(element => { |
| | | // values+=element; |
| | | // }); |
| | | values = checkedKeys.value.join(','); |
| | | closeModal(); |
| | | emit('success', { |
| | | isUpdate: unref(false), |
| | | values: { values, id: 0 }, |
| | | }); |
| | | } finally { |
| | | setModalProps({ confirmLoading: false }); |
| | | } |
| | | } |
| | | function onSelect(record, selected) { |
| | | if (selected) { |
| | | checkedKeys.value = [...checkedKeys.value, record.ITEM_CODE]; |
| | | } else { |
| | | checkedKeys.value = checkedKeys.value.filter((ITEM_CODE) => ITEM_CODE !== record.ITEM_CODE); |
| | | } |
| | | } |
| | | function onSelectAll(selected, selectedRows, changeRows) { |
| | | const changeIds = changeRows.map((item) => item.ITEM_CODE); |
| | | if (selected) { |
| | | checkedKeys.value = [...checkedKeys.value, ...changeIds]; |
| | | } else { |
| | | checkedKeys.value = checkedKeys.value.filter((ITEM_CODE) => { |
| | | return !changeIds.includes(ITEM_CODE); |
| | | }); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { onMounted, ref } from 'vue'; |
| | | import { h, onMounted, ref } from 'vue'; |
| | | import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table'; |
| | | import { useDrawer } from '/@/components/Drawer'; |
| | | import normalDrawer from './normalDrawer.vue'; |
| | | import { DeleteEntity, fetchJson, getListByPage } from '/@/api/tigerapi/system'; |
| | | import { DeleteEntity, fetchJson, getEntity, getListByPage } from '/@/api/tigerapi/system'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import { useRoute } from 'vue-router'; |
| | | import { Tag, Tooltip } from 'ant-design-vue'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | | |
| | | const route = useRoute(); |
| | | const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); |
| | | const globSetting = useGlobSetting(); |
| | | const _columns = ref([]); |
| | | const _searchFormSchema = ref([]); |
| | | const _crudFormSchema = ref([]); |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: 'å表信æ¯', |
| | |
| | | openDrawer(true, { |
| | | isUpdate: false, |
| | | entityName: objParams.value.ID, |
| | | formJson: _crudFormSchema.value, |
| | | }); |
| | | } |
| | | |
| | |
| | | record, |
| | | isUpdate: true, |
| | | entityName: objParams.value.ID, |
| | | formJson: _crudFormSchema.value, |
| | | }); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | _searchFormSchema.value = await fetchJson( |
| | | `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Searchform.json`, |
| | | ); |
| | | _columns.value = await fetchJson( |
| | | `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Baseform.json`, |
| | | ); |
| | | /* ç¨jsonè·åå */ |
| | | // _searchFormSchema.value = await fetchJson( |
| | | // `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Searchform.json`, |
| | | // ); |
| | | // var objs = await fetchJson( |
| | | // `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Baseform.json`, |
| | | // ); |
| | | // for (const i in objs) { |
| | | // if (!isNullOrEmpty(objs[i].customRender)) { |
| | | // const func = new Function(objs[i].customRender)(); |
| | | // objs[i].customRender = ({ record }) => { |
| | | // let texts = func(record); |
| | | // return h(Tooltip, { title: texts.text }, () => |
| | | // h(Tag, { color: texts.color }, () => texts.text), |
| | | // ); |
| | | // }; |
| | | // } |
| | | // } |
| | | // _columns.value = objs; |
| | | const data = await getEntity({ |
| | | sqlcmd: "ASSEMBLY_NAME ='" + objParams.value.ID + "'", |
| | | entityName: 'SYS_LOW_CODE', |
| | | }); |
| | | _searchFormSchema.value = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON); |
| | | _columns.value = JSON.parse(data.Data.Items[0].BASE_FORM_JSON); |
| | | _crudFormSchema.value = JSON.parse(data.Data.Items[0].FORM_JSON); |
| | | }); |
| | | </script> |
| | |
| | | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
| | | isUpdate.value = !!data?.isUpdate; |
| | | entityName.value = data?.entityName; |
| | | formSchema.value = await fetchJson( |
| | | `${globSetting.downloadUrl}/LowCode/${unref(entityName)}/${ |
| | | entityName.value |
| | | }_addEditform.json`, |
| | | ); |
| | | // formSchema.value = await fetchJson( |
| | | // `${globSetting.downloadUrl}/LowCode/${unref(entityName)}/${ |
| | | // entityName.value |
| | | // }_addEditform.json`, |
| | | // ); |
| | | formSchema.value = data?.formJson; |
| | | resetFields(); |
| | | setDrawerProps({ confirmLoading: false }); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <BasicTable @register="registerTable"> |
| | | <template #toolbar> |
| | | <a-button type="primary" @click="handleCreate" preIcon="add_02|svg"> æ°å¢ </a-button> |
| | | </template> |
| | | <template #action="{ record }"> |
| | | <TableAction |
| | | :actions="[ |
| | | { |
| | | icon: 'clarity:note-edit-line', |
| | | onClick: handleEdit.bind(null, record), |
| | | }, |
| | | { |
| | | icon: 'ant-design:delete-outlined', |
| | | color: 'error', |
| | | popConfirm: { |
| | | title: 'æ¯å¦ç¡®è®¤å é¤?', |
| | | placement: 'left', |
| | | confirm: handleDelete.bind(null, record), |
| | | }, |
| | | }, |
| | | ]" |
| | | /> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { onMounted, ref } from 'vue'; |
| | | import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table'; |
| | | import { DeleteEntity, fetchJson, getListByPage } from '/@/api/tigerapi/system'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | import { buildUUID } from '/@/utils/uuid'; |
| | | |
| | | const go = useGo(); |
| | | const globSetting = useGlobSetting(); |
| | | const _columns = ref([]); |
| | | const _searchFormSchema = ref([]); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: 'å表信æ¯', |
| | | api: getListByPage, |
| | | searchInfo: { TABLE_NAME: 'SYS_LOW_CODE' }, |
| | | columns: _columns as unknown as BasicColumn[], |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas: _searchFormSchema as unknown as FormSchema[], |
| | | }, |
| | | useSearchForm: true, |
| | | showTableSetting: true, |
| | | bordered: true, |
| | | canResize: true, |
| | | showIndexColumn: false, |
| | | actionColumn: { |
| | | width: 80, |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | | fixed: undefined, |
| | | }, |
| | | }); |
| | | |
| | | function handleCreate() { |
| | | const ID = { Update: '0', ID: buildUUID(), Name: '' }; |
| | | go(`/PageDetail/${encodeURI(JSON.stringify(ID))}`); |
| | | } |
| | | |
| | | function handleEdit(record: Recordable) { |
| | | const ID = { Update: '1', ID: record.ID, Name: record.ASSEMBLY_NAME }; |
| | | go(`/PageDetail/${encodeURI(JSON.stringify(ID))}`); |
| | | } |
| | | |
| | | function handleDelete(record: Recordable) { |
| | | console.log(record); |
| | | //å é¤ |
| | | const apiAction = DeleteEntity(record, 'SYS_LOW_CODE'); |
| | | apiAction.then((action) => { |
| | | if (action.IsSuccessed) { |
| | | reload(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleSuccess() { |
| | | reload(); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | _searchFormSchema.value = await fetchJson( |
| | | `${globSetting.downloadUrl}/LowCode/SYS_LOW_CODE/SYS_LOW_CODE_Searchform.json`, |
| | | ); |
| | | _columns.value = await fetchJson( |
| | | `${globSetting.downloadUrl}/LowCode/SYS_LOW_CODE/SYS_LOW_CODE_Baseform.json`, |
| | | ); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <PageWrapper |
| | | class="high-form" |
| | | title="ä½ä»£ç 页é¢ç®¡ç" |
| | | content="è¿æ¯ä½ä»£ç 页é¢ç®¡çï¼å¨è¿è½å¤æ ¹æ®å®ä½ç±»é
ç½®å¢å æ¹åè½é¡µé¢ã" |
| | | @back="goBack" |
| | | > |
| | | <a-card title="æ¥è¯¢æ¡ä»¶é
ç½®" :bordered="false"> |
| | | <BasicForm @register="register"> |
| | | <template #add="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="handleSelecNew" |
| | | preIcon="search|svg" |
| | | /> |
| | | <EntityModal @register="registerNewAdd" @success="handleNewSuccess" /> |
| | | </template> |
| | | <template #condAdd="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="condAdd" |
| | | preIcon="add_blue|svg" |
| | | /> |
| | | </template> |
| | | <template #subtract="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="del(field)" |
| | | preIcon="subtract|svg" |
| | | /> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="(item, index) in searchSlots" :key="item"> |
| | | <a-input-group compact> |
| | | <ApiSelect |
| | | style="width: 25%" |
| | | :api="getEntityPropertieList" |
| | | :params="{ StartWith: getFieldsValue().ASSEMBLY_NAME, Namespace: 'Tiger.Model' }" |
| | | v-model:value="model[field]" |
| | | resultField="items" |
| | | label-field="Name" |
| | | valueField="Name" |
| | | /> |
| | | <a-input v-model:value="objInputs[field]" style="width: 55%" /> |
| | | <Select |
| | | ref="select" |
| | | v-model:value="searchSelectVals[field]" |
| | | style="width: 20%" |
| | | :options="options" |
| | | :readonly="true" |
| | | /> |
| | | </a-input-group> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="item in swSlots" :key="item"> |
| | | <a-switch v-model:checked="model[field]" /> |
| | | </template> |
| | | </BasicForm> |
| | | </a-card> |
| | | <a-card title="ä¸»è¡¨æ ¼é
ç½®" :bordered="false" class="!mt-5"> |
| | | <div> |
| | | <BasicForm @register="registerMain"> |
| | | <template #add="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="mainSelectAssy" |
| | | preIcon="search|svg" |
| | | /> |
| | | <EntityModal @register="registerMainAdd" @success="mainAssySuccess" /> |
| | | </template> |
| | | <template #mainCondAdd="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="mainCondAdd" |
| | | preIcon="add_blue|svg" |
| | | /> |
| | | </template> |
| | | <template #mainSubtract="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="mainDel(field)" |
| | | preIcon="subtract|svg" |
| | | /> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="(item, index) in mainSlots" :key="item"> |
| | | <a-input-group compact> |
| | | <ApiSelect |
| | | style="width: 30%" |
| | | :api="getEntityPropertieList" |
| | | :params="{ |
| | | StartWith: getFieldsValueMain().MainAssemblyName, |
| | | Namespace: 'Tiger.Model', |
| | | }" |
| | | v-model:value="model[field]" |
| | | resultField="items" |
| | | label-field="Name" |
| | | valueField="Name" |
| | | /> |
| | | <a-input v-model:value="mainInputs[field]" style="width: 70%" /> |
| | | </a-input-group> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="item in mainSwSlots" :key="item"> |
| | | <a-switch v-model:checked="model[field]" /> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="item in mainsSwSlots" :key="item"> |
| | | <a-switch v-model:checked="model[field]" /> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="item in mainwSwSlots" :key="item"> |
| | | <a-switch v-model:checked="model[field]" /> |
| | | </template> |
| | | </BasicForm> |
| | | </div> |
| | | </a-card> |
| | | <a-card title="å¢å æ¹é
ç½®" :bordered="false" class="!mt-5"> |
| | | <BasicForm @register="registerCrud"> |
| | | <template #add="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="handleSelectCrud" |
| | | preIcon="search|svg" |
| | | /> |
| | | <EntityModal @register="registerCrudAdd" @success="handleCrudSuccess" /> |
| | | </template> |
| | | <template #crudCondAdd="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="crudCondAdd" |
| | | preIcon="add_blue|svg" |
| | | /> |
| | | </template> |
| | | <template #crudSubtract="{ field }"> |
| | | <a-button |
| | | v-if="field" |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="crudDel(field)" |
| | | preIcon="subtract|svg" |
| | | /> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="(item, index) in crudSlots" :key="item"> |
| | | <a-input-group compact> |
| | | <ApiSelect |
| | | style="width: 25%" |
| | | :api="getEntityPropertieList" |
| | | :params="{ |
| | | StartWith: getFieldsValueCrud().crudAssemblyName, |
| | | Namespace: 'Tiger.Model', |
| | | }" |
| | | v-model:value="model[field]" |
| | | resultField="items" |
| | | label-field="Name" |
| | | valueField="Name" |
| | | /> |
| | | <a-input v-model:value="crudInputs[field]" style="width: 55%" /> |
| | | <Select |
| | | ref="select" |
| | | v-model:value="crudSelectVals[field]" |
| | | style="width: 20%" |
| | | :options="options" |
| | | :readonly="true" |
| | | /> |
| | | </a-input-group> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="item in crudSwSlots" :key="item"> |
| | | <a-switch v-model:checked="model[field]" /> |
| | | </template> |
| | | <template #[item]="{ model, field }" v-for="item in crudrSwSlots" :key="item"> |
| | | <a-switch v-model:checked="model[field]" /> |
| | | </template> |
| | | </BasicForm> |
| | | </a-card> |
| | | |
| | | <template #rightFooter> |
| | | <a-button class="mr-4" type="info" @click="cancel"> åæ¶ </a-button> |
| | | <a-button type="primary" @click="submitAll"> çæ </a-button> |
| | | </template> |
| | | </PageWrapper> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { BasicForm, useForm } from '/@/components/Form'; |
| | | import { onMounted, ref, unref } from 'vue'; |
| | | import { Card, InputGroup, Select, Input, Switch } from 'ant-design-vue'; |
| | | import { ApiSelect } from '/@/components/Form/index'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | import { PageWrapper } from '/@/components/Page'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | import { newFormSchema, crudSchemas, mainSchemas } from './setting.data'; |
| | | import { useTabs } from '/@/hooks/web/useTabs'; |
| | | import EntityModal from '/@/views/components/EntityModal.vue'; |
| | | import { buildUUID } from '/@/utils/uuid'; |
| | | import { SelectTypes } from 'ant-design-vue/es/select'; |
| | | import { useMultipleTabStore } from '/@/store/modules/multipleTab'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { SaveEntity, getEntityPropertieList } from '/@/api/tigerapi/system'; |
| | | import { EntityPropertie, SYS_LOW_CODE } from '/@/api/tigerapi/model/systemModel'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | const ACard = Card; |
| | | const AInputGroup = InputGroup; |
| | | const AInput = Input; |
| | | const ASwitch = Switch; |
| | | const route = useRoute(); |
| | | const go = useGo(); |
| | | const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); |
| | | const { setTitle } = useTabs(); |
| | | const tabStore = useMultipleTabStore(); |
| | | const router = useRouter(); |
| | | |
| | | const { currentRoute } = router; |
| | | function getCurrentTab() { |
| | | const route = unref(currentRoute); |
| | | return tabStore.getTabList.find((item) => item.fullPath === route.fullPath)!; |
| | | } |
| | | const currentTab = getCurrentTab(); |
| | | var _title = |
| | | objParams.value.Update == '0' |
| | | ? 'ä½ä»£ç 页é¢è¯¦æ
æ°å¢' |
| | | : `ä½ä»£ç 页é¢è¯¦æ
ç¼è¾ï¼${objParams.value.Name}`; |
| | | setTitle(_title); |
| | | const [registerCrudAdd, { openModal: openCrudModal }] = useModal(); |
| | | const [registerNewAdd, { openModal: openNewModal }] = useModal(); |
| | | const [registerMainAdd, { openModal: openMainModal }] = useModal(); |
| | | const [ |
| | | register, |
| | | { |
| | | resetFields, |
| | | setFieldsValue, |
| | | getFieldsValue, |
| | | appendSchemaByField, |
| | | removeSchemaByField, |
| | | validate, |
| | | }, |
| | | ] = useForm({ |
| | | labelWidth: 120, |
| | | baseColProps: { |
| | | span: 24, |
| | | }, |
| | | schemas: newFormSchema, |
| | | showActionButtonGroup: false, |
| | | }); |
| | | const [ |
| | | registerCrud, |
| | | { |
| | | setFieldsValue: setFieldsValueCrud, |
| | | getFieldsValue: getFieldsValueCrud, |
| | | appendSchemaByField: appendSchemaByFieldCrud, |
| | | removeSchemaByField: removeSchemaByFieldCrud, |
| | | validate: crudvalidate, |
| | | }, |
| | | ] = useForm({ |
| | | labelWidth: 120, |
| | | baseColProps: { |
| | | span: 24, |
| | | }, |
| | | schemas: crudSchemas, |
| | | showActionButtonGroup: false, |
| | | }); |
| | | const [ |
| | | registerMain, |
| | | { |
| | | setFieldsValue: setFieldsValueMain, |
| | | getFieldsValue: getFieldsValueMain, |
| | | appendSchemaByField: appendSchemaByFieldMain, |
| | | removeSchemaByField: removeSchemaByFieldMain, |
| | | validate: validateMainForm, |
| | | }, |
| | | ] = useForm({ |
| | | labelWidth: 120, |
| | | baseColProps: { |
| | | span: 24, |
| | | }, |
| | | schemas: mainSchemas, |
| | | showActionButtonGroup: false, |
| | | }); |
| | | const objInputs = ref({} as { [key: string]: any }); |
| | | const mainInputs = ref({} as { [key: string]: any }); |
| | | const crudInputs = ref({} as { [key: string]: any }); |
| | | const searchProperties = ref([] as EntityPropertie[]); |
| | | const mainProperties = ref([] as EntityPropertie[]); |
| | | const crudProperties = ref([] as EntityPropertie[]); |
| | | const searchSlots = ref([] as string[]); |
| | | const mainSlots = ref([] as string[]); |
| | | const crudSlots = ref([] as string[]); |
| | | const swSlots = ref([] as string[]); |
| | | const mainSwSlots = ref([] as string[]); |
| | | const crudSwSlots = ref([] as string[]); |
| | | const mainsSwSlots = ref([] as string[]); |
| | | const mainwSwSlots = ref([] as string[]); |
| | | const crudrSwSlots = ref([] as string[]); |
| | | const searchSelectVals = ref({} as { [key: string]: any }); |
| | | const mainSelectVals = ref({} as { [key: string]: any }); |
| | | const crudSelectVals = ref({} as { [key: string]: any }); |
| | | const options = ref<SelectTypes['options']>([ |
| | | { |
| | | value: 'Input', |
| | | label: 'è¾å
¥æ¡', |
| | | }, |
| | | { |
| | | value: 'InputPassword', |
| | | label: 'è¾å
¥å¯ç æ¡', |
| | | }, |
| | | { |
| | | value: 'InputNumber', |
| | | label: 'è¾å
¥æ°åæ¡', |
| | | }, |
| | | { |
| | | value: 'Select', |
| | | label: '䏿æ¡', |
| | | }, |
| | | { |
| | | value: 'ApiSelect', |
| | | label: 'Api䏿æ¡', |
| | | }, |
| | | { |
| | | value: 'Checkbox', |
| | | label: 'Checkbox', |
| | | }, |
| | | { |
| | | value: 'TimePicker', |
| | | label: 'æ¶é´éæ©å¨', |
| | | }, |
| | | { |
| | | value: 'Switch', |
| | | label: 'å¼å
³', |
| | | }, |
| | | ]); |
| | | onMounted(async () => {}); |
| | | |
| | | async function submitAll() { |
| | | try { |
| | | const [values, crudvalues, mainvalues] = await Promise.all([ |
| | | validate(), |
| | | crudvalidate(), |
| | | validateMainForm(), |
| | | ]); |
| | | /* æ¥è¯¢æ¡ä»¶Json */ |
| | | const Keys = Object.getOwnPropertyNames(values); |
| | | var searchjsons = []; |
| | | var _json = {}; |
| | | var _n = 0; |
| | | for (const k in Keys) { |
| | | console.log(`${k}:${Keys[k]}`); |
| | | if (!isNullOrEmpty(values[Keys[k]])) { |
| | | if (Keys[k].toString().startsWith(getFieldsValue().ASSEMBLY_NAME)) { |
| | | _json['field'] = values[Keys[k]]; |
| | | _json['label'] = objInputs.value[Keys[k]]; |
| | | _json['defaultValue'] = ''; |
| | | _json['component'] = searchSelectVals.value[Keys[k]]; |
| | | _n = _n + 4; |
| | | } |
| | | if (Keys[k].toString().startsWith('InputNumber')) { |
| | | _json['colProps'] = { span: values[Keys[k]] }; |
| | | _n++; |
| | | } |
| | | if (Keys[k].toString().startsWith('Switch')) { |
| | | _json['ifShow'] = values[Keys[k]] as boolean; |
| | | _n++; |
| | | } |
| | | if (!isNullOrEmpty(_json) && _n == 6) { |
| | | searchjsons.push(_json); |
| | | _json = {}; |
| | | _n = 0; |
| | | } |
| | | } |
| | | } |
| | | console.log(JSON.stringify(searchjsons)); |
| | | /* ä¸»è¡¨æ ¼Json */ |
| | | const mKeys = Object.getOwnPropertyNames(mainvalues); |
| | | var mjsons = []; |
| | | var mjson = {}; |
| | | var i = 0; |
| | | for (const k in mKeys) { |
| | | console.log(`${k}:${mKeys[k]}`); |
| | | if (isNullOrEmpty(mainvalues[mKeys[k]])) { |
| | | if ( |
| | | mKeys[k].toString().startsWith('Switch') || |
| | | mKeys[k].toString().startsWith('sSwitch') || |
| | | mKeys[k].toString().startsWith('wSwitch') |
| | | ) { |
| | | mainvalues[mKeys[k]] = false; |
| | | } |
| | | } |
| | | if (!isNullOrEmpty(mainvalues[mKeys[k]])) { |
| | | if (mKeys[k].toString().startsWith(getFieldsValueMain().MainAssemblyName)) { |
| | | mjson['dataIndex'] = mainvalues[mKeys[k]]; |
| | | mjson['title'] = mainInputs.value[mKeys[k]]; |
| | | i = i + 2; |
| | | } |
| | | if (mKeys[k].toString().startsWith('Switch')) { |
| | | mjson['ifShow'] = mainvalues[mKeys[k]] as boolean; |
| | | i++; |
| | | } |
| | | if (mKeys[k].toString().startsWith('sSwitch')) { |
| | | mjson['sorter'] = mainvalues[mKeys[k]] as boolean; |
| | | i++; |
| | | } |
| | | if (mKeys[k].toString().startsWith('wSwitch')) { |
| | | mjson['resizable'] = mainvalues[mKeys[k]] as boolean; |
| | | i++; |
| | | } |
| | | if (!isNullOrEmpty(mjson) && i == 5) { |
| | | mjsons.push(mjson); |
| | | i = 0; |
| | | mjson = {}; |
| | | } |
| | | } |
| | | } |
| | | console.log(JSON.stringify(mjsons)); |
| | | /* å¢å æ¹Json */ |
| | | const cKeys = Object.getOwnPropertyNames(crudvalues); |
| | | var cjsons = []; |
| | | var cjson = {}; |
| | | var c = 0; |
| | | for (const k in cKeys) { |
| | | console.log(`${k}:${cKeys[k]}`); |
| | | if (isNullOrEmpty(crudvalues[mKeys[k]])) { |
| | | if ( |
| | | cKeys[k].toString().startsWith('Switch') || |
| | | cKeys[k].toString().startsWith('rSwitch') |
| | | ) { |
| | | crudvalues[mKeys[k]] = false; |
| | | } |
| | | } |
| | | if (!isNullOrEmpty(crudvalues[cKeys[k]])) { |
| | | if (cKeys[k].toString().startsWith(getFieldsValueCrud().crudAssemblyName)) { |
| | | cjson['field'] = crudvalues[cKeys[k]]; |
| | | cjson['label'] = crudInputs.value[cKeys[k]]; |
| | | cjson['component'] = crudSelectVals.value[cKeys[k]]; |
| | | c = c + 3; |
| | | } |
| | | if (cKeys[k].toString().startsWith('Switch')) { |
| | | cjson['show'] = crudvalues[cKeys[k]] as boolean; |
| | | c++; |
| | | } |
| | | if (cKeys[k].toString().startsWith('rSwitch')) { |
| | | cjson['required'] = crudvalues[cKeys[k]] as boolean; |
| | | c++; |
| | | } |
| | | if (cKeys[k].toString().startsWith('InputNumber')) { |
| | | cjson['colProps'] = { span: crudvalues[cKeys[k]] }; |
| | | c++; |
| | | } |
| | | if (!isNullOrEmpty(cjson) && c == 6) { |
| | | cjsons.push(cjson); |
| | | c = 0; |
| | | cjson = {}; |
| | | } |
| | | } |
| | | } |
| | | console.log(JSON.stringify(cjsons)); |
| | | var entity: SYS_LOW_CODE = { |
| | | CREATE_USER: useUserStore().getUserInfo.userId as string, |
| | | UPDATE_USER: useUserStore().getUserInfo.userId as string, |
| | | SEARCH_FORM_JSON: JSON.stringify(searchjsons), |
| | | BASE_FORM_JSON: JSON.stringify(mjsons), |
| | | FORM_JSON: JSON.stringify(cjsons), |
| | | ASSEMBLY_NAME: getFieldsValueMain().MainAssemblyName, |
| | | CRUD_ASSY_NAME: getFieldsValueCrud().crudAssemblyName, |
| | | SEARCH_ASSY_NAME: getFieldsValue().ASSEMBLY_NAME, |
| | | }; |
| | | SaveEntity(entity, unref(objParams.value.Update) == '1', 'SYS_LOW_CODE').then((action) => { |
| | | if (action.IsSuccessed) { |
| | | cancel(); |
| | | } |
| | | }); |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |
| | | } |
| | | |
| | | async function cancel() { |
| | | try { |
| | | tabStore.closeTab(currentTab, router); |
| | | } catch (error) {} |
| | | } |
| | | async function handleCreate() { |
| | | await validate(); |
| | | } |
| | | |
| | | function handleEdit(record: Recordable) {} |
| | | //ç¹å»æå¼ç©æåè¡¨æ¡ |
| | | function handleSelecNew() { |
| | | openNewModal(true, { |
| | | data: 'content', |
| | | info: 'Info', |
| | | }); |
| | | } |
| | | |
| | | function mainSelectAssy() { |
| | | openMainModal(true, { |
| | | data: 'content', |
| | | info: 'Info', |
| | | }); |
| | | } |
| | | |
| | | function handleSelectCrud() { |
| | | openCrudModal(true, { |
| | | data: 'content', |
| | | info: 'Info', |
| | | }); |
| | | } |
| | | |
| | | async function mainAssySuccess(d, u) { |
| | | setFieldsValueMain({ |
| | | MainAssemblyName: d.values.values, |
| | | }); |
| | | var data = await getEntityPropertieList({ |
| | | StartWith: d.values.values, |
| | | Namespace: 'Tiger.Model', |
| | | }); |
| | | mainProperties.value = data.items; |
| | | } |
| | | |
| | | async function handleNewSuccess(d, u) { |
| | | setFieldsValue({ |
| | | ASSEMBLY_NAME: d.values.values, |
| | | }); |
| | | var data = await getEntityPropertieList({ |
| | | StartWith: d.values.values, |
| | | Namespace: 'Tiger.Model', |
| | | }); |
| | | searchProperties.value = data.items; |
| | | } |
| | | |
| | | function handleCrudSuccess(d, u) { |
| | | setFieldsValueCrud({ |
| | | crudAssemblyName: d.values.values, |
| | | }); |
| | | } |
| | | const n = ref(1); |
| | | const m = ref(1); |
| | | const j = ref(1); |
| | | /** |
| | | * @description: æ¹éæ·»å æ¥è¯¢é
ç½® |
| | | */ |
| | | function condAdd() { |
| | | appendSchemaByField( |
| | | [ |
| | | { |
| | | field: `${getFieldsValue().ASSEMBLY_NAME}${n.value}a`, |
| | | component: 'InputGroup', |
| | | label: 'åæ®µ' + n.value, |
| | | // required: true, |
| | | slot: 'fac' + n.value, |
| | | colProps: { span: 14 }, |
| | | }, |
| | | { |
| | | field: `Switch${n.value}`, |
| | | component: 'Switch', |
| | | label: 'æ¯å¦æ¾ç¤º', |
| | | slot: `sw${n.value}`, |
| | | colProps: { span: 3 }, |
| | | }, |
| | | { |
| | | field: `InputNumber${n.value}`, |
| | | component: 'InputNumber', |
| | | label: 'å宽', |
| | | colProps: { span: 3 }, |
| | | }, |
| | | { |
| | | field: `${n.value}`, |
| | | component: 'Input', |
| | | label: ' ', |
| | | slot: 'subtract', |
| | | colProps: { span: 4 }, |
| | | }, |
| | | ], |
| | | '', |
| | | ); |
| | | searchSlots.value.push('fac' + n.value); |
| | | swSlots.value.push(`sw${n.value}`); |
| | | objInputs.value[`${getFieldsValue().ASSEMBLY_NAME}${n.value}a`] = ''; |
| | | searchSelectVals.value[`${getFieldsValue().ASSEMBLY_NAME}${n.value}a`] = ''; |
| | | console.log(searchSlots.value); |
| | | n.value++; |
| | | } |
| | | |
| | | function del(field) { |
| | | removeSchemaByField([ |
| | | `${getFieldsValue().ASSEMBLY_NAME}${field}a`, |
| | | `Switch${field}`, |
| | | `InputNumber${field}`, |
| | | `${field}`, |
| | | ]); |
| | | swSlots.value.splice(swSlots.value.indexOf(`sw${field}`), 1); |
| | | searchSlots.value.splice(searchSlots.value.indexOf(`fac${field}`), 1); |
| | | if (searchSlots.value.length == 0) { |
| | | n.value = 1; |
| | | } |
| | | } |
| | | |
| | | /* 主表é
ç½® */ |
| | | function mainCondAdd() { |
| | | appendSchemaByFieldMain( |
| | | [ |
| | | { |
| | | field: `${getFieldsValueMain().MainAssemblyName}${m.value}a`, |
| | | component: 'InputGroup', |
| | | label: 'åæ®µ' + m.value, |
| | | // required: true, |
| | | slot: 'mainfac' + m.value, |
| | | colProps: { span: 12 }, |
| | | }, |
| | | { |
| | | field: `Switch${m.value}`, |
| | | component: 'Switch', |
| | | label: 'æ¯å¦æ¾ç¤º', |
| | | slot: `mainSw${m.value}`, |
| | | colProps: { span: 3 }, |
| | | }, |
| | | { |
| | | field: `sSwitch${m.value}`, |
| | | component: 'Switch', |
| | | label: 'æ¯å¦æåº', |
| | | slot: `mainsSw${m.value}`, |
| | | colProps: { span: 3 }, |
| | | }, |
| | | { |
| | | field: `wSwitch${m.value}`, |
| | | component: 'Switch', |
| | | label: 'æ¯å¦å¯è°å®½', |
| | | slot: `mainwSw${m.value}`, |
| | | colProps: { span: 3 }, |
| | | }, |
| | | // { |
| | | // field: `InputNumber${m.value}`, |
| | | // component: 'InputNumber', |
| | | // label: 'å宽', |
| | | // colProps: { span: 3 }, |
| | | // }, |
| | | { |
| | | field: `${m.value}`, |
| | | component: 'Input', |
| | | label: ' ', |
| | | slot: 'mainSubtract', |
| | | colProps: { span: 3 }, |
| | | }, |
| | | ], |
| | | '', |
| | | ); |
| | | mainSlots.value.push('mainfac' + m.value); |
| | | mainSwSlots.value.push(`mainSw${m.value}`); |
| | | mainsSwSlots.value.push(`mainsSw${m.value}`); |
| | | mainwSwSlots.value.push(`mainwSw${m.value}`); |
| | | mainInputs.value[`${getFieldsValueMain().MainAssemblyName}${m.value}a`] = ''; |
| | | mainSelectVals.value[`${getFieldsValueMain().MainAssemblyName}${m.value}a`] = ''; |
| | | console.log(mainSlots.value); |
| | | m.value++; |
| | | } |
| | | |
| | | function mainDel(field) { |
| | | removeSchemaByFieldMain([ |
| | | `${getFieldsValueMain().MainAssemblyName}${field}a`, |
| | | `Switch${field}`, |
| | | `sSwitch${field}`, |
| | | `wSwitch${field}`, |
| | | `InputNumber${field}`, |
| | | `${field}`, |
| | | ]); |
| | | mainSwSlots.value.splice(mainSwSlots.value.indexOf(`mainSw${field}`), 1); |
| | | mainsSwSlots.value.splice(mainsSwSlots.value.indexOf(`mainsSw${field}`), 1); |
| | | mainwSwSlots.value.splice(mainwSwSlots.value.indexOf(`mainwSw${field}`), 1); |
| | | mainSlots.value.splice(mainSlots.value.indexOf(`mainfac${field}`), 1); |
| | | if (mainSlots.value.length == 0) { |
| | | m.value = 1; |
| | | } |
| | | } |
| | | |
| | | /* å¢å æ¹é
ç½® */ |
| | | function crudCondAdd() { |
| | | appendSchemaByFieldCrud( |
| | | [ |
| | | { |
| | | field: `${getFieldsValueCrud().crudAssemblyName}${j.value}a`, |
| | | component: 'InputGroup', |
| | | label: 'åæ®µ' + j.value, |
| | | // required: true, |
| | | slot: 'crudfac' + j.value, |
| | | colProps: { span: 12 }, |
| | | }, |
| | | { |
| | | field: `Switch${j.value}`, |
| | | component: 'Switch', |
| | | label: 'æ¯å¦æ¾ç¤º', |
| | | slot: `crudSw${j.value}`, |
| | | colProps: { span: 3 }, |
| | | }, |
| | | { |
| | | field: `rSwitch${j.value}`, |
| | | component: 'Switch', |
| | | label: 'æ¯å¦å¿
å¡«', |
| | | slot: `crudrSw${j.value}`, |
| | | colProps: { span: 3 }, |
| | | }, |
| | | { |
| | | field: `InputNumber${j.value}`, |
| | | component: 'InputNumber', |
| | | label: 'å宽', |
| | | colProps: { span: 3 }, |
| | | }, |
| | | { |
| | | field: `${j.value}`, |
| | | component: 'Input', |
| | | label: ' ', |
| | | slot: 'crudSubtract', |
| | | colProps: { span: 3 }, |
| | | }, |
| | | ], |
| | | '', |
| | | ); |
| | | crudSlots.value.push('crudfac' + j.value); |
| | | crudSwSlots.value.push(`crudSw${j.value}`); |
| | | crudrSwSlots.value.push(`crudrSw${j.value}`); |
| | | crudInputs.value[`${getFieldsValueCrud().crudAssemblyName}${j.value}a`] = ''; |
| | | crudSelectVals.value[`${getFieldsValueCrud().crudAssemblyName}${j.value}a`] = ''; |
| | | console.log(crudSlots.value); |
| | | j.value++; |
| | | } |
| | | |
| | | function crudDel(field) { |
| | | removeSchemaByFieldCrud([ |
| | | `${getFieldsValueCrud().crudAssemblyName}${field}a`, |
| | | `Switch${field}`, |
| | | `rSwitch${field}`, |
| | | `InputNumber${field}`, |
| | | `${field}`, |
| | | ]); |
| | | crudSwSlots.value.splice(crudSwSlots.value.indexOf(`crudSw${field}`), 1); |
| | | crudrSwSlots.value.splice(crudrSwSlots.value.indexOf(`crudrSw${field}`), 1); |
| | | crudSlots.value.splice(crudSlots.value.indexOf(`crudfac${field}`), 1); |
| | | if (crudSlots.value.length == 0) { |
| | | j.value = 1; |
| | | } |
| | | } |
| | | |
| | | function goBack() { |
| | | // æ¬ä¾çæææ¶ç¹å»è¿åå§ç»è·³è½¬å°è´¦å·å表页ï¼å®é
åºç¨æ¶å¯è¿åä¸ä¸é¡µ |
| | | go('/LowCodePage'); |
| | | } |
| | | </script> |
| | | <style lang="less" scoped> |
| | | .high-form { |
| | | padding-bottom: 48px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { BasicColumn, FormSchema } from '/@/components/Table'; |
| | | |
| | | //å表æ¾ç¤º |
| | | export const dtlColumns: BasicColumn[] = [ |
| | | { |
| | | title: 'åæ®µå', |
| | | dataIndex: 'FieldName', |
| | | ifShow: false, |
| | | width: 180, |
| | | }, |
| | | ]; |
| | | |
| | | export const newFormSchema: FormSchema[] = [ |
| | | { |
| | | field: 'ASSEMBLY_NAME', |
| | | label: 'å®ä½ç±»å', |
| | | component: 'Input', |
| | | colProps: { span: 8 }, |
| | | }, |
| | | { |
| | | field: '00', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'add', |
| | | colProps: { |
| | | span: 2, |
| | | }, |
| | | }, |
| | | { |
| | | field: '0', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'condAdd', |
| | | colProps: { |
| | | span: 10, |
| | | }, |
| | | }, |
| | | ]; |
| | | |
| | | export const crudSchemas: FormSchema[] = [ |
| | | { |
| | | field: 'crudAssemblyName', |
| | | label: 'å®ä½ç±»å', |
| | | component: 'Input', |
| | | colProps: { span: 8 }, |
| | | }, |
| | | { |
| | | field: '00', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'add', |
| | | colProps: { |
| | | span: 2, |
| | | }, |
| | | }, |
| | | { |
| | | field: '0', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'crudCondAdd', |
| | | colProps: { |
| | | span: 10, |
| | | }, |
| | | }, |
| | | ]; |
| | | |
| | | export const mainSchemas: FormSchema[] = [ |
| | | { |
| | | field: 'MainAssemblyName', |
| | | label: 'å®ä½ç±»å', |
| | | component: 'Input', |
| | | colProps: { span: 8 }, |
| | | }, |
| | | { |
| | | field: '00', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'add', |
| | | colProps: { |
| | | span: 2, |
| | | }, |
| | | }, |
| | | { |
| | | field: '0', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'mainCondAdd', |
| | | colProps: { |
| | | span: 10, |
| | | }, |
| | | }, |
| | | ]; |
| | |
| | | title: string; |
| | | // Service interface url |
| | | apiUrl: string; |
| | | sysApiUrl: string; |
| | | taskApiUrl: string; |
| | | // Upload url |
| | | uploadUrl?: string; |
| | |
| | | VITE_GLOB_APP_TITLE: string; |
| | | // Service interface url |
| | | VITE_GLOB_API_URL: string; |
| | | VITE_GLOB_SYS_API_URL: string; |
| | | VITE_GLOB_TSK_API_URL: string; |
| | | // Service interface url prefix |
| | | VITE_GLOB_API_URL_PREFIX?: string; |