3 次代碼提交 72a6a74e87 ... 5b10abc9a1

作者 SHA1 備註 提交日期
  yangfan 5b10abc9a1 Merge remote-tracking branch 'origin/1.2.2' into 1.2.2 3 月之前
  yangfan 013d0ece96 Merge remote-tracking branch 'origin/1.2.2' into 1.2.2 3 月之前
  yangfan 1c75a8939f 卡片回填数据修正 3 月之前

+ 138 - 156
src/components/CardTemplate/index.vue

@@ -4,49 +4,46 @@
     <div v-if="cardInfo.value == 1" class="flex-card" :style="cardBoxStyle">
       <div v-for="(dataInfo, dataIndex) in cardList" :key="dataIndex" class="box-card">
         <el-card :style="cardStyle">
-          <div slot="header"
-               :style="cardInfo.title.class != '' && cardInfo.title.class ? JSON.parse(cardInfo.title.class) : {}"
-               class="clearfix">
+          <div slot="header" :style="cardInfo.title.class != '' && cardInfo.title.class ? JSON.parse(cardInfo.title.class) : {}" class="clearfix">
             <div class="titleLeft" :style="titleStyle">
               <span v-if="cardInfo.title.text != ''">
-                {{ cardInfo.title.text + ":" }}
+                {{ cardInfo.title.text + ':' }}
               </span>
               <el-tooltip v-if="cardInfo.title.model != ''" effect="dark" placement="right-start">
                 <div slot="content">
-                  {{ getModelName(cardInfo.title, dataInfo, "title") }}
+                  {{ getModelName(cardInfo.title, dataInfo, 'title') }}
                 </div>
                 <span>
-                  {{ getModelName(cardInfo.title, dataInfo, "title") }}
+                  {{ getModelName(cardInfo.title, dataInfo, 'title') }}
                 </span>
               </el-tooltip>
             </div>
             <div class="titleRight" :style="subTitleStyle">
               <span v-if="cardInfo.subTitle.text != ''">
-                {{ cardInfo.subTitle.text + ":" }}
+                {{ cardInfo.subTitle.text + ':' }}
               </span>
               <el-tooltip v-if="cardInfo.subTitle.model != ''" effect="dark" placement="right-start">
                 <div slot="content">
-                  {{ getModelName(cardInfo.subTitle, dataInfo, "subTitle") }}
+                  {{ getModelName(cardInfo.subTitle, dataInfo, 'subTitle') }}
                 </div>
                 <span>
-                  {{ getModelName(cardInfo.subTitle, dataInfo, "subTitle") }}
+                  {{ getModelName(cardInfo.subTitle, dataInfo, 'subTitle') }}
                 </span>
               </el-tooltip>
             </div>
           </div>
-          <div v-if="cardInfo.info.data.length > 0" style="padding: 15px"
-               :style="cardInfo.info.class != '' && cardInfo.info.class ? JSON.parse(cardInfo.info.class) : {}">
+          <div v-if="cardInfo.info.data.length > 0" style="padding: 15px" :style="cardInfo.info.class != '' && cardInfo.info.class ? JSON.parse(cardInfo.info.class) : {}">
             <el-row :gutter="10">
               <el-col v-for="(item, index) in cardInfo.info.data" :key="index" :span="cardInfo.info.col">
                 <div class="flex-row" :style="infoStyle">
-                  <div class="left" v-if="item.text != ''">{{ item.text + ":" }}</div>
+                  <div class="left" v-if="item.text != ''">{{ item.text + ':' }}</div>
                   <div class="right">
                     <el-tooltip v-if="item.model != ''" effect="dark" placement="right-start">
                       <div slot="content">
-                        {{ getModelName(item, dataInfo, "info") }}
+                        {{ getModelName(item, dataInfo, 'info') }}
                       </div>
                       <span>
-                        {{ getModelName(item, dataInfo, "info") }}
+                        {{ getModelName(item, dataInfo, 'info') }}
                       </span>
                     </el-tooltip>
                   </div>
@@ -57,10 +54,8 @@
               <div class="btns">
                 <template v-for="(item, i) in btnList">
                   <template v-if="item.value == 'edit'">
-                    <el-button size="mini" type="text" :key="i"
-                               :disabled="config.webType == 3 && [1, 2, 5].indexOf(data.flowState) > -1"
-                               @click="columnBtnsHandel(item.value, dataInfo)"
-                    >{{ item.label }}
+                    <el-button size="mini" type="text" :key="i" :disabled="config.webType == 3 && [1, 2, 5].indexOf(data.flowState) > -1" @click="columnBtnsHandel(item.value, dataInfo)"
+                      >{{ item.label }}
                     </el-button>
                   </template>
                   <template v-if="item.value == 'remove'">
@@ -71,7 +66,7 @@
                       class="JNPF-table-delBtn"
                       :disabled="config.webType == 3 && [1, 2, 3, 5].indexOf(dataInfo.flowState) > -1"
                       @click="columnBtnsHandel(item.value, dataInfo, item)"
-                    >{{ item.label }}
+                      >{{ item.label }}
                     </el-button>
                   </template>
                   <template v-if="item.value == 'detail'">
@@ -101,35 +96,33 @@
           <div :style="cardInfo.title.class != '' && cardInfo.title.class ? JSON.parse(cardInfo.title.class) : {}">
             <div :style="titleStyle">
               <span v-if="cardInfo.title.text != ''">
-                {{ cardInfo.title.text + ":" }}
+                {{ cardInfo.title.text + ':' }}
               </span>
               <el-tooltip v-if="cardInfo.title.model != ''" effect="dark" placement="right-start">
                 <div slot="content">
-                  {{ getModelName(cardInfo.title, dataInfo, "title") }}
+                  {{ getModelName(cardInfo.title, dataInfo, 'title') }}
                 </div>
                 <span>
-                  {{ getModelName(cardInfo.title, dataInfo, "title") }}
+                  {{ getModelName(cardInfo.title, dataInfo, 'title') }}
                 </span>
               </el-tooltip>
             </div>
           </div>
-          <el-image class="img" :style="{ height: cardInfo.imgHeight + 'px', width: '94%', marginLeft: '3%' }"
-                    :src="imgVal(dataInfo)" alt="">
+          <el-image class="img" :style="{ height: cardInfo.imgHeight + 'px', width: '94%', marginLeft: '3%' }" :src="imgVal(dataInfo)" alt="">
             <div slot="error" class="image-slot">暂无图片</div>
           </el-image>
-          <div v-if="cardInfo.info.data.length > 0" style="padding: 15px"
-               :style="cardInfo.info.class != '' && cardInfo.info.class ? JSON.parse(cardInfo.info.class) : {}">
+          <div v-if="cardInfo.info.data.length > 0" style="padding: 15px" :style="cardInfo.info.class != '' && cardInfo.info.class ? JSON.parse(cardInfo.info.class) : {}">
             <el-row :gutter="10">
               <el-col v-for="(item, index) in cardInfo.info.data" :key="index" :span="cardInfo.info.col">
                 <div class="flex-row" :style="infoStyle">
-                  <div class="left" v-if="item.text != ''">{{ item.text + ":" }}</div>
+                  <div class="left" v-if="item.text != ''">{{ item.text + ':' }}</div>
                   <div class="right">
                     <el-tooltip v-if="item.model != ''" effect="dark" placement="right-start">
                       <div slot="content">
-                        {{ getModelName(item, dataInfo, "info") }}
+                        {{ getModelName(item, dataInfo, 'info') }}
                       </div>
                       <div>
-                        {{ getModelName(item, dataInfo, "info") }}
+                        {{ getModelName(item, dataInfo, 'info') }}
                       </div>
                     </el-tooltip>
                   </div>
@@ -140,10 +133,8 @@
               <div class="btns">
                 <template v-for="(item, i) in btnList">
                   <template v-if="item.value == 'edit'">
-                    <el-button size="mini" type="text" :key="i"
-                               :disabled="config.webType == 3 && [1, 2, 5].indexOf(data.flowState) > -1"
-                               @click="columnBtnsHandel(item.value, dataInfo)"
-                    >{{ item.label }}
+                    <el-button size="mini" type="text" :key="i" :disabled="config.webType == 3 && [1, 2, 5].indexOf(data.flowState) > -1" @click="columnBtnsHandel(item.value, dataInfo)"
+                      >{{ item.label }}
                     </el-button>
                   </template>
                   <template v-if="item.value == 'remove'">
@@ -154,7 +145,7 @@
                       class="JNPF-table-delBtn"
                       :disabled="config.webType == 3 && [1, 2, 3, 5].indexOf(dataInfo.flowState) > -1"
                       @click="columnBtnsHandel(item.value, dataInfo, item)"
-                    >{{ item.label }}
+                      >{{ item.label }}
                     </el-button>
                   </template>
                   <template v-if="item.value == 'detail'">
@@ -190,19 +181,18 @@
               </div>
             </div>
             <div class="flex-right">
-              <div class="item-left"
-                   :style="cardInfo.info.class != '' && cardInfo.info.class ? JSON.parse(cardInfo.info.class) : {}">
-                <div v-if="cardInfo.info.data.length > 0" :style="infoStyle" style="width:100%">
+              <div class="item-left" :style="cardInfo.info.class != '' && cardInfo.info.class ? JSON.parse(cardInfo.info.class) : {}">
+                <div v-if="cardInfo.info.data.length > 0" :style="infoStyle" style="width: 100%">
                   <div class="item-row" v-for="(item, index) in cardInfo.info.data" :key="index">
-                    <div class="left" v-if="item.text != ''">{{ item.text + ":" }}</div>
+                    <div class="left" v-if="item.text != ''">{{ item.text + ':' }}</div>
                     <div class="right">
-<!--                      {{ getModelName(item, dataInfo, "info") }}-->
+                      <!--                      {{ getModelName(item, dataInfo, "info") }}-->
                       <el-tooltip v-if="item.model != ''" effect="dark" placement="right-start">
                         <div slot="content">
-                          {{ getModelName(item, dataInfo, "info") }}
+                          {{ getModelName(item, dataInfo, 'info') }}
                         </div>
                         <span>
-                        {{ getModelName(item, dataInfo, "info") }}
+                          {{ getModelName(item, dataInfo, 'info') }}
                         </span>
                       </el-tooltip>
                     </div>
@@ -213,17 +203,13 @@
                 <div class="item-footer" v-if="btnList.length > 0">
                   <div class="item-btns" v-for="(item, i) in btnList" :key="i">
                     <div v-if="item.value == 'edit'">
-                      <el-button size="mini" type="primary"
-                                 :disabled="config.webType == 3 && [1, 2, 5].indexOf(data.flowState) > -1"
-                                 @click="columnBtnsHandel(item.value, dataInfo)"
-                      >{{ item.label }}
+                      <el-button size="mini" type="primary" :disabled="config.webType == 3 && [1, 2, 5].indexOf(data.flowState) > -1" @click="columnBtnsHandel(item.value, dataInfo)"
+                        >{{ item.label }}
                       </el-button>
                     </div>
                     <div v-if="item.value == 'remove'">
-                      <el-button size="mini" type="danger"
-                                 :disabled="config.webType == 3 && [1, 2, 3, 5].indexOf(dataInfo.flowState) > -1"
-                                 @click="columnBtnsHandel(item.value, dataInfo, item)"
-                      >{{ item.label }}
+                      <el-button size="mini" type="danger" :disabled="config.webType == 3 && [1, 2, 3, 5].indexOf(dataInfo.flowState) > -1" @click="columnBtnsHandel(item.value, dataInfo, item)"
+                        >{{ item.label }}
                       </el-button>
                     </div>
                     <div v-if="item.value == 'detail'">
@@ -251,19 +237,17 @@
     <div v-else-if="cardInfo.value == 4" class="flex-card" :style="cardBoxStyle">
       <div v-for="(dataInfo, dataIndex) in cardList" :key="dataIndex" class="box-card">
         <el-card :style="cardStyle2(cardInfo.subTitle, dataInfo)">
-          <div slot="header"
-               :style="cardInfo.title.class != '' && cardInfo.title.class ? JSON.parse(cardInfo.title.class) : {}"
-               class="clearfix">
+          <div slot="header" :style="cardInfo.title.class != '' && cardInfo.title.class ? JSON.parse(cardInfo.title.class) : {}" class="clearfix">
             <div class="titleLeft" :style="titleStyle">
               <span v-if="cardInfo.title.text != ''">
-                {{ cardInfo.title.text + ":" }}
+                {{ cardInfo.title.text + ':' }}
               </span>
               <el-tooltip v-if="cardInfo.title.model != ''" effect="dark" placement="right-start">
                 <div slot="content">
-                  {{ getModelName(cardInfo.title, dataInfo, "title") }}
+                  {{ getModelName(cardInfo.title, dataInfo, 'title') }}
                 </div>
                 <span>
-                  {{ getModelName(cardInfo.title, dataInfo, "title") }}
+                  {{ getModelName(cardInfo.title, dataInfo, 'title') }}
                 </span>
               </el-tooltip>
             </div>
@@ -281,19 +265,18 @@
               </el-tooltip> -->
             </div>
           </div>
-          <div v-if="cardInfo.info.data.length > 0" style="padding: 15px"
-               :style="cardInfo.info.class != '' && cardInfo.info.class ? JSON.parse(cardInfo.info.class) : {}">
+          <div v-if="cardInfo.info.data.length > 0" style="padding: 15px" :style="cardInfo.info.class != '' && cardInfo.info.class ? JSON.parse(cardInfo.info.class) : {}">
             <el-row :gutter="10">
               <el-col v-for="(item, index) in cardInfo.info.data" :key="index" :span="cardInfo.info.col">
                 <div class="flex-row" :style="infoStyle">
-                  <div class="left" v-if="item.text != ''">{{ item.text + ":" }}</div>
+                  <div class="left" v-if="item.text != ''">{{ item.text + ':' }}</div>
                   <div class="right">
                     <el-tooltip v-if="item.model != ''" effect="dark" placement="right-start">
                       <div slot="content">
-                        {{ getModelName(item, dataInfo, "info") }}
+                        {{ getModelName(item, dataInfo, 'info') }}
                       </div>
                       <span>
-                        {{ getModelName(item, dataInfo, "info") }}
+                        {{ getModelName(item, dataInfo, 'info') }}
                       </span>
                     </el-tooltip>
                   </div>
@@ -304,10 +287,8 @@
               <div class="btns">
                 <template v-for="(item, i) in btnList">
                   <template v-if="item.value == 'edit'">
-                    <el-button size="mini" :key="i"
-                               :disabled="config.webType == 3 && [1, 2, 5].indexOf(data.flowState) > -1"
-                               @click="columnBtnsHandel(item.value, dataInfo)"
-                    >{{ item.label }}
+                    <el-button size="mini" :key="i" :disabled="config.webType == 3 && [1, 2, 5].indexOf(data.flowState) > -1" @click="columnBtnsHandel(item.value, dataInfo)"
+                      >{{ item.label }}
                     </el-button>
                   </template>
                   <template v-if="item.value == 'remove'">
@@ -317,7 +298,7 @@
                       class="JNPF-table-delBtn"
                       :disabled="config.webType == 3 && [1, 2, 3, 5].indexOf(dataInfo.flowState) > -1"
                       @click="columnBtnsHandel(item.value, dataInfo, item)"
-                    >{{ item.label }}
+                      >{{ item.label }}
                     </el-button>
                   </template>
                   <template v-if="item.value == 'detail'">
@@ -347,51 +328,51 @@
 </template>
 
 <script>
-import { dataapiDetail, dataapiUrl } from "@/api/systemData/dataInterface";
-import { comUrl } from "@/utils/define";
+import { dataapiDetail, dataapiUrl } from '@/api/systemData/dataInterface'
+import { comUrl } from '@/utils/define'
 
 export default {
   props: {
     cardInfo: {
       type: Object,
       default: () => {
-        return {};
+        return {}
       }
     },
     modelList: {
       type: Array,
       default: () => {
-        return [];
+        return []
       }
     },
     cardData: {
       type: Array,
       default: () => {
-        return [];
+        return []
       }
     },
     columnList: {
       type: Array,
       default: () => {
-        return [];
+        return []
       }
     },
     columnDict: {
       type: Object,
       default: () => {
-        return {};
+        return {}
       }
     },
     btnList: {
       type: Array,
       default: () => {
-        return [];
+        return []
       }
     },
     config: {
       type: Object,
       default: () => {
-        return {};
+        return {}
       }
     }
   },
@@ -401,104 +382,105 @@ export default {
         border: `1px solid ${this.cardInfo.borderColor}`,
         boxShadow: `0 2px ${this.cardInfo.shadowPx}px 0 ${this.cardInfo.shadowColor} !important`,
         backgroundColor: `${this.cardInfo.bgColor} !important`
-      };
+      }
 
-      return { ...style };
+      return { ...style }
     },
     cardBoxStyle() {
       let style = {
-        "--gridTemplateColumns": this.cardInfo.rowNum,
+        '--gridTemplateColumns': this.cardInfo.rowNum,
         gap: `${this.cardInfo.gap}px`
-      };
-      return { ...style };
+      }
+      return { ...style }
     },
     infoStyle() {
       let style = {
-        fontSize: this.cardInfo.info.size + "px",
+        fontSize: this.cardInfo.info.size + 'px',
         color: this.cardInfo.info.color
-      };
-      return { ...style };
+      }
+      return { ...style }
     },
     titleStyle() {
       let style = {
-        fontSize: this.cardInfo.title.size + "px",
+        fontSize: this.cardInfo.title.size + 'px',
         color: this.cardInfo.title.color
-      };
-      return { ...style };
+      }
+      return { ...style }
     },
     subTitleStyle() {
       let style = {
-        fontSize: this.cardInfo.subTitle.size + "px",
+        fontSize: this.cardInfo.subTitle.size + 'px',
         color: this.cardInfo.subTitle.color
-      };
-      return { ...style };
+      }
+      return { ...style }
     }
   },
   data() {
     return {
       cardList: []
-    };
+    }
   },
   async created() {
-    await this.columnList.forEach( (item) => {
+    await this.columnList.forEach((item) => {
       if (item.propsUrl && item.propsUrl.length) {
-         dataapiDetail(item.params.propsUrl).then( (res) => {
-          let { data, code } = res.data;
+        dataapiDetail(item.params.propsUrl).then((res) => {
+          let { data, code } = res.data
           if (code == 200) {
-             dataapiUrl(data.apiUrl).then((result) => {
+            dataapiUrl(data.apiUrl).then((result) => {
               // console.log(result)
               if (this.cardInfo.title.model == item.propId) {
-                this.cardInfo.title.apiData = result.data.data;
-                this.cardInfo.title.apiProps = item.params.apiProps;
+                this.cardInfo.title.apiData = result.data.data
+                this.cardInfo.title.apiProps = item.params.apiProps
               }
               if (this.cardInfo.subTitle.model == item.propId) {
-                this.cardInfo.title.apiData = result.data.data;
-                this.cardInfo.title.apiProps = item.params.apiProps;
+                this.cardInfo.title.apiData = result.data.data
+                this.cardInfo.title.apiProps = item.params.apiProps
               }
               if (this.cardInfo.info.data.length > 0) {
                 this.cardInfo.info.data.map((val) => {
                   if (val.model == item.propId) {
-                    val.apiData = result.data.data;
-                    val.apiProps = item.params.apiProps;
-                    return val;
+                    val.apiData = result.data.data
+                    val.apiProps = item.params.apiProps
+                    return val
                   }
-                });
+                })
               }
-            });
+            })
           }
           // if(res.)
-        });
+        })
       }
       if (this.cardInfo.title.model == item.propId) {
-        this.cardInfo.title.field = item.field;
+        this.cardInfo.title.field = item.field
       }
       if (this.cardInfo.subTitle.model == item.propId) {
-        this.cardInfo.subTitle.field = item.field;
+        this.cardInfo.subTitle.field = item.field
       }
       if (this.cardInfo.info.data.length > 0) {
         this.cardInfo.info.data.map((val) => {
           if (val.model == item.propId) {
-            val.field = item.field;
-            return val;
+            val.field = item.field
+            return val
           }
-        });
+        })
       }
-    });
+    })
 
     setTimeout(() => {
       if (this.modelList.length > 0) {
-        this.cardList = 10;
+        this.cardList = 10
       } else {
         if (this.cardData.length > 0) {
           this.cardList = this.cardData.map((item) => {
             return {
               ...item,
               checked: false
-            };
-          });
+            }
+          })
+          console.log(this.cardData)
         }
       }
-    }, 1000);
+    }, 1000)
   },
   methods: {
     cardStyle2(model, item) {
@@ -506,110 +488,110 @@ export default {
         border: `1px solid ${this.cardInfo.borderColor}`,
         boxShadow: `0 2px ${this.cardInfo.shadowPx}px 0 ${this.cardInfo.shadowColor} !important`,
         background: `linear-gradient(to bottom, ${this.cardInfo.bgColor} 0%, #ffffff 80%)`
-      };
+      }
       if (this.cardInfo.termInfo.length > 0) {
         this.cardInfo.termInfo.forEach((val) => {
-          if (val.string == "==" && val.val == item[this.cardInfo.subTitle.field]) {
-            style.background = `linear-gradient(to bottom, ${val.style} 0%, #ffffff 80%)  `;
+          if (val.string == '==' && val.val == item[this.cardInfo.subTitle.field]) {
+            style.background = `linear-gradient(to bottom, ${val.style} 0%, #ffffff 80%)  `
           }
-          if (val.string == ">" && item[this.cardInfo.subTitle.field] > val.val) {
-            style.background = `linear-gradient(to bottom, ${val.style} 0%, #ffffff 80%)  `;
+          if (val.string == '>' && item[this.cardInfo.subTitle.field] > val.val) {
+            style.background = `linear-gradient(to bottom, ${val.style} 0%, #ffffff 80%)  `
           }
-          if (val.string == "<" && item[this.cardInfo.subTitle.field] < val.val) {
-            style.background = `linear-gradient(to bottom, ${val.style} 0%, #ffffff 80%)  `;
+          if (val.string == '<' && item[this.cardInfo.subTitle.field] < val.val) {
+            style.background = `linear-gradient(to bottom, ${val.style} 0%, #ffffff 80%)  `
           }
-        });
+        })
       }
-      return { ...style };
+      return { ...style }
     },
     checkChange() {
-      let records = this.cardList.filter((item) => item.checked == true);
-      this.$parent.handleSelectionChange({ records: records });
+      let records = this.cardList.filter((item) => item.checked == true)
+      this.$parent.handleSelectionChange({ records: records })
     },
     imgVal(data) {
       if (this.modelList.length > 0) {
-        return "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg";
+        return 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg'
       } else {
-        if (this.cardInfo.imgModel && this.cardInfo.imgModel !== "") {
-          let imgFiledId = this.columnList.find((val) => val.propId == this.cardInfo.imgModel)?.propId;
-          if (imgFiledId && data[this.columnDict[imgFiledId]] !== "" && data[this.columnDict[imgFiledId]] != null && data[this.columnDict[imgFiledId]] !== undefined) {
-            let url = data[this.columnDict[imgFiledId]].split(",")[0];
-            return comUrl + "/api/file/getFileInputStreamById/" + url;
+        if (this.cardInfo.imgModel && this.cardInfo.imgModel !== '') {
+          let imgFiledId = this.columnList.find((val) => val.propId == this.cardInfo.imgModel)?.propId
+          if (imgFiledId && data[this.columnDict[imgFiledId]] !== '' && data[this.columnDict[imgFiledId]] != null && data[this.columnDict[imgFiledId]] !== undefined) {
+            let url = data[this.columnDict[imgFiledId]].split(',')[0]
+            return comUrl + '/api/file/getFileInputStreamById/' + url
           }
         }
       }
     },
     columnBtnsHandel(value, data) {
-      this.$parent.columnBtnsHandel(value, data);
+      this.$parent.columnBtnsHandel(value, data)
     },
     getModelName(model, item, type) {
       if (this.modelList.length > 0) {
-        let name = this.modelList.find((m) => m.__vModel__ == model.model);
+        let name = this.modelList.find((m) => m.__vModel__ == model.model)
         if (name != undefined) {
-          return `$${name.__config__.label}$`;
+          return `$${name.__config__.label}$`
         } else {
-          return "";
+          return ''
         }
       } else {
-        if (type == "title") {
+        if (type == 'title') {
           if (this.cardInfo.title.model == model.model) {
             if (model.apiData) {
               let result = model.apiData.find((val) => {
                 if (val[model.apiProps.value] == item[this.cardInfo.title.field]) {
-                  return val;
+                  return val
                 }
-              })?.[model.apiProps.label];
+              })?.[model.apiProps.label]
               if (result != undefined) {
-                return result;
+                return result
               } else {
-                return item[this.cardInfo.title.field];
+                return item[this.columnDict[model.model]]
               }
             } else {
-              return item[this.cardInfo.title.field];
+              return item[this.columnDict[model.model]]
             }
           }
-        } else if (type == "subTitle") {
+        } else if (type == 'subTitle') {
           if (model.apiData) {
             let result = model.apiData.find((val) => {
               if (val[model.apiProps.value] == item[this.cardInfo.subTitle.field]) {
-                return val;
+                return val
               }
-            })?.[model.apiProps.label];
+            })?.[model.apiProps.label]
             if (result != undefined) {
-              return result;
+              return result
             } else {
-              return item[this.cardInfo.subTitle.field];
+              return item[this.columnDict[model.model]]
             }
           } else {
-            return item[this.cardInfo.subTitle.field];
+            return item[this.columnDict[model.model]]
           }
-        } else if (type == "info") {
-          let field = this.cardInfo.info.data.find((val) => val.model == model.model)?.field;
+        } else if (type == 'info') {
+          let field = this.cardInfo.info.data.find((val) => val.model == model.model)?.field
           if (field != undefined) {
             if (model.apiData) {
               let result = model.apiData.find((val) => {
                 if (val[model.apiProps.value] == item[field]) {
-                  return val;
+                  return val
                 }
-              })?.[model.apiProps.label];
+              })?.[model.apiProps.label]
               if (result != undefined) {
-                return result;
+                return result
               } else {
-                return item[field];
+                return item[this.columnDict[model.model]]
               }
             } else {
-              return item[field];
+              return item[this.columnDict[model.model]]
             }
           } else {
-            return "";
+            return ''
           }
         } else {
-          return "";
+          return ''
         }
       }
     }
   }
-};
+}
 </script>
 
 <style lang="scss" scoped>

+ 16 - 7
src/components/Dataset-filter/util.js

@@ -45,7 +45,7 @@ export const getdefaultAPIData = (item, componentList, type, scheme, cascaderDat
     let leveType = item.cascaderType
     if (formAllVar && formAllVar.length && componentList && componentList.length) {
       if (formAllVar[0] === 3) {
-        let varObbj = componentList.find((o) => o.__vModel__ && o.__vModel__ === formAllVar[1])
+        let varObbj = componentList.find((o) => o.__vModel__ && o.__vModel__ == formAllVar[1])
         if (type === 'search') {
           sessionStorage.setItem(`FORM_${item.__vModel__}`, varObbj.value)
           resolve(varObbj.value)
@@ -83,13 +83,22 @@ export const getdefaultAPIData = (item, componentList, type, scheme, cascaderDat
           if (!obnj) return
           if (!config.defaultValue) return
           let matrix = scheme.__slot__.options
-          //从当前配置API返回值变量组件的下拉选项中匹配到与选中值符合的对象
-          let obj = matrix.find((x) => config.defaultValue === x.id)
-          for (const cur of config.ApiReturn) {
-            // 储存全局变量
-            sessionStorage.setItem(`API_${cur.varName}`, obj[cur.keyName])
+          if (!matrix.length) {
+            //input输入框接口返回
+            setTimeout(() => {
+              const sessionValue = sessionStorage.getItem(`API_${obnj.varName}`)
+              resolve(sessionValue)
+            }, 1000)
+          } else {
+            //从当前配置API返回值变量组件的下拉选项中匹配到与选中值符合的对象
+            let obj = matrix.find((x) => config.defaultValue === x.id)
+            for (const cur of config.ApiReturn) {
+              // 储存全局变量
+              sessionStorage.setItem(`API_${cur.varName}`, obj[cur.keyName])
+            }
+            resolve(obj[obnj.keyName])
           }
-          resolve(obj[obnj.keyName])
+
           // })
         }
       }

+ 34 - 4
src/components/Generator/components/NewInput/index.vue

@@ -1,7 +1,20 @@
 <template>
-  <div class="JNPFAmount"><el-input-number style="width: 80% !important" v-model="innerValue" v-bind="$attrs" v-on="$listeners"> </el-input-number> /元</div>
+  <div class="JNPFInput">
+    <div class="JNPFInput-input">
+      <el-input style="width: 99% !important" v-model="innerValue" v-bind="$attrs" v-on="$listeners" @change="getChange"></el-input>
+    </div>
+    <div v-if="$attrs.isScan" class="JNPFInput-scan">
+      <svg data-v-217a6391="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(24,144,255,1)">
+        <path data-v-217a6391="" d="M15 3H21V8H19V5H15V3ZM9 3V5H5V8H3V3H9ZM15 21V19H19V16H21V21H15ZM9 21H3V16H5V19H9V21ZM3 11H21V13H3V11Z"></path>
+      </svg>
+    </div>
+  </div>
 </template>
 <script>
+import { dyOptionsList } from '@/components/Generator/generator/comConfig'
+import { dictDetail } from '@/api/newbi/dict'
+import { getAPIData } from '@/components/Dataset-filter/util'
+
 export default {
   model: {
     prop: 'value',
@@ -19,13 +32,30 @@ export default {
     value(val) {
       this.innerValue = val
     }
+  },
+  mounted() {},
+  methods: {
+    getChange(val) {
+      if (this.$attrs.isScan) {
+        this.$emit('change', val)
+      }
+    }
   }
 }
 </script>
 <style lang="scss" scoped>
-.JNPFAmount {
-  .el-input {
-    width: 90%;
+.JNPFInput {
+  display: flex;
+
+  &-input {
+    flex: 1;
+    width: 100%;
+  }
+
+  &-scan {
+    height: 30px;
+    width: 30px;
+    margin-top: 3px;
   }
 }
 </style>

+ 21 - 4
src/components/Generator/generator/config.js

@@ -34,7 +34,7 @@ export const inputComponents = [
       label: '单行输入',
       labelWidth: undefined,
       showLabel: true,
-      tag: 'el-input',
+      tag: 'NewInput',
       tagIcon: 'icon-ym icon-ym-generator-input',
       defaultValue: undefined,
       required: false,
@@ -44,8 +44,24 @@ export const inputComponents = [
       regList: [],
       trigger: 'blur',
       inputType: '',
-      viewDataType: 'STRING',
-      ApiReturn: []
+
+      dataType: 'dynamic',
+      dictionaryType: '',
+      relationSelectId: '',
+      propsUrl: '',
+      ApiParams: [],
+      ApiReturn: [],
+      apiProps: {
+        label: '',
+        value: '',
+        fitLabel: [],
+        labelSeparator: ''
+      },
+      props: {
+        label: 'fullName',
+        value: 'id'
+      },
+      viewDataType: 'STRING'
     },
     defaultVarType: [], //api全局表单变量
     cascaderType: '', // 级联父子级
@@ -73,6 +89,7 @@ export const inputComponents = [
     allVar: false,
     isUrl: false,
     isText: false,
+    isScan: false,
     anotherName: false,
     anotherNameList: [],
     ApiReturn: [],
@@ -954,7 +971,7 @@ export const selectComponents = [
       foreignModel: '',
       foreignModelName: '',
       itemRelationTable: '',
-      filterColumnList:[{columnId:'',viewDataType:'STRING',function:'like',value:''}]
+      filterColumnList: [{ columnId: '', viewDataType: 'STRING', function: 'like', value: '' }]
     },
     relationConfFlag: true,
     relationColumnList: [],

+ 294 - 46
src/components/Generator/index/RightComponents/ComInput.vue

@@ -156,35 +156,11 @@
     <template v-if="activeData.isScan">
       <el-form-item label="" label-width="40px">
         <el-radio-group v-model="activeData.__config__.dataType" size="small" style="text-align: center" @change="dataTypeChange">
-          <el-radio-button label="static">静态数据</el-radio-button>
-          <el-radio-button label="dictionary">数据字典</el-radio-button>
+          <!--          <el-radio-button label="static">静态数据</el-radio-button>-->
+          <!--          <el-radio-button label="dictionary">数据字典</el-radio-button>-->
           <el-radio-button label="dynamic">API数据</el-radio-button>
         </el-radio-group>
       </el-form-item>
-      <template v-if="activeData.__config__.dataType === 'static'">
-        <draggable :list="activeData.__slot__.options" :animation="340" group="selectItem" handle=".option-drag">
-          <div v-for="(item, index) in activeData.__slot__.options" :key="index" class="select-item">
-            <div class="select-line-icon option-drag">
-              <i class="el-icon-s-operation" />
-            </div>
-            <el-input v-model="item.fullName" placeholder="选项名(value)" size="small" @input="optionsChange($event, item)" />
-            <el-input v-model="item.id" placeholder="选项值(key)" size="small" @input="optionsChange($event, item)" />
-            <el-input v-if="activeData.__config__.relationSelectId" v-model="item.relation" placeholder="关联关键词" size="small" />
-            <div class="close-btn select-line-icon" @click="activeData.__slot__.options.splice(index, 1)">
-              <i class="el-icon-remove-outline" />
-            </div>
-          </div>
-        </draggable>
-        <div style="margin-left: 29px">
-          <el-button style="padding-bottom: 0" icon="el-icon-circle-plus-outline" type="text" @click="addSelectItem"> 添加选项 </el-button>
-        </div>
-      </template>
-      <!--    <JNPF-TreeSelect :options="treeData" v-model="activeData.__config__.dictionaryType"-->
-      <!--      placeholder="选择数据字典" lastLevel v-if="activeData.__config__.dataType==='dictionary'" clearable>-->
-      <!--    </JNPF-TreeSelect>-->
-      <el-select @change="wallpaperInput" placeholder="选择数据字典" v-model="activeData.__config__.dictionaryType" v-if="activeData.__config__.dataType === 'dictionary'">
-        <el-option v-for="(item, i) of treeData" :key="i" :value="item.id" :label="item.keyCode"></el-option>
-      </el-select>
       <template v-if="activeData.__config__.dataType === 'dynamic'">
         <el-form-item label="API数据">
           <el-cascader
@@ -221,24 +197,6 @@
           </template>
           <el-button size="mini" type="primary" plain @click="previewClick" icon="View">API返回值结构预览</el-button>
         </el-form-item>
-        <el-form-item label="key值">
-          <el-select placeholder="请选择key值" v-model="activeData.__config__.apiProps.value">
-            <el-option v-for="(item, i) of showFields" :key="i" :value="item.columnComments" :label="item.columnName"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="value值">
-          <el-select placeholder="请选择value值" v-model="activeData.__config__.apiProps.label">
-            <el-option v-for="(item, i) of showFields" :key="i" :value="item.columnComments" :label="item.columnName"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="副标题">
-          <el-select placeholder="请选择副标题" multiple v-model="activeData.__config__.apiProps.fitLabel" @change="fitLabelChange">
-            <el-option v-for="(item, i) of showFields" :key="i" :value="item.columnComments" :label="item.columnName"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item v-if="activeData.__config__.apiProps.fitLabel.length" label="标题分隔符">
-          <el-input v-model="activeData.__config__.apiProps.labelSeparator" placeholder="请输入标题分隔符" />
-        </el-form-item>
         <template v-if="activeData.__config__.ApiReturn && activeData.__config__.ApiReturn.length">
           <el-form-item>
             <template slot="label">
@@ -266,7 +224,7 @@
           </el-table>
         </template>
       </template>
-      <el-divider />
+      <!--      <el-divider />-->
     </template>
     <el-divider>校验</el-divider>
     <el-form-item label="是否必填">
@@ -293,6 +251,31 @@
       <el-button type="primary" @click="addReg" style="margin-left: 10px"> 自定义规则 </el-button>
     </div>
     <iconBox :visible.sync="iconsVisible" :current="activeData[currentIconModel]" @choiceIcon="setIcon" />
+    <el-dialog :visible.sync="previewShow" title="API数据结构预览" width="800px" append-to-body class="source-http-preview">
+      <el-table :data="previewArr" border row-key="path" default-expand-all>
+        <el-table-column label="结构">
+          <template #default="scope">
+            {{ scope.row.key }}
+          </template>
+        </el-table-column>
+        <el-table-column label="类型" width="100px" align="center">
+          <template #default="scope">
+            {{ scope.row.type }}
+          </template>
+        </el-table-column>
+        <el-table-column label="jsonpath">
+          <template #default="scope">
+            {{ scope.row.path }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="140px" align="center">
+          <template #default="scope">
+            <el-button v-if="scope.row.type === 'array'" size="small" type="primary" plain @click="getAllPath(scope.row)"> 使用全部子项 </el-button>
+            <el-button v-if="scope.row.type !== 'array' && scope.row.type !== 'object'" size="small" type="primary" plain @click="getPath(scope.row)"> 使用 </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
   </el-row>
 </template>
 <script>
@@ -301,6 +284,11 @@ import customExpression from '@/components/Generator/index/RightComponents/custo
 import columnAnotherName from '@/components/Generator/index/RightComponents/componets/columnAnotherName'
 import comMixin from './mixin'
 import { loopActiveTabelList, loopRelationList, loopRelationTabelList } from '@/utils'
+import { dataapicategoryList, dataapiDetail, dataapiList } from '@/api/systemData/dataInterface'
+import { getparamsys, paramList } from '@/api/newbi/globalParams'
+import { getAPIData } from '@/components/Dataset-filter/util'
+import { openurl } from '@/components/Dataset-filter/report'
+import { param } from '@/components/Dataset-filter/config'
 export default {
   props: ['activeData', 'dbLinkId', 'drawList'],
   mixins: [comMixin],
@@ -374,11 +362,23 @@ export default {
       allVarList: [],
       apiVarList: [],
       varTypeList: [],
-      cascaderTypeshow: false
+      cascaderTypeshow: false,
+
+      treeData: [],
+      dataInterfaceSelector: [],
+      sysVarList: [], //系统变量
+      previewShow: false,
+      previewArr: [],
+      showFields: [],
+      apiJoinName: ''
     }
   },
   created() {
     this.allVarListChange(true)
+    this.getDataInterfaceSelector()
+    if (this.activeData.__config__.dataType === 'dynamic' && this.activeData.__config__.propsUrl) {
+      this.propsUrlChange(this.activeData.__config__.propsUrl)
+    }
   },
   methods: {
     varchange() {
@@ -455,6 +455,254 @@ export default {
         pattern: row.pattern,
         message: row.message
       })
+    },
+
+    dataTypeChange(val) {
+      this.activeData.__config__.defaultValue = this.activeData.multiple ? [] : ''
+      // this.activeData.__slot__.options = []
+      this.activeData.__config__.props.value = 'id'
+      this.activeData.__config__.props.label = 'fullName'
+      if (val === 'static') {
+        this.activeData.__config__.dictionaryType = ''
+        this.activeData.__config__.propsUrl = ''
+        this.activeData.__config__.ApiParams = []
+        this.activeData.__slot__.options = []
+      }
+      if (val === 'dynamic') {
+        this.activeData.__config__.dictionaryType = ''
+      }
+      if (val === 'dictionary') {
+        this.activeData.__config__.propsUrl = ''
+        this.activeData.__config__.ApiParams = []
+      }
+      this.$nextTick(() => {
+        this.$forceUpdate()
+      })
+    },
+    previewClick() {
+      if (!this.activeData.__config__.propsUrl)
+        return this.$message({
+          message: '当前未选择API接口,不支持数据预览',
+          type: 'warning'
+        })
+      dataapiDetail(this.activeData.__config__.propsUrl).then((res) => {
+        let { apiKey } = res.data.data
+        this.apiJoinName = res.data.data.apiName
+        let resJson = JSON.parse(res.data.data.note || '{}')
+        let formVarObj = {}
+        if (resJson.params && resJson.params.length) {
+          resJson.params.forEach((i, k) => {
+            formVarObj[i.key] = i.def
+          })
+        }
+        console.log(apiKey)
+        openurl(apiKey, { ...param, ...formVarObj }).then((res) => {
+          let { data } = res.data
+          console.log(1111, data)
+          try {
+            let arr = []
+            this.previewShow = true
+            this.jsonPath(arr, data, '$')
+            this.previewArr = arr
+            console.log(arr)
+          } catch (e) {
+            this.$message({ message: '接口返回数据格式不支持', type: 'warning' })
+          }
+        })
+      })
+    },
+    jsonPath(arr, json, basePath) {
+      const type = this.validateType(json)
+      if (type === 'object') {
+        for (let key in json) {
+          const item = {
+            key,
+            path: `${basePath}.${key}`
+          }
+          const childType = this.validateType(json[key])
+          item.type = childType
+          if (childType === 'object' || childType === 'array') {
+            item.leaf = true
+            item.children = []
+            this.jsonPath(item.children, json[key], item.path)
+          } else {
+            item.leaf = false
+            item.value = json[key]
+          }
+          arr.push(item)
+        }
+      } else if (type === 'array') {
+        json = json[0]
+        if (json === undefined) return
+        for (let key in json) {
+          const item = {
+            key,
+            path: `${basePath}[*].${key}`
+          }
+          const childType = this.validateType(json[key])
+          item.type = childType
+          if (childType === 'object' || childType === 'array') {
+            item.leaf = true
+            item.children = []
+            this.jsonPath(item.children, json[key], item.path)
+          } else {
+            item.leaf = false
+            item.value = json[key]
+          }
+          arr.push(item)
+        }
+      }
+    },
+    validateType(val) {
+      // 校验JSON数据类型
+      const type = typeof val
+      if (type === 'object') {
+        if (Array.isArray(val)) {
+          return 'array'
+        } else if (val === null) {
+          return 'null'
+        } else {
+          return 'object'
+        }
+      } else {
+        return type
+      }
+    },
+    getDataInterfaceSelector() {
+      this.getAllVarList()
+      this.getAllapiVarList()
+      //获取api列表
+      dataapicategoryList().then((res) => {
+        let category = res.data.data
+        dataapiList({ apiFormal: 1, apiTypes: '1,2' }).then((res) => {
+          let list = res.data.data
+          this.dataInterfaceSelector = category
+            .map((i) => ({
+              label: i.categoryName,
+              value: i.id,
+              children: list.filter((j) => j.categoryId === i.id).map((k) => ({ label: k.apiName, value: k.id, key: k.apiKey }))
+            }))
+            .filter((i) => i.children.length)
+        })
+        this.getSysparamList()
+      })
+    },
+    getSysparamList() {
+      //获取全局系统变量
+      paramList({ paramType: 'SYSTEM' }).then((res) => {
+        let arr = res.data.data.records
+        getparamsys({ dateFormat: 'yyyy_MM_dd' }).then((r) => {
+          let sysVarValue = r.data.data
+          if (sysVarValue) {
+            this.sysVarList = arr
+              .map((i) => {
+                return {
+                  label: i.paramName,
+                  value: sysVarValue[i.paramKey] || null
+                }
+              })
+              .filter((l) => l !== undefined)
+          }
+        })
+        this.varTypeList = [
+          { value: 1, label: '默认值' },
+          { value: 2, label: '系统全局变量', children: this.sysVarList || [] },
+          { value: 3, label: '表单全局变量', children: this.allVarList || [] },
+          { value: 4, label: 'api全局变量', children: this.apiVarList || [] }
+        ]
+        this.$nextTick(() => {
+          this.allVarListChange(true)
+        })
+      })
+    },
+    varNamefitlte(row, val) {
+      if (this.activeData.__config__.ApiReturn.find((i) => i.varName === val && i.keyName !== row.keyName)) {
+        this.activeData.varRepeat = true
+        return this.$message({
+          message: '检测到变量命名重复,请重新输入',
+          type: 'warning'
+        })
+      }
+      if (this.apiVarList.find((i) => i.label === val)) {
+        this.activeData.varRepeat = true
+        return this.$message({
+          message: '检测到变量命名重复,请重新输入',
+          type: 'warning'
+        })
+      }
+      this.activeData.varRepeat = false
+      this.getAllapiVarList()
+      this.varTypeList[3].children = this.apiVarList
+    },
+    varNamefitlteclass(row, val) {
+      let flag = false
+      if (this.activeData.__config__.ApiReturn.find((i) => i.varName === val && i.keyName !== row.keyName)) {
+        flag = true
+      }
+      if (this.apiVarList.filter((i) => i.label === val).length > 1) {
+        flag = true
+      }
+      return flag
+    },
+    apiFilterMethod(node, keyword) {
+      let { label, key } = node.data
+      keyword = keyword.toLowerCase()
+      return label.includes(keyword) || key.toLowerCase().includes(keyword)
+    },
+    fitLabelChange() {
+      if (!this.activeData.__config__.apiProps.fitLabel.length) {
+        this.activeData.__config__.apiProps.labelSeparator = ''
+      }
+    },
+    propsUrlChange(val) {
+      if (!val) {
+        this.activeData.__slot__.options = []
+        return
+      }
+      // this.activeData.__config__.ApiParams = []
+      // this.activeData.__config__.apiProps = {label: '',value: ''}
+      this.activeData.__config__.defaultValue = this.activeData.multiple ? [] : ''
+      //获取api信息
+      dataapiDetail(val).then((res) => {
+        //获取api值
+        getAPIData(this.activeData.__slot__, val, [], [], '', this.activeData.__config__.apiProps).then((res) => {
+          this.$set(this.activeData.__slot__, 'options', res)
+        })
+        let resJson = JSON.parse(res.data.data.note || '{}')
+        this.showFields = resJson.showFields || []
+        if (resJson.params && resJson.params.length) {
+          //添加变量类型 1:默认 2:全局系统变量 3:表单内全局变量
+          if (!this.activeData.__config__.ApiParams.length) {
+            resJson.params.forEach((i, k) => [Object.assign(i, { varType: [1] })])
+            this.activeData.__config__.ApiParams = resJson.params
+          } else {
+            let APIKeylist = resJson.params.map((i) => {
+              return i.key
+            })
+            let paramsList = this.activeData.__config__.ApiParams.filter((l) => APIKeylist.includes(l.key))
+            paramsList.forEach((i, k) => {
+              if (!i.varType) {
+                Object.assign(i, { varType: [1] })
+              }
+            })
+            this.activeData.__config__.ApiParams = paramsList
+          }
+        } else {
+          this.activeData.__config__.ApiParams = []
+        }
+      })
+    },
+    getPath(item) {
+      this.getAPiPath(item)
+    },
+    getAllPath(array) {
+      array.children.forEach((item) => this.getAPiPath(item))
+    },
+    getAPiPath({ key }) {
+      if (this.activeData.__config__.ApiReturn.find((i) => i.keyName === key)) return
+      this.activeData.__config__.ApiReturn.push({ keyName: key, varName: key, apiName: this.apiJoinName })
+      this.getAllapiVarList()
+      this.varTypeList[2].children = this.apiVarList
     }
   }
 }

+ 52 - 8
src/components/Generator/parser/Parser.vue

@@ -28,7 +28,7 @@ const components = {
   formItem(scheme, config, labelWidth, listeners) {
     return [
       scheme.__vModel__ !== this.idKey && !scheme.displayNone && (
-        <el-col span={config.jnpfKey !== 'table' ? config.span === 24 && !config.typeSpan ? this.formConf.span : config.span : 24}>
+        <el-col span={config.jnpfKey !== 'table' ? (config.span === 24 && !config.typeSpan ? this.formConf.span : config.span) : 24}>
           <el-form-item label-width={labelWidth} prop={String(scheme.__vModel__)} key={scheme.__vModel__} label={config.showLabel ? config.label : ''}>
             <render
               formData={this[this.formConf.formModel]}
@@ -65,12 +65,14 @@ const components = {
     ]
   }
 }
+
 function getLogic(h, Ellogic) {
   const { formConfCopy } = this
   //op:绑定组件__vModel__ setType:1选中 2未选中 deVal:符合的值
   const { op, setType, deVal } = Ellogic.__logic__
   const eleList = []
-  let deValList = Array.isArray(deVal) ? deVal : [deVal];
+  let deValList = Array.isArray(deVal) ? deVal : [deVal]
+
   function f(fields) {
     const allFields = loopRelationList(fields)
     allFields.forEach((i) => {
@@ -83,13 +85,21 @@ function getLogic(h, Ellogic) {
       }
     })
   }
+
   f(formConfCopy.fields)
   let el = eleList[0]
-  const result = setType === 1 ? deValList.length ? deValList.includes(el.__config__.defaultValue) : el.__config__ && el.__config__.defaultValue : deValList.length ? !deValList.includes(el.__config__.defaultValue) : el.__config__ && !el.__config__.defaultValue
+  const result =
+    setType === 1
+      ? deValList.length
+        ? deValList.includes(el.__config__.defaultValue)
+        : el.__config__ && el.__config__.defaultValue
+      : deValList.length
+        ? !deValList.includes(el.__config__.defaultValue)
+        : el.__config__ && !el.__config__.defaultValue
   // 如果不符合条件隐藏时 需查询配置是否清空数据
   if (!result) {
-    if (!Ellogic.__vModel__ || !el.__config__?.defaultValue) return;
-    if (Ellogic.__logic__?.hideClear){
+    if (!Ellogic.__vModel__ || !el.__config__?.defaultValue) return
+    if (Ellogic.__logic__?.hideClear) {
       this.$set(Ellogic.__config__, 'defaultValue', null)
       this.$set(this[this.formConf.formModel], Ellogic.__vModel__, null)
     }
@@ -241,7 +251,8 @@ function renderFrom(h) {
         ref={formConfCopy.formRef}
         // model不能直接赋值 https://github.com/vuejs/jsx/issues/49#issuecomment-472013664
         props={{ model: this[formConfCopy.formModel] }}
-        rules={this[formConfCopy.formRules]} class={this.detailType === 'detail' ? 'detailForm' : ''}
+        rules={this[formConfCopy.formRules]}
+        class={this.detailType === 'detail' ? 'detailForm' : ''}
       >
         <el-row gutter={formConfCopy.gutter} class={formConfCopy.formStyle} type="flex" style="flex-wrap:wrap">
           {renderFormItem.call(this, h, formConfCopy.fields)}
@@ -252,10 +263,12 @@ function renderFrom(h) {
     )
   }
 }
+
 function RelationDom(h) {
   const { relationConf } = this
   return <relation-form class="relationBox" relation-conf={relationConf} onChangeRow={this.changeElRowClick} ref="relationBox"></relation-form>
 }
+
 function formBtns(h) {
   return (
     <el-col>
@@ -300,6 +313,13 @@ function setValue(event, config, scheme) {
   // }
   if (scheme.relationValuePrimaryId) this.$set(scheme, 'relationValuePrimaryId', '')
   let mapList = loopRelationList(formConfCopy.fields)
+  if (scheme.allVar && scheme.__config__ && scheme.__config__.ApiParams && scheme.__config__.ApiParams.length) {
+    let itemConfig = scheme.__config__
+    const isVarTypeExist = checkVarTypeExist(itemConfig.ApiParams, scheme.__vModel__)
+    if (!isVarTypeExist) return
+    if (!itemConfig.propsUrl) return
+    setOptions.call(this, scheme, itemConfig, formConfCopy)
+  }
   mapList.forEach((i, k) => {
     //当当前组件值change时 查询当前组件是否有api变量
     if (scheme.__config__.ApiReturn && scheme.__config__.ApiReturn.length) {
@@ -360,6 +380,7 @@ function setValue(event, config, scheme) {
     }
   })
 }
+
 function setOptions(i, itemConfig, formConfCopy) {
   let isTreeSelect = itemConfig.jnpfKey === 'treeSelect' || itemConfig.jnpfKey === 'cascader'
   if (isTreeSelect) {
@@ -372,10 +393,20 @@ function setOptions(i, itemConfig, formConfCopy) {
     })
   } else {
     getAPIData(i.__slot__, itemConfig.propsUrl, itemConfig.ApiParams, formConfCopy.fields, '', itemConfig.apiProps).then((res) => {
-      this.$set(i.__slot__, 'options', res)
+      if (i.__config__.jnpfKey == 'comInput' && res.length > 0) {
+        // this.$set(i.__slot__, 'options', res)
+        const data = res[0]
+        for (const cur of i.__config__.ApiReturn) {
+          // 储存全局变量
+          sessionStorage.setItem(`API_${cur.varName}`, data[cur.keyName])
+        }
+      } else {
+        this.$set(i.__slot__, 'options', res)
+      }
     })
   }
 }
+
 // 查API变量
 function checkApiVarTypeExist(arr, target) {
   for (let obj of arr) {
@@ -387,6 +418,7 @@ function checkApiVarTypeExist(arr, target) {
   }
   return false
 }
+
 // 查表单变量
 function checkVarTypeExist(arr, target) {
   for (let obj of arr) {
@@ -396,6 +428,7 @@ function checkVarTypeExist(arr, target) {
   }
   return false
 }
+
 function buildListeners(scheme, h) {
   const { formConfCopy } = this
   const config = scheme.__config__
@@ -487,6 +520,7 @@ function getConfigDefVal(h, item) {
       .filter((l) => l !== undefined)
   }
 }
+
 export default {
   components: {
     render,
@@ -592,7 +626,12 @@ export default {
             if (!config.dictionaryType) return
             dictDetail({ id: config.dictionaryType }).then((res) => {
               let content = JSON.parse(res.data.data.content || '[]')
-              isTreeSelect ? (cur.options = content.map((i) => ({ fullName: i.value, id: i.key }))) : (cur.__slot__.options = content.map((i) => ({ fullName: i.value, id: i.key })))
+              isTreeSelect
+                ? (cur.options = content.map((i) => ({
+                    fullName: i.value,
+                    id: i.key
+                  })))
+                : (cur.__slot__.options = content.map((i) => ({ fullName: i.value, id: i.key })))
             })
           }
           //当下拉组件使用api接口时
@@ -664,9 +703,11 @@ export default {
       const rowData = rowRes.data.data
       // 获取当前表格信息
       const rowDetailData = await detail(this.modelId, rowData.dbLinkId)
+
       function isEmptyObject(obj) {
         return Object.keys(obj).length === 0
       }
+
       const rowColumnDict = rowDetailData.columnDict
       const field = rowColumnDict[scheme.__vModel__]
       const rowAssociationData = JSON.parse(localStorage.getItem('BROWSER_associationData')) || {}
@@ -848,10 +889,12 @@ export default {
   position: absolute;
   right: 0;
   top: 0;
+
   i {
     color: #ffffff;
   }
 }
+
 .topEntryBox {
   display: flex !important; //设置布局
   flex-wrap: wrap !important; //进行换行操作
@@ -859,6 +902,7 @@ export default {
     line-height: 35px !important;
   }
 }
+
 @media (max-width: 768px) {
   .relationItem {
     margin-right: 0;

+ 7 - 1
src/components/Generator/render/render.js

@@ -66,6 +66,12 @@ function buildDataObject(confClone, dataObject, formData, primaryRow, flowForeig
       dataObject.attrs[key] = val
     }
   })
+  if (confClone.__config__.tag === 'NewInput') {
+    dataObject.attrs = {
+      ...dataObject.attrs,
+      ...confClone.__config__
+    }
+  }
   if (confClone.__config__.jnpfKey === 'numInput') {
     if (confClone.slotPrepend) dataObject.attrs['data-prepend'] = confClone.slotPrepend
     if (confClone.slotAppend) dataObject.attrs['data-append'] = confClone.slotAppend
@@ -144,7 +150,7 @@ export default {
     },
     formData: {
       type: Object,
-      default: () => { }
+      default: () => {}
     }
   },
   render(h) {

+ 3 - 2
src/utils/define.js

@@ -3,13 +3,14 @@
 // JAVA Cloud对应网关地址
 // const APIURl = 'http://192.168.0.103:8181'
 
-const url = 'https://windata.platomix.net' // 测试环境
+// const url = 'https://windata.platomix.net' // 测试环境
 // const url = 'https://api.bi.platomix.net' // 测试环境
 // const url = 'https://bi.platomix.net' // BI环境
-// const url = 'http://60.190.98.244:8070' // BI环境
+const url = 'http://60.190.98.244:8070' // 巨一环境
 // const url = 'https://miniapp.zhangmushiye.com/' // 樟木环境
 // const url = 'http://hr.cscec8st.com.cn:50021/' // 中建环境
 // const url = 'http://hr.cscec8st.com.cn:50022/' // 中建环境
+// const url = 'http://60.190.98.244:8070' // 中建环境
 
 const APIURl = url + '/api'
 const WLAPIURl = 'http://flow.teplot.com/paas' // 文领本地

File diff suppressed because it is too large
+ 1 - 1
src/utils/request.js


+ 10 - 13
src/views/basic/dynamicModel/list/index.vue

@@ -171,9 +171,9 @@
           </template>
           <template #tag="{ row, column }">
             <template v-if="getColor(row[column.property], row, column)">
-              <el-tag :style="`color:#fff;background-color: ${getColor(row[column.property], row, column)}`">
-                {{ row[column.property] }}
-              </el-tag>
+              <!--              <el-tag :style="`color:#fff;background-color: ${getColor(row[column.property], row, column)}`">-->
+              <!--                {{ row[column.property] }}-->
+              <!--              </el-tag>-->
             </template>
             <template v-else>
               {{ row[column.property] }}
@@ -207,17 +207,14 @@
               </template>
               <template v-else>
                 <el-tag
-                  :style="`color:#fff;background-color: ${getColor(formatAssociationData(row, column, item), row, column)}`">
-                  <el-tag
-                    v-if="getColor(formatAssociationData(row, column, item), row, column)"
-                    :style="`color:#fff;background-color: ${getColor(formatAssociationData(row, column, item), row, column)}`"
-                  >
-                    {{ formatAssociationData(row, column, item) }}
-                  </el-tag>
-                  <template v-else>
-                    {{ formatAssociationData(row, column, item) }}
-                  </template>
+                  v-if="getColor(formatAssociationData(row, column, item), row, column)"
+                  :style="`color:#fff;background-color: ${getColor(formatAssociationData(row, column, item), row, column)}`"
+                >
+                  {{ formatAssociationData(row, column, item) }}
                 </el-tag>
+                <template v-else>
+                  {{ formatAssociationData(row, column, item) }}
+                </template>
               </template>
             </div>
           </template>