addInfo.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <div>
  3. <NavBar />
  4. <div class="bigBox">
  5. <van-row>
  6. <van-col span="24">
  7. <!-- <van-cell title="任务名称" value="每周监控调阅(0501~0507)" /> -->
  8. <div class="textTitle">任务名称:{{ taskData?.taskName }}</div>
  9. </van-col>
  10. <van-col span="24">
  11. <!-- <van-cell title="调阅开始时间" value="2023-05-05 10:12" /> -->
  12. <div class="text">调阅开始时间:{{ taskData?.taskStartTime }}</div>
  13. </van-col>
  14. </van-row>
  15. <!-- 主机选择 -->
  16. <van-row>
  17. <van-col span="24">
  18. <van-field v-model="host" is-link readonly label="监控主机" placeholder="" @click="showHost = true" />
  19. <van-popup v-model="showHost" round position="bottom">
  20. <van-picker
  21. title="监控主机"
  22. show-toolbar
  23. :columns="hostList"
  24. @confirm="onConfirm"
  25. @cancel="onCancel"
  26. @change="onChange"
  27. >
  28. <template #option="option">
  29. <div style="display: flex; flex-direction: column; align-items: center">
  30. <!-- <div>{{ option.id }}</div> -->
  31. <div>{{ option.deviceName }}</div>
  32. </div>
  33. </template>
  34. </van-picker> </van-popup
  35. ></van-col>
  36. </van-row>
  37. <!-- 视频通道 -->
  38. <van-row>
  39. <van-col span="24">
  40. <van-field v-model="fieldValue" :disabled="ishost" is-link readonly label="视频通道" placeholder="" @click="showStatus = true" />
  41. <van-popup v-model="showStatus" :disabled="ishost" round position="bottom">
  42. <van-picker
  43. title="视频通道"
  44. show-toolbar
  45. :columns="columns"
  46. @confirm="onConfirm"
  47. @cancel="onCancel"
  48. @change="onChange"
  49. >
  50. <template #option="option">
  51. <div style="display: flex; flex-direction: column; align-items: center">
  52. <div>{{ option.id }}</div>
  53. <div>{{ option.deviceName }}</div>
  54. </div>
  55. </template>
  56. </van-picker>
  57. </van-popup></van-col
  58. >
  59. </van-row>
  60. <van-row>
  61. <van-col span="24">
  62. <van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o">
  63. 请选择实际调阅项目进行填写,不需要编辑所有项目
  64. </van-notice-bar>
  65. </van-col>
  66. </van-row>
  67. <div>
  68. <!-- 主体选择项 -->
  69. <van-collapse v-model="activeNames" :is-link="false">
  70. <van-collapse-item name="1">
  71. <template #title>
  72. <div>
  73. <van-checkbox v-model="checked" shape="square">复选框</van-checkbox>
  74. </div>
  75. </template>
  76. <van-row>
  77. <van-col span="24">
  78. <van-dropdown-menu>
  79. <van-dropdown-item v-model="value1" :options="option1" />
  80. </van-dropdown-menu>
  81. </van-col>
  82. </van-row>
  83. <van-row>
  84. <van-col span="24">
  85. <van-field
  86. v-model="message"
  87. rows="2"
  88. autosize
  89. label="异常说明"
  90. type="textarea"
  91. placeholder="请输入异常说明"
  92. show-word-limit
  93. />
  94. </van-col>
  95. </van-row>
  96. </van-collapse-item>
  97. <van-collapse-item name="2">
  98. <template #title>
  99. <div>
  100. <van-checkbox v-model="checked1" shape="square">复选框</van-checkbox>
  101. </div>
  102. </template>
  103. <van-row>
  104. <van-col span="24">
  105. <van-dropdown-menu>
  106. <van-dropdown-item v-model="value1" :options="option1" />
  107. </van-dropdown-menu>
  108. </van-col>
  109. </van-row>
  110. <van-row>
  111. <van-col span="24">
  112. <van-field
  113. v-show="value1 == 0"
  114. v-model="message"
  115. rows="2"
  116. autosize
  117. label="异常说明"
  118. type="textarea"
  119. placeholder="请输入异常说明"
  120. show-word-limit
  121. />
  122. </van-col>
  123. </van-row>
  124. </van-collapse-item>
  125. </van-collapse>
  126. </div>
  127. <!-- 底部按钮 -->
  128. <div class="bottomClass">
  129. <van-row>
  130. <van-col span="24">
  131. <van-button type="info">添加</van-button>
  132. </van-col>
  133. </van-row>
  134. </div>
  135. </div>
  136. </div>
  137. </template>
  138. <script>
  139. import NavBar from '@/components/NavBar'
  140. // 主机列表组件
  141. import MonitoingList from './monitoringList.vue'
  142. import { Col, Row, Dialog, Icon, Picker } from 'vant'
  143. import { registrationList, getorgHost } from '@/api/toConsult.js'
  144. import { mapGetters } from 'vuex'
  145. export default {
  146. data() {
  147. return {
  148. columns: ['全部', '已调阅', '调阅中', '待调阅'],
  149. hostList: [], //主机列表
  150. showStatus: false, //通道显示隐藏
  151. showHost: false, //主机显示隐藏
  152. checked: false,
  153. checked1: false,
  154. message: '',
  155. ishost:true,
  156. fieldValue: '',
  157. host:'',//主机名称
  158. hostId:'',//主机ID
  159. value1: 0,
  160. option1: [
  161. { text: '异常', value: 0 },
  162. { text: '正常', value: 1 }
  163. ],
  164. activeNames: [''],
  165. taskData: []
  166. }
  167. },
  168. components: {
  169. NavBar,
  170. Dialog,
  171. Icon,
  172. Picker,
  173. Col,
  174. Row,
  175. MonitoingList
  176. },
  177. computed: {
  178. monitor() {
  179. return 'monitor'
  180. },
  181. ...mapGetters(['orgName', 'orgId'])
  182. },
  183. created() {
  184. this.init()
  185. },
  186. methods: {
  187. //项目初始化获取数据
  188. init() {
  189. //获取组织机构数据
  190. registrationList({ taskId: this.$route.params.id }).then(res => {
  191. let { code, data, msg } = res
  192. if (code == 200) {
  193. this.taskData = data
  194. }
  195. })
  196. //获取当前登录人机构下主机列表
  197. getorgHost(this.orgId).then(res => {
  198. let { code, data, msg } = res
  199. if (code == 200) {
  200. this.hostList = data
  201. }
  202. })
  203. },
  204. onConfirm(value, index) {
  205. this.host=value
  206. this.hostId=this.hostList[index].id
  207. this.ishost=false
  208. },
  209. onChange(picker, value, index) {
  210. },
  211. onCancel() {
  212. Toast('取消')
  213. }
  214. }
  215. }
  216. </script>
  217. <style lang="scss" scoped>
  218. .bigBox {
  219. height: calc(100vh - 260px);
  220. overflow: scroll;
  221. }
  222. .van-button {
  223. width: 100%;
  224. margin-top: 10px;
  225. border-radius: 10px;
  226. }
  227. .bottomClass {
  228. position: fixed;
  229. width: 100%;
  230. bottom: 0%;
  231. }
  232. .condition {
  233. font-size: 50px !important;
  234. line-height: 50px;
  235. color: #1989fa;
  236. }
  237. .textTitle {
  238. font-size: 40px;
  239. font-weight: bold;
  240. padding: 20px;
  241. }
  242. .text {
  243. padding: 20px;
  244. font-size: 26px;
  245. }
  246. </style>