|
|
@ -14,19 +14,20 @@ |
|
|
<!-- 观察情况 --> |
|
|
<!-- 观察情况 --> |
|
|
<div class="template-form-item"> |
|
|
<div class="template-form-item"> |
|
|
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps" |
|
|
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps" |
|
|
:formConfig="stepFormConfig" @blur="onHandleBlur" |
|
|
|
|
|
:formData="formData" @onRegentSubmit="onRegentSubmit" /> |
|
|
|
|
|
|
|
|
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" |
|
|
|
|
|
@onRegentSubmit="onRegentSubmit" /> |
|
|
<div style="color:#999;font-size:14px;"> |
|
|
<div style="color:#999;font-size:14px;"> |
|
|
畸变类型以代号填写:断片(b)、裂隙(g)、互换及射体(t)、环状染色体(r)、多倍体(p)、双着丝点染色体(d)、内复制(e)、染色体碎化(z)、缺失(l)、粘着(s)、微小体(m)。 |
|
|
畸变类型以代号填写:断片(b)、裂隙(g)、互换及射体(t)、环状染色体(r)、多倍体(p)、双着丝点染色体(d)、内复制(e)、染色体碎化(z)、缺失(l)、粘着(s)、微小体(m)。 |
|
|
</div> |
|
|
</div> |
|
|
<CustomTable :ref="`tableRef`" :columns="tableColumns" :formData="tableFormData" |
|
|
<CustomTable :ref="`tableRef`" :columns="tableColumns" :formData="tableFormData" |
|
|
operationWidth="120px" :prefixKey="`table`" fieldItemLabel="template.dl.dl022.jbqk" |
|
|
operationWidth="120px" :prefixKey="`table`" fieldItemLabel="template.dl.dl022.jbqk" |
|
|
@onAddRow = "onAddRow" @blur="handleClickButton" |
|
|
|
|
|
:showAddRow="fillType === 'actFill'" :showOperation="fillType === 'actFill'"> |
|
|
|
|
|
|
|
|
@onAddRow="onAddRow" @blur="handleClickButton" :showAddRow="fillType === 'actFill'" |
|
|
|
|
|
:showOperation="fillType === 'actFill'"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
@deleteRow="deleteRow"></TableOpertaionDelete> |
|
|
@deleteRow="deleteRow"></TableOpertaionDelete> |
|
|
<button v-if="fillType === 'actFill'" class="edit-button" @click="onEditClick(row, rowIndex)"> |
|
|
|
|
|
|
|
|
<button v-if="fillType === 'actFill'" class="edit-button" |
|
|
|
|
|
@click="onEditClick(row, rowIndex)"> |
|
|
{{ row.isComplete ? '编辑' : '完成' }} |
|
|
{{ row.isComplete ? '编辑' : '完成' }} |
|
|
</button> |
|
|
</button> |
|
|
</template> |
|
|
</template> |
|
|
@ -66,13 +67,13 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
// 表格数据 |
|
|
|
|
|
tableFormData() { |
|
|
|
|
|
return { |
|
|
|
|
|
stepTableFormData: this.formData.stepTableFormData || [], |
|
|
|
|
|
headerSelectFields: {} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 表格数据 |
|
|
|
|
|
tableFormData() { |
|
|
|
|
|
return { |
|
|
|
|
|
stepTableFormData: this.formData.stepTableFormData || [], |
|
|
|
|
|
headerSelectFields: {} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
// 备注表单配置 |
|
|
// 备注表单配置 |
|
|
remarkConig() { |
|
|
remarkConig() { |
|
|
return [ |
|
|
return [ |
|
|
@ -175,7 +176,7 @@ export default { |
|
|
bodyFillType: 'actFill', |
|
|
bodyFillType: 'actFill', |
|
|
width: 200, |
|
|
width: 200, |
|
|
disabled: true, |
|
|
disabled: true, |
|
|
bodyDisabled: true, |
|
|
|
|
|
|
|
|
bodyDisabled: true, |
|
|
}, { |
|
|
}, { |
|
|
label: 'template.dl.dl022.lxjbs', |
|
|
label: 'template.dl.dl022.lxjbs', |
|
|
prop: 'lxjbs', |
|
|
prop: 'lxjbs', |
|
|
@ -183,7 +184,7 @@ export default { |
|
|
bodyFillType: 'actFill', |
|
|
bodyFillType: 'actFill', |
|
|
width: 200, |
|
|
width: 200, |
|
|
disabled: true, |
|
|
disabled: true, |
|
|
bodyDisabled: true, |
|
|
|
|
|
|
|
|
bodyDisabled: true, |
|
|
}, { |
|
|
}, { |
|
|
label: 'template.dl.dl022.dbtjbs', |
|
|
label: 'template.dl.dl022.dbtjbs', |
|
|
prop: 'dbtjbs', |
|
|
prop: 'dbtjbs', |
|
|
@ -191,7 +192,7 @@ export default { |
|
|
bodyFillType: 'actFill', |
|
|
bodyFillType: 'actFill', |
|
|
width: 200, |
|
|
width: 200, |
|
|
disabled: true, |
|
|
disabled: true, |
|
|
bodyDisabled: true, |
|
|
|
|
|
|
|
|
bodyDisabled: true, |
|
|
}, { |
|
|
}, { |
|
|
label: 'template.dl.dl022.nfzjbs', |
|
|
label: 'template.dl.dl022.nfzjbs', |
|
|
prop: 'nfzjbs', |
|
|
prop: 'nfzjbs', |
|
|
@ -199,7 +200,7 @@ export default { |
|
|
bodyFillType: 'actFill', |
|
|
bodyFillType: 'actFill', |
|
|
width: 200, |
|
|
width: 200, |
|
|
disabled: true, |
|
|
disabled: true, |
|
|
bodyDisabled: true, |
|
|
|
|
|
|
|
|
bodyDisabled: true, |
|
|
}, { |
|
|
}, { |
|
|
label: 'template.dl.dl022.jblx', |
|
|
label: 'template.dl.dl022.jblx', |
|
|
prop: 'jblx', |
|
|
prop: 'jblx', |
|
|
@ -213,96 +214,96 @@ export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
formData: {}, |
|
|
formData: {}, |
|
|
uuid:getuuid(),//事件id |
|
|
|
|
|
currentItem: {}, |
|
|
|
|
|
currentRowIndex: -1, |
|
|
|
|
|
|
|
|
uuid: getuuid(),//事件id |
|
|
|
|
|
currentItem: {}, |
|
|
|
|
|
currentRowIndex: -1, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
|
|
|
|
|
|
watch: { |
|
|
formData: { |
|
|
formData: { |
|
|
immediate: true, |
|
|
immediate: true, |
|
|
handler(v) { |
|
|
handler(v) { |
|
|
console.log('formData==============',v); |
|
|
|
|
|
|
|
|
console.log('formData==============', v); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
|
|
|
EventBus.$on('onEditSignCallback', this.handleEditSignCallback); |
|
|
|
|
|
}, |
|
|
|
|
|
unmounted() { |
|
|
|
|
|
|
|
|
mounted() { |
|
|
|
|
|
EventBus.$on('onEditSignCallback', this.handleEditSignCallback); |
|
|
|
|
|
}, |
|
|
|
|
|
unmounted() { |
|
|
EventBus.$off('onEditSignCallback', this.handleEditSignCallback); |
|
|
EventBus.$off('onEditSignCallback', this.handleEditSignCallback); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
//畸变类型 |
|
|
|
|
|
handleClickButton(e, rowIndex) { |
|
|
|
|
|
console.log('formData==============',e,rowIndex,this.formData); |
|
|
|
|
|
if(this.formData.stepTableFormData&&this.formData.stepTableFormData.length>0){ |
|
|
|
|
|
const list = this.formData.stepTableFormData; |
|
|
|
|
|
list.map((item, index) => { |
|
|
|
|
|
let jblxList = item.jblx; |
|
|
|
|
|
if(jblxList&&jblxList.length>0){ |
|
|
|
|
|
item.jgjxjbs = this.calculateJgjxjbs(jblxList); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
//畸变类型 |
|
|
|
|
|
handleClickButton(e, rowIndex) { |
|
|
|
|
|
console.log('formData==============', e, rowIndex, this.formData); |
|
|
|
|
|
if (this.formData.stepTableFormData && this.formData.stepTableFormData.length > 0) { |
|
|
|
|
|
const list = this.formData.stepTableFormData; |
|
|
|
|
|
list.map((item, index) => { |
|
|
|
|
|
let jblxList = item.jblx; |
|
|
|
|
|
if (jblxList && jblxList.length > 0) { |
|
|
|
|
|
item.jgjxjbs = this.calculateJgjxjbs(jblxList); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// 使用 $set 更新 formData,触发 CustomTable 的响应式更新 |
|
|
|
|
|
this.$set(this.formData, this.formData) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 使用 $set 更新 formData,触发 CustomTable 的响应式更新 |
|
|
|
|
|
this.$set(this.formData, this.formData) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// 计算结构畸形畸变数 |
|
|
|
|
|
calculateJgjxjbs(jblxList,countCodes) { |
|
|
|
|
|
if (!jblxList || jblxList.length === 0) return 0 |
|
|
|
|
|
// 需要计数的代号 |
|
|
|
|
|
// const countCodes = ['b', 't', 'r', 'd', 'z', 'l', 's', 'm'] |
|
|
|
|
|
|
|
|
// 计算结构畸形畸变数 |
|
|
|
|
|
calculateJgjxjbs(jblxList, countCodes) { |
|
|
|
|
|
if (!jblxList || jblxList.length === 0) return 0 |
|
|
|
|
|
// 需要计数的代号 |
|
|
|
|
|
// const countCodes = ['b', 't', 'r', 'd', 'z', 'l', 's', 'm'] |
|
|
|
|
|
|
|
|
let count = 0 |
|
|
|
|
|
|
|
|
let count = 0 |
|
|
|
|
|
|
|
|
for (const it of jblxList) { |
|
|
|
|
|
if (it.value) { |
|
|
|
|
|
const val = String(it.value).toLowerCase() |
|
|
|
|
|
// 同一输入框中,每个符合规则的代号都计1 |
|
|
|
|
|
for (const code of countCodes) { |
|
|
|
|
|
if (val.includes(code)) { |
|
|
|
|
|
count++ |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return count |
|
|
|
|
|
}, |
|
|
|
|
|
handleEditSignCallback(data){ |
|
|
|
|
|
|
|
|
for (const it of jblxList) { |
|
|
|
|
|
if (it.value) { |
|
|
|
|
|
const val = String(it.value).toLowerCase() |
|
|
|
|
|
// 同一输入框中,每个符合规则的代号都计1 |
|
|
|
|
|
for (const code of countCodes) { |
|
|
|
|
|
if (val.includes(code)) { |
|
|
|
|
|
count++ |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return count |
|
|
|
|
|
}, |
|
|
|
|
|
handleEditSignCallback(data) { |
|
|
if (data.uuid === this.uuid) { |
|
|
if (data.uuid === this.uuid) { |
|
|
this.handleEdit(); |
|
|
this.handleEdit(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
handleEdit(){ |
|
|
|
|
|
const {currentItem, currentRowIndex} = this; |
|
|
|
|
|
|
|
|
handleEdit() { |
|
|
|
|
|
const { currentItem, currentRowIndex } = this; |
|
|
currentItem.isComplete = !currentItem.isComplete; |
|
|
currentItem.isComplete = !currentItem.isComplete; |
|
|
this.$refs.tableRef.updateDataSourceByRowIndex(currentRowIndex, currentItem) |
|
|
this.$refs.tableRef.updateDataSourceByRowIndex(currentRowIndex, currentItem) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 编辑/完成 |
|
|
// 编辑/完成 |
|
|
onEditClick(item, rowIndex) { |
|
|
onEditClick(item, rowIndex) { |
|
|
const { jblx=[] } = item; |
|
|
|
|
|
|
|
|
const { jblx = [] } = item; |
|
|
const flag = jblx.every(it => !!it.value) |
|
|
const flag = jblx.every(it => !!it.value) |
|
|
if(!item.isComplete && !flag){ |
|
|
|
|
|
|
|
|
if (!item.isComplete && !flag) { |
|
|
this.$message.error('畸变类型还未填写完,请填写完成后再操作') |
|
|
this.$message.error('畸变类型还未填写完,请填写完成后再操作') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
item.jgjxjbs = this.calculateJgjxjbs(jblx,['b', 't', 'r', 'd', 'z', 'l', 's', 'm']) |
|
|
|
|
|
item.lxjbs = this.calculateJgjxjbs(jblx,['g']) |
|
|
|
|
|
item.dbtjbs = this.calculateJgjxjbs(jblx,['p']) |
|
|
|
|
|
item.nfzjbs = this.calculateJgjxjbs(jblx,['e']) |
|
|
|
|
|
|
|
|
item.jgjxjbs = this.calculateJgjxjbs(jblx, ['b', 't', 'r', 'd', 'z', 'l', 's', 'm']) |
|
|
|
|
|
item.lxjbs = this.calculateJgjxjbs(jblx, ['g']) |
|
|
|
|
|
item.dbtjbs = this.calculateJgjxjbs(jblx, ['p']) |
|
|
|
|
|
item.nfzjbs = this.calculateJgjxjbs(jblx, ['e']) |
|
|
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); |
|
|
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); |
|
|
this.currentItem = item; |
|
|
this.currentItem = item; |
|
|
this.currentRowIndex = rowIndex; |
|
|
this.currentRowIndex = rowIndex; |
|
|
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, item) |
|
|
|
|
|
|
|
|
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, item) |
|
|
}, |
|
|
}, |
|
|
// 新增行 |
|
|
// 新增行 |
|
|
onAddRow() { |
|
|
onAddRow() { |
|
|
this.$refs.tableRef.addRow({ |
|
|
this.$refs.tableRef.addRow({ |
|
|
jblx: [{value: undefined}], |
|
|
|
|
|
|
|
|
jblx: [{ value: undefined }], |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
onFormSelect(fields) { |
|
|
onFormSelect(fields) { |
|
|
@ -386,14 +387,14 @@ export default { |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
<style rel="stylesheet/scss" lang="scss"> |
|
|
<style rel="stylesheet/scss" lang="scss"> |
|
|
.edit-button{ |
|
|
|
|
|
color: #409eff; |
|
|
|
|
|
font-size: 13px; |
|
|
|
|
|
border-radius: 3px; |
|
|
|
|
|
padding: 5px 9px; |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
border-color: transparent; |
|
|
|
|
|
background: transparent; |
|
|
|
|
|
margin: 0 0 5px 10px !important; |
|
|
|
|
|
|
|
|
.edit-button { |
|
|
|
|
|
color: #409eff; |
|
|
|
|
|
font-size: 13px; |
|
|
|
|
|
border-radius: 3px; |
|
|
|
|
|
padding: 5px 9px; |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
border-color: transparent; |
|
|
|
|
|
background: transparent; |
|
|
|
|
|
margin: 0 0 5px 10px !important; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |