Browse Source

fix: 问题单修改

tags/PMS_V1.0.0_Alpha6
chenglb 1 year ago
parent
commit
2a1d899297
  1. 2
      src/components/TableModule/index.jsx
  2. 23
      src/config/ajax.js
  3. 8
      src/pages/DataAnalysisPrediction/ParkingBusinessAly/CarTypeAly/loadable.jsx
  4. 10
      src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx
  5. 10
      src/pages/OffPeak/OffPeakParkMgm/BreakInfo/loadable.jsx
  6. 2
      src/pages/OffPeak/OffPeakParkMgm/OffPeakParkingRecords/loadable.jsx
  7. 8
      src/pages/SystemMgm/BusinessConfig/HotCbdConf/loadable.jsx
  8. 3
      src/pages/SystemMgm/BusinessConfig/PageConf/loadable.jsx
  9. 1
      src/services/OperationCenter/AppMgm/index.js

2
src/components/TableModule/index.jsx

@ -1027,7 +1027,7 @@ const TableModule = forwardRef((props, ref) => {
if (res.status === 20000) {
setAreaList(res.data);
} else {
res.message(res.data)
message.error(res.message)
}
})
.catch((err) => {

23
src/config/ajax.js

@ -7,8 +7,11 @@ import qs from 'qs'
axios.defaults.baseURL = baseApi
axios.defaults.timeout = 5 * 60 * 1000
axios.defaults.headers.common['Authorization'] = getToken()
window.queryRecord = {} // 临时方案, 对于查询比较慢的接口, 先统一在这里处理, todo, 后期每个接口再加loading,
// axios.defaults.headers.common['Authorization'] = `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTk2MzAwNzUsInN1YiI6Inlpc2Ffand0IiwibmJmIjoxNjk5NjI2NDc1LCJhdWQiOiJ5aXNhX3VzZXIiLCJpYXQiOjE2OTk2MjY0NzUsImp0aSI6IjlhYzg3MzcxNGUyYWUyNjQyOWNlMTFjMDliZjZiMTFiIiwiaXNzIjoieWlzYV9pc3MiLCJzdGF0dXMiOjEsImRhdGEiOnsidXNlcl91aWQiOjE4MTkwOTEwNDA1MzQ2MTU5NjksImlkX2NhcmQiOm51bGwsInJvbGVfaWQiOjE3NjcyMTAwNDQ0N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J9fQ.mYH-k_uKUDxysOiytBSRzOj4hWjKSxkTBVEpy4FnLe8`
window.queryRecord = {} // 临时方案, 对于查询比较慢的接口, 先统一在这里处理, todo,
const createHash = ()=>{
return location.hash.replace(/\?.*/, '').replace('#/',"").replace('/', '_')
}
/**
* @description 请求全局拦截
* @param {boolean} transFormData post方法 true转form提交表单方式
@ -46,7 +49,7 @@ function ajax(ajaxData = {}) {
// message.error('建议不要快速切换')
}else{
// message.error('请勿重复操作') // todo 直接组织重复操作, 不提示
console.error('重复操作')
console.log('重复操作')
// 返回一个promise防止语法错误
return new Promise((resolve, reject)=>{
new Error(1)
@ -61,7 +64,9 @@ function ajax(ajaxData = {}) {
}
}
// 新增逻辑 用于判断发起该请求的页面是否已经销毁
ajaxData.data = {...ajaxData.data, pageHash: location.hash.replace(/\?.*/, '').replace('#/',"").replace('/', '_')}
if(!ajaxData.noPageHash){
ajaxData.data = {...ajaxData.data, pageHash: createHash()}
}
return new Promise((resolve, reject) => {
if (!utils.isObject(ajaxData)) {
return reject(new Error('ajax请求配置错误'))
@ -69,7 +74,6 @@ function ajax(ajaxData = {}) {
let method = ajaxData.type || 'GET'
method = method.toLowerCase()
let url = ajaxData.mock && isDevelopment ? `/mock` + ajaxData.url : ajaxData.url
// let data = method === 'get' ? { params: ajaxData.data } : ajaxData.data
let data = method === "get" || method === 'delete' ? { params: ajaxData.data }: ajaxData.data;
axios[method](url, data)
@ -81,7 +85,7 @@ function ajax(ajaxData = {}) {
window.queryRecord[res.config.url].ing = false
}
}
// if(location.hash.replace(/\?.*/, '') != JSON.parse(res.config.data)?.pageHash){
// if(createHash() != JSON.parse(res.config.data)?.pageHash){
// console.log('页面已销毁')
// resolve({message: "",status: 20000,data: [] })
// return
@ -93,7 +97,7 @@ function ajax(ajaxData = {}) {
window.queryRecord[res.config.url].ing = false
}
}
// if(location.hash.replace(/\?.*/, '') != res.config.params.pageHash){
// if(createHash() != res.config.params.pageHash){
// console.log('页面已销毁')
// resolve({message: "", status: 20000,data: [] })
// return
@ -114,7 +118,7 @@ function ajax(ajaxData = {}) {
if(JSON.parse(err.config.data)?.guard){
window.queryRecord[err.config.url].ing = false
}
if(location.hash.replace(/\?.*/, '').replace('#/',"").replace('/', '_') != JSON.parse(err.config.data)?.pageHash){
if(JSON.parse(err.config.data)?.pageHash && createHash() != JSON.parse(err.config.data)?.pageHash){
console.log('接口异常,但页面已销毁')
reject(new Error(1))
return
@ -126,7 +130,7 @@ function ajax(ajaxData = {}) {
window.queryRecord[err.config.url].ing = false
}
}
if(location.hash.replace(/\?.*/, '').replace('#/',"").replace('/', '_') != err.config.params.pageHash){
if(err.config.params.pageHash && createHash() != err.config.params.pageHash){
console.log('接口异常,但页面已销毁')
reject(new Error(1))
return
@ -138,7 +142,6 @@ function ajax(ajaxData = {}) {
case 401:
removeToken()
window.location.replace(sysConfig.logout_url)
// window.location.replace("/#/login")
message.error('登录失效')
break
case 500:

8
src/pages/DataAnalysisPrediction/ParkingBusinessAly/CarTypeAly/loadable.jsx

@ -306,9 +306,9 @@ function CarTypeAly() {
getParkingOption(res.data.energy)
getCarTypeOption(res.data.car_type)
}
// else {
// message.error('')
// }
else {
message.error(res.message)
}
})
.catch((err) => console.error(err));
}
@ -438,6 +438,8 @@ function CarTypeAly() {
.then((res) => {
if (res.status === 20000) {
setAreaList(res.data);
}else{
message.error(res.message)
}
})
.catch((err) => {

10
src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx

@ -319,8 +319,6 @@ function PersonInfo() {
})
})
setTranferAllData(temparr)
currentPersonInfo.good_ids = '',
currentPersonInfo.depart_id = ''
} else {
message.error(res.message)
}
@ -332,8 +330,8 @@ function PersonInfo() {
setTranferAllData([])
setDepartEditOptions([])
setAssetsEditOptions([])
currentPersonInfo.good_ids = '',
currentPersonInfo.depart_id = ''
// currentPersonInfo.good_ids = '',
// currentPersonInfo.depart_id = ''
}
}, [getPersonId])
/**
@ -359,7 +357,7 @@ function PersonInfo() {
const search = () => {
setPageData({
pn: 1,
page_size: 20
page_size: dictionary?.pageSizeOptions[0]
})
}
@ -391,7 +389,7 @@ function PersonInfo() {
property_id: '',
road_name: '',
pn: 1,
page_size: 20
page_size:dictionary?.pageSizeOptions[0]
}
getData(params.current)
setGetOperatorId('0')

10
src/pages/OffPeak/OffPeakParkMgm/BreakInfo/loadable.jsx

@ -19,6 +19,7 @@ function BreakInfo() {
const tableRef = useRef()
//
const [total, setTotal] = useState(0);
const [historyNum, setHistoryNum] = useState(0)
const columns = [
{
title: "姓名",
@ -97,11 +98,8 @@ function BreakInfo() {
];
//
const initFormData = {
merchantName: "0",
road_name: "",
parking_num: "",
operator: "",
exceedTime: "",
name: "",
tel: ""
};
function search(params) {
@ -109,6 +107,7 @@ function BreakInfo() {
if (res.status === 20000) {
setTableData(res.data.list);
setTotal(res.data.total);
setHistoryNum(res.data.set_nums ? res.data.set_nums : 0)
}else{
message.error(res.message)
}
@ -120,6 +119,7 @@ function BreakInfo() {
const countSetting=()=>{
setVisible(true)
setCurrentRecord({})
setCount(historyNum)
}
const save = ()=>{

2
src/pages/OffPeak/OffPeakParkMgm/OffPeakParkingRecords/loadable.jsx

@ -139,6 +139,8 @@ function OffPeakParkingRecords() {
if (res.status === 20000) {
setTableData(res.data.list);
setTotal(res.data.total);
}else{
message.error(res.message)
}
});
}

8
src/pages/SystemMgm/BusinessConfig/HotCbdConf/loadable.jsx

@ -29,6 +29,7 @@ function HotCbdConf() {
const [detailVisible, setDetailVisible] = useState(false);
// const [tabKey, setTabKey] = useState("1");
const [treeData, setTreeData] = useState([])
const [treeEditData, setTreeEditData] = useState([])
const [defaultParams, setDefaultParams] = useSessionStorageState('hotCbdConf_formData',{
defaultValue:{}
})
@ -283,8 +284,11 @@ function HotCbdConf() {
ajax.getAreaTree()
.then(res=>{
if(res.status == 20000){
// tranverseTreeData(res.data)
setTreeData(res.data)
if(res.data?.length){
let newarr = res.data.slice(1, res.data.length)
setTreeEditData(newarr)
}
}else{
message.error(res.message)
}
@ -450,7 +454,7 @@ function HotCbdConf() {
}
return false
}}
treeData={treeData}
treeData={treeEditData}
/>
</div>
</div>

3
src/pages/SystemMgm/BusinessConfig/PageConf/loadable.jsx

@ -20,6 +20,9 @@ function PageConf() {
dataIndex: "id",
key: "id",
align: "center",
render:(_,record, index)=>{
return index + 1
}
},
{
title: "数据项名称",

1
src/services/OperationCenter/AppMgm/index.js

@ -15,6 +15,7 @@ const publishMenu = (params) => {
url: "/api/ope/app_manage/publish_menu",
type: "post",
data: params,
noPageHash: true
});
};
// 移动端管理配置 获取移动端管理数据

Loading…
Cancel
Save