Przeglądaj źródła

数据查询数据处理,展示字典配置结果

lkk 1 rok temu
rodzic
commit
77fe52bf33
2 zmienionych plików z 16 dodań i 4 usunięć
  1. 15 3
      src/views/system/zyml/index.vue
  2. 1 1
      vue.config.js

+ 15 - 3
src/views/system/zyml/index.vue

@@ -431,6 +431,16 @@
                 <span v-else>{{ row.fieldaliasname }}</span>
               </template>
             </el-table-column>
+            <el-table-column label="是否显示">
+              <template slot-scope="{row}">
+                <el-switch
+                  v-model="row.status"
+                  active-text="是"
+                  inactive-text="否"
+                >
+                </el-switch>
+              </template>
+            </el-table-column>
           </el-table>
         </el-tab-pane>
       </el-tabs>
@@ -457,7 +467,6 @@ import { getToken } from "@/utils/auth";
 import { getXzq } from "@/api/system/user";
 import { GetFieldValue, UpdateFieldValue } from "@/api/system/yztfield";
 import axios from "axios";
-
 export default {
   name: "Zyml",
   dicts: [
@@ -841,6 +850,7 @@ export default {
     },
     /** 字典维护 */
     async handleDict(row) {
+      console.log(row.legend);
       this.tempRowData = row;
       this.tabelList = [];
       this.tempTableData = [];
@@ -852,7 +862,7 @@ export default {
       let url1 = resolvess.replace("map-", "data-");
       let url3 = row.sde.substring(0, row.sde.indexOf(":")) + "/datasets/";
       let url2 = url1.replace("maps", "data/datasources/" + url3);
-      let reqName = row.sde.substring(row.sde.indexOf(":") + 1, row.sde.length)
+      let reqName = row.sde.substring(row.sde.indexOf(":") + 1, row.sde.length);
       if (row.legend == "" && row.url != "") {
         //从iserver中获取数据地址
         let newUrl = url2 + reqName + "/fields.json";
@@ -867,6 +877,7 @@ export default {
               this.tempTableData.push({
                 fieldname: item,
                 fieldaliasname: item,
+                status:true,
               });
             });
 
@@ -879,6 +890,7 @@ export default {
           }
         });
       } else {
+        console.log(JSON.parse(row.legend),'已有配置');
         //如果lenged中存在字段修正数据,则直接使用
         this.tabelList.push({
           bsm: row.bsm,
@@ -896,7 +908,7 @@ export default {
       if (this.tabelList.length > 0) {
         //将数据转化为字符串存储
         this.tempRowData.legend = JSON.stringify(this.tabelList[0].tabelData);
-        console.log(this.tempRowData,'this.tempRowData');
+        console.log(this.tempRowData, "this.tempRowData");
 
         updateZyml(this.tempRowData).then((response) => {
           this.$modal.msgSuccess("修改成功");

+ 1 - 1
vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://192.168.60.4:8080`,
+        target: `http://192.168.100.30:8080`,
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",