data.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  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. ellipsis: true,
  289. dataIndex: 'sceneName',
  290. slots: { customRender: 'href' },
  291. width: 150,
  292. },
  293. {
  294. title: '场景码',
  295. dataIndex: 'num',
  296. ellipsis: true,
  297. width: 180,
  298. },
  299. {
  300. title: '拍摄时间',
  301. dataIndex: 'createTime',
  302. sorter: true,
  303. width: 180,
  304. customRender: ({ record }) => {
  305. return (
  306. record.createTime &&
  307. h(Time, {
  308. value: record.createTime,
  309. mode: 'datetime',
  310. })
  311. );
  312. },
  313. },
  314. {
  315. title: 'obj生成状态',
  316. dataIndex: 'isObj',
  317. ellipsis: true,
  318. ifShow: isobj,
  319. width: 180,
  320. customRender: ({ record }) => {
  321. return record.isObj == 0 ? '未生成' : record.isObj == 1 ? '已生成' : '计算中';
  322. },
  323. },
  324. {
  325. title: '计算完成时间',
  326. dataIndex: 'amount',
  327. width: 180,
  328. customRender: ({ record }) => {
  329. return (
  330. (record.algorithmTime &&
  331. h(Time, {
  332. value: record.algorithmTime,
  333. mode: 'datetime',
  334. })) ||
  335. '-'
  336. );
  337. },
  338. },
  339. {
  340. title: 'SN码',
  341. dataIndex: 'snCode',
  342. width: 180,
  343. },
  344. {
  345. title: '点位数量',
  346. dataIndex: 'shootCount',
  347. width: 80,
  348. // customRender: ({ record }) => {
  349. // return ( tableType.value == 2 || tableType.value == 6 )||!record.shootCount ? '-' : record.shootCount
  350. // },
  351. },
  352. {
  353. title: '场景大小',
  354. dataIndex: 'sceneSize',
  355. width: 80,
  356. customRender: ({ record }) => {
  357. return record.sceneSize && record.sceneSize != 0
  358. ? h('span', { class: 'sceneSize' }, Math.ceil(record.sceneSize / 1024 / 1024) + 'M')
  359. : '-';
  360. },
  361. },
  362. {
  363. title: '拍摄位置',
  364. dataIndex: 'addressComponent',
  365. width: 100,
  366. customRender: ({ record }) => {
  367. if (!record.addressComponent) {
  368. return '-';
  369. }
  370. return (record && record.addressComponent && record.addressComponent.city) || '-'; // + district + township;
  371. },
  372. },
  373. {
  374. title: '是否复制',
  375. dataIndex: 'isCopy',
  376. width: 80,
  377. customRender: ({ record }) => {
  378. return record.isCopy ? '是' : '否';
  379. },
  380. },
  381. {
  382. title: '复制时间',
  383. dataIndex: 'copyTime',
  384. width: 180,
  385. customRender: ({ record }) => {
  386. return record.copyTime
  387. ? h(Time, {
  388. value: record.copyTime,
  389. mode: 'datetime',
  390. })
  391. : '-';
  392. },
  393. },
  394. {
  395. title: '绑定账号',
  396. dataIndex: 'userName',
  397. width: 100,
  398. },
  399. {
  400. title: '浏览量',
  401. dataIndex: 'viewCount',
  402. sorter: true,
  403. width: 80,
  404. },
  405. {
  406. title: '状态',
  407. dataIndex: 'statusString',
  408. width: 120,
  409. slots: { customRender: 'status' },
  410. },
  411. {
  412. title: '操作',
  413. dataIndex: 'action',
  414. slots: { customRender: 'action' },
  415. ifShow: true,
  416. fixed: 'right',
  417. flag: 'ACTION',
  418. width: 340,
  419. },
  420. ];
  421. };
  422. export const getVrColumns = () => {
  423. return [
  424. {
  425. title: '作品标题',
  426. dataIndex: 'name',
  427. slots: { customRender: 'href' },
  428. width: 150,
  429. },
  430. {
  431. title: '作品码',
  432. dataIndex: 'sceneCodes',
  433. ellipsis: true,
  434. width: 200,
  435. },
  436. {
  437. title: '场景码',
  438. dataIndex: 'num',
  439. ellipsis: true,
  440. width: 180,
  441. },
  442. {
  443. title: '拍摄时间',
  444. dataIndex: 'createTime',
  445. sorter: true,
  446. width: 180,
  447. customRender: ({ record }) => {
  448. return (
  449. record.createTime &&
  450. h(Time, {
  451. value: record.createTime,
  452. mode: 'datetime',
  453. })
  454. );
  455. },
  456. },
  457. {
  458. title: '计算完成时间',
  459. dataIndex: 'amount',
  460. width: 180,
  461. customRender: ({ record }) => {
  462. return (
  463. (record.algorithmTime &&
  464. h(Time, {
  465. value: record.algorithmTime,
  466. mode: 'datetime',
  467. })) ||
  468. '-'
  469. );
  470. },
  471. },
  472. {
  473. title: 'SN码',
  474. dataIndex: 'snCode',
  475. width: 180,
  476. },
  477. {
  478. title: '点位数量',
  479. dataIndex: 'shootCount',
  480. width: 80,
  481. // customRender: ({ record }) => {
  482. // return ( tableType.value == 2 || tableType.value == 6 )||!record.shootCount ? '-' : record.shootCount
  483. // },
  484. },
  485. {
  486. title: '拍摄位置',
  487. dataIndex: 'addressComponent',
  488. width: 100,
  489. customRender: ({ record }) => {
  490. if (!record.addressComponent) {
  491. return '-';
  492. }
  493. return (record && record.addressComponent && record.addressComponent.city) || '-'; // + district + township;
  494. },
  495. },
  496. {
  497. title: '绑定账号',
  498. dataIndex: 'userName',
  499. width: 100,
  500. },
  501. {
  502. title: '浏览量',
  503. dataIndex: 'visit',
  504. sorter: true,
  505. width: 80,
  506. },
  507. {
  508. title: '状态',
  509. dataIndex: 'statusString',
  510. width: 120,
  511. slots: { customRender: 'status' },
  512. },
  513. {
  514. title: '操作',
  515. dataIndex: 'action',
  516. slots: { customRender: 'action' },
  517. ifShow: true,
  518. fixed: 'right',
  519. flag: 'ACTION',
  520. width: 280,
  521. },
  522. ];
  523. };