jinlin
2024-05-28 7c723bef7e4d9aaf1ac07da4a369b28f572e551c
web/src/views/modules/basicInfo/TyProductModel-AddOrUpdate.vue
@@ -2,7 +2,7 @@
  <zt-dialog ref="dialog" @confirm="formSubmit" append-to-body>
    <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-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>
@@ -43,7 +43,7 @@
    name: 'TyProductModel',
    data() {
      return {
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`,
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`,
        fileId: '',
        productList: [],
        dataForm: {
@@ -68,6 +68,10 @@
      init() {
        this.getProductList()
      },
      selectDefaultProduct() {
        this.dataForm.nodeType = 1
        this.getDefaultImg(this.dataForm.nodeType)
      },
      // 获取系统列表
      async getProductList() {
        let res = await this.$http.get('/basicInfo/TyProductModel/getProductList')
@@ -83,11 +87,10 @@
        console.log(row, 'openAddWin(row)')
      },
      async getDefaultImg(selected) {
        console.log(selected, 'async getDefaultImg')
        let params = {
          productType: selected
        }
        let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params:params})
        let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params: params})
        this.dataForm.operatImgName = res.data.name
        this.dataForm.operatImg = res.data.id
      },
@@ -98,7 +101,22 @@
          ...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() {