浏览代码

修改基本参数的一点代码;新增设备状态、运行情况

dongjh 1 年之前
父节点
当前提交
eb2c925014

+ 3 - 3
src/views/module_base/elecfeeAdd/ElecfeeAddList.vue

@@ -12,12 +12,12 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('base_elecfee_add')">导出</a-button>
+      <!-- <a-button type="primary" icon="download" @click="handleExportXls('base_elecfee_add')">导出</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
+      </a-upload> -->
       <!-- 高级查询区域 -->
-      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>

+ 5 - 5
src/views/module_base/elecfeeBase/ElecfeeBaseList.vue

@@ -11,8 +11,8 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('base_elecfee_base')">导出</a-button>
-      <a-upload
+      <!-- <a-button type="primary" icon="download" @click="handleExportXls('base_elecfee_base')">导出</a-button> -->
+      <!-- <a-upload
         name="file"
         :showUploadList="false"
         :multiple="false"
@@ -21,13 +21,13 @@
         @change="handleImportExcel"
       >
         <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
+      </a-upload> -->
       <!-- 高级查询区域 -->
-      <j-super-query
+      <!-- <j-super-query
         :fieldList="superFieldList"
         ref="superQueryModal"
         @handleSuperQuery="handleSuperQuery"
-      ></j-super-query>
+      ></j-super-query> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>

+ 3 - 3
src/views/module_base/elecfeeDegree/ElecfeeDegreeList.vue

@@ -12,12 +12,12 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('电度电费')">导出</a-button>
+      <!-- <a-button type="primary" icon="download" @click="handleExportXls('电度电费')">导出</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
+      </a-upload> -->
       <!-- 高级查询区域 -->
-      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>

+ 3 - 3
src/views/module_base/elecfeeRatio/ElecfeeRatioList.vue

@@ -12,12 +12,12 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('base_elecfee_ratio')">导出</a-button>
+      <!-- <a-button type="primary" icon="download" @click="handleExportXls('base_elecfee_ratio')">导出</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
+      </a-upload> -->
       <!-- 高级查询区域 -->
-      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>

+ 3 - 3
src/views/module_base/energyRate/EnergyRateList.vue

@@ -28,12 +28,12 @@
     <!-- 操作按钮区域 begin -->
     <div class="table-operator">
       <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('base_energy_rate')">导出</a-button>
+      <!-- <a-button type="primary" icon="download" @click="handleExportXls('base_energy_rate')">导出</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
+      </a-upload> -->
       <!-- 高级查询区域 -->
-      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel">

+ 3 - 3
src/views/module_base/energyType/EnergyTypeList.vue

@@ -12,12 +12,12 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('base_energy_type')">导出</a-button>
+      <!-- <a-button type="primary" icon="download" @click="handleExportXls('base_energy_type')">导出</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
+      </a-upload> -->
       <!-- 高级查询区域 -->
-      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>

+ 234 - 0
src/views/module_tpm/equipmentOnoff/EquipmentOnoffList.vue

@@ -0,0 +1,234 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('tpm_equipment_onoff')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <equipment-onoff-modal ref="modalForm" @ok="modalFormOk"></equipment-onoff-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import EquipmentOnoffModal from './modules/EquipmentOnoffModal'
+
+  export default {
+    name: 'EquipmentOnoffList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      EquipmentOnoffModal
+    },
+    data () {
+      return {
+        description: 'tpm_equipment_onoff管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'设备id',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname'
+          },
+          {
+            title:'设备状态:1运行、2待机、3停机',
+            align:"center",
+            dataIndex: 'status'
+          },
+          {
+            title:'当前时间',
+            align:"center",
+            dataIndex: 'logtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'所属年',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'所属月',
+            align:"center",
+            dataIndex: 'month'
+          },
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'day'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'time'
+          },
+          {
+            title:'所属年月',
+            align:"center",
+            dataIndex: 'yearmonth'
+          },
+          {
+            title:'所属周',
+            align:"center",
+            dataIndex: 'week'
+          },
+          {
+            title:'周几',
+            align:"center",
+            dataIndex: 'dayofweek'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/equipmentOnoff/equipmentOnoff/list",
+          delete: "/equipmentOnoff/equipmentOnoff/delete",
+          deleteBatch: "/equipmentOnoff/equipmentOnoff/deleteBatch",
+          exportXlsUrl: "/equipmentOnoff/equipmentOnoff/exportXls",
+          importExcelUrl: "equipmentOnoff/equipmentOnoff/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'equipmentid',text:'设备id'})
+        fieldList.push({type:'string',value:'equipmentname',text:'设备名称'})
+        fieldList.push({type:'string',value:'status',text:'设备状态:1运行、2待机、3停机'})
+        fieldList.push({type:'date',value:'logtime',text:'当前时间'})
+        fieldList.push({type:'int',value:'year',text:'所属年'})
+        fieldList.push({type:'int',value:'month',text:'所属月'})
+        fieldList.push({type:'string',value:'day',text:'日期'})
+        fieldList.push({type:'string',value:'time',text:'时间'})
+        fieldList.push({type:'string',value:'yearmonth',text:'所属年月'})
+        fieldList.push({type:'int',value:'week',text:'所属周'})
+        fieldList.push({type:'int',value:'dayofweek',text:'周几'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 157 - 0
src/views/module_tpm/equipmentOnoff/modules/EquipmentOnoffForm.vue

@@ -0,0 +1,157 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="设备id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备id" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备状态:1运行、2待机、3停机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
+              <a-input v-model="model.status" placeholder="请输入设备状态:1运行、2待机、3停机"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="当前时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logtime">
+              <j-date placeholder="请选择当前时间" v-model="model.logtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入所属年" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入所属月" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="day">
+              <a-input v-model="model.day" placeholder="请输入日期"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
+              <a-input v-model="model.time" placeholder="请输入时间"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearmonth">
+              <a-input v-model="model.yearmonth" placeholder="请输入所属年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属周" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="week">
+              <a-input-number v-model="model.week" placeholder="请输入所属周" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="周几" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayofweek">
+              <a-input-number v-model="model.dayofweek" placeholder="请输入周几" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'EquipmentOnoffForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           equipmentid: [
+              { required: true, message: '请输入设备id!'},
+           ],
+        },
+        url: {
+          add: "/equipmentOnoff/equipmentOnoff/add",
+          edit: "/equipmentOnoff/equipmentOnoff/edit",
+          queryById: "/equipmentOnoff/equipmentOnoff/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/module_tpm/equipmentOnoff/modules/EquipmentOnoffModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <equipment-onoff-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></equipment-onoff-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import EquipmentOnoffForm from './EquipmentOnoffForm'
+
+  export default {
+    name: 'EquipmentOnoffModal',
+    components: {
+      EquipmentOnoffForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_tpm/equipmentOnoff/modules/EquipmentOnoffModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <equipment-onoff-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></equipment-onoff-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import EquipmentOnoffForm from './EquipmentOnoffForm'
+  export default {
+    name: 'EquipmentOnoffModal',
+    components: {
+      EquipmentOnoffForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 243 - 0
src/views/module_tpm/equipmentOnoffSection/EquipmentOnoffSectionList.vue

@@ -0,0 +1,243 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('tpm_equipment_onoff_section')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <equipment-onoff-section-modal ref="modalForm" @ok="modalFormOk"></equipment-onoff-section-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import EquipmentOnoffSectionModal from './modules/EquipmentOnoffSectionModal'
+
+  export default {
+    name: 'EquipmentOnoffSectionList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      EquipmentOnoffSectionModal
+    },
+    data () {
+      return {
+        description: 'tpm_equipment_onoff_section管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'设备id',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'设备状态:1运行、2待机、3停机',
+            align:"center",
+            dataIndex: 'status'
+          },
+          {
+            title:'开始时间',
+            align:"center",
+            dataIndex: 'starttime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'结束时间',
+            align:"center",
+            dataIndex: 'endtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'时长(分钟)',
+            align:"center",
+            dataIndex: 'duration'
+          },
+          {
+            title:'所属年',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'所属月',
+            align:"center",
+            dataIndex: 'month'
+          },
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'day'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'time'
+          },
+          {
+            title:'所属年月',
+            align:"center",
+            dataIndex: 'yearmonth'
+          },
+          {
+            title:'所属周',
+            align:"center",
+            dataIndex: 'week'
+          },
+          {
+            title:'周几',
+            align:"center",
+            dataIndex: 'dayofweek'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/equipmentOnoffSection/equipmentOnoffSection/list",
+          delete: "/equipmentOnoffSection/equipmentOnoffSection/delete",
+          deleteBatch: "/equipmentOnoffSection/equipmentOnoffSection/deleteBatch",
+          exportXlsUrl: "/equipmentOnoffSection/equipmentOnoffSection/exportXls",
+          importExcelUrl: "equipmentOnoffSection/equipmentOnoffSection/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'equipmentid',text:'设备id'})
+        fieldList.push({type:'string',value:'status',text:'设备状态:1运行、2待机、3停机'})
+        fieldList.push({type:'date',value:'starttime',text:'开始时间'})
+        fieldList.push({type:'date',value:'endtime',text:'结束时间'})
+        fieldList.push({type:'int',value:'duration',text:'时长(分钟)'})
+        fieldList.push({type:'int',value:'year',text:'所属年'})
+        fieldList.push({type:'int',value:'month',text:'所属月'})
+        fieldList.push({type:'string',value:'day',text:'日期'})
+        fieldList.push({type:'string',value:'time',text:'时间'})
+        fieldList.push({type:'string',value:'yearmonth',text:'所属年月'})
+        fieldList.push({type:'int',value:'week',text:'所属周'})
+        fieldList.push({type:'int',value:'dayofweek',text:'周几'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 162 - 0
src/views/module_tpm/equipmentOnoffSection/modules/EquipmentOnoffSectionForm.vue

@@ -0,0 +1,162 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="设备id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备id" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备状态:1运行、2待机、3停机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
+              <a-input v-model="model.status" placeholder="请输入设备状态:1运行、2待机、3停机"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="starttime">
+              <j-date placeholder="请选择开始时间" v-model="model.starttime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="endtime">
+              <j-date placeholder="请选择结束时间" v-model="model.endtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时长(分钟)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration">
+              <a-input-number v-model="model.duration" placeholder="请输入时长(分钟)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入所属年" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入所属月" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="day">
+              <a-input v-model="model.day" placeholder="请输入日期"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
+              <a-input v-model="model.time" placeholder="请输入时间"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearmonth">
+              <a-input v-model="model.yearmonth" placeholder="请输入所属年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属周" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="week">
+              <a-input-number v-model="model.week" placeholder="请输入所属周" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="周几" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayofweek">
+              <a-input-number v-model="model.dayofweek" placeholder="请输入周几" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'EquipmentOnoffSectionForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           equipmentid: [
+              { required: true, message: '请输入设备id!'},
+           ],
+        },
+        url: {
+          add: "/equipmentOnoffSection/equipmentOnoffSection/add",
+          edit: "/equipmentOnoffSection/equipmentOnoffSection/edit",
+          queryById: "/equipmentOnoffSection/equipmentOnoffSection/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/module_tpm/equipmentOnoffSection/modules/EquipmentOnoffSectionModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <equipment-onoff-section-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></equipment-onoff-section-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import EquipmentOnoffSectionForm from './EquipmentOnoffSectionForm'
+
+  export default {
+    name: 'EquipmentOnoffSectionModal',
+    components: {
+      EquipmentOnoffSectionForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_tpm/equipmentOnoffSection/modules/EquipmentOnoffSectionModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <equipment-onoff-section-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></equipment-onoff-section-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import EquipmentOnoffSectionForm from './EquipmentOnoffSectionForm'
+  export default {
+    name: 'EquipmentOnoffSectionModal',
+    components: {
+      EquipmentOnoffSectionForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 282 - 0
src/views/module_tpm/equipmentStatus/EquipmentStatusList.vue

@@ -0,0 +1,282 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('设备状态定义')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <equipment-status-modal ref="modalForm" @ok="modalFormOk"></equipment-status-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import EquipmentStatusModal from './modules/EquipmentStatusModal'
+
+  export default {
+    name: 'EquipmentStatusList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      EquipmentStatusModal
+    },
+    data () {
+      return {
+        description: '设备状态定义管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+          {
+            title:'设备ID',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'额定功率(KWh)',
+            align:"center",
+            dataIndex: 'ratedpower'
+          },
+          {
+            title:'功率点位名',
+            align:"center",
+            dataIndex: 'tagnamep'
+          },
+          {
+            title:'A相电流点位名',
+            align:"center",
+            dataIndex: 'tagnameca'
+          },
+          {
+            title:'A相电压点位名',
+            align:"center",
+            dataIndex: 'tagnameva'
+          },
+          {
+            title:'B相电流点位名',
+            align:"center",
+            dataIndex: 'tagnamecb'
+          },
+          {
+            title:'B相电压点位名',
+            align:"center",
+            dataIndex: 'tagnamevb'
+          },
+          {
+            title:'C相电流点位名',
+            align:"center",
+            dataIndex: 'tagnamecc'
+          },
+          {
+            title:'C相电压点位名',
+            align:"center",
+            dataIndex: 'tagnamevc'
+          },
+          {
+            title:'实际功率当前值',
+            align:"center",
+            dataIndex: 'tagvaluep'
+          },
+          {
+            title:'A相电流当前值',
+            align:"center",
+            dataIndex: 'tagvalueca'
+          },
+          {
+            title:'A相电压当前值',
+            align:"center",
+            dataIndex: 'tagvalueva'
+          },
+          {
+            title:'B相电流当前值',
+            align:"center",
+            dataIndex: 'tagvaluecb'
+          },
+          {
+            title:'B相电压当前值',
+            align:"center",
+            dataIndex: 'tagvaluevb'
+          },
+          {
+            title:'C相电流当前值',
+            align:"center",
+            dataIndex: 'tagvaluecc'
+          },
+          {
+            title:'C相电压当前值',
+            align:"center",
+            dataIndex: 'tagvaluevc'
+          },
+          {
+            title:'记录时间',
+            align:"center",
+            dataIndex: 'logtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'状态:0正常、1运行、2待机、3停机',
+            align:"center",
+            dataIndex: 'status'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/equipmentStatus/equipmentStatus/list",
+          delete: "/equipmentStatus/equipmentStatus/delete",
+          deleteBatch: "/equipmentStatus/equipmentStatus/deleteBatch",
+          exportXlsUrl: "/equipmentStatus/equipmentStatus/exportXls",
+          importExcelUrl: "equipmentStatus/equipmentStatus/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
+        fieldList.push({type:'int',value:'equipmentid',text:'设备ID',dictCode:''})
+        fieldList.push({type:'double',value:'ratedpower',text:'额定功率(KWh)',dictCode:''})
+        fieldList.push({type:'string',value:'tagnamep',text:'功率点位名',dictCode:''})
+        fieldList.push({type:'string',value:'tagnameca',text:'A相电流点位名',dictCode:''})
+        fieldList.push({type:'string',value:'tagnameva',text:'A相电压点位名',dictCode:''})
+        fieldList.push({type:'string',value:'tagnamecb',text:'B相电流点位名',dictCode:''})
+        fieldList.push({type:'string',value:'tagnamevb',text:'B相电压点位名',dictCode:''})
+        fieldList.push({type:'string',value:'tagnamecc',text:'C相电流点位名',dictCode:''})
+        fieldList.push({type:'string',value:'tagnamevc',text:'C相电压点位名',dictCode:''})
+        fieldList.push({type:'double',value:'tagvaluep',text:'实际功率当前值',dictCode:''})
+        fieldList.push({type:'double',value:'tagvalueca',text:'A相电流当前值',dictCode:''})
+        fieldList.push({type:'double',value:'tagvalueva',text:'A相电压当前值',dictCode:''})
+        fieldList.push({type:'double',value:'tagvaluecb',text:'B相电流当前值',dictCode:''})
+        fieldList.push({type:'double',value:'tagvaluevb',text:'B相电压当前值',dictCode:''})
+        fieldList.push({type:'double',value:'tagvaluecc',text:'C相电流当前值',dictCode:''})
+        fieldList.push({type:'double',value:'tagvaluevc',text:'C相电压当前值',dictCode:''})
+        fieldList.push({type:'date',value:'logtime',text:'记录时间'})
+        fieldList.push({type:'string',value:'status',text:'状态:0正常、1运行、2待机、3停机',dictCode:''})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 194 - 0
src/views/module_tpm/equipmentStatus/modules/EquipmentStatusForm.vue

@@ -0,0 +1,194 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
+              <a-input v-model="model.remark" placeholder="请输入备注"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="额定功率(KWh)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ratedpower">
+              <a-input-number v-model="model.ratedpower" placeholder="请输入额定功率(KWh)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="功率点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagnamep">
+              <a-input v-model="model.tagnamep" placeholder="请输入功率点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="A相电流点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagnameca">
+              <a-input v-model="model.tagnameca" placeholder="请输入A相电流点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="A相电压点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagnameva">
+              <a-input v-model="model.tagnameva" placeholder="请输入A相电压点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="B相电流点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagnamecb">
+              <a-input v-model="model.tagnamecb" placeholder="请输入B相电流点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="B相电压点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagnamevb">
+              <a-input v-model="model.tagnamevb" placeholder="请输入B相电压点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="C相电流点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagnamecc">
+              <a-input v-model="model.tagnamecc" placeholder="请输入C相电流点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="C相电压点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagnamevc">
+              <a-input v-model="model.tagnamevc" placeholder="请输入C相电压点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="实际功率当前值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvaluep">
+              <a-input-number v-model="model.tagvaluep" placeholder="请输入实际功率当前值" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="A相电流当前值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvalueca">
+              <a-input-number v-model="model.tagvalueca" placeholder="请输入A相电流当前值" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="A相电压当前值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvalueva">
+              <a-input-number v-model="model.tagvalueva" placeholder="请输入A相电压当前值" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="B相电流当前值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvaluecb">
+              <a-input-number v-model="model.tagvaluecb" placeholder="请输入B相电流当前值" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="B相电压当前值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvaluevb">
+              <a-input-number v-model="model.tagvaluevb" placeholder="请输入B相电压当前值" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="C相电流当前值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvaluecc">
+              <a-input-number v-model="model.tagvaluecc" placeholder="请输入C相电流当前值" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="C相电压当前值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvaluevc">
+              <a-input-number v-model="model.tagvaluevc" placeholder="请输入C相电压当前值" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="记录时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logtime">
+              <j-date placeholder="请选择记录时间" v-model="model.logtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="状态:0正常、1运行、2待机、3停机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
+              <a-input v-model="model.status" placeholder="请输入状态:0正常、1运行、2待机、3停机"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'EquipmentStatusForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/equipmentStatus/equipmentStatus/add",
+          edit: "/equipmentStatus/equipmentStatus/edit",
+          queryById: "/equipmentStatus/equipmentStatus/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/module_tpm/equipmentStatus/modules/EquipmentStatusModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <equipment-status-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></equipment-status-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import EquipmentStatusForm from './EquipmentStatusForm'
+
+  export default {
+    name: 'EquipmentStatusModal',
+    components: {
+      EquipmentStatusForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_tpm/equipmentStatus/modules/EquipmentStatusModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <equipment-status-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></equipment-status-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import EquipmentStatusForm from './EquipmentStatusForm'
+  export default {
+    name: 'EquipmentStatusModal',
+    components: {
+      EquipmentStatusForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>