selectratedinfo.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /**
  2. @author:fugy
  3. @date:2018.09.21
  4. @info:固定报警条目选择技术报警点的弹窗
  5. */
  6. <template>
  7. <!-- @close="selectInfoCloseHandle" -->
  8. <el-dialog
  9. title="选择报警触发时所转问题"
  10. :visible.sync="dialogVisible"
  11. width="50%"
  12. center
  13. >
  14. <div class="problem-box">
  15. <!-- <div class="top">
  16. <el-radio-group v-model="radioValue">
  17. <el-radio-button v-for="(item, index) in radioArr" :key="index" :label="item.value" :disabled="objTypeValue != item.value">{{item.label}}</el-radio-button>
  18. </el-radio-group>
  19. </div>
  20. <hr class="line" /> -->
  21. <div class="content">
  22. <!-- <div class="contion" v-if="radioValue == 'system' || radioValue == 'facility'">
  23. <el-select v-model="majorSelectValue" clearable placeholder="请选择专业" @change="changeMajorHandle">
  24. <el-option
  25. v-for="item in majorSelectArr"
  26. :key="item.value"
  27. :label="item.label"
  28. :value="item.value">
  29. </el-option>
  30. </el-select>
  31. <el-select v-if="majorSelectValue" v-model="sysSelectValue" clearable placeholder="请选择系统" @change="changeSysHandle">
  32. <el-option
  33. v-for="item in sysSelectArr"
  34. :key="item.value"
  35. :label="item.label"
  36. :value="item.value">
  37. </el-option>
  38. </el-select>
  39. <el-select v-if="sysSelectValue && this.radioValue=='facility'" v-model="devSelectValue" clearable placeholder="请选择设备" @change="changeDevHandle">
  40. <el-option
  41. v-for="item in devSelectArr"
  42. :key="item.value"
  43. :label="item.label"
  44. :value="item.value">
  45. </el-option>
  46. </el-select>
  47. </div> -->
  48. <div class="table-box">
  49. <el-table
  50. v-if="infoPointArr"
  51. v-loading="loading"
  52. :data="infoPointArr"
  53. border
  54. style="width: 100%">
  55. <el-table-column
  56. prop="infoPointName"
  57. label="信息点名称"
  58. header-align="center">
  59. </el-table-column>
  60. <el-table-column
  61. prop="infoPointCode"
  62. label="信息点infoid"
  63. header-align="center">
  64. </el-table-column>
  65. <el-table-column
  66. label="选择"
  67. header-align="center"
  68. align="center"
  69. >
  70. <template slot-scope="scope">
  71. <el-radio v-model="selectInfoValue" :label="scope.row.infoPointCode" @change="radioHandle(scope.row)">{{null}}</el-radio>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. </div>
  76. </div>
  77. </div>
  78. </el-dialog>
  79. </template>
  80. <script>
  81. import api from './api';
  82. export default {
  83. name: "has-problem",
  84. data() {
  85. return {
  86. dialogVisible: false,
  87. loading: false,
  88. radioArr:[{ //单选按钮的数据Arr
  89. value: 'building',
  90. label: '建筑',
  91. },{
  92. value: 'floor',
  93. label: '楼层',
  94. },{
  95. value: 'system',
  96. label: '系统类',
  97. },{
  98. value: 'facility',
  99. label: '设备类',
  100. }],
  101. radioValue:'space', //单选按钮的value值
  102. majorSelectValue: null, //专业下拉value
  103. majorSelectArr: [], //专业下拉的数组
  104. sysSelectValue: null, //系统下拉value
  105. sysSelectArr: [], //系统下拉的数组
  106. devSelectValue: null, //设备下拉value
  107. devSelectArr: [], //设备下拉的属猪
  108. tableData:[
  109. {
  110. infoPointName: '信息点1',
  111. infoPointCode: '001',
  112. },{
  113. infoPointName: '信息点2',
  114. infoPointCode: '002',
  115. }
  116. ],
  117. selectInfoValue: null, // 表格单选按钮的value值
  118. param: null, //请求参数
  119. }
  120. },
  121. props:["selectRatedInfoFlag", "objTypeValue", "infoPointArr","selectRatedInfoCheckedCode"],
  122. methods: {
  123. //表格单选按钮
  124. radioHandle(row){
  125. this.$emit("select-info-handle", row.infoPointName, row.infoPointCode);
  126. this.dialogVisible = false;
  127. },
  128. //弹窗关闭
  129. // selectInfoCloseHandle() {
  130. // this.majorSelectValue = null;
  131. // this.sysSelectValue = null;
  132. // this.devSelectValue = null;
  133. // this.loading = false;
  134. // },
  135. //获取专业的接口
  136. getmajorSelectData() {
  137. this.majorSelectArr = api.getMajorSelectData();
  138. },
  139. // 改变专业下拉,获取系统的下拉列表
  140. changeMajorHandle(val) {
  141. if(!val){
  142. return;
  143. }
  144. this.sysSelectValue = null;
  145. let arr = api.getSysSelectData(val);
  146. if(arr){
  147. this.sysSelectArr = arr;
  148. } else {
  149. this.sysSelectArr = [];
  150. }
  151. },
  152. // 改变系统下拉,获取设备的下拉列表
  153. changeSysHandle(val) {
  154. // console.log(val);
  155. if(!val){
  156. return;
  157. }
  158. if (this.radioValue == "system") { //系统
  159. } else { //设备
  160. this.devSelectValue = null;
  161. let arr = api.getDevSelectData(val);
  162. if(arr){
  163. this.devSelectArr = arr;
  164. }else {
  165. this.devSelectArr = [];
  166. }
  167. }
  168. },
  169. // 改变设备的下拉
  170. changeDevHandle (val) {
  171. console.log(val)
  172. },
  173. //获取技术信息点
  174. getInfoListData() {
  175. this.loading = true;
  176. this.param = this.endCascadeValue;
  177. if (this.startCascadeValue == 'system') {
  178. this.param = this.param.substring(2,4);
  179. }
  180. if (this.startCascadeValue == 'facility') {
  181. this.param = this.param.substring(2,6);
  182. }
  183. let params = {
  184. type: this.param,
  185. }
  186. api.getInfoListData(params).then((res) => {
  187. this.loading = false;
  188. // console.log(res);
  189. // let data = res;
  190. // let arr = data.filter((ele, index) => {
  191. // return ele.firstTag ? ele.firstTag == '技术参数': null
  192. // })
  193. this.tableData = res;
  194. }).catch(err => {
  195. throw err;
  196. })
  197. }
  198. },
  199. watch: {
  200. //弹窗显示
  201. selectRatedInfoFlag() {
  202. this.dialogVisible = true;
  203. this.selectInfoValue = this.selectRatedInfoCheckedCode;
  204. //获取技术信息点
  205. // this.getInfoListData();
  206. // this.selectInfoValue = null;
  207. // if (this.objTypeValue == "system" || this.objTypeValue == "facility") {
  208. // this.getmajorSelectData();
  209. // }
  210. },
  211. //获取专业的下拉列表
  212. objTypeValue() {
  213. this.radioValue = this.objTypeValue;
  214. }
  215. }
  216. }
  217. </script>
  218. <style lang="less" scoped>
  219. .problem-box{
  220. height: 600px;
  221. overflow-y: auto;
  222. .top{
  223. text-align: center;
  224. }
  225. .line{
  226. background-color: #ccc;
  227. height: 1px;
  228. border: none;
  229. }
  230. .content{
  231. .table-box{
  232. margin-top: 10px;
  233. }
  234. }
  235. }
  236. </style>