物联bug处理。
This commit is contained in:
parent
0cad5cc74b
commit
d518ff607f
|
|
@ -74,7 +74,7 @@ import {ref, reactive, createVNode, h, onMounted, watch, unref,nextTick} from 'v
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { columns, searchFormSchema } from './camera.data';
|
import { columns, searchFormSchema } from './camera.data';
|
||||||
import {list, syncAllDevices} from './camera.api';
|
import {getImageCommon, list, syncAllDevices} from './camera.api';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { useDrawer } from "@/components/Drawer";
|
import { useDrawer } from "@/components/Drawer";
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
@ -140,11 +140,18 @@ function handleEdit(record: Recordable) {
|
||||||
* 预览
|
* 预览
|
||||||
*/
|
*/
|
||||||
function handlePreview(record: Recordable) {
|
function handlePreview(record: Recordable) {
|
||||||
nextTick(()=>{
|
if (record.deviceIndex == null) {
|
||||||
previewModal.value.disableSubmit = true;
|
return
|
||||||
previewModal.value.edit(record);
|
}
|
||||||
})
|
getImageCommon({
|
||||||
|
"deviceIndex": record.deviceIndex,
|
||||||
|
"type": "switch"
|
||||||
|
}).then(res => {
|
||||||
|
previewModal.value.disableSubmit = true;
|
||||||
|
previewModal.value.edit(record);
|
||||||
|
}).catch(res=>{
|
||||||
|
reload();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -158,19 +165,29 @@ function handleSuccess() {
|
||||||
* 画面配置
|
* 画面配置
|
||||||
*/
|
*/
|
||||||
function handlePicConfig(record) {
|
function handlePicConfig(record) {
|
||||||
var params = {
|
if (record.deviceIndex == null) {
|
||||||
deviceIndex: record.deviceIndex,
|
return
|
||||||
deviceName: record.deviceName,
|
|
||||||
parentId: record.parentId,
|
|
||||||
multitrans: record.multitrans,
|
|
||||||
projectId: record.projectId,
|
|
||||||
regionId: record.regionId,
|
|
||||||
ip: record.ip
|
|
||||||
}
|
}
|
||||||
nextTick(()=>{
|
getImageCommon({
|
||||||
cameraPictureConfigModal.value.disableSubmit = true;
|
"deviceIndex": record.deviceIndex,
|
||||||
cameraPictureConfigModal.value.edit(params);
|
"type": "switch"
|
||||||
})
|
}).then(res => {
|
||||||
|
var params = {
|
||||||
|
deviceIndex: record.deviceIndex,
|
||||||
|
deviceName: record.deviceName,
|
||||||
|
parentId: record.parentId,
|
||||||
|
multitrans: record.multitrans,
|
||||||
|
projectId: record.projectId,
|
||||||
|
regionId: record.regionId,
|
||||||
|
ip: record.ip
|
||||||
|
}
|
||||||
|
nextTick(()=>{
|
||||||
|
cameraPictureConfigModal.value.disableSubmit = true;
|
||||||
|
cameraPictureConfigModal.value.edit(params);
|
||||||
|
})
|
||||||
|
}).catch(res=>{
|
||||||
|
reload();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,15 @@ import {FormSchema} from '/@/components/Table';
|
||||||
|
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '平台标识',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'sysFlag',
|
||||||
|
width: 80,
|
||||||
|
customRender:({record}) =>{
|
||||||
|
return record.sysFlag?(record.sysFlag=='0'?'运维平台':'业务平台'):'';
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '机构编码',
|
title: '机构编码',
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
@ -52,6 +61,19 @@ export const formSchema: FormSchema[] = [
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
show: false,
|
show: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '平台标识',
|
||||||
|
field: 'sysFlag',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: [
|
||||||
|
{label:'运维平台',value:'0'},
|
||||||
|
{label:'业务平台',value:'1'},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
defaultValue: '1',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '机构',
|
label: '机构',
|
||||||
field: 'orgCode',
|
field: 'orgCode',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
import {defHttp} from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
list = '/iot/weihu/deviceMaintain/remarksList',
|
||||||
|
save='/iot/weihu/deviceMaintain/add',
|
||||||
|
edit='/iot/weihu/deviceMaintain/edit',
|
||||||
|
deleteOne = '/iot/weihu/deviceMaintain/delete',
|
||||||
|
deleteBatch = '/iot/weihu/deviceMaintain/deleteBatch',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const list = (params) =>
|
||||||
|
defHttp.get({url: Api.list, params});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单个
|
||||||
|
*/
|
||||||
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
return defHttp.post({url: url, params}, { isTransformResponse: false });
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
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: 'type'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备编码',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'deviceId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'SN',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'sn'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发往机构名',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'reserveDepartName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '更新时间',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'updateDate',
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'remark'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
//查询数据
|
||||||
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
label: '删除',
|
||||||
|
field: 'delFlag',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: '正常',
|
||||||
|
value: '0',
|
||||||
|
key: '0',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '删除',
|
||||||
|
value: '1',
|
||||||
|
key: '1',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
colProps: { span: 6 },
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<template>
|
||||||
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<HeatanalysisRemarksForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></HeatanalysisRemarksForm>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import HeatanalysisRemarksForm from './RemarksForm.vue'
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
|
const title = ref<string>('');
|
||||||
|
const width = ref<number>(1200);
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const registerForm = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add(parentData) {
|
||||||
|
title.value = '新增';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.add(parentData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @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>
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
<template>
|
||||||
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<RemarksList ref="remarksList" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></RemarksList>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import RemarksList from './RemarksList.vue'
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
|
const title = ref<string>('');
|
||||||
|
const width = ref<number>(1600);
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const remarksList = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
title.value = '新增';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
remarksList.value.add();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
title.value = '运维列表';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
remarksList.value.init(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
remarksList.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
edit,
|
||||||
|
disableSubmit,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped></style>
|
||||||
|
|
@ -0,0 +1,154 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<JFormContainer :disabled="disabled">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="备注" v-bind="validateInfos.remark">
|
||||||
|
<a-textarea v-model:value="formData.remark" placeholder="请输入备注" :rows="4" />
|
||||||
|
</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 './Reamrks.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: undefined,
|
||||||
|
deviceId: undefined,
|
||||||
|
type: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
});
|
||||||
|
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 = {
|
||||||
|
remarks: [{ required: true, message: '请输入备注!'},],
|
||||||
|
};
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(()=>{
|
||||||
|
if(props.formBpm === true){
|
||||||
|
if(props.formData.disabled === false){
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add(parentData) {
|
||||||
|
let record = {};
|
||||||
|
record["deviceId"] = parentData["deviceId"];
|
||||||
|
record["type"] = parentData["type"];
|
||||||
|
edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
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 {
|
||||||
|
min-height: 500px !important;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 24px 24px 24px 24px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,255 @@
|
||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<JFormContainer :disabled="disabled">
|
||||||
|
<template #detail>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
<!--查询区域-->
|
||||||
|
<div class="jeecg-basic-table-form-container">
|
||||||
|
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item label="删除状态">
|
||||||
|
<a-select ref="select" placeholder="请选择状态" v-model:value="queryParam.delFlag">
|
||||||
|
<a-select-option value="0">正常</a-select-option>
|
||||||
|
<a-select-option value="1">删除</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
|
<a-button preIcon="ant-design:sync-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable" :rowSelection="rowSelection" size="small">
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||||
|
删除
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
<a-button >批量操作
|
||||||
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
|
</a-button>
|
||||||
|
</a-dropdown>
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)"/>
|
||||||
|
</template>
|
||||||
|
<!--字段回显插槽-->
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<ReamrksFormModal ref="registerModal" @success="handleSuccess"></ReamrksFormModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="heating-remarks-list" setup>
|
||||||
|
import {ref, reactive, computed, unref, defineProps} from 'vue';
|
||||||
|
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import ReamrksFormModal from './ReamrksFormModal.vue';
|
||||||
|
import {columns, searchFormSchema} from './Reamrks.data';
|
||||||
|
import {list, deleteOne, batchDelete} from './Reamrks.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
const props = defineProps({
|
||||||
|
formDisabled: { type: Boolean, default: false },
|
||||||
|
formData: { type: Object, default: () => ({})},
|
||||||
|
formBpm: { type: Boolean, default: true }
|
||||||
|
});
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
const parentData = ref();
|
||||||
|
const checkedKeys = ref<Array<string | number>>([]);
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const registerModal = ref();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||||
|
tableProps:{
|
||||||
|
title: '设备维护日志',
|
||||||
|
api: list,
|
||||||
|
defSort: {
|
||||||
|
column: 'id',
|
||||||
|
order: 'asc',
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
canResize:false,
|
||||||
|
showIndexColumn: true,
|
||||||
|
actionColumn: {
|
||||||
|
width: 180,
|
||||||
|
fixed:'right'
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return Object.assign(params, queryParam);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||||
|
const labelCol = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 7 },
|
||||||
|
});
|
||||||
|
const wrapperCol = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 },
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增事件
|
||||||
|
*/
|
||||||
|
function handleAdd() {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.add(parentData.value);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 编辑事件
|
||||||
|
*/
|
||||||
|
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: handleDetail.bind(null, record),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '编辑',
|
||||||
|
// onClick: handleEdit.bind(null, record),
|
||||||
|
// }, {
|
||||||
|
// label: '删除',
|
||||||
|
// popConfirm: {
|
||||||
|
// title: '是否确认删除',
|
||||||
|
// confirm: handleDelete.bind(null, record),
|
||||||
|
// placement: 'topLeft',
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
const actions = [{}];
|
||||||
|
actions.push(
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if(record.delFlag == '0'){
|
||||||
|
// actions.push(
|
||||||
|
// {
|
||||||
|
// label: '编辑',
|
||||||
|
// onClick: handleEdit.bind(null, record),
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
actions.push(
|
||||||
|
{
|
||||||
|
label: '删除',
|
||||||
|
popConfirm: {
|
||||||
|
title: '是否确认删除',
|
||||||
|
confirm: handleDelete.bind(null, record),
|
||||||
|
placement: 'topLeft',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
function init(record){
|
||||||
|
parentData.value = unref(record);
|
||||||
|
queryParam.deviceId = parentData.value.deviceId;
|
||||||
|
queryParam.delFlag = '0';
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
function searchQuery(){
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
function searchReset(){
|
||||||
|
queryParam.delFlag = '0';
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暴露给父组件的方法
|
||||||
|
defineExpose({
|
||||||
|
init
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-cust {
|
||||||
|
width: calc(50% - 15px);
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-split-cust {
|
||||||
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.jeecg-basic-table-form-container) {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-form-item) {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<SendOrgDrawer @register="registerDrawer" @success="handleSuccess" />
|
<SendOrgDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||||
|
<ReamrksListModal ref="remarksModal"></ReamrksListModal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -38,11 +39,11 @@ import {onMounted, reactive, ref} from 'vue';
|
||||||
import { columns, searchFormSchema } from './weihu.data';
|
import { columns, searchFormSchema } from './weihu.data';
|
||||||
import { useDrawer } from "@/components/Drawer";
|
import { useDrawer } from "@/components/Drawer";
|
||||||
import SendOrgDrawer from './components/SendOrgDrawer.vue';
|
import SendOrgDrawer from './components/SendOrgDrawer.vue';
|
||||||
|
import ReamrksListModal from './components/ReamrksListModal.vue'
|
||||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const selectedRows = ref<any[]>([]);
|
const selectedRows = ref<any[]>([]);
|
||||||
|
const remarksModal = ref();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls,tableContext } = useListPage({
|
const { prefixCls,tableContext } = useListPage({
|
||||||
tableProps:{
|
tableProps:{
|
||||||
|
|
@ -89,31 +90,36 @@ import {onMounted, reactive, ref} from 'vue';
|
||||||
(selectedRowKeys.value = []) && reload();
|
(selectedRowKeys.value = []) && reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function handleDetail(record){
|
||||||
|
// let records = [];
|
||||||
|
// records.push(record);
|
||||||
|
// openDrawer(true, {
|
||||||
|
// records : records,
|
||||||
|
// isUpdate: true,
|
||||||
|
// showFooter: false,
|
||||||
|
// tenantSaas: false,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
function handleDetail(record){
|
function handleDetail(record){
|
||||||
let records = [];
|
remarksModal.value.disableSubmit = true;
|
||||||
records.push(record);
|
remarksModal.value.edit(record)
|
||||||
openDrawer(true, {
|
|
||||||
records : records,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: false,
|
|
||||||
tenantSaas: false,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作栏
|
* 操作栏
|
||||||
*/
|
*/
|
||||||
function getTableAction(record){
|
function getTableAction(record){
|
||||||
const actions = [];
|
return [
|
||||||
if(record.reserveDepartId){
|
// {
|
||||||
actions.push({
|
// label: '备注',
|
||||||
label: '详情',
|
// onClick: handleDetail.bind(null, record),
|
||||||
onClick: () => {
|
// },
|
||||||
handleDetail(record);
|
{
|
||||||
}
|
label: '备注',
|
||||||
});
|
onClick: handleDetail.bind(null, record),
|
||||||
}
|
},
|
||||||
return actions;
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
const departInfos = ref();
|
const departInfos = ref();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue