data.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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 = () => {
  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. componentProps: {
  37. maxLength: 100,
  38. },
  39. colProps: {
  40. xl: 7,
  41. xxl: 7,
  42. },
  43. },
  44. {
  45. field: 'userName',
  46. label: '绑定账号',
  47. component: 'Input',
  48. componentProps: {
  49. maxLength: 100,
  50. },
  51. colProps: {
  52. xl: 7,
  53. xxl: 7,
  54. },
  55. },
  56. {
  57. field: 'timeList',
  58. label: '拍摄时间段',
  59. component: 'RangePicker',
  60. componentProps: {
  61. maxLength: 100,
  62. minWidth: '385px',
  63. format: 'YYYY-MM-DD',
  64. valueFormat: 'YYYY-MM-DD',
  65. showTime: true,
  66. },
  67. colProps: {
  68. xl: 8,
  69. xxl: 8,
  70. },
  71. },
  72. ];
  73. };
  74. export const getquanjingSchemas = () => {
  75. return [
  76. {
  77. field: 'sceneName',
  78. label: '作品标题',
  79. component: 'Input',
  80. componentProps: {
  81. maxLength: 100,
  82. },
  83. colProps: {
  84. xl: 7,
  85. xxl: 7,
  86. },
  87. },
  88. {
  89. field: 'sceneCodes',
  90. label: '作品码',
  91. component: 'Input',
  92. componentProps: {
  93. maxLength: 100,
  94. },
  95. colProps: {
  96. xl: 7,
  97. xxl: 7,
  98. },
  99. },
  100. {
  101. field: 'num',
  102. label: '场景码',
  103. component: 'Input',
  104. componentProps: {
  105. maxLength: 100,
  106. },
  107. colProps: {
  108. xl: 7,
  109. xxl: 7,
  110. },
  111. },
  112. {
  113. field: 'snCode',
  114. label: 'SN码',
  115. component: 'Input',
  116. componentProps: {
  117. maxLength: 100,
  118. },
  119. colProps: {
  120. xl: 7,
  121. xxl: 7,
  122. },
  123. },
  124. {
  125. field: 'userName',
  126. label: '绑定账号',
  127. component: 'Input',
  128. componentProps: {
  129. maxLength: 100,
  130. },
  131. colProps: {
  132. xl: 7,
  133. xxl: 7,
  134. },
  135. },
  136. {
  137. field: 'timeList',
  138. label: '拍摄时间段',
  139. component: 'RangePicker',
  140. componentProps: {
  141. maxLength: 100,
  142. minWidth: '385px',
  143. format: 'YYYY-MM-DD',
  144. valueFormat: 'YYYY-MM-DD',
  145. showTime: true,
  146. },
  147. colProps: {
  148. xl: 8,
  149. xxl: 8,
  150. },
  151. },
  152. ];
  153. };
  154. export const getviewSchemas = () => {
  155. return [
  156. {
  157. field: 'sceneName',
  158. label: '作品标题',
  159. component: 'Input',
  160. componentProps: {
  161. maxLength: 100,
  162. },
  163. colProps: {
  164. xl: 7,
  165. xxl: 7,
  166. },
  167. },
  168. {
  169. field: 'sceneCodes',
  170. label: '作品码',
  171. component: 'Input',
  172. componentProps: {
  173. maxLength: 100,
  174. },
  175. colProps: {
  176. xl: 7,
  177. xxl: 7,
  178. },
  179. },
  180. {
  181. field: 'userName',
  182. label: '用户账号',
  183. component: 'Input',
  184. componentProps: {
  185. maxLength: 100,
  186. },
  187. colProps: {
  188. xl: 6,
  189. xxl: 6,
  190. },
  191. },
  192. {
  193. field: 'timeList',
  194. label: '创建时间',
  195. component: 'RangePicker',
  196. componentProps: {
  197. maxLength: 100,
  198. minWidth: '385px',
  199. format: 'YYYY-MM-DD',
  200. valueFormat: 'YYYY-MM-DD',
  201. showTime: true,
  202. },
  203. colProps: {
  204. xl: 8,
  205. xxl: 8,
  206. },
  207. },
  208. ];
  209. };
  210. export const getviewColumns = () => {
  211. return [
  212. {
  213. title: '作品标题',
  214. dataIndex: 'name',
  215. slots: { customRender: 'href' },
  216. width: 150,
  217. // customRender: ({ record }) => {
  218. // return record.name ? h('span', record.name) : '-';
  219. // },
  220. },
  221. {
  222. title: '作品码',
  223. dataIndex: 'sceneCodes',
  224. ellipsis: true,
  225. width: 180,
  226. },
  227. {
  228. title: '用户账号',
  229. dataIndex: 'userId',
  230. width: 100,
  231. },
  232. {
  233. title: '创建时间',
  234. dataIndex: 'createTime',
  235. sorter: true,
  236. width: 180,
  237. customRender: ({ record }) => {
  238. return record.createTime
  239. ? h(Time, {
  240. value: record.createTime,
  241. mode: 'datetime',
  242. })
  243. : '-';
  244. },
  245. },
  246. {
  247. title: '最新编辑时间',
  248. dataIndex: 'updateTime',
  249. width: 180,
  250. customRender: ({ record }) => {
  251. return record.updateTime
  252. ? h(Time, {
  253. value: record.updateTime,
  254. mode: 'datetime',
  255. })
  256. : '-';
  257. },
  258. },
  259. {
  260. title: '是否加密',
  261. dataIndex: 'status',
  262. width: 80,
  263. customRender: ({ record }) => {
  264. return record.isPassword == 1 ? '是' : '否';
  265. },
  266. },
  267. {
  268. title: '浏览量',
  269. dataIndex: 'visit',
  270. sorter: true,
  271. width: 80,
  272. },
  273. {
  274. title: '操作',
  275. dataIndex: 'action',
  276. slots: { customRender: 'action' },
  277. ifShow: true,
  278. fixed: 'right',
  279. flag: 'ACTION',
  280. width: 50,
  281. },
  282. ];
  283. };
  284. export const getColumns = (isobj) => {
  285. return [
  286. {
  287. title: '场景标题',
  288. dataIndex: 'sceneName',
  289. slots: { customRender: 'href' },
  290. width: 150,
  291. },
  292. {
  293. title: '场景码',
  294. dataIndex: 'num',
  295. ellipsis: true,
  296. width: 180,
  297. },
  298. {
  299. title: '拍摄时间',
  300. dataIndex: 'createTime',
  301. sorter: true,
  302. width: 180,
  303. customRender: ({ record }) => {
  304. return (
  305. record.createTime &&
  306. h(Time, {
  307. value: record.createTime,
  308. mode: 'datetime',
  309. })
  310. );
  311. },
  312. },
  313. {
  314. title: 'obj生成状态',
  315. dataIndex: 'isObj',
  316. ellipsis: true,
  317. ifShow: isobj,
  318. width: 180,
  319. customRender: ({ record }) => {
  320. return record.isObj == 0 ? '未生成' : record.isObj == 1 ? '已生成' : '计算中';
  321. },
  322. },
  323. {
  324. title: '计算完成时间',
  325. dataIndex: 'amount',
  326. width: 180,
  327. customRender: ({ record }) => {
  328. return (
  329. (record.algorithmTime &&
  330. h(Time, {
  331. value: record.algorithmTime,
  332. mode: 'datetime',
  333. })) ||
  334. '-'
  335. );
  336. },
  337. },
  338. {
  339. title: 'SN码',
  340. dataIndex: 'snCode',
  341. width: 180,
  342. },
  343. {
  344. title: '点位数量',
  345. dataIndex: 'shootCount',
  346. width: 80,
  347. // customRender: ({ record }) => {
  348. // return ( tableType.value == 2 || tableType.value == 6 )||!record.shootCount ? '-' : record.shootCount
  349. // },
  350. },
  351. {
  352. title: '场景大小',
  353. dataIndex: 'sceneSize',
  354. width: 80,
  355. customRender: ({ record }) => {
  356. return record.sceneSize && record.sceneSize != 0
  357. ? h('span', { class: 'sceneSize' }, Math.ceil(record.sceneSize / 1024 / 1024) + 'M')
  358. : '-';
  359. },
  360. },
  361. {
  362. title: '拍摄位置',
  363. dataIndex: 'addressComponent',
  364. width: 100,
  365. customRender: ({ record }) => {
  366. if (!record.addressComponent) {
  367. return '-';
  368. }
  369. return (record && record.addressComponent && record.addressComponent.city) || '-'; // + district + township;
  370. },
  371. },
  372. {
  373. title: '是否复制',
  374. dataIndex: 'isCopy',
  375. width: 80,
  376. customRender: ({ record }) => {
  377. return record.isCopy ? '是' : '否';
  378. },
  379. },
  380. {
  381. title: '复制时间',
  382. dataIndex: 'copyTime',
  383. width: 180,
  384. customRender: ({ record }) => {
  385. return record.copyTime
  386. ? h(Time, {
  387. value: record.copyTime,
  388. mode: 'datetime',
  389. })
  390. : '-';
  391. },
  392. },
  393. {
  394. title: '绑定账号',
  395. dataIndex: 'userName',
  396. width: 100,
  397. },
  398. {
  399. title: '浏览量',
  400. dataIndex: 'viewCount',
  401. sorter: true,
  402. width: 80,
  403. },
  404. {
  405. title: '状态',
  406. dataIndex: 'statusString',
  407. width: 120,
  408. slots: { customRender: 'status' },
  409. },
  410. {
  411. title: '操作',
  412. dataIndex: 'action',
  413. slots: { customRender: 'action' },
  414. ifShow: true,
  415. fixed: 'right',
  416. flag: 'ACTION',
  417. width: 280,
  418. },
  419. ];
  420. };
  421. export const getVrColumns = () => {
  422. return [
  423. {
  424. title: '作品标题',
  425. dataIndex: 'sceneName',
  426. slots: { customRender: 'href' },
  427. width: 150,
  428. },
  429. {
  430. title: '作品码',
  431. dataIndex: 'sceneCodes',
  432. ellipsis: true,
  433. width: 200,
  434. },
  435. {
  436. title: '场景码',
  437. dataIndex: 'num',
  438. ellipsis: true,
  439. width: 180,
  440. },
  441. {
  442. title: '拍摄时间',
  443. dataIndex: 'createTime',
  444. sorter: true,
  445. width: 180,
  446. customRender: ({ record }) => {
  447. return (
  448. record.createTime &&
  449. h(Time, {
  450. value: record.createTime,
  451. mode: 'datetime',
  452. })
  453. );
  454. },
  455. },
  456. {
  457. title: '计算完成时间',
  458. dataIndex: 'amount',
  459. width: 180,
  460. customRender: ({ record }) => {
  461. return (
  462. (record.algorithmTime &&
  463. h(Time, {
  464. value: record.algorithmTime,
  465. mode: 'datetime',
  466. })) ||
  467. '-'
  468. );
  469. },
  470. },
  471. {
  472. title: 'SN码',
  473. dataIndex: 'snCode',
  474. width: 180,
  475. },
  476. {
  477. title: '点位数量',
  478. dataIndex: 'shootCount',
  479. width: 80,
  480. // customRender: ({ record }) => {
  481. // return ( tableType.value == 2 || tableType.value == 6 )||!record.shootCount ? '-' : record.shootCount
  482. // },
  483. },
  484. {
  485. title: '拍摄位置',
  486. dataIndex: 'addressComponent',
  487. width: 100,
  488. customRender: ({ record }) => {
  489. if (!record.addressComponent) {
  490. return '-';
  491. }
  492. return (record && record.addressComponent && record.addressComponent.city) || '-'; // + district + township;
  493. },
  494. },
  495. {
  496. title: '绑定账号',
  497. dataIndex: 'userName',
  498. width: 100,
  499. },
  500. {
  501. title: '浏览量',
  502. dataIndex: 'visit',
  503. sorter: true,
  504. width: 80,
  505. },
  506. {
  507. title: '状态',
  508. dataIndex: 'statusString',
  509. width: 120,
  510. slots: { customRender: 'status' },
  511. },
  512. {
  513. title: '操作',
  514. dataIndex: 'action',
  515. slots: { customRender: 'action' },
  516. ifShow: true,
  517. fixed: 'right',
  518. flag: 'ACTION',
  519. width: 280,
  520. },
  521. ];
  522. };