Commit fb1947ddfd4cd54baebc3768dbad7869a8f53b3f

Authored by fengwotao
1 parent 97579852

fix(src/packages/): 修复之前未移动组件路径的项目导入问题

... ... @@ -78,6 +78,10 @@ export const compatibleConfig = [
78 78 },
79 79 {
80 80 key: 'OverrideTextCommon', //自定义文字
  81 + oldChartKey: 'ExternalVCOverrideTextCommon',
  82 + newChartKey: 'ExternalVCOverrideTextCommon',
  83 + oldConKey: 'ExternalVCCOverrideTextCommon',
  84 + newConKey: 'ExternalVCCOverrideTextCommon',
81 85 oldPackage: 'Informations', //之前的包名
82 86 newPackage: 'Informations', //现在的包名
83 87 oldCategory: 'Mores', //之前的目录
... ... @@ -106,6 +110,10 @@ export const compatibleConfig = [
106 110 {
107 111 key: 'LeftCenterRightHead', //大标题1
108 112 newKey: 'Headline1', //新的key
  113 + oldChartKey: 'ExternalVCLeftCenterRightHead',
  114 + newChartKey: 'ExternalVCHeadline1',
  115 + oldConKey: 'ExternalVCCLeftCenterRightHead',
  116 + newConKey: 'ExternalVCCHeadline1',
109 117 oldPackage: 'Composes', //之前的包名
110 118 newPackage: 'Decorates', //现在的包名
111 119 oldCategory: 'HeadCombinations', //之前的目录
... ... @@ -116,6 +124,10 @@ export const compatibleConfig = [
116 124 {
117 125 key: 'LeftCenterRightHeadAnimat', //大标题2
118 126 newKey: 'Headline2', //新的key
  127 + oldChartKey: 'ExternalVCLeftCenterRightHeadAnimat',
  128 + newChartKey: 'ExternalVCHeadline2',
  129 + oldConKey: 'ExternalVCCLeftCenterRightHeadAnimat',
  130 + newConKey: 'ExternalVCCHeadline2',
119 131 oldPackage: 'Composes', //之前的包名
120 132 newPackage: 'Decorates', //现在的包名
121 133 oldCategory: 'HeadCombinations', //之前的目录
... ... @@ -126,6 +138,10 @@ export const compatibleConfig = [
126 138 {
127 139 key: 'Title1', //小标题1
128 140 newKey: 'Subtitle1', //新的key
  141 + oldChartKey: 'ExternalVCTitle1',
  142 + newChartKey: 'ExternalVCSubtitle1',
  143 + oldConKey: 'ExternalVCCTitle1',
  144 + newConKey: 'ExternalVCCSubtitle1',
129 145 oldPackage: 'Composes', //之前的包名
130 146 newPackage: 'Decorates', //现在的包名
131 147 oldCategory: 'Mores', //之前的目录
... ... @@ -135,6 +151,10 @@ export const compatibleConfig = [
135 151 },
136 152 {
137 153 key: 'Title2', //小标题2
  154 + oldChartKey: 'ExternalVCTitle2',
  155 + newChartKey: 'ExternalVCSubtitle2',
  156 + oldConKey: 'ExternalVCCTitle2',
  157 + newConKey: 'ExternalVCCSubtitle2',
138 158 newKey: 'Subtitle2', //新的key
139 159 oldPackage: 'Composes', //之前的包名
140 160 newPackage: 'Decorates', //现在的包名
... ... @@ -145,6 +165,10 @@ export const compatibleConfig = [
145 165 },
146 166 {
147 167 key: 'Title3', //小标题3
  168 + oldChartKey: 'ExternalVCTitle3',
  169 + newChartKey: 'ExternalVCSubtitle3',
  170 + oldConKey: 'ExternalVCCTitle3',
  171 + newConKey: 'ExternalVCCSubtitle3',
148 172 newKey: 'Subtitle3', //新的key
149 173 oldPackage: 'Composes', //之前的包名
150 174 newPackage: 'Decorates', //现在的包名
... ... @@ -152,6 +176,15 @@ export const compatibleConfig = [
152 176 newCategory: 'Subtitle', //新的目录
153 177 oldCategoryName: '更多', //之前的目录名
154 178 newCategoryName: '小标题' //新的目录名
  179 + },
  180 + {
  181 + key: 'OverrideImage', //自定义图片
  182 + oldPackage: 'Informations', //之前的包名
  183 + newPackage: 'Informations', //现在的包名
  184 + oldCategory: 'Mores', //之前的目录
  185 + newCategory: 'Mores', //新的目录
  186 + oldCategoryName: '更多', //之前的目录名
  187 + newCategoryName: '更多' //新的目录名
155 188 }
156 189 ]
157 190 //
... ...
... ... @@ -14,7 +14,7 @@ const getChartConfigFile = async (path: string) => {
14 14
15 15 export const createComponent = async (configType: ConfigType) => {
16 16 // eslint-disable-next-line prefer-const
17   - let { key, chartKey, category, package: packageName, redirectComponent, categoryName } = configType
  17 + let { key, chartKey, category, package: packageName, redirectComponent, categoryName , conKey} = configType
18 18 // redirectComponent 是给图片组件库和图标组件库使用的
19 19 if (redirectComponent) {
20 20 const [packageName, categoryName, keyName] = redirectComponent.split('/')
... ... @@ -25,13 +25,17 @@ export const createComponent = async (configType: ConfigType) => {
25 25 /**
26 26 * 兼容之前导入错误的补丁
27 27 */
  28 + const includeOldTitleKeys=['LeftCenterRightHead','LeftCenterRightHeadAnimat','Title1','Title2','Title3']
28 29 compatibleConfig?.forEach(item => {
29 30 if (item?.key === key) {
30   - key = item?.key as string
  31 + key = includeOldTitleKeys.includes(item?.key)?item?.newKey:item?.key as any
31 32 packageName = item?.newPackage as string
32 33 category = item?.newCategory as string
33 34 // eslint-disable-next-line @typescript-eslint/no-unused-vars
34 35 categoryName = item?.newCategoryName as string
  36 + chartKey = includeOldTitleKeys.includes(item?.key)?item?.newChartKey:chartKey as any
  37 + // eslint-disable-next-line @typescript-eslint/no-unused-vars
  38 + conKey = includeOldTitleKeys.includes(item?.key)?item?.newConKey:conKey as any
35 39 }
36 40 })
37 41 //
... ...