InheritorContent.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. import { DataModel, transformArrayDataModel, transformDataModel } from '@imengyu/js-request-transform';
  2. import { AppServerRequestModule } from '../RequestModules';
  3. import dayjs from 'dayjs';
  4. import { transformSomeToArray } from '../Utils';
  5. import { GetContentListItem } from '../CommonContent';
  6. export class CommonInfo<T extends DataModel> extends DataModel<T> {
  7. constructor(classCreator?: (new () => T) | undefined, name: string = '基础信息') {
  8. super(classCreator, name);
  9. this.setNameMapperCase('Camel', 'Snake');
  10. this._convertTable = {
  11. id: { clientSide: 'number', serverSide: 'number', clientSideRequired: true },
  12. flag: { clientSide: 'splitCommaArray', serverSide: 'commaArrayMerge' },
  13. type: { clientSide: 'number', serverSide: 'number' },
  14. keywords: { clientSide: 'splitCommaArray', serverSide: 'commaArrayMerge' },
  15. images: { clientSide: 'array', serverSide: 'array' },
  16. expandInfo: { serverSide: 'undefined' },
  17. region: { clientSide: 'number', serverSide: 'number' },
  18. progress: { clientSide: 'number', serverSide: 'number' },
  19. longitude: { clientSide: 'number', serverSide: 'number' },
  20. latitude: { clientSide: 'number', serverSide: 'number' },
  21. };
  22. this._beforeSolveClient = (data) => {
  23. if (!data.contentId && data.id)
  24. data.contentId = data.id;
  25. }
  26. }
  27. contentId = null as number|null;
  28. collectId = null as number|null;
  29. title = '' as string;
  30. region = null as number|null;
  31. image = null as string|null;
  32. imageDesc = '' as string|null;
  33. images = [] as string[];
  34. audio = '' as string|null;
  35. video = '' as string|null;
  36. flag = [] as string[];
  37. keywords = [] as string[];
  38. tags = '' as string;
  39. associationId = 0 as number;
  40. pid = 0 as number;
  41. content = '' as string|null;
  42. }
  43. export class IchInfo extends CommonInfo<IchInfo> {
  44. constructor() {
  45. super(IchInfo, "非遗项目信息");
  46. this._convertTable = {
  47. ...this._convertTable,
  48. lonlat: { serverSide: 'undefined' },
  49. batch: { clientSide: 'number', serverSide: 'string' },
  50. typicalImages: [
  51. {
  52. clientSide: 'object',
  53. clientSideChildDataModel: {
  54. convertTable: {},
  55. },
  56. serverSide: 'string'
  57. },
  58. {
  59. clientSide: 'addDefaultValue',
  60. clientSideParam: {
  61. defaultValue: [],
  62. }
  63. },
  64. ],
  65. };
  66. this._convertKeyType = (key, direction) => {
  67. if (key.endsWith('Text') || key.endsWith('_text')) {
  68. return {
  69. clientSide: 'string',
  70. serverSide: 'undefined',
  71. };
  72. }
  73. };
  74. this._afterSolveServer = (self) => {
  75. self.lonlat = [ self.longitude, self.latitude ];
  76. if (!self.intro && self.description)
  77. self.intro = self.description;
  78. };
  79. this._afterSolveClient = (data) => {
  80. data.longitude = this.lonlat[0];
  81. data.latitude = this.lonlat[1];
  82. };
  83. const _superBeforeSolveClient = this._beforeSolveClient;
  84. this._beforeSolveClient = (data) => {
  85. _superBeforeSolveClient?.(data);
  86. if (!this.expandInfo)
  87. this.expandInfo = new IchExpandInfo();
  88. this.expandInfo.batch = this.batch;
  89. this.expandInfo.region = this.region;
  90. this.expandInfo.image = this.image;
  91. this.expandInfo.level = this.level!;
  92. this.expandInfo.ichType = this.ichType!;
  93. this.expandInfo.contentId = this.contentId!;
  94. this.expandInfo.collectId = this.collectId!;
  95. };
  96. }
  97. lonlat = [] as (number|string)[];
  98. expandInfo : IchExpandInfo|null = new IchExpandInfo();
  99. id = 0 as number;
  100. modelId = 2;
  101. mainBodyColumnId = 0 as number;
  102. ztImage = '' as string|null;
  103. intro = '' as string;
  104. description = '' as string;
  105. heritage = null as number|null;
  106. level = null as number|null;
  107. ichType = null as number|null;
  108. batch = '' as string;
  109. longitude = '' as string;
  110. latitude = '' as string;
  111. mapX = '' as string|null;
  112. mapY = '' as string|null;
  113. unit = '' as string;
  114. address = '' as string|null;
  115. declarationRegion = '' as string;
  116. popularRegion = '' as string;
  117. approveTime = '' as string;
  118. typicalImages = [] as {
  119. form: string,
  120. mobile: string,
  121. desc: string,
  122. url: string,
  123. }[];
  124. thumbnail = '' as string;
  125. flagText = '' as string;
  126. typeText = '' as string;
  127. openStatusText = '' as string;
  128. statusText = '' as string;
  129. regionText = '' as string;
  130. levelText = '' as string;
  131. crTypeText = '' as string;
  132. ichTypeText = '' as string;
  133. claimStatusText = '' as string;
  134. isMultipleClaimsText = '' as string;
  135. batchText = '' as string;
  136. ichSiteTypeText = '' as string;
  137. }
  138. export class IchExpandInfo extends DataModel<IchExpandInfo> {
  139. constructor() {
  140. super(IchExpandInfo, "非遗项目信息");
  141. this.setNameMapperCase('Camel', 'Snake');
  142. this._convertTable = {
  143. protectLevel: { clientSide: 'number', serverSide: 'string' },
  144. id: { clientSide: 'number', serverSide: 'undefined' },
  145. };
  146. this._convertKeyType = (key, direction) => {
  147. if (key.endsWith('Text') || key.endsWith('_text')) {
  148. return {
  149. clientSide: 'string',
  150. serverSide: 'undefined',
  151. };
  152. }
  153. if (key.endsWith('At')) {
  154. return {
  155. clientSide: 'date',
  156. serverSide: 'undefined',
  157. };
  158. }
  159. };
  160. this._afterSolveServer = (self) => {
  161. };
  162. this._afterSolveClient = (data) => {
  163. };
  164. }
  165. id = 0 as number;
  166. modelId = 2;
  167. userId = 0 as number;
  168. reviewId = 0 as number;
  169. originId = '' as string|null;
  170. contentId = 0 as number;
  171. name = '' as string;
  172. level = 0 as number;
  173. ichType = 0 as number;
  174. protectLevel = null as number|null;
  175. image = '' as string|null;
  176. images = [] as string[];
  177. otherNames = '' as string|null;
  178. history = false;
  179. existence = false;
  180. folkCulture = '' as string|null;
  181. culturalRelic = '' as string|null;
  182. description = '' as string|null;
  183. desc = '' as string;
  184. mapX = '' as string|null;
  185. mapY = '' as string|null;
  186. declarationRegion = '' as string|null;
  187. popularRegion = '' as string|null;
  188. createdAt = '' as string;
  189. updatedAt = '' as string;
  190. deletedAt = '' as string|null;
  191. progress = 0 as number;
  192. comment = '' as string;
  193. levelText = '' as string;
  194. ichTypeText = '' as string;
  195. protectLevelText = '' as string;
  196. progressText = '' as string;
  197. }
  198. export class InheritorInfo extends CommonInfo<InheritorInfo> {
  199. constructor() {
  200. super(InheritorInfo, "传承人信息");
  201. this._convertTable = {
  202. ...this._convertTable,
  203. gender: { clientSide: 'number', serverSide: 'string' },
  204. level: { clientSide: 'number', serverSide: 'string' },
  205. batch: { clientSide: 'number', serverSide: 'string' },
  206. typicalImages: [
  207. {
  208. clientSide: 'object',
  209. clientSideChildDataModel: {
  210. convertTable: {},
  211. },
  212. serverSide: 'string'
  213. },
  214. {
  215. clientSide: 'addDefaultValue',
  216. clientSideParam: {
  217. defaultValue: [],
  218. },
  219. serverSide: 'original',
  220. },
  221. ],
  222. works: {
  223. clientSide: 'array',
  224. clientSideChildDataModel: InheritorWorkInfo,
  225. serverSide: 'array'
  226. },
  227. };
  228. this._convertKeyType = (key, direction) => {
  229. if (key.endsWith('Text') || key.endsWith('_text')) {
  230. return {
  231. clientSide: 'string',
  232. serverSide: 'undefined',
  233. };
  234. }
  235. };
  236. }
  237. expandInfo : InheritorExpandInfo|null = new InheritorExpandInfo();
  238. id = 0 as number;
  239. modelId = 7;
  240. mainBodyColumnId = 0 as number;
  241. alsoName = '' as string|null;
  242. nation = '' as string;
  243. dateBirth = '' as string;
  244. deathBirth = '' as string|null;
  245. unit = '' as string;
  246. content = '' as string|null;
  247. intro = '' as string;
  248. prize = '' as string;
  249. level = null as number|null;
  250. gender = 0 as number;
  251. batch = '' as string|null;
  252. typicalImages = [] as string[];
  253. progress = 0 as number;
  254. contentId = 0 as number;
  255. thumbnail = '' as string;
  256. flagText = '' as string;
  257. typeText = '' as string;
  258. openStatusText = '' as string;
  259. statusText = '' as string;
  260. regionText = '' as string;
  261. levelText = '' as string;
  262. crTypeText = '' as string;
  263. ichTypeText = '' as string;
  264. claimStatusText = '' as string;
  265. isMultipleClaimsText = '' as string;
  266. batchText = '' as string;
  267. ichSiteTypeText = '' as string;
  268. progressText = '' as string;
  269. works = [] as InheritorWorkInfo[];
  270. }
  271. export class InheritorExpandInfo extends DataModel<InheritorExpandInfo> {
  272. constructor() {
  273. super(InheritorExpandInfo, "非遗项目信息");
  274. this.setNameMapperCase('Camel', 'Snake');
  275. this._convertTable = {
  276. gender: { clientSide: 'number', serverSide: 'string' },
  277. level: { clientSide: 'number', serverSide: 'string' },
  278. batch: { clientSide: 'number', serverSide: 'string' },
  279. photosJson: [
  280. {
  281. clientSide: 'object',
  282. clientSideChildDataModel: {
  283. convertTable: {},
  284. },
  285. serverSide: 'string'
  286. },
  287. {
  288. clientSide: 'addDefaultValue',
  289. clientSideParam: {
  290. defaultValue: [],
  291. }
  292. },
  293. ],
  294. };
  295. this._convertKeyType = (key, direction) => {
  296. if (key.endsWith('Text') || key.endsWith('_text')) {
  297. return {
  298. clientSide: 'string',
  299. serverSide: 'undefined',
  300. };
  301. }
  302. };
  303. this._afterSolveServer = (self) => {
  304. };
  305. this._afterSolveClient = (data) => {
  306. };
  307. }
  308. modelId = 7;
  309. }
  310. export class InheritorWorkInfo extends DataModel<InheritorWorkInfo> {
  311. constructor() {
  312. super(InheritorWorkInfo, "传承人作品");
  313. this.setNameMapperCase('Camel', 'Snake');
  314. this._convertTable = {
  315. collectionTime: { clientSide: 'dayjs', serverSide: 'string' },
  316. type: { clientSide: 'number', serverSide: 'number' },
  317. };
  318. this._convertKeyType = (key, direction) => {
  319. if (key.endsWith('Text') || key.endsWith('_text')) {
  320. return {
  321. clientSide: 'string',
  322. serverSide: 'undefined',
  323. };
  324. }
  325. if (key.endsWith('At')) {
  326. return {
  327. clientSide: 'string',
  328. serverSide: 'undefined',
  329. };
  330. }
  331. };
  332. this._afterSolveServer = (self) => {
  333. };
  334. this._afterSolveClient = (data) => {
  335. };
  336. }
  337. id = 0;
  338. modelId = 16;
  339. category = '';
  340. feature = '';
  341. otherName = '';
  342. creator = '';
  343. language = '';
  344. overview = '';
  345. ethnicGroup = '';
  346. creationEra = '';
  347. mainPerformer = '';
  348. otherPerformers = '';
  349. fullString = '';
  350. tune = '';
  351. development = '';
  352. spread = '';
  353. influence = '';
  354. collector = '';
  355. collectionTime = dayjs();
  356. collectionLocation = '';
  357. }
  358. export class SeminarInfo extends CommonInfo<SeminarInfo> {
  359. constructor() {
  360. super(SeminarInfo, "传习所信息");
  361. this.setNameMapperCase('Camel', 'Snake');
  362. this._convertTable = {
  363. ...this._convertTable,
  364. lonlat: { serverSide: 'undefined' },
  365. visit: { clientSide: 'number' },
  366. ichSiteType: { clientSide: 'number', serverSide: 'number' },
  367. };
  368. this._convertKeyType = (key, direction) => {
  369. if (key.endsWith('Text') || key.endsWith('_text')) {
  370. return {
  371. clientSide: 'string',
  372. serverSide: 'undefined',
  373. };
  374. }
  375. };
  376. this._afterSolveServer = (self) => {
  377. self.lonlat = [ self.longitude, self.latitude ];
  378. };
  379. this._afterSolveClient = (data) => {
  380. data.longitude = this.lonlat[0];
  381. data.latitude = this.lonlat[1];
  382. };
  383. }
  384. lonlat = [] as (number|string)[];
  385. expandInfo : SeminarExpandInfo|null = new SeminarExpandInfo();
  386. id = 0 as number;
  387. modelId = 17;
  388. mainBodyColumnId = 0 as number;
  389. content = '' as string|null;
  390. mapX = '' as string|null;
  391. mapY = '' as string|null;
  392. longitude = '' as string|null;
  393. latitude = '' as string|null;
  394. address = '' as string;
  395. featuresType = null as number|null;
  396. contact = '' as string;
  397. ichSiteType = '' as string;
  398. flagText = '' as string;
  399. typeText = '' as string;
  400. openStatusText = '' as string;
  401. statusText = '' as string;
  402. regionText = '' as string;
  403. levelText = '' as string;
  404. crTypeText = '' as string;
  405. ichTypeText = '' as string;
  406. claimStatusText = '' as string;
  407. isMultipleClaimsText = '' as string;
  408. batchText = '' as string;
  409. ichSiteTypeText = '' as string;
  410. }
  411. export class SeminarExpandInfo extends DataModel<SeminarExpandInfo> {
  412. constructor() {
  413. super(SeminarExpandInfo, "非遗项目信息");
  414. this.setNameMapperCase('Camel', 'Snake');
  415. this._convertTable = {
  416. lonlat: { serverSide: 'undefined' },
  417. };
  418. this._convertKeyType = (key, direction) => {
  419. if (key.endsWith('Text') || key.endsWith('_text')) {
  420. return {
  421. clientSide: 'string',
  422. serverSide: 'undefined',
  423. };
  424. }
  425. };
  426. this._afterSolveServer = (self) => {
  427. self.lonlat = [ self.longitude, self.latitude ];
  428. };
  429. this._afterSolveClient = (data) => {
  430. data.longitude = this.lonlat[0];
  431. data.latitude = this.lonlat[1];
  432. };
  433. }
  434. modelId = 17;
  435. lonlat = [] as (number|string)[];
  436. }
  437. export class PlanInfo extends DataModel<PlanInfo> {
  438. constructor() {
  439. super(PlanInfo, "五年计划");
  440. this.setNameMapperCase('Camel', 'Snake');
  441. this._convertTable = {
  442. progress: { clientSide: 'number', serverSide: 'undefined' },
  443. };
  444. this._convertKeyType = (key, direction) => {
  445. if (key.endsWith('Text') || key.endsWith('_text')) {
  446. return {
  447. clientSide: 'string',
  448. serverSide: 'undefined',
  449. };
  450. }
  451. };
  452. this._afterSolveServer = (self) => {
  453. };
  454. this._afterSolveClient = (data) => {
  455. };
  456. }
  457. id = 0 as number;
  458. ichId = 0 as number;
  459. name = '' as string;
  460. investment = 0 as number;
  461. desc = '' as string;
  462. target = '' as string;
  463. unit = 0 as number;
  464. department = 0 as number;
  465. userId = 0 as number;
  466. progress = 0 as number;
  467. createdAt = '' as string;
  468. updatedAt = '' as string;
  469. ichName = '' as string;
  470. progressText = '' as string;
  471. }
  472. export class InheritorAccountInfo extends DataModel<InheritorAccountInfo> {
  473. constructor() {
  474. super(InheritorAccountInfo, "传承人账号信息");
  475. this.setNameMapperCase('Camel', 'Snake');
  476. this._convertTable = {
  477. username: { clientSide: 'string', clientSideRequired: true },
  478. password: { clientSide: 'string', clientSideRequired: true },
  479. };
  480. }
  481. id = 0 as number;
  482. username = '' as string;
  483. password = '' as string;
  484. nickname = '' as string;
  485. }
  486. export class InheritorSubmitInfo extends DataModel<InheritorSubmitInfo> {
  487. constructor() {
  488. super(InheritorSubmitInfo, "传承人采集数据信息");
  489. this.setNameMapperCase('Camel', 'Snake');
  490. this._convertTable = {
  491. progress: { clientSide: 'number', serverSide: 'undefined' },
  492. };
  493. }
  494. id = 0 as number;
  495. title = '' as string;
  496. userId = 0 as number;
  497. nickname = '' as string;
  498. logintime = '' as string;
  499. updatedAt = '' as string;
  500. collectTotal = 0 as number;
  501. progress = 0 as number;
  502. }
  503. export class InheritorContentApi extends AppServerRequestModule<DataModel> {
  504. constructor() {
  505. super();
  506. }
  507. async getBaseInfo<T extends DataModel>(id: number|undefined, newDataModel: new () => T, contentId?: number) {
  508. return (await this.post('/ich/inheritor/baseInfo', {
  509. model_id: new newDataModel().modelId,
  510. id,
  511. content_id: contentId,
  512. }, '基础表信息', undefined, newDataModel)).data as T;
  513. }
  514. /**
  515. * 项目五年计划
  516. * @param ichId 项目ID:传承人只返回绑定项目的计划
  517. * @param progress 审核进度:-1=不通过,0=待审核,1=已通过
  518. * @returns
  519. */
  520. async getPlanList(ichId: number, progress?: number) {
  521. return transformArrayDataModel<PlanInfo>(
  522. PlanInfo,
  523. (await this.post('/ich/inheritor/plans', {
  524. ich_id: ichId,
  525. progress,
  526. }, '获取计划列表')).data2.data,
  527. "data2"
  528. );
  529. }
  530. async saveBaseInfo<T extends DataModel>(dataModel: T) {
  531. return (await this.post('/ich/inheritor/saveBase', dataModel.toServerSide(), '基础内容表采集(非遗,传承人,传习所)'));
  532. }
  533. async getExpandInfo<T extends DataModel>(id: number|undefined, newDataModel: new () => T) : Promise<T | null> {
  534. return this.post('/ich/inheritor/expandInfo', {
  535. model_id: new newDataModel().modelId,
  536. id,
  537. }, '扩展表信息', undefined).then((res) => {
  538. if (!res.data2)
  539. return null;
  540. return transformDataModel(newDataModel, res.data2) as T;
  541. })
  542. }
  543. async saveExpandInfo<T extends DataModel>(dataModel: T) {
  544. return (await this.post('/ich/inheritor/saveExpand', dataModel.toServerSide(), '扩展内容表采集(非遗,传承人,传习所)'));
  545. }
  546. async saveWorkInfo(dataModel: InheritorWorkInfo) {
  547. return (await this.post('/ich/inheritor/saveWork', {
  548. ...dataModel.toServerSide(),
  549. }, '保存传承人作品信息'));
  550. }
  551. async savePlanInfo(dataModel: PlanInfo) {
  552. return (await this.post('/ich/inheritor/savePlans', dataModel.toServerSide(), '保存项目五年计划'));
  553. }
  554. async getCollectListInfo<T extends DataModel>(dataModel: new () => T, id: number) {
  555. return this.post('/ich/inheritor/collectInfo', {
  556. model_id: new dataModel().modelId,
  557. id,
  558. }, '获取采集记录详情', undefined).then((res) => {
  559. return transformDataModel(dataModel, res.data2);
  560. })
  561. }
  562. /**
  563. * 获取采集列表
  564. * @param data
  565. * @returns
  566. */
  567. async getCollectList<T extends DataModel>(dataModel: new () => T, data: {
  568. /**
  569. * 采集类型
  570. * * content 基础
  571. * * ich 扩展
  572. */
  573. collectType: 'content'|'ich',
  574. /**
  575. * 提交用户ID
  576. */
  577. userId?: number,
  578. /**
  579. * 进度:-1=审核失败,0=待审核,1=审核通过
  580. */
  581. progress?: number,
  582. /**
  583. * 审核人用户ID
  584. */
  585. reviewId?: number,
  586. /**
  587. * 原基础表记录ID
  588. */
  589. contentId?: number,
  590. page?: number,
  591. pageSize?: number,
  592. }) {
  593. return this.post('/ich/inheritor/collectList', {
  594. collect_type: data.collectType,
  595. model_id: new dataModel().modelId,
  596. user_id: data.userId,
  597. progress: data.progress,
  598. review_id: data.reviewId,
  599. content_id: data.contentId,
  600. page: data.page,
  601. pageSize: data.pageSize,
  602. }, '获取采集列表', undefined).then((res) => {
  603. return {
  604. data: transformArrayDataModel<T>(dataModel, transformSomeToArray(res.data2.data), 'data2'),
  605. total: res.data2.total,
  606. }
  607. })
  608. }
  609. async getInheritorAccountInfo(contentId: number) {
  610. return this.post('/ich/inheritor/getAccount', {
  611. content_id: contentId,
  612. }, '获取传承人账号信息', undefined).then((res) => {
  613. const arr = transformSomeToArray(res.data2);
  614. if (arr.length === 0)
  615. return null;
  616. return transformDataModel(InheritorAccountInfo, arr[0]);
  617. })
  618. }
  619. async getInheritorSubmtList(modelId: number) {
  620. return this.post('/ich/inheritor/list', {
  621. model_id: modelId
  622. }, '获取传承人采集数据列表', undefined).then((res) => {
  623. return transformArrayDataModel<InheritorSubmitInfo>(InheritorSubmitInfo, transformSomeToArray(res.data2), 'data2');
  624. })
  625. }
  626. async getIchSeminarInfo(data: {
  627. ichId?: number,
  628. page?: number,
  629. pageSize?: number,
  630. }) {
  631. return this.post('/ich/inheritor/sites', {
  632. ich_id: data.ichId,
  633. page: data.page,
  634. pageSize: data.pageSize,
  635. }, '获取传习所列表', undefined).then((res) => {
  636. return transformArrayDataModel<SeminarInfo>(SeminarInfo, transformSomeToArray(res.data2), 'data2');
  637. })
  638. }
  639. async getIchWorksInfo(data: {
  640. ichId: number,
  641. page?: number,
  642. pageSize?: number,
  643. }) {
  644. return this.post('/ich/inheritor/works', {
  645. ich_id: data.ichId,
  646. page: data.page,
  647. pageSize: data.pageSize,
  648. }, '获取项目作品列表', undefined).then((res) => {
  649. return transformArrayDataModel<InheritorWorkInfo>(InheritorWorkInfo, res.data2.data, 'data2');
  650. })
  651. }
  652. async getIchWorksDetail(id: number) {
  653. return this.post('/ich/inheritor/info', {
  654. id,
  655. model_id: 16,
  656. }, '获取项目作品详情', undefined).then((res) => {
  657. return transformDataModel<InheritorWorkInfo>(InheritorWorkInfo, res.data2);
  658. })
  659. }
  660. async getIchInfo(id: number|undefined) {
  661. return await this.getBaseInfo(id, IchInfo);
  662. }
  663. async getInheritorInfo(id: number|undefined) {
  664. return await this.getBaseInfo(id, InheritorInfo);
  665. }
  666. async getSeminarInfo(id: number|undefined) {
  667. return await this.getBaseInfo(undefined, SeminarInfo, id);
  668. }
  669. async getIchExpandInfo(id: number|undefined) {
  670. return await this.getExpandInfo(id, IchExpandInfo);
  671. }
  672. async getInheritorExpandInfo(id: number|undefined) {
  673. return await this.getExpandInfo(id, InheritorExpandInfo);
  674. }
  675. async getSeminarExpandInfo(id: number|undefined) {
  676. return await this.getExpandInfo(id, SeminarExpandInfo);
  677. }
  678. }
  679. export default new InheritorContentApi();