{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowFormSubRowCondition.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowFormSubRowCondition.vue","mtime":1675071991803},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport flow from \"@/api/flow.js\";\nimport req from \"@/request.js\";\nimport { mapState, mapActions } from \"vuex\";\nimport FlowNodeCusersSelector from \"@/components/flow/FlowNodeCusersSelector.vue\";\nimport utils from \"@/hotent-ui-util.js\";\nexport default {\n  components: {},\n  props: [\"curTableAuth\", \"table\", \"boTree\", \"type\", \"finishTable\"],\n  data: function data() {\n    return {\n      userConditionTab: 'first',\n      dialogVisible: false,\n      title: '子表数据授权',\n      conditionObj: {},\n      conditionName: '',\n      pathList: [],\n      data: {},\n      branchList: [],\n      tabList: [],\n      Tree: [],\n      svgHeight: '400px',\n      Mleft: 50,\n      //初始左边距50\n      Mtop: 20,\n      //初始上边距40\n      XIncase: 100,\n      //x轴递增数值70   \n      YIncase: 50,\n      //y轴递增数据50\n      svgHtml: '',\n      curEditTab: {},\n      filedsObj: {},\n      varTree: [],\n      defaultCondition: {\n        property: \"\",\n        operator: \"1\",\n        dataType: \"\",\n        value: \"\",\n        compType: \"2\"\n      }\n    };\n  },\n  computed: mapState({\n    defConfigData: function defConfigData(state) {\n      return state.flow.defConfigData;\n    }\n  }),\n  created: function created() {\n    this.initCondition(this.curTableAuth, this.table, this.boTree);\n    var me_ = this;\n    this.$root.$on('sub-row-auth-confirm-start', function () {\n      me_.handleClose();\n    });\n  },\n  methods: {\n    initCondition: function initCondition(curTableAuth, table, boTree) {\n      var this_ = this;\n      this_.conditionObj = {\n        'junction': 'and',\n        'condition': []\n      };\n      this_.buildVarTree(table, boTree);\n\n      if (curTableAuth && curTableAuth[this.type] && curTableAuth[this.type].conditionObj) {\n        this_.conditionObj = JSON.parse(curTableAuth[this.type].conditionObj);\n      }\n\n      this_.buildConditionTree(this_.conditionObj);\n    },\n    buildVarTree: function buildVarTree(table, boTree) {\n      var _this = this;\n\n      var treeArr = [];\n\n      if (!boTree || boTree.length < 0) {\n        return;\n      }\n\n      var fieldPrefix = boTree[0].children[0].fieldPrefix;\n      var subEntList = boTree[0].children[0].children;\n\n      if (subEntList && subEntList.length > 0) {\n        subEntList.forEach(function (sub) {\n          if (sub.name == table.tableName) {\n            sub.attributeList.forEach(function (cAttr) {\n              cAttr.path = cAttr.tableName;\n              cAttr.pathStr = fieldPrefix + cAttr.name;\n              _this.filedsObj[cAttr.pathStr] = cAttr;\n              treeArr.push(cAttr);\n            });\n          }\n        });\n      }\n\n      if (treeArr.length > 0) {\n        this.varTree = treeArr;\n      }\n    },\n    isNotEmpty: function isNotEmpty(val) {\n      if (!val || val.length == 0) {\n        return false;\n      }\n\n      return true;\n    },\n    //根据条件数组构建条件分支界面\n    buildConditionTree: function buildConditionTree(data) {\n      var pathArr = [];\n      var tableArr = [];\n      var branchArr = [];\n      this.buildData(data, pathArr, tableArr, branchArr);\n      this.pathList = pathArr;\n      this.branchList = branchArr;\n      this.tabList = tableArr; //取路径最后一条数据，因为该条数据的高度距离顶部最大\n\n      var lastPath = pathArr[pathArr.length - 1];\n      var lastIndexArr = [];\n      if (lastPath) lastIndexArr = lastPath.split(','); //取最后一个坐标点。终点纵坐标为整个svg中最大的纵坐标\n\n      var lastYIndex = lastIndexArr[lastIndexArr.length - 1]; //设置svg的高度为最大纵坐标+100，从而实现svg页面高度自适应\n\n      if (lastYIndex) {\n        this.svgHeight = parseInt(lastYIndex) + 50 + \"px\";\n      }\n\n      this.createSvgHtml(pathArr);\n    },\n    ArrayTool: function ArrayTool(ary, idx, direct) {\n      direct = direct || \"down\";\n      var part = ary[idx];\n\n      if (!part || part.constructor !== Object && part.constructor !== Array) {\n        return ary;\n      }\n\n      if (part.constructor === Object) {\n        part = [part];\n      }\n\n      if (direct == \"up\") {\n        part.forEach(function (m) {\n          var index = ary.indexOf(m, 1);\n\n          if (index > 0) {\n            var t = ary[index - 1];\n            ary.splice(index - 1, 1, ary[index]);\n            ary.splice(index, 1, t);\n          }\n        });\n      } else if (direct == \"down\") {\n        for (var i = part.length - 1, m; m = part[i--];) {\n          var index = ary.indexOf(m, 0);\n\n          if (index > -1 && index < ary.length - 1) {\n            var t = ary[index + 1];\n            ary.splice(index + 1, 1, ary[index]);\n            ary.splice(index, 1, t);\n          }\n        }\n      }\n    },\n    //构建svg图形页面\n    createSvgHtml: function createSvgHtml(pathArr) {\n      this.svgHtml = '';\n      var html = '<svg height=\"' + this.svgHeight + '\" version=\"1.1\" width=\"692\" xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: hidden; position: relative;\">';\n\n      for (var i = 0; i < pathArr.length; i++) {\n        html += '<path fill=\"none\" stroke=\"#787878\"' + 'd=\"' + this.pathList[i] + '\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\"></path>';\n      }\n\n      html += '</svg>';\n      this.svgHtml = html;\n    },\n    changecondition: function changecondition(index) {\n      var _this2 = this;\n\n      var oldVal = this.branchList[index].oldjunction;\n      var newVal = this.branchList[index].newjunction;\n\n      if (newVal == '3' || newVal == '4' || newVal == '5') {\n        this.branchList[index].newjunction = this.branchList[index].oldjunction;\n        var indexStr = this.branchList[index].indexStr;\n\n        if (newVal == '3') {\n          this.addCondition(indexStr);\n        } else if (newVal == '4') {\n          this.addUnionCondition(indexStr);\n        } else {\n          this.$confirm(\"确定要删除此联合条件及其下属的所有子条件吗？\", \"提示\", {\n            cancelButtonText: \"取消\",\n            confirmButtonText: \"确定\",\n            type: \"warning\",\n            closeOnClickModal: false\n          }).then(function () {\n            _this2.removeCondition(indexStr);\n          });\n        }\n      } else {\n        this.branchList[index].oldjunction = this.branchList[index].newjunction;\n        var indexStr = this.branchList[index].indexStr;\n        var indexArr = indexStr.split(',');\n\n        if (indexStr == 'root') {\n          this.conditionObj.junction = newVal;\n        } else if (indexArr.length == 1) {\n          this.conditionObj.condition[indexStr].junction = newVal;\n        } else if (indexArr.length == 2) {\n          this.conditionObj.condition[indexArr[0]].condition[indexArr[1]].junction = newVal;\n        }\n      }\n    },\n    //添加一个联合\n    addCondition: function addCondition(indexStr) {\n      var data = this.conditionObj.condition;\n\n      if (indexStr == 'root') {\n        data.push(JSON.parse(JSON.stringify(this.defaultCondition)));\n      } else {\n        var indexArr = [];\n        if (indexStr) indexArr = indexStr.split(',');\n\n        for (var i = 0; i < data.length; i++) {\n          if (indexArr.length > 0 && i == indexArr[0]) {\n            if (indexArr.length > 1) {\n              for (var j = 0; j < data[i].condition.length; j++) {\n                if (j == indexArr[1]) {\n                  data[i].condition[j].condition.push(JSON.parse(JSON.stringify(this.defaultCondition)));\n                  break;\n                }\n              }\n            } else {\n              data[i].condition.push(JSON.parse(JSON.stringify(this.defaultCondition)));\n            }\n\n            break;\n          }\n        }\n      }\n\n      this.conditionObj.condition = data;\n      this.buildConditionTree(this.conditionObj);\n    },\n    removeCondition: function removeCondition(indexStr) {\n      var indexArr = [];\n      if (indexStr) indexArr = indexStr.split(',');\n\n      if (indexArr.length > 0) {\n        var data = this.conditionObj.condition;\n\n        for (var i = 0; i < data.length; i++) {\n          if (i == indexArr[0]) {\n            if (indexArr.length > 1) {\n              for (var j = 0; j < data[i].condition.length; j++) {\n                if (j == indexArr[1]) {\n                  if (indexArr.length > 2) {\n                    for (var z = 0; z < data[i].condition[j].condition.length; z++) {\n                      if (z == indexArr[2]) {\n                        data[i].condition[j].condition.splice(z, 1);\n                        break;\n                      }\n                    }\n                  } else {\n                    data[i].condition.splice(j, 1);\n                  }\n\n                  break;\n                }\n              }\n            } else {\n              data.splice(i, 1);\n            }\n\n            break;\n          }\n        }\n\n        this.conditionObj.condition = data;\n        this.buildConditionTree(this.conditionObj);\n      }\n    },\n    //添加一个联合条件条件\n    addUnionCondition: function addUnionCondition(indexStr) {\n      var data = this.conditionObj.condition;\n\n      if (indexStr == 'root') {\n        data.push({\n          'junction': 'or',\n          'condition': []\n        });\n      } else {\n        var indexArr = [];\n        if (indexStr) indexArr = indexStr.split(',');\n\n        for (var i = 0; i < data.length; i++) {\n          if (indexArr.length > 0 && i == indexArr[0]) {\n            if (indexArr.length > 1) {\n              for (var j = 0; j < data[i].condition.length; j++) {\n                if (j == indexArr[1]) {\n                  data[i].condition[j].condition.push({\n                    'junction': 'or',\n                    'condition': []\n                  });\n                  break;\n                }\n              }\n            } else {\n              data[i].condition.push({\n                'junction': 'or',\n                'condition': []\n              });\n            }\n\n            break;\n          }\n        }\n      }\n\n      this.conditionObj.condition = data;\n      this.buildConditionTree(this.conditionObj);\n    },\n    buildData: function buildData(conditionData, pathArr, tableArr, branchArr) {\n      var curYIndex = 0;\n      var data = conditionData.condition; //算三级节点总共分支个数\n\n      var yIncaseNum = this.getyIncaseNum(conditionData.condition) > 1 ? this.getyIncaseNum(conditionData.condition) : 1; //第一个节点 this.Mtop 最后一个节点Mtop+this.YIncase*（yIncaseNum-1）\n\n      var startY1 = (this.Mtop * 2 + this.YIncase * (yIncaseNum - 1)) / 2;\n      branchArr.push({\n        newjunction: conditionData.junction,\n        oldjunction: conditionData.junction,\n        style: \"left:\" + (this.Mleft - 35) + \"px; top:\" + (startY1 - 15) + \"px\",\n        indexStr: 'root',\n        condition: 'noDel'\n      });\n\n      for (var i = 0; i < data.length; i++) {\n        if (data[i].condition) {\n          var curchildNum = this.getyIncaseNum(data[i].condition); //如果该节点，没有分支条件，则保留节点\n\n          var isEmpty0 = false;\n\n          if (curchildNum < 1) {\n            curchildNum = 1;\n            isEmpty0 = true;\n          } //计算一级节点和该节点的连线\n\n\n          var startY2 = (this.Mtop * 2 + this.YIncase * (2 * curYIndex + curchildNum - 1)) / 2;\n          var path = 'M' + this.Mleft + ',' + startY1 + 'C' + this.Mleft + ',' + startY2 + ',' + this.Mleft + ',' + startY2 + ',' + (this.Mleft + this.XIncase) + ',' + startY2;\n          pathArr.push(path);\n          branchArr.push({\n            newjunction: data[i].junction,\n            oldjunction: data[i].junction,\n            style: \"left:\" + (this.Mleft + this.XIncase - 35) + \"px; top:\" + (startY2 - 15) + \"px\",\n            indexStr: '' + i\n          });\n          if (isEmpty0) curYIndex++;\n\n          for (var j = 0; j < data[i].condition.length; j++) {\n            //如果第三级节点有分支，则计算分支\n            if (data[i].condition[j].condition) {\n              //计算改节点分支个数\n              var curchildNum2 = this.getyIncaseNum(data[i].condition[j].condition); //如果该节点，没有分支条件，则保留节点,默认其占一行\n\n              var isEmpty = false;\n\n              if (curchildNum2 < 1) {\n                curchildNum2 = 1;\n                isEmpty = true;\n              } // 改分支第一个节点纵坐标= this.Mtop+this.YIncase*curYIndex  上一个节点纵坐标加上递增值\n              // 改分支最后节点纵坐标=改分支第一个节点纵坐标 +计算改节点分支个数*y递增值 this.Mtop+this.YIncase*curYIndex+this.YIncase*(curchildNum2-1)\n              // 计算改节点的纵坐标。（改分支第一个节点纵坐标+该分支的最后一个纵坐标）/2\n              // 该节点起始点纵坐标=  this.Mtop+this.YIncase*curYIndex+ this.Mtop+this.YIncase*curYIndex+this.YIncase*(curchildNum2-1)\n\n\n              var startY3 = (this.Mtop * 2 + this.YIncase * (2 * curYIndex + curchildNum2 - 1)) / 2; //改分支指引线的终点的纵坐标等于startY2\n\n              var _path = 'M' + (this.Mleft + this.XIncase) + ',' + startY2 + 'C' + (this.Mleft + this.XIncase) + ',' + startY3 + ',' + (this.Mleft + this.XIncase) + ',' + startY3 + ',' + (this.Mleft + this.XIncase * 2) + ',' + startY3;\n\n              pathArr.push(_path);\n              branchArr.push({\n                newjunction: data[i].condition[j].junction,\n                oldjunction: data[i].condition[j].junction,\n                style: \"left:\" + (this.Mleft + this.XIncase * 2 - 35) + \"px; top:\" + (startY3 - 15) + \"px\",\n                indexStr: i + ',' + j,\n                condition: 'noAdd'\n              });\n\n              if (isEmpty) {\n                curYIndex++;\n              }\n\n              for (var z = 0; z < data[i].condition[j].condition.length; z++) {\n                var obj = data[i].condition[j].condition[z];\n                obj.style = \"left:\" + (this.Mleft + this.XIncase * 3) + \"px; top:\" + (this.Mtop + this.YIncase * curYIndex - 19) + \"px\";\n                obj.indexStr = i + \",\" + j + \",\" + z;\n                tableArr.push(obj); //改分支下所有节点的起始纵坐标为startY3，终点纵坐标根据该节点位置决定\n\n                var _path2 = 'M' + (this.Mleft + this.XIncase * 2) + ',' + startY3 + 'C' + (this.Mleft + this.XIncase * 2) + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase * 2) + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase * 3) + ',' + (this.Mtop + this.YIncase * curYIndex);\n\n                pathArr.push(_path2);\n                curYIndex++;\n              }\n            } else {\n              //第二级节点没有分支\n              var _obj = data[i].condition[j];\n              _obj.style = \"left:\" + (this.Mleft + this.XIncase * 2) + \"px; top:\" + (this.Mtop + this.YIncase * curYIndex - 19) + \"px\";\n              _obj.indexStr = i + \",\" + j;\n              tableArr.push(_obj); //计算改分支的路径。因为是第二节点。startY2\n\n              var _path3 = 'M' + (this.Mleft + this.XIncase) + ',' + startY2 + 'C' + (this.Mleft + this.XIncase) + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase) + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase * 2) + ',' + (this.Mtop + this.YIncase * curYIndex);\n\n              pathArr.push(_path3);\n              curYIndex++;\n            }\n          }\n        } else {\n          var _obj2 = data[i];\n          _obj2.style = \"left:\" + (this.Mleft + this.XIncase) + \"px; top:\" + (this.Mtop + this.YIncase * curYIndex - 19) + \"px\";\n          _obj2.indexStr = '' + i;\n          tableArr.push(_obj2);\n\n          var _path4 = 'M' + this.Mleft + ',' + startY1 + 'C' + this.Mleft + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + this.Mleft + ',' + (this.Mtop + this.YIncase * curYIndex) + ',' + (this.Mleft + this.XIncase) + ',' + (this.Mtop + this.YIncase * curYIndex);\n\n          pathArr.push(_path4);\n          curYIndex++;\n        }\n      }\n    },\n    //获取条件总数\n    getyIncaseNum: function getyIncaseNum(data) {\n      var sum = 0;\n\n      for (var i = 0; i < data.length; i++) {\n        if (data[i].condition && data[i].condition.length > 0) {\n          for (var j = 0; j < data[i].condition.length; j++) {\n            if (data[i].condition[j].condition && data[i].condition[j].condition.length > 0) {\n              for (var z = 0; z < data[i].condition[j].condition.length; z++) {\n                sum++;\n              }\n            } else {\n              sum++;\n            }\n          }\n        } else {\n          sum++;\n        }\n      }\n\n      return sum;\n    },\n    setFieldOtherInfo: function setFieldOtherInfo(ele, tab, type) {\n      var selectFiled = this.filedsObj[tab.property];\n\n      if (type == 1) {\n        tab.dataType = selectFiled.dataType;\n        tab.format = selectFiled.format;\n        tab.chooseDesc = selectFiled.desc;\n        tab.value = \"\";\n      } else {\n        tab.changeDesc = selectFiled.desc;\n      }\n\n      if (selectFiled.dataType != 'varchar' && tab.compType != '2') {\n        tab.compType = '2';\n      }\n    },\n    handleClose: function handleClose() {\n      var me_ = this;\n      utils.validateForm(this, \"form1\" + this.type).then(function (r) {\n        me_.curTableAuth[me_.type] = me_.getConditionData();\n\n        if (me_.finishTable.indexOf(me_.type) < 0) {\n          me_.finishTable.push(me_.type);\n        }\n\n        me_.$root.$emit('sub-row-auth-confirm-end');\n      }).catch(function (items) {\n        me_.$message.error(\"\\u6743\\u9650\\u8BBE\\u7F6E\\u9875\\u9762\\u8FD8\\u6709\\u5185\\u5BB9\\u672A\\u586B\\u5199\\u3002\");\n      });\n    },\n    getConditionData: function getConditionData() {\n      if (!this.conditionObj) return;\n      var data = this.getConditionStr(this.conditionObj);\n      data.conditionObj = JSON.stringify(this.conditionObj);\n      this.scriptStr = data.conditionString;\n      return data;\n    },\n    getConditionStr: function getConditionStr(obj) {\n      if (!obj || !obj.condition) return;\n      var returnData = {};\n      var data = obj.condition;\n      var res = \"\";\n      var desString = \"\";\n\n      for (var i = 0; i < data.length; i++) {\n        //第一节点的表达式\n        var curcondStr1 = \"\";\n        var curcondDes1 = \"\"; //如果第一节点有分支则计算\n\n        if (data[i].condition && data[i].condition.length > 0) {\n          curcondStr1 += \"(\";\n          curcondDes1 += \"(\";\n\n          for (var j = 0; j < data[i].condition.length; j++) {\n            //第二节点的表达式\n            var curcondStr2 = \"\";\n            var curcondDes2 = \"\"; //如果第三级节点有分支，则计算分支\n\n            if (data[i].condition[j].condition && data[i].condition[j].condition.length > 0) {\n              curcondStr2 += \"(\";\n              curcondDes2 += \"(\";\n              var curcondStr3 = \"\";\n              var curcondDes3 = \"\";\n\n              for (var z = 0; z < data[i].condition[j].condition.length; z++) {\n                curcondStr3 = this.getConditionStrByObj(data[i].condition[j].condition[z]);\n                curcondDes3 = this.getConditionStrByObj(data[i].condition[j].condition[z], \"des\");\n\n                if (curcondStr3 != \"\") {\n                  //循环拼接第三节点的条件\n                  if (z == 0) {\n                    //第一个不拼接运算符\n                    curcondStr2 += curcondStr3;\n                    curcondDes2 += curcondDes3;\n                  } else {\n                    curcondStr2 += this.getjunction(data[i].condition[j].junction) + curcondStr3;\n                    curcondDes2 += this.getjunction(data[i].condition[j].junction) + curcondDes3;\n                  }\n                }\n              }\n\n              curcondStr2 += \")\";\n              curcondDes2 += \")\";\n            } else if (data[i].condition[j].property) {\n              //第二节点没有分只\n              curcondStr2 = this.getConditionStrByObj(data[i].condition[j]);\n              curcondDes2 = this.getConditionStrByObj(data[i].condition[j], \"des\");\n            }\n\n            if (curcondStr2 != \"\") {\n              //循环拼接第二节点的条件\n              if (j == 0) {\n                //第一个不拼接运算符\n                curcondStr1 += curcondStr2;\n                curcondDes1 += curcondDes2;\n              } else {\n                curcondStr1 += this.getjunction(data[i].junction) + curcondStr2;\n                curcondDes1 += this.getjunction(data[i].junction) + curcondDes2;\n              }\n            }\n          }\n\n          curcondStr1 += \")\";\n          curcondDes1 += \")\";\n        } else if (data[i].property) {\n          //第一节点没有分只\n          curcondStr1 = this.getConditionStrByObj(data[i]);\n          curcondDes1 = this.getConditionStrByObj(data[i], \"des\");\n        }\n\n        if (curcondStr1 != \"\") {\n          //循环拼接第一节点的条件\n          if (i == 0) {\n            //第一个不拼接运算符\n            res += curcondStr1;\n            desString += curcondDes1;\n          } else {\n            res += this.getjunction(obj.junction) + curcondStr1;\n            desString += this.getjunction(obj.junction) + curcondDes1;\n          }\n        }\n      }\n\n      returnData.conditionString = res;\n      returnData.conditionDes = desString;\n      return returnData;\n    },\n    getConditionStrByObj: function getConditionStrByObj(obj, type) {\n      var res = \"\";\n\n      if (!obj.value) {\n        throw '比较的值必填';\n      }\n\n      switch (obj.dataType) {\n        case \"varchar\":\n          res = this.buildStringCondition(obj, type);\n          break;\n\n        case \"date\":\n          res = this.buildDateCondition(obj, type);\n          break;\n\n        case \"number\":\n          res = this.buildIntCondition(obj, type);\n          break;\n      }\n\n      return res;\n    },\n    buildDateCondition: function buildDateCondition(obj, type) {\n      var value = obj.value;\n      var valueDes = \"\";\n      var property = obj.property;\n      var res = \"\";\n\n      if (obj.compType == 2) {\n        if (obj.operator == '9') {\n          value = \"'\" + value[0] + \"' and '\" + value[1] + \"'\";\n        } else {\n          value = \"'\" + obj.value + \"'\";\n        }\n      } else {\n        value = \"'{\" + obj.value + \"}'\";\n        valueDes = obj.changeDesc;\n      }\n\n      if (type == \"des\") {\n        property = obj.chooseDesc;\n        value = valueDes || value;\n      }\n\n      switch (obj.operator) {\n        case \"1\":\n          res = property + \" = \" + value;\n          break;\n\n        case \"2\":\n          res = property + \" != \" + value;\n          break;\n\n        case \"3\":\n          res = property + \" >  \" + value;\n          break;\n\n        case \"4\":\n          res = property + \" < \" + value;\n          break;\n\n        case \"7\":\n          res = property + \" >= \" + value;\n          break;\n\n        case \"8\":\n          res = property + \" <= \" + value;\n          break;\n\n        case \"9\":\n          res = property + \" BETWEEN \" + value;\n          break;\n      }\n\n      return res;\n    },\n    buildStringCondition: function buildStringCondition(obj, type) {\n      var value = obj.value;\n      var valueDes = \"\";\n      var property = obj.property;\n      var res = \"\";\n\n      if (obj.compType == 2) {\n        if (obj.operator == 5 || obj.operator == 6) {\n          value = \"'%\" + obj.value + \"%'\";\n        } else if (obj.operator == 9 || obj.operator == 10) {\n          value = \"('\" + obj.value.split(\",\").join(\"','\") + \"')\";\n        } else {\n          value = \"'\" + obj.value + \"'\";\n        }\n\n        valueDes = value;\n      } else {\n        value = \"'{\" + obj.value + \"}'\";\n        valueDes = obj.changeDesc;\n      }\n\n      if (type == \"des\") {\n        property = obj.chooseDesc;\n        value = valueDes;\n      }\n\n      switch (obj.operator) {\n        case \"1\":\n          res = property + \" = \" + value;\n          break;\n\n        case \"2\":\n          res = property + \" != \" + value;\n          break;\n\n        case \"5\":\n          res = property + \" like  \" + value;\n          break;\n\n        case \"6\":\n          res = property + \" not like \" + value;\n          break;\n\n        case \"9\":\n          res = property + \" in \" + value;\n          break;\n\n        case \"10\":\n          res = property + \" not in \" + value;\n          break;\n      }\n\n      return res;\n    },\n    buildIntCondition: function buildIntCondition(obj, type) {\n      var value = obj.value;\n      var valueDes = \"\";\n      var property = obj.property;\n\n      if (obj.compType == 2) {\n        value = obj.value;\n        valueDes = value;\n      } else {\n        value = \"{\" + obj.value + \"}\";\n        valueDes = obj.changeDesc;\n      }\n\n      if (type == \"des\") {\n        property = obj.chooseDesc;\n        value = valueDes;\n      }\n\n      var res = \"\";\n\n      switch (obj.operator) {\n        case \"1\":\n          res = property + \" = \" + value;\n          break;\n\n        case \"2\":\n          res = property + \" != \" + value;\n          break;\n\n        case \"3\":\n          res = property + \" > \" + value;\n          break;\n\n        case \"4\":\n          res = property + \" < \" + value;\n          break;\n\n        case \"7\":\n          res = property + \" >= \" + value;\n          break;\n\n        case \"8\":\n          res = property + \" <= \" + value;\n          break;\n      }\n\n      return res;\n    },\n    getjunction: function getjunction(str) {\n      return ' ' + str + ' ';\n    }\n  }\n};",null]}