Commit a7dcfc6d authored by GuanHua's avatar GuanHua
parents 2067b652 bf75e844
......@@ -27,3 +27,6 @@
/src/services/index.ts
.vscode
config/base.config.json
src/global/config/global.d.ts
src/services/*Api.ts
\ No newline at end of file
......@@ -82,19 +82,47 @@ async function batchAxiosHttps() {
// }
// }
// serverFn(asyncHttpQueue)
const httpErrorQueue = []
const serverErrorQueue = []
console.log('\n')
for (const item in serviceConfig) {
if(JSON.stringify(item) !== '{}'){
for (const subItem in serviceConfig[item]) {
try {
const data = await axios(serviceConfig[item][subItem])
asyncHttpQueue[item][subItem] = data.data.data
// 当接口出错时 不写入json文件
if (data.data.code === 1000) {
asyncHttpQueue[item][subItem] = data.data.data
} else {
serverErrorQueue.push({ ...asyncHttpQueue[item][subItem], ...data.data})
// 默认置为null
asyncHttpQueue[item][subItem] = null
}
} catch(err) {
console.log(serviceConfig[item][subItem].url)
console.log(err.response.data)
httpErrorQueue.push({...serviceConfig[item][subItem], ...err.response.data})
}
}
}
}
if (httpErrorQueue.length > 0) {
console.log('\n网络错误\n')
// 可在此做日志收集
console.log(httpErrorQueue)
}
if (serverErrorQueue.length > 0) {
console.log('\n接口服务错误\n')
// 可在此做日志收集
console.log(serverErrorQueue)
}
if (httpErrorQueue.length > 0 || serverErrorQueue.length > 0) {
// 退出构建
console.log('\n脚本构建失败!!!!!!')
// 终止当前进程
process.exit(1)
}
return isDemo ? Object.assign(asyncHttpQueue, await demoFetch()) : asyncHttpQueue
}
......
......@@ -29,7 +29,7 @@ const whiteLists = [
'/shop',
'/purchaseOnline',
'/pointsMall',
'/memberCenter',
// '/memberCenter',
'/memberCenter/noAuth',
'/commodity',
'/shops',
......
......@@ -38,7 +38,7 @@ const ModalTable:React.FC<ModalTableProps> = (props) => {
tableType='small'
currentRef={selfRef}
formRender={(child, ps) => <Row justify='space-between'>
<Col>{child}</Col>
<Col span={18}>{child}</Col>
<Col style={{marginTop: 4}}>{ps}</Col>
</Row>}
{...resetTable}
......
......@@ -128,6 +128,9 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
filterOption={false}
loading={loading}
options={dataSource}
getPopupContainer={triggerNode => {
return triggerNode
}}
value={props.value}
dropdownRender={originNode => <SelectContent confirm={confirm} resetField={resetField} parentRef={ref} handleChange={handleChange} multiple={multiple} value={props.value}>{originNode}</SelectContent>}
{...multipleProps}
......
export interface MemberType {
id: number;
typeName: string;
}
export interface BusinessType {
id: number;
typeName: string;
}
export interface UseType {
memberType: MemberType[];
businessType: BusinessType[];
}
export interface UserRegister {
useType: UseType;
}
export interface ShopInfo {
id: number;
name: string;
type: number;
environment: number;
logoUrl: string;
describe: string;
state: number;
url: string;
}
export interface Web {
shopInfo: ShopInfo[];
}
export interface PayConfig {
paymemberConfig?: any;
}
export interface CountryList {
name: string;
key: string;
icon: string;
}
export interface Global {
siteId: number;
siteUrl: string;
logo: string;
countryList: CountryList[];
}
export interface RootObject {
userRegister: UserRegister;
web: Web;
payConfig: PayConfig;
global: Global;
}
\ No newline at end of file
......@@ -206,6 +206,8 @@ h6 {
}
}
.tree-node-circle {
width: 4px;
height: 4px;
......@@ -266,4 +268,11 @@ h6 {
position: absolute;
top: 100%;
font-size: 12px;
}
// 强制覆盖下拉框固定位置
.fixed-ant-selected-down {
.ant-select-dropdown {
top: 36px !important;
}
}
\ No newline at end of file
......@@ -15,6 +15,11 @@ import { Button, message } from 'antd'
import NiceForm from '@/components/NiceForm'
import ModalTable from '@/components/ModalTable'
import { GlobalConfig } from '@/global/config'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Search from '@/components/NiceForm/components/Search'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import Submit from '@/components/NiceForm/components/Submit'
export interface PositionSettingProps {
addSchemaAction: ISchemaFormActions,
......@@ -221,9 +226,59 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入商品名称或者ID'
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '请输入商品名称/ID',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
categoryId: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
style: {
width: 160
}
}
},
brandId: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
style: {
width: 160
}
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
......@@ -282,7 +337,18 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
fetchTableData={params => fetchProductList(params)}
formilyProps={
{
ctx: { schema: formProduct }
ctx: {
schema: formProduct,
components: { ModalSearch: Search, SearchSelect, Submit } ,
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
}
}
}
}
tableProps={{
......
......@@ -4,7 +4,15 @@
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-22 10:23:38
*/
import * as Api from './index'
import * as LogisticsApi from './LogisticsApi'
import * as PassApi from './PassApi'
import * as WarehouseApi from './WarehouseApi'
import * as MemberApi from './MemberApi'
import * as ProductApi from './ProductApi'
import * as TemplateApi from './TemplateApi'
import * as PayApi from './PayApi'
import * as SearchApi from './SearchApi'
import * as OrderApi from './OrderApi'
import request from '@/utils/request'
/**
......@@ -15,4 +23,14 @@ export const CustomApi = {
}
// 公共的接口,从yapi拉下
export const PublicApi = Api
export const PublicApi = {
...LogisticsApi,
...PassApi,
...WarehouseApi,
...MemberApi,
...ProductApi,
...TemplateApi,
...PayApi,
...SearchApi,
...OrderApi,
}
/*
* @Author: LeeJiancong
* @Date: 2020-07-22 09:54:50
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-24 16:09:13
*/
import { Config } from 'god-yapi2ts'
const tokens = [
'b063a0a29fb1a570d9f00eaabbdd8ccfe8e6e10e24739441990cc1098e79b601', // 业务中台管理平台
'7c8f235d95f6224ceb97c4d832b09658f9a75fb8721a95699b230af0733d7fa4', // 仓库服务
'8d14d945507d1f8cd89afe139ca6d111bbad25f702fafe0aec59d3c9cd2e0ffe', // 物流服务
'3a46198c5b97ac7147e5b07ad2dff5ac5c93c1afed47e1911961db87149e6ebf', // 商户会员管理服务
'efe99e20ed1375dc0db3e809e4fc7692f42ecebaf60cd77e65c50ed65d6ba6c4', // 商品服务
'7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb', // 店铺服务
'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49', // 支付服务
'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48', // 搜索服务
'5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd' //订单服务
const tokenList = [
{ name: 'Pass', token: 'b063a0a29fb1a570d9f00eaabbdd8ccfe8e6e10e24739441990cc1098e79b601' }, // 业务中台管理平台
{ name: 'Warehouse', token: '7c8f235d95f6224ceb97c4d832b09658f9a75fb8721a95699b230af0733d7fa4' }, // 仓库服务
{ name: 'Logistics', token: '8d14d945507d1f8cd89afe139ca6d111bbad25f702fafe0aec59d3c9cd2e0ffe' }, // 物流服务
{ name: 'Member', token: '3a46198c5b97ac7147e5b07ad2dff5ac5c93c1afed47e1911961db87149e6ebf' }, // 商户会员管理服务
{ name: 'Product', token: 'efe99e20ed1375dc0db3e809e4fc7692f42ecebaf60cd77e65c50ed65d6ba6c4' }, // 商品服务
{ name: 'Template', token: '7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb' }, // 店铺模板服务
{ name: 'Pay', token: 'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49' }, // 支付服务
{ name: 'Search', token: 'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48' }, // 搜索服务
{ name: 'Order', token: '5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd' }, //订单服务
]
const genMap = (tokens) => {
return tokens.map(v => {
return {
token: v,
const getConfigMap = (tokens) => tokens.map(v => ({
serverUrl: 'http://10.0.0.25:4000/',
typesOnly: false,
reactHooks: {
enabled: false,
},
outputFilePath: `src/services/${v.name}Api.ts`,
requestFunctionFilePath: 'request.ts',
dataKey: 'data',
projects: [
{
token: v.token,
categories: [
{
id: 0,
......@@ -33,21 +31,7 @@ const genMap = (tokens) => {
},
]
}
})
}
const config: Config = [
{
serverUrl: 'http://10.0.0.25:4000/',
typesOnly: false,
reactHooks: {
enabled: false,
},
outputFilePath: 'src/services/index.ts',
requestFunctionFilePath: 'request.ts',
dataKey: 'data',
projects: genMap(tokens),
},
]
],
}))
export default config
\ No newline at end of file
export default getConfigMap(tokenList)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment