| | |
| | | <el-input v-model="dataForm.project.softwareName" placeholder="被测软件"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="版本" style="width: 49%"> |
| | | <el-input v-model="dataForm.project.softwareIdentity" placeholder="版本"></el-input> |
| | | <el-input v-model="dataForm.project.version" placeholder="版本"></el-input> |
| | | </el-form-item> |
| | | <div class="el-flexConfigDialog el-form-border"> |
| | | <div class="DFormWidth DAlign DHold"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="icon-container" @click="addSoftwareRow()"> |
| | | <div v-if="!dataForm.disabled" class="icon-container" @click="addSoftwareRow()"> |
| | | <!-- 放置固定的图标 --> |
| | | <i class="el-icon-plus"></i> |
| | | </div> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="icon-container" @click="addHardwareRow()"> |
| | | <div v-if="!dataForm.disabled" class="icon-container" @click="addHardwareRow()"> |
| | | <!-- 放置固定的图标 --> |
| | | <i class="el-icon-plus"></i> |
| | | </div> |
| | |
| | | <div style="width: calc(100% - 120px);"> |
| | | <div class="el-wt-border-left"> |
| | | <span>{{dataForm.environ.testEnvirontDiagram}}</span> |
| | | <config-uploader busi-type="test_environt_diagram" model-name="dataForm" :dataForm="dataForm" |
| | | <config-uploader :lineHeight="true" busi-type="test_environ_diagram" model-name="dataForm" :dataForm="dataForm" |
| | | @getImageUrl="getImageUrl" |
| | | v-model="dataForm.files"/> |
| | | <div v-if="dataForm.url"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="icon-container" @click="addDiscrepancyRow()"> |
| | | <div v-if="!dataForm.disabled" class="icon-container" @click="addDiscrepancyRow()"> |
| | | <!-- 放置固定的图标 --> |
| | | <i class="el-icon-plus"></i> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="el-flex environ-sc" style="height: 60px"> |
| | | <el-form-item class="marginTopAndMarginBottom" style="width: 100%"> |
| | | <config-uploader :lineHeight="true" :busiTypeVarName="busiTypeVarName" busi-type="test_environ" model-name="dataForm" :dataForm="dataForm" |
| | | v-model="dataForm.files2"/> |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | <template v-slot:footer> |
| | | <el-button v-if="dataForm.disabled" type="primary" @click="print()">打印</el-button> |
| | | </template> |
| | | </zt-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import qs from "qs"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | busiTypeVarName: 'files2', |
| | | dataForm: { |
| | | id: '', |
| | | url: '', |
| | |
| | | virusDatabaseVersion: '', |
| | | }, |
| | | project: { |
| | | softwareIdentity: '', |
| | | version: '', |
| | | softwareName: '', |
| | | }, |
| | | testAgencyInfo: { |
| | |
| | | }, |
| | | methods: { |
| | | init(id, row) { |
| | | console.log(row, 'row') |
| | | this.dataForm.id = row.id |
| | | this.dataForm.projectId = row.projectId |
| | | // this.dataForm.disabled |
| | | this.dataForm.disabled |
| | | this.getInfo() |
| | | this.getImageUrl() |
| | | console.log(this.dataForm.id, this.dataForm.projectId, 'params params') |
| | | }, |
| | | // 获取信息 |
| | |
| | | projectId: this.dataForm.projectId |
| | | } |
| | | let res = await this.$http.get(`/project/Environ/getDto`, {params: params}) |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | | if (res.data) { |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | this.dataForm.project.version='1.0.0' |
| | | this.getImageUrl() |
| | | } |
| | | console.log(this.dataForm, 'this.dataForm') |
| | | }, |
| | | indexFormat(index) { |
| | | return index += 1 |
| | |
| | | tableBody.scrollTop = tableBody.scrollHeight; |
| | | }) |
| | | }, |
| | | getImageUrl() { |
| | | let pictureId = this.getFirstImageId(this.dataForm.files, 'test_environt_diagram') |
| | | this.dataForm.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/content2?fileId=${pictureId}` |
| | | console.log(this.dataForm.url, ' this.dataForm.url') |
| | | }, |
| | | getFirstImageId(oss) { |
| | | console.log(oss, ' getFirstImageId(oss)') |
| | | let fileId = 0 |
| | | if (oss != null) { |
| | | if (oss.groups.length > 0) { |
| | | let group = oss.groups[0] |
| | | if (group.fields.length > 0) { |
| | | let field = group.fields[0] |
| | | if (field.files.length > 0) { |
| | | let file = field.files[0] |
| | | fileId = file.id |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return fileId |
| | | getImageUrl() { |
| | | let pictureId = this.getFirstImageId(this.dataForm.files) |
| | | this.dataForm.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/content2?fileId=${pictureId}` |
| | | console.log(this.dataForm.url, ' this.dataForm.url') |
| | | }, |
| | | getFirstImageId(oss) { |
| | | console.log(oss, ' getFirstImageId(oss)') |
| | | let fileId = 0 |
| | | if (oss != null) { |
| | | if (oss.groups.length > 0) { |
| | | let group = oss.groups[0] |
| | | if (group.fields.length > 0) { |
| | | let field = group.fields[0] |
| | | if (field.files.length > 0) { |
| | | let file = field.files[0] |
| | | fileId = file.id |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return fileId |
| | | }, |
| | | async print() { |
| | | console.log(this.dataForm) |
| | | let params = qs.stringify({ |
| | | token: Cookies.get('token'), |
| | | id: this.dataForm.id |
| | | }) |
| | | let apiURL = `/project/Environ/exportEnviron/` |
| | | window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}` |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |
| | |
| | | margin-top: 0 !important; |
| | | margin-bottom: 10px !important; |
| | | } |
| | | .environ-sc > .el-form-item > .el-form-item__content { |
| | | width:100%; |
| | | } |
| | | |
| | | </style> |