xiaoguo 2 years ago
commit aefdf8aa7d

@ -9,7 +9,7 @@
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
const { configure } = require('quasar/wrappers');
const path = require('path')
const path = require('path');
module.exports = configure(function (/* ctx */) {
return {
@ -30,11 +30,10 @@ module.exports = configure(function (/* ctx */) {
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli-vite/boot-files
// boot: ['axios', 'i18n.js'],
boot: ['axios', 'vue-i18n','vue-print'],
boot: ['axios', 'vue-i18n', 'vue-print'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss','global.css'],
css: ['app.scss', 'global.css'],
// https://github.com/quasarframework/quasar/tree/dev/extras
extras: [
@ -52,12 +51,12 @@ module.exports = configure(function (/* ctx */) {
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
build: {
extendWebpack (cfg, { isServer, isClient }) {
extendWebpack(cfg, { isServer, isClient }) {
cfg.resolve.alias = {
...cfg.resolve.alias, // This adds the existing alias
// Add your own alias like this
'@': path.resolve(__dirname, 'src'),
}
};
},
target: {
browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
@ -92,9 +91,19 @@ module.exports = configure(function (/* ctx */) {
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
devServer: {
// https: true
// https: true,
port: 8080,
open: true, // opens browser window automatically
proxy: {
'/api': {
target: 'https://127.0.0.1:7200',
secure: false, //开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求
changeOrigin: true,
pathRewrite: {
'^/api': '/', //重写匹配的字段。把/api 转为 /
},
},
},
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
@ -118,7 +127,7 @@ module.exports = configure(function (/* ctx */) {
// directives: [],
// Quasar plugins
plugins: ['Loading','Notify','Dialog','AppFullscreen'],
plugins: ['Loading', 'Notify', 'Dialog', 'AppFullscreen'],
},
// animations: 'all', // --- includes all animations

@ -0,0 +1,4 @@
export class SysConfigEntity {
configName!: string;
configKey!: string;
}

@ -0,0 +1,36 @@
import { request } from '../../boot/axios';
import { Pagination } from '../class';
import { SysConfigEntity } from './model/sysConfig';
const pathName = 'SysConfig/';
class SysConfigApi {
// 获取系统参数设置分页列表 configName: string, configKey: string, page: any, size: any
getPage = (val: Pagination<SysConfigEntity>) => {
return request.get(
`${pathName}GetSysConfigPageList?configName=${val.data.configName}&configKey=${val.data.configKey}&page=${val.page}&size=${val.rowsPerPage}`
);
};
// // 获取系统配置项
// getControllerItem = () => {
// return request.get(`${pathName}getControllerItem`);
// };
// // 修改 配置项
// modifyControllerItem = (val: SystemSettingEntity) => {
// return request.post(`${pathName}modifyControllerItem`, val);
// };
// // SAP库存同步接口 设置为无限请求时间
// sapStockSynchronization = () => {
// return request.get(`${pathName}sapStockSynchronization`, {
// timeout: 0
// });
// };
// // SAP物料同步接口 设置为无限请求时间
// sapMaterialSynchronization = () => {
// return request.get(`${pathName}SapMaterialSynchronization`, {
// timeout: 0
// });
// };
}
const sysConfigApi = new SysConfigApi();
export { sysConfigApi };

@ -78,6 +78,11 @@
<div class="text-subtitle2 q-mt-sm q-mb-sm">
Hi! {{ user.userName }}
</div>
<q-btn color="primary" label="系统设置" push v-close-popup icon="settings"
:to="{ name: 'sysConfig' }">
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
content-style="font-size: 12px">系统参数设置</q-tooltip>
</q-btn>
<!-- <q-btn color="primary" label="修改密码" push v-close-popup icon="lock"
@click="updatePasswordForm()">
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"

@ -0,0 +1,420 @@
<template>
<transition appear enter-active-class="animated fadeIn">
<q-card class="shadow-24">
<!-- 搜索条件 -->
<q-card-section>
<div class="row q-col-gutter-md">
<!-- 刷新 查询 -->
<div class="col-xl-2 col-lg-2 col-sm-12">
<q-btn-group push glossy>
<q-btn push label="刷新" icon="refresh" @click="reFresh()">
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
content-style="font-size: 12px">清空所有条件并刷新数据</q-tooltip>
</q-btn>
<q-btn push label="查询" icon="search" @click="getPage()">
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
content-style="font-size: 12px">按条件查询数据</q-tooltip>
</q-btn>
</q-btn-group>
</div>
<!-- 搜索条件 -->
<div class="col-xl-2 col-lg-2 col-sm-12">
<q-input dense label="日期范围" ref="rangDateRef" readonly outlined v-model="rangDateText">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
content-style="font-size: 12px">选择日期范围</q-tooltip>
<q-popup-proxy ref="qDateProxy" transition-show="scale" transition-hide="scale">
<q-date v-model="rangeDate" years-in-month-view landscape range mask="YYYY-MM-DD"
@update:model-value="rangeDateUpdate">
<!-- <div class="row items-center justify-end">
<q-btn v-close-popup label="关闭" color="primary" flat />
</div> -->
<div class="row">
<div class="col-3">
<q-btn v-close-popup label="本月" @click="setCurrMonth" color="orange"
flat />
</div>
<div class="col-3">
<q-btn v-close-popup label="本年" @click="setCurrYear" color="red" flat />
</div>
<div class="col-3"></div>
<div class="col-3">
<q-btn v-close-popup label="关闭" color="primary" flat />
</div>
</div>
</q-date>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</div>
</div>
</q-card-section>
<q-card-section style="padding:0 10px 15px 10px;">
<div class="row q-col-gutter-md">
<div class="col-xl-12 col-lg-12 col-sm-12">
<q-table class="my-sticky-header-column-table" :rows="list" row-key="id" separator="cell"
:loading="loading" :columns="columns" @request="onRequest" v-model:pagination="pagination"
:table-style="{ height: Screen.height - 190 + 'px' }" flat bordered
:rows-per-page-options="[20, 30, 40, 50, 100]">
<template v-slot:body="props">
<q-tr :props="props" class="tr_hover">
<q-td style="font-size: 16px;" key="index" :props="props">{{ props.rowIndex + 1
}}</q-td>
<q-td style="font-size: 16px;" key="name" :props="props">{{ props.row.name }}</q-td>
<q-td style="font-size: 16px;" key="calories" :props="props">{{ props.row.calories
}}</q-td>
<q-td style="font-size: 16px;" key="count" :props="props">{{ props.row.count }}</q-td>
<q-td style="font-size: 16px;" key="start" :props="props">{{ props.row.start }}</q-td>
<q-td style="font-size: 16px;" key="end" :props="props">{{ props.row.end }}</q-td>
<q-td style="font-size: 16px;" key="total" :props="props">{{ props.row.total }}</q-td>
</q-tr>
</template>
</q-table>
</div>
</div>
</q-card-section>
</q-card>
</transition>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { Notify, Screen, date } from 'quasar';
import { sysConfigApi } from '../../api/sysConfig/sysConifgApi';
import { SysConfigEntity } from '../../api/sysConfig/model/sysConfig';
import { Pagination, convert } from 'src/api/class';
//
const pagination = ref(new Pagination(new SysConfigEntity()));
const loading = ref(false);
const rangeDate = ref();
const rangDateText = ref();
const device = ref();
const deviceList = ref([]);
const columns = ref([
{
name: 'index',
label: '#',
field: 'index',
align: 'center',
headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;',
},
{
name: 'name',
align: 'center',
label: '设备名称',
field: 'name',
headerClasses: 'text-h4 text-weight-bold',
headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;',
},
{ name: 'count', align: 'center', label: '开炉次数', field: 'count', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
{ name: 'start', align: 'center', label: '总运行时长', field: 'start', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
{ name: 'end', align: 'center', label: '总报警时长', field: 'end', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
{ name: 'total', align: 'center', label: '总待机时长', field: 'total', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
])
const list = ref([
{
name: '24#|Balzers',
calories: 159,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '25#|Balzers',
calories: 237,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '26#|Balzers',
calories: 262,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '9#|Ionbond',
calories: 305,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '19#|Ionbond',
calories: 356,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '12#|Ionbond',
calories: 375,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '13#|Ionbond',
calories: 392,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '16#|Ionbond',
calories: 408,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '23#|Ionbond',
calories: 452,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '17#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '18#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '20#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '11#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '21#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '15#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '22#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '14#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '3#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '7#|CemeCon',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '5#|CemeCon',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '6#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '4#|CemeCon',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '8#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '2#|CemeCon',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '10#|Balzers',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
},
{
name: '1#|CemeCon',
calories: 518,
count: '12',
start: '89',
end: '102',
total: '500'
}
]);
const reFresh = () => {
device.value = ''
rangDateText.value = ''
rangeDate.value = ''
};
const onRequest = (props: any) => {
const { page, rowsPerPage, rowsNumber } = props.pagination;
pagination.value.page = page;
pagination.value.rowsPerPage = rowsPerPage != 0 ? rowsPerPage : rowsNumber;
getPage();
};
const getPage = () => {
sysConfigApi.getPage(pagination.value).then((res: any) => {
list.value = res.dataList;;
convert(pagination.value, res);
});
}
//
const setCurrMonth = () => {
var d = new Date(); //
var monthStart = date.formatDate(new Date(d.getFullYear(), d.getMonth(), 1), 'YYYY-MM-DD'); //
var monthEnd = date.formatDate(new Date(d.getFullYear(), d.getMonth() + 1, 0), 'YYYY-MM-DD'); // 23:59:59
rangDateText.value = `${monthStart} ~ ${monthEnd}`
rangeDate.value = { from: `${monthStart}`, to: `${monthEnd}` }
}
//
const setCurrYear = () => {
var d = new Date(); //
var monthStart = date.formatDate(new Date(d.getFullYear(), 0, 1), 'YYYY-MM-DD'); //
var monthEnd = date.formatDate(new Date(d.getFullYear(), 12, 0), 'YYYY-MM-DD'); // 23:59:59
rangDateText.value = `${monthStart} ~ ${monthEnd}`
rangeDate.value = { from: `${monthStart}`, to: `${monthEnd}` }
}
//
const rangeDateUpdate = (value: any, reason: any, details) => {
if (reason === 'add-range') {
const start = value.from //
const end = value.to //
const diff = date.getDateDiff(new Date(end), new Date(start), 'days') //
// 365
if (diff >= 366) {
Notify.create({
position: 'top',
message: '日期范围不能大于365天',
icon: 'feedback',
color: 'negative',
})
rangDateText.value = ''
return
}
rangDateText.value = start + ' ~ ' + end
}
if (reason === 'add-day') {
Notify.create({
position: 'top',
message: '日期范围不能为同一天!',
icon: 'feedback',
color: 'negative',
})
rangDateText.value = ''
return
}
}
</script>
<style scoped>
/* .tr_hover {
background: #aaaaaa;
} */
.tr_hover:hover {
background: #e8e8e8;
}
.click-hover {
cursor: pointer;
color: #1976d2;
}
.click-hover:hover {
color: #2196f3;
/* background-color: yellow; */
}
</style>

@ -50,6 +50,12 @@ const routes: RouteRecordRaw[] = [
name: 'screen4',
component: () => import('pages/screen/screen4/index.vue'),
children: []
},
{
path: 'sysConfig',
name: 'sysConfig',
component: () => import('pages/sysConfig/index.vue'),
children: []
}
// {
// redirect: '/web/screenTab/screen1',

Loading…
Cancel
Save