<template>
  <el-dialog :visible.sync="visible" width="40%">
    <small-title slot="title" :no-padding="true">
      {{ this.dataForm.lineId + '·' + this.dataForm.equipmentName }}
    </small-title>

    <div class="content">
      <div class="visual-part">
        <base-table :table-props="tableProps"
          :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
          <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
            @clickBtn="handleClick" /> -->
        </base-table>
      </div>
    </div>
    <!-- <div slot="footer" class="dialog-footer">
      <el-button style="" @click="goback()">取消</el-button>
      <el-button  type="primary" @click="dataFormSubmit()">
        确定
      </el-button>
    </div> -->
  </el-dialog>
</template>

<script>
const tableProps = [

  {
    prop: 'paramName',
    label: '参数名称'
  },
  {
    prop: 'paramValue',
    label: '当前值',
    // filter: parseTime,
    // width: 160
  },
];

import { getParamMonitor } from '@/api/base/equipment';
// import { parseTime } from '../../mixins/code-filter';
import SmallTitle from './SmallTitle';
export default {
	components: { SmallTitle },
	data() {
		return {
      visible: false,
      tableProps,
      tableData:[],
      listQuery: {
        pageNo: 1,
        pageSize:100,
      },
			addOrUpdateVisible: false,
			dataForm: {
        equipmentId:undefined,
        equipmentName: undefined,
        lineId: undefined,
			},
		};
	},
	methods: {
    init(data) {
      console.log(data.paramMonitors,'data');

      this.dataForm.equipmentId = data.equipmentId || undefined;
      this.dataForm.equipmentName = data.equipmentName || undefined;
      this.dataForm.lineId = data.lineId || undefined;


			this.visible = true;
			this.$nextTick(() => {
        // this.$refs['dataForm'].resetFields();
        // getParamMonitor({
        //   equipmentId:this.dataForm.equipmentId
        // }).then((res) => {
        this.tableData = data.paramMonitors
        // })
			});
		}
	},
};
</script>

<style scoped>
.drawer >>> .el-drawer {
	border-radius: 8px 0 0 8px;
	display: flex;
	flex-direction: column;
}

.drawer >>> .el-form-item__label {
	padding: 0;
}

.drawer >>> .el-drawer__header {
	margin: 0;
	padding: 32px 32px 24px;
	border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
	flex: 1;
	height: 1px;
	display: flex;
	flex-direction: column;
}

.drawer >>> .content {
	padding: 30px 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
	/* height: 100%; */
}

.drawer >>> .visual-part {
	flex: 1 auto;
	max-height: 76vh;
	overflow: hidden;
	overflow-y: scroll;
	padding-right: 10px; /* 调整滚动条样式 */
}

.drawer >>> .el-form,
.drawer >>> .attr-list {
	padding: 0 16px;
}

.drawer-body__footer {
	display: flex;
	justify-content: flex-end;
	padding: 18px;
}
</style>
