jinlin
2024-05-28 7c723bef7e4d9aaf1ac07da4a369b28f572e551c
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
@@ -8,11 +8,11 @@
        <el-input v-model="dataForm.name"></el-input>
      </zt-form-item>
      <zt-form-item label="节点类型" prop="productType" rules="required">
        <zt-dict v-model="dataForm.productType" dict="product" @input="getDefaultImg"></zt-dict>
        <zt-dict v-model="dataForm.productType" dict="product" @input="getDefaultImg"
                 :disabled="disabled"></zt-dict>
      </zt-form-item>
      <zt-form-item label="运行状态图" prop="operatImg" v-if="isShow">
        <el-input v-model="dataForm.operatImgName" @focus="selectPicture()"
                  :readonly="readonly"></el-input>
        <el-input v-model="dataForm.operatImgName" @focus="selectPicture()"></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">
@@ -31,7 +31,8 @@
  export default {
    data() {
      return {
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`,
        disabled: false,
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`,
        isTree: false,
        isShow: true,
        fileId: '',
@@ -61,11 +62,11 @@
          this.dataForm.pid = params.pid
          this.dataForm.productType = params.type
        }
        if (this.dataForm.productType==='10'){
        if (this.dataForm.productType === 10 && id == null) {
          this.getDefaultImg(this.dataForm.productType)
        }
        this.disabled = !!id;
      },
      // 获取系统列表
      async getProductList() {
        let res = await this.$http.get('/basicInfo/XhProductModel/getProductList')
@@ -100,19 +101,19 @@
      // 表单提交
      async formSubmit() {
        let flag = true
        if (this.isTree){
        if (this.isTree) {
          if (this.dataForm.productType !== '5' || this.dataForm.productType !== '4') {
            this.$alert("不支持新增此节点")
            flag =false
            flag = false
          }
        }else{
        } else {
          if (this.dataForm.productType === '5' || this.dataForm.productType === '4') {
            this.$alert("不支持新增此节点")
            flag =false
            flag = false
          }
        }
        if (!flag){
        if (!flag) {
          return
        }
        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/basicInfo/XhProductModel/', this.dataForm)