data.tsx 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. import { h, computed } from 'vue';
  2. import { BasicColumn, FormProps } from '/@/components/Table';
  3. import { Time } from '/@/components/Time';
  4. import { useMessage } from '/@/hooks/web/useMessage';
  5. import { useI18n } from '/@/hooks/web/useI18n';
  6. import { useLocaleStore } from '/@/store/modules/locale';
  7. const localeStore = useLocaleStore();
  8. const { createMessage } = useMessage();
  9. const { t } = useI18n();
  10. const isJA = computed(() => localeStore.getLocale === 'en');
  11. export const columns: BasicColumn[] = [
  12. {
  13. title: '场景标题',
  14. dataIndex: 'sceneName',
  15. width: 150,
  16. customRender: ({ record }) => {
  17. return (
  18. <a href={record.webSite || record.thumb} target="_blank">
  19. {record.sceneName}
  20. </a>
  21. );
  22. },
  23. },
  24. {
  25. title: '场景码',
  26. dataIndex: 'num',
  27. ellipsis: true,
  28. width: 80,
  29. },
  30. {
  31. title: '拍摄时间',
  32. dataIndex: 'createTime',
  33. width: 180,
  34. customRender: ({ record }) => {
  35. return (
  36. record.createTime &&
  37. h(Time, {
  38. value: record.createTime,
  39. mode: 'datetime',
  40. })
  41. );
  42. },
  43. },
  44. {
  45. title: '计算完成时间',
  46. dataIndex: 'amount',
  47. width: 180,
  48. customRender: ({ record }) => {
  49. return (
  50. (record.createTime &&
  51. h(Time, {
  52. value: record.createTime,
  53. mode: 'datetime',
  54. })) ||
  55. '-'
  56. );
  57. },
  58. },
  59. {
  60. title: 'SN码',
  61. dataIndex: 'snCode',
  62. width: 180,
  63. },
  64. {
  65. title: '场景大小',
  66. dataIndex: 'sceneSize',
  67. width: 80,
  68. customRender: ({ record }) => {
  69. return h('span', { class: 'sceneSize' }, Math.ceil(record.sceneSize / 1024 / 1024) + 'M');
  70. },
  71. },
  72. {
  73. title: '是否复制',
  74. dataIndex: 'isCopy',
  75. width: 80,
  76. customRender: ({ record }) => {
  77. return record.isCopy ? '是' : '否';
  78. },
  79. },
  80. {
  81. title: '复制时间',
  82. dataIndex: 'copyTime',
  83. width: 180,
  84. customRender: ({ record }) => {
  85. return record.copyTime
  86. ? h(Time, {
  87. value: record.copyTime,
  88. mode: 'datetime',
  89. })
  90. : '-';
  91. },
  92. },
  93. {
  94. title: '绑定账号',
  95. dataIndex: 'userName',
  96. width: 100,
  97. },
  98. {
  99. title: '浏览量',
  100. dataIndex: 'viewCount',
  101. width: 80,
  102. },
  103. {
  104. title: '状态',
  105. dataIndex: 'statusString',
  106. width: 80,
  107. // customRender: ({ record }) => {
  108. // let str;
  109. // switch (record.status - 0) {
  110. // case 0:
  111. // str = '计算中';
  112. // break;
  113. // case 1:
  114. // str = '计算成功';
  115. // break;
  116. // case -2:
  117. // str = '计算成功';
  118. // break;
  119. // case -1:
  120. // str = '计算失败';
  121. // break;
  122. // }
  123. // return record.payStatus == 1 ? '封存' : str;
  124. // },
  125. },
  126. {
  127. title: '操作',
  128. dataIndex: 'action',
  129. slots: { customRender: 'action' },
  130. ifShow: true,
  131. fixed: 'right',
  132. flag: 'ACTION',
  133. width: 330,
  134. },
  135. ];
  136. export const searchForm: Partial<FormProps> = {
  137. labelWidth: 100,
  138. schemas: [
  139. {
  140. field: 'sceneName',
  141. label: '场景标题',
  142. component: 'Input',
  143. componentProps: {
  144. maxLength: 100,
  145. },
  146. colProps: {
  147. xl: 7,
  148. xxl: 7,
  149. },
  150. },
  151. {
  152. field: 'snCode',
  153. label: 'SN码',
  154. component: 'Input',
  155. componentProps: {
  156. maxLength: 100,
  157. },
  158. colProps: {
  159. xl: 6,
  160. xxl: 6,
  161. },
  162. },
  163. ],
  164. };
  165. export const cameraScene: BasicColumn[] = [
  166. {
  167. title: '作品标题',
  168. dataIndex: 'name',
  169. width: 150,
  170. customRender: ({ record }) => {
  171. return (
  172. <a href={record.webSite || record.thumb} target="_blank">
  173. {record.name}
  174. </a>
  175. );
  176. // return record.name ? h('span', record.name) : '-';
  177. },
  178. },
  179. {
  180. title: '作品码',
  181. dataIndex: 'sceneCodes',
  182. ellipsis: true,
  183. width: 180,
  184. },
  185. {
  186. title: '用户账号',
  187. dataIndex: 'userId',
  188. width: 100,
  189. },
  190. {
  191. title: '创建时间',
  192. dataIndex: 'createTime',
  193. width: 180,
  194. customRender: ({ record }) => {
  195. return record.createTime
  196. ? h(Time, {
  197. value: record.createTime,
  198. mode: 'datetime',
  199. })
  200. : '-';
  201. },
  202. },
  203. {
  204. title: '最新编辑时间',
  205. dataIndex: 'updateTime',
  206. width: 180,
  207. customRender: ({ record }) => {
  208. return record.updateTime
  209. ? h(Time, {
  210. value: record.updateTime,
  211. mode: 'datetime',
  212. })
  213. : '-';
  214. },
  215. },
  216. {
  217. title: '是否加密',
  218. dataIndex: 'status',
  219. width: 80,
  220. customRender: ({ record }) => {
  221. return record.isCopy ? '是' : '否';
  222. },
  223. },
  224. {
  225. title: '浏览量',
  226. dataIndex: 'visit',
  227. width: 80,
  228. },
  229. {
  230. title: '操作',
  231. dataIndex: 'action',
  232. slots: { customRender: 'action' },
  233. ifShow: true,
  234. fixed: 'right',
  235. flag: 'ACTION',
  236. width: 50,
  237. },
  238. ];
  239. export const cameraSearchForm: Partial<FormProps> = {
  240. labelWidth: 100,
  241. schemas: [
  242. {
  243. field: 'sceneName',
  244. label: '场景标题',
  245. component: 'Input',
  246. componentProps: {
  247. maxLength: 100,
  248. },
  249. colProps: {
  250. xl: 7,
  251. xxl: 7,
  252. },
  253. },
  254. {
  255. field: 'snCode',
  256. label: 'SN码',
  257. component: 'Input',
  258. componentProps: {
  259. maxLength: 100,
  260. },
  261. colProps: {
  262. xl: 7,
  263. xxl: 7,
  264. },
  265. },
  266. ],
  267. };
  268. export const quanjSearchForm: Partial<FormProps> = {
  269. labelWidth: 100,
  270. schemas: [
  271. {
  272. field: 'sceneName',
  273. label: '作品标题',
  274. component: 'Input',
  275. componentProps: {
  276. maxLength: 100,
  277. },
  278. colProps: {
  279. xl: 7,
  280. xxl: 7,
  281. },
  282. },
  283. // {
  284. // field: 'snCode',
  285. // label: '作品码',
  286. // component: 'Input',
  287. // componentProps: {
  288. // maxLength: 100,
  289. // },
  290. // colProps: {
  291. // xl: 7,
  292. // xxl: 7,
  293. // },
  294. // },
  295. ],
  296. };