InheritorContent.ts 21 KB

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