| | |
| | | # VITE_GLOB_TSK_API_URL=http://localhost:9527/api |
| | | |
| | | # File upload addressï¼ optional |
| | | VITE_GLOB_UPLOAD_URL=/upload |
| | | # ç´æ¥IISæè
è°è¯ç¨ |
| | | VITE_GLOB_UPLOAD_URL=http://localhost:9528/api/Base/Upload |
| | | VITE_GLOB_DOWNLOAD_URL=http://47.115.28.255:8800/files |
| | | |
| | | # Interface prefix |
| | | VITE_GLOB_API_URL_PREFIX= |
| | |
| | | |
| | | # File upload addressï¼ optional |
| | | # It can be forwarded by nginx or write the actual address directly |
| | | # ç´æ¥IISæè
è°è¯ç¨ |
| | | # VITE_GLOB_UPLOAD_URL=http://localhost:9528/api/Base/Upload |
| | | # nginxç¨ |
| | | VITE_GLOB_UPLOAD_URL=/upload |
| | | # ä¸è½½å°å |
| | | VITE_GLOB_DOWNLOAD_URL=http://47.115.28.255:8800/files |
| | | |
| | | # Interface prefix |
| | | VITE_GLOB_API_URL_PREFIX= |
| | |
| | | ); |
| | | }; |
| | | |
| | | /* éç¨æ¥è¯¢å页 */ |
| | | export async function getListByPage<T>(params: T) { |
| | | const Keys = Object.getOwnPropertyNames(params); |
| | | let sqlcmd = ''; |
| | |
| | | }; |
| | | return model; |
| | | } |
| | | |
| | | export async function fetchJson(url: string) { |
| | | try { |
| | | const response = await fetch(url); |
| | | return await response.json(); |
| | | } catch (error) { |
| | | console.error('Error fetching columns:', error); |
| | | } |
| | | } |
| | |
| | | { url: Api.EntityPageList, params }, |
| | | { |
| | | isTransformResponse: false, |
| | | apiUrl: globSetting.taskApiUrl |
| | | apiUrl: globSetting.taskApiUrl, |
| | | }, |
| | | ); |
| | | const model: Tsk_TrigPageListGetResultModel = { |
| | |
| | | VITE_GLOB_UPLOAD_URL, |
| | | VITE_GLOB_MAP_KEY, |
| | | VITE_GLOB_TSK_API_URL, |
| | | VITE_GLOB_DOWNLOAD_URL, |
| | | } = getAppEnvConfig(); |
| | | |
| | | // Take global configuration |
| | |
| | | urlPrefix: VITE_GLOB_API_URL_PREFIX, |
| | | uploadUrl: VITE_GLOB_UPLOAD_URL, |
| | | mapKey: VITE_GLOB_MAP_KEY, |
| | | downloadUrl: VITE_GLOB_DOWNLOAD_URL, |
| | | }; |
| | | return glob as Readonly<GlobConfig>; |
| | | }; |
| | |
| | | VITE_GLOB_UPLOAD_URL, |
| | | VITE_GLOB_MAP_KEY, |
| | | VITE_GLOB_TSK_API_URL, |
| | | VITE_GLOB_DOWNLOAD_URL, |
| | | } = ENV; |
| | | |
| | | return { |
| | |
| | | VITE_GLOB_API_URL_PREFIX, |
| | | VITE_GLOB_UPLOAD_URL, |
| | | VITE_GLOB_MAP_KEY, |
| | | VITE_GLOB_DOWNLOAD_URL, |
| | | }; |
| | | } |
| | | |
| | |
| | | setFieldsValueTest({ |
| | | CHECK_REGEX: ruleData[0]?.CHECK_REGEX, |
| | | }); |
| | | } |
| | | else{ |
| | | |
| | | } else { |
| | | // setFieldsValue({ |
| | | // ID: buildUUID(), |
| | | // CHECK_TYPE:0, |
| | |
| | | async function submitAll() { |
| | | try { |
| | | const [values, testValues] = await Promise.all([validate(), validateTestForm()]); |
| | | values.ID =params.RULE_ID; |
| | | values.ID = params.RULE_ID; |
| | | const action = await SaveRule({ ...values, ...testValues }); |
| | | if (action.IsSuccessed) { |
| | | await DeleteRuleDtl(params.RULE_ID); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <BasicTable @register="registerTable"> |
| | | <template #toolbar> |
| | | <a-button type="primary" @click="handleCreate"> æ°å¢å¨åº </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> |
| | | <normalDrawer @register="registerDrawer" @success="handleSuccess" /> |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { onMounted, ref } from 'vue'; |
| | | import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table'; |
| | | import { useDrawer } from '/@/components/Drawer'; |
| | | import normalDrawer from './normalDrawer.vue'; |
| | | import { DeleteRegion } from '/@/api/tigerapi/wms/region'; |
| | | import { fetchJson, getListByPage } from '/@/api/tigerapi/system'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | |
| | | const globSetting = useGlobSetting(); |
| | | const _columns = ref([]); |
| | | const _searchFormSchema = ref([]); |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: 'å¨åºå表', |
| | | api: getListByPage, |
| | | searchInfo: { TABLE_NAME: 'WMS_REGION' }, |
| | | 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() { |
| | | openDrawer(true, { |
| | | isUpdate: false, |
| | | }); |
| | | } |
| | | |
| | | function handleEdit(record: Recordable) { |
| | | openDrawer(true, { |
| | | record, |
| | | isUpdate: true, |
| | | }); |
| | | } |
| | | |
| | | function handleDelete(record: Recordable) { |
| | | console.log(record); |
| | | //å é¤ |
| | | const apiAction = DeleteRegion(record); |
| | | apiAction.then((action) => { |
| | | if (action.IsSuccessed) { |
| | | reload(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleSuccess() { |
| | | reload(); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | _searchFormSchema.value = await fetchJson( |
| | | `${globSetting.downloadUrl}/LowCode/regionSearchform.json`, |
| | | ); |
| | | _columns.value = await fetchJson(`${globSetting.downloadUrl}/LowCode/regionBaseform.json`); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <BasicDrawer |
| | | v-bind="$attrs" |
| | | @register="registerDrawer" |
| | | showFooter |
| | | :title="getTitle" |
| | | width="600px" |
| | | @ok="handleSubmit" |
| | | > |
| | | <BasicForm @register="registerForm" /> |
| | | </BasicDrawer> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { ref, computed, unref, onMounted } from 'vue'; |
| | | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
| | | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import { SaveRegion } from '/@/api/tigerapi/wms/region'; |
| | | import { fetchJson } from '/@/api/tigerapi/system'; |
| | | |
| | | const emit = defineEmits(['success', 'register']); |
| | | const globSetting = useGlobSetting(); |
| | | const isUpdate = ref(true); |
| | | const formSchema = ref([]); |
| | | const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ |
| | | labelWidth: 120, |
| | | schemas: formSchema as unknown as FormSchema[], |
| | | actionColOptions: { |
| | | span: 24, |
| | | }, |
| | | showActionButtonGroup: false, |
| | | }); |
| | | |
| | | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
| | | resetFields(); |
| | | setDrawerProps({ confirmLoading: false }); |
| | | isUpdate.value = !!data?.isUpdate; |
| | | |
| | | if (unref(isUpdate)) { |
| | | setFieldsValue({ |
| | | ...data.record, |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | const getTitle = computed(() => (!unref(isUpdate) ? 'æ°å¢å¨åº' : 'ç¼è¾å¨åº')); |
| | | |
| | | onMounted(async () => { |
| | | formSchema.value = await fetchJson(`${globSetting.downloadUrl}/LowCode/addEditform.json`); |
| | | }); |
| | | async function handleSubmit() { |
| | | try { |
| | | const values = await validate(); |
| | | setDrawerProps({ confirmLoading: true }); |
| | | // TODO custom api |
| | | //ä¿åå¨åº |
| | | const apiAction = SaveRegion(values, unref(isUpdate)); |
| | | apiAction.then((action) => { |
| | | if (action.IsSuccessed) { |
| | | closeDrawer(); |
| | | emit('success'); |
| | | } |
| | | }); |
| | | } finally { |
| | | setDrawerProps({ confirmLoading: false }); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent } from 'vue'; |
| | | |
| | | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| | | |
| | | import { defineComponent, onMounted, ref } from 'vue'; |
| | | import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table'; |
| | | import { useDrawer } from '/@/components/Drawer'; |
| | | import RegionDrawer from './regionDrawer.vue'; |
| | | |
| | | import { columns, searchFormSchema } from './region.data'; |
| | | import { DeleteRegion } from '/@/api/tigerapi/wms/region'; |
| | | import { getListByPage } from '/@/api/tigerapi/system'; |
| | | import { fetchJson, getListByPage } from '/@/api/tigerapi/system'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | |
| | | export default defineComponent({ |
| | | name: 'LocationManagement', |
| | | components: { BasicTable, RegionDrawer, TableAction }, |
| | | setup() { |
| | | const globSetting = useGlobSetting(); |
| | | const _columns = ref([]); |
| | | const _searchFormSchema = ref([]); |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: 'å¨åºå表', |
| | | api: getListByPage, |
| | | columns, |
| | | searchInfo: { TABLE_NAME: 'WMS_REGION' }, |
| | | columns: _columns as unknown as BasicColumn[], |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas: searchFormSchema, |
| | | schemas: _searchFormSchema as unknown as FormSchema[], |
| | | }, |
| | | useSearchForm: true, |
| | | showTableSetting: true, |
| | |
| | | reload(); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | _searchFormSchema.value = await fetchJson( |
| | | `${globSetting.downloadUrl}/LowCode/regionSearchform.json`, |
| | | ); |
| | | _columns.value = await fetchJson(`${globSetting.downloadUrl}/LowCode/regionBaseform.json`); |
| | | }); |
| | | |
| | | return { |
| | | registerTable, |
| | | registerDrawer, |
| | |
| | | handleEdit, |
| | | handleDelete, |
| | | handleSuccess, |
| | | _columns, |
| | | _searchFormSchema, |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | </BasicDrawer> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, computed, unref } from 'vue'; |
| | | import { BasicForm, useForm } from '/@/components/Form/index'; |
| | | import { formSchema } from './region.data'; |
| | | import { defineComponent, ref, computed, unref, onMounted } from 'vue'; |
| | | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
| | | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| | | |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import { SaveRegion } from '/@/api/tigerapi/wms/region'; |
| | | import { fetchJson } from '/@/api/tigerapi/system'; |
| | | |
| | | export default defineComponent({ |
| | | name: 'RegionDrawer', |
| | | components: { BasicDrawer, BasicForm }, |
| | | emits: ['success', 'register'], |
| | | setup(_, { emit }) { |
| | | const globSetting = useGlobSetting(); |
| | | const isUpdate = ref(true); |
| | | |
| | | const formSchema = ref([]); |
| | | const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ |
| | | labelWidth: 120, |
| | | schemas: formSchema, |
| | | schemas: formSchema as unknown as FormSchema[], |
| | | actionColOptions: { |
| | | span: 24, |
| | | }, |
| | |
| | | |
| | | const getTitle = computed(() => (!unref(isUpdate) ? 'æ°å¢å¨åº' : 'ç¼è¾å¨åº')); |
| | | |
| | | onMounted(async () => { |
| | | formSchema.value = await fetchJson(`${globSetting.downloadUrl}/LowCode/addEditform.json`); |
| | | }); |
| | | async function handleSubmit() { |
| | | try { |
| | | const values = await validate(); |
| | |
| | | registerForm, |
| | | getTitle, |
| | | handleSubmit, |
| | | formSchema, |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | // Project abbreviation |
| | | shortName: string; |
| | | mapKey: string; |
| | | downloadUrl: string; |
| | | } |
| | | export interface GlobEnvConfig { |
| | | // Site title |
| | |
| | | // Upload url |
| | | VITE_GLOB_UPLOAD_URL?: string; |
| | | VITE_GLOB_MAP_KEY: string; |
| | | VITE_GLOB_DOWNLOAD_URL: string; |
| | | } |