1. <template>
    2. <Row>
    3. <Col span="24">
    4. <List
    5. :VC="'Devices'"
    6. :PK="'DID'"
    7. :Columns="Columns"
    8. :EditColumns="EditColumns"
    9. :FormRules="FormRules"
    10. :Empty="Empty"
    11. :Name="'设备'"
    12. ></List>
    13. </Col>
    14. </Row>
    15. </template>
    16. <script lang="ts">
    17. import Vue from "vue";
    18. import Component from "vue-class-component";
    19. import DevicesClass from "@/class/Devices";
    20. /**
    21. * 设备列表
    22. * */
    23. @Component({
    24. components: {
    25. List: () => import("../../List/List.vue")
    26. }
    27. })
    28. export default class Devices extends Vue {
    29. Empty: any = DevicesClass;
    30. Columns: any = [
    31. {
    32. Title: "设备型号",
    33. Key: "DMID",
    34. Span: 12,
    35. Type: "number"
    36. },
    37. {
    38. Title: "序列号",
    39. Key: "SN",
    40. Span: 12,
    41. Type: "number"
    42. },
    43. {
    44. Title: "生产日期",
    45. Key: "PTime",
    46. Span: 12,
    47. Type: "date"
    48. },
    49. {
    50. Title: "区域码",
    51. Key: "AID",
    52. Span: 12,
    53. Type: "number"
    54. },
    55. {
    56. Title: "地址码",
    57. Key: "AreaID",
    58. Span: 12,
    59. Type: "number"
    60. },
    61. {
    62. Title: "户号",
    63. Key: "House",
    64. Span: 12,
    65. Type: "string"
    66. },
    67. {
    68. Title: "层级",
    69. Key: "Floor",
    70. Span: 12,
    71. Type: "string"
    72. },
    73. {
    74. Title: "单元号",
    75. Key: "Unit",
    76. Span: 12,
    77. Type: "string"
    78. },
    79. {
    80. Title: "楼栋号",
    81. Key: "Build",
    82. Span: 12,
    83. Type: "string"
    84. },
    85. {
    86. Title: "安装日期",
    87. Key: "ITime",
    88. Span: 12,
    89. Type: "date"
    90. },
    91. {
    92. Title: "安装人",
    93. Key: "IUID",
    94. Span: 12,
    95. Type: "map",
    96. MapVC: "Users",
    97. MapKey: "Name"
    98. },
    99. {
    100. Title: "备注",
    101. Key: "Memo",
    102. Span: 12,
    103. Type: "string"
    104. }
    105. ];
    106. EditColumns: any = [
    107. {
    108. Title: "设备型号",
    109. Key: "DMID",
    110. Span: 12,
    111. Type: "foreign.select",
    112. Foreign: {
    113. VC: "Model",
    114. VR: "Result",
    115. Getter: "G_MODEL_ALL",
    116. Text: (v: any) => `${v.P.Title}>${v.Title}`,
    117. //外键选择,
    118. Value: "DMID"
    119. },
    120. Options: [{ Text: "a", Value: 1 }]
    121. },
    122. {
    123. Title: "序列号",
    124. Key: "SN",
    125. Span: 12,
    126. Type: "number"
    127. },
    128. {
    129. Title: "生产日期",
    130. Key: "PTime",
    131. Span: 12,
    132. Type: "date"
    133. },
    134. {
    135. Title: "区域码",
    136. Key: "AID",
    137. Span: 12,
    138. Type: "number"
    139. },
    140. {
    141. Title: "地址码",
    142. Key: "AreaID",
    143. Span: 12,
    144. Type: "number"
    145. },
    146. {
    147. Title: "户号",
    148. Key: "House",
    149. Span: 12,
    150. Type: "number"
    151. },
    152. {
    153. Title: "层级",
    154. Key: "Floor",
    155. Span: 12,
    156. Type: "string"
    157. },
    158. {
    159. Title: "单元号",
    160. Key: "Unit",
    161. Span: 12,
    162. Type: "string"
    163. },
    164. {
    165. Title: "楼栋号",
    166. Key: "Build",
    167. Span: 12,
    168. Type: "string"
    169. },
    170. {
    171. Title: "安装日期",
    172. Key: "ITime",
    173. Span: 12,
    174. Type: "date"
    175. },
    176. {
    177. Title: "安装人",
    178. Key: "IUID",
    179. Span: 12,
    180. Type: "foreign.select",
    181. Foreign: {
    182. VC: "Users",
    183. VR: "Result",
    184. Getter: "G_USERS_RESULT",
    185. Text: (v: any) => {
    186. return v.Name;
    187. },
    188. Value: "UID",
    189. //开启远程搜索,会调用指定的Action
    190. RemoteAction: "A_USERS_SEARCH"
    191. }
    192. },
    193. {
    194. Title: "备注",
    195. Key: "Memo",
    196. Span: 12,
    197. Type: "string"
    198. }
    199. // {
    200. // Title: "GPSX",
    201. // Key: "X",
    202. // Span: 12,
    203. // Type: "float"
    204. // },
    205. // {
    206. // Title: "GPSY",
    207. // Key: "Y",
    208. // Span: 12,
    209. // Type: "float"
    210. // }
    211. ];
    212. FormRules: any = {
    213. DMID: [
    214. { type: "number", message: "设备型号必须是数字" },
    215. { required: true, message: "请输入设备型号" }
    216. //{ min:1,message:"设备型号最小值为1" }
    217. //{ max:999,message:"设备型号最大值为999" },
    218. ],
    219. SN: [
    220. { type: "number", message: "序列号必须是数字" },
    221. { required: true, message: "请输入序列号" }
    222. //{ min:1,message:"序列号最小值为1" }
    223. //{ max:999,message:"序列号最大值为999" },
    224. ],
    225. PTime: [
    226. { required: true, message: "请输入生产日期" }
    227. //{ min:1,message:"生产日期最小值为1" }
    228. //{ max:999,message:"生产日期最大值为999" },
    229. ],
    230. AID: [
    231. { type: "number", message: "区域码必须是数字" },
    232. { required: true, message: "请输入区域码" }
    233. //{ min:1,message:"区域码最小值为1" }
    234. //{ max:999,message:"区域码最大值为999" },
    235. ],
    236. AreaID: [
    237. { type: "number", message: "地址码必须是数字" },
    238. { required: true, message: "请输入地址码" }
    239. //{ min:1,message:"地址码最小值为1" }
    240. //{ max:999,message:"地址码最大值为999" },
    241. ],
    242. House: [
    243. { type: "string", required: true, message: "请输入户号" },
    244. { min: 1, message: "户号最小长度为1个字符" },
    245. { max: 10, message: "户号最大长度为10个字符" }
    246. ],
    247. Floor: [
    248. { type: "string", required: true, message: "请输入层级" },
    249. { min: 1, message: "层级最小长度为1个字符" },
    250. { max: 10, message: "层级最大长度为10个字符" }
    251. ],
    252. Unit: [
    253. { type: "string", required: true, message: "请输入单元号" },
    254. { min: 1, message: "单元号最小长度为1个字符" },
    255. { max: 10, message: "单元号最大长度为10个字符" }
    256. ],
    257. Build: [
    258. { type: "string", required: true, message: "请输入楼栋号" },
    259. { min: 1, message: "楼栋号最小长度为1个字符" },
    260. { max: 10, message: "楼栋号最大长度为10个字符" }
    261. ],
    262. ITime: [
    263. { required: true, message: "请输入安装日期" }
    264. //{ min:1,message:"安装日期最小值为1" }
    265. //{ max:999,message:"安装日期最大值为999" },
    266. ],
    267. IUID: [
    268. { type: "number", message: "安装人必须是数字" },
    269. { required: true, message: "请输入安装人" }
    270. //{ min:1,message:"安装人最小值为1" }
    271. //{ max:999,message:"安装人最大值为999" },
    272. ],
    273. Memo: [
    274. { type: "string", required: true, message: "请输入备注" },
    275. { min: 1, message: "备注最小长度为1个字符" },
    276. { max: 250, message: "备注最大长度为250个字符" }
    277. ],
    278. X: [
    279. { type: "float", message: "GPSX必须是小数" },
    280. { required: true, message: "请输入GPSX" }
    281. //{ min:1,message:"GPSX最小值为1" }
    282. //{ max:999,message:"GPSX最大值为999" },
    283. ],
    284. Y: [
    285. { type: "float", message: "GPSY必须是小数" },
    286. { required: true, message: "请输入GPSY" }
    287. //{ min:1,message:"GPSY最小值为1" }
    288. //{ max:999,message:"GPSY最大值为999" },
    289. ]
    290. };
    291. mounted() {
    292. if (this.$store.getters["G_MODEL_RESULT"].L.length == 0) {
    293. }
    294. }
    295. created() {}
    296. }
    297. </script>
    298. <style lang="less" scoped>
    299. </style>