Commit 89abb6f0 authored by xinzhedeai's avatar xinzhedeai

西沟修改:定时刷新、foottext修改

parent eaf0a8db
...@@ -6,7 +6,11 @@ ...@@ -6,7 +6,11 @@
</keep-alive> </keep-alive>
</transition> </transition>
<footer v-if="$route.path!=='/dashboard'" class="page-footer"></footer> <footer v-if="$route.path!=='/dashboard'" class="page-footer" :data-content="$store.state.settings.footerTxt">
<!-- <span v-html="$store.state.settings.footerTxt" style="color:#888;display:inline-block;font-weight:bold;" /> -->
<!-- <span style="color:#888;display:inline-block;font-weight:bold;" /> -->
</footer>
<!-- <div v-if="$store.state.settings.showFooter" id="el-main-footer"> <!-- <div v-if="$store.state.settings.showFooter" id="el-main-footer">
<span v-html="$store.state.settings.footerTxt" /> <span v-html="$store.state.settings.footerTxt" />
...@@ -53,7 +57,8 @@ export default { ...@@ -53,7 +57,8 @@ export default {
display:flex;justify-content:center;background-color:#fff;line-height:2; display:flex;justify-content:center;background-color:#fff;line-height:2;
&:after{ &:after{
color:#888;display:inline-block;font-weight:bold; color:#888;display:inline-block;font-weight:bold;
content:'© ⋅ 技术支持:威海晶合数字矿山技术有限公司'; // content:'© ⋅ 技术支持:山东天地寰宇';
content: attr(data-content)
} }
} }
</style> </style>
......
...@@ -43,7 +43,7 @@ module.exports = { ...@@ -43,7 +43,7 @@ module.exports = {
* 底部文字,支持html语法 * 底部文字,支持html语法
*/ */
//footerTxt: '© 2019 Zheng Jie <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License 2.0</a>', //footerTxt: '© 2019 Zheng Jie <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License 2.0</a>',
footerTxt: '© ', footerTxt: '© ⋅ 技术支持:山东天地寰宇',
/** /**
* 备案号 * 备案号
*/ */
......
...@@ -16,10 +16,24 @@ ...@@ -16,10 +16,24 @@
<div class="content-fix"> <div class="content-fix">
<div class="toolbar"> <div class="toolbar">
<div> <div>
<el-button v-for="(item, key) in form.config.otherBtn" size="mini" :type="item.type" :icon="item.icon" @click="item.callback.call(_self, $event)">{{item.name}}</el-button> <el-button
v-for="(item, key) in form.config.otherBtn"
size="mini"
:type="item.type"
:icon="item.icon"
@click="item.callback.call(_self, $event)"
>{{ item.name }}</el-button
>
</div> </div>
<div> <div>
<el-button v-for="(item, key) in form.config.rightBtn" size="mini" :type="item.type" :icon="item.icon" @click="item.callback.call(_self, $event)">{{item.name}}</el-button> <el-button
v-for="(item, key) in form.config.rightBtn"
size="mini"
:type="item.type"
:icon="item.icon"
@click="item.callback.call(_self, $event)"
>{{ item.name }}</el-button
>
</div> </div>
</div> </div>
<!-- 表格渲染 --> <!-- 表格渲染 -->
...@@ -49,75 +63,103 @@ ...@@ -49,75 +63,103 @@
</template> </template>
<script> <script>
import { reqApi, Config } from '@/assets/js/httpApi.js'; import { reqApi, Config } from "@/assets/js/httpApi.js";
import { Tools } from '@/assets/js/common.js'; import { Tools } from "@/assets/js/common.js";
import DateRangePicker from '@/components/DateRangePicker'; import DateRangePicker from "@/components/DateRangePicker";
import TableFilter from '@/components/TableFilter'; import TableFilter from "@/components/TableFilter";
import cuForm from '@/components/cuForm'; import cuForm from "@/components/cuForm";
import cuTable from '@/components/cuTable'; import cuTable from "@/components/cuTable";
export default { export default {
name: 'Dashboard', name: "Dashboard",
components: { components: {
DateRangePicker, TableFilter, cuForm, cuTable DateRangePicker,
TableFilter,
cuForm,
cuTable,
}, },
data() { data() {
return { return {
Dict:{selectList:[]}, refreshInterval: null,
table:{ Dict: { selectList: [] },
table: {
page: 1, page: 1,
size: 10, size: 10,
total: 0, total: 0,
loading: false, loading: false,
dataList:[], dataList: [],
}, },
rules: {}, rules: {},
form: { form: {
title:'', visible:false, reqType:'add', historyDialog:false, title: "",
status:{cu:0}, visible: false,
query:{}, reqType: "add",
search:{}, historyDialog: false,
item:{}, status: { cu: 0 },
file:0, query: {},
config:{}, search: {},
item: {},
file: 0,
config: {},
}, },
} };
}, },
created(){ created() {
// 获取基本信息 // 获取基本信息
this.pageApi = Config.getModuleInfo(this); this.pageApi = Config.getModuleInfo(this);
this.Dict = this.pageApi.Dict; this.Dict = this.pageApi.Dict;
this.form.config = this.pageApi.config; this.form.config = this.pageApi.config;
this.rules = reqApi.getRules(this.Dict.baseInfo) || (this.Dict.rules || {}); this.rules = reqApi.getRules(this.Dict.baseInfo) || this.Dict.rules || {};
this.pageApi.created && this.pageApi.created(); this.pageApi.created && this.pageApi.created();
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.loadData(); this.loadData();
this.startRefreshInterval(); // 开启定时器
}); });
// 获取选择列表字典 // 获取选择列表字典
var selectList = this.Dict.selectList; var selectList = this.Dict.selectList;
Tools.asyncLoop.call(this, selectList, function(key, value, next){ Tools.asyncLoop.call(this, selectList, function (key, value, next) {
if(typeof value === 'function'){ if (typeof value === "function") {
value.call(this.Dict).then(function(res){ value.call(this.Dict).then(function (res) {
selectList[key] = res; next(); selectList[key] = res;
}) next();
}else{next()}; });
} else {
next();
}
}); });
}, },
beforeDestroy() {
this.clearRefreshInterval(); // 清除定时器
},
methods: { methods: {
loadData:reqApi.common.getRequst, // 定时刷新开始
cancelForm(){ startRefreshInterval() {
this.refreshInterval = setInterval(() => {
this.loadData(); // 每30秒刷新列表
}, 30000); // 30000毫秒 == 30秒
},
clearRefreshInterval() {
if (this.refreshInterval) {
clearInterval(this.refreshInterval);
this.refreshInterval = null;
}
},
// 定时刷新结束
loadData: reqApi.common.getRequst,
cancelForm() {
this.form.visible = false; this.form.visible = false;
}, },
submitForm(form, item){ submitForm(form, item) {
reqApi.common.submitForm.call(this, form, item); reqApi.common.submitForm.call(this, form, item);
}, },
} },
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scope> <style rel="stylesheet/scss" lang="scss" scope>
.qyzz{ .qyzz {
} }
</style> </style>
...@@ -16,10 +16,24 @@ ...@@ -16,10 +16,24 @@
<div class="content-fix"> <div class="content-fix">
<div class="toolbar"> <div class="toolbar">
<div> <div>
<el-button v-for="(item, key) in form.config.otherBtn" size="mini" :type="item.type" :icon="item.icon" @click="item.callback.call(_self, $event)">{{item.name}}</el-button> <el-button
v-for="(item, key) in form.config.otherBtn"
size="mini"
:type="item.type"
:icon="item.icon"
@click="item.callback.call(_self, $event)"
>{{ item.name }}</el-button
>
</div> </div>
<div> <div>
<el-button v-for="(item, key) in form.config.rightBtn" size="mini" :type="item.type" :icon="item.icon" @click="item.callback.call(_self, $event)">{{item.name}}</el-button> <el-button
v-for="(item, key) in form.config.rightBtn"
size="mini"
:type="item.type"
:icon="item.icon"
@click="item.callback.call(_self, $event)"
>{{ item.name }}</el-button
>
</div> </div>
</div> </div>
<!-- 表格渲染 --> <!-- 表格渲染 -->
...@@ -49,75 +63,103 @@ ...@@ -49,75 +63,103 @@
</template> </template>
<script> <script>
import { reqApi, Config } from '@/assets/js/httpApi.js'; import { reqApi, Config } from "@/assets/js/httpApi.js";
import { Tools } from '@/assets/js/common.js'; import { Tools } from "@/assets/js/common.js";
import DateRangePicker from '@/components/DateRangePicker'; import DateRangePicker from "@/components/DateRangePicker";
import TableFilter from '@/components/TableFilter'; import TableFilter from "@/components/TableFilter";
import cuForm from '@/components/cuForm'; import cuForm from "@/components/cuForm";
import cuTable from '@/components/cuTable'; import cuTable from "@/components/cuTable";
export default { export default {
name: 'Dashboard', name: "Dashboard",
components: { components: {
DateRangePicker, TableFilter, cuForm, cuTable DateRangePicker,
TableFilter,
cuForm,
cuTable,
}, },
data() { data() {
return { return {
Dict:{selectList:[]}, refreshInterval: null,
table:{ Dict: { selectList: [] },
table: {
page: 1, page: 1,
size: 10, size: 10,
total: 0, total: 0,
loading: false, loading: false,
dataList:[], dataList: [],
}, },
rules: {}, rules: {},
form: { form: {
title:'', visible:false, reqType:'add', historyDialog:false, title: "",
status:{cu:0}, visible: false,
query:{}, reqType: "add",
search:{}, historyDialog: false,
item:{}, status: { cu: 0 },
file:0, query: {},
config:{}, search: {},
item: {},
file: 0,
config: {},
}, },
} };
}, },
created(){ created() {
// 获取基本信息 // 获取基本信息
this.pageApi = Config.getModuleInfo(this); this.pageApi = Config.getModuleInfo(this);
this.Dict = this.pageApi.Dict; this.Dict = this.pageApi.Dict;
this.form.config = this.pageApi.config; this.form.config = this.pageApi.config;
this.rules = reqApi.getRules(this.Dict.baseInfo) || (this.Dict.rules || {}); this.rules = reqApi.getRules(this.Dict.baseInfo) || this.Dict.rules || {};
this.pageApi.created && this.pageApi.created(); this.pageApi.created && this.pageApi.created();
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.loadData(); this.loadData();
this.startRefreshInterval(); // 开启定时器
}); });
// 获取选择列表字典 // 获取选择列表字典
var selectList = this.Dict.selectList; var selectList = this.Dict.selectList;
Tools.asyncLoop.call(this, selectList, function(key, value, next){ Tools.asyncLoop.call(this, selectList, function (key, value, next) {
if(typeof value === 'function'){ if (typeof value === "function") {
value.call(this.Dict).then(function(res){ value.call(this.Dict).then(function (res) {
selectList[key] = res; next(); selectList[key] = res;
}) next();
}else{next()}; });
} else {
next();
}
}); });
}, },
beforeDestroy() {
this.clearRefreshInterval(); // 清除定时器
},
methods: { methods: {
loadData:reqApi.common.getRequst, // 定时刷新开始
cancelForm(){ startRefreshInterval() {
this.refreshInterval = setInterval(() => {
this.loadData(); // 每30秒刷新列表
}, 30000); // 30000毫秒 == 30秒
},
clearRefreshInterval() {
if (this.refreshInterval) {
clearInterval(this.refreshInterval);
this.refreshInterval = null;
}
},
// 定时刷新结束
loadData: reqApi.common.getRequst,
cancelForm() {
this.form.visible = false; this.form.visible = false;
}, },
submitForm(form, item){ submitForm(form, item) {
reqApi.common.submitForm.call(this, form, item); reqApi.common.submitForm.call(this, form, item);
}, },
} },
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scope> <style rel="stylesheet/scss" lang="scss" scope>
.qyzz{ .qyzz {
} }
</style> </style>
...@@ -318,7 +318,7 @@ export default { ...@@ -318,7 +318,7 @@ export default {
//background-image:-webkit-linear-gradient(top, #8fe9ff, #3d8aff); //background-image:-webkit-linear-gradient(top, #8fe9ff, #3d8aff);
background-image:-webkit-linear-gradient(top,#8affe1,#4193ff); background-image:-webkit-linear-gradient(top,#8affe1,#4193ff);
-webkit-background-clip:text;-webkit-text-fill-color:transparent; -webkit-background-clip:text;-webkit-text-fill-color:transparent;
content:'© ⋅ 技术支持:威海晶合数字矿山技术有限公司'; content:'© ⋅ 技术支持:山东天地寰宇';
} }
img{display:none !important;} img{display:none !important;}
} }
......
...@@ -443,7 +443,7 @@ export default { ...@@ -443,7 +443,7 @@ export default {
//background-image:-webkit-linear-gradient(top, #8fe9ff, #3d8aff); //background-image:-webkit-linear-gradient(top, #8fe9ff, #3d8aff);
background-image:-webkit-linear-gradient(top,#8affe1,#4193ff); background-image:-webkit-linear-gradient(top,#8affe1,#4193ff);
-webkit-background-clip:text;-webkit-text-fill-color:transparent; -webkit-background-clip:text;-webkit-text-fill-color:transparent;
content:'© ⋅ 技术支持:威海晶合数字矿山技术有限公司'; content:'© ⋅ 技术支持:山东天地寰宇';
} }
img{display:none !important;} img{display:none !important;}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment