🐛 修改组件命名规则,去掉pontCore
Some checks failed
Release / lint (push) Failing after 31s
Release / Release (push) Has been skipped

This commit is contained in:
my_ong 2024-12-10 11:19:19 +08:00
parent 673ea93312
commit eebfca8790
13 changed files with 10 additions and 82 deletions

View File

@ -29,6 +29,7 @@ export default [
dictionary: true,
sensor: true,
station: true,
material: true,
},
ecmaVersion: 2020,
parser: parserVue,

View File

@ -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<any>) {
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();

View File

@ -30,10 +30,10 @@
</template>
<script setup lang="ts">
import applyForm,{RowVO} from '../component/applyForm.vue'
import scanForm from '../component/scanForm.vue'
import applyConfirm from '../component/applyConfirm.vue'
import successResul from '../component/successResul.vue'
import applyForm,{RowVO} from './apply-form.vue'
import scanForm from './scan-form.vue'
import applyConfirm from './apply-confirm.vue'
import successResul from './success-resul.vue'
import api from '@/api'
//
defineProps(

View File

@ -37,7 +37,7 @@
import api from '@/api'
import { IPage } from '@/api/api'
import apply from './applyModal.vue';
import apply from './apply-modal.vue';
const props = defineProps({

View File

@ -3,6 +3,6 @@
</template>
<script setup lang="ts">
import applyModal from "@/views/stock/component/applyModal.vue";
import applyModal from "@/views/stock/component/apply-modal.vue";
</script>

View File

@ -3,6 +3,6 @@
</template>
<script setup lang="ts">
import applyModal from "@/views/stock/component/applyModal.vue";
import applyModal from "@/views/stock/component/apply-modal.vue";
</script>

View File

@ -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('')