plan.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909
  1. <template>
  2. <div class="content">
  3. <div class="tabs">
  4. <ul>
  5. <li v-for="(tab,i) in tabs" @click="goTab(tab.url)" :class="{'active':tabIndex == i}">
  6. {{tab.name}}
  7. </li>
  8. </ul>
  9. </div>
  10. <div class="panel">
  11. <div class="panel-body">
  12. <div class=" panel_control">
  13. <div class="pline">
  14. <em>扫描区域:</em>
  15. <el-select v-model="panel.regionid">
  16. <el-option
  17. v-for="item in panel.regionidOptions"
  18. :key="item.Id"
  19. :label="item.Name"
  20. :value="item.Id">
  21. </el-option>
  22. </el-select>
  23. </div>
  24. <div class="pline">
  25. <em>扫描策略:</em>
  26. <el-select v-model="panel.scanStrategyId">
  27. <el-option
  28. v-for="item in panel.scanStrategyIdOptions"
  29. :key="item.Id"
  30. :label="item.Name"
  31. :value="item.Id">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div class="pline">
  36. <el-button size="medium" type="primary" @click="query">查询</el-button>
  37. </div>
  38. <div class="pline pull-right">
  39. <el-button size="medium" type="primary" @click="addList">添加</el-button>
  40. <el-button size="medium" type="primary" @click="editList">修改</el-button>
  41. <el-button size="medium" type="primary" @click="delList">删除</el-button>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <el-table
  47. :data="tableData"
  48. is-horizontal-resize
  49. :default-sort="{prop: 'date', order: 'descending'}"
  50. v-loading="loading"
  51. element-loading-background="rgba(0, 0, 0, 0.8)"
  52. class=""
  53. @selection-change="handleSelectionChange"
  54. stripe
  55. ref="multipleTable"
  56. @row-click="handle"
  57. >
  58. <el-table-column
  59. type="selection"
  60. width="55">
  61. </el-table-column>
  62. <el-table-column
  63. type="index"
  64. label="序号"
  65. width="60"
  66. sortable
  67. >
  68. </el-table-column>
  69. <el-table-column
  70. prop="RegionName"
  71. label="区域名称"
  72. sortable
  73. >
  74. </el-table-column>
  75. <el-table-column
  76. prop="Begin"
  77. label="开始时间"
  78. :formatter="filterTime"
  79. sortable
  80. >
  81. </el-table-column>
  82. <el-table-column
  83. prop="Duration"
  84. label="持续时间(秒)"
  85. sortable
  86. >
  87. </el-table-column>
  88. <el-table-column
  89. prop="InterDays"
  90. label="间隔天数"
  91. sortable
  92. >
  93. </el-table-column>
  94. <el-table-column
  95. prop="ExecCount"
  96. label="已执行次数"
  97. sortable
  98. >
  99. </el-table-column>
  100. <el-table-column
  101. prop="ScanStrategyName"
  102. label="扫描策略"
  103. sortable
  104. >
  105. </el-table-column>
  106. <el-table-column
  107. prop="UserName"
  108. label="创建者"
  109. sortable
  110. >
  111. </el-table-column>
  112. <el-table-column
  113. prop="CreateAt"
  114. label="创建时间"
  115. :formatter="filterTime"
  116. sortable
  117. >
  118. </el-table-column>
  119. </el-table>
  120. <br>
  121. <el-pagination
  122. background
  123. :total="pageination.total"
  124. :page-size="pageination.pageItem"
  125. @current-change="pageChange"
  126. ></el-pagination>
  127. <!--<el-button class="down_btn" type="primary" @click="goPoster(scope.row)">下载驱动器todo</el-button>-->
  128. <dialog_referrer_list
  129. :show="dialog_state"
  130. :title="dialog_title"
  131. :large="true"
  132. @dialog_cancel="dialog_cancel"
  133. @dialog_ok="dialog_ok"
  134. >
  135. <div class="dialogContent">
  136. <el-row :gutter="24">
  137. <el-col :span="12">
  138. <label>
  139. *区域
  140. </label>
  141. <el-select v-model="dialog.regionid">
  142. <el-option
  143. v-for="item in dialog.regionidOptions"
  144. :key="item.Id"
  145. :label="item.Name"
  146. :value="item.Id">
  147. </el-option>
  148. </el-select>
  149. </el-col>
  150. <el-col :span="12">
  151. <label>
  152. *扫描策略
  153. </label>
  154. <el-select v-model="dialog.scanStrategyId">
  155. <el-option
  156. v-for="item in dialog.scanStrategyIdOptions"
  157. :key="item.Id"
  158. :label="item.Name"
  159. :value="item.Id">
  160. </el-option>
  161. </el-select>
  162. </el-col>
  163. <el-col :span="12">
  164. <label>
  165. *开始时间
  166. </label>
  167. <el-date-picker
  168. v-model="dialog.bt"
  169. type="date"
  170. placeholder="选择日期">
  171. </el-date-picker>
  172. </el-col>
  173. <el-col :span="12">
  174. <label>
  175. *扫描时间
  176. </label>
  177. <el-input v-model="dialog.duration" type="number"></el-input>
  178. </el-col>
  179. <el-col :span="12">
  180. <label>
  181. *间隔天数
  182. </label>
  183. <el-input v-model="dialog.interDays" type="number" placeholder="0为单次扫描"></el-input>
  184. </el-col>
  185. <el-col :span="12">
  186. <label>
  187. *备注
  188. </label>
  189. <el-input v-model="dialog.memo" type="text"></el-input>
  190. </el-col>
  191. </el-row>
  192. </div>
  193. </dialog_referrer_list>
  194. </div>
  195. </template>
  196. <script>
  197. import Global from '../Global.js'
  198. import dialog_referrer_list from '../components/dialog_referrer_list'
  199. import {
  200. DetectorAdd,
  201. RegionList,
  202. DetectorEdit,
  203. ScheduledTaskList,
  204. ScanStrategyListDetail,
  205. ScheduledTaskAdd,
  206. ScheduledTaskDel,
  207. ScheduledTaskEdit,
  208. } from '../api/getApiRes.js'
  209. let qs = require('qs');
  210. export default {
  211. data() {
  212. return {
  213. // dialog
  214. dialog_state: false,
  215. dialog_title: '',
  216. dialog_type: '',//类型,1是添加,2是修改
  217. dialog: {
  218. id : '',
  219. mac: '',
  220. regionid: '',
  221. scanStrategyId: '',
  222. bt: globalBt3(0)[0],
  223. duration: 0,
  224. interDays: 0,
  225. memo: '',
  226. regionidOptions: [],
  227. scanStrategyIdOptions: [],
  228. },
  229. tabIndex: 0,
  230. tabs: [
  231. {name: '任务计划管理', url: 'plan'},
  232. ],
  233. // panel 配置项目
  234. panel: {
  235. scanStrategyId: '',
  236. usercode: '',
  237. username: '',
  238. compname: '',
  239. keyword: '',
  240. USERCODE: '',
  241. taskstatus: 99,
  242. regionid: "",
  243. regionid2: '',
  244. regionidOptions: [],
  245. scanStrategyIdOptions: [],
  246. options: [
  247. {value: 99, label: '全部'},
  248. {value: 1, label: '进行中'},
  249. {value: 2, label: '已完成'},
  250. ],
  251. time1: globalBt3(2),
  252. },
  253. pageination: {
  254. pageItem: 100,
  255. pageoptions: pageOptions(),
  256. total: 500,
  257. pageIndex: 1,
  258. },
  259. draw: 1,
  260. start: 0,
  261. recordsTotal: 0,
  262. tableData: [],
  263. allTableData: [],
  264. limit: '10',
  265. multipleSort: false,
  266. loading: true,
  267. fileList: [],
  268. multipleSelection: [],
  269. detectedmac: '',
  270. }
  271. },
  272. mounted() {
  273. this.getTableQuery();
  274. },
  275. methods: {
  276. handle(row, column, event) {
  277. this.$refs.multipleTable.toggleRowSelection(row);
  278. },
  279. // 页面数据查询
  280. getTableQuery() {
  281. let that = this;
  282. this.getGeFullRegionSelect();
  283. this.getGeFullScanStrategySelect();
  284. that.loading = true;
  285. let param = {
  286. token: localStorage.token,
  287. scanStrategyId: this.panel.scanStrategyId,//
  288. regionId: that.panel.regionid,//
  289. };
  290. let postdata = qs.stringify(param);
  291. ScheduledTaskList(postdata).then(res => {
  292. let json = res;
  293. if (json.Code == 0) {
  294. that.loading = false;
  295. if (json.Rs) {
  296. that.allTableData = json.Rs;
  297. that.recordsTotal = json.Rs.length;
  298. } else {
  299. that.allTableData = [];
  300. that.recordsTotal = 0;
  301. }
  302. // 设置分页数据
  303. that.setPaginations();
  304. } else {
  305. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  306. }
  307. })
  308. },
  309. // 获取扫描区域列表
  310. getGeFullRegionSelect() {
  311. let that = this;
  312. let param = {
  313. token: localStorage.token,
  314. };
  315. let postdata = qs.stringify(param);
  316. RegionList(postdata).then(res => {
  317. let json = res;
  318. if (json.Code == 0) {
  319. if (!json.Rs) {
  320. that.$message.error('区域列表为空,请先添加有效区域');
  321. return false
  322. }
  323. that.panel.regionidOptions = json.Rs;
  324. that.dialog.regionidOptions = json.Rs;
  325. that.panel.regionidOptions.unshift({Id: "", Name: "全部", DisplayName: "全部"});
  326. that.dialog.regionidOptions.shift();
  327. } else {
  328. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  329. }
  330. })
  331. },
  332. // 获取扫描策略下拉列表
  333. getGeFullScanStrategySelect() {
  334. let that = this;
  335. let param = {
  336. token: localStorage.token,
  337. };
  338. let postdata = qs.stringify(param);
  339. ScanStrategyListDetail(postdata).then(res => {
  340. let json = res;
  341. if (json.Code == 0) {
  342. if (!json.Rs) {
  343. that.$message.error('区域列表为空,请先添加有效区域');
  344. return false
  345. }
  346. that.panel.scanStrategyIdOptions = json.Rs;
  347. that.dialog.scanStrategyIdOptions = json.Rs;
  348. that.panel.scanStrategyIdOptions.unshift({Id: "", Name: "全部", DisplayName: "全部"});
  349. that.dialog.scanStrategyIdOptions.shift();
  350. } else {
  351. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  352. }
  353. })
  354. },
  355. // dialog获取下级列表
  356. dialoggetGeFullRegionSelect() {
  357. let that = this;
  358. let param = {
  359. token: localStorage.token,
  360. };
  361. let postdata = qs.stringify(param);
  362. RegionList(postdata).then(res => {
  363. let json = res;
  364. if (json.Code == 0) {
  365. that.dialog.regionlevelOneIdOptions = json.Rs;
  366. that.dialog.regionId = json.Rs[0].Id;
  367. } else {
  368. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  369. }
  370. })
  371. },
  372. // 跳转tab页面
  373. goTab(url) {
  374. this.$router.push({path: url});
  375. },
  376. // 查询按钮
  377. query() {
  378. this.getTableQuery();
  379. this.$message.success('查询完毕');
  380. },
  381. handleSelectionChange(val) {
  382. this.multipleSelection = val;
  383. },
  384. // 设置分页数据
  385. setPaginations() {
  386. // 分页属性
  387. let that = this;
  388. that.pageination.total = that.recordsTotal;
  389. // 默认分页
  390. that.tableData = that.allTableData.filter((item, index) => {
  391. return index < that.pageination.pageItem;
  392. });
  393. },
  394. // 每页显示数量
  395. handleSizeChange() {
  396. let that = this;
  397. that.tableData = that.allTableData.filter((item, index) => {
  398. return index < that.pageination.pageItem;
  399. });
  400. that.draw = that.pageination.pageItem;
  401. // that.getTableQuery();
  402. },
  403. // 翻页
  404. pageChange(pageIndex) {
  405. let that = this;
  406. // 获取当前页
  407. let index = that.pageination.pageItem * (pageIndex - 1);
  408. // 数据总数
  409. let nums = that.pageination.pageItem * pageIndex;
  410. // 容器
  411. let tables = [];
  412. for (var i = index; i < nums; i++) {
  413. if (that.allTableData[i]) {
  414. tables.push(that.allTableData[i])
  415. }
  416. this.tableData = tables;
  417. }
  418. that.start = index * that.draw;
  419. // that.getTableQuery();
  420. },
  421. // 自动排序
  422. sortChange(params) {
  423. console.log(params)
  424. },
  425. // 过滤时间
  426. filterFmtDate(value, row, column) {
  427. return globalfmtDate(column, 11);
  428. },
  429. addList() {
  430. this.dialog_state = true;
  431. this.dialog_title = '添加任务计划';
  432. this.dialog_type = 1;
  433. // 重载地区列表
  434. this.getGeFullRegionSelect();
  435. this.getGeFullScanStrategySelect();
  436. // clear dialog
  437. this.dialog.regionid = '';
  438. this.dialog.scanStrategyId = '';
  439. this.dialog.bt = globalBt3(0)[0];
  440. this.dialog.duration = 0;
  441. this.dialog.interDays = 0;
  442. this.dialog.memo = '';
  443. },
  444. delList() {
  445. let that = this;
  446. // checkNum
  447. if (!this.multipleSelection.length) {
  448. that.$message({
  449. showClose: true,
  450. message: '错了哦,需要先选中至少一条记录',
  451. type: 'error'
  452. });
  453. return false
  454. }
  455. let detectorid = that.multipleSelection[0].Id;
  456. let param = {
  457. token: localStorage.token,
  458. id: detectorid,
  459. };
  460. let postdata = qs.stringify(param);
  461. this.$confirm('此操作将永久删除该任务计划, 是否继续?', '提示', {
  462. confirmButtonText: '确定',
  463. cancelButtonText: '取消',
  464. type: 'warning'
  465. }).then(() => {
  466. ScheduledTaskDel(postdata).then(res => {
  467. let json = res;
  468. if (json.Code == 0) {
  469. that.$message({
  470. showClose: true,
  471. message: '选中的任务计划已删除!',
  472. type: 'success'
  473. });
  474. // 重载列表
  475. that.getTableQuery();
  476. that.dialog_state = false;
  477. } else {
  478. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  479. }
  480. });
  481. }).catch(() => {
  482. this.$message({
  483. type: 'info',
  484. message: '已取消删除'
  485. });
  486. });
  487. },
  488. editList() {
  489. let that = this;
  490. // checkNum
  491. if (!this.multipleSelection.length) {
  492. this.$message({
  493. showClose: true,
  494. message: '错了哦,需要先选中一条记录',
  495. type: 'error'
  496. });
  497. return false
  498. }
  499. if (this.multipleSelection.length > 1) {
  500. this.$message({
  501. showClose: true,
  502. message: '错了哦,只能选中一条记录',
  503. type: 'error'
  504. });
  505. return false
  506. }
  507. this.dialog_state = true;
  508. this.dialog_title = '修改任务计划信息';
  509. this.dialog_type = 2;
  510. // 读取本条记录
  511. let row = this.multipleSelection[0];
  512. this.dialog.id = row.Id ;
  513. this.dialog.regionid = row.RegionId;
  514. this.dialog.scanStrategyId = row.ScanStrategyId;
  515. this.dialog.bt = filterTimeToString(row.Begin, 11);
  516. this.dialog.duration = row.Duration;
  517. this.dialog.interDays = row.InterDays;
  518. // 重载地区列表
  519. this.getGeFullRegionSelect();
  520. this.getGeFullScanStrategySelect();
  521. },
  522. // 探测记录
  523. goPhoneRecord(row) {
  524. this.$router.push({
  525. path: '/phoneSign',
  526. query:
  527. {
  528. detectorid: row.Id,
  529. comId: 1,
  530. regionId: row.RegionId,
  531. }
  532. });
  533. },
  534. // 探测记录
  535. goWifiRecord(row) {
  536. this.$router.push({
  537. path: '/wifiSign',
  538. query:
  539. {
  540. detectorid: row.Id,
  541. comId: 1,
  542. regionId: row.RegionId,
  543. }
  544. });
  545. },
  546. dialog_cancel() {
  547. let that = this;
  548. that.dialog_state = false;
  549. },
  550. dialog_ok() {
  551. if (this.dialog_type == 1) {
  552. this.confirmAddEquip();
  553. } else {
  554. this.confirmEditEquip();
  555. }
  556. },
  557. // 提交增加新任务计划
  558. confirmAddEquip() {
  559. let that = this;
  560. // checkVal
  561. if (!that.dialog.regionid) {
  562. this.$message.error('错了哦,区域不能为空');
  563. return false
  564. }
  565. if (!that.dialog.scanStrategyId) {
  566. this.$message.error('错了哦,扫描策略不能为空');
  567. return false
  568. }
  569. if (!that.dialog.bt) {
  570. this.$message.error('错了哦,开始时间不能为空');
  571. return false
  572. }
  573. if (!that.dialog.duration) {
  574. this.$message.error('错了哦,扫描时间不能为空');
  575. return false
  576. }
  577. if (that.dialog.duration.length > 86400) {
  578. this.$message.error('错了哦,扫描时间不能超过86400秒(24小时)');
  579. return false
  580. }
  581. if (that.dialog.interDays < 0) {
  582. this.$message.error('错了哦,间隔天数不能小于0');
  583. return false
  584. }
  585. if (that.dialog.memo) {
  586. if (that.dialog.memo.length > 200) {
  587. this.$message.error('错了哦,备注不能超过200字');
  588. return false
  589. }
  590. }
  591. let param = {
  592. token: localStorage.token,
  593. scanStrategyId: that.dialog.scanStrategyId,
  594. regionId: that.dialog.regionid,
  595. bt: parseInt(new Date(that.dialog.bt).getTime() / 1000),
  596. duration: that.dialog.duration,
  597. interDays: that.dialog.interDays,
  598. memo: that.dialog.memo,
  599. };
  600. let postdata = qs.stringify(param);
  601. ScheduledTaskAdd(postdata).then(res => {
  602. let json = res;
  603. if (json.Code == 0) {
  604. that.$message({
  605. showClose: true,
  606. message: '任务计划添加成功!',
  607. type: 'success'
  608. });
  609. // 重载列表
  610. that.getTableQuery();
  611. that.dialog_state = false;
  612. } else {
  613. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  614. }
  615. });
  616. },
  617. // 提交修改任务计划信息
  618. confirmEditEquip() {
  619. let that = this;
  620. if (!that.dialog.regionid) {
  621. this.$message.error('错了哦,区域不能为空');
  622. return false
  623. }
  624. if (!that.dialog.scanStrategyId) {
  625. this.$message.error('错了哦,扫描策略不能为空');
  626. return false
  627. }
  628. if (!that.dialog.bt) {
  629. this.$message.error('错了哦,开始时间不能为空');
  630. return false
  631. }
  632. if (!that.dialog.duration) {
  633. this.$message.error('错了哦,扫描时间不能为空');
  634. return false
  635. }
  636. if (that.dialog.duration.length > 86400) {
  637. this.$message.error('错了哦,扫描时间不能超过86400秒(24小时)');
  638. return false
  639. }
  640. if (that.dialog.interDays < 0) {
  641. this.$message.error('错了哦,间隔天数不能小于0');
  642. return false
  643. }
  644. if (that.dialog.memo) {
  645. if (that.dialog.memo.length > 200) {
  646. this.$message.error('错了哦,备注不能超过200字');
  647. return false
  648. }
  649. }
  650. let param = {
  651. token: localStorage.token,
  652. id: that.dialog.id,
  653. scanStrategyId: that.dialog.scanStrategyId,
  654. regionId: that.dialog.regionid,
  655. bt: parseInt(new Date(that.dialog.bt).getTime() / 1000),
  656. duration: that.dialog.duration,
  657. interDays: that.dialog.interDays,
  658. memo: that.dialog.memo,
  659. };
  660. let postdata = qs.stringify(param);
  661. ScheduledTaskEdit(postdata).then(res => {
  662. let json = res;
  663. if (json.Code == 0) {
  664. that.$message({
  665. showClose: true,
  666. message: '任务计划添加成功!',
  667. type: 'success'
  668. });
  669. // 重载列表
  670. that.getTableQuery();
  671. that.dialog_state = false;
  672. } else {
  673. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  674. }
  675. });
  676. },
  677. // 修改任务计划状态
  678. getDetectorEditStatus(detectorid, status, text) {
  679. let that = this;
  680. let param = {
  681. token: localStorage.token,
  682. detectorid: detectorid,
  683. status: status,
  684. };
  685. let postdata = qs.stringify(param);
  686. DetectorEditStatus(postdata).then(res => {
  687. let json = res;
  688. if (json.Code == 0) {
  689. that.$message({
  690. showClose: true,
  691. message: text + '成功!',
  692. type: 'success'
  693. });
  694. // table 重载
  695. that.getTableQuery();
  696. } else {
  697. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  698. }
  699. })
  700. },
  701. // 禁用
  702. pauseRow(row) {
  703. let that = this;
  704. this.$confirm('是否禁用' + row.TagName + '任务计划?', '禁用操作', {
  705. confirmButtonText: '确定',
  706. cancelButtonText: '取消',
  707. type: 'warning'
  708. }).then(() => {
  709. that.getDetectorEditStatus(row.Id, 0, '禁用');
  710. }).catch(() => {
  711. this.$message({
  712. type: 'info',
  713. message: '已取消禁用'
  714. });
  715. });
  716. },
  717. // 获取区域位置的平面图
  718. getRegionPictureGetByRegionId(regionID) {
  719. let that = this;
  720. let param = {
  721. token: localStorage.token,
  722. regionID: regionID,
  723. regionId: regionID,
  724. };
  725. let postdata = qs.stringify(param);
  726. that.dialog.plateImgSrc = '../assets/img/main/grid.png'
  727. // RegionPictureGetByRegionId(postdata).then(res => {
  728. // let json = res;
  729. // that.dialog.plateImgSrc = '';
  730. // if (json.Code == 0) {
  731. // that.dialog.plateImgSrc = json.EncodeString;
  732. // } else {
  733. // that.$message.error(json.Memo + ',错误代码:' + json.Code);
  734. // }
  735. // })
  736. },
  737. // 启用
  738. runRow(row) {
  739. console.log(row);
  740. let that = this;
  741. this.$confirm('是否启用' + row.TagName + '任务计划?', '启用操作', {
  742. confirmButtonText: '确定',
  743. cancelButtonText: '取消',
  744. type: 'warning'
  745. }).then(() => {
  746. that.getDetectorEditStatus(row.Id, 1, '启用');
  747. }).catch(() => {
  748. this.$message({
  749. type: 'info',
  750. message: '已取消启用'
  751. });
  752. });
  753. },
  754. // 添加探测器位置的点坐标
  755. addPoint(e) {
  756. let x = e.offsetX;
  757. let y = e.offsetY;
  758. this.dialog.points = [{x: x, y: y}];
  759. },
  760. // 获取位置的文字内容
  761. selectRegionLabel(id) {
  762. let that = this;
  763. let selectedWorkName = {};
  764. // selectedWorkName = that.dialog.regionIdRoomOptions.filter(item => {
  765. selectedWorkName = that.dialog.regionlevelOneIdOptions.filter(item => {
  766. if (item.Id === id) {
  767. console.log(item.Name);
  768. that.dialog.location = item.Name;
  769. }
  770. });
  771. },
  772. filterTime(val, row, column) {
  773. return nonTfmtDate(column, 11);
  774. }
  775. },
  776. watch: {
  777. 'dialog.regionId': function (val) {
  778. if (val) {
  779. this.getRegionPictureGetByRegionId(val);
  780. }
  781. },
  782. },
  783. components: {
  784. dialog_referrer_list
  785. }
  786. }
  787. </script>
  788. <style scoped>
  789. @import "../assets/css/panel.css";
  790. @import "../assets/css/dialog.css";
  791. .tabs ul {
  792. width: 168px;
  793. float: left;
  794. }
  795. table span {
  796. cursor: pointer;
  797. }
  798. .down_btn {
  799. float: left;
  800. }
  801. .content {
  802. width: 98%;
  803. overflow: hidden;
  804. display: block;
  805. margin: 0 auto;
  806. padding-left: 20px;
  807. }
  808. .selectStyle {
  809. width: 100%;
  810. color: #005EA2;
  811. }
  812. .selectStyle ::placeholder {
  813. color: #005EA2;
  814. }
  815. /deep/ .modal .el-select .el-input .el-select__caret {
  816. position: relative;
  817. top: 35px;
  818. }
  819. .imgContianer {
  820. width: 100%;
  821. height: 340px;
  822. overflow: hidden;
  823. display: block;
  824. margin: 0 auto;
  825. }
  826. .imgContianer img {
  827. width: 100%;
  828. height: 100%;
  829. overflow: hidden;
  830. display: block;
  831. margin: 0 auto;
  832. }
  833. .pointers {
  834. position: relative;
  835. bottom: 340px;
  836. width: 100%;
  837. height: 100%;
  838. overflow: hidden;
  839. display: block;
  840. margin: 0 auto;
  841. }
  842. .imgContianer i {
  843. position: relative;
  844. width: 10px;
  845. height: 10px;
  846. float: left;
  847. border-radius: 250px;
  848. background: #FFDD00;
  849. }
  850. /deep/ .modal-dialog {
  851. height: 80px;
  852. margin-top: 20px;
  853. }
  854. /deep/ textarea {
  855. color: #6DC1FF;
  856. }
  857. /deep/ .el-table__empty-text {
  858. color: #015B9E;
  859. }
  860. /deep/ .el-input.is-disabled .el-input__inner {
  861. background-color: #015B9E;
  862. }
  863. .red {
  864. color: red;
  865. }
  866. .yellow {
  867. color: #fd0;
  868. }
  869. /deep/ .modal-dialog .el-select {
  870. width: 100%;
  871. }
  872. /deep/ .modal-dialog .el-date-editor {
  873. width: 100%;
  874. }
  875. </style>