|
|
@@ -47,19 +47,19 @@
|
|
|
{{ form.fangAnLeiXing || '' }}
|
|
|
</div>
|
|
|
<experimental-desc
|
|
|
- :step="form.step || ''"
|
|
|
- :criterion="form.criterion || ''"
|
|
|
- :formulas="form.formulas || []"
|
|
|
- :references="form.references || []"
|
|
|
+ :step="form.configDetailPo.step || ''"
|
|
|
+ :criterion="form.configDetailPo.criterion || ''"
|
|
|
+ :formulas="form.configDetailPo.formulas || []"
|
|
|
+ :references="form.configDetailPo.references || []"
|
|
|
:readonly="true"
|
|
|
/>
|
|
|
<basic-info :info="form" :readonly="true" />
|
|
|
<reagent-info :info="form.reagentPoList" :readonly="true" />
|
|
|
<param-info
|
|
|
- v-if="$utils.isNotEmpty(form.params)"
|
|
|
+ v-if="form.shiYanCanShu"
|
|
|
:form-id="formId"
|
|
|
:info="form.shiYanCanShu"
|
|
|
- :config-data="form.params || []"
|
|
|
+ :config-data="form.configDetailPo.params || []"
|
|
|
:readonly="true"
|
|
|
/>
|
|
|
<experimental-data
|
|
|
@@ -87,7 +87,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getExperimentalTree, getExperimental } from '@/api/business/pv'
|
|
|
+import { getExperimentalTree, getExperimental,getConfigDetail } from '@/api/business/pv'
|
|
|
import ExperimentalDesc from './components/experimental-desc'
|
|
|
import BasicInfo from './components/basic-info'
|
|
|
import ReagentInfo from './components/reagent-info'
|
|
|
@@ -117,10 +117,12 @@ export default {
|
|
|
treeKey: 0,
|
|
|
form: {
|
|
|
methodName: '',
|
|
|
- step: '',
|
|
|
- criterion: '',
|
|
|
- formulas: [],
|
|
|
- references: [],
|
|
|
+ configDetailPo: {
|
|
|
+ step: '',
|
|
|
+ criterion: '',
|
|
|
+ formulas: [],
|
|
|
+ references: [],
|
|
|
+ },
|
|
|
reagentPoList: [],
|
|
|
params: [],
|
|
|
shiYanCanShu: {},
|
|
|
@@ -191,23 +193,92 @@ export default {
|
|
|
},
|
|
|
|
|
|
async handleNodeClick(node) {
|
|
|
- if (node.level === 5) { // 只有第五层是叶子节点,有表单数据
|
|
|
+ if (node.level === 5) {
|
|
|
try {
|
|
|
const response = await getExperimental({ id: node.dataId })
|
|
|
- this.form = response.data
|
|
|
+ let formData = response.data
|
|
|
+
|
|
|
+ // 确保 configDetailPo 存在
|
|
|
+ if (!formData.configDetailPo) {
|
|
|
+ formData.configDetailPo = {
|
|
|
+ step: '',
|
|
|
+ criterion: '',
|
|
|
+ formulas: [],
|
|
|
+ references: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ formData.shiYanCanShu = formData.shiYanCanShu
|
|
|
+ ? JSON.parse(formData.shiYanCanShu)
|
|
|
+ : {}
|
|
|
+ formData.shiYanShuJu = formData.shiYanShuJu
|
|
|
+ ? JSON.parse(formData.shiYanShuJu)
|
|
|
+ : []
|
|
|
+ formData.jiSuanJieGuo = formData.jiSuanJieGuo
|
|
|
+ ? JSON.parse(formData.jiSuanJieGuo)
|
|
|
+ : {}
|
|
|
+ // 处理 formulas
|
|
|
+ if (formData.configDetailPo.formulas && typeof formData.configDetailPo.formulas === 'string') {
|
|
|
+ formData.configDetailPo.formulas = this.$utils.isNotEmpty(formData.configDetailPo.formulas)
|
|
|
+ ? JSON.parse(formData.configDetailPo.formulas)
|
|
|
+ : []
|
|
|
+ } else if (!formData.configDetailPo.formulas) {
|
|
|
+ formData.configDetailPo.formulas = []
|
|
|
+ }
|
|
|
+ // 处理 params
|
|
|
+ if (formData.configDetailPo.params && typeof formData.configDetailPo.params === 'string') {
|
|
|
+ formData.configDetailPo.params = this.$utils.isNotEmpty(formData.configDetailPo.params)
|
|
|
+ ? JSON.parse(formData.configDetailPo.params)
|
|
|
+ : []
|
|
|
+ } else if (!formData.configDetailPo.params) {
|
|
|
+ formData.configDetailPo.params = []
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form = formData
|
|
|
+ // 获取配置详情
|
|
|
+ if (formData.zhiBiaoId) {
|
|
|
+ await this.getConfigData({ targetId: formData.zhiBiaoId, methodId: formData.fangFaId })
|
|
|
+ }
|
|
|
this.showForm = true
|
|
|
} catch (error) {
|
|
|
- console.error('Failed to fetch form data:', error)
|
|
|
+ console.error('请求失败', error)
|
|
|
this.showForm = false
|
|
|
}
|
|
|
} else {
|
|
|
this.showForm = false
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ async getConfigData({ targetId, methodId }) {
|
|
|
+ await getConfigDetail({ id: targetId }).then((res) => {
|
|
|
+ const {
|
|
|
+ target,
|
|
|
+ targetKey,
|
|
|
+ experimentalConfigDetailPoList: methods
|
|
|
+ } = res.data || {}
|
|
|
+ const method = methods.find((i) => i.id === methodId) || {}
|
|
|
+ const configData = {
|
|
|
+ target,
|
|
|
+ targetKey,
|
|
|
+ ...method,
|
|
|
+ params: this.$utils.isNotEmpty(method.params)
|
|
|
+ ? JSON.parse(method.params)
|
|
|
+ : [],
|
|
|
+ formulas: this.$utils.isNotEmpty(method.formulas)
|
|
|
+ ? JSON.parse(method.formulas)
|
|
|
+ : []
|
|
|
+ }
|
|
|
+ // 将配置数据合并到form.configDetailPo中
|
|
|
+ // this.form.configDetailPo = { ...this.form.configDetailPo, ...configData }
|
|
|
+ this.$set(this.form, 'configDetailPo', {
|
|
|
+ ...this.form.configDetailPo,
|
|
|
+ ...configData
|
|
|
+ })
|
|
|
+ console.log('数据11111111111111',this.form)
|
|
|
+ })
|
|
|
+ },
|
|
|
getpdf() {
|
|
|
const dom = document.querySelector('#pdfDom')
|
|
|
- const title = this.form.fangAnLeiXing || '表单标题'
|
|
|
+ const title = this.form.fangAnLeiXing || '性能验证报告'
|
|
|
|
|
|
// 隐藏标题和导出按钮
|
|
|
const headerElement = document.getElementById('pdfHeader')
|