LevelDeterConfig.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573
  1. <template>
  2. <div class="content-main-manage">
  3. <div class="search-list">
  4. <div class="search-left">
  5. <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
  6. <FormItem label="" prop="targetCount">
  7. <Select v-model="tableParams.targetCount" placeholder="监测指标数量">
  8. <Option v-for="item in indicatorsNum" :value="item.value" :key="item.value">{{ item.label }}</Option>
  9. </Select>
  10. </FormItem>
  11. <FormItem label="" prop="coverTargetCount">
  12. <Select v-model="tableParams.coverTargetCount" placeholder="策略覆盖指标数量">
  13. <Option v-for="item in strategyIndicNum" :value="item.value" :key="item.value">{{ item.label }}</Option>
  14. </Select>
  15. </FormItem>
  16. <FormItem label="" prop="coverEquipmentCount">
  17. <Select v-model="tableParams.coverEquipmentCount" placeholder="策略覆盖设备数量">
  18. <Option v-for="item in strategyEquipNum" :value="item.value" :key="item.value">{{ item.label }}</Option>
  19. </Select>
  20. </FormItem>
  21. <FormItem label="" prop="name">
  22. <Input placeholder="输入关键字查询" clearable search v-model="tableParams.name" />
  23. </FormItem>
  24. <FormItem label="" >
  25. <Button type="primary" class="common-btn-search" @click="searchClick">
  26. <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 筛选
  27. </Button>
  28. <Button type="primary" class="common-btn-search" style="margin-left:10px" @click="resetClick('tableParams')">
  29. <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 重置
  30. </Button>
  31. </FormItem>
  32. </Form>
  33. </div>
  34. </div>
  35. <div class="btn-container">
  36. <Button icon="ios-add" class="common-add-btn" @click="addClick">新增策略</Button>
  37. </div>
  38. <div class="manage-main-center">
  39. <Table :columns="columns" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading">
  40. <template slot="loading">
  41. <Loading-animation></Loading-animation>
  42. </template>
  43. <template slot-scope="{ row }" slot="action">
  44. <Tooltip content="详情" placement="top">
  45. <i class="iconfont icon-xiangqingmingxi" style="cursor:pointer;color:#B8B532;fontSize:20px;marginRight:6px" @click="detailClick(row)"></i>
  46. </Tooltip>
  47. <Tooltip content="编辑" placement="top">
  48. <i class="iconfont icon-bianji" style="cursor:pointer;color:#64ACFE;fontSize:20px;marginRight:6px" @click="editClick(row)"></i>
  49. </Tooltip>
  50. <Tooltip content="删除" placement="top">
  51. <i class="iconfont icon-shanchu" style="cursor:pointer;color:#E92E2E;fontSize:20px;marginRight:6px" @click="delClick(row)"></i>
  52. </Tooltip>
  53. </template>
  54. </Table>
  55. </div>
  56. <div class="common-page">
  57. <div class="common-page-total">
  58. 共<span>{{tablePage}}</span>页 / <span>{{tableTotal}}</span>条数据
  59. </div>
  60. <Page :total="tableTotal" :current="tableParams.pageNum" :page-size="tableParams.pageSize" @on-change="changePage" @on-page-size-change="sizeChange" show-elevator />
  61. </div>
  62. <Modal
  63. v-model="showModal"
  64. :title="title"
  65. width="65"
  66. ref="modalGrag"
  67. draggable
  68. reset-drag-position
  69. @on-visible-change="modalChange"
  70. :mask-closable="false"
  71. class-name="common-modal">
  72. <div class="common-modal-top">
  73. <span class="common-modal-top-text">基础信息</span>
  74. </div>
  75. <Form class="common-form" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="95" inline label-position="left">
  76. <FormItem label="来源应用:" prop="appId" style="width:48%">
  77. <Select v-model="formOption.appId" placeholder="来源应用" @on-change="selectModalApp" label-in-value :disabled="disabledApp">
  78. <Option v-for="item in appModalData" :value="item.id" :key="item.id">{{ item.appName }}</Option>
  79. </Select>
  80. </FormItem>
  81. <FormItem label="设备类型:" prop="equipmentTypeId" style="width:48%">
  82. <Select v-model="formOption.equipmentTypeId" placeholder="设备类型" @on-change="selectModalEquip" label-in-value :disabled="disabledEquip">
  83. <Option v-for="item in equipTypeModalData" :value="item.equipmentTypeId" :key="item.equipmentTypeId">{{ item.equipmentName }}</Option>
  84. </Select>
  85. </FormItem>
  86. <FormItem label="策略名称:" prop="strategyName" style="width:100%" >
  87. <Input v-model.trim="formOption.strategyName" placeholder="默认回显【来源应用-设备类型】作为策略名称,可手动修改" maxlength="100" show-word-limit />
  88. </FormItem>
  89. </Form>
  90. <div class="common-modal-top">
  91. <span class="common-modal-top-text">等级判定策略</span>
  92. </div>
  93. <div class="strategy-form-scroll common-scroll" v-if="showModal">
  94. <Form ref="formDynamic" :model="formCustom" :label-width="0" class="strategy-form">
  95. <Row v-for="(item, index) in formCustom.alertStrategyRankDTOList" :key="index">
  96. <Col span="2" :class="{'row-first': index == 0}" class="row-first-es">策略{{index + 1}}</Col>
  97. <Col span="16" :class="{'row-first': index == 0}">
  98. <Row v-for="(val, i) in item.alertStrategyDetailList" :key="i" style="width:100%" class="strategy-form-row">
  99. <Col span="4">
  100. <FormItem :prop="'alertStrategyRankDTOList.' + index + '.alertStrategyDetailList.' + i + '.targetId'" :rules="{ required: clickbtn==3 ? false: true, type: 'number',message: '请选择监测指标', trigger: 'change',}" style="display:flex">
  101. <span class="sub-first-text">{{val.relationName}}</span>
  102. <Select v-model="val.targetId" style="width: 75%" placeholder="监测指标" @on-change="selectTarget(val.targetId,index,i)" ref="targetId" transfer>
  103. <Option v-for="subItem in indicatorsModalData" :value="subItem.id" :key="subItem.id">{{ subItem.targetName }}</Option>
  104. </Select>
  105. </FormItem>
  106. </Col>
  107. <Col span="4">
  108. <FormItem :prop="'alertStrategyRankDTOList.' + index + '.alertStrategyDetailList.' + i + '.logical1'" :rules="{required: clickbtn==3 ? false: true, type: 'number',message: '请选择逻辑关系',trigger: 'change',}">
  109. <Select v-model="val.logical1" style="width: 100%" placeholder="逻辑关系" @on-change="selectLogical1(val.logical1,index,i)" ref="logical1" transfer>
  110. <Option v-for="item in operatorModalData" :value="item.id" :key="item.id">{{ item.value }}</Option>
  111. </Select>
  112. </FormItem>
  113. </Col>
  114. <Col span="4">
  115. <FormItem :prop="'alertStrategyRankDTOList.' + index + '.alertStrategyDetailList.' + i + '.targetValue1'" :rules="{ required: clickbtn==3 ? false: true, message: '请输入', trigger: 'blur'}" style="display:flex">
  116. <Input v-model.trim="val.targetValue1" placeholder="请输入"/>
  117. </FormItem>
  118. </Col>
  119. <Col span="4">
  120. <FormItem :prop="'alertStrategyRankDTOList.' + index + '.alertStrategyDetailList.' + i + '.connectLogical'" style="display:flex">
  121. <Select v-model="val.connectLogical" style="width: 100%" placeholder="逻辑判断" clearable @on-change="selectConnectLogical(val.connectLogical,index,i)" ref="connectLogical" transfer>
  122. <Option v-for="item in logicJudgmentModalData" :value="item.id" :key="item.id">{{ item.value }}</Option>
  123. </Select>
  124. </FormItem>
  125. </Col>
  126. <Col span="4">
  127. <FormItem :prop="'alertStrategyRankDTOList.' + index + '.alertStrategyDetailList.' + i + '.logical2'" style="display:flex">
  128. <Select v-model="val.logical2" style="width: 100%" placeholder="逻辑关系" clearable @on-change="selectLogical2(val.logical2,index,i)" ref="logical2" transfer>
  129. <Option v-for="subItem in operatorModalData" :value="subItem.id" :key="subItem.id">{{ subItem.value }}</Option>
  130. </Select>
  131. </FormItem>
  132. </Col>
  133. <Col :span="i != 0 ? 3 : 4">
  134. <FormItem :prop="'alertStrategyRankDTOList.' + index + '.alertStrategyDetailList.' + i + '.targetValue2'">
  135. <Input v-model.trim="val.targetValue2" placeholder="请输入" clearable />
  136. </FormItem>
  137. </Col>
  138. <Col span="1" class="row-es-del" v-if="i != 0">
  139. <FormItem>
  140. <i class="iconfont icon-shanchu ivu-col-del" v-if="i != 0" @click="handleSubRemove(index,i)"></i>
  141. <Input placeholder="请输入" clearable style="opacity: 0;width:0px"/>
  142. </FormItem>
  143. </Col>
  144. </Row>
  145. </Col>
  146. <Col span="2" :class="{'row-first': index == 0}" class="row-es-text">判定为</Col>
  147. <Col span="3" :class="{'row-first': index == 0}" class="row-es-last">
  148. <FormItem
  149. :prop="'alertStrategyRankDTOList.'+index+'.rankId'" :rules="{required: clickbtn==3 ? false: true,type: 'number',message: '请选择告警等级',trigger: 'change'}">
  150. <Select v-model="item.rankId" style="width: 100%" placeholder="告警等级" @on-change="selectRank(item.rankId,index)" ref="rank" transfer>
  151. <Option v-for="firstitem in alarmLevelModalData" :value="firstitem.id" :key="firstitem.id" :disabled="firstitem.disabled">{{ firstitem.name }}</Option>
  152. </Select>
  153. </FormItem>
  154. </Col>
  155. <Col span="1" class="ivu-col-btn">
  156. <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;" @click="handleAdd('formDynamic')" v-if="index == formCustom.alertStrategyRankDTOList.length - 1 &&title=='新增策略'"></i>
  157. <i class="iconfont icon-shanchu ivu-col-del" style="padding-left:5px" @click="handleRemove(index)"></i>
  158. </Col>
  159. <Col span="23" class="ivu-col-edit" v-if="title=='编辑策略'">
  160. <div class="sub-add">
  161. <span>新增一条子策略 子策略与现有子策略间为</span>
  162. <FormItem ref="subLogical" :prop="'alertStrategyRankDTOList.'+index+'.subLogical'" :rules="{required: clickbtn==2 ? true: false, type: 'number',message: '请选择逻辑判断',trigger: 'change'}">
  163. <Select v-model="item.subLogical" placeholder="逻辑判断" style="width: 200px;padding: 0 6px" @on-change="selectEditSubLogical(item.subLogical,index)" label-in-value transfer>
  164. <Option v-for="item in logicJudgmentModalData" :value="item.id" :key="item.id">{{ item.value }}</Option>
  165. </Select>
  166. </FormItem>
  167. 关系
  168. <i class="iconfont icon-tianjia" style="cursor:pointer;color:#43B843;padding-left:10px" @click="handleEditSub('formDynamic',index)"></i>
  169. </div>
  170. </Col>
  171. </Row>
  172. <div class="sub-add" v-if="title=='新增策略'">
  173. <span>新增一条子策略 子策略与现有子策略间为</span>
  174. <FormItem prop="subLogical" :rules="{required: clickbtn==2 ? true: false, type: 'number',message: '请选择逻辑判断',trigger: 'change'}">
  175. <Select v-model="formCustom.subLogical" placeholder="逻辑判断" style="width: 200px;padding: 0 6px" @on-change="selectSubLogical" label-in-value transfer>
  176. <Option v-for="item in logicJudgmentModalData" :value="item.id" :key="item.id">{{ item.value }}</Option>
  177. </Select>
  178. </FormItem>
  179. 关系
  180. <i class="iconfont icon-tianjia" style="cursor:pointer;color:#43B843;padding-left:10px" @click="handleAddSub('formDynamic')"></i>
  181. </div>
  182. </Form>
  183. </div>
  184. <div slot="footer">
  185.     <Button @click="modalCancel">取消</Button>
  186.     <Button type="primary" @click="modalOk">确定</Button>
  187.   </div>
  188. </Modal>
  189. <Modal
  190. v-model="modalStatus"
  191. :title="commonTitle"
  192. width="30"
  193. ref="modalGrag"
  194. draggable
  195. reset-drag-position
  196. :mask-closable="false"
  197. class-name="common-modal">
  198. <Icon type="ios-information-circle" :style="{ color: activeColor}" class="modal-icon"></Icon>
  199. <span class="modal-text">{{modalTitle}}</span>
  200. <div slot="footer">
  201.     <Button @click="commonCancel">取消</Button>
  202.     <Button type="primary" @click="commonOk">确定</Button>
  203.   </div>
  204. </Modal>
  205. <Modal
  206. v-model="detailStatus"
  207. title="等级判定策略详情"
  208. width="45"
  209. ref="modalGrag"
  210. draggable
  211. reset-drag-position
  212. footer-hide
  213. :mask-closable="false"
  214. class-name="common-modal">
  215. <div v-for="(item,index) in detailLabel" :key="index">
  216. <div class="common-modal-top">
  217. <span class="common-modal-top-text">{{item.name}}</span>
  218. </div>
  219. <div class="common-modal-content">
  220. <div class="modal-content-item" v-for="(val,i) in item.arr" :key="i" :class="{'item-especial': val.name == '策略名称' && item.arr.length%2!=0,'item-especial-bot':(i==item.arr.length-1 || i==item.arr.length-2)}">
  221. <span class="modal-content-item-name">
  222. {{val.name}}
  223. </span>
  224. <div class="modal-content-item-value">
  225. <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
  226. <span>{{val.value}}</span>
  227. <div slot="content">
  228. <span>{{val.value}}</span>
  229. </div>
  230. </Tooltip>
  231. <span v-else>{{val.value}}</span>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. <div>
  237. <div class="common-modal-top">
  238. <span class="common-modal-top-text">等级判定策略</span>
  239. </div>
  240. <div class="strategy-form strategy-form-detail common-scroll" v-if="detailStatus">
  241. <Row v-for="(item, index) in formCustom.alertStrategyRankDTOList" :key="index">
  242. <Col span="2" :class="{'row-first': index == 0}" class="row-first-es row-first-es-detail">
  243. <Tooltip placement="top-start" transfer max-width="350">
  244. <span>策略{{index + 1}}</span>
  245. <div slot="content">
  246. <span>策略{{index + 1}}</span>
  247. </div>
  248. </Tooltip>
  249. </Col>
  250. <Col span="16" :class="{'row-first': index == 0}">
  251. <Row v-for="(val, i) in item.alertStrategyDetailList" :key="i" style="width:100%" class="strategy-form-row">
  252. <Col span="4">
  253. <!-- <span class="sub-first-text">{{val.relationName}}</span> -->
  254. <Tooltip placement="top-start" transfer max-width="350">
  255. <span>{{val.targetName}}</span>
  256. <div slot="content">
  257. <span>{{val.targetName}}</span>
  258. </div>
  259. </Tooltip>
  260. </Col>
  261. <Col span="4">
  262. <Tooltip placement="top-start" transfer max-width="350">
  263. <span>{{val.logicalName1}}</span>
  264. <div slot="content">
  265. <span>{{val.logicalName1}}</span>
  266. </div>
  267. </Tooltip>
  268. </Col>
  269. <Col span="4">
  270. <Tooltip placement="top-start" transfer max-width="350">
  271. <span>{{val.targetValue1}}</span>
  272. <div slot="content">
  273. <span>{{val.targetValue1}}</span>
  274. </div>
  275. </Tooltip>
  276. </Col>
  277. <Col span="4">
  278. <Tooltip placement="top-start" transfer max-width="350" v-if="val.connectLogicalName">
  279. <span>{{val.connectLogicalName}}</span>
  280. <div slot="content">
  281. <span>{{val.connectLogicalName}}</span>
  282. </div>
  283. </Tooltip>
  284. <span v-else>{{val.connectLogicalName}}</span>
  285. </Col>
  286. <Col span="4">
  287. <Tooltip placement="top-start" transfer max-width="350" v-if="val.logicalName2">
  288. <span>{{val.logicalName2}}</span>
  289. <div slot="content">
  290. <span>{{val.logicalName2}}</span>
  291. </div>
  292. </Tooltip>
  293. <span v-else>{{val.logicalName2}}</span>
  294. </Col>
  295. <Col span="4">
  296. <Tooltip placement="top-start" transfer max-width="350" v-if="val.targetValue2 || val.targetValue2===0">
  297. <span>{{val.targetValue2}}</span>
  298. <div slot="content">
  299. <span>{{val.targetValue2}}</span>
  300. </div>
  301. </Tooltip>
  302. <span v-else>{{val.targetValue2}}</span>
  303. </Col>
  304. </Row>
  305. </Col>
  306. <Col span="6" :class="{'row-first': index == 0}" class="row-es-last">
  307. <Tooltip placement="top-start" transfer max-width="350">
  308. <span>{{item.rankName}}</span>
  309. <div slot="content">
  310. <span>{{item.rankName}}</span>
  311. </div>
  312. </Tooltip>
  313. </Col>
  314. </Row>
  315. </div>
  316. </div>
  317. </Modal>
  318. </div>
  319. </template>
  320. <script>
  321. const defaultFrom = {appId:'',equipmentTypeId: '',strategyName: '',enabled: 0}
  322. export default {
  323. name: "LevelDeterConfig",
  324. components:{
  325. },
  326. data() {
  327. return {
  328. alarmParams: {
  329. keywords: '',
  330. enabled: 1,
  331. beginDate: '',
  332. endDate: '',
  333. pageNum: 1,
  334. pageSize: 10
  335. },
  336. applicationParams: {
  337. level: '',
  338. lineId: '',
  339. stationId: '',
  340. equipmentCheck: '',
  341. instrumentCheck: '',
  342. pageNum: 1,
  343. pageSize: 9999
  344. },
  345. appParams: {
  346. applicationId: '',
  347. equipmentTypeId: '',
  348. keywords: '',
  349. pageNum: 1,
  350. pageSize: 9999
  351. },
  352. loading: true,
  353. dateRange: [],
  354. tableParams: {
  355. keywords: '',
  356. applicationId:'',
  357. equipmentTypeId: '',
  358. targetCount: '',
  359. coverTargetCount: '',
  360. coverEquipmentCount: '',
  361. name: '',
  362. pageNum: 1,
  363. pageSize: 10
  364. },
  365. tableData: [],
  366. tableTotal: 0,
  367. tablePage: 0,
  368. rowObj: {},
  369. indicatorsNum: [
  370. {
  371. value: '-1',
  372. label: '监测指标数量'
  373. },
  374. {
  375. value: '0-5',
  376. label: '0-5'
  377. },
  378. {
  379. value: '6-10',
  380. label: '6-10'
  381. },
  382. {
  383. value: '11-',
  384. label: '11-'
  385. },
  386. ],
  387. strategyIndicNum: [
  388. {
  389. value: '-1',
  390. label: '策略覆盖指标数量'
  391. },
  392. {
  393. value: '0-5',
  394. label: '0-5'
  395. },
  396. {
  397. value: '6-10',
  398. label: '6-10'
  399. },
  400. {
  401. value: '11-',
  402. label: '11-'
  403. }
  404. ],
  405. strategyEquipNum: [
  406. {
  407. value: '-1',
  408. label: '策略覆盖设备数量'
  409. },
  410. {
  411. value: '0-10',
  412. label: '0-10'
  413. },
  414. {
  415. value: '11-50',
  416. label: '11-50'
  417. },
  418. {
  419. value: '51-',
  420. label: '51-'
  421. },
  422. ],
  423. equipTypeData: [],
  424. equipTypeModalData: [],
  425. appData: [],
  426. appModalData: [],
  427. columns: [
  428. {
  429. title: '等级判定策略名称',
  430. key: 'strategyName',
  431. align: 'center',
  432. ellipsis: true,
  433. tooltip: true
  434. },
  435. {
  436. title: '来源应用',
  437. key: 'appName',
  438. align: 'center',
  439. ellipsis: true,
  440. tooltip: true
  441. },
  442. {
  443. title: '设备类型',
  444. key: 'equipmentTypeName',
  445. align: 'center',
  446. ellipsis: true,
  447. tooltip: true
  448. },
  449. {
  450. title: '监测指标数量',
  451. key: 'targetCount',
  452. align: 'center'
  453. },
  454. {
  455. title: '策略覆盖指标数量',
  456. key: 'coverTargetCount',
  457. align: 'center',
  458. },
  459. {
  460. title: '策略覆盖设备数量',
  461. key: 'coverEquipmentCount',
  462. align: 'center',
  463. },
  464. {
  465. title: '是否启用',
  466. key: 'enabled',
  467. align: 'center',
  468. width: 120,
  469. render: (h, params) => {
  470. return h('div', [
  471. h('i-switch', {
  472. props: { value: params.row.enabled,'true-color': '#57C44F', trueValue:1,falseValue: 0
  473. },
  474. nativeOn:{
  475. "mousedown":(event)=>{ // 监听组件原生事件mousedown,此事件在click之前触发
  476. this.rowObj = params.row
  477. if (params.row.enabled == 1) {
  478. this.commonTitle = '确认关闭'
  479. this.activeColor = '#E92E2E'
  480. this.activeClass = 'icon-guanbi'
  481. this.modalTitle = '可能影响新数据判断结果。'
  482. this.modalStatus = true
  483. } else {
  484. this.commonTitle = '确认启用'
  485. this.activeColor = '#57C44F'
  486. this.activeClass = 'icon-qiyong'
  487. this.modalTitle = '当前时间点后所有告警信息,将使用策略自动判定。'
  488. this.modalStatus = true
  489. }
  490. },
  491. }
  492. }),
  493. ])
  494. }
  495. },
  496. {
  497. title: '操作',
  498. align: 'center',
  499. slot: 'action',
  500. width: 120,
  501. }
  502. ],
  503. disabledApp: false,
  504. disabledEquip: false,
  505. showModal: false,
  506. detailStatus: false,
  507. modalStatus: false,
  508. title: '新增策略',
  509. commonTitle: "确认删除",
  510. activeColor: '#E92E2E',
  511. activeClass: '',
  512. modalTitle: '',
  513. formOption: {appId:'',equipmentTypeId: '',strategyName: '',enabled: 0},
  514. appModalName: '',
  515. ruleValidate: {
  516. appId: [{
  517. required: true,
  518. type: 'number',
  519. message: '请选择来源应用',
  520. trigger: 'change'
  521. }],
  522. equipmentTypeId: [{
  523. required: true,
  524. type: 'number',
  525. message: '请选择设备类型',
  526. trigger: 'change'
  527. }],
  528. strategyName: [{
  529. required: true,
  530. message: '请输入策略名称',
  531. trigger: 'change'
  532. }],
  533. },
  534. detailLabel: [],
  535. formCustom: {
  536. alertStrategyRankDTOList: [
  537. {
  538. rankId: '',
  539. rankName: '',
  540. alertStrategyDetailList: [
  541. {
  542. targetId: '',
  543. targetName: '',
  544. logical1: '',
  545. logicalName1: '',
  546.             targetValue1: '',
  547.             connectLogical: '',
  548. connectLogicalName: '',
  549.             logical2: '',
  550. logicalName2: '',
  551.             targetValue2: '',
  552. relation: '',
  553. relationName: ''
  554. },
  555. ],
  556. subLogical: '',
  557. subLogicalName: ''
  558. },
  559. ],
  560. },
  561. operatorModalData: [],
  562. indicatorsModalData: [],
  563. alarmLevelModalData: [],
  564. logicJudgmentModalData: [],
  565. clickbtn: 1, // 1点击策略增加按钮 2点击子策略增加按钮 3点击子策略删除按钮
  566. };
  567. },
  568. mounted() {
  569. this.getType()
  570. },
  571. methods: {
  572. go (){
  573. // this.$router.push({path:'//ApplicationManage'})
  574. // this.$router.push({path:'/MainPage/ApplicationManage/2'})
  575. this.$router.push({ name: 'ApplicationManage', params: { type:2 }}) // -> /home/123
  576. },
  577. changePicker (date) {
  578. this.tableParams.useDateBegin = date[0]
  579. this.tableParams.useDateEnd = date[1]
  580. },
  581. rowClassName(row, index) {
  582. if (index % 2 == 0) {
  583. return "ivu-table-stripe-even";
  584. } else {
  585. return "ivu-table-stripe-odd";
  586. }
  587. },
  588. // 分页
  589. changePage (val) {
  590. this.tableParams.pageNum = val
  591. this.getTableData()
  592. },
  593. //跳转
  594. sizeChange (val) {
  595. this.tableParams.pageSize = val
  596. this.getTableData()
  597. },
  598. getType () {
  599. // 获取来源应用
  600. this.$get('metroapi/application/info/list', this.applicationParams).then(res=>{
  601. if (res.httpCode == 1 ){
  602. this.appModalData = res.data.data
  603. // this.appData = res.data.data
  604. // this.appData.unshift({ id: '-1', appName: '来源应用' })
  605. } else {
  606. this.appModalData = []
  607. // this.appData = []
  608. }
  609. })
  610. // this.$get('metroapi/dic/queryDictionary', {name:'监测指标'}).then(res=>{
  611. // if (res.httpCode == 1 ){
  612. // this.indicatorsModalData = res.data
  613. // } else {
  614. // this.indicatorsModalData = []
  615. // }
  616. // })
  617. this.$get('metroapi/dic/queryDictionary', {name:'逻辑运算符'}).then(res=>{
  618. if (res.httpCode == 1 ){
  619. this.operatorModalData = res.data
  620. } else {
  621. this.operatorModalData = []
  622. }
  623. })
  624. this.$get('metroapi/dic/queryDictionary', {name:'逻辑判断'}).then(res=>{
  625. if (res.httpCode == 1 ){
  626. this.logicJudgmentModalData = res.data
  627. } else {
  628. this.logicJudgmentModalData = []
  629. }
  630. })
  631. // 告警等级
  632. this.$get('metroapi/alert/rank/list', this.alarmParams).then(res=>{
  633. if (res.httpCode == 1 ){
  634. this.alarmLevelModalData = res.data.data
  635. } else {
  636. this.alarmLevelModalData = []
  637. }
  638. })
  639. },
  640. // selectApp (val) {
  641. // this.tableParams.equipmentTypeId = ''
  642. // this.tableParams.applicationId = val
  643. // this.appParams.applicationId = val
  644. // if (this.tableParams.applicationId) {
  645. // this.getAddEquipType(this.appParams)
  646. // }
  647. // },
  648. // 获取新增设备类型
  649. getAddEquipType (params) {
  650. if (params.applicationId == '-1') {
  651. this.equipTypeData = [{ equipmentTypeId: '-1', equipmentName: '设备类型' }]
  652. } else {
  653. this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
  654. if (res.httpCode == 1 ){
  655. this.equipTypeModalData = res.data.data
  656. this.equipTypeData = res.data.data
  657. this.equipTypeData.unshift({ equipmentTypeId: '-1', equipmentName: '设备类型' })
  658. } else {
  659. this.equipTypeData = []
  660. this.equipTypeModalData = []
  661. }
  662. })
  663. }
  664. },
  665. // 获取表格数据
  666. getTableData () {
  667. let params = JSON.parse(JSON.stringify(this.tableParams))
  668. // params.applicationId = params.applicationId == '-1' ? '':params.applicationId
  669. // params.equipmentTypeId = params.equipmentTypeId == '-1' ?'':params.equipmentTypeId
  670. params.targetCount = params.targetCount == '-1' ? '':params.targetCount
  671. params.coverTargetCount = params.coverTargetCount == '-1' ?'':params.coverTargetCount
  672. params.coverEquipmentCount = params.coverEquipmentCount == '-1' ?'':params.coverEquipmentCount
  673. this.loading = true
  674. this.$get('metroapi/alert/queryStrategyPage', params).then(res=>{
  675. this.loading = false
  676. if (res.httpCode == 1 ){
  677. this.tableData = res.data.data
  678. this.tableTotal = res.data.count
  679. if (res.data.data.length==0) {
  680. this.tablePage = 0
  681. } else {
  682. this.tablePage = res.data.count<= 10 ? 1: Math.ceil(res.data.count/this.tableParams.pageSize)
  683. }
  684. if (res.data.data.length==0 && this.tableParams.pageNum>1) {
  685. this.tableParams.pageNum--
  686. return this.getTableData()
  687. }
  688. } else {
  689. this.tableData = []
  690. this.tableTotal = 0
  691. }
  692. })
  693. },
  694. selectModalApp (val) {
  695. if (val) {
  696. this.appParams.applicationId = val.value
  697. this.formOption.equipmentTypeId = ''
  698. this.formOption.strategyName = val.label
  699. this.appModalName = val.label
  700. this.clickbtn = 1
  701. this.formCustom.alertStrategyRankDTOList[0].alertStrategyDetailList[0].targetId = ''
  702. this.indicatorsModalData = []
  703. this.getAddEquipType( this.appParams)
  704. }
  705. },
  706. selectModalEquip (val) {
  707. if (val) {
  708. this.formOption.equipmentTypeId = val.value
  709. this.formOption.strategyName = this.appModalName + '-'+ val.label
  710. this.clickbtn = 1
  711. this.formCustom.alertStrategyRankDTOList[0].alertStrategyDetailList[0].targetId = ''
  712. let params = {
  713. equipmentTypeId: val.value
  714. }
  715. this.getMonitorIndex(params)
  716. }
  717. },
  718. // 获取监测指标
  719. getMonitorIndex (params) {
  720. this.$get('metroapi/target/queryTargetCountByEquTypeId', params).then(res=>{
  721. if (res.httpCode == 1 ){
  722. this.indicatorsModalData = res.data.data
  723. } else {
  724. this.equipTypeModalData = []
  725. }
  726. })
  727. },
  728. // 获取新增设备类型
  729. getAddEquipType (params) {
  730. this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
  731. if (res.httpCode == 1 ){
  732. this.equipTypeModalData = res.data.data
  733. } else {
  734. this.equipTypeModalData = []
  735. }
  736. })
  737. },
  738. searchClick () {
  739. this.tableParams.pageNum = 1
  740. this.getTableData()
  741. // this.$router.push({ path: '/MainPage/ApplicationManage', query: {deptName: "2"}})
  742. },
  743. resetClick (name) {
  744. // this.tableParams.equipmentTypeId = ''
  745. // this.equipTypeModalData = [{ id: '-1', stationName: '设备类型' }]
  746. this.$refs[name].resetFields()
  747. this.tableParams.pageNum = 1
  748. this.getTableData()
  749. },
  750. getstrategyData (id) {
  751. this.$get('metroapi/alert/getStrategy', {strategyId:id}).then(res=>{
  752. if ( res.httpCode == 1 ){
  753. this.detailLabel = [{name:'基础信息',arr:[{name:'策略名称',value:res.data.strategyName},{name:'设备类型',value:res.data.equipmentTypeName},{name:'来源应用',value:res.data.appName}]}]
  754. this.formCustom.alertStrategyRankDTOList = res.data.alertStrategyRankDTOList
  755. if (this.formCustom.alertStrategyRankDTOList && this.formCustom.alertStrategyRankDTOList.length>1) {
  756. this.disabledApp = true
  757. this.disabledEquip = true
  758. } else if (this.formCustom.alertStrategyRankDTOList.length==1) {
  759. this.disabledApp = false
  760. this.disabledEquip = false
  761. if (this.formCustom.alertStrategyRankDTOList[0].alertStrategyDetailList.length>1) {
  762. this.disabledApp = true
  763. this.disabledEquip = true
  764. }
  765. }
  766. } else {
  767. this.$Message.info(res.msg)
  768. }
  769. })
  770. },
  771. addClick () {
  772. this.clickbtn = 1
  773. this.formOption = JSON.parse(JSON.stringify(defaultFrom))
  774. this.formCustom.alertStrategyRankDTOList = [{
  775. rankId: '',
  776. rankName: '',
  777. alertStrategyDetailList: [
  778. {
  779. targetId: '',
  780. targetName: '',
  781. logical1: '',
  782. logicalName1: '',
  783.             targetValue1: '',
  784.             connectLogical: '',
  785. connectLogicalName: '',
  786.             logical2: '',
  787. logicalName2: '',
  788.             targetValue2: '',
  789. relation: '',
  790. relationName: ''
  791. },
  792. ],
  793. subLogical: '',
  794. subLogicalName: ''
  795. }];
  796. this.disabledApp = false
  797. this.disabledEquip = false
  798. this.title = '新增策略'
  799. this.$nextTick(()=> {
  800. this.showModal = true
  801. })
  802. },
  803. detailClick (row) {
  804. this.getstrategyData(row.id)
  805. this.rowObj = row
  806. this.$nextTick(()=> {
  807. this.detailStatus = true
  808. })
  809. // this.$get('metroapi/equipment/equipmentDetail', {equipmentId:row.id}).then(res=>{
  810. // if ( res.httpCode == 1 ){
  811. // this.detailLabel = res.data
  812. // } else {
  813. // this.$Message.info(res.msg)
  814. // }
  815. // })
  816. },
  817. editClick (row) {
  818. this.clickbtn = 1
  819. let params = {
  820. equipmentTypeId: row.equipmentTypeId
  821. }
  822. this.getMonitorIndex(params)
  823. this.getstrategyData(row.id)
  824. this.rowObj = row
  825. this.formOption = JSON.parse(JSON.stringify(row));
  826. this.appParams.applicationId = this.formOption.appId
  827. this.getAddEquipType(this.appParams)
  828. this.title = '编辑策略'
  829. this.$nextTick(()=> {
  830. this.showModal = true
  831. })
  832. },
  833. delClick (row) {
  834. this.rowObj = row
  835. this.commonTitle = '确认删除'
  836. this.activeColor = '#E92E2E'
  837. this.activeClass = ''
  838. this.modalTitle = '删除的同时将解绑所有运营数据,且数据不可恢复,请慎重操作。'
  839. this.modalStatus = true
  840. },
  841. modalChange (modalStatus) {
  842. if (!modalStatus) {
  843. this.$refs.formOption.resetFields();
  844. this.$refs.formDynamic.resetFields();
  845. this.equipTypeModalData = []
  846. this.indicatorsModalData = []
  847. document.querySelector(".common-modal .common-scroll").scrollTo(0, 0); // 滚动条回到顶部
  848. }
  849. },
  850. modalOk () {
  851. var params = Object.assign({}, this.formOption, this.formCustom); // 合并对象 注意目标对象自身也会改变。假设目标对象{}是之前里的对象,他的值跟obj一样
  852. this.clickbtn = 1
  853. this.$nextTick(()=> {
  854. // 多个form表单验证
  855. const p1 = new Promise((resolve,reject)=>{
  856. this.$refs['formOption'].validate(valid=>{
  857. if(valid) resolve()
  858. })
  859. })
  860. const p2 = new Promise((resolve,reject)=>{
  861. this.$refs['formDynamic'].validate(valid=>{
  862. if(valid) resolve()
  863. })
  864. })
  865. Promise.all([p1,p2]).then(()=>{
  866. let canSave = false
  867. params.alertStrategyRankDTOList.forEach((item,index) => {
  868. item.alertStrategyDetailList.forEach((val,i) => {
  869. if ((val.connectLogical && val.logical2 && val.targetValue2) || (!val.connectLogical && !val.logical2 && !val.targetValue2)) {
  870. canSave = true
  871. } else {
  872. canSave = false
  873. this.$Message['error']({
  874. background: true,
  875. content: '后三个做一致性校验。值要有都有,要没有都没有'
  876. });
  877. }
  878. })
  879. })
  880. if(canSave) {
  881. this.saveStrategyData(params)
  882. }
  883. })
  884. })
  885. },
  886. saveStrategyData (params) {
  887. let url = ''
  888. if (this.title == '新增策略') {
  889. url = 'metroapi/alert/addStrategy'
  890. } else {
  891. url = 'metroapi/alert/editStrategy'
  892. }
  893. this.$post(url, params).then(res=>{
  894. if ( res.httpCode == 1 ){
  895. this.showModal = false
  896. this.$Message.info(res.msg)
  897. this.getTableData()
  898. } else {
  899. this.$Message.info(res.msg)
  900. }
  901. })
  902. },
  903. modalCancel () {
  904. this.showModal = false
  905. },
  906. commonOk () {
  907. if (this.commonTitle == '确认启用') {
  908. let params = {
  909. strategyId: this.rowObj.id,
  910. enabled: 1
  911. }
  912. this.getSwitchStatus(params)
  913. } else if (this.commonTitle == '确认关闭') {
  914. let params = {
  915. strategyId: this.rowObj.id,
  916. enabled:0
  917. }
  918. this.getSwitchStatus(params)
  919. } else {
  920. let params = {
  921. strategyId: this.rowObj.id
  922. }
  923. this.delData(params)
  924. }
  925. },
  926. commonCancel () {
  927. this.modalStatus = false
  928. },
  929. // 启用 关闭/接口
  930. getSwitchStatus (params) {
  931. this.$get('metroapi/alert/enableStrategy',params).then(res=>{
  932. if (res.httpCode == 1 ){
  933. if (params.enabled == 0) {
  934. this.rowObj.enabled = 0
  935. } else {
  936. this.rowObj.enabled = 1
  937. }
  938. this.modalStatus = false
  939. } else {
  940. this.rowObj.enabled = 0
  941. this.$Message.info(res.msg)
  942. }
  943. })
  944. },
  945. // 删除接口
  946. delData (params) {
  947. this.$get('metroapi/alert/delStrategy',params).then(res=>{
  948. if (res.httpCode == 1 ){
  949. this.modalStatus = false
  950. this.$Message.info(res.msg)
  951. this.getTableData()
  952. } else {
  953. this.$Message.info(res.msg)
  954. }
  955. })
  956. },
  957. handleAdd(name) {
  958. this.clickbtn = 1
  959. this.$nextTick(()=> {
  960. this.$refs[name].validate((valid) => {
  961. if (valid) {
  962. if (this.formCustom.alertStrategyRankDTOList.length>0) {
  963. this.disabledApp = true
  964. this.disabledEquip = true
  965. }
  966. this.formCustom.alertStrategyRankDTOList.push({
  967. rankId: '',
  968. rankName: '',
  969. alertStrategyDetailList: [
  970. {
  971. targetId: '',
  972. targetName: '',
  973. logical1: '',
  974. logicalName1: '',
  975.             targetValue1: '',
  976.             connectLogical: '',
  977. connectLogicalName: '',
  978.             logical2: '',
  979. logicalName2: '',
  980.             targetValue2: '',
  981. relation: '',
  982. relationName: ''
  983. },
  984. ],
  985. });
  986. this.formCustom.subLogical = ''
  987. this.formCustom.subLogicalName = ''
  988. // this.formCustom.alertStrategyRankDTOList.forEach((item,index) => {
  989. // item.alertStrategyDetailList.forEach((val,i) => {
  990. // if ((val.connectLogical && val.logical2 && val.targetValue2) || (!val.connectLogical && !val.logical2 && !val.targetValue2)) {
  991. // this.formCustom.alertStrategyRankDTOList.push({
  992. // rankId: '',
  993. // rankName: '',
  994. // alertStrategyDetailList: [
  995. // {
  996. // targetId: '',
  997. // targetName: '',
  998. // logical1: '',
  999. // logicalName1: '',
  1000. //             targetValue1: '',
  1001. //             connectLogical: '',
  1002. // connectLogicalName: '',
  1003. //             logical2: '',
  1004. // logicalName2: '',
  1005. //             targetValue2: '',
  1006. // relation: '',
  1007. // relationName: ''
  1008. // },
  1009. // ],
  1010. // });
  1011. // this.formCustom.subLogical = ''
  1012. // this.formCustom.subLogicalName = ''
  1013. // } else {
  1014. // this.$Message.info('后三个做一致性校验。值要有都有,要没有都没有')
  1015. // }
  1016. // })
  1017. // })
  1018. }
  1019. });
  1020. })
  1021. },
  1022. handleAddSub(name) {
  1023. if (this.formCustom.subLogical) {
  1024. this.clickbtn = 1
  1025. } else {
  1026. this.clickbtn = 2
  1027. }
  1028. this.$nextTick(()=> {
  1029. this.$refs[name].validate((valid) => {
  1030. if (valid) {
  1031. this.disabledApp = true
  1032. this.disabledEquip = true
  1033. this.formCustom.alertStrategyRankDTOList[
  1034. this.formCustom.alertStrategyRankDTOList.length - 1
  1035. ].alertStrategyDetailList.push({
  1036. targetId: '',
  1037. targetName: '',
  1038. logical1: '',
  1039. logicalName1: '',
  1040.             targetValue1: '',
  1041.             connectLogical: '',
  1042. connectLogicalName: '',
  1043.             logical2: '',
  1044. logicalName2: '',
  1045.             targetValue2: '',
  1046. relation: this.formCustom.subLogical,
  1047. relationName: this.formCustom.subLogicalName
  1048. });
  1049. // this.formCustom.subLogical = ''
  1050. // this.formCustom.subLogicalName = ''
  1051. }
  1052. })
  1053. })
  1054. },
  1055. handleEditSub (name,index) {
  1056. if (this.formCustom.subLogical) {
  1057. this.clickbtn = 1
  1058. } else {
  1059. this.clickbtn = 2
  1060. }
  1061. this.$nextTick(()=> {
  1062. this.$refs.formDynamic.validateField(`alertStrategyRankDTOList.${index}.subLogical`,(valid)=> {
  1063. if (valid!='请选择逻辑判断') {
  1064. this.disabledApp = true
  1065. this.disabledEquip = true
  1066. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList.push({
  1067. targetId: '',
  1068. targetName: '',
  1069. logical1: '',
  1070. logicalName1: '',
  1071.             targetValue1: '',
  1072.             connectLogical: '',
  1073. connectLogicalName: '',
  1074.             logical2: '',
  1075. logicalName2: '',
  1076.             targetValue2: '',
  1077. relation: this.formCustom.alertStrategyRankDTOList[index].subLogical,
  1078. relationName: this.formCustom.alertStrategyRankDTOList[index].subLogicalName
  1079. });
  1080. }
  1081. })
  1082. })
  1083. },
  1084. handleRemove (index) {
  1085. this.clickbtn = 3
  1086. this.$nextTick(()=> {
  1087. if (this.formCustom.alertStrategyRankDTOList.length == 1) {
  1088. this.$Message['error']({
  1089. background: true,
  1090. content: '请至少保留一条非空策略',
  1091. });
  1092. } else {
  1093. this.formCustom.alertStrategyRankDTOList.splice(index, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
  1094. }
  1095. this.formCustom.alertStrategyRankDTOList.forEach((item,index)=> {
  1096. if (this.formCustom.alertStrategyRankDTOList.length==1 && item.alertStrategyDetailList && item.alertStrategyDetailList.length==1) {
  1097. this.disabledApp = false
  1098. this.disabledEquip = false
  1099. }
  1100. })
  1101. // this.formCustom.alertStrategyRankDTOList[this.formCustom.alertStrategyRankDTOList.length - 1].alertStrategyDetailList.splice(i, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
  1102. })
  1103. },
  1104. handleSubRemove(index,i) {
  1105. this.clickbtn = 3
  1106. this.$nextTick(()=> {
  1107. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList.splice(i, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
  1108. // if (this.formCustom.alertStrategyRankDTOList.length==1) {
  1109. // this.disabledApp = false
  1110. // this.disabledEquip = false
  1111. // }
  1112. this.formCustom.alertStrategyRankDTOList.forEach((item,index)=> {
  1113. if (this.formCustom.alertStrategyRankDTOList.length==1 && item.alertStrategyDetailList && item.alertStrategyDetailList.length==1) {
  1114. this.disabledApp = false
  1115. this.disabledEquip = false
  1116. }
  1117. })
  1118. // this.formCustom.alertStrategyRankDTOList[this.formCustom.alertStrategyRankDTOList.length - 1].alertStrategyDetailList.splice(i, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
  1119. })
  1120. },
  1121. selectSubLogical (val) {
  1122. if (val) {
  1123. this.formCustom.subLogical = val.value
  1124. this.formCustom.subLogicalName = val.label
  1125. this.clickbtn = 1
  1126. }
  1127. },
  1128. selectEditSubLogical (val,index) {
  1129. this.formCustom.alertStrategyRankDTOList[index].subLogical = val
  1130. let subLogicalName = ''
  1131. this.logicJudgmentModalData.forEach((item)=> {
  1132. if (val == item.id) {
  1133. subLogicalName = item.value
  1134. }
  1135. })
  1136. this.formCustom.alertStrategyRankDTOList[index].subLogicalName = subLogicalName
  1137. },
  1138. selectTarget (val,index,i) {
  1139. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].targetId = val
  1140. let targetName = ''
  1141. this.indicatorsModalData.forEach((item)=> {
  1142. if (val == item.id) {
  1143. targetName = item.targetCode
  1144. }
  1145. })
  1146. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].targetName = targetName
  1147. },
  1148. selectLogical1 (val,index,i) {
  1149. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].logical1 = val
  1150. let logicalName1 = ''
  1151. this.operatorModalData.forEach((item)=> {
  1152. if (val == item.id) {
  1153. logicalName1 = item.value
  1154. }
  1155. })
  1156. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].logicalName1 = logicalName1
  1157. },
  1158. selectConnectLogical (val,index,i) {
  1159. if (val) {
  1160. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].connectLogical = val
  1161. let connectLogicalName = ''
  1162. this.logicJudgmentModalData.forEach((item)=> {
  1163. if (val == item.id) {
  1164. connectLogicalName = item.value
  1165. }
  1166. })
  1167. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].connectLogicalName = connectLogicalName
  1168. } else {
  1169. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].connectLogical = ''
  1170. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].connectLogicalName = ''
  1171. }
  1172. },
  1173. selectLogical2 (val,index,i) {
  1174. if (val) {
  1175. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].logical2 = val
  1176. let logicalName2 = ''
  1177. this.operatorModalData.forEach((item)=> {
  1178. if (val == item.id) {
  1179. logicalName2 = item.value
  1180. }
  1181. })
  1182. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].logicalName2 = logicalName2
  1183. } else {
  1184. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].logical2 = ''
  1185. this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].logicalName2 = ''
  1186. }
  1187. },
  1188. selectRank (val,index) {
  1189. this.formCustom.alertStrategyRankDTOList[index].rankId = val
  1190. let rankName = ''
  1191. this.alarmLevelModalData.forEach((item)=> {
  1192. if (val == item.id) {
  1193. rankName = item.name
  1194. }
  1195. })
  1196. this.formCustom.alertStrategyRankDTOList[index].rankName = rankName
  1197. // this.alarmLevelModalData.forEach((item,index)=> {
  1198. // if (val == item.id) {
  1199. // item.disabled = true
  1200. // } else {
  1201. // item.disabled = false
  1202. // }
  1203. // })
  1204. }
  1205. }
  1206. };
  1207. </script>
  1208. <style scoped lang="stylus">
  1209. .content-main-manage {
  1210. position: relative;
  1211. // height: calc(100% - 50px);
  1212. height: 100%;
  1213. }
  1214. .search-list {
  1215. display: flex;
  1216. padding: 10px 0 0;
  1217. }
  1218. .search-left {
  1219. display: flex;
  1220. align-items: center;
  1221. .ivu-select {
  1222. width: 175px;
  1223. height: 32px;
  1224. }
  1225. .ivu-select-single .ivu-select-selection {
  1226. height: 100%;
  1227. }
  1228. >>> .ivu-input {
  1229. width: 160px;
  1230. height: 32px;
  1231. }
  1232. >>> .ivu-input-prefix, >>> .ivu-input-suffix {
  1233. height: 32px;
  1234. line-height: 32px;
  1235. }
  1236. >>> .ivu-input-icon {
  1237. height: 32px;
  1238. line-height: 32px;
  1239. }
  1240. >>> .date-picker-main .ivu-date-picker-header {
  1241. border-bottom: 0.0052083333rem solid #204384;
  1242. }
  1243. }
  1244. .btn-container {
  1245. display: flex;
  1246. justify-content: flex-end;
  1247. padding-bottom: 10px;
  1248. }
  1249. .common-form {
  1250. display: flex;
  1251. flex-wrap: wrap;
  1252. }
  1253. >>> .common-form-list .ivu-form-item {
  1254. margin-bottom: 10px;
  1255. }
  1256. .manage-main-center {
  1257. width: 100%;
  1258. // height: calc(100% - 150px);
  1259. height: calc(100% - 140px);
  1260. }
  1261. .common-table {
  1262. height: 100%;
  1263. // max-height: 100%;
  1264. }
  1265. >>> .common-table .ivu-table-body{
  1266. height: calc(100% - 50px);
  1267. overflow: hidden;
  1268. overflow-y: auto;
  1269. }
  1270. >>> .common-table .ivu-table th {
  1271. height: 50px;
  1272. }
  1273. >>> .common-table .ivu-table td {
  1274. height: 49.5px;
  1275. }
  1276. >>> .common-table .ivu-spin-fix {
  1277. top: 50px;
  1278. }
  1279. // >>> .common-table .ivu-table th {
  1280. // height: 49px;
  1281. // }
  1282. // >>> .common-table .ivu-table td {
  1283. // height: 48.5px;
  1284. // }
  1285. // >>> .common-table .ivu-spin-fix {
  1286. // top: 49px;
  1287. // }
  1288. >>> .app-table .ivu-spin-fix {
  1289. height: calc(100vh - 375px);
  1290. }
  1291. >>> .ivu-table-tip {
  1292. background: url('../../../assets/images/noData.png') no-repeat center;
  1293. }
  1294. >>> .app-table .ivu-table-tip {
  1295. height: calc(100vh - 375px);
  1296. }
  1297. >>> .common-table .ivu-table-tip table {
  1298. display: none;
  1299. }
  1300. >>> .modal-table {
  1301. overflow: auto !important;
  1302. }
  1303. >>> .modal-table .ivu-spin-fix {
  1304. height: 200px;
  1305. }
  1306. >>> .modal-table .ivu-table-tip {
  1307. height: 200px;
  1308. }
  1309. .common-page {
  1310. margin-top: 15px;
  1311. display: flex;
  1312. align-items: center;
  1313. justify-content: flex-end;
  1314. position: absolute;
  1315. bottom: 0;
  1316. right: 0;
  1317. }
  1318. .common-page-total {
  1319. color: #fff;
  1320. padding-right: 10px;
  1321. font-size: 14px;
  1322. span {
  1323. color #409EFF;
  1324. }
  1325. }
  1326. >>> .modal-tabs-item {
  1327. margin-top: 10px;
  1328. }
  1329. >>> .common-modal-top-text {
  1330. font-size: 14px;
  1331. font-weight: bold;
  1332. color: #29A0FF;
  1333. line-height: 42px;
  1334. border-left: 3px solid #1590F1;
  1335. padding-left: 12px;
  1336. }
  1337. >>> .common-modal-content {
  1338. display: flex;
  1339. width: 100%;
  1340. justify-content: space-between;
  1341. flex-wrap: wrap;
  1342. margin-bottom: 15px;
  1343. border-right: 1px solid #21437B;
  1344. }
  1345. >>> .modal-content-item {
  1346. width: 50%;
  1347. display: flex;
  1348. }
  1349. >>> .item-especial {
  1350. width: 100%;
  1351. }
  1352. >>> .modal-content-item-name {
  1353. width: 50%;
  1354. height: 45px;
  1355. line-height: 45px;
  1356. background: #13305F;
  1357. border-top: 1px solid #21437B;
  1358. border-left: 1px solid #21437B;
  1359. font-size: 14px;
  1360. color: #F5F5F5;
  1361. padding-left: 20px;
  1362. }
  1363. >>> .modal-content-item-value {
  1364. width: 50%;
  1365. height: 45px;
  1366. line-height: 45px;
  1367. background: #06214D;
  1368. border-top: 1px solid #21437B;
  1369. border-left: 1px solid #21437B;
  1370. font-size: 14px;
  1371. color: #F5F5F5;
  1372. padding-left: 20px;
  1373. }
  1374. >>> .item-especial .modal-content-item-name{
  1375. width: 25%;
  1376. height: 45px;
  1377. line-height: 45px;
  1378. }
  1379. >>> .item-especial .modal-content-item-value{
  1380. width: 75%;
  1381. height: 45px;
  1382. line-height: 45px;
  1383. }
  1384. >>> .item-especial-bot .modal-content-item-name {
  1385. border-bottom: 1px solid #21437B;
  1386. }
  1387. >>> .item-especial-bot .modal-content-item-value {
  1388. border-bottom: 1px solid #21437B;
  1389. }
  1390. >>> .modal-content-item-value .ivu-tooltip {
  1391. width: 100%;
  1392. }
  1393. >>> .modal-content-item-value .ivu-tooltip-rel{
  1394. overflow: hidden;
  1395. text-overflow:ellipsis;
  1396. white-space: nowrap;
  1397. }
  1398. >>> .strategy-form-scroll {
  1399. max-height: 360px;
  1400. overflow: hidden;
  1401. overflow-y: auto;
  1402. }
  1403. >>> .strategy-form {
  1404. margin-bottom: 30px;
  1405. }
  1406. >>> .strategy-form .ivu-col{
  1407. position: initial;
  1408. color: #2B8EE2;
  1409. font-size: 14PX;
  1410. }
  1411. >>> .row-first-es {
  1412. border-left: 1px solid #21437B;
  1413. border-bottom: 1px solid #21437B;
  1414. border-right: 1px solid #21437B;
  1415. display: flex;
  1416. align-items: center;
  1417. justify-content: center;
  1418. background: #13305F;
  1419. }
  1420. >>> .strategy-form .row-first{
  1421. border-top: 1px solid #21437B;
  1422. }
  1423. >>> .strategy-form .ivu-form-item{
  1424. height: 100%;
  1425. margin-bottom: 0;
  1426. }
  1427. >>> .strategy-form-row .ivu-form-item{
  1428. width: 100%;
  1429. height: 100%;
  1430. margin-bottom: 0;
  1431. .ivu-form-item-content {
  1432. width: 100%;
  1433. padding: 10px 5px;
  1434. }
  1435. }
  1436. >>> .strategy-form-row .ivu-col {
  1437. // height: 100%;
  1438. border: 1px solid #21437B;
  1439. border-top: none;
  1440. border-left: none;
  1441. }
  1442. >>> .strategy-form .row-es-text {
  1443. border-left: none;
  1444. border-bottom: 1px solid #21437B;
  1445. border-right: 1px solid #21437B;
  1446. display: flex;
  1447. align-items: center;
  1448. justify-content: center;
  1449. background: #13305F;
  1450. }
  1451. >>> .strategy-form .row-es-last {
  1452. border-bottom: 1px solid #21437B;
  1453. border-right: 1px solid #21437B;
  1454. display: flex;
  1455. align-items: center;
  1456. justify-content: center;
  1457. .ivu-form-item {
  1458. height: 100%;
  1459. width: 100%;
  1460. .ivu-form-item-content {
  1461. height: 100%;
  1462. width: 100%;
  1463. .ivu-select {
  1464. padding: 10px 5px;
  1465. height: 100%;
  1466. width: 100%;
  1467. }
  1468. }
  1469. }
  1470. }
  1471. >>> .row-es-del .ivu-form-item-content{
  1472. display: flex;
  1473. align-items: center;
  1474. justify-content: center;
  1475. }
  1476. >>> .ivu-col-del {
  1477. cursor:pointer;
  1478. color:#BC2020;
  1479. }
  1480. >>> .strategy-form .ivu-col-btn {
  1481. border-top: none;
  1482. border-bottom: none;
  1483. display: flex;
  1484. align-items: center;
  1485. justify-content: center;
  1486. }
  1487. >>> .sub-add {
  1488. display: flex;
  1489. align-items: center;
  1490. margin-top: 20PX;
  1491. padding-left: 10%;
  1492. font-size: 12PX;
  1493. color: #FFFFFF;
  1494. .ivu-form-item-content {
  1495. display: flex;
  1496. }
  1497. }
  1498. .sub-first-text {
  1499. font-size: 14PX;
  1500. font-weight: bold;
  1501. color: #EE823A;
  1502. margin-right: 5px;
  1503. display: inline-block;
  1504. min-width: 14px;
  1505. }
  1506. >>> .ivu-col-edit {
  1507. border-left: 1px solid #21437b;
  1508. border-bottom: 1px solid #21437b;
  1509. border-right: 1px solid #21437b;
  1510. }
  1511. >>> .ivu-col-edit .sub-add {
  1512. margin-top: 0;
  1513. padding: 20px 5px;
  1514. padding-left: 10%;
  1515. }
  1516. .strategy-form-detail {
  1517. max-height: 350px;
  1518. overflow: hidden;
  1519. overflow-y: auto;
  1520. }
  1521. .strategy-form-detail .ivu-col{
  1522. text-align: center;
  1523. color: #fff;
  1524. }
  1525. >>> .strategy-form-detail .row-first-es-detail {
  1526. color: #2b8ee2;
  1527. }
  1528. >>> .strategy-form-detail .strategy-form-row {
  1529. height: 45px;
  1530. line-height: 45px;
  1531. }
  1532. >>> .strategy-form-detail .strategy-form-row .ivu-col {
  1533. height: 100%;
  1534. }
  1535. >>> .strategy-form-detail .ivu-col{
  1536. .ivu-tooltip {
  1537. width: 100%;
  1538. height: 100%;
  1539. display: flex;
  1540. align-items: center;
  1541. }
  1542. .ivu-tooltip-rel {
  1543. height: 100%;
  1544. display: flex;
  1545. align-items: center;
  1546. justify-content: center;
  1547. overflow: hidden;
  1548. text-overflow: ellipsis;
  1549. white-space: nowrap;
  1550. }
  1551. span {
  1552. overflow: hidden;
  1553. text-overflow: ellipsis;
  1554. white-space: nowrap;
  1555. padding-left: 4px;
  1556. }
  1557. }
  1558. >>> .strategy-form .ivu-form-item-error-tip {
  1559. padding-left: 6px;
  1560. }
  1561. /deep/ .ivu-input::-webkit-input-placeholder{
  1562. color: #718EBD;
  1563. }
  1564. /deep/ .ivu-input::-moz-placeholder{ /* Mozilla Firefox 19+ */
  1565. color: #718EBD;
  1566. }
  1567. /deep/ .ivu-input::-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
  1568. color: #718EBD;
  1569. }
  1570. /deep/ .ivu-input::-ms-input-placeholder{ /* Internet Explorer 10-11 */
  1571. color: #718EBD;
  1572. }
  1573. </style>