<template>
	<div class="app-container">
		<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
			<el-form-item label="创建人名称" prop="createName">
				<el-input v-model="queryParams.createName" placeholder="请输入创建人名称" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="更新人名称" prop="updateName">
				<el-input v-model="queryParams.updateName" placeholder="请输入更新人名称" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="气体摩尔组成" prop="adMixture">
				<el-input v-model="queryParams.adMixture" placeholder="请输入气体摩尔组成" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="气体体积组成" prop="adMixtureV">
				<el-input v-model="queryParams.adMixtureV" placeholder="请输入气体体积组成" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="气体质量组成" prop="adMixtureD">
				<el-input v-model="queryParams.adMixtureD" placeholder="请输入气体质量组成" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="参比条件" prop="dCbtj">
				<el-select v-model="queryParams.dCbtj" placeholder="请选择参比条件" clearable>
					<el-option v-for="dict in ngtools_cbtj" :key="dict.value" :label="dict.label" :value="dict.value" />
				</el-select>
			</el-form-item>
			<el-form-item label="参比压力" prop="dPb">
				<el-input v-model="queryParams.dPb" placeholder="请输入参比压力" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="参比温度" prop="dTb">
				<el-input v-model="queryParams.dTb" placeholder="请输入参比温度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="绝对压力" prop="dPf">
				<el-input v-model="queryParams.dPf" placeholder="请输入绝对压力" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="工况温度" prop="dTf">
				<el-input v-model="queryParams.dTf" placeholder="请输入工况温度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="分子量" prop="dMrx">
				<el-input v-model="queryParams.dMrx" placeholder="请输入分子量" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="标况压缩因子" prop="dZb">
				<el-input v-model="queryParams.dZb" placeholder="请输入标况压缩因子" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="工况压缩因子" prop="dZf">
				<el-input v-model="queryParams.dZf" placeholder="请输入工况压缩因子" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="超压缩系数" prop="dFpv">
				<el-input v-model="queryParams.dFpv" placeholder="请输入超压缩系数" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="标况摩尔密度" prop="dDb">
				<el-input v-model="queryParams.dDb" placeholder="请输入标况摩尔密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="工况摩尔密度" prop="dDf">
				<el-input v-model="queryParams.dDf" placeholder="请输入工况摩尔密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="标况质量密度" prop="dRhob">
				<el-input v-model="queryParams.dRhob" placeholder="请输入标况质量密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="工况质量密度" prop="dRhof">
				<el-input v-model="queryParams.dRhof" placeholder="请输入工况质量密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="理想气体的相对密度" prop="drdIdeal">
				<el-input v-model="queryParams.drdIdeal" placeholder="请输入理想气体的相对密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="真实气体的相对密度" prop="drdReal">
				<el-input v-model="queryParams.drdReal" placeholder="请输入真实气体的相对密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="理想气体的比焓" prop="dHo">
				<el-input v-model="queryParams.dHo" placeholder="请输入理想气体的比焓" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="真实气体的焓" prop="dH">
				<el-input v-model="queryParams.dH" placeholder="请输入真实气体的焓" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="真实气体的熵" prop="dS">
				<el-input v-model="queryParams.dS" placeholder="请输入真实气体的熵" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="理想气体定压热容" prop="dCpi">
				<el-input v-model="queryParams.dCpi" placeholder="请输入理想气体定压热容" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="定压热容" prop="dCp">
				<el-input v-model="queryParams.dCp" placeholder="请输入定压热容" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="定容积热容" prop="dCv">
				<el-input v-model="queryParams.dCv" placeholder="请输入定容积热容" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="比热比" prop="dk">
				<el-input v-model="queryParams.dk" placeholder="请输入比热比" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="等熵指数" prop="dKappa">
				<el-input v-model="queryParams.dKappa" placeholder="请输入等熵指数" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="声速" prop="dSOS">
				<el-input v-model="queryParams.dSOS" placeholder="请输入声速" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="临界流函数" prop="dCstar">
				<el-input v-model="queryParams.dCstar" placeholder="请输入临界流函数" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="摩尔高位发热量" prop="dHhvMol">
				<el-input v-model="queryParams.dHhvMol" placeholder="请输入摩尔高位发热量" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="摩尔低位发热量" prop="dLhvMol">
				<el-input v-model="queryParams.dLhvMol" placeholder="请输入摩尔低位发热量" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="体积高位发热量" prop="dHhvv">
				<el-input v-model="queryParams.dHhvv" placeholder="请输入体积高位发热量" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="体积低位发热量" prop="dLhvv">
				<el-input v-model="queryParams.dLhvv" placeholder="请输入体积低位发热量" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="质量高位发热量" prop="dHhvm">
				<el-input v-model="queryParams.dHhvm" placeholder="请输入质量高位发热量" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="质量地位发热量" prop="dLhvm">
				<el-input v-model="queryParams.dLhvm" placeholder="请输入质量地位发热量" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="标况压缩因子" prop="dZb11062">
				<el-input v-model="queryParams.dZb11062" placeholder="请输入标况压缩因子" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="标况质量密度" prop="dRhob11062">
				<el-input v-model="queryParams.dRhob11062" placeholder="请输入标况质量密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="工况质量密度" prop="dRhof11062">
				<el-input v-model="queryParams.dRhof11062" placeholder="请输入工况质量密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="理想气体的相对密度" prop="drdIdeal11062">
				<el-input v-model="queryParams.drdIdeal11062" placeholder="请输入理想气体的相对密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="真实气体的相对密度" prop="drdReal11062">
				<el-input v-model="queryParams.drdReal11062" placeholder="请输入真实气体的相对密度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="真实气体的沃泊指数" prop="dWobbeIndex">
				<el-input v-model="queryParams.dWobbeIndex" placeholder="请输入真实气体的沃泊指数" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="临界压力" prop="dPc">
				<el-input v-model="queryParams.dPc" placeholder="请输入临界压力" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="临界温度" prop="dTC">
				<el-input v-model="queryParams.dTC" placeholder="请输入临界温度" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="爆炸上限" prop="dBzsx">
				<el-input v-model="queryParams.dBzsx" placeholder="请输入爆炸上限" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="爆炸下限" prop="dBzxx">
				<el-input v-model="queryParams.dBzxx" placeholder="请输入爆炸下限" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="总炭含量(kg/m3)" prop="dTotalC">
				<el-input v-model="queryParams.dTotalC" placeholder="请输入总炭含量(kg/m3)" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="C2组分含量(kg/m3)" prop="dC2">
				<el-input v-model="queryParams.dC2" placeholder="请输入C2组分含量(kg/m3)" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="C2以上组分含量(kg/m3)" prop="dC2j">
				<el-input v-model="queryParams.dC2j" placeholder="请输入C2以上组分含量(kg/m3)" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="C3以上组分含量(kg/m3)" prop="dC3j">
				<el-input v-model="queryParams.dC3j" placeholder="请输入C3以上组分含量(kg/m3)" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="C4以上组分含量(kg/m3)" prop="dC4j">
				<el-input v-model="queryParams.dC4j" placeholder="请输入C4以上组分含量(kg/m3)" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="C5以上组分含量(kg/m3)" prop="dC5j">
				<el-input v-model="queryParams.dC5j" placeholder="请输入C5以上组分含量(kg/m3)" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="C6以上组分含量(kg/m3)" prop="dC6j">
				<el-input v-model="queryParams.dC6j" placeholder="请输入C6以上组分含量(kg/m3)" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="C3C4组分含量(kg/m3)" prop="dC3C4">
				<el-input v-model="queryParams.dC3C4" placeholder="请输入C3C4组分含量(kg/m3)" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item>
				<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
				<el-button icon="Refresh" @click="resetQuery">重置</el-button>
			</el-form-item>
		</el-form>

		<el-row :gutter="10" class="mb8">
			<el-col :span="1.5">
				<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['ngtools:ngpar:add']">新增</el-button>
			</el-col>
			<el-col :span="1.5">
				<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['ngtools:ngpar:edit']">修改</el-button>
			</el-col>
			<el-col :span="1.5">
				<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['ngtools:ngpar:remove']">删除</el-button>
			</el-col>
			<el-col :span="1.5">
				<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['ngtools:ngpar:export']">导出</el-button>
			</el-col>
			<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
		</el-row>

		<el-table v-loading="loading" :data="ngparList" @selection-change="handleSelectionChange">
			<el-table-column type="selection" width="55" align="center" />
			<el-table-column label="ID" align="center" prop="id" />
			<el-table-column label="创建人名称" align="center" prop="createName" />
			<el-table-column label="更新人名称" align="center" prop="updateName" />
			<el-table-column label="气体摩尔组成" align="center" prop="adMixture" />
			<el-table-column label="气体体积组成" align="center" prop="adMixtureV" />
			<el-table-column label="气体质量组成" align="center" prop="adMixtureD" />
			<el-table-column label="参比条件" align="center" prop="dCbtj">
				<template #default="scope">
					<dict-tag :options="ngtools_cbtj" :value="scope.row.dCbtj" />
				</template>
			</el-table-column>
			<el-table-column label="参比压力" align="center" prop="dPb" />
			<el-table-column label="参比温度" align="center" prop="dTb" />
			<el-table-column label="绝对压力" align="center" prop="dPf" />
			<el-table-column label="工况温度" align="center" prop="dTf" />
			<el-table-column label="分子量" align="center" prop="dMrx" />
			<el-table-column label="标况压缩因子" align="center" prop="dZb" />
			<el-table-column label="工况压缩因子" align="center" prop="dZf" />
			<el-table-column label="超压缩系数" align="center" prop="dFpv" />
			<el-table-column label="标况摩尔密度" align="center" prop="dDb" />
			<el-table-column label="工况摩尔密度" align="center" prop="dDf" />
			<el-table-column label="标况质量密度" align="center" prop="dRhob" />
			<el-table-column label="工况质量密度" align="center" prop="dRhof" />
			<el-table-column label="理想气体的相对密度" align="center" prop="drdIdeal" />
			<el-table-column label="真实气体的相对密度" align="center" prop="drdReal" />
			<el-table-column label="理想气体的比焓" align="center" prop="dHo" />
			<el-table-column label="真实气体的焓" align="center" prop="dH" />
			<el-table-column label="真实气体的熵" align="center" prop="dS" />
			<el-table-column label="理想气体定压热容" align="center" prop="dCpi" />
			<el-table-column label="定压热容" align="center" prop="dCp" />
			<el-table-column label="定容积热容" align="center" prop="dCv" />
			<el-table-column label="比热比" align="center" prop="dk" />
			<el-table-column label="等熵指数" align="center" prop="dKappa" />
			<el-table-column label="声速" align="center" prop="dSOS" />
			<el-table-column label="临界流函数" align="center" prop="dCstar" />
			<el-table-column label="摩尔高位发热量" align="center" prop="dHhvMol" />
			<el-table-column label="摩尔低位发热量" align="center" prop="dLhvMol" />
			<el-table-column label="体积高位发热量" align="center" prop="dHhvv" />
			<el-table-column label="体积低位发热量" align="center" prop="dLhvv" />
			<el-table-column label="质量高位发热量" align="center" prop="dHhvm" />
			<el-table-column label="质量地位发热量" align="center" prop="dLhvm" />
			<el-table-column label="标况压缩因子" align="center" prop="dZb11062" />
			<el-table-column label="标况质量密度" align="center" prop="dRhob11062" />
			<el-table-column label="工况质量密度" align="center" prop="dRhof11062" />
			<el-table-column label="理想气体的相对密度" align="center" prop="drdIdeal11062" />
			<el-table-column label="真实气体的相对密度" align="center" prop="drdReal11062" />
			<el-table-column label="真实气体的沃泊指数" align="center" prop="dWobbeIndex" />
			<el-table-column label="临界压力" align="center" prop="dPc" />
			<el-table-column label="临界温度" align="center" prop="dTC" />
			<el-table-column label="爆炸上限" align="center" prop="dBzsx" />
			<el-table-column label="爆炸下限" align="center" prop="dBzxx" />
			<el-table-column label="总炭含量(kg/m3)" align="center" prop="dTotalC" />
			<el-table-column label="C2组分含量(kg/m3)" align="center" prop="dC2" />
			<el-table-column label="C2以上组分含量(kg/m3)" align="center" prop="dC2j" />
			<el-table-column label="C3以上组分含量(kg/m3)" align="center" prop="dC3j" />
			<el-table-column label="C4以上组分含量(kg/m3)" align="center" prop="dC4j" />
			<el-table-column label="C5以上组分含量(kg/m3)" align="center" prop="dC5j" />
			<el-table-column label="C6以上组分含量(kg/m3)" align="center" prop="dC6j" />
			<el-table-column label="C3C4组分含量(kg/m3)" align="center" prop="dC3C4" />
			<el-table-column label="取样编号" align="center" prop="sampleno" />
			<el-table-column label="仪表编号" align="center" prop="meterno" />
			<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
				<template #default="scope">
					<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ngtools:ngpar:edit']">修改</el-button>
					<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['ngtools:ngpar:remove']">删除</el-button>
				</template>
			</el-table-column>
		</el-table>

		<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />

		<!-- 添加或修改天然气物性参数对话框 -->
		<el-dialog :title="title" v-model="open" width="500px" append-to-body>
			<el-form ref="ngparRef" :model="form" :rules="rules" label-width="80px">
				<el-form-item label="创建人名称" prop="createName">
					<el-input v-model="form.createName" placeholder="请输入创建人名称" />
				</el-form-item>
				<el-form-item label="更新人名称" prop="updateName">
					<el-input v-model="form.updateName" placeholder="请输入更新人名称" />
				</el-form-item>
				<el-form-item label="气体摩尔组成" prop="adMixture">
					<el-input v-model="form.adMixture" placeholder="请输入气体摩尔组成" />
				</el-form-item>
				<el-form-item label="气体体积组成" prop="adMixtureV">
					<el-input v-model="form.adMixtureV" placeholder="请输入气体体积组成" />
				</el-form-item>
				<el-form-item label="气体质量组成" prop="adMixtureD">
					<el-input v-model="form.adMixtureD" placeholder="请输入气体质量组成" />
				</el-form-item>
				<el-form-item label="参比条件" prop="dCbtj">
					<el-select v-model="form.dCbtj" placeholder="请选择参比条件">
						<el-option v-for="dict in ngtools_cbtj" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="参比压力" prop="dPb">
					<el-input v-model="form.dPb" placeholder="请输入参比压力" />
				</el-form-item>
				<el-form-item label="参比温度" prop="dTb">
					<el-input v-model="form.dTb" placeholder="请输入参比温度" />
				</el-form-item>
				<el-form-item label="绝对压力" prop="dPf">
					<el-input v-model="form.dPf" placeholder="请输入绝对压力" />
				</el-form-item>
				<el-form-item label="工况温度" prop="dTf">
					<el-input v-model="form.dTf" placeholder="请输入工况温度" />
				</el-form-item>
				<el-form-item label="分子量" prop="dMrx">
					<el-input v-model="form.dMrx" placeholder="请输入分子量" />
				</el-form-item>
				<el-form-item label="标况压缩因子" prop="dZb">
					<el-input v-model="form.dZb" placeholder="请输入标况压缩因子" />
				</el-form-item>
				<el-form-item label="工况压缩因子" prop="dZf">
					<el-input v-model="form.dZf" placeholder="请输入工况压缩因子" />
				</el-form-item>
				<el-form-item label="超压缩系数" prop="dFpv">
					<el-input v-model="form.dFpv" placeholder="请输入超压缩系数" />
				</el-form-item>
				<el-form-item label="标况摩尔密度" prop="dDb">
					<el-input v-model="form.dDb" placeholder="请输入标况摩尔密度" />
				</el-form-item>
				<el-form-item label="工况摩尔密度" prop="dDf">
					<el-input v-model="form.dDf" placeholder="请输入工况摩尔密度" />
				</el-form-item>
				<el-form-item label="标况质量密度" prop="dRhob">
					<el-input v-model="form.dRhob" placeholder="请输入标况质量密度" />
				</el-form-item>
				<el-form-item label="工况质量密度" prop="dRhof">
					<el-input v-model="form.dRhof" placeholder="请输入工况质量密度" />
				</el-form-item>
				<el-form-item label="理想气体的相对密度" prop="drdIdeal">
					<el-input v-model="form.drdIdeal" placeholder="请输入理想气体的相对密度" />
				</el-form-item>
				<el-form-item label="真实气体的相对密度" prop="drdReal">
					<el-input v-model="form.drdReal" placeholder="请输入真实气体的相对密度" />
				</el-form-item>
				<el-form-item label="理想气体的比焓" prop="dHo">
					<el-input v-model="form.dHo" placeholder="请输入理想气体的比焓" />
				</el-form-item>
				<el-form-item label="真实气体的焓" prop="dH">
					<el-input v-model="form.dH" placeholder="请输入真实气体的焓" />
				</el-form-item>
				<el-form-item label="真实气体的熵" prop="dS">
					<el-input v-model="form.dS" placeholder="请输入真实气体的熵" />
				</el-form-item>
				<el-form-item label="理想气体定压热容" prop="dCpi">
					<el-input v-model="form.dCpi" placeholder="请输入理想气体定压热容" />
				</el-form-item>
				<el-form-item label="定压热容" prop="dCp">
					<el-input v-model="form.dCp" placeholder="请输入定压热容" />
				</el-form-item>
				<el-form-item label="定容积热容" prop="dCv">
					<el-input v-model="form.dCv" placeholder="请输入定容积热容" />
				</el-form-item>
				<el-form-item label="比热比" prop="dk">
					<el-input v-model="form.dk" placeholder="请输入比热比" />
				</el-form-item>
				<el-form-item label="等熵指数" prop="dKappa">
					<el-input v-model="form.dKappa" placeholder="请输入等熵指数" />
				</el-form-item>
				<el-form-item label="声速" prop="dSOS">
					<el-input v-model="form.dSOS" placeholder="请输入声速" />
				</el-form-item>
				<el-form-item label="临界流函数" prop="dCstar">
					<el-input v-model="form.dCstar" placeholder="请输入临界流函数" />
				</el-form-item>
				<el-form-item label="摩尔高位发热量" prop="dHhvMol">
					<el-input v-model="form.dHhvMol" placeholder="请输入摩尔高位发热量" />
				</el-form-item>
				<el-form-item label="摩尔低位发热量" prop="dLhvMol">
					<el-input v-model="form.dLhvMol" placeholder="请输入摩尔低位发热量" />
				</el-form-item>
				<el-form-item label="体积高位发热量" prop="dHhvv">
					<el-input v-model="form.dHhvv" placeholder="请输入体积高位发热量" />
				</el-form-item>
				<el-form-item label="体积低位发热量" prop="dLhvv">
					<el-input v-model="form.dLhvv" placeholder="请输入体积低位发热量" />
				</el-form-item>
				<el-form-item label="质量高位发热量" prop="dHhvm">
					<el-input v-model="form.dHhvm" placeholder="请输入质量高位发热量" />
				</el-form-item>
				<el-form-item label="质量地位发热量" prop="dLhvm">
					<el-input v-model="form.dLhvm" placeholder="请输入质量地位发热量" />
				</el-form-item>
				<el-form-item label="标况压缩因子" prop="dZb11062">
					<el-input v-model="form.dZb11062" placeholder="请输入标况压缩因子" />
				</el-form-item>
				<el-form-item label="标况质量密度" prop="dRhob11062">
					<el-input v-model="form.dRhob11062" placeholder="请输入标况质量密度" />
				</el-form-item>
				<el-form-item label="工况质量密度" prop="dRhof11062">
					<el-input v-model="form.dRhof11062" placeholder="请输入工况质量密度" />
				</el-form-item>
				<el-form-item label="理想气体的相对密度" prop="drdIdeal11062">
					<el-input v-model="form.drdIdeal11062" placeholder="请输入理想气体的相对密度" />
				</el-form-item>
				<el-form-item label="真实气体的相对密度" prop="drdReal11062">
					<el-input v-model="form.drdReal11062" placeholder="请输入真实气体的相对密度" />
				</el-form-item>
				<el-form-item label="真实气体的沃泊指数" prop="dWobbeIndex">
					<el-input v-model="form.dWobbeIndex" placeholder="请输入真实气体的沃泊指数" />
				</el-form-item>
				<el-form-item label="临界压力" prop="dPc">
					<el-input v-model="form.dPc" placeholder="请输入临界压力" />
				</el-form-item>
				<el-form-item label="临界温度" prop="dTC">
					<el-input v-model="form.dTC" placeholder="请输入临界温度" />
				</el-form-item>
				<el-form-item label="爆炸上限" prop="dBzsx">
					<el-input v-model="form.dBzsx" placeholder="请输入爆炸上限" />
				</el-form-item>
				<el-form-item label="爆炸下限" prop="dBzxx">
					<el-input v-model="form.dBzxx" placeholder="请输入爆炸下限" />
				</el-form-item>
				<el-form-item label="总炭含量(kg/m3)" prop="dTotalC">
					<el-input v-model="form.dTotalC" placeholder="请输入总炭含量(kg/m3)" />
				</el-form-item>
				<el-form-item label="C2组分含量(kg/m3)" prop="dC2">
					<el-input v-model="form.dC2" placeholder="请输入C2组分含量(kg/m3)" />
				</el-form-item>
				<el-form-item label="C2以上组分含量(kg/m3)" prop="dC2j">
					<el-input v-model="form.dC2j" placeholder="请输入C2以上组分含量(kg/m3)" />
				</el-form-item>
				<el-form-item label="C3以上组分含量(kg/m3)" prop="dC3j">
					<el-input v-model="form.dC3j" placeholder="请输入C3以上组分含量(kg/m3)" />
				</el-form-item>
				<el-form-item label="C4以上组分含量(kg/m3)" prop="dC4j">
					<el-input v-model="form.dC4j" placeholder="请输入C4以上组分含量(kg/m3)" />
				</el-form-item>
				<el-form-item label="C5以上组分含量(kg/m3)" prop="dC5j">
					<el-input v-model="form.dC5j" placeholder="请输入C5以上组分含量(kg/m3)" />
				</el-form-item>
				<el-form-item label="C6以上组分含量(kg/m3)" prop="dC6j">
					<el-input v-model="form.dC6j" placeholder="请输入C6以上组分含量(kg/m3)" />
				</el-form-item>
				<el-form-item label="C3C4组分含量(kg/m3)" prop="dC3C4">
					<el-input v-model="form.dC3C4" placeholder="请输入C3C4组分含量(kg/m3)" />
				</el-form-item>
			</el-form>
			<template #footer>
				<div class="dialog-footer">
					<el-button type="primary" @click="submitForm">确 定</el-button>
					<el-button @click="cancel">取 消</el-button>
				</div>
			</template>
		</el-dialog>
	</div>
</template>

<script setup name="Ngpar">
import { listNgpar, getNgpar, delNgpar, addNgpar, updateNgpar } from '@/api/ngtools/ngpar';

const { proxy } = getCurrentInstance();
const { ngtools_cbtj } = proxy.useDict('ngtools_cbtj');

const ngparList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref('');

const data = reactive({
	form: {},
	queryParams: {
		pageNum: 1,
		pageSize: 10,
		createName: null,
		updateName: null,
		adMixture: null,
		adMixtureV: null,
		adMixtureD: null,
		dCbtj: null,
		dPb: null,
		dTb: null,
		dPf: null,
		dTf: null,
		dMrx: null,
		dZb: null,
		dZf: null,
		dFpv: null,
		dDb: null,
		dDf: null,
		dRhob: null,
		dRhof: null,
		drdIdeal: null,
		drdReal: null,
		dHo: null,
		dH: null,
		dS: null,
		dCpi: null,
		dCp: null,
		dCv: null,
		dk: null,
		dKappa: null,
		dSOS: null,
		dCstar: null,
		dHhvMol: null,
		dLhvMol: null,
		dHhvv: null,
		dLhvv: null,
		dHhvm: null,
		dLhvm: null,
		dZb11062: null,
		dRhob11062: null,
		dRhof11062: null,
		drdIdeal11062: null,
		drdReal11062: null,
		dWobbeIndex: null,
		dPc: null,
		dTC: null,
		dBzsx: null,
		dBzxx: null,
		dTotalC: null,
		dC2: null,
		dC2j: null,
		dC3j: null,
		dC4j: null,
		dC5j: null,
		dC6j: null,
		dC3C4: null,
		sampleno: null,
		meterno: null
	},
	rules: {}
});

const { queryParams, form, rules } = toRefs(data);

/** 查询天然气物性参数列表 */
function getList() {
	loading.value = true;
	listNgpar(queryParams.value).then((response) => {
		ngparList.value = response.rows;
		total.value = response.total;
		loading.value = false;
	});
}

// 取消按钮
function cancel() {
	open.value = false;
	reset();
}

// 表单重置
function reset() {
	form.value = {
		id: null,
		createName: null,
		createBy: null,
		createTime: null,
		updateName: null,
		updateBy: null,
		updateTime: null,
		adMixture: null,
		adMixtureV: null,
		adMixtureD: null,
		dCbtj: null,
		dPb: null,
		dTb: null,
		dPf: null,
		dTf: null,
		dMrx: null,
		dZb: null,
		dZf: null,
		dFpv: null,
		dDb: null,
		dDf: null,
		dRhob: null,
		dRhof: null,
		drdIdeal: null,
		drdReal: null,
		dHo: null,
		dH: null,
		dS: null,
		dCpi: null,
		dCp: null,
		dCv: null,
		dk: null,
		dKappa: null,
		dSOS: null,
		dCstar: null,
		dHhvMol: null,
		dLhvMol: null,
		dHhvv: null,
		dLhvv: null,
		dHhvm: null,
		dLhvm: null,
		dZb11062: null,
		dRhob11062: null,
		dRhof11062: null,
		drdIdeal11062: null,
		drdReal11062: null,
		dWobbeIndex: null,
		dPc: null,
		dTC: null,
		dBzsx: null,
		dBzxx: null,
		dTotalC: null,
		dC2: null,
		dC2j: null,
		dC3j: null,
		dC4j: null,
		dC5j: null,
		dC6j: null,
		dC3C4: null,
		sampleno: null,
		meterno: null
	};
	proxy.resetForm('ngparRef');
}

/** 搜索按钮操作 */
function handleQuery() {
	queryParams.value.pageNum = 1;
	getList();
}

/** 重置按钮操作 */
function resetQuery() {
	proxy.resetForm('queryRef');
	handleQuery();
}

// 多选框选中数据
function handleSelectionChange(selection) {
	ids.value = selection.map((item) => item.id);
	single.value = selection.length != 1;
	multiple.value = !selection.length;
}

/** 新增按钮操作 */
function handleAdd() {
	reset();
	open.value = true;
	title.value = '添加天然气物性参数';
}

/** 修改按钮操作 */
function handleUpdate(row) {
	reset();
	const _id = row.id || ids.value;
	getNgpar(_id).then((response) => {
		form.value = response.data;
		open.value = true;
		title.value = '修改天然气物性参数';
	});
}

/** 提交按钮 */
function submitForm() {
	proxy.$refs['ngparRef'].validate((valid) => {
		if (valid) {
			if (form.value.id != null) {
				updateNgpar(form.value).then((response) => {
					proxy.$modal.msgSuccess('修改成功');
					open.value = false;
					getList();
				});
			} else {
				addNgpar(form.value).then((response) => {
					proxy.$modal.msgSuccess('新增成功');
					open.value = false;
					getList();
				});
			}
		}
	});
}

/** 删除按钮操作 */
function handleDelete(row) {
	const _ids = row.id || ids.value;
	proxy.$modal
		.confirm('是否确认删除天然气物性参数编号为"' + _ids + '"的数据项？')
		.then(function () {
			return delNgpar(_ids);
		})
		.then(() => {
			getList();
			proxy.$modal.msgSuccess('删除成功');
		})
		.catch(() => {});
}

/** 导出按钮操作 */
function handleExport() {
	proxy.download(
		'ngtools/ngpar/export',
		{
			...queryParams.value
		},
		`ngpar_${new Date().getTime()}.xlsx`
	);
}

getList();
</script>
