添加温湿度选择护理单元功能

This commit is contained in:
yangjun 2025-06-20 10:22:54 +08:00
parent 1035b210df
commit 8de7b54e47
26 changed files with 2581 additions and 3 deletions

View File

@ -2,7 +2,7 @@
VITE_USE_MOCK = false VITE_USE_MOCK = false
# 发布路径 # 发布路径
VITE_PUBLIC_PATH = /nu001 VITE_PUBLIC_PATH = /nu0010507
# 是否启用gzip或brotli压缩 # 是否启用gzip或brotli压缩
# 选项值: gzip | brotli | none # 选项值: gzip | brotli | none
@ -13,10 +13,10 @@ VITE_BUILD_COMPRESS = 'gzip'
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
#后台接口父地址(必填) #后台接口父地址(必填)
VITE_GLOB_API_URL=/nursing-unit_001 VITE_GLOB_API_URL=/nursingunit001
#后台接口全路径地址(必填) #后台接口全路径地址(必填)
VITE_GLOB_DOMAIN_URL=https://www.focusnu.com/nursing-unit_001 VITE_GLOB_DOMAIN_URL=https://www.focusnu.com/nursingunit001
# 接口父路径前缀 # 接口父路径前缀
VITE_GLOB_API_URL_PREFIX= VITE_GLOB_API_URL_PREFIX=

View File

@ -18,6 +18,7 @@
// position: relative; /* needed for pseudo-element */ // position: relative; /* needed for pseudo-element */
overflow: hidden; /* clip the animated stripe */ overflow: hidden; /* clip the animated stripe */
border: 0px; border: 0px;
color: white;
// height: 34px; // height: 34px;
} }
&.ant-btn-primary:not(.ant-btn-link)::before { &.ant-btn-primary:not(.ant-btn-link)::before {

View File

@ -0,0 +1,94 @@
<template>
<div class="p-2">
<a-tabs v-model:activeKey="activeKey" type="card" @change="handleChange">
<a-tab-pane key="3" tab="抄表">
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal3"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="9" tab="清零" force-render>
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal9"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="10" tab="电表拉闸" force-render>
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal10"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="11" tab="电表合闸" force-render>
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal11"></NuIotTqApiRequestLogList>
</a-tab-pane>
</a-tabs>
</div>
</template>
<script lang="ts" name="departUtils-sysDepart" setup>
import { ref, reactive } from 'vue';
import NuIotTqApiRequestLogList from '/@/views/iot/tq/nuIotTqApiRequestLog/NuIotTqApiRequestLogList.vue';
const activeKey= ref('3');
const dbsbInfo = ref<any>({});
const nuIotTqApiRequestLogListModal9 = ref();
const nuIotTqApiRequestLogListModal3 = ref();
const nuIotTqApiRequestLogListModal10 = ref();
const nuIotTqApiRequestLogListModal11 = ref();
function initLog(record){
console.log("🚀 ~ initLog ~ record:", record)
activeKey.value = "3";
console.log("🚀 ~ initLog ~ activeKey.value:", activeKey.value)
getDataList(activeKey.value, record);
dbsbInfo.value = record;
}
function getDataList(type, record) {
console.log("🚀 ~ getDataList ~ type, record:", type, record)
var params = {
type: type,
cid: record.cid
}
if(type == '3'){
nuIotTqApiRequestLogListModal3.value.init(params);
}else if(type == '3'){
nuIotTqApiRequestLogListModal9.value.init(params);
}else if(type == '10'){
nuIotTqApiRequestLogListModal10.value.init(params);
}else if(type == '11'){
nuIotTqApiRequestLogListModal11.value.init(params);
}
}
function handleChange(key) {
console.log("🚀 ~ handleChange ~ key:", key)
activeKey.value = key;
getDataList(key, dbsbInfo.value);
}
defineExpose({
initLog,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<j-modal :title="title" width="70%" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<DepartUtilsList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DepartUtilsList>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import DepartUtilsList from './ApiLogList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 日志
* @param record
*/
function showApiLog(record) {
title.value = '日志';
visible.value = true;
nextTick(() => {
registerForm.value.initLog(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(params) {
handleCancel();
emit('success',params);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
showApiLog,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,46 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/iot/tq/electricityMeter/list',
eleReset = '/iot/tq/electricityMeter/eleReset',
eleControl = '/iot/tq/electricityMeter/eleControl',
eleRead = '/iot/tq/electricityMeter/eleRead',
getAllMeter = '/iot/tq/common/device/getAllMeter',
getAllCollector = '/iot/tq/common/device/getAllCollector',
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
*/
export const eleReset = (params?) => defHttp.get({ url: Api.eleReset, params });
/**
*
* @param params
*/
export const eleControl = (params?) => defHttp.get({ url: Api.eleControl, params });
/**
*
* @param params
*/
export const eleRead = (params?) => defHttp.get({ url: Api.eleRead, params });
/**
*
* @param params
*/
export const getAllMeter = (params?) => defHttp.get({ url: Api.getAllMeter, params });
/**
*
* @param params
*/
export const getAllCollector = (params?) => defHttp.get({ url: Api.getAllCollector, params });

View File

@ -0,0 +1,154 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
title: '机构',
align: "center",
dataIndex: 'departName'
},
{
title: '护理单元',
align: "center",
dataIndex: 'nuName'
},
{
title: '表号',
align: "center",
dataIndex: 'address'
},
{
title: '采集器号',
align: "center",
dataIndex: 'cid'
},
{
title: '设备状态',
align: "center",
dataIndex: 'relayState',
customRender:({record})=>{
return record.relayState?(record.relayState=='1'?'合闸':'拉闸'):'';
},
},
{
title: '在线状态',
align: "center",
dataIndex: 'online',
customRender:({record})=>{
return record.online?(record.online=='true'?'在线':'离线'):'';
},
},
{
title: '信号强度',
align: "center",
dataIndex: 'csq',
customRender:({record})=>{
if(record.csq){
if(record.csq < 10){
return '低';
}else if(record.csq > 20){
return '高';
}else{
return '中';
}
}else{
return '';
}
}
},
{
title: '用电量KWH',
align: "center",
dataIndex: 'eleValue'
},
{
title: '上次抄表时间',
align: "center",
dataIndex: 'readTime'
},
{
title: '上次上线时间',
align: "center",
dataIndex: 'connectTime'
},
{
title: '上次掉线时间',
align: "center",
dataIndex: 'disconnectTime'
},
{
title: '描述',
align: "center",
dataIndex: 'remark'
},
];
export const searchFormSchema: FormSchema[] = [
{
label: '机构',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择机构',
dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
},
colProps: { span: 6 },
},
{
label: '护理单元',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择护理单元',
dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
},
colProps: { span: 6 },
},
{
label: '表号',
field: 'address',
component: 'Input',
colProps: { span: 6 },
},
{
label: '设备状态',
field: 'relayState',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择状态',
options: [
{ label: '合闸', value: '1' },
{ label: '拉闸', value: '0' },
],
},
colProps: { span: 6 },
},
{
label: '在线状态',
field: 'online',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择状态',
options: [
{ label: '在线', value: 'true' },
{ label: '离线', value: 'false' },
],
},
colProps: { span: 6 },
},
{
label: '信号强度',
field: 'csq',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择强度',
options: [
{ label: '高', value: '1' },
{ label: '中', value: '2' },
{ label: '低', value: '3' },
],
},
colProps: { span: 6 },
},
];

View File

@ -0,0 +1,218 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="address">
<template #label><span title="同步类型">表号</span></template>
<a-input placeholder="请输入同步类型" v-model:value="queryParam.address" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
</a-col>
</a-row>
</a-form>
</div>
<a-row>
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px;">
<a-card style="width: 100%;border-radius: 8px;">
<template #title >
<div class="cardTitle">
<a-row>
<a-col :span="12">
<span style="margin-left:15px;font-size:14px;">表号{{item.address}}</span>
</a-col>
<a-col :span="12" style="text-align: right;">
<span style="margin-right:15px;font-size:14px;">{{item.relayState=='1'?'在线':'离线'}}</span>
</a-col>
</a-row>
</div>
</template>
<p>
<span>护理单元名称{{item.nuName?item.nuName:'未配置'}}</span>
</p>
<p>
<span>上次抄表时间{{item.readTime?item.readTime:'未抄表'}}</span>
</p>
<p style="margin-top: 20px;">
<span><Statistic title="用电量(KWH)" :value="item.eleValue?item.eleValue:'无'" style="text-align:center;" /></span>
</p>
<a-divider />
<p style="text-align:center;">
<span>
<a @click="handleRead(item)">抄表</a>
<a-divider type="vertical" />
<a @click="handleControlLz(item)">拉闸</a>
<a-divider type="vertical" />
<a @click="handleControlHz(item)">合闸</a>
<a-divider type="vertical" />
<a @click="handleReset(item)">清零</a>
<a-divider type="vertical" />
<a @click="showApiLog(item)">日志</a>
</span>
</p>
</a-card>
</a-col>
</a-row>
<div
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
<span style="margin-right: 10px;"> {{ tableData.total }} 条数据</span>
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
show-quick-jumper :total="tableData.total" @change="reload" />
</div>
<!--引用表格-->
<ApiLogModal ref="apiLogModal"></ApiLogModal>
</div>
</template>
<script lang="ts" name="iot-nuIotRegionInfo" setup>
import {reactive, ref,h,onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Statistic } from 'ant-design-vue';
import {Modal} from "ant-design-vue";
import {list, eleReset, eleControl, eleRead } from './electricity.api';
import { Pagination } from 'ant-design-vue';
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
import { set } from 'lodash-es';
const formRef = ref();
const queryParam = reactive<any>({});
const apiLogModal = ref();
const tableData = ref<any>([]);
const pageParams = ref({ pageNo: 1, pageSize: 8 })
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
//
async function handleRead(record) {
const params = {
'cid' : record.cid,
'address' : record.address,
};
await eleRead(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleControlLz(record) {
if(record.relayState == '0'){
Modal.info({
title: '拉闸',
content: h('div', {}, [
h('p', '此电表已拉闸!'),
]),
onOk() {},
});
return;
}
const params = {
'cid' : record.cid,
'address' : record.address,
'type' : '10',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleControlHz(record) {
if(record.relayState == '1'){
Modal.info({
title: '合闸',
content: h('div', {}, [
h('p', '此电表已合闸!'),
]),
onOk() {},
});
return;
}
const params = {
'cid' : record.cid,
'address' : record.address,
'type' : '11',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleReset(record) {
const params = {
'cid' : record.cid,
'address' : record.address,
};
await eleReset(params);
setTimeout(() => {
reload();
}, 4000);
}
/**
* 查看api日志
*/
function showApiLog(record){
console.log(record);
apiLogModal.value.disableSubmit = true;
apiLogModal.value.showApiLog(record);
}
function reload(){
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({url: '/iot/tq/electricityMeter/list',params:queryParam}).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
});
}
//
onMounted(() => {
reload();
});
</script>
<style lang="less" scoped>
.cardTitle{
background: #1ea0fa;
width: 100%;
margin: -28px -24px;
padding-top: 15px;
border-radius: 5px 5px 0px 0px;
color: white;
height: 55px;
display: block;
position: absolute;
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/nuIotTqApiRequestLog/nuIotTqApiRequestLog/list',
save='/nuIotTqApiRequestLog/nuIotTqApiRequestLog/add',
edit='/nuIotTqApiRequestLog/nuIotTqApiRequestLog/edit',
deleteOne = '/nuIotTqApiRequestLog/nuIotTqApiRequestLog/delete',
deleteBatch = '/nuIotTqApiRequestLog/nuIotTqApiRequestLog/deleteBatch',
importExcel = '/nuIotTqApiRequestLog/nuIotTqApiRequestLog/importExcel',
exportXls = '/nuIotTqApiRequestLog/nuIotTqApiRequestLog/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,72 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '表号',
align: "center",
dataIndex: 'address'
},
{
title: '类型',
align: "center",
dataIndex: 'type_dictText'
},
{
title: '请求时的值',
align: "center",
dataIndex: 'requestValue'
},
{
title: '请求时间',
align: "center",
dataIndex: 'requestTime'
},
{
title: '请求状态',
align: "center",
dataIndex: 'requestStatus_dictText'
},
{
title: '请求描述',
align: "center",
dataIndex: 'requestRemark'
},
{
title: '反馈值',
align: "center",
dataIndex: 'resolveValue'
},
{
title: '反馈时间',
align: "center",
dataIndex: 'resolveTime'
},
{
title: '反馈状态',
align: "center",
dataIndex: 'resolveStatus_dictText'
},
{
title: '反馈描述',
align: "center",
dataIndex: 'resolveRemark'
},
];
// 高级查询数据
export const superQuerySchema = {
address: {title: '表号',order: 0,view: 'text', type: 'string',},
type: {title: '类型',order: 1,view: 'list', type: 'string',dictCode: 'dbsb_type',},
requestValue: {title: '请求时的值',order: 2,view: 'text', type: 'string',},
requestTime: {title: '请求时间',order: 3,view: 'text', type: 'string',},
requestStatus: {title: '请求状态',order: 4,view: 'list', type: 'string',dictCode: '',},
requestRemark: {title: '请求描述',order: 5,view: 'text', type: 'string',},
resolveValue: {title: '反馈值',order: 6,view: 'text', type: 'string',},
resolveTime: {title: '反馈时间',order: 7,view: 'text', type: 'string',},
resolveStatus: {title: '反馈状态',order: 8,view: 'list', type: 'string',dictCode: 'dbsb_status',},
resolveRemark: {title: '反馈描述',order: 9,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,250 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="requestStatus">
<template #label><span title="请求状态">请求状态</span></template>
<j-select-multiple placeholder="请选择请求状态" v-model:value="queryParam.requestStatus" dictCode="dbsb_status" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="resolveStatus">
<template #label><span title="反馈状态">反馈状态</span></template>
<j-select-multiple placeholder="请选择反馈状态" v-model:value="queryParam.resolveStatus" dictCode="dbsb_status" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuIotTqApiRequestLogModal ref="registerModal" @success="handleSuccess"></NuIotTqApiRequestLogModal>
</div>
</template>
<script lang="ts" name="nuIotTqApiRequestLog-nuIotTqApiRequestLog" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuIotTqApiRequestLog.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuIotTqApiRequestLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuIotTqApiRequestLogModal from './components/NuIotTqApiRequestLogModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'api请求日志',
api: list,
columns,
canResize:false,
useSearchForm: false,
immediate: false,
showActionColumn: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "api请求日志",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:8,
xl:6,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'nuIotTqApiRequestLog:nu_iot_tq_api_request_log:edit'
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'nuIotTqApiRequestLog:nu_iot_tq_api_request_log:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
function init(record) {
console.log("🚀 ~ init ~ record:", record)
queryParam.cid = record.cid;
queryParam.type = record.type;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,200 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuIotTqApiRequestLogForm">
<a-row>
<a-col :span="24">
<a-form-item label="表号" v-bind="validateInfos.address" id="NuIotTqApiRequestLogForm-address" name="address">
<a-input v-model:value="formData.address" placeholder="请输入表号" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="类型" v-bind="validateInfos.type" id="NuIotTqApiRequestLogForm-type" name="type">
<j-dict-select-tag v-model:value="formData.type" dictCode="dbsb_type" placeholder="请选择类型" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="请求时的值" v-bind="validateInfos.requestValue" id="NuIotTqApiRequestLogForm-requestValue" name="requestValue">
<a-input v-model:value="formData.requestValue" placeholder="请输入请求时的值" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="请求时间" v-bind="validateInfos.requestTime" id="NuIotTqApiRequestLogForm-requestTime" name="requestTime">
<a-input v-model:value="formData.requestTime" placeholder="请输入请求时间" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="请求状态" v-bind="validateInfos.requestStatus" id="NuIotTqApiRequestLogForm-requestStatus" name="requestStatus">
<j-dict-select-tag v-model:value="formData.requestStatus" dictCode="" placeholder="请选择请求状态" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="请求描述" v-bind="validateInfos.requestRemark" id="NuIotTqApiRequestLogForm-requestRemark" name="requestRemark">
<a-input v-model:value="formData.requestRemark" placeholder="请输入请求描述" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="反馈值" v-bind="validateInfos.resolveValue" id="NuIotTqApiRequestLogForm-resolveValue" name="resolveValue">
<a-input v-model:value="formData.resolveValue" placeholder="请输入反馈值" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="反馈时间" v-bind="validateInfos.resolveTime" id="NuIotTqApiRequestLogForm-resolveTime" name="resolveTime">
<a-input v-model:value="formData.resolveTime" placeholder="请输入反馈时间" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="反馈状态" v-bind="validateInfos.resolveStatus" id="NuIotTqApiRequestLogForm-resolveStatus" name="resolveStatus">
<j-dict-select-tag v-model:value="formData.resolveStatus" dictCode="dbsb_status" placeholder="请选择反馈状态" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="反馈描述" v-bind="validateInfos.resolveRemark" id="NuIotTqApiRequestLogForm-resolveRemark" name="resolveRemark">
<a-input v-model:value="formData.resolveRemark" placeholder="请输入反馈描述" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuIotTqApiRequestLog.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
address: '',
type: '',
requestValue: '',
requestTime: '',
requestStatus: '',
requestRemark: '',
resolveValue: '',
resolveTime: '',
resolveStatus: '',
resolveRemark: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<NuIotTqApiRequestLogForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuIotTqApiRequestLogForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuIotTqApiRequestLogForm from './NuIotTqApiRequestLogForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/nuIotTqElectricitySyncLog/nuIotTqElectricitySyncLog/list',
save='/nuIotTqElectricitySyncLog/nuIotTqElectricitySyncLog/add',
edit='/nuIotTqElectricitySyncLog/nuIotTqElectricitySyncLog/edit',
deleteOne = '/nuIotTqElectricitySyncLog/nuIotTqElectricitySyncLog/delete',
deleteBatch = '/nuIotTqElectricitySyncLog/nuIotTqElectricitySyncLog/deleteBatch',
importExcel = '/nuIotTqElectricitySyncLog/nuIotTqElectricitySyncLog/importExcel',
exportXls = '/nuIotTqElectricitySyncLog/nuIotTqElectricitySyncLog/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,68 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '同步时间',
align: "center",
dataIndex: 'createTime'
},
{
title: '同步类型',
align: "center",
dataIndex: 'syncType'
},
{
title: '原机构名称',
align: "center",
dataIndex: 'orgName'
},
{
title: '原机构编码',
align: "center",
dataIndex: 'orgCode',
defaultHidden: true
},
{
title: '新机构名称',
align: "center",
dataIndex: 'newOrgName'
},
{
title: '新机构编码',
align: "center",
dataIndex: 'newOrgCode',
defaultHidden: true
},
{
title: '状态',
align: "center",
dataIndex: 'status'
},
{
title: '备注',
align: "center",
dataIndex: 'content'
},
{
title: '服务类型',
align: "center",
dataIndex: 'serverType'
},
];
// 高级查询数据
export const superQuerySchema = {
mainName: {title: '主表名称',order: 0,view: 'text', type: 'string',},
syncType: {title: '同步类型',order: 1,view: 'text', type: 'string',},
orgName: {title: '原机构名称',order: 2,view: 'text', type: 'string',},
orgCode: {title: '原机构编码',order: 3,view: 'text', type: 'string',},
newOrgName: {title: '新机构名称',order: 4,view: 'text', type: 'string',},
newOrgCode: {title: '新机构编码',order: 5,view: 'text', type: 'string',},
status: {title: '状态',order: 6,view: 'text', type: 'string',},
content: {title: '备注',order: 7,view: 'text', type: 'string',},
serverType: {title: '服务类型',order: 8,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,169 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="syncType">
<template #label><span title="同步类型">同步类型</span></template>
<a-input placeholder="请输入同步类型" v-model:value="queryParam.syncType" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="status">
<template #label><span title="状态">状态</span></template>
<a-input placeholder="请输入状态" v-model:value="queryParam.status" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleSync" preIcon="ant-design:sync-outlined"> 同步</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="nuIotTqElectricitySyncLog-nuIotTqElectricitySyncLog" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuIotTqElectricitySyncLog.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuIotTqElectricitySyncLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuIotTqElectricitySyncLogModal from './components/NuIotTqElectricitySyncLogModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { defHttp } from '/@/utils/http/axios';
const formRef = ref();
const queryParam = reactive<any>({});
const syncInfo = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '同步日志',
api: list,
columns,
canResize:false,
useSearchForm: false,
immediate: false,
showIndexColumn: true,
showActionColumn: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 同步事件
*/
function handleSync() {
defHttp.post({
url: '/iot/tq/electricityMeter/syncElectricity',
params: syncInfo.value,
}).then((res) => {
reload();
});
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
//
function init(record){
console.log("🚀 ~ init ~ record:", record)
syncInfo.value = record;
queryParam.mainId = record.id;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<j-modal :title="title" width="80%" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<NuIotTqElectricitySyncLogList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuIotTqElectricitySyncLogList>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuIotTqElectricitySyncLogList from './NuIotTqElectricitySyncLogList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function init(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,187 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuIotTqElectricitySyncLogForm">
<a-row>
<a-col :span="24">
<a-form-item label="主表名称" v-bind="validateInfos.mainName" id="NuIotTqElectricitySyncLogForm-mainName" name="mainName">
<a-input v-model:value="formData.mainName" placeholder="请输入主表名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="同步类型" v-bind="validateInfos.syncType" id="NuIotTqElectricitySyncLogForm-syncType" name="syncType">
<a-input v-model:value="formData.syncType" placeholder="请输入同步类型" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="原机构名称" v-bind="validateInfos.orgName" id="NuIotTqElectricitySyncLogForm-orgName" name="orgName">
<a-input v-model:value="formData.orgName" placeholder="请输入原机构名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="原机构编码" v-bind="validateInfos.orgCode" id="NuIotTqElectricitySyncLogForm-orgCode" name="orgCode">
<a-input v-model:value="formData.orgCode" placeholder="请输入原机构编码" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="新机构名称" v-bind="validateInfos.newOrgName" id="NuIotTqElectricitySyncLogForm-newOrgName" name="newOrgName">
<a-input v-model:value="formData.newOrgName" placeholder="请输入新机构名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="新机构编码" v-bind="validateInfos.newOrgCode" id="NuIotTqElectricitySyncLogForm-newOrgCode" name="newOrgCode">
<a-input v-model:value="formData.newOrgCode" placeholder="请输入新机构编码" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="状态" v-bind="validateInfos.status" id="NuIotTqElectricitySyncLogForm-status" name="status">
<a-input v-model:value="formData.status" placeholder="请输入状态" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.content" id="NuIotTqElectricitySyncLogForm-content" name="content">
<a-input v-model:value="formData.content" placeholder="请输入备注" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuIotTqElectricitySyncLog.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
mainName: '',
syncType: '',
orgName: '',
orgCode: '',
newOrgName: '',
newOrgCode: '',
status: '',
content: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<NuIotTqElectricitySyncLogForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuIotTqElectricitySyncLogForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuIotTqElectricitySyncLogForm from './NuIotTqElectricitySyncLogForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/sys/sysDepart/getDepartServerUrl',
save='/sys/sysDepart/add',
edit='/sys/sysDepart/edit',
deleteOne = '/sys/sysDepart/delete',
deleteBatch = '/sys/sysDepart/deleteBatch',
importExcel = '/sys/sysDepart/importExcel',
exportXls = '/sys/sysDepart/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,60 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '机构/部门名称',
align: "center",
dataIndex: 'departName'
},
{
title: '机构编码',
align: "center",
dataIndex: 'orgCode'
},
{
title: '运营开始时间',
align: "center",
dataIndex: 'operationStartTime'
},
{
title: '运营到期时间',
align: "center",
dataIndex: 'operationEndTime'
},
];
// 高级查询数据
export const superQuerySchema = {
parentId: {title: '父机构ID',order: 0,view: 'text', type: 'string',},
departName: {title: '机构/部门名称',order: 1,view: 'text', type: 'string',},
departNameEn: {title: '英文名',order: 2,view: 'text', type: 'string',},
departNameAbbr: {title: '缩写',order: 3,view: 'text', type: 'string',},
departOrder: {title: '排序',order: 4,view: 'number', type: 'number',},
description: {title: '描述',order: 5,view: 'text', type: 'string',},
orgCategory: {title: '机构类别 1机构2区域',order: 6,view: 'text', type: 'string',},
orgType: {title: '机构类型 1一级部门 2子部门',order: 7,view: 'text', type: 'string',},
orgCode: {title: '机构编码',order: 8,view: 'text', type: 'string',},
platType: {title: '机构对应平台类型 是否是试验机构(数据字典iz_test_site) ',order: 9,view: 'text', type: 'string',},
operationStartTime: {title: '运营开始时间',order: 10,view: 'datetime', type: 'string',},
operationEndTime: {title: '运营到期时间',order: 11,view: 'datetime', type: 'string',},
contractStartTime: {title: '合同开始时间',order: 12,view: 'datetime', type: 'string',},
contractEndTime: {title: '合同到期时间',order: 13,view: 'datetime', type: 'string',},
mobile: {title: '手机号',order: 14,view: 'text', type: 'string',},
fax: {title: '传真',order: 15,view: 'text', type: 'string',},
address: {title: '地址',order: 16,view: 'text', type: 'string',},
memo: {title: '备注',order: 17,view: 'text', type: 'string',},
status: {title: '状态1启用0不启用',order: 18,view: 'text', type: 'string',},
qywxIdentifier: {title: '对接企业微信的ID',order: 20,view: 'text', type: 'string',},
dingIdentifier: {title: '对接钉钉部门的ID',order: 21,view: 'text', type: 'string',},
tenantId: {title: '租户ID',order: 22,view: 'number', type: 'number',},
izLeaf: {title: '是否有叶子节点: 1是0否',order: 23,view: 'number', type: 'number',},
serverUrl: {title: '服务器后台接口地址',order: 24,view: 'text', type: 'string',},
picUrl: {title: '机构图片',order: 25,view: 'text', type: 'string',},
province: {title: '省份 sys_category.id',order: 26,view: 'text', type: 'string',},
city: {title: '城市 sys_category.id',order: 27,view: 'text', type: 'string',},
district: {title: '区域 sys_category.id',order: 28,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,181 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
</div>
</template>
<script lang="ts" name="departUtils-sysDepart" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './DepartUtils.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DepartUtils.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SysDepartModal from './components/SysDepartModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { e } from 'unocss';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const departInfo = ref<any>({});
const userStore = useUserStore();
const emit = defineEmits(['register', 'ok']);
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'sys_depart',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "sys_depart",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
const superQueryConfig = reactive(superQuerySchema);
function edit(record) {
console.log("🚀 ~ edit ~ record:", record)
departInfo.value = record;
}
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
console.log("🚀 ~ handleEdit ~ record:", record)
departInfo.value.departId = record.id;
departInfo.value.departName = record.departName;
departInfo.value.departServerUrl = record.orgCode;
console.log("🚀 ~ handleEdit ~ departInfo.value:", departInfo.value)
emit("ok",departInfo);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '选择',
onClick: handleEdit.bind(null, record),
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
defineExpose({
edit,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<DepartUtilsList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DepartUtilsList>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import DepartUtilsList from './DepartUtilsList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(params) {
handleCancel();
emit('success',params);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,15 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/iot/cameraInfo/getNuBaseList',
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });

View File

@ -0,0 +1,55 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '护理单元名称',
align: "center",
dataIndex: 'nuName'
},
{
title: '编码',
align: "center",
dataIndex: 'code'
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime'
},
];
// 高级查询数据
export const superQuerySchema = {
parentId: {title: '父机构ID',order: 0,view: 'text', type: 'string',},
departName: {title: '机构/部门名称',order: 1,view: 'text', type: 'string',},
departNameEn: {title: '英文名',order: 2,view: 'text', type: 'string',},
departNameAbbr: {title: '缩写',order: 3,view: 'text', type: 'string',},
departOrder: {title: '排序',order: 4,view: 'number', type: 'number',},
description: {title: '描述',order: 5,view: 'text', type: 'string',},
orgCategory: {title: '机构类别 1机构2区域',order: 6,view: 'text', type: 'string',},
orgType: {title: '机构类型 1一级部门 2子部门',order: 7,view: 'text', type: 'string',},
orgCode: {title: '机构编码',order: 8,view: 'text', type: 'string',},
platType: {title: '机构对应平台类型 是否是试验机构(数据字典iz_test_site) ',order: 9,view: 'text', type: 'string',},
operationStartTime: {title: '运营开始时间',order: 10,view: 'datetime', type: 'string',},
operationEndTime: {title: '运营到期时间',order: 11,view: 'datetime', type: 'string',},
contractStartTime: {title: '合同开始时间',order: 12,view: 'datetime', type: 'string',},
contractEndTime: {title: '合同到期时间',order: 13,view: 'datetime', type: 'string',},
mobile: {title: '手机号',order: 14,view: 'text', type: 'string',},
fax: {title: '传真',order: 15,view: 'text', type: 'string',},
address: {title: '地址',order: 16,view: 'text', type: 'string',},
memo: {title: '备注',order: 17,view: 'text', type: 'string',},
status: {title: '状态1启用0不启用',order: 18,view: 'text', type: 'string',},
qywxIdentifier: {title: '对接企业微信的ID',order: 20,view: 'text', type: 'string',},
dingIdentifier: {title: '对接钉钉部门的ID',order: 21,view: 'text', type: 'string',},
tenantId: {title: '租户ID',order: 22,view: 'number', type: 'number',},
izLeaf: {title: '是否有叶子节点: 1是0否',order: 23,view: 'number', type: 'number',},
serverUrl: {title: '服务器后台接口地址',order: 24,view: 'text', type: 'string',},
picUrl: {title: '机构图片',order: 25,view: 'text', type: 'string',},
province: {title: '省份 sys_category.id',order: 26,view: 'text', type: 'string',},
city: {title: '城市 sys_category.id',order: 27,view: 'text', type: 'string',},
district: {title: '区域 sys_category.id',order: 28,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,174 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
</div>
</template>
<script lang="ts" name="departUtils-sysDepart" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './HldyUtils.data';
import { list } from './HldyUtils.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SysDepartModal from './components/SysDepartModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { e } from 'unocss';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const departInfo = ref<any>({});
const userStore = useUserStore();
const emit = defineEmits(['register', 'ok']);
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'sys_depart',
api: list,
columns,
canResize:false,
useSearchForm: false,
immediate: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
console.log("🚀 ~ handleEdit ~ record:", record)
departInfo.value.nuId = record.id;
departInfo.value.nuName = record.nuName;
console.log("🚀 ~ handleEdit ~ departInfo.value:", departInfo.value)
emit("ok",departInfo);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '选择',
onClick: handleEdit.bind(null, record),
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
function edit(record) {
console.log("🚀 ~ edit ~ record:", record.departServerUrl)
departInfo.value = record;
queryParam.sysOrgCode = record.departServerUrl;
reload();
}
defineExpose({
edit,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<DepartUtilsList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DepartUtilsList>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import DepartUtilsList from './HldyUtilsList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(params) {
handleCancel();
emit('success',params);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>