From 260a426cfa4ee4999895ed885bc0e11a7c015771 Mon Sep 17 00:00:00 2001 From: "bruce\\fibo-zhu" <2547721127@qq.com> Date: Tue, 9 Aug 2022 11:02:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E5=88=99=E6=94=B9=E4=B8=BA=E5=9D=97?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20=E5=8A=A0=E5=85=A5=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E6=9C=AC=E8=BA=AB=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- h5-enginex-manager/baseUrl.js | 2 +- .../src/components/common/Cascader.vue | 71 + .../common/rule/ruleManageRedact.vue | 1510 +++++++++-------- .../src/components/common/ruleRelation.vue | 14 +- .../src/components/models/RuleCont.vue | 81 +- .../src/components/models/outcontent.vue | 23 +- .../src/components/page/tendencyAnalyse.vue | 28 +- h5-enginex-manager/src/main.js | 5 +- h5-enginex-manager/src/store/index.js | 2 +- h5-enginex-manager/src/utils/GetdeepObj.js | 23 +- h5-enginex-manager/src/utils/mixin.js | 1 + 11 files changed, 982 insertions(+), 778 deletions(-) create mode 100644 h5-enginex-manager/src/components/common/Cascader.vue diff --git a/h5-enginex-manager/baseUrl.js b/h5-enginex-manager/baseUrl.js index 51beee7..867cfd2 100644 --- a/h5-enginex-manager/baseUrl.js +++ b/h5-enginex-manager/baseUrl.js @@ -76,7 +76,7 @@ switch (process.env.NODE_ENV) { case 'wang': // 汪环境 proxyObj = { '/Riskmanage': { - target: 'http://192.168.50.228:8080', // 生产环境 + target: 'http://192.168.50.223:8080', // 生产环境 changeOrigin: true, // 是否跨域 pathRewrite: { '^/Riskmanage': '/Riskmanage' diff --git a/h5-enginex-manager/src/components/common/Cascader.vue b/h5-enginex-manager/src/components/common/Cascader.vue new file mode 100644 index 0000000..2af38e9 --- /dev/null +++ b/h5-enginex-manager/src/components/common/Cascader.vue @@ -0,0 +1,71 @@ + + \ No newline at end of file diff --git a/h5-enginex-manager/src/components/common/rule/ruleManageRedact.vue b/h5-enginex-manager/src/components/common/rule/ruleManageRedact.vue index 2f71723..56b8c03 100644 --- a/h5-enginex-manager/src/components/common/rule/ruleManageRedact.vue +++ b/h5-enginex-manager/src/components/common/rule/ruleManageRedact.vue @@ -1,52 +1,61 @@ diff --git a/h5-enginex-manager/src/components/common/ruleRelation.vue b/h5-enginex-manager/src/components/common/ruleRelation.vue index 4d0dd5e..8d12343 100644 --- a/h5-enginex-manager/src/components/common/ruleRelation.vue +++ b/h5-enginex-manager/src/components/common/ruleRelation.vue @@ -3,17 +3,19 @@
- - - - - - + + + + + + + +
+
@@ -91,35 +93,42 @@
-
+ :style="{border: '1px dashed '+ color[ZIndex%5],borderRadius: '5px',paddingRight: '5px',paddingBottom: '5px',position:'relative',minWidth:'30px',minHeight:'40px',backgroundColor:data.red&&(data.conditionType==1||data.conditionType==4||data.conditionType==5)?'#f56c6c':''}"> + +
+
- - + +
+ :style="{backgroundColor:data.red&&data.conditionType==3?'#f56c6c':'',border:data.conditionType==3?'1px dotted #000':'',margin:data.conditionType==3?'5px 10px ':'',padding:data.conditionType==3?'8px':'',paddingLeft:'0px'}"> + {{typeof sdataJson!= 'object'&&typeof sdataJson!= 'array'&&data.conditionType==3?'此处不支持继续遍历请删除此节点':''}} +
+
+
- + -
+
- +
-
+
+ 打点1 -->
-
+
- + +
-
+
- +
-
+
命中条件: [
+
+ style="display: flex; align-items: center;margin-bottom: 5px;margin-left: 5px;" + :style="{backgroundColor:item.red?'#f56c6c':''}" + > + @@ -230,9 +247,10 @@ - + @@ -288,8 +306,8 @@ }, mounted() { if (this.data) { - // console.log(this.data.fieldEn) - if (Array.isArray(this.data.fieldEn)) { + // console.log(this.data) + if (this.data.fieldEn) { if (this.data.fieldEn.length > 0) { this.EnChange(this.data.fieldEn, false) } @@ -369,12 +387,12 @@ let obj = {} if (this.fieldType == "for") { obj = this.sdataJson - } else if (Array.isArray(this.data.fieldEn)) { - // console.log(1, this.data.fieldEn) - obj = JSON.parse(this.mixinGetFieldByEn(this.data.fieldEn[0]).jsonValue) + } else if (this.data.fieldEn) { + console.log(1, this.data.fieldEn) + obj = JSON.parse(this.mixinGetFieldByEn(this.data.fieldEn.split('.')[0]).jsonValue) } - if (Array.isArray(this.data.fieldEn)) { - this.data.fieldEn.forEach((value, index) => { + if (this.data.fieldEn) { + this.data.fieldEn.split('.').forEach((value, index) => { if (index != 0) { obj = obj[value] } @@ -492,6 +510,7 @@ item.operator = "" }, getvalueTypebyEn(e) { //通过En 获取 valueType + e && (e = e.split('.')) if (!Array.isArray(e)) { return } @@ -527,14 +546,14 @@ }, EnChange(e, clear = true) { - this.En = e.join('.') + this.En = e if (!clear) return this.deepClearEn(this.data) }, deepClearEn(obj) { // 递归清除用到父级的 En obj.children.forEach(value => { - if (Array.isArray(value.fieldEn)) { - if (value.fieldEn[0][0] == "%") { + if (value.fieldEn) { + if (value.fieldEn[0] == "%") { value.fieldEn = "" } } @@ -700,7 +719,7 @@ this.data.children.push({ "logical": 'for', "fieldId": "", - "fieldEn":[], + "fieldEn":"", "operator": "", "fieldValue": "", "conditionType": 3, diff --git a/h5-enginex-manager/src/components/models/outcontent.vue b/h5-enginex-manager/src/components/models/outcontent.vue index da80380..d58aa89 100644 --- a/h5-enginex-manager/src/components/models/outcontent.vue +++ b/h5-enginex-manager/src/components/models/outcontent.vue @@ -75,16 +75,17 @@
- - + +
-
+
+
- - + +
- +

=

- +
@@ -201,6 +202,10 @@ default: () => { return null } + }, + size:{ + type: String, + default: '' } }, // watch: { @@ -320,6 +325,7 @@ if (this.radio == '') { this.$message.error('请选择一个字段,或者选择取消') } else { + // console.log(this.tempcur) if (this.tempcur.split('###')[1] === "Data") { this.Data.forEach((value, index) => { if (index === parseInt(this.tempcur.split('###')[0])) { @@ -330,10 +336,11 @@ } }) } else if (this.tempcur.split('###')[1] === "out") { - console.log(this.outcontent) + // console.log(this.outcontent) this.outcontent.forEach((value, index) => { if (index === parseInt(this.tempcur.split('###')[0])) { value.fieldId = this.radio + value.fieldEn = this.mixinGetvalueEn(value.fieldId) // value.fieldEn = this.mixinGetvalueEn(this.radio) this.$set(value,'fieldEn',this.mixinGetvalueEn(this.radio)) value.fieldValue = '' diff --git a/h5-enginex-manager/src/components/page/tendencyAnalyse.vue b/h5-enginex-manager/src/components/page/tendencyAnalyse.vue index 4804b3d..e71e717 100644 --- a/h5-enginex-manager/src/components/page/tendencyAnalyse.vue +++ b/h5-enginex-manager/src/components/page/tendencyAnalyse.vue @@ -89,7 +89,8 @@ style="text-align: center;font-size: 100px;color: #d0d0d0;margin-top: 50px;user-select: none;"> 请选择引擎信息

- +
diff --git a/h5-enginex-manager/src/main.js b/h5-enginex-manager/src/main.js index a003e02..6cfd33c 100644 --- a/h5-enginex-manager/src/main.js +++ b/h5-enginex-manager/src/main.js @@ -17,7 +17,7 @@ import store from './store' import './styles/index.scss'; // global css import myMixin from '@/utils/mixin.js'; - +import myCascader from './components/common/Cascader' // import 'codemirror/lib/codemirror.css' // import VueCodemirror from 'vue-codemirror' @@ -36,6 +36,9 @@ const i18n = new VueI18n({ }); +Vue.component("myCascader",myCascader) + + Date.prototype.format = function(fmt) { var o = { "M+": this.getMonth() + 1, //月份 diff --git a/h5-enginex-manager/src/store/index.js b/h5-enginex-manager/src/store/index.js index 1d30dca..88045a6 100644 --- a/h5-enginex-manager/src/store/index.js +++ b/h5-enginex-manager/src/store/index.js @@ -212,7 +212,7 @@ export default new Vuex.Store({ value: value.fieldEn, valueType: value.valueType, jsonValue: value.jsonValue, - children: GetdeepObj(JSON.parse(value.jsonValue)) + children: GetdeepObj(JSON.parse(value.jsonValue),true,true,true) } } else { return { diff --git a/h5-enginex-manager/src/utils/GetdeepObj.js b/h5-enginex-manager/src/utils/GetdeepObj.js index 0f8e56c..12cda06 100644 --- a/h5-enginex-manager/src/utils/GetdeepObj.js +++ b/h5-enginex-manager/src/utils/GetdeepObj.js @@ -1,4 +1,4 @@ -export const GetdeepObj = (obj, length = true ,first=false) => { +export const GetdeepObj = (obj, length = true ,first=false,my = false) => { if (typeof obj == 'object' && !Array.isArray(obj)) { let arr = [] for (let key in obj) { @@ -20,7 +20,15 @@ export const GetdeepObj = (obj, length = true ,first=false) => { obj2.children.push({ value: '[]', label: '第一项', - children: GetdeepObj(obj[key][0], length,first) + children: GetdeepObj(obj[key][0], length,first,my) + }) + } + if (my) { + console.log(1) + obj2.children.push({ + value: 'array', + label: '本身', + valueType: 7, }) } arr.push(obj2) @@ -28,7 +36,7 @@ export const GetdeepObj = (obj, length = true ,first=false) => { arr.push({ value: key, label: key, - children: GetdeepObj(obj[key], length,first) + children: GetdeepObj(obj[key], length,first,my) }) } else { arr.push({ @@ -54,7 +62,14 @@ export const GetdeepObj = (obj, length = true ,first=false) => { obj.push({ value: '[0]', label: '第一项', - children: GetdeepObj(obj[0], length,first) + children: GetdeepObj(obj[0], length,first,my) + }) + } + if (my) { + obj.push({ + value: 'array', + label: '本身', + valueType: 7, }) } diff --git a/h5-enginex-manager/src/utils/mixin.js b/h5-enginex-manager/src/utils/mixin.js index 7568084..66e84c0 100644 --- a/h5-enginex-manager/src/utils/mixin.js +++ b/h5-enginex-manager/src/utils/mixin.js @@ -80,6 +80,7 @@ export default { }, mixinGetValueTypeByJSONEn(e){ if(!e||e.length==0) return + if(typeof e == 'string') e = e.split('.') if(!Array.isArray(e)) e=e.split('.') let obj =this.FieldUserObj e.forEach((value,index)=>{