123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- <template>
- <section class="app-main" :style="{ paddingTop: appMainPaddingTop }">
-
- <transition name="fade-transform" mode="out-in">
- <keep-alive include="Monitor">
- <router-view :key="key" />
- </keep-alive>
- </transition>
- <el-card v-if="shuo" class="box-card">
- <div v-if="mainShow">
- <div class="title">
- {{ topic }}
- </div>
- <div class="text">
- <p class="p">{{ message }}</p>
- </div>
- <div class="block">
- <el-pagination
- style="width: 100%"
- @current-change="handleCurrentChange"
- :current-page="pagination.current"
- :page-size="pagination.size"
- layout="prev, pager, next"
- pager-count="3"
- :total="total"
- >
- </el-pagination>
- </div>
- </div>
- <el-button type="primary" size="small" class="btn" @click="shuo = false"
- >确 定</el-button
- >
- </el-card>
- </section>
- </template>
- <script>
- import { uploadRoute } from "@/api/user";
- import { getNotifications } from "@/api/dashboard";
- export default {
- name: "AppMain",
- computed: {
- key() {
- return this.$route.path;
- },
- appMainPaddingTop() {
-
-
-
- const tagsViewShow = this.$store.state.settings.tagsView;
- if (tagsViewShow) return "43px";
- else return "0px";
- },
- },
- data() {
- return {
- shuo: true,
- mainShow: true,
- pagination: {
- size: 1,
- current: 1,
- type: 8,
- tableName: "SCADA_HISTORY",
- },
- total: 0,
- topic: "",
- message: "",
- };
- },
- mounted() {
- this.getNotificationList();
- },
- methods: {
- handleCurrentChange(value) {
- console.log("2333", value);
- this.pagination.current = value;
- this.getNotificationListPage();
- },
-
- getNotificationListPage() {
- const data = Object.assign({}, this.pagination, this.filter);
-
- this.mainShow = false;
- getNotifications(data).then((res) => {
- if (res.code == 1) {
- if (res.result.records.length > 0) {
- this.topic = res.result.records[0].topic;
- this.message = res.result.records[0].message;
- this.total = res.result.total;
- this.mainShow = true;
- }
- }
- });
- },
- getNotificationList() {
- const data = Object.assign({}, this.pagination, this.filter);
-
- this.shuo = false;
- getNotifications(data).then((res) => {
- if (res.code == 1) {
- if (res.result.records.length > 0) {
- this.topic = res.result.records[0].topic;
- this.message = res.result.records[0].message;
- this.total = res.result.total;
- }
- }
- });
- this.shuo = true;
- },
- uploadRouteTable() {
- const data = {
- 1: JSON.stringify({
- name: "sys",
-
- type: "tofly-master",
- notes: "使用与当前系统。",
- }),
- };
- uploadRoute(JSON.stringify(data)).then((res) => {
- this.$message.success("上传成功");
- });
- },
- },
- };
- </script>
- <style scoped>
- .app-main {
-
- height: calc(100vh - 64px);
- width: 100%;
- position: relative;
- overflow: hidden;
- background: #fff;
- }
- .box-card {
- width: 300px;
- height: 300px;
- position: absolute;
- right: 0;
- bottom: 0;
- }
- .btn {
- position: absolute;
- bottom: 10px;
- right: 10px;
- }
- .title {
- height: 40px;
- width: 250px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- cursor: pointer;
- }
- .text {
- height: 160px;
- }
- .p {
- margin: 0;
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 8;
- line-clamp: 8;
- -webkit-box-orient: vertical;
- }
- .block {
- width: 150px;
- }
- .fixed-header + .app-main {
- padding-top: 43px;
- }
- </style>
- <style lang="scss">
- .el-popup-parent--hidden {
- .fixed-header {
- padding-right: 15px;
- }
- }
- /deep/.el-pager {
- width: 100px;
- }
- </style>
|