index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <div class="app-container">
  3. <div class="main-right-box">
  4. <!-- 搜索条件 -->
  5. <div class="main-search-box">
  6. <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" size="small">
  7. <el-form-item label="检查机构">
  8. <org-tree
  9. v-model="queryParams.orgId"
  10. @defaultOrg="getDefaultOrg"
  11. @checkChange="checkChange"
  12. @click="clickTreeNode"
  13. ref="orgTree"
  14. ></org-tree>
  15. </el-form-item>
  16. <el-form-item label="时间" prop="range">
  17. <el-date-picker
  18. v-model="queryParams.range"
  19. style="width: 240px"
  20. value-format="yyyy-MM-dd HH:mm:ss"
  21. :clearable="false"
  22. type="daterange"
  23. range-separator="-"
  24. start-placeholder="开始日期"
  25. end-placeholder="结束日期"
  26. :default-time="['00:00:00', '23:59:59']"
  27. ></el-date-picker>
  28. </el-form-item>
  29. </el-form>
  30. <el-row :gutter="10">
  31. <el-col :span="1.5">
  32. <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery"
  33. >搜索
  34. </el-button>
  35. </el-col>
  36. <el-col :span="1.5">
  37. <el-button icon="el-icon-refresh" size="mini" type="primary" @click="resetQuery"
  38. >重置
  39. </el-button>
  40. </el-col>
  41. <el-col :span="1.5">
  42. <el-button icon="el-icon-upload2" size="mini" type="primary" @click="handleExport"
  43. >导出
  44. </el-button>
  45. </el-col>
  46. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  47. </el-row>
  48. </div>
  49. <el-row :gutter="20">
  50. <!-- 日历和饼图 -->
  51. <el-col :xs="24" :sm="12" :md="9" :lg="9">
  52. <p class="card-title">统计</p>
  53. <div class="calendar-box">
  54. <Calendar
  55. :startDate="this.queryParams.range[0]"
  56. :endDate="this.queryParams.range[1]"
  57. :doDates="this.doDates"
  58. :unDoDates="this.unDoDates"
  59. @select="onSelectDate"
  60. ></Calendar>
  61. </div>
  62. </el-col>
  63. <!-- 分页数据 -->
  64. <el-col :xs="24" :sm="12" :md="15" :lg="15">
  65. <el-table v-loading="loading" :data="dataList" border height="680" size="small">
  66. <el-table-column align="center" label="序号">
  67. <template v-slot:default="scope">
  68. <span v-text="getPageIndex(scope.$index)"> </span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column align="center" label="所属机构" prop="affiliatedArea"/>
  72. <el-table-column align="center" label="所属机构" prop="affiliatedBank"/>
  73. <el-table-column align="center" label="主机名称" prop="orgName"/>
  74. <el-table-column align="center" label="主机名称" prop="fileName"/>
  75. <el-table-column align="center" label="日期" prop="recordDate"/>
  76. <el-table-column align="center" label="操作人" prop="userName"/>
  77. <el-table-column
  78. class-name="small-padding fixed-width"
  79. label="操作"
  80. align="center"
  81. >
  82. <template slot-scope="{ row }">
  83. <el-button
  84. class="el-icon-download"
  85. size="mini"
  86. type="text"
  87. @click="handleExport(row.id)"
  88. >下载
  89. </el-button>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum"
  94. :total="total"
  95. @pagination="getList"/>
  96. </el-col>
  97. </el-row>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. import dayjs from "dayjs";
  103. import {mapGetters} from "vuex";
  104. import {pageData, downLoad, statistics} from "@/api/deploy/dailyCheck";
  105. import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
  106. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  107. import Calendar from "./Calendar.vue";
  108. export default {
  109. name: "dayiltCheck",
  110. components: {
  111. DataRangePicker,
  112. OrgTree,
  113. Calendar,
  114. },
  115. data() {
  116. return {
  117. // 遮罩层
  118. loading: true,
  119. // 选中数组
  120. ids: [],
  121. // 非单个停用
  122. single: true,
  123. // 非多个停用
  124. multiple: true,
  125. // 显示搜索条件
  126. showSearch: true,
  127. // 总条数
  128. total: 0,
  129. // 弹出层标题
  130. title: "",
  131. // 是否显示弹出层
  132. open: false,
  133. selectedOrgName: "",
  134. // 查询参数
  135. queryParams: {
  136. pageNum: 1,
  137. pageSize: 10,
  138. checkSub: true,
  139. orgId: null,
  140. range: this.getTodayRange(),
  141. },
  142. dataList: [],
  143. doDates: [],
  144. unDoDates: [],
  145. };
  146. },
  147. mounted() {
  148. // this.getList();
  149. },
  150. computed: {
  151. ...mapGetters(["roleList", "isAdmin", "orgName"]),
  152. calenderStartDate() {
  153. if (this.data == null || this.data.storage == null) {
  154. return new Date();
  155. }
  156. if (this.data.storage.earliestTime) {
  157. return this.data.storage.earliestTime;
  158. }
  159. let d = dayjs().add(this.data.storage.planDays * -1 - 1, "day");
  160. return d;
  161. },
  162. },
  163. methods: {
  164. dayjs,
  165. getTodayRange() {
  166. const start = new Date();
  167. start.setHours(0, 0, 0, 0); // 设置为当天的0点0分0秒
  168. const end = new Date();
  169. end.setHours(23, 59, 59, 999); // 设置为当天的23点59分59秒
  170. return [start, end];
  171. },
  172. onSelectDate(date){
  173. },
  174. /** 搜索按钮操作 */
  175. handleQuery() {
  176. this.queryParams.pageNum = 1;
  177. this.getList();
  178. },
  179. /** 重置按钮操作 */
  180. resetQuery() {
  181. this.dateRange = [];
  182. this.resetForm("queryForm");
  183. this.selectedOrgName = this.orgName;
  184. this.handleQuery();
  185. },
  186. getDefaultOrg(node) {
  187. this.queryParams.orgId = node.id;
  188. this.selectedOrgName = node.shortName;
  189. this.getList();
  190. },
  191. //单选框状态改变
  192. checkChange(state) {
  193. this.queryParams.checkSub = state;
  194. this.selectedOrgName = node.shortName;
  195. this.getList();
  196. },
  197. // 节点单击事件
  198. clickTreeNode(data) {
  199. if (data == null) {
  200. return;
  201. }
  202. this.queryParams.orgId = data.id;
  203. this.selectedOrgName = node.shortName;
  204. this.getList();
  205. },
  206. handleClose() {
  207. this.show = false;
  208. this.selectMsg = null;
  209. },
  210. /** 查询主机列表 */
  211. getList() {
  212. this.loading = true;
  213. console.log(123, this.queryParams.range);
  214. pageData(this.queryParams).then(response => {
  215. this.dataList = response.rows;
  216. this.total = response.total;
  217. this.loading = false;
  218. }
  219. ).catch((err) => {
  220. this.loading = false;
  221. });
  222. statistics(this.queryParams).then(response => {
  223. this.doDates = response.data.doDates;
  224. this.unDoDates = response.data.unDoDates;
  225. this.loading = false;
  226. }
  227. ).catch((err) => {
  228. this.loading = false;
  229. });
  230. },
  231. getPageIndex($index) {
  232. //表格序号
  233. return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
  234. },
  235. /** 导出按钮操作 */
  236. handleExport(id) {
  237. this.download(
  238. "/api/deploy/dailyCheckData/downLoad",
  239. {
  240. id,
  241. },
  242. `${this.selectedOrgName}-${this.$tab.getCurrentTabName()}-${dayjs(
  243. new Date()
  244. ).format("YYYYMMDD")}.xlsx`
  245. );
  246. },
  247. },
  248. };
  249. </script>
  250. <style lang="scss" scoped>
  251. .tab_font {
  252. font-size: 16px;
  253. font-weight: bold;
  254. }
  255. .home-container {
  256. padding: 20px;
  257. background-color: rgb(240, 242, 245);
  258. .chart-wrapper {
  259. background: #fff;
  260. margin-top: 20px;
  261. }
  262. }
  263. .card-title {
  264. width: 120px;
  265. margin: 0 0 10px 0;
  266. padding-left: 4px;
  267. color: #fff;
  268. line-height: 26px;
  269. font-weight: bold;
  270. letter-spacing: 2px;
  271. background: linear-gradient(to right, #71bfe3, #fff);
  272. }
  273. .card-group {
  274. height: 740px;
  275. .card-title {
  276. margin: 0;
  277. }
  278. }
  279. .tab-panel {
  280. height: 457px;
  281. overflow: auto;
  282. }
  283. //css 透明的属性=
  284. .card-item-icon {
  285. width: 50px;
  286. height: 50px;
  287. &:hover {
  288. opacity: 0.8;
  289. }
  290. }
  291. .msg-item {
  292. font-size: 15px;
  293. padding: 0 10px;
  294. color: #1ea8e9;
  295. line-height: 39px;
  296. display: flex;
  297. justify-content: space-between;
  298. cursor: pointer;
  299. &:hover {
  300. text-decoration: underline;
  301. }
  302. > span {
  303. display: inline-block;
  304. overflow: hidden;
  305. white-space: nowrap;
  306. text-overflow: ellipsis;
  307. text-align: start;
  308. }
  309. .item-title {
  310. flex: 0.75;
  311. }
  312. .item-time {
  313. flex: 0.25;
  314. text-align: right;
  315. }
  316. }
  317. </style>