Ben Lin
2024-05-30 7e1c7ea9f47d6fe3fd669672a4bce51ec2758bc3
Low Code Update
已删除1个文件
已修改10个文件
已添加2个文件
342 ■■■■■ 文件已修改
.env.development 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.production 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/system.ts 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/tsk/tsk_trig.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/hooks/setting/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/env.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/bas/checkrule/ruleDetail.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/index.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/normalDrawer.vue 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/wms/region/index.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/wms/region/region.data.ts 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/wms/region/regionDrawer.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
types/config.d.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -16,7 +16,9 @@
# 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=
.env.production
@@ -22,7 +22,12 @@
# 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=
src/api/tigerapi/system.ts
@@ -646,6 +646,7 @@
  );
};
/* é€šç”¨æŸ¥è¯¢åˆ†é¡µ */
export async function getListByPage<T>(params: T) {
  const Keys = Object.getOwnPropertyNames(params);
  let sqlcmd = '';
@@ -676,3 +677,12 @@
  };
  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);
  }
}
src/api/tigerapi/tsk/tsk_trig.ts
@@ -26,7 +26,7 @@
    { url: Api.EntityPageList, params },
    {
      isTransformResponse: false,
      apiUrl: globSetting.taskApiUrl
      apiUrl: globSetting.taskApiUrl,
    },
  );
  const model: Tsk_TrigPageListGetResultModel = {
src/hooks/setting/index.ts
@@ -10,6 +10,7 @@
    VITE_GLOB_UPLOAD_URL,
    VITE_GLOB_MAP_KEY,
    VITE_GLOB_TSK_API_URL,
    VITE_GLOB_DOWNLOAD_URL,
  } = getAppEnvConfig();
  // Take global configuration
@@ -21,6 +22,7 @@
    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>;
};
src/utils/env.ts
@@ -32,6 +32,7 @@
    VITE_GLOB_UPLOAD_URL,
    VITE_GLOB_MAP_KEY,
    VITE_GLOB_TSK_API_URL,
    VITE_GLOB_DOWNLOAD_URL,
  } = ENV;
  return {
@@ -41,6 +42,7 @@
    VITE_GLOB_API_URL_PREFIX,
    VITE_GLOB_UPLOAD_URL,
    VITE_GLOB_MAP_KEY,
    VITE_GLOB_DOWNLOAD_URL,
  };
}
src/views/tigerprojects/bas/checkrule/ruleDetail.vue
@@ -161,9 +161,7 @@
          setFieldsValueTest({
            CHECK_REGEX: ruleData[0]?.CHECK_REGEX,
          });
        }
        else{
        } else {
          // setFieldsValue({
          //   ID: buildUUID(),
          //   CHECK_TYPE:0,
@@ -184,7 +182,7 @@
      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);
src/views/tigerprojects/system/lowcode/normal/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,100 @@
<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>
src/views/tigerprojects/system/lowcode/normal/normalDrawer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
<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>
src/views/tigerprojects/wms/region/index.vue
@@ -28,29 +28,30 @@
  </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,
@@ -94,6 +95,13 @@
        reload();
      }
      onMounted(async () => {
        _searchFormSchema.value = await fetchJson(
          `${globSetting.downloadUrl}/LowCode/regionSearchform.json`,
        );
        _columns.value = await fetchJson(`${globSetting.downloadUrl}/LowCode/regionBaseform.json`);
      });
      return {
        registerTable,
        registerDrawer,
@@ -101,6 +109,8 @@
        handleEdit,
        handleDelete,
        handleSuccess,
        _columns,
        _searchFormSchema,
      };
    },
  });
src/views/tigerprojects/wms/region/region.data.ts
ÎļþÒÑɾ³ý
src/views/tigerprojects/wms/region/regionDrawer.vue
@@ -11,23 +11,24 @@
  </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,
        },
@@ -48,6 +49,9 @@
      const getTitle = computed(() => (!unref(isUpdate) ? '新增储区' : '编辑储区'));
      onMounted(async () => {
        formSchema.value = await fetchJson(`${globSetting.downloadUrl}/LowCode/addEditform.json`);
      });
      async function handleSubmit() {
        try {
          const values = await validate();
@@ -71,6 +75,7 @@
        registerForm,
        getTitle,
        handleSubmit,
        formSchema,
      };
    },
  });
types/config.d.ts
@@ -149,6 +149,7 @@
  // Project abbreviation
  shortName: string;
  mapKey: string;
  downloadUrl: string;
}
export interface GlobEnvConfig {
  // Site title
@@ -161,4 +162,5 @@
  // Upload url
  VITE_GLOB_UPLOAD_URL?: string;
  VITE_GLOB_MAP_KEY: string;
  VITE_GLOB_DOWNLOAD_URL: string;
}