<template>
|
<a-modal
|
:title="title"
|
:width="1250"
|
:visible="visible"
|
:confirmLoading="confirmLoading"
|
:okButtonProps="{ props: {disabled: disableSubmit} }"
|
@ok="handleOk"
|
@cancel="handleCancel"
|
cancelText="关闭"
|
>
|
<a-spin :spinning="confirmLoading">
|
<a-form :form="form">
|
<a-table
|
ref="table"
|
size="middle"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
@change="handleTableChange"
|
:customRow="clickThenCheck"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}"
|
>
|
|
</a-table>
|
|
<a-tabs defaultActiveKey="1">
|
<a-tab-pane key="1">
|
<span slot="tab">
|
<a-badge>精度参数 </a-badge>
|
</span>
|
<div
|
class="table-operator"
|
style="margin:8px"
|
>
|
<precision-parameters-detail-list ref="PrecisionParametersDetailList"> </precision-parameters-detail-list>
|
</div>
|
</a-tab-pane>
|
</a-tabs>
|
</a-form>
|
</a-spin>
|
|
</a-modal>
|
</template>
|
|
<script>
|
|
import { postAction, getAction } from '@/api/manage'
|
import JDate from '@/components/jeecg/JDate'
|
import Tooltip from 'ant-design-vue/es/tooltip'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import JEllipsis from '@/components/jeecg/JEllipsis'//引入过长裁剪
|
import PrecisionParametersDetailList from './PrecisionParametersDetailList'
|
import store from '@/store'
|
|
export default {
|
name: "PrecisionParametersTemplateList",
|
mixins: [JeecgListMixin],
|
components: {
|
JDate,
|
Tooltip,
|
JEllipsis,
|
PrecisionParametersDetailList,
|
},
|
data() {
|
return {
|
title: "精度参数模板",
|
visible: false,
|
model: {},
|
dataSource: [],
|
precisionParametersDataSource: [],
|
disableSubmit: false,
|
equipmentId: "",
|
type: "radio",
|
/* 分页参数 */
|
ipagination: {
|
current: 1,
|
pageSize: 5,
|
pageSizeOptions: ['5', '10', '20', '30'],
|
showTotal: (total, range) => {
|
return range[0] + "-" + range[1] + " 共" + total + "条"
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 6 },
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 18 },
|
},
|
confirmLoading: false,
|
form: this.$form.createForm(this),
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
align: 'center',
|
customRender: function (t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '设备精度模板编码',
|
align: 'center',
|
dataIndex: 'num',
|
},
|
{
|
title: '设备精度模板名称',
|
align: 'center',
|
dataIndex: 'name',
|
},
|
{
|
title: '创建人',
|
align: "center",
|
dataIndex: 'createBy'
|
},
|
{
|
title: '创建日期',
|
align: "center",
|
dataIndex: 'createTime'
|
},
|
{
|
title: '备注',
|
align: 'center',
|
dataIndex: 'remark',
|
},
|
],
|
url: {
|
add: '/eam/equipmentPrecisionParameters/add',
|
list: "/eam/precisionParametersTemplate/list",
|
},
|
}
|
},
|
|
mounted() {
|
this.$bus.$on('precisionParametersDataSource', (data) => {
|
this.precisionParametersDataSource = data
|
})
|
},
|
|
methods: {
|
|
searchQuery() {
|
this.loadData(1);
|
},
|
searchReset() {
|
this.loadData(1)
|
},
|
list() {
|
this.selectedRowKeys = [];
|
this.selectedRowRecord = [];
|
this.visible = true;
|
this.$bus.$emit('refreshChildPage', { precisionParametersTemplateId: "-1" });
|
this.loadData(1);
|
},
|
clickThenCheck(record) {
|
return {
|
on: {
|
click: (e) => {
|
this.selectedRowRecord = record;
|
this.onSelectChange(record.id.split(","), [record]);
|
this.$bus.$emit('refreshChildPage', { precisionParametersTemplateId: record.id });
|
}
|
}
|
};
|
},
|
onSelectChange(selectedRowKeys, selectedRows) {
|
this.selectedRowKeys = selectedRowKeys;
|
this.selectedRowRecord = selectedRows[0];
|
},
|
close() {
|
this.queryParam = {};
|
this.$emit('close');
|
this.visible = false;
|
},
|
handleOk() {
|
const that = this;
|
// 触发表单验证
|
if (that.selectedRowKeys.length > 0) {
|
if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") {
|
that.$emit('sendPrecisionParametersTemplateRecord', { record: that.selectedRowRecord });
|
that.close();
|
} else {
|
that.$message.error("请选择设备精度模板!")
|
}
|
} else {
|
that.$message.error("请选择设备精度模板!")
|
}
|
},
|
|
handleCancel() {
|
this.close();
|
},
|
|
// add() {
|
// let that = this
|
// this.form.resetFields();
|
// this.disableSubmit = false;
|
// this.visible = true;
|
// this.selectedRowRecord = [];
|
// this.selectedRowKeys = [];
|
// this.loadData(1);
|
// this.$bus.$emit('refreshChildPage', { precisionParametersTemplateId: "-1" });
|
// },
|
|
// close() {
|
// this.$emit('close');
|
// this.visible = false;
|
// },
|
// handleOk() {
|
// const that = this;
|
// if (this.precisionParametersDataSource.length == 0) {
|
// that.$message.warning("请选择参数模板!");
|
// return
|
// }
|
// // 触发表单验证
|
// this.form.validateFields((err, values) => {
|
// if (!err) {
|
// that.confirmLoading = true;
|
|
// let formData = Object.assign(this.model, values);
|
// formData.equipmentId = this.equipmentId
|
// formData.precisionParametersList = this.precisionParametersDataSource
|
// postAction(this.url.add, formData).then((res) => {
|
// if (res.success) {
|
// that.$message.success(res.message);
|
// that.$emit('ok');
|
// that.alterFlag = new Date();
|
// } else {
|
// that.$message.warning(res.message);
|
// }
|
// }).finally(() => {
|
// that.confirmLoading = false;
|
// that.close();
|
// })
|
// }
|
// })
|
// },
|
// handleCancel() {
|
// this.close()
|
// },
|
|
// clickThenCheck(record) {
|
// return {
|
// on: {
|
// click: (e) => {
|
// this.selectedRowRecord = record;
|
// this.selectedRowKeys = record.id.split(",");
|
// this.$bus.$emit('refreshChildPage', { precisionParametersTemplateId: record.id });
|
// }
|
// }
|
// };
|
// },
|
},
|
}
|
</script>
|
<style scoped>
|
.ant-btn {
|
padding: 0 10px;
|
margin-left: 3px;
|
}
|
|
.ant-form-item-control {
|
line-height: 0px;
|
}
|
|
.fontweight {
|
font-weight: bold;
|
}
|
|
/** 主表单行间距 */
|
.ant-form .ant-form-item {
|
margin-bottom: 10px;
|
}
|
|
/** Tab页面行间距 */
|
.ant-tabs-content .ant-form-item {
|
margin-bottom: 0px;
|
}
|
.ant-table-tbody .ant-table-row td {
|
padding-top: 10px;
|
padding-bottom: 10px;
|
}
|
|
.anty-row-operator button {
|
margin: 0 5px;
|
}
|
|
.ant-btn-danger {
|
background-color: #ffffff;
|
}
|
|
.ant-modal-cust-warp {
|
height: 100%;
|
}
|
|
.ant-modal-cust-warp .ant-modal-body {
|
height: calc(100% - 110px) !important;
|
overflow-y: auto;
|
}
|
|
.ant-modal-cust-warp .ant-modal-content {
|
height: 90% !important;
|
overflow-y: hidden;
|
}
|
|
.notshow {
|
display: none;
|
}
|
|
.frozenRowClass {
|
color: #c9c9c9;
|
}
|
.hight {
|
color: #f5222d;
|
}
|
.middle {
|
color: #fa8c16;
|
}
|
.low {
|
color: #52c41a;
|
}
|
.dataUnKnow {
|
color: #1890ff;
|
}
|
|
.frozenRowClass {
|
color: #c9c9c9;
|
}
|
</style>
|