window.data.ts 8.1 KB

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