data.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. import { useI18n } from '/@/hooks/web/useI18n';
  2. const { t } = useI18n();
  3. import { Time } from '/@/components/Time';
  4. import { BasicColumn } from '/@/components/Table/src/types/table';
  5. import { h } from 'vue';
  6. export const getSchemas = (val, userName) => {
  7. return [
  8. {
  9. field: 'sceneName',
  10. label: '场景标题',
  11. component: 'Input',
  12. componentProps: {
  13. maxLength: 100,
  14. },
  15. colProps: {
  16. xl: 7,
  17. xxl: 7,
  18. },
  19. },
  20. {
  21. field: 'num',
  22. label: '场景码',
  23. component: 'Input',
  24. componentProps: {
  25. maxLength: 100,
  26. },
  27. colProps: {
  28. xl: 7,
  29. xxl: 7,
  30. },
  31. },
  32. {
  33. field: 'snCode',
  34. label: 'SN码',
  35. component: 'Input',
  36. ifShow: val != 57 && val != 58,
  37. componentProps: {
  38. maxLength: 100,
  39. },
  40. colProps: {
  41. xl: 7,
  42. xxl: 7,
  43. },
  44. },
  45. {
  46. field: 'userName',
  47. label: '绑定账号',
  48. component: 'Input',
  49. ifShow: !userName,
  50. componentProps: {
  51. maxLength: 100,
  52. },
  53. colProps: {
  54. xl: 7,
  55. xxl: 7,
  56. },
  57. },
  58. {
  59. field: 'locationType',
  60. component: 'Select',
  61. label: '场景类型',
  62. ifShow: val != 3 && val == 6,
  63. colProps: {
  64. xl: 7,
  65. xxl: 7,
  66. },
  67. componentProps: {
  68. options: [
  69. {
  70. label: '架站式',
  71. value: 0,
  72. key: '0',
  73. },
  74. {
  75. label: 'Slam',
  76. value: 1,
  77. key: '1',
  78. },
  79. ],
  80. },
  81. },
  82. {
  83. field: 'timeList',
  84. label: '拍摄时间段',
  85. component: 'RangePicker',
  86. componentProps: {
  87. maxLength: 100,
  88. minWidth: '385px',
  89. format: 'YYYY-MM-DD',
  90. valueFormat: 'YYYY-MM-DD',
  91. showTime: true,
  92. },
  93. colProps: {
  94. xl: 8,
  95. xxl: 8,
  96. },
  97. },
  98. {
  99. field: 'shootCounts',
  100. component: 'NumberRange',
  101. label: '点位数量',
  102. ifShow: val != 3,
  103. componentProps: {
  104. min: 0,
  105. },
  106. colProps: {
  107. xl: 7,
  108. xxl: 7,
  109. },
  110. },
  111. // {
  112. // field: 'shootCount2',
  113. // component: 'InputNumber',
  114. // label: '最大点位数',
  115. // ifShow: val != 3,
  116. // componentProps: {
  117. // min: 0,
  118. // },
  119. // colProps: {
  120. // xl: 7,
  121. // xxl: 7,
  122. // },
  123. // },
  124. ];
  125. };
  126. export const getquanjingSchemas = () => {
  127. return [
  128. {
  129. field: 'sceneName',
  130. label: '作品标题',
  131. component: 'Input',
  132. componentProps: {
  133. maxLength: 100,
  134. },
  135. colProps: {
  136. xl: 7,
  137. xxl: 7,
  138. },
  139. },
  140. {
  141. field: 'sceneCodes',
  142. label: '作品码',
  143. component: 'Input',
  144. componentProps: {
  145. maxLength: 100,
  146. },
  147. colProps: {
  148. xl: 7,
  149. xxl: 7,
  150. },
  151. },
  152. {
  153. field: 'num',
  154. label: '场景码',
  155. component: 'Input',
  156. componentProps: {
  157. maxLength: 100,
  158. },
  159. colProps: {
  160. xl: 7,
  161. xxl: 7,
  162. },
  163. },
  164. {
  165. field: 'snCode',
  166. label: 'SN码',
  167. component: 'Input',
  168. componentProps: {
  169. maxLength: 100,
  170. },
  171. colProps: {
  172. xl: 7,
  173. xxl: 7,
  174. },
  175. },
  176. {
  177. field: 'userName',
  178. label: '绑定账号',
  179. component: 'Input',
  180. componentProps: {
  181. maxLength: 100,
  182. },
  183. colProps: {
  184. xl: 7,
  185. xxl: 7,
  186. },
  187. },
  188. {
  189. field: 'timeList',
  190. label: '拍摄时间段',
  191. component: 'RangePicker',
  192. componentProps: {
  193. maxLength: 100,
  194. minWidth: '385px',
  195. format: 'YYYY-MM-DD',
  196. valueFormat: 'YYYY-MM-DD',
  197. showTime: true,
  198. },
  199. colProps: {
  200. xl: 8,
  201. xxl: 8,
  202. },
  203. },
  204. ];
  205. };
  206. export const getviewSchemas = () => {
  207. return [
  208. {
  209. field: 'sceneName',
  210. label: '作品标题',
  211. component: 'Input',
  212. componentProps: {
  213. maxLength: 100,
  214. },
  215. colProps: {
  216. xl: 7,
  217. xxl: 7,
  218. },
  219. },
  220. {
  221. field: 'sceneCodes',
  222. label: '作品码',
  223. component: 'Input',
  224. componentProps: {
  225. maxLength: 100,
  226. },
  227. colProps: {
  228. xl: 7,
  229. xxl: 7,
  230. },
  231. },
  232. {
  233. field: 'userName',
  234. label: '用户账号',
  235. component: 'Input',
  236. componentProps: {
  237. maxLength: 100,
  238. },
  239. colProps: {
  240. xl: 6,
  241. xxl: 6,
  242. },
  243. },
  244. {
  245. field: 'timeList',
  246. label: '创建时间',
  247. component: 'RangePicker',
  248. componentProps: {
  249. maxLength: 100,
  250. minWidth: '385px',
  251. format: 'YYYY-MM-DD',
  252. valueFormat: 'YYYY-MM-DD',
  253. showTime: true,
  254. },
  255. colProps: {
  256. xl: 8,
  257. xxl: 8,
  258. },
  259. },
  260. ];
  261. };
  262. export const getviewColumns = () => {
  263. return [
  264. {
  265. title: '作品标题',
  266. dataIndex: 'name',
  267. slots: { customRender: 'href' },
  268. width: 150,
  269. // customRender: ({ record }) => {
  270. // return record.name ? h('span', record.name) : '-';
  271. // },
  272. },
  273. {
  274. title: '作品码',
  275. dataIndex: 'sceneCodes',
  276. ellipsis: true,
  277. width: 180,
  278. },
  279. {
  280. title: '用户账号',
  281. dataIndex: 'userId',
  282. width: 100,
  283. },
  284. {
  285. title: '创建时间',
  286. dataIndex: 'createTime',
  287. sorter: true,
  288. width: 180,
  289. customRender: ({ record }) => {
  290. return record.createTime
  291. ? h(Time, {
  292. value: record.createTime,
  293. mode: 'datetime',
  294. })
  295. : '-';
  296. },
  297. },
  298. {
  299. title: '最新编辑时间',
  300. dataIndex: 'updateTime',
  301. width: 180,
  302. customRender: ({ record }) => {
  303. return record.updateTime
  304. ? h(Time, {
  305. value: record.updateTime,
  306. mode: 'datetime',
  307. })
  308. : '-';
  309. },
  310. },
  311. {
  312. title: '是否加密',
  313. dataIndex: 'status',
  314. width: 80,
  315. customRender: ({ record }) => {
  316. return record.isPassword == 1 ? '是' : '否';
  317. },
  318. },
  319. {
  320. title: '浏览量',
  321. dataIndex: 'visit',
  322. sorter: true,
  323. width: 80,
  324. },
  325. {
  326. title: '操作',
  327. dataIndex: 'action',
  328. slots: { customRender: 'action' },
  329. ifShow: true,
  330. fixed: 'right',
  331. flag: 'ACTION',
  332. width: 50,
  333. },
  334. ];
  335. };
  336. export const getColumns = (val) => {
  337. const isobj = val == 6 || val == 57;
  338. return [
  339. {
  340. title: '场景标题',
  341. ellipsis: true,
  342. dataIndex: 'sceneName',
  343. slots: { customRender: 'href' },
  344. width: 150,
  345. },
  346. {
  347. title: '场景码',
  348. dataIndex: 'num',
  349. ellipsis: true,
  350. width: 180,
  351. },
  352. {
  353. title: '拍摄时间',
  354. dataIndex: 'createTime',
  355. sorter: true,
  356. width: 180,
  357. customRender: ({ record }) => {
  358. return (
  359. record.createTime &&
  360. h(Time, {
  361. value: record.createTime,
  362. mode: 'datetime',
  363. })
  364. );
  365. },
  366. },
  367. {
  368. title: '计算完成时间',
  369. dataIndex: 'amount',
  370. width: 180,
  371. customRender: ({ record }) => {
  372. return (
  373. (record.algorithmTime &&
  374. h(Time, {
  375. value: record.algorithmTime,
  376. mode: 'datetime',
  377. })) ||
  378. '-'
  379. );
  380. },
  381. },
  382. {
  383. title: '计算时长(分钟)',
  384. dataIndex: 'computeTime',
  385. width: 120,
  386. customRender: ({ record }) => {
  387. return (record.computeTime && Math.round(record.computeTime / 60)) || '-';
  388. },
  389. },
  390. {
  391. title: '场景类型',
  392. dataIndex: 'location',
  393. ifShow: isobj,
  394. width: 120,
  395. customRender: ({ record }) => {
  396. return record.location == 5 || record.location == 6 ? 'Slam' : '架站式';
  397. },
  398. },
  399. {
  400. title: 'SN码',
  401. dataIndex: 'snCode',
  402. ifShow: val != 57 && val != 58,
  403. width: 180,
  404. },
  405. {
  406. title: 'obj生成状态',
  407. dataIndex: 'isObj',
  408. ellipsis: true,
  409. ifShow: isobj || val == 2,
  410. width: 180,
  411. customRender: ({ record }) => {
  412. return record.isObj == 0 ? '未生成' : record.isObj == 1 ? '已生成' : '计算中';
  413. },
  414. },
  415. {
  416. title: '点位数量',
  417. dataIndex: 'shootCount',
  418. width: 80,
  419. },
  420. {
  421. title: '场景大小',
  422. dataIndex: 'sceneSize',
  423. width: 80,
  424. customRender: ({ record }) => {
  425. return record.sceneSize && record.sceneSize != 0
  426. ? h('span', { class: 'sceneSize' }, Math.ceil(record.sceneSize / 1024 / 1024) + 'M')
  427. : '-';
  428. },
  429. },
  430. {
  431. title: 'slam帧数',
  432. ifShow: isobj || val == 6,
  433. dataIndex: 'slamCount',
  434. width: 80,
  435. },
  436. {
  437. title: '拍摄位置',
  438. dataIndex: 'addressComponent',
  439. width: 100,
  440. ifShow: val != 57 && val != 58,
  441. customRender: ({ record }) => {
  442. if (!record.addressComponent) {
  443. return '-';
  444. }
  445. return (record && record.addressComponent && record.addressComponent.city) || '-'; // + district + township;
  446. },
  447. },
  448. {
  449. title: '是否复制',
  450. dataIndex: 'isCopy',
  451. width: 80,
  452. customRender: ({ record }) => {
  453. return record.isCopy ? '是' : '否';
  454. },
  455. },
  456. {
  457. title: '复制时间',
  458. dataIndex: 'copyTime',
  459. width: 180,
  460. customRender: ({ record }) => {
  461. return record.copyTime
  462. ? h(Time, {
  463. value: record.copyTime,
  464. mode: 'datetime',
  465. })
  466. : '-';
  467. },
  468. },
  469. {
  470. title: '绑定账号',
  471. dataIndex: 'userName',
  472. width: 100,
  473. },
  474. {
  475. title: '浏览量',
  476. dataIndex: 'viewCount',
  477. sorter: true,
  478. width: 80,
  479. },
  480. {
  481. title: '状态',
  482. dataIndex: 'statusString',
  483. width: 120,
  484. slots: { customRender: 'status' },
  485. },
  486. {
  487. title: '操作',
  488. dataIndex: 'action',
  489. slots: { customRender: 'action' },
  490. ifShow: true,
  491. fixed: 'right',
  492. flag: 'ACTION',
  493. width: 340,
  494. },
  495. ];
  496. };
  497. export const getVrColumns = () => {
  498. return [
  499. {
  500. title: '作品标题',
  501. dataIndex: 'name',
  502. slots: { customRender: 'href' },
  503. width: 150,
  504. },
  505. {
  506. title: '作品码',
  507. dataIndex: 'sceneCodes',
  508. ellipsis: true,
  509. width: 200,
  510. },
  511. {
  512. title: '场景码',
  513. dataIndex: 'num',
  514. ellipsis: true,
  515. width: 180,
  516. },
  517. {
  518. title: '拍摄时间',
  519. dataIndex: 'createTime',
  520. sorter: true,
  521. width: 180,
  522. customRender: ({ record }) => {
  523. return (
  524. record.createTime &&
  525. h(Time, {
  526. value: record.createTime,
  527. mode: 'datetime',
  528. })
  529. );
  530. },
  531. },
  532. {
  533. title: '计算完成时间',
  534. dataIndex: 'amount',
  535. width: 180,
  536. customRender: ({ record }) => {
  537. return (
  538. (record.algorithmTime &&
  539. h(Time, {
  540. value: record.algorithmTime,
  541. mode: 'datetime',
  542. })) ||
  543. '-'
  544. );
  545. },
  546. },
  547. {
  548. title: '计算时长(分钟)',
  549. dataIndex: 'computeTime',
  550. width: 120,
  551. customRender: ({ record }) => {
  552. return (record.computeTime && Math.round(record.computeTime / 60)) || '-';
  553. },
  554. },
  555. {
  556. title: 'SN码',
  557. dataIndex: 'snCode',
  558. width: 180,
  559. },
  560. {
  561. title: '点位数量',
  562. dataIndex: 'shootCount',
  563. width: 80,
  564. // customRender: ({ record }) => {
  565. // return ( tableType.value == 2 || tableType.value == 6 )||!record.shootCount ? '-' : record.shootCount
  566. // },
  567. },
  568. {
  569. title: '拍摄位置',
  570. dataIndex: 'addressComponent',
  571. width: 100,
  572. customRender: ({ record }) => {
  573. if (!record.addressComponent) {
  574. return '-';
  575. }
  576. return (record && record.addressComponent && record.addressComponent.city) || '-'; // + district + township;
  577. },
  578. },
  579. {
  580. title: '绑定账号',
  581. dataIndex: 'userName',
  582. width: 100,
  583. },
  584. {
  585. title: '浏览量',
  586. dataIndex: 'visit',
  587. sorter: true,
  588. width: 80,
  589. },
  590. {
  591. title: '计算状态',
  592. dataIndex: 'statusString',
  593. width: 120,
  594. slots: { customRender: 'status' },
  595. },
  596. {
  597. title: '切图状态',
  598. dataIndex: 'panoStatus',
  599. width: 120,
  600. customRender: ({ record }) => {
  601. // 切图状态:-1切图失败 0等待中 1 排队 2切图中 3切图完成
  602. const obj = {
  603. '-1': '切图失败',
  604. '0': '等待中',
  605. '1': '排队中',
  606. '2': '切图中',
  607. '3': '切图完成',
  608. };
  609. return obj[record.panoStatus];
  610. },
  611. },
  612. {
  613. title: '操作',
  614. dataIndex: 'action',
  615. slots: { customRender: 'action' },
  616. ifShow: true,
  617. fixed: 'right',
  618. flag: 'ACTION',
  619. width: 280,
  620. },
  621. ];
  622. };