feat: add "导入" and modify title , icon
This commit is contained in:
parent
efba375d59
commit
b874f3a316
|
@ -11,7 +11,7 @@
|
|||
<meta name="renderer" content="webkit">
|
||||
<!-- <script src="https://cdn.jsdelivr.net/gh/WangYuLue/image-conversion/build/conversion.js"></script> -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>江西心诚药业有限公司</title>
|
||||
<title>工业互联网平台</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -19,6 +19,9 @@ const yxkAPI = {
|
|||
params: param,
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
},
|
||||
autoGenerate(param) {
|
||||
return axiosJson.get(`${base.url}/apis/deviceOperation/autoGenerate`, { params: param });
|
||||
},
|
||||
};
|
||||
export default yxkAPI;
|
||||
|
|
|
@ -111,6 +111,17 @@ export default {
|
|||
imgShow: 0
|
||||
};
|
||||
},
|
||||
async created() {
|
||||
// 确保 companyInfo 已经加载
|
||||
await this.ensureCompanyInfo();
|
||||
const info = this.$store.state.common.companyInfo;
|
||||
if (info && info.name) {
|
||||
document.title = info.name;
|
||||
}
|
||||
if (info && info.favicon) {
|
||||
this.setFavicon(info.logoUrl);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//重要。相同路由页面跳转时,query不同,可以刷新页面
|
||||
key() {
|
||||
|
@ -151,8 +162,21 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
getLogoUrl: "common/getLogoUrl"
|
||||
getLogoUrl: "common/getLogoUrl",
|
||||
}),
|
||||
async ensureCompanyInfo() {
|
||||
if (!this.$store.state.common.companyInfo ||
|
||||
!this.$store.state.common.companyInfo.name) {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
if (this.$store.state.common.companyInfo &&
|
||||
this.$store.state.common.companyInfo.name) {
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 切换侧边在线客服菜单
|
||||
changeMenu() {
|
||||
this.isShow = true;
|
||||
|
@ -206,7 +230,16 @@ export default {
|
|||
},
|
||||
notreadnum(newv) {
|
||||
this.thisNotRedNum = newv;
|
||||
},
|
||||
'$store.state.common.companyInfo': {
|
||||
handler(newVal) {
|
||||
if (newVal && newVal.name) {
|
||||
document.title = newVal.name;
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -55,6 +55,9 @@ export default {
|
|||
companyInfo: state => state.common.companyInfo
|
||||
}),
|
||||
},
|
||||
created() {
|
||||
document.title = '登录'
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
login: "auth/loginByUser",
|
||||
|
|
|
@ -47,10 +47,13 @@
|
|||
<el-date-picker v-model="search_data.yf" type="month" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form_item_btn_out">
|
||||
<div class="form_item_btn_out" >
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search()">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="dialogVisible = true">导入</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
@ -78,6 +81,31 @@
|
|||
:current-page="search_data.pageno" :page-sizes="pageSizes" :page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
|
||||
</div>
|
||||
<el-dialog
|
||||
title="导入"
|
||||
:visible.sync="dialogVisible"
|
||||
width="45%"
|
||||
>
|
||||
<el-form ref="form" label-width="80px">
|
||||
<el-form-item label="选择时间">
|
||||
<el-date-picker
|
||||
v-model="choiceDate"
|
||||
type="datetimerange"
|
||||
:picker-options="pickerOptions"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
align="right">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer" style="padding-right: 20px;box-sizing: border-box;">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="queryAutoGenerate">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -93,6 +121,8 @@ export default {
|
|||
name: "ydnfx",
|
||||
data() {
|
||||
return {
|
||||
choiceDate:'',
|
||||
dialogVisible:false,
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
search_data: {
|
||||
|
@ -103,7 +133,33 @@ export default {
|
|||
planTime: "",
|
||||
statusList: [], //计划状态
|
||||
getUserList: [], //用户
|
||||
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
},
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
chooseUserVisible: false,
|
||||
|
@ -130,6 +186,19 @@ export default {
|
|||
|
||||
},
|
||||
methods: {
|
||||
async queryAutoGenerate(){
|
||||
console.log(this.choiceDate)
|
||||
const res = await this.$api.yxkAPI.autoGenerate({startTime:this.choiceDate[0],endTime:this.choiceDate[1]}).catch(()=>{
|
||||
this.dialogVisible = false
|
||||
})
|
||||
if(res.code===0){
|
||||
this.$message.success("操作成功")
|
||||
this.dialogVisible = false
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
this.dialogVisible = false
|
||||
}
|
||||
},
|
||||
async initChart(){
|
||||
const res = await this.$api.yxkAPI
|
||||
.yxkPost('/apis/hl/nhfx/bt', this.search_data)
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 3.9 KiB |
Loading…
Reference in New Issue