Centralize API base URL in config and add missing ant-design icons.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-15 11:30:51 +03:30
co-authored by Cursor
parent 7ea97b922b
commit e78b2865c5
15 changed files with 32 additions and 21 deletions
+1
View File
@@ -8,6 +8,7 @@
"lint": "node ./node_modules/@vue/cli-service/bin/vue-cli-service.js lint"
},
"dependencies": {
"@ant-design/icons": "^2.1.1",
"@chenfengyuan/vue-countdown": "^1.1.2",
"ag-grid-community": "^21.0.1",
"ag-grid-vue": "^21.0.1",
+2 -1
View File
@@ -1,6 +1,7 @@
import axios from 'axios'
import router from '@/router'
import store from '@/store/store'
import { API_BASE_URL } from '@/config'
const domain = ""
// import themeConfig from '@/../themeConfig.js'
@@ -20,7 +21,7 @@ const headers = {
var myax= new axios.create({
baseURL: 'http://hr.asco-intl.com:2020/kernel/api/',
baseURL: `${API_BASE_URL}/`,
headers,
// domain
})
+2 -2
View File
@@ -40,7 +40,7 @@ function getBase64(file) {
});
}
//import themeConfig from "../../../../themeConfig";
import { API_BASE_URL } from '@/config'
export default {
name: 'UploadInput',
@@ -69,7 +69,7 @@ export default {
},
data() {
return {
url: 'http://hr.asco-intl.com:2020/kernel/api/register/upload',
url: `${API_BASE_URL}/register/upload`,
previewVisible: false,
previewImage: '',
fileList: [],
+3
View File
@@ -0,0 +1,3 @@
// آدرس API — برای تغییر دامنه یا پورت فقط همین فایل را ویرایش کنید
export const API_HOST = 'http://hr.asco-intl.com:2020'
export const API_BASE_URL = `${API_HOST}/kernel/api`
+2
View File
@@ -23,8 +23,10 @@ Vue.use(Antd)
// axios
import axios from './axios.js'
import { API_BASE_URL } from '@/config'
Vue.prototype.$http = axios
Vue.prototype.$apiBase = API_BASE_URL
// API Calls
/*import './http/requests'*/
+2 -1
View File
@@ -1,12 +1,13 @@
import XTbl, {Xtc} from '../../components/new-x-table/index';
import store from '@/store/store'
import { API_BASE_URL } from '@/config'
let unitsFilter = {}
store.state.contract.units.map((x) => {
unitsFilter[x.id] = x.value
})
let contractTypes = store.state.contract.contractTypes
const tbl = new XTbl('http://hr.asco-intl.com:2020/kernel/api/personnel/contract/table', 'لیست قرارداد ها');
const tbl = new XTbl(`${API_BASE_URL}/personnel/contract/table`, 'لیست قرارداد ها');
tbl.add(new Xtc('personnel.proposal.name', 'نام پرسنل').filterText())
tbl.add(new Xtc('personnel.proposal.ncode', 'کد ملی').filterText())
tbl.add(new Xtc('personnel_id', 'کد پرسنلی').filterText())
+5 -5
View File
@@ -92,7 +92,7 @@
<div class="dropbox">
<a-upload-dragger
:disabled="!$getAccess('personnel.basic.update')"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="documentFileList"
:default-file-list="documentFileList"
@change="changeDocumentUpload"
@@ -490,7 +490,7 @@
<a-upload-dragger
:disabled="!$getAccess('personnel.basic.update')"
:multiple="false"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="prsonalFileList"
:default-file-list="prsonalFileList"
@change="fileUpload"
@@ -622,7 +622,7 @@
<a-button type="danger" class="mt-3 mr-3">حذف</a-button>
</a-popconfirm>
</a-tooltip>
&lt;!&ndash; <a-button :disabled="!$getAccess('personnel.contract.print')" class="ml-3" :href="`http://hr.asco-intl.com:2020/kernel/api/personnel/print?id=${item.id}&type=${item.type?item.type:1}`" target="_blank">چاپ قرداد</a-button>&ndash;&gt;
&lt;!&ndash; <a-button :disabled="!$getAccess('personnel.contract.print')" class="ml-3" :href="`${$apiBase}/personnel/print?id=${item.id}&type=${item.type?item.type:1}`" target="_blank">چاپ قرداد</a-button>&ndash;&gt;
<a-dropdown class="mb-4">
<a-menu slot="overlay" @click="printContract($event,item.id)">
<a-menu-item v-for="(subItem,subIndex) in contractTypes" :key="subIndex">{{ subItem }}
@@ -1090,7 +1090,7 @@
<a-upload-dragger
:disabled="!$getAccess('personnel.basic.update')"
:multiple="false"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="contractFileList"
:default-file-list="contractFileList"
@change="contractFileUpload"
@@ -1501,7 +1501,7 @@ export default {
this.flags.gender = event.target.value
},
printContract(event, id) {
window.open(`http://hr.asco-intl.com:2020/kernel/api/personnel/print?type=${event.key}&id=${id}`, '_blank').focus()
window.open(`${this.$apiBase}/personnel/print?type=${event.key}&id=${id}`, '_blank').focus()
},
contractFileUpload({fileList, event, file}) {
if (file.response && file.response.id) {
+2 -2
View File
@@ -260,7 +260,7 @@
<a-upload-dragger
:disabled="!$getAccess('personnel.basic.update')"
:multiple="false"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="contractFileList"
:default-file-list="contractFileList"
@change="contractFileUpload"
@@ -426,7 +426,7 @@ export default {
}
},
printContract(event, id) {
window.open(`http://hr.asco-intl.com:2020/kernel/api/personnel/print?type=${event.key}&id=${id}`, '_blank').focus()
window.open(`${this.$apiBase}/personnel/print?type=${event.key}&id=${id}`, '_blank').focus()
},
openEditingContractModal(item, index) {
// console.log(this.contractTypes)
+2 -1
View File
@@ -1,6 +1,7 @@
import XTbl, {Xtc} from '../../components/new-x-table/index';
import { API_BASE_URL } from '@/config'
const tbl = new XTbl('http://hr.asco-intl.com:2020/kernel/api/personnel/table', 'لیست پرسنل');
const tbl = new XTbl(`${API_BASE_URL}/personnel/table`, 'لیست پرسنل');
tbl.add(new Xtc('id', 'کد پرسنلی').filterText())
tbl.add(new Xtc('name', 'نام و نام خانوادگی').filterText());
tbl.add(new Xtc('insurance_no', 'شماره بیمه').filterText())
+4 -4
View File
@@ -269,7 +269,7 @@
<div class="dropbox">
<a-upload-dragger
:disabled="!$getAccess('personnel.basic.update')"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="documentFileList"
:default-file-list="documentFileList"
@change="changeDocumentUpload"
@@ -619,7 +619,7 @@
<div class="dropbox">
<a-upload-dragger
:multiple="true"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="prsonalFileList"
:default-file-list="prsonalFileList"
@change="fileUpload"
@@ -1243,7 +1243,7 @@
<a-upload-dragger
:disabled="!$getAccess('personnel.basic.update')"
:multiple="false"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="contractFileList"
:default-file-list="contractFileList"
@change="contractFileUpload"
@@ -1881,7 +1881,7 @@ export default {
}
},*/
/* printContract(event, id) {
window.open(`http://hr.asco-intl.com:2020/kernel/api/personnel/print?type=${event.key}&id=${id}`, '_blank').focus()
window.open(`${this.$apiBase}/personnel/print?type=${event.key}&id=${id}`, '_blank').focus()
},*/
/* contractFileUpload({fileList, event, file}) {
if (file.response && file.response.id) {
+1 -1
View File
@@ -425,7 +425,7 @@
<a-upload-dragger
:disabled="true"
:multiple="false"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="prsonalFileList"
:default-file-list="prsonalFileList"
@change="fileUpload"
+2 -1
View File
@@ -1,6 +1,7 @@
import XTbl, {Xtc} from '../../components/new-x-table/index';
import { API_BASE_URL } from '@/config'
const tbl = new XTbl('http://hr.asco-intl.com:2020/kernel/api/proposal/table', 'لیست درخواست ها');
const tbl = new XTbl(`${API_BASE_URL}/proposal/table`, 'لیست درخواست ها');
tbl.add(new Xtc('name', 'نام و نام خانوادگی').filterText());
tbl.add(new Xtc('ncode', 'کد ملی').filterText())
tbl.add(new Xtc('mobile', 'موبایل').filterText())
+1 -1
View File
@@ -525,7 +525,7 @@
<div class="dropbox">
<a-upload-dragger
:multiple="true"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="fileList"
:default-file-list="fileList"
@change="changeDocumentUpload"
+1 -1
View File
@@ -532,7 +532,7 @@
<div class="dropbox">
<a-upload-dragger
:multiple="false"
action="http://hr.asco-intl.com:2020/kernel/api/register/upload"
:action="$apiBase + '/register/upload'"
:file-list="fileList"
:default-file-list="fileList"
@change="changeDocumentUpload"
+2 -1
View File
@@ -1,6 +1,7 @@
import XTbl, {Xtc} from '../../components/new-x-table/index';
import { API_BASE_URL } from '@/config'
const tbl = new XTbl('http://hr.asco-intl.com:2020/kernel/api/user/table', 'لیست کاربران');
const tbl = new XTbl(`${API_BASE_URL}/user/table`, 'لیست کاربران');
tbl.add(new Xtc('id', 'id').filterNumber());
tbl.add(new Xtc('name', 'نام و نام خانوادگی').filterText());
tbl.add(new Xtc('user_type.value', 'نوع کاربر').filterText());