|
|
|
@ -7,6 +7,11 @@
|
|
|
|
|
<!-- 刷新 查询 -->
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-btn-group push glossy>
|
|
|
|
|
<q-btn push label="新增" icon="add" @click="addOrEditForm()">
|
|
|
|
|
<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="refresh" @click="reFresh()">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">清空所有条件并,刷新数据</q-tooltip>
|
|
|
|
@ -19,35 +24,10 @@
|
|
|
|
|
</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>
|
|
|
|
|
<q-input dense label="参数名称" outlined v-model="pagination.data.configName" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-input dense label="参数键名" outlined v-model="pagination.data.configKey" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
@ -62,13 +42,26 @@
|
|
|
|
|
<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 style="font-size: 16px;" key="configName" :props="props">{{ props.row.configName
|
|
|
|
|
}}</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-td style="font-size: 16px;" key="configKey" :props="props">{{ props.row.configKey
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="configValue" :props="props">{{ props.row.configValue
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="configType" :props="props">{{ props.row.configType
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="remark" :props="props">{{ props.row.remark }}</q-td>
|
|
|
|
|
<q-td key="action" :props="props" style="width: 100px">
|
|
|
|
|
<q-btn round flat push color="info" icon="edit" @click="addOrEditForm(props.row)">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">编辑这条数据</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
<q-btn round flat push color="negative" icon="delete"
|
|
|
|
|
@click="openDelDialog(props.row)">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">删除这条数据</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</q-table>
|
|
|
|
@ -77,17 +70,24 @@
|
|
|
|
|
</q-card-section>
|
|
|
|
|
</q-card>
|
|
|
|
|
</transition>
|
|
|
|
|
|
|
|
|
|
<!-- 系统参数设置 -->
|
|
|
|
|
<addOrEditDialog ref="addOrEdit" @refresh="getPage" />
|
|
|
|
|
<!-- 删除弹窗 -->
|
|
|
|
|
<customDialog ref="deleteDialogRef" @func="delFunc" />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
import { onMounted, 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';
|
|
|
|
|
import { SysConfigSearchEntity } from '../../api/sysConfig/model/sysConfig';
|
|
|
|
|
import { Pagination, cconvert } from 'src/api/class';
|
|
|
|
|
import customDialog from 'src/components/customDialog.vue';
|
|
|
|
|
import addOrEditDialog from 'src/pages/sysConfig/components/addOrEditDialog.vue'
|
|
|
|
|
|
|
|
|
|
//公共
|
|
|
|
|
const pagination = ref(new Pagination(new SysConfigEntity()));
|
|
|
|
|
const pagination = ref(new Pagination(new SysConfigSearchEntity()));
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const rangeDate = ref();
|
|
|
|
|
const rangDateText = ref();
|
|
|
|
@ -103,234 +103,29 @@ const columns = ref([
|
|
|
|
|
headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'name',
|
|
|
|
|
name: 'configName',
|
|
|
|
|
align: 'center',
|
|
|
|
|
label: '设备名称',
|
|
|
|
|
field: 'name',
|
|
|
|
|
label: '参数名称',
|
|
|
|
|
field: 'configName',
|
|
|
|
|
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;' },
|
|
|
|
|
{ name: 'configKey', align: 'center', label: '参数键名', field: 'configKey', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'configValue', align: 'center', label: '参数键值', field: 'configValue', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'configType', align: 'center', label: '是否系统内置', field: 'configType', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'remark', align: 'center', label: '备注', field: 'remark', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'action', align: 'center', label: '操作', field: 'action', 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 list = ref([]);
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getPage();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const reFresh = () => {
|
|
|
|
|
device.value = ''
|
|
|
|
|
rangDateText.value = ''
|
|
|
|
|
rangeDate.value = ''
|
|
|
|
|
pagination.value.data = new SysConfigSearchEntity();
|
|
|
|
|
getPage();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onRequest = (props: any) => {
|
|
|
|
@ -342,61 +137,26 @@ const onRequest = (props: any) => {
|
|
|
|
|
|
|
|
|
|
const getPage = () => {
|
|
|
|
|
sysConfigApi.getPage(pagination.value).then((res: any) => {
|
|
|
|
|
list.value = res.dataList;;
|
|
|
|
|
convert(pagination.value, res);
|
|
|
|
|
list.value = res.data;
|
|
|
|
|
cconvert(pagination.value, res);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const addOrEdit = ref();
|
|
|
|
|
const addOrEditForm = (row?: any) => {
|
|
|
|
|
addOrEdit.value.clickForm(row);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 设置本月
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
const deleteDialogRef = ref();
|
|
|
|
|
const openDelDialog = (row: any) => {
|
|
|
|
|
deleteDialogRef.value.open(row);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除出库单
|
|
|
|
|
const delFunc = (e: any) => {
|
|
|
|
|
sysConfigApi.delete(e.id).then(() => {
|
|
|
|
|
getPage();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|