map.data.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { RoleEnum } from '/@/enums/roleEnum';
  4. import { getServiceTypes,queryServiceTags,queryDicsByName,queryCoors } from '/@/api/resource/map';
  5. const resTag = await queryServiceTags()
  6. let listTag = []
  7. resTag.map(item => {
  8. listTag.push({
  9. label: item.name,
  10. value: item.code
  11. })
  12. })
  13. /**
  14. * 密级字典
  15. */
  16. export const secrets = await queryDicsByName('密级')
  17. /**
  18. * 服务标签
  19. */
  20. export const serviceTags = listTag;
  21. /**
  22. * 坐标系列表
  23. */
  24. export const sysCoors = await queryCoors()
  25. /**
  26. * 服务类型
  27. */
  28. export const serviceTypes = await getServiceTypes()
  29. /**
  30. * 责任处室
  31. */
  32. export const respDept = await queryDicsByName('责任处室')
  33. /**
  34. * 保管单位
  35. */
  36. export const collectDept = await queryDicsByName('保管单位')
  37. /**
  38. * EPSG code
  39. */
  40. export const EPSGCodes = await queryDicsByName('EPSG code')
  41. const checkStatus = [
  42. { label: '未提交', value: 1 },
  43. { label: '审核中', value: 2 },
  44. { label: '审核不通过', value: 3 },
  45. { label: '被驳回', value: 4 },
  46. { label: '审核通过', value: 5 },
  47. { label: '我的', value: 6 },
  48. ]
  49. export enum KeysTypeEnum {
  50. DISABLED = 'disabled',
  51. ENABLED = 'enabled',
  52. }
  53. export const RoleMenuDictEnum: Recordable<{ key: string; keyType: KeysTypeEnum }> = {
  54. [RoleEnum.PLATFORM_ADMIN]: { key: 'enabled_platform_admin_auth', keyType: KeysTypeEnum.ENABLED },
  55. [RoleEnum.SYS_ADMIN]: { key: 'enabled_sysadmin_auth', keyType: KeysTypeEnum.ENABLED },
  56. [RoleEnum.TENANT_ADMIN]: { key: 'disabled_tenant_auth', keyType: KeysTypeEnum.DISABLED },
  57. [RoleEnum.CUSTOMER_USER]: { key: 'disabled_tenant_auth', keyType: KeysTypeEnum.DISABLED },
  58. };
  59. /**
  60. * 查询条件
  61. */
  62. export const searchFormSchema: FormSchema[] = [
  63. {
  64. field: 'resTag',
  65. label: '资源标签',
  66. component: 'Select',
  67. componentProps: {
  68. options: serviceTags,
  69. // [
  70. // { label: '标签1', value: 1 },
  71. // { label: '标签2', value: 2 },
  72. // { label: '标签3', value: 3 },
  73. // ],
  74. },
  75. colProps: { span: 5 },
  76. },
  77. {
  78. field: 'resName',
  79. label: '资源名称',
  80. component: 'Input',
  81. colProps: { span: 5 },
  82. componentProps: {
  83. maxLength: 255,
  84. },
  85. },
  86. {
  87. field: 'checkStatus',
  88. label: '审核状态',
  89. component: 'Select',
  90. componentProps: {
  91. options: checkStatus,
  92. },
  93. colProps: { span: 5 },
  94. },
  95. ];
  96. /**
  97. * 列表显示信息
  98. */
  99. export const columns: BasicColumn[] = [
  100. {
  101. title: '分组名称',
  102. dataIndex: 'groupName',
  103. align:'center',
  104. },
  105. {
  106. title: '接口名称',
  107. dataIndex: 'name',
  108. align:'center',
  109. },
  110. {
  111. title: '接口id',
  112. dataIndex: 'id',
  113. align:'center',
  114. },
  115. {
  116. title: '调用次数',
  117. dataIndex: 'isOpen',
  118. align:'center',
  119. },
  120. {
  121. title: '发布时间',
  122. dataIndex: 'publishTime',
  123. align:'center',
  124. },
  125. {
  126. title: '接口说明',
  127. dataIndex: 'remark',
  128. align:'center',
  129. },
  130. {
  131. title: '接口状态',
  132. dataIndex: 'status',
  133. align:'center',
  134. },
  135. {
  136. title: '版本号',
  137. align:'center',
  138. dataIndex: 'version',
  139. },
  140. {
  141. title: '审核状态',
  142. align:'center',
  143. dataIndex: 'assemblyStatus',
  144. slots: { customRender: 'assemblyStatus' },
  145. }
  146. ];
  147. /**
  148. * 表单
  149. */
  150. export const formSchema: FormSchema[] = [
  151. {
  152. field: 'groupName',
  153. label: '角色名称',
  154. required: true,
  155. component: 'Input',
  156. componentProps: {
  157. maxLength: 255,
  158. placeholder: '请输入角色名称',
  159. },
  160. },
  161. {
  162. label: '排序',
  163. field: 'sort',
  164. component: 'Input',
  165. componentProps: {
  166. maxLength: 255,
  167. placeholder: '请输入排序',
  168. },
  169. }
  170. ];