data.ts 9.4 KB

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