window.data.ts 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. import { BasicColumn } from '/@/components/Table';
  2. import { defineAsyncComponent } from 'vue';
  3. import { FormSchema } from '/@/components/Table';
  4. import { rules } from '/@/utils/helper/validator';
  5. export const columns: BasicColumn[] = [
  6. {
  7. title: '名称',
  8. dataIndex: 'strname',
  9. width: 120,
  10. },
  11. {
  12. title: '安装位置',
  13. dataIndex: 'strinstallpos',
  14. width: 100,
  15. },
  16. {
  17. title: '是否为常闭型',
  18. dataIndex: 'bnormalclose',
  19. width: 100,
  20. // customRender: render.renderAvatar,
  21. },
  22. {
  23. title: '净宽',
  24. dataIndex: 'fclearwidth',
  25. width: 80,
  26. },
  27. {
  28. title: '净高',
  29. dataIndex: 'fclearheight',
  30. width: 100,
  31. },
  32. {
  33. title: '风门道数',
  34. dataIndex: 'ndoorcount',
  35. width: 100,
  36. },
  37. {
  38. title: '所属分站',
  39. width: 150,
  40. dataIndex: 'stationname',
  41. },
  42. {
  43. title: '点表',
  44. width: 100,
  45. dataIndex: 'strtype',
  46. },
  47. {
  48. title: '监测类型',
  49. dataIndex: 'monitorflag',
  50. width: 100,
  51. },
  52. {
  53. title: '是否模拟数据',
  54. dataIndex: 'testflag',
  55. width: 100,
  56. },
  57. ];
  58. export const recycleColumns: BasicColumn[] = [
  59. {
  60. title: '名称',
  61. dataIndex: 'strname',
  62. width: 100,
  63. },
  64. {
  65. title: '是否为常闭型',
  66. dataIndex: 'bnormalclose',
  67. width: 100,
  68. },
  69. ];
  70. export const searchFormSchema: FormSchema[] = [
  71. {
  72. label: '名称',
  73. field: 'strname',
  74. component: 'Input',
  75. colProps: { span: 6 },
  76. },
  77. {
  78. label: '安装位置',
  79. field: 'strinstallpos',
  80. component: 'Input',
  81. colProps: { span: 6 },
  82. },
  83. {
  84. label: '是否为常闭型',
  85. field: 'bnormalclose',
  86. component: 'JDictSelectTag',
  87. componentProps: {
  88. dictCode: 'user_status',
  89. placeholder: '请选择读写类型',
  90. stringToNumber: true,
  91. },
  92. colProps: { span: 6 },
  93. },
  94. ];
  95. export const formSchema: FormSchema[] = [
  96. {
  97. label: '',
  98. field: 'id',
  99. component: 'Input',
  100. show: false,
  101. },
  102. {
  103. label: '名称',
  104. field: 'strname',
  105. component: 'Input',
  106. },
  107. {
  108. label: '安装位置',
  109. field: 'strinstallpos',
  110. component: 'Input',
  111. },
  112. {
  113. label: '是否为常闭型',
  114. field: 'bnormalclose',
  115. component: 'RadioGroup',
  116. defaultValue: 1,
  117. componentProps: () => {
  118. return {
  119. options: [
  120. { label: '是', value: 1, key: '1' },
  121. { label: '否', value: 0, key: '2' },
  122. ],
  123. };
  124. },
  125. },
  126. {
  127. label: '净宽',
  128. field: 'fclearwidth',
  129. component: 'Input',
  130. },
  131. {
  132. label: '净高',
  133. field: 'fclearheight',
  134. component: 'Input',
  135. },
  136. {
  137. label: '风门道数',
  138. field: 'ndoorcount',
  139. component: 'Input',
  140. },
  141. {
  142. label: '所属分站',
  143. field: 'stationname',
  144. component: 'JDictSelectTag',
  145. componentProps: {
  146. dictCode: 'user_status',
  147. placeholder: '请选择状态',
  148. stringToNumber: true,
  149. },
  150. },
  151. {
  152. label: '点表',
  153. field: 'strtype',
  154. component: 'JDictSelectTag',
  155. componentProps: {
  156. dictCode: 'user_status',
  157. placeholder: '请选择状态',
  158. stringToNumber: true,
  159. },
  160. },
  161. {
  162. label: '监测类型',
  163. field: 'monitorflag',
  164. component: 'JDictSelectTag',
  165. componentProps: {
  166. dictCode: 'user_status',
  167. placeholder: '请选择状态',
  168. stringToNumber: true,
  169. },
  170. },
  171. {
  172. label: '是否模拟数据',
  173. field: 'testflag',
  174. component: 'RadioGroup',
  175. defaultValue: 1,
  176. componentProps: () => {
  177. return {
  178. options: [
  179. { label: '是', value: 1, key: '1' },
  180. { label: '否', value: 0, key: '2' },
  181. ],
  182. };
  183. },
  184. },
  185. ];
  186. export const formPasswordSchema: FormSchema[] = [
  187. {
  188. label: '用户账号',
  189. field: 'username',
  190. component: 'Input',
  191. componentProps: { readOnly: true },
  192. },
  193. {
  194. label: '登录密码',
  195. field: 'password',
  196. component: 'StrengthMeter',
  197. componentProps: {
  198. placeholder: '请输入登录密码',
  199. },
  200. rules: [
  201. {
  202. required: true,
  203. message: '请输入登录密码',
  204. },
  205. ],
  206. },
  207. {
  208. label: '确认密码',
  209. field: 'confirmPassword',
  210. component: 'InputPassword',
  211. dynamicRules: ({ values }) => rules.confirmPassword(values, true),
  212. },
  213. ];
  214. export const formAgentSchema: FormSchema[] = [
  215. {
  216. label: '',
  217. field: 'id',
  218. component: 'Input',
  219. show: false,
  220. },
  221. {
  222. field: 'userName',
  223. label: '用户名',
  224. component: 'Input',
  225. componentProps: {
  226. readOnly: true,
  227. allowClear: false,
  228. },
  229. },
  230. {
  231. field: 'agentUserName',
  232. label: '代理人用户名',
  233. required: true,
  234. component: 'JSelectUser',
  235. componentProps: {
  236. rowKey: 'username',
  237. labelKey: 'realname',
  238. maxSelectCount: 10,
  239. },
  240. },
  241. {
  242. field: 'startTime',
  243. label: '代理开始时间',
  244. component: 'DatePicker',
  245. required: true,
  246. componentProps: {
  247. showTime: true,
  248. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  249. placeholder: '请选择代理开始时间',
  250. },
  251. },
  252. {
  253. field: 'endTime',
  254. label: '代理结束时间',
  255. component: 'DatePicker',
  256. required: true,
  257. componentProps: {
  258. showTime: true,
  259. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  260. placeholder: '请选择代理结束时间',
  261. },
  262. },
  263. {
  264. field: 'status',
  265. label: '状态',
  266. component: 'JDictSelectTag',
  267. defaultValue: '1',
  268. componentProps: {
  269. dictCode: 'valid_status',
  270. type: 'radioButton',
  271. },
  272. },
  273. ];
  274. export const chartsColumns = [
  275. {
  276. legend: '前窗风速',
  277. seriesName: '(m/min)',
  278. ymax: 20,
  279. yname: 'm/min',
  280. linetype: 'bar',
  281. yaxispos: 'left',
  282. color: '#37BCF2',
  283. sort: 1,
  284. xRotate: 0,
  285. dataIndex: 'frontPresentValue',
  286. },
  287. {
  288. legend: '后窗风速',
  289. seriesName: '',
  290. ymax: 50,
  291. yname: 'm/min',
  292. linetype: 'bar',
  293. yaxispos: 'right',
  294. color: '#FC4327',
  295. sort: 1,
  296. xRotate: 0,
  297. dataIndex: 'rearPresentValue',
  298. },
  299. ];
  300. export function getModelComponent(is2DModel: boolean = false, sysOrgCode?: string) {
  301. // @ts-ignore
  302. return defineAsyncComponent(() => {
  303. if (!is2DModel) return import('./components/entryThree.vue');
  304. switch (sysOrgCode) {
  305. // case '000000':
  306. // return import('./components/000000.vue');
  307. // return import('./components/windowDualSVG.vue');
  308. default:
  309. return import('./components/windowDualSVG.vue');
  310. // return import('./components/windowSVG.vue');
  311. }
  312. });
  313. }