<template> <Row> <Col span="24"> <List :VC="'Devices'" :PK="'DID'" :Columns="Columns" :EditColumns="EditColumns" :FormRules="FormRules" :Empty="Empty" :Name="'设备'" ></List> </Col> </Row></template><script lang="ts">import Vue from "vue";import Component from "vue-class-component";import DevicesClass from "@/class/Devices";/** * 设备列表 * */@Component({ components: { List: () => import("../../List/List.vue") }})export default class Devices extends Vue { Empty: any = DevicesClass; Columns: any = [ { Title: "设备型号", Key: "DMID", Span: 12, Type: "number" }, { Title: "序列号", Key: "SN", Span: 12, Type: "number" }, { Title: "生产日期", Key: "PTime", Span: 12, Type: "date" }, { Title: "区域码", Key: "AID", Span: 12, Type: "number" }, { Title: "地址码", Key: "AreaID", Span: 12, Type: "number" }, { Title: "户号", Key: "House", Span: 12, Type: "string" }, { Title: "层级", Key: "Floor", Span: 12, Type: "string" }, { Title: "单元号", Key: "Unit", Span: 12, Type: "string" }, { Title: "楼栋号", Key: "Build", Span: 12, Type: "string" }, { Title: "安装日期", Key: "ITime", Span: 12, Type: "date" }, { Title: "安装人", Key: "IUID", Span: 12, Type: "map", MapVC: "Users", MapKey: "Name" }, { Title: "备注", Key: "Memo", Span: 12, Type: "string" } ]; EditColumns: any = [ { Title: "设备型号", Key: "DMID", Span: 12, Type: "foreign.select", Foreign: { VC: "Model", VR: "Result", Getter: "G_MODEL_ALL", Text: (v: any) => `${v.P.Title}>${v.Title}`, //外键选择, Value: "DMID" }, Options: [{ Text: "a", Value: 1 }] }, { Title: "序列号", Key: "SN", Span: 12, Type: "number" }, { Title: "生产日期", Key: "PTime", Span: 12, Type: "date" }, { Title: "区域码", Key: "AID", Span: 12, Type: "number" }, { Title: "地址码", Key: "AreaID", Span: 12, Type: "number" }, { Title: "户号", Key: "House", Span: 12, Type: "number" }, { Title: "层级", Key: "Floor", Span: 12, Type: "string" }, { Title: "单元号", Key: "Unit", Span: 12, Type: "string" }, { Title: "楼栋号", Key: "Build", Span: 12, Type: "string" }, { Title: "安装日期", Key: "ITime", Span: 12, Type: "date" }, { Title: "安装人", Key: "IUID", Span: 12, Type: "foreign.select", Foreign: { VC: "Users", VR: "Result", Getter: "G_USERS_RESULT", Text: (v: any) => { return v.Name; }, Value: "UID", //开启远程搜索,会调用指定的Action RemoteAction: "A_USERS_SEARCH" } }, { Title: "备注", Key: "Memo", Span: 12, Type: "string" } // { // Title: "GPSX", // Key: "X", // Span: 12, // Type: "float" // }, // { // Title: "GPSY", // Key: "Y", // Span: 12, // Type: "float" // } ]; FormRules: any = { DMID: [ { type: "number", message: "设备型号必须是数字" }, { required: true, message: "请输入设备型号" } //{ min:1,message:"设备型号最小值为1" } //{ max:999,message:"设备型号最大值为999" }, ], SN: [ { type: "number", message: "序列号必须是数字" }, { required: true, message: "请输入序列号" } //{ min:1,message:"序列号最小值为1" } //{ max:999,message:"序列号最大值为999" }, ], PTime: [ { required: true, message: "请输入生产日期" } //{ min:1,message:"生产日期最小值为1" } //{ max:999,message:"生产日期最大值为999" }, ], AID: [ { type: "number", message: "区域码必须是数字" }, { required: true, message: "请输入区域码" } //{ min:1,message:"区域码最小值为1" } //{ max:999,message:"区域码最大值为999" }, ], AreaID: [ { type: "number", message: "地址码必须是数字" }, { required: true, message: "请输入地址码" } //{ min:1,message:"地址码最小值为1" } //{ max:999,message:"地址码最大值为999" }, ], House: [ { type: "string", required: true, message: "请输入户号" }, { min: 1, message: "户号最小长度为1个字符" }, { max: 10, message: "户号最大长度为10个字符" } ], Floor: [ { type: "string", required: true, message: "请输入层级" }, { min: 1, message: "层级最小长度为1个字符" }, { max: 10, message: "层级最大长度为10个字符" } ], Unit: [ { type: "string", required: true, message: "请输入单元号" }, { min: 1, message: "单元号最小长度为1个字符" }, { max: 10, message: "单元号最大长度为10个字符" } ], Build: [ { type: "string", required: true, message: "请输入楼栋号" }, { min: 1, message: "楼栋号最小长度为1个字符" }, { max: 10, message: "楼栋号最大长度为10个字符" } ], ITime: [ { required: true, message: "请输入安装日期" } //{ min:1,message:"安装日期最小值为1" } //{ max:999,message:"安装日期最大值为999" }, ], IUID: [ { type: "number", message: "安装人必须是数字" }, { required: true, message: "请输入安装人" } //{ min:1,message:"安装人最小值为1" } //{ max:999,message:"安装人最大值为999" }, ], Memo: [ { type: "string", required: true, message: "请输入备注" }, { min: 1, message: "备注最小长度为1个字符" }, { max: 250, message: "备注最大长度为250个字符" } ], X: [ { type: "float", message: "GPSX必须是小数" }, { required: true, message: "请输入GPSX" } //{ min:1,message:"GPSX最小值为1" } //{ max:999,message:"GPSX最大值为999" }, ], Y: [ { type: "float", message: "GPSY必须是小数" }, { required: true, message: "请输入GPSY" } //{ min:1,message:"GPSY最小值为1" } //{ max:999,message:"GPSY最大值为999" }, ] }; mounted() { if (this.$store.getters["G_MODEL_RESULT"].L.length == 0) { } } created() {}}</script><style lang="less" scoped></style>