windrect.data.ts 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { rules } from '/@/utils/helper/validator';
  4. import { reactive } from 'vue';
  5. export const resultColumns: BasicColumn[] = [
  6. // {
  7. // title: '测风描述',
  8. // dataIndex: 'strremark',
  9. // width: 120,
  10. // align: 'center',
  11. // },
  12. {
  13. title: '测风设备数量',
  14. dataIndex: 'totalcount',
  15. width: 100,
  16. align: 'center',
  17. },
  18. {
  19. title: '同时运行数量',
  20. dataIndex: 'count',
  21. width: 100,
  22. align: 'center',
  23. },
  24. {
  25. title: '总时长',
  26. dataIndex: 'runtime',
  27. width: 100,
  28. align: 'center',
  29. },
  30. {
  31. title: '开始测风时间',
  32. dataIndex: 'begintime',
  33. width: 80,
  34. align: 'center',
  35. },
  36. {
  37. title: '结束测风时间',
  38. dataIndex: 'endtime',
  39. width: 100,
  40. align: 'center',
  41. sorter: (a: any, b: any) => new Date(a.endtime) - new Date(b.endtime),
  42. },
  43. {
  44. title: '用时(s)',
  45. dataIndex: 'runtime',
  46. width: 100,
  47. align: 'center',
  48. },
  49. {
  50. title: '操作',
  51. dataIndex: 'action',
  52. width: 100,
  53. align: 'center',
  54. },
  55. ];
  56. export const innerResultColumns: BasicColumn[] = [
  57. {
  58. title: '设备名称',
  59. dataIndex: 'strname',
  60. align: 'center',
  61. width: 120,
  62. },
  63. {
  64. title: '平均风速',
  65. dataIndex: 'va',
  66. align: 'center',
  67. width: 100,
  68. },
  69. {
  70. title: '风量',
  71. dataIndex: 'm3',
  72. align: 'center',
  73. width: 100,
  74. },
  75. {
  76. title: '用时(s)',
  77. dataIndex: 'runtime',
  78. align: 'center',
  79. width: 80,
  80. },
  81. ];
  82. export const columns: BasicColumn[] = [
  83. {
  84. title: '名称',
  85. dataIndex: 'strname',
  86. width: 120,
  87. },
  88. {
  89. title: '安装位置',
  90. dataIndex: 'strinstallpos',
  91. width: 100,
  92. },
  93. {
  94. title: '是否为常闭型',
  95. dataIndex: 'bnormalclose',
  96. width: 100,
  97. // customRender: render.renderAvatar,
  98. },
  99. {
  100. title: '净宽',
  101. dataIndex: 'fclearwidth',
  102. width: 80,
  103. },
  104. {
  105. title: '净高',
  106. dataIndex: 'fclearheight',
  107. width: 100,
  108. },
  109. {
  110. title: '风门道数',
  111. dataIndex: 'ndoorcount',
  112. width: 100,
  113. },
  114. {
  115. title: '所属分站',
  116. width: 150,
  117. dataIndex: 'stationname',
  118. },
  119. {
  120. title: '点表',
  121. width: 100,
  122. dataIndex: 'strtype',
  123. },
  124. {
  125. title: '监测类型',
  126. dataIndex: 'monitorflag',
  127. width: 100,
  128. },
  129. {
  130. title: '是否模拟数据',
  131. dataIndex: 'testflag',
  132. width: 100,
  133. },
  134. ];
  135. export const recycleColumns: BasicColumn[] = [
  136. {
  137. title: '名称',
  138. dataIndex: 'strname',
  139. width: 100,
  140. },
  141. {
  142. title: '是否为常闭型',
  143. dataIndex: 'bnormalclose',
  144. width: 100,
  145. },
  146. ];
  147. export const searchFormSchema: FormSchema[] = [
  148. {
  149. label: '名称',
  150. field: 'strname',
  151. component: 'Input',
  152. colProps: { span: 6 },
  153. },
  154. {
  155. label: '安装位置',
  156. field: 'strinstallpos',
  157. component: 'Input',
  158. colProps: { span: 6 },
  159. },
  160. {
  161. label: '是否为常闭型',
  162. field: 'bnormalclose',
  163. component: 'JDictSelectTag',
  164. componentProps: {
  165. dictCode: 'user_status',
  166. placeholder: '请选择读写类型',
  167. stringToNumber: true,
  168. },
  169. colProps: { span: 6 },
  170. },
  171. ];
  172. export const formSchema: FormSchema[] = [
  173. {
  174. label: '',
  175. field: 'id',
  176. component: 'Input',
  177. show: false,
  178. },
  179. {
  180. label: '名称',
  181. field: 'strname',
  182. component: 'Input',
  183. },
  184. {
  185. label: '安装位置',
  186. field: 'strinstallpos',
  187. component: 'Input',
  188. },
  189. {
  190. label: '是否为常闭型',
  191. field: 'bnormalclose',
  192. component: 'RadioGroup',
  193. defaultValue: 1,
  194. componentProps: () => {
  195. return {
  196. options: [
  197. { label: '是', value: 1, key: '1' },
  198. { label: '否', value: 0, key: '2' },
  199. ],
  200. };
  201. },
  202. },
  203. {
  204. label: '净宽',
  205. field: 'fclearwidth',
  206. component: 'Input',
  207. },
  208. {
  209. label: '净高',
  210. field: 'fclearheight',
  211. component: 'Input',
  212. },
  213. {
  214. label: '风门道数',
  215. field: 'ndoorcount',
  216. component: 'Input',
  217. },
  218. {
  219. label: '所属分站',
  220. field: 'stationname',
  221. component: 'JDictSelectTag',
  222. componentProps: {
  223. dictCode: 'user_status',
  224. placeholder: '请选择状态',
  225. stringToNumber: true,
  226. },
  227. },
  228. {
  229. label: '点表',
  230. field: 'strtype',
  231. component: 'JDictSelectTag',
  232. componentProps: {
  233. dictCode: 'user_status',
  234. placeholder: '请选择状态',
  235. stringToNumber: true,
  236. },
  237. },
  238. {
  239. label: '监测类型',
  240. field: 'monitorflag',
  241. component: 'JDictSelectTag',
  242. componentProps: {
  243. dictCode: 'user_status',
  244. placeholder: '请选择状态',
  245. stringToNumber: true,
  246. },
  247. },
  248. {
  249. label: '是否模拟数据',
  250. field: 'testflag',
  251. component: 'RadioGroup',
  252. defaultValue: 1,
  253. componentProps: () => {
  254. return {
  255. options: [
  256. { label: '是', value: 1, key: '1' },
  257. { label: '否', value: 0, key: '2' },
  258. ],
  259. };
  260. },
  261. },
  262. ];
  263. export const formPasswordSchema: FormSchema[] = [
  264. {
  265. label: '用户账号',
  266. field: 'username',
  267. component: 'Input',
  268. componentProps: { readOnly: true },
  269. },
  270. {
  271. label: '登录密码',
  272. field: 'password',
  273. component: 'StrengthMeter',
  274. componentProps: {
  275. placeholder: '请输入登录密码',
  276. },
  277. rules: [
  278. {
  279. required: true,
  280. message: '请输入登录密码',
  281. },
  282. ],
  283. },
  284. {
  285. label: '确认密码',
  286. field: 'confirmPassword',
  287. component: 'InputPassword',
  288. dynamicRules: ({ values }) => rules.confirmPassword(values, true),
  289. },
  290. ];
  291. export const formAgentSchema: FormSchema[] = [
  292. {
  293. label: '',
  294. field: 'id',
  295. component: 'Input',
  296. show: false,
  297. },
  298. {
  299. field: 'userName',
  300. label: '用户名',
  301. component: 'Input',
  302. componentProps: {
  303. readOnly: true,
  304. allowClear: false,
  305. },
  306. },
  307. {
  308. field: 'agentUserName',
  309. label: '代理人用户名',
  310. required: true,
  311. component: 'JSelectUser',
  312. componentProps: {
  313. rowKey: 'username',
  314. labelKey: 'realname',
  315. maxSelectCount: 10,
  316. },
  317. },
  318. {
  319. field: 'startTime',
  320. label: '代理开始时间',
  321. component: 'DatePicker',
  322. required: true,
  323. componentProps: {
  324. showTime: true,
  325. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  326. placeholder: '请选择代理开始时间',
  327. },
  328. },
  329. {
  330. field: 'endTime',
  331. label: '代理结束时间',
  332. component: 'DatePicker',
  333. required: true,
  334. componentProps: {
  335. showTime: true,
  336. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  337. placeholder: '请选择代理结束时间',
  338. },
  339. },
  340. {
  341. field: 'status',
  342. label: '状态',
  343. component: 'JDictSelectTag',
  344. defaultValue: '1',
  345. componentProps: {
  346. dictCode: 'valid_status',
  347. type: 'radioButton',
  348. },
  349. },
  350. ];
  351. export const chartsColumns = [
  352. {
  353. legend: '风量',
  354. seriesName: 'm³/min',
  355. ymax: 10000,
  356. yname: 'm³/min',
  357. linetype: 'line',
  358. yaxispos: 'left',
  359. color: '#3DF6FF',
  360. sort: 1,
  361. xRotate: 0,
  362. dataIndex: 'm3',
  363. },
  364. {
  365. legend: '风速',
  366. seriesName: '(m/s)',
  367. ymax: 10,
  368. yname: 'm/s',
  369. linetype: 'line',
  370. yaxispos: 'right',
  371. color: '#cd5fff',
  372. sort: 2,
  373. xRotate: 0,
  374. dataIndex: 'va',
  375. },
  376. ];
  377. export const option = {
  378. xAxis: {
  379. type: 'category',
  380. boundaryGap: false,
  381. axisLine: { lineStyle: { color: '#57617B' } },
  382. axisLabel: { color: '#ffffffcc' },
  383. splitLine: { show: true, lineStyle: { color: '#57617B22', type: 'dashed' } },
  384. interval: 0,
  385. rotate: 40,
  386. },
  387. };