diff --git a/eslint.config.js b/eslint.config.js index 3b1cb57..1f45368 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -29,6 +29,7 @@ export default [ dictionary: true, sensor: true, station: true, + material: true, }, ecmaVersion: 2020, parser: parserVue, diff --git a/src/api/pontCore.ts b/src/api/pontCore.ts deleted file mode 100644 index fa183ba..0000000 --- a/src/api/pontCore.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @description pont内置请求单例 - */ - -class PontCoreManager { - // static singleInstance = undefined as PontCoreManager; - private static singleInstance: PontCoreManager | null = null; - - static getSignleInstance() { - if (!PontCoreManager.singleInstance) { - PontCoreManager.singleInstance = new PontCoreManager(); - return PontCoreManager.singleInstance; - } - return PontCoreManager.singleInstance; - } - - /** - * fetch请求 - * @param url 请求url - * @param options fetch 请求配置 - */ - fetch(url: string, options = {}) { - return fetch(url, options).then((res) => { - return res.json(); - }); - } - - /** - * 使用外部传入的请求方法替换默认的fetch请求 - */ - useFetch(fetch: (url: string, options?: any) => Promise) { - if (typeof fetch !== 'function') { - console.error('fetch should be a function '); - return; - } - - this.fetch = fetch; - } - - getUrl(path: string, queryParams: any) { - const params = { - ...(queryParams || ({} as any)), - }; - - const url = path.replace(/\{([^\\}]*(?:\\.[^\\}]*)*)\}/gm, ( key) => { - // eslint-disable-next-line no-param-reassign - key = key.trim(); - - if (params[key] !== undefined) { - const value = params[key]; - delete params[key]; - return value; - } - console.warn('Please set value for template key: ', key); - return ''; - }); - - const paramStr = Object.keys(params) - .map((key) => { - return params[key] === undefined ? '' : `${key}=${params[key]}`; - }) - .filter((id) => id) - .join('&'); - - if (paramStr) { - return `${url}?${paramStr}`; - } - - return url; - } -} - -export const PontCore = PontCoreManager.getSignleInstance(); diff --git a/src/views/stock/component/applyConfirm.vue b/src/views/stock/component/apply-confirm.vue similarity index 100% rename from src/views/stock/component/applyConfirm.vue rename to src/views/stock/component/apply-confirm.vue diff --git a/src/views/stock/component/applyForm.vue b/src/views/stock/component/apply-form.vue similarity index 100% rename from src/views/stock/component/applyForm.vue rename to src/views/stock/component/apply-form.vue diff --git a/src/views/stock/component/applyModal.vue b/src/views/stock/component/apply-modal.vue similarity index 94% rename from src/views/stock/component/applyModal.vue rename to src/views/stock/component/apply-modal.vue index 0940be0..081bd5a 100644 --- a/src/views/stock/component/applyModal.vue +++ b/src/views/stock/component/apply-modal.vue @@ -30,10 +30,10 @@ diff --git a/src/views/stock/outboud/outbound-page.vue b/src/views/stock/outboud/outbound-page.vue index 2390e61..e82b72f 100644 --- a/src/views/stock/outboud/outbound-page.vue +++ b/src/views/stock/outboud/outbound-page.vue @@ -3,6 +3,6 @@ diff --git a/src/views/stock/stocktaking/resultForm.vue b/src/views/stock/stocktaking/result-form.vue similarity index 100% rename from src/views/stock/stocktaking/resultForm.vue rename to src/views/stock/stocktaking/result-form.vue diff --git a/src/views/stock/stocktaking/stocktaking-page.vue b/src/views/stock/stocktaking/stocktaking-page.vue index 84baaae..a3f2f10 100644 --- a/src/views/stock/stocktaking/stocktaking-page.vue +++ b/src/views/stock/stocktaking/stocktaking-page.vue @@ -86,8 +86,8 @@ import { config, formItems } from './form' import { notification } from 'ant-design-vue' import dayjs from 'dayjs'; import { useUserStore } from '@/stores/user' -import scanForm from '../component/scanForm.vue' -import resultForm from '../stocktaking/resultForm.vue' +import scanForm from '../component/scan-form.vue' +import resultForm from './result-form.vue' const searchKey = ref('')