Browse Source

替换项目化配置相关接口

zhangyu 5 năm trước cách đây
mục cha
commit
7cb4c7ed3e

+ 6 - 0
src/api/scan/request.js

@@ -859,6 +859,12 @@ export function getDataDictionary(param, success) {
     http.postJson(url, data, success)
 }
 
+//设置项目数据字典显隐 --列表表头
+export function setDataDictionary(param, success) {
+    let url = `${baseUrl}/datacenter/data-dictionary/project/setting-dic-project`;
+    http.postJson(url, param, success)
+}
+
 //设备清单 - 根据分类查询部件列表内容
 export function getEquipPartsCon(param, success) {
     let url = `${baseUrl}/equip-component/equip-query/components-property`;

+ 7 - 7
src/utils/handsontable/notShow.js

@@ -930,15 +930,15 @@ const showTools = {
                     return undefined
                 }
                 if (showType == "Visible" && item.Visible) { //只看要采集的信息
-                    return showTools.inputModeFilter(item)
+                    return showTools.inputModeFilter(item, onlyRead)
                 } else if (showType == "all") { //显示全部
-                    return showTools.inputModeFilter(item)
+                    return showTools.inputModeFilter(item, onlyRead)
                 } else if (showType == "partInfo" && showTools.isShow(item.InfoPointCode)) { //隐藏部分厂家信息(***需维护不显示列表***)
                     // if (item.FirstName == "控制参数" || item.FirstName == "设定参数" || item.FirstName == "运行参数") {
                     if (item.FirstTag == "TechParam") {
                         return undefined
                     } else {
-                        return showTools.inputModeFilter(item)
+                        return showTools.inputModeFilter(item, onlyRead)
                     }
                 } else {
                     return undefined
@@ -1042,14 +1042,14 @@ const showTools = {
                 data: item.Path,
                 readOnly: onlyRead
             }
-        } else { //不支持输入(暂定后台控制是否可编辑)
+        } else { //(未支持的输入方式)暂不支持编辑
             return {
                 data: item.Path,
                 readOnly: onlyRead
             }
         }
     },
-    inputModeFilter (item) {
+    inputModeFilter (item, onlyRead) {
         if (item.InfoPointCode == "EquipQRCode") {
             return {
                 data: item.Path,
@@ -1150,10 +1150,10 @@ const showTools = {
                 data: item.Path,
                 readOnly: !item.Editable
             }
-        } else { //不支持输入(暂定后台控制是否可编辑)
+        } else { //(未支持的输入方式)暂不支持编辑
             return {
                 data: item.Path,
-                readOnly: !item.Editable
+                readOnly: onlyRead
             }
         }
     },

+ 30 - 37
src/views/project_setting/collection_setting/index.vue

@@ -46,11 +46,11 @@
             <div class="right_main" v-loading="rightLoading">
                 <el-tabs v-if="labelKey.length && tabsFalg" tab-position="left" style="height: 100%;">
                     <el-tab-pane v-for="(item,index) in labelKey" :key="index">
-                        <span slot="label">{{item.FirstTag || '信息'}}</span>
+                        <span slot="label">{{item.FirstName || '信息'}}</span>
                         <div class="label_main" v-for="(tag,tagIndex) in item.details" :key="tagIndex">
-                            <p>{{tag.SecondTag}}</p>
+                            <p>{{tag.SecondName}}</p>
                             <ul v-for="(detail,detailInd) in tag.details" :key="detailInd">
-                                <el-checkbox v-model="detail.Visible" @change="boxChange(detail)">{{detail.InfoPointName}}</el-checkbox>
+                                <el-checkbox :title="detail.InfoPointName" v-model="detail.Visible" @change="boxChange(detail)">{{detail.InfoPointName}}</el-checkbox>
                             </ul>
                         </div>
                     </el-tab-pane>
@@ -75,8 +75,8 @@
     import buildInput from "@/components/common/search_input";
     import {
         getAllFamily, //获取所有设备族
-        getTableHeader, //点击时后去右侧的数据
-        setHeader, //修改右侧数据
+        getDataDictionary, //点击时后去右侧的数据
+        setDataDictionary, //修改右侧数据
         getEqCode,
         getBussTypes
     } from "@/api/scan/request";
@@ -114,7 +114,6 @@
                 code: '',
                 letterArr: [], //出现的a-z字符
                 UserId: "18612660722", //用户id
-                ProjId: "", //项目id
                 labelKey: [], // 右侧主体数据承接数组
                 searchArr: [], // 搜索后的数据
                 searchVal: "", //搜索内容
@@ -516,7 +515,6 @@
             },
             //获取所有设备族
             getAllFamily() {
-                this.ProjId = this.projectId
                 if (this.value == "property") {
                     getAllFamily().then(result => {
                         this.isLoading = false
@@ -612,20 +610,13 @@
             },
             //点击checkBox的事件
             boxChange(detail) {
-                console.log(detail)
-                let param = {
-                    FamilyId: this.code,
-                    code: detail.InfoPointCode,
-                    perjectId: this.ProjId,
-                    UserId: this.UserId,
+                let param = [{
+                    Type: this.code,
+                    InfoPointCode: detail.InfoPointCode,
                     Visible: detail.Visible
-                };
-                setHeader(param).then(res => {
-                    if (res.data.Result == "success") {
-                        return;
-                    } else {
-                        this.$message.error("保存失败");
-                    }
+                }]
+                setDataDictionary(param, res => {
+                    return
                 });
             },
             //修改search
@@ -661,19 +652,21 @@
             //高亮行
             familyActive(name, code) {
                 this.rightLoading = true
-                this.active = name;
-                this.code = code;
+                this.active = name
+                this.code = code
                 let param = {
-                    UserId: this.UserId,
-                    code: code,
-                    ProjId: this.ProjId
+                    data: {
+                        PageNumber: 1,
+                        PageSize: 500
+                    },
+                    type: code
                 };
                 this.tabsFalg = false
-                getTableHeader(param).then(result => {
+                getDataDictionary(param, result => {
                     this.rightLoading = false
-                    if (result.data.Result == "success") {
+                    if (result.Result == "success") {
                         this.tabsFalg = true
-                        this.labelKey = this.arrayCnt(result.data.Content);
+                        this.labelKey = this.arrayCnt(result.Content)
                     } else {
                         this.dialogVisible = true;
                         this.ajaxMsg = "请求出错";
@@ -685,29 +678,29 @@
                 let first = {}
                 //一级循环出来一级标签
                 arr.map(item => {
-                    if (!!first[item.FirstTag] && first[item.FirstTag].length) {} else {
-                        first[item.FirstTag] = []
+                    if (first[item.FirstName] && first[item.FirstName].length) {} else {
+                        first[item.FirstName] = []
                     }
-                    first[item.FirstTag].push({
+                    first[item.FirstName].push({
                         InfoPointName: item.InfoPointName,
                         InfoPointCode: item.InfoPointCode,
                         Visible: item.Visible,
-                        SecondTag: item.SecondTag
+                        SecondName: item.SecondName? item.SecondName: ""
                     })
                 })
                 //循环出第二级标签
                 let sound = []
                 for (let key in first) {
                     let obj = {
-                        FirstTag: key,
+                        FirstName: key,
                         details: {}
                     }
                     first[key].map(item => {
-                        if (!!obj.details[item.SecondTag] && obj.details[item.SecondTag].length) {
+                        if (!!obj.details[item.SecondName] && obj.details[item.SecondName].length) {
                         } else {
-                            obj.details[item.SecondTag] = []
+                            obj.details[item.SecondName] = []
                         }
-                        obj.details[item.SecondTag].push({
+                        obj.details[item.SecondName].push({
                             InfoPointName: item.InfoPointName,
                             InfoPointCode: item.InfoPointCode,
                             Visible: item.Visible,
@@ -723,7 +716,7 @@
                             item.details = []
                         }
                         item.details.push({
-                            SecondTag: k,
+                            SecondName: k,
                             details: copyarr[k]
                         })
                     }