| | |
| | | <template> |
| | | <zt-dialog ref="dialog" @confirm="formSubmit" append-to-body> |
| | | <zt-dialog ref="dialog" append-to-body @confirm="formSubmit" :hasConfirm="true"> |
| | | <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> |
| | | <zt-form-item label="上级系统" prop="pid"> |
| | | <zt-select v-model="dataForm.pid" placeholder=" " :datas="productList"/> |
| | | <zt-form-item label="上级节点" prop="pid"> |
| | | <zt-select v-model="dataForm.pid" placeholder=" " :datas="productList" @input="selectDefaultProduct"/> |
| | | </zt-form-item> |
| | | <zt-form-item label="名称" prop="name" rules="required"> |
| | | <el-input v-model="dataForm.name"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="节点类型" prop="nodeType" rules="required"> |
| | | <zt-dict v-model="dataForm.nodeType" dict="product"></zt-dict> |
| | | <zt-dict v-model="dataForm.nodeType" dict="product" @input="getDefaultImg"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item label="基本计算" prop="baseCompute"> |
| | | <zt-dict v-model="dataForm.baseCompute" dict="is_or_not" placeholder="基本计算"></zt-dict> |
| | |
| | | </zt-form-item> |
| | | <zt-form-item label="运行图片" prop="operatImg"> |
| | | <el-input v-model="dataForm.operatImgName" @focus="selectPicture()" :readonly="readonly"></el-input> |
| | | <el-image v-if="dataForm.operatImg" :src="url+dataForm.operatImg" style="height: 50px;width: 50px"></el-image> |
| | | </zt-form-item> |
| | | <zt-form-item label="排序" prop="sort"> |
| | | <el-input v-model="dataForm.sort" :readonly="readonly"></el-input> |
| | |
| | | |
| | | <script> |
| | | import PictureSelect from "@/views/modules/basicInfo/SelectPicture"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | export default { |
| | | name:'TyProductModel', |
| | | name: 'TyProductModel', |
| | | data() { |
| | | return { |
| | | url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`, |
| | | fileId: '', |
| | | productList: [], |
| | | dataForm: { |
| | |
| | | reliabDistrib: '', |
| | | repairDistrib: '', |
| | | operatImg: '', |
| | | operatImgName:'', |
| | | operatImgName: '', |
| | | sort: '', |
| | | } |
| | | } |
| | |
| | | methods: { |
| | | init() { |
| | | this.getProductList() |
| | | |
| | | }, |
| | | selectDefaultProduct() { |
| | | this.dataForm.nodeType = 5 |
| | | this.getDefaultImg(this.dataForm.nodeType) |
| | | }, |
| | | // 获取系统列表 |
| | | async getProductList() { |
| | |
| | | console.log(this.productList, 'getProductList') |
| | | }, |
| | | selectPicture() { |
| | | this.$refs.pictureSelect.$refs.dialog.init() |
| | | this.$refs.pictureSelect.$refs.dialog.init(this.dataForm.nodeType) |
| | | }, |
| | | openAddWin(row) { |
| | | this.dataForm.operatImgName = row.name |
| | | this.dataForm.operatImg = row.id |
| | | console.log(row, 'openAddWin(row)') |
| | | }, |
| | | async getDefaultImg(selected) { |
| | | let params = { |
| | | productType: selected |
| | | } |
| | | let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params: params}) |
| | | this.dataForm.operatImgName = res.data.name |
| | | this.dataForm.operatImg = res.data.id |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | console.log(this.map, 'getInfo') |
| | | if (this.dataForm.pid == null) { |
| | | this.dataForm.pid = '' |
| | | } |
| | | if (this.dataForm.baseCompute == null) { |
| | | this.dataForm.baseCompute = '' |
| | | } |
| | | if (this.dataForm.taskCompute == null) { |
| | | this.dataForm.taskCompute = '' |
| | | } |
| | | if (this.dataForm.reliabDistrib == null) { |
| | | this.dataForm.reliabDistrib = '' |
| | | } |
| | | if (this.dataForm.repairDistrib == null) { |
| | | this.dataForm.repairDistrib = '' |
| | | } |
| | | console.log(this.dataForm, 'this.dataForm') |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |