添加长者标签操作日志查询功,镜像日志查询功能
This commit is contained in:
parent
7ae15159ab
commit
1695b6a5be
|
|
@ -5,21 +5,21 @@
|
|||
<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-col :lg="8">
|
||||
<a-form-item name="orgCode">
|
||||
<template #label><span title="机构名称">机构名称</span></template>
|
||||
<j-dict-select-tag placeholder="请选择所属机构" v-model:value="queryParam.orgCode"
|
||||
dictCode="sys_depart,depart_name,org_code" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-col :lg="8">
|
||||
<a-form-item name="createTime">
|
||||
<template #label><span title="操作时间">操作时间</span></template>
|
||||
<a-range-picker value-format="YYYY-MM-DD" v-model:value="queryParam.createTime"
|
||||
class="query-group-cust" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-col :lg="6" >
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/elderTagOpeLogMain/nuConfigElderTagOpeLogInfo/list',
|
||||
dblist = '/eldertagopelog/elderTagOpeLogInfo/list',
|
||||
save='/elderTagOpeLogMain/nuConfigElderTagOpeLogInfo/add',
|
||||
edit='/elderTagOpeLogMain/nuConfigElderTagOpeLogInfo/edit',
|
||||
deleteOne = '/elderTagOpeLogMain/nuConfigElderTagOpeLogInfo/delete',
|
||||
deleteBatch = '/elderTagOpeLogMain/nuConfigElderTagOpeLogInfo/deleteBatch',
|
||||
importExcel = '/elderTagOpeLogMain/nuConfigElderTagOpeLogInfo/importExcel',
|
||||
exportXls = '/elderTagOpeLogMain/nuConfigElderTagOpeLogInfo/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 });
|
||||
export const dblist = (params) => defHttp.get({ url: Api.dblist, 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 });
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
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: 'typeName'
|
||||
},
|
||||
{
|
||||
title: '标签名称',
|
||||
align: "center",
|
||||
dataIndex: 'tagName'
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
align: "center",
|
||||
dataIndex: 'describ'
|
||||
},
|
||||
{
|
||||
title: '价格',
|
||||
align: "center",
|
||||
dataIndex: 'price'
|
||||
},
|
||||
{
|
||||
title: '默认图标',
|
||||
align: "center",
|
||||
dataIndex: 'pic'
|
||||
},
|
||||
{
|
||||
title: '焦点图标',
|
||||
align: "center",
|
||||
dataIndex: 'picFocus'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
typeName: {title: '标签类型中文名',order: 0,view: 'text', type: 'string',},
|
||||
tagName: {title: '标签名称',order: 1,view: 'text', type: 'string',},
|
||||
describ: {title: '说明',order: 2,view: 'text', type: 'string',},
|
||||
price: {title: '价格',order: 3,view: 'number', type: 'number',},
|
||||
pic: {title: '默认图标',order: 4,view: 'text', type: 'string',},
|
||||
picFocus: {title: '焦点图标',order: 5,view: 'text', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/eldertagopelog/elderTagOpeLogMain/list',
|
||||
save='/eldertagopelog/elderTagOpeLogMain/add',
|
||||
edit='/eldertagopelog/elderTagOpeLogMain/edit',
|
||||
deleteOne = '/eldertagopelog/elderTagOpeLogMain/delete',
|
||||
deleteBatch = '/eldertagopelog/elderTagOpeLogMain/deleteBatch',
|
||||
importExcel = '/eldertagopelog/elderTagOpeLogMain/importExcel',
|
||||
exportXls = '/eldertagopelog/elderTagOpeLogMain/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 });
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
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';
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS;
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '机构名称',
|
||||
align: "center",
|
||||
dataIndex: 'orgCode_dictText'
|
||||
},
|
||||
{
|
||||
title: '操作类型',
|
||||
align: "center",
|
||||
dataIndex: 'opeType_dictText',
|
||||
width: 100
|
||||
},
|
||||
// {
|
||||
// title: '标签类型中文名',
|
||||
// align: "center",
|
||||
// dataIndex: 'typeName'
|
||||
// },
|
||||
{
|
||||
title: '标签名称',
|
||||
align: "center",
|
||||
dataIndex: 'tagName'
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
align: "center",
|
||||
dataIndex: 'describ'
|
||||
},
|
||||
{
|
||||
title: '价格',
|
||||
align: "center",
|
||||
dataIndex: 'price',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '默认图标',
|
||||
align: "center",
|
||||
dataIndex: 'pic',
|
||||
customRender: ({ text }) => {
|
||||
// 如果 text 为空或 null/undefined,使用默认图片
|
||||
const imageUrl = text ? opeMediaAddress + text : opeMediaAddress + import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
|
||||
return render.renderImage({ text: imageUrl });
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '焦点图标',
|
||||
align: "center",
|
||||
dataIndex: 'picFocus',
|
||||
customRender: ({ text }) => {
|
||||
// 如果 text 为空或 null/undefined,使用默认图片
|
||||
const imageUrl = text ? opeMediaAddress + text : opeMediaAddress + import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
|
||||
return render.renderImage({ text: imageUrl });
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
opeType: {title: '操作类型',order: 0,view: 'list', type: 'string',dictCode: 'directive_ope_type',},
|
||||
orgCode: {title: '机构名称',order: 1,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'org_code', dictText: 'depart_name',},
|
||||
typeName: {title: '标签类型中文名',order: 2,view: 'text', type: 'string',},
|
||||
tagName: {title: '标签名称',order: 3,view: 'text', type: 'string',},
|
||||
describ: {title: '说明',order: 4,view: 'text', type: 'string',},
|
||||
price: {title: '价格',order: 5,view: 'number', type: 'number',},
|
||||
pic: {title: '默认图标',order: 6,view: 'text', type: 'string',},
|
||||
picFocus: {title: '焦点图标',order: 7,view: 'text', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
<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="8">
|
||||
<a-form-item name="orgCode">
|
||||
<template #label><span title="机构名称">机构名称</span></template>
|
||||
<JDictSelectTag placeholder="请选择机构名称" v-model:value="queryParam.orgCode" dictCode="sys_depart,depart_name,org_code" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item name="opeType">
|
||||
<template #label><span title="操作类型">操作类型</span></template>
|
||||
<JDictSelectTag placeholder="请选择操作类型" v-model:value="queryParam.opeType" dictCode="directive_ope_type" 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)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuConfigElderTagOpeLogInfoModal ref="registerModal" @success="handleSuccess"></NuConfigElderTagOpeLogInfoModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="elderTagOpeLogMain-nuConfigElderTagOpeLogMain" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './NuConfigElderTagOpeLogMain.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuConfigElderTagOpeLogMain.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuConfigElderTagOpeLogMainModal from './components/NuConfigElderTagOpeLogMainModal.vue'
|
||||
import NuConfigElderTagOpeLogInfoModal from '/@/views/synchronization/eldertag/elderTagOpeLogMain/components/NuConfigElderTagOpeLogInfoModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.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: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "长者标签-操作日志-主表",
|
||||
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:8,
|
||||
xxl:8
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 16,
|
||||
});
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
console.log("🚀 ~ handleDetail ~ record:", record)
|
||||
if(record.optType =='1'){
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}else{
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.dbEdit(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
function init(record: any) {
|
||||
}
|
||||
|
||||
|
||||
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>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true" :bodyStyle="{ padding: 0 }" :maskClosable="false" :keyboard="false"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<NuConfigElderTagOpeLogMainList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuConfigElderTagOpeLogMainList>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel" style="margin-right: 10px;">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuConfigElderTagOpeLogMainList from './NuConfigElderTagOpeLogMainList.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']);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function init(record) {
|
||||
title.value = '操作日志';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.init(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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>
|
||||
|
|
@ -0,0 +1,287 @@
|
|||
<template>
|
||||
<a-spin :spinning="loading">
|
||||
<div class="container2">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-table :dataSource="tableData" :columns="columns" :pagination="false" bordered size="small"
|
||||
:rowClassName="setRowClassName">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<!-- 旧数据 -->
|
||||
<template v-if="column.dataIndex === 'oldValue'">
|
||||
<template v-if="isImageField(record, column.dataIndex) && record.oldValue">
|
||||
<JImageUpload :value="getFieldValue(record, column.dataIndex)" disabled />
|
||||
</template>
|
||||
<template v-else-if="record.fieldKey === 'pic' && record.oldValue">
|
||||
<img :src="getFileAccessHttpUrl(getFullUrl(record.oldValue))" style="width:80px;">
|
||||
</template>
|
||||
<template v-else-if="record.fieldKey === 'picFocus' && record.oldValue">
|
||||
<img :src="getFileAccessHttpUrl(getFullUrl(record.oldValue))" style="width:80px;">
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{ record[column.dataIndex] != null ? record[column.dataIndex] : '-' }}</span>
|
||||
</template>
|
||||
</template>
|
||||
<!-- 新数据 -->
|
||||
<template v-else-if="column.dataIndex === 'newValue'">
|
||||
<template v-if="isImageField(record, column.dataIndex) && record.newValue">
|
||||
<JImageUpload :value="getFieldValue(record, column.dataIndex)" disabled />
|
||||
</template>
|
||||
<template v-else-if="record.fieldKey === 'pic' && record.newValue">
|
||||
<img :src="getFileAccessHttpUrl(getFullUrl(record.oldValue))" style="width:80px;">
|
||||
</template>
|
||||
<template v-else-if="record.fieldKey === 'picFocus' && record.newValue">
|
||||
<img :src="getFileAccessHttpUrl(getFullUrl(record.oldValue))" style="width:80px;">
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{ record[column.dataIndex] != null ? record[column.dataIndex] : '-' }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { Tag } from 'ant-design-vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { dblist } from '../NuConfigElderTagOpeLogInfo.api';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
|
||||
const loading = ref(false);
|
||||
const oldData = ref<Record<string, any>>({});
|
||||
const newData = ref<Record<string, any>>({});
|
||||
|
||||
// 字段映射,用于显示中文名称
|
||||
const fieldLabels: Record<string, string> = {
|
||||
// type:'标签类型',
|
||||
typeName:'标签类型',
|
||||
tagName:'标签名称',
|
||||
describ:'说明',
|
||||
price:'价格',
|
||||
pic:'默认图标',
|
||||
picFocus:'焦点图标',
|
||||
|
||||
};
|
||||
|
||||
// 需要显示的字段顺序
|
||||
const displayFields = [
|
||||
// 'type',
|
||||
'typeName',
|
||||
'tagName',
|
||||
'describ',
|
||||
'price',
|
||||
'pic',
|
||||
'picFocus'
|
||||
|
||||
];
|
||||
|
||||
// 表格列定义
|
||||
const columns = computed(() => [
|
||||
{
|
||||
title: '字段',
|
||||
dataIndex: 'field',
|
||||
key: 'field',
|
||||
ellipsis: false
|
||||
},
|
||||
{
|
||||
title: '变更前',
|
||||
dataIndex: 'oldValue',
|
||||
key: 'oldValue',
|
||||
width: '42%',
|
||||
ellipsis: false
|
||||
},
|
||||
{
|
||||
title: '变更后',
|
||||
dataIndex: 'newValue',
|
||||
key: 'newValue',
|
||||
width: '42%',
|
||||
ellipsis: false
|
||||
}
|
||||
]);
|
||||
setTimeout(()=>{
|
||||
console.log("🌊 ~ tableData:", tableData)
|
||||
},3000)
|
||||
// 表格数据
|
||||
const tableData = computed(() => {
|
||||
return displayFields.map(field => {
|
||||
// 修正:正确处理字段值
|
||||
let oldValue = oldData.value[field];
|
||||
let newValue = newData.value[field];
|
||||
|
||||
return {
|
||||
key: field,
|
||||
field: fieldLabels[field] || field,
|
||||
fieldKey: field,
|
||||
oldValue: oldValue,
|
||||
newValue: newValue,
|
||||
// 为了在模板中方便访问,添加原始字段
|
||||
[field]: newValue,
|
||||
// 添加原始数据的引用
|
||||
oldDataRef: oldData,
|
||||
newDataRef: newData
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
// 判断是否为图片字段
|
||||
const isImageField = (record: any, columnDataIndex: string) => {
|
||||
const imageFields = [
|
||||
'previewFile',
|
||||
'previewFileSmall',
|
||||
'immediateFile',
|
||||
'immediateFileFocus'
|
||||
];
|
||||
if (columnDataIndex == 'field') {
|
||||
return false
|
||||
} else {
|
||||
return imageFields.includes(record.fieldKey);
|
||||
}
|
||||
};
|
||||
|
||||
// 获取字段值
|
||||
const getFieldValue = (record: any, columnDataIndex: string) => {
|
||||
if (columnDataIndex === 'oldValue') {
|
||||
return record.oldValue;
|
||||
} else if (columnDataIndex === 'newValue') {
|
||||
return record.newValue;
|
||||
} else if (columnDataIndex === 'field') {
|
||||
return record.field;
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
// 获取完整的文件URL
|
||||
const getFullUrl = (url: string) => {
|
||||
if (!url) return '';
|
||||
if (url.startsWith('http')) {
|
||||
return url;
|
||||
}
|
||||
const baseUrl = '';
|
||||
return baseUrl + url;
|
||||
};
|
||||
|
||||
// 设置行类名,高亮显示有差异的行
|
||||
const setRowClassName = (record: any) => {
|
||||
if (record.oldValue !== record.newValue && record.fieldKey !== 'createTime') {
|
||||
return 'highlight-row';
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
async function init(record_: any) {
|
||||
try {
|
||||
loading.value = true;
|
||||
const data = await dblist({ 'pkId': record_.id });
|
||||
|
||||
if (data && data.records && data.records.length >= 2) {
|
||||
const oldRecord = data.records.find((item: any) => item.dataType === '1');
|
||||
const newRecord = data.records.find((item: any) => item.dataType === '2');
|
||||
|
||||
if (oldRecord) {
|
||||
oldData.value = { ...oldRecord };
|
||||
}
|
||||
if (newRecord) {
|
||||
newData.value = { ...newRecord };
|
||||
}
|
||||
} else if (data && data.records && data.records.length === 1) {
|
||||
const record = data.records[0];
|
||||
if (record.dataType === '1') {
|
||||
oldData.value = { ...record };
|
||||
newData.value = {};
|
||||
} else if (record.dataType === '2') {
|
||||
oldData.value = {};
|
||||
newData.value = { ...record };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (error) {
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
init
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="less" scoped>
|
||||
.container2 {
|
||||
padding: 16px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
:deep(.ant-table-cell) {
|
||||
padding: 8px 12px !important;
|
||||
}
|
||||
|
||||
// 高亮行样式
|
||||
:deep(.highlight-row) {
|
||||
background-color: #f0f9ff !important; // 浅蓝色背景,表示有变更
|
||||
|
||||
&:hover {
|
||||
background-color: #e6f7ff !important;
|
||||
}
|
||||
}
|
||||
|
||||
// 差异高亮样式
|
||||
:deep(.ant-table-row) {
|
||||
.ant-table-cell {
|
||||
|
||||
&:nth-child(2),
|
||||
// 旧数据列
|
||||
&:nth-child(3) {
|
||||
|
||||
// 新数据列
|
||||
.ant-image,
|
||||
.ant-upload-list-item {
|
||||
border: 1px solid #e8e8e8;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.highlight-row {
|
||||
.ant-table-cell {
|
||||
|
||||
&:nth-child(2),
|
||||
// 旧数据列
|
||||
&:nth-child(3) {
|
||||
// 新数据列
|
||||
background-color: #fff1f0 !important; // 差异数据浅红色背景
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 媒体文件样式调整
|
||||
audio,
|
||||
video {
|
||||
vertical-align: middle;
|
||||
background: #f5f5f5;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
audio {
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
video {
|
||||
min-width: 200px;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
// 标签样式
|
||||
.ant-tag {
|
||||
margin: 0;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuConfigElderTagOpeLogInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签类型" v-bind="validateInfos.typeName" id="NuConfigElderTagOpeLogInfoForm-typeName" name="typeName">
|
||||
<a-input v-model:value="formData.typeName" placeholder="请输入标签类型" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签名称" v-bind="validateInfos.tagName" id="NuConfigElderTagOpeLogInfoForm-tagName" name="tagName">
|
||||
<a-input v-model:value="formData.tagName" placeholder="请输入标签名称" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="说明" v-bind="validateInfos.describ" id="NuConfigElderTagOpeLogInfoForm-describ" name="describ">
|
||||
<a-input v-model:value="formData.describ" placeholder="请输入说明" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="价格" v-bind="validateInfos.price" id="NuConfigElderTagOpeLogInfoForm-price" name="price">
|
||||
<a-input-number v-model:value="formData.price" placeholder="请输入价格" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="默认图标" v-bind="validateInfos.pic" id="NuConfigElderTagOpeLogInfoForm-pic" name="pic">
|
||||
<!-- <a-input v-model:value="formData.pic" placeholder="请输入默认图标" ></a-input> -->
|
||||
<img :src="opeMediaAddress+formData.pic" style="width: 70px;">
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="焦点图标" v-bind="validateInfos.picFocus" id="NuConfigElderTagOpeLogInfoForm-picFocus" name="picFocus">
|
||||
<!-- <a-input v-model:value="formData.picFocus" placeholder="请输入焦点图标" ></a-input> -->
|
||||
<img :src="opeMediaAddress+formData.picFocus" style="width: 70px;">
|
||||
</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 '../NuConfigElderTagOpeLogInfo.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS;
|
||||
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: '',
|
||||
typeName: '',
|
||||
tagName: '',
|
||||
describ: '',
|
||||
price: undefined,
|
||||
pic: '',
|
||||
picFocus: '',
|
||||
});
|
||||
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>
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true" :bodyStyle="{ padding: 0 }" :maskClosable="false" :keyboard="false"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<NuConfigElderTagOpeLogInfoForm ref="registerForm" v-if="isType == '1'" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuConfigElderTagOpeLogInfoForm>
|
||||
<NuConfigElderTagOpeLogInfoCompare ref="registerForm" v-else @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuConfigElderTagOpeLogInfoCompare>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel" style="margin-right: 10px;">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuConfigElderTagOpeLogInfoForm from './NuConfigElderTagOpeLogInfoForm.vue'
|
||||
import NuConfigElderTagOpeLogInfoCompare from './NuConfigElderTagOpeLogInfoCompare.vue'
|
||||
|
||||
const title = ref<string>('');
|
||||
const isType = ref<string>('1');
|
||||
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) {
|
||||
isType.value = '1';
|
||||
title.value = '详情';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function dbEdit(record) {
|
||||
isType.value = '2';
|
||||
title.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({
|
||||
add,
|
||||
edit,
|
||||
dbEdit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuConfigElderTagOpeLogMainForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="操作类型 1新增 2修改" v-bind="validateInfos.opeType" id="NuConfigElderTagOpeLogMainForm-opeType" name="opeType">
|
||||
<j-dict-select-tag v-model:value="formData.opeType" dictCode="directive_ope_type" placeholder="请选择操作类型 1新增 2修改" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="机构编码" v-bind="validateInfos.orgCode" id="NuConfigElderTagOpeLogMainForm-orgCode" name="orgCode">
|
||||
<j-dict-select-tag v-model:value="formData.orgCode" dictCode="sys_depart,depart_name,org_code" placeholder="请选择机构编码" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签类型中文名" v-bind="validateInfos.typeName" id="NuConfigElderTagOpeLogMainForm-typeName" name="typeName">
|
||||
<a-input v-model:value="formData.typeName" placeholder="请输入标签类型中文名" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签名称" v-bind="validateInfos.tagName" id="NuConfigElderTagOpeLogMainForm-tagName" name="tagName">
|
||||
<a-input v-model:value="formData.tagName" placeholder="请输入标签名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="说明" v-bind="validateInfos.describ" id="NuConfigElderTagOpeLogMainForm-describ" name="describ">
|
||||
<a-input v-model:value="formData.describ" placeholder="请输入说明" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="价格" v-bind="validateInfos.price" id="NuConfigElderTagOpeLogMainForm-price" name="price">
|
||||
<a-input-number v-model:value="formData.price" placeholder="请输入价格" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="默认图标" v-bind="validateInfos.pic" id="NuConfigElderTagOpeLogMainForm-pic" name="pic">
|
||||
<a-input v-model:value="formData.pic" placeholder="请输入默认图标" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="焦点图标" v-bind="validateInfos.picFocus" id="NuConfigElderTagOpeLogMainForm-picFocus" name="picFocus">
|
||||
<a-input v-model:value="formData.picFocus" 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 '../NuConfigElderTagOpeLogMain.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: '',
|
||||
opeType: '',
|
||||
orgCode: '',
|
||||
typeName: '',
|
||||
tagName: '',
|
||||
describ: '',
|
||||
price: undefined,
|
||||
pic: '',
|
||||
picFocus: '',
|
||||
});
|
||||
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>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<NuConfigElderTagOpeLogMainForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuConfigElderTagOpeLogMainForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuConfigElderTagOpeLogMainForm from './NuConfigElderTagOpeLogMainForm.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>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
:is-elder-tag-main="etmOrg?.orgCode === item.orgCode" :show-detail="props.showDetail"
|
||||
:clickable="props.showChoose || props.showDirectiveChoose" @click="handleCardClick" @detail="handleDetail" />
|
||||
</a-col>
|
||||
<a-col v-if="orgTableList.length == 0">
|
||||
<a-col v-if="orgTableList.records.length == 0">
|
||||
<div style="margin: 30px auto;">
|
||||
<a-empty />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="title">
|
||||
<template #label><span title="机构名称">机构名称</span></template>
|
||||
<a-input placeholder="请输入机构名称" v-model:value="queryParam.title" allow-clear></a-input>
|
||||
<template #label><span title="机构名称">机构信息</span></template>
|
||||
<a-input placeholder="请输入机构名称/负责人/电话" v-model:value="queryParam.title" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
|
|
@ -17,30 +17,23 @@
|
|||
style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
<a-col :lg="12" style="text-align: right;">
|
||||
<a-button type="primary" preIcon="ant-design:cloud-sync-outlined" @click="handleJingxiang"
|
||||
style="margin-right: 10px;">镜像</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:file-text-twotone" @click="handleViewLogs"
|
||||
style="margin-right: 10px;">日志</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:safety-certificate-twotone" @click="handleElderTagMainFunc"
|
||||
style="margin-right: 10px;">标准标签库</a-button>
|
||||
style="margin-right: 10px;">操作日志</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:cloud-sync-outlined" @click="handleJingxiang"
|
||||
style="margin-right: 10px;">镜像日志</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:copy-outlined" @click="handleElderBackups"
|
||||
style="margin-right: 10px;">标签备份</a-button>
|
||||
<!-- <a-badge :count="609" style="margin-right: 10px;"> -->
|
||||
<!-- <a-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
|
||||
@click="handleLookNewDirectives">新增标签</a-button> -->
|
||||
<!-- </a-badge> -->
|
||||
style="margin-right: 10px;">标签快照</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 机构信息列表 -->
|
||||
<OrgListCom ref="orgListComRef" :title="queryParam.title" @handleOrgDetail="handleDetail" :showDetail=true
|
||||
:showDMTip="true">
|
||||
</OrgListCom>
|
||||
|
||||
<ElderTagModal ref="elderTagModal" />
|
||||
<SyncStepListModal ref="syncStepListModal" />
|
||||
<a-drawer title="详情" width="85vw" v-if="listVisible" v-model:visible="listVisible"
|
||||
<!-- 指令详情 -->
|
||||
<a-drawer title="指令详情" width="85vw" v-if="listVisible" v-model:visible="listVisible"
|
||||
:bodyStyle="{ padding:'14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleCancelList">
|
||||
<ElderTagList ref="listRef"></ElderTagList>
|
||||
|
|
@ -48,49 +41,8 @@
|
|||
<a-button @click="handleCancelList" type="primary" style="float:right;">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
<a-drawer title="日志" width="85vw" v-model:visible="logsVisible"
|
||||
:bodyStyle="{ padding:'14px',height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleCancelLogs">
|
||||
<a-row style="overflow-x: hidden !important; background-color: white;">
|
||||
<a-col :span="2" :push="22" style="margin-top: 18px;margin-left: 30px;">
|
||||
<a-button type="primary" @click="handleRefreshLogs" title="刷新">
|
||||
刷新
|
||||
</a-button>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<AsyncListComponent ref="logsRef" :type="'elderTag'" @handleDetail="handleDetail"></AsyncListComponent>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelLogs" type="primary" style="float:right;">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
<!-- 标准指令库 -->
|
||||
<a-drawer v-model:visible="elderTagMainVisible" title="标准标签库" width="85vw" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding:'14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleCancelelderTagMain">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelelderTagMain" type="primary" style="margin-right: 10px;">关闭</a-button>
|
||||
<a-button @click="handleAsyncelderTagMain" type="primary">确认</a-button>
|
||||
</template>
|
||||
<OrgListCom ref="elderTagMainComRef" :showElderTagMain=true :showDirectiveChoose="true"
|
||||
@handleOrgDetail="handleDetail" :showDetail=true @handleOrgChoose="elderTagMainFunc">
|
||||
</OrgListCom>
|
||||
</a-drawer>
|
||||
<!-- 新增标签 -->
|
||||
<a-drawer v-model:visible="newElderTagVisible" title="新增标签" width="85vw" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ height: '80vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleCancelNewElderTag">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelNewElderTag" type="primary">关闭</a-button>
|
||||
</template>
|
||||
<div >
|
||||
<CanAddElderTagList ref="canAddElderTagRef" :elderTagMainOrgInfo="elderTagMainOrgInfo" :existETIds="existETIds"
|
||||
@refreshExistIds="refreshDMExistedIds"></CanAddElderTagList>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<!-- 标签备份 -->
|
||||
<a-drawer v-model:visible="elderTagBackupsOpen" title="标签备份" width="85vw" :footer-style="{ textAlign: 'right' }"
|
||||
<!-- 标签快照 -->
|
||||
<a-drawer v-model:visible="elderTagBackupsOpen" title="标签快照" width="1000" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding: '14px', height: '80vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleElderBackupsClose">
|
||||
<template #footer>
|
||||
|
|
@ -100,52 +52,30 @@
|
|||
<ElderBkMainList v-if="elderTagBackupsOpen" ref="backupsRef"></ElderBkMainList>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<!-- 操作日志 -->
|
||||
<NuConfigElderTagOpeLogMainListModal ref="opeLogModalRef"></NuConfigElderTagOpeLogMainListModal>
|
||||
<ElderTagSyncLogMainListModal ref="syncLogModalRef"></ElderTagSyncLogMainListModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="synchronization-directive2" lang="ts">
|
||||
import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue'
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue'
|
||||
// 以下为服务指令引用:
|
||||
import { list, asyncFunc, departList } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import ElderTagModal from '/@/views/synchronization/eldertag/eldertag/components/ElderTagModal.vue';
|
||||
import SyncStepListModal from '/@/views/synchronization/eldertag/syncStep/SyncStepListModal.vue';
|
||||
//机构信息
|
||||
import { getOrgInfo } from '/@/views/admin/orgapplyinfo/OrgApplyInfo.api';
|
||||
//机构列表
|
||||
import OrgListCom from '/@/views/synchronization/eldertag/orgCom/OrgListCom.vue'
|
||||
//可新增指令
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import AsyncListComponent from '@/components/dataAsync/AsyncMainList0731.vue'
|
||||
import { getElderTagMain, changeElderTagMain } from '/@/api/common/api'
|
||||
import { idListByDS } from '/@/views/synchronization/eldertag/eldertag/ElderTag.api';
|
||||
import CanAddElderTagList from '/@/views/synchronization/eldertag/canaddet/CanAddElderTagList.vue'
|
||||
import ElderTagList from '/@/views/synchronization/eldertag/eldertag/ElderTagList.vue'
|
||||
import ElderBkMainList from '/@/views/elder/elderbk/ElderBkMainList.vue'
|
||||
import NuConfigElderTagOpeLogMainListModal from '/@/views/synchronization/eldertag/elderTagOpeLogMain/NuConfigElderTagOpeLogMainListModal.vue'
|
||||
import ElderTagSyncLogMainListModal from '/@/views/synchronization/eldertag/tagSyncLogMain/ElderTagSyncLogMainListModal.vue'
|
||||
|
||||
const { createMessage } = useMessage()
|
||||
const canAddElderTagRef = ref()
|
||||
const newElderTagVisible = ref(false)
|
||||
const elderTagMainComRef = ref();
|
||||
const newDirectiveRef = ref()
|
||||
const logsRef = ref()
|
||||
const formRef = ref();
|
||||
const elderTagModal = ref();
|
||||
const syncStepListModal = ref();
|
||||
const orgTableList = ref<any>([]);
|
||||
const queryParam = reactive<any>({});
|
||||
const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
||||
const orgListComRef = ref()
|
||||
const logsVisible = ref(false)
|
||||
const elderTagMainVisible = ref(false)
|
||||
const { createConfirm } = useMessage();
|
||||
const existETIds = ref([])//指令库已存在指令id
|
||||
const elderTagMainOrgInfo = ref()
|
||||
const opeLogModalRef = ref()
|
||||
const syncLogModalRef = ref()
|
||||
const listVisible = ref(false)
|
||||
const listRef = ref(false)
|
||||
const elderTagBackupsOpen = ref(false)
|
||||
const backupsRef = ref()//指令快照
|
||||
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
|
|
@ -159,14 +89,20 @@ const wrapperCol = reactive({
|
|||
});
|
||||
|
||||
/**
|
||||
* 镜像
|
||||
*/
|
||||
function handleJingxiang() {
|
||||
syncStepListModal.value.init(null);
|
||||
syncStepListModal.value.disableSubmit = true;
|
||||
* 操作日志
|
||||
*/
|
||||
function handleViewLogs() {
|
||||
opeLogModalRef.value.init({})
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
* 镜像日志
|
||||
*/
|
||||
function handleJingxiang() {
|
||||
syncLogModalRef.value.init({})
|
||||
}
|
||||
|
||||
/**
|
||||
* 指令详情
|
||||
* @param record
|
||||
*/
|
||||
function handleDetail(record) {
|
||||
|
|
@ -176,6 +112,9 @@ function handleDetail(record) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭详情
|
||||
*/
|
||||
function handleCancelList() {
|
||||
listVisible.value = false
|
||||
}
|
||||
|
|
@ -187,14 +126,6 @@ function searchQuery() {
|
|||
orgListComRef.value?.reload();
|
||||
}
|
||||
|
||||
function reload() {
|
||||
//刷新数据
|
||||
queryParam.pageSize = pageParams.value.pageSize;
|
||||
queryParam.pageNo = pageParams.value.pageNo;
|
||||
getOrgInfo(queryParam).then(res => {
|
||||
orgTableList.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
|
|
@ -204,113 +135,6 @@ function searchReset() {
|
|||
orgListComRef.value?.searchReset()
|
||||
}
|
||||
|
||||
/**
|
||||
* 日志
|
||||
*/
|
||||
function handleViewLogs() {
|
||||
logsVisible.value = true
|
||||
handleRefreshLogs()
|
||||
}
|
||||
|
||||
function handleLookNewDirectives() {
|
||||
newElderTagVisible.value = true
|
||||
refreshDMExistedIds(elderTagMainOrgInfo.value, true)
|
||||
}
|
||||
|
||||
//关闭日志模态框
|
||||
function handleCancelLogs() {
|
||||
logsVisible.value = false
|
||||
}
|
||||
|
||||
//刷新日志
|
||||
function handleRefreshLogs() {
|
||||
logsRef.value?.searchQuery()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭新增指令
|
||||
*/
|
||||
function handleCancelNewElderTag() {
|
||||
newElderTagVisible.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步新增指令
|
||||
*/
|
||||
function handleAsyncNewDirective() {
|
||||
// newDirectiveRef
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开指令库
|
||||
*/
|
||||
function handleElderTagMainFunc() {
|
||||
elderTagMainVisible.value = true
|
||||
elderTagMainComRef.value?.reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭指令库
|
||||
*/
|
||||
function handleCancelelderTagMain() {
|
||||
elderTagMainVisible.value = false
|
||||
}
|
||||
|
||||
//刷新已有指令库
|
||||
function refreshDMExistedIds(dmOrgInfo, izReset = false, izQuery = true) {
|
||||
idListByDS({ dataSourceCode: dmOrgInfo.orgCode }).then(res => {
|
||||
existETIds.value = res.records
|
||||
if (izReset) {
|
||||
canAddElderTagRef.value?.searchReset()
|
||||
} else {
|
||||
canAddElderTagRef.value?.reload()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
watch(elderTagMainOrgInfo, (newValue, oldValue) => {
|
||||
refreshDMExistedIds(newValue)
|
||||
}, { deep: true })
|
||||
|
||||
const tempDM = ref()
|
||||
/**
|
||||
* 指令库对应机构信息
|
||||
*/
|
||||
function elderTagMainFunc(orgInfo_) {
|
||||
tempDM.value = orgInfo_
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认指令库
|
||||
*/
|
||||
function handleAsyncelderTagMain() {
|
||||
// createConfirm({
|
||||
// iconType: 'warning',
|
||||
// title: '指令库变更提醒',
|
||||
// content: '是否变更指令库为:' + tempDM.value.departName,
|
||||
// okText: '确认',
|
||||
// cancelText: '取消',
|
||||
// onOk: () => {
|
||||
elderTagMainOrgInfo.value = tempDM.value
|
||||
changeElderTagMain(elderTagMainOrgInfo.value.orgCode).then(() => {
|
||||
createMessage.success('标准指令库已变更')
|
||||
handleCancelelderTagMain()
|
||||
canAddElderTagRef.value?.reload()
|
||||
orgListComRef.value?.reload()
|
||||
}).catch(() => {
|
||||
createMessage.error('指令库变更失败,请稍后再试')
|
||||
})
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
//获取指令库机构信息
|
||||
function getElderTagMainOrgInfo() {
|
||||
getElderTagMain().then(res => {
|
||||
elderTagMainOrgInfo.value = res
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看指令快照
|
||||
*/
|
||||
|
|
@ -327,8 +151,6 @@ function handleElderBackupsClose() {
|
|||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
reload();
|
||||
getElderTagMainOrgInfo()
|
||||
orgListComRef.value?.reload();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/eldertagsynclog/elderTagSyncLogInfo/list',
|
||||
save='/eldertagsynclog/elderTagSyncLogInfo/add',
|
||||
edit='/eldertagsynclog/elderTagSyncLogInfo/edit',
|
||||
deleteOne = '/eldertagsynclog/elderTagSyncLogInfo/delete',
|
||||
deleteBatch = '/eldertagsynclog/elderTagSyncLogInfo/deleteBatch',
|
||||
importExcel = '/eldertagsynclog/elderTagSyncLogInfo/importExcel',
|
||||
exportXls = '/eldertagsynclog/elderTagSyncLogInfo/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 });
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
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';
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS;
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
// {
|
||||
// title: '标签类型',
|
||||
// align: "center",
|
||||
// dataIndex: 'type'
|
||||
// },
|
||||
{
|
||||
title: '标签类型中文名',
|
||||
align: "center",
|
||||
dataIndex: 'typeName'
|
||||
},
|
||||
{
|
||||
title: '标签名称',
|
||||
align: "center",
|
||||
dataIndex: 'tagName'
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
align: "center",
|
||||
dataIndex: 'describ'
|
||||
},
|
||||
{
|
||||
title: '价格',
|
||||
align: "center",
|
||||
dataIndex: 'price'
|
||||
},
|
||||
{
|
||||
title: '默认图标',
|
||||
align: "center",
|
||||
dataIndex: 'pic',
|
||||
customRender: ({ text }) => {
|
||||
// 如果 text 为空或 null/undefined,使用默认图片
|
||||
const imageUrl = text ? opeMediaAddress + text : opeMediaAddress + import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
|
||||
return render.renderImage({ text: imageUrl });
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '焦点图标',
|
||||
align: "center",
|
||||
dataIndex: 'picFocus',
|
||||
customRender: ({ text }) => {
|
||||
// 如果 text 为空或 null/undefined,使用默认图片
|
||||
const imageUrl = text ? opeMediaAddress + text : opeMediaAddress + import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
|
||||
return render.renderImage({ text: imageUrl });
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
pkId: {title: 'nu_config_elder_tag_sync_log_main.id',order: 0,view: 'text', type: 'string',},
|
||||
type: {title: '标签类型',order: 1,view: 'text', type: 'string',},
|
||||
typeName: {title: '标签类型中文名',order: 2,view: 'text', type: 'string',},
|
||||
tagName: {title: '标签名称',order: 3,view: 'text', type: 'string',},
|
||||
describ: {title: '说明',order: 4,view: 'text', type: 'string',},
|
||||
price: {title: '价格',order: 5,view: 'number', type: 'number',},
|
||||
pic: {title: '默认图标',order: 6,view: 'text', type: 'string',},
|
||||
picFocus: {title: '焦点图标',order: 7,view: 'text', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,227 @@
|
|||
<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)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagSyncLogInfoModal ref="registerModal" @success="handleSuccess"></ElderTagSyncLogInfoModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="tagSyncLogMain-elderTagSyncLogInfo" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ElderTagSyncLogInfo.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ElderTagSyncLogInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ElderTagSyncLogInfoModal from './components/ElderTagSyncLogInfoModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
||||
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: 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: "长者标签-镜像-日志-指令详情表",
|
||||
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 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: 'tagSyncLogMain:nu_config_elder_tag_sync_log_info:edit'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'tagSyncLogMain:nu_config_elder_tag_sync_log_info:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
function init(record) {
|
||||
console.log("🚀 ~ init ~ record:", record)
|
||||
queryParam.pkId = 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>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true" :bodyStyle="{ padding: 0 }" :maskClosable="false" :keyboard="false"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<ElderTagSyncLogInfoList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ElderTagSyncLogInfoList>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel" style="margin-right: 10px;">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ElderTagSyncLogInfoList from './ElderTagSyncLogInfoList.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']);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function init(record) {
|
||||
title.value = '镜像日志详情';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.init(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/eldertagsynclog/elderTagSyncLogMain/list',
|
||||
save='/eldertagsynclog/elderTagSyncLogMain/add',
|
||||
edit='/eldertagsynclog/elderTagSyncLogMain/edit',
|
||||
deleteOne = '/eldertagsynclog/elderTagSyncLogMain/delete',
|
||||
deleteBatch = '/eldertagsynclog/elderTagSyncLogMain/deleteBatch',
|
||||
importExcel = '/eldertagsynclog/elderTagSyncLogMain/importExcel',
|
||||
exportXls = '/eldertagsynclog/elderTagSyncLogMain/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 });
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
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: 'opeOrgCode_dictText'
|
||||
},
|
||||
{
|
||||
title: '源镜像机构',
|
||||
align: "center",
|
||||
dataIndex: 'targetOrgCode_dictText'
|
||||
},
|
||||
{
|
||||
title: '镜像码',
|
||||
align: "center",
|
||||
dataIndex: 'orgTagCode',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '镜像时间',
|
||||
align: "center",
|
||||
dataIndex: 'createTime',
|
||||
width: 180
|
||||
// customRender:({text}) =>{
|
||||
// text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
|
||||
// return text;
|
||||
// },
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
opeOrgCode: {title: '目标镜像机构',order: 0,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'org_code', dictText: 'depart_name',},
|
||||
targetOrgCode: {title: '源镜像机构',order: 1,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'org_code', dictText: 'depart_name',},
|
||||
orgTagCode: {title: '标签镜像码',order: 2,view: 'text', type: 'string',},
|
||||
createTime: {title: '镜像时间',order: 3,view: 'date', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,220 @@
|
|||
<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="8">
|
||||
<a-form-item name="opeOrgCode">
|
||||
<template #label><span title="目标镜像机构">目标镜像机构</span></template>
|
||||
<JDictSelectTag placeholder="请选择目标镜像机构" v-model:value="queryParam.opeOrgCode" dictCode="sys_depart,depart_name,org_code" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item name="targetOrgCode">
|
||||
<template #label><span title="源镜像机构">源镜像机构</span></template>
|
||||
<JDictSelectTag placeholder="请选择源镜像机构" v-model:value="queryParam.targetOrgCode" dictCode="sys_depart,depart_name,org_code" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item name="orgTagCode">
|
||||
<template #label><span title="镜像码">镜像码</span></template>
|
||||
<JInput v-model:value="queryParam.orgTagCode" placeholder="请输入镜像码"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item name="createTime">
|
||||
<template #label><span title="镜像时间">镜像时间</span></template>
|
||||
<a-range-picker value-format="YYYY-MM-DD" v-model:value="queryParam.createTime" class="query-group-cust"/>
|
||||
</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)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagSyncLogMainList ref="registerModal" @success="handleSuccess"></ElderTagSyncLogMainList>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="tagSyncLogMain-elderTagSyncLogMain" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ElderTagSyncLogMain.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ElderTagSyncLogMain.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ElderTagSyncLogMainList from './ElderTagSyncLogInfoListModal.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';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
|
||||
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: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
let rangerQuery = await setRangeQuery();
|
||||
return Object.assign(params, rangerQuery);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "长者标签-镜像-日志-主表",
|
||||
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:6,
|
||||
xl:6,
|
||||
xxl:6
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 18,
|
||||
});
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.init(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
let rangeField = 'createTime,'
|
||||
|
||||
/**
|
||||
* 设置范围查询条件
|
||||
*/
|
||||
async function setRangeQuery(){
|
||||
let queryParamClone = cloneDeep(queryParam);
|
||||
if (rangeField) {
|
||||
let fieldsValue = rangeField.split(',');
|
||||
fieldsValue.forEach(item => {
|
||||
if (queryParamClone[item]) {
|
||||
let range = queryParamClone[item];
|
||||
queryParamClone[item+'_begin'] = range[0];
|
||||
queryParamClone[item+'_end'] = range[1];
|
||||
delete queryParamClone[item];
|
||||
} else {
|
||||
queryParamClone[item+'_begin'] = '';
|
||||
queryParamClone[item+'_end'] = '';
|
||||
}
|
||||
})
|
||||
}
|
||||
return queryParamClone;
|
||||
}
|
||||
|
||||
|
||||
function init(record) {
|
||||
console.log("🚀 ~ init ~ record:", record)
|
||||
}
|
||||
|
||||
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>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true" :bodyStyle="{ padding: 0 }" :maskClosable="false" :keyboard="false"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<ElderTagSyncLogMainList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ElderTagSyncLogMainList>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel" style="margin-right: 10px;">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ElderTagSyncLogMainList from './ElderTagSyncLogMainList.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']);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function init(record) {
|
||||
title.value = '镜像日志';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.init(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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>
|
||||
|
|
@ -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="ElderTagSyncLogInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="nu_config_elder_tag_sync_log_main.id" v-bind="validateInfos.pkId" id="ElderTagSyncLogInfoForm-pkId" name="pkId">
|
||||
<a-input v-model:value="formData.pkId" placeholder="请输入nu_config_elder_tag_sync_log_main.id" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签类型nu_elder_tag_type.id" v-bind="validateInfos.type" id="ElderTagSyncLogInfoForm-type" name="type">
|
||||
<a-input v-model:value="formData.type" placeholder="请输入标签类型nu_elder_tag_type.id" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签类型中文名" v-bind="validateInfos.typeName" id="ElderTagSyncLogInfoForm-typeName" name="typeName">
|
||||
<a-input v-model:value="formData.typeName" placeholder="请输入标签类型中文名" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签名称" v-bind="validateInfos.tagName" id="ElderTagSyncLogInfoForm-tagName" name="tagName">
|
||||
<a-input v-model:value="formData.tagName" placeholder="请输入标签名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="说明" v-bind="validateInfos.describ" id="ElderTagSyncLogInfoForm-describ" name="describ">
|
||||
<a-input v-model:value="formData.describ" placeholder="请输入说明" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="价格" v-bind="validateInfos.price" id="ElderTagSyncLogInfoForm-price" name="price">
|
||||
<a-input-number v-model:value="formData.price" placeholder="请输入价格" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="默认图标" v-bind="validateInfos.pic" id="ElderTagSyncLogInfoForm-pic" name="pic">
|
||||
<a-input v-model:value="formData.pic" placeholder="请输入默认图标" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="焦点图标" v-bind="validateInfos.picFocus" id="ElderTagSyncLogInfoForm-picFocus" name="picFocus">
|
||||
<a-input v-model:value="formData.picFocus" 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 '../ElderTagSyncLogInfo.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: '',
|
||||
pkId: '',
|
||||
type: '',
|
||||
typeName: '',
|
||||
tagName: '',
|
||||
describ: '',
|
||||
price: undefined,
|
||||
pic: '',
|
||||
picFocus: '',
|
||||
});
|
||||
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>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<ElderTagSyncLogInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ElderTagSyncLogInfoForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ElderTagSyncLogInfoForm from './ElderTagSyncLogInfoForm.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>
|
||||
|
|
@ -0,0 +1,164 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ElderTagSyncLogMainForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="哪个机构镜像的" v-bind="validateInfos.opeOrgCode" id="ElderTagSyncLogMainForm-opeOrgCode" name="opeOrgCode">
|
||||
<j-dict-select-tag v-model:value="formData.opeOrgCode" dictCode="sys_depart,depart_name,org_code" placeholder="请选择哪个机构镜像的" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="镜像的哪个机构的标签" v-bind="validateInfos.targetOrgCode" id="ElderTagSyncLogMainForm-targetOrgCode" name="targetOrgCode">
|
||||
<j-dict-select-tag v-model:value="formData.targetOrgCode" dictCode="sys_depart,depart_name,org_code" placeholder="请选择镜像的哪个机构的标签" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签镜像码" v-bind="validateInfos.orgTagCode" id="ElderTagSyncLogMainForm-orgTagCode" name="orgTagCode">
|
||||
<a-input v-model:value="formData.orgTagCode" placeholder="请输入标签镜像码" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="创建日期" v-bind="validateInfos.createTime" id="ElderTagSyncLogMainForm-createTime" name="createTime">
|
||||
<a-date-picker placeholder="请选择创建日期" v-model:value="formData.createTime" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
||||
</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 '../ElderTagSyncLogMain.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: '',
|
||||
opeOrgCode: '',
|
||||
targetOrgCode: '',
|
||||
orgTagCode: '',
|
||||
createTime: '',
|
||||
});
|
||||
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>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<ElderTagSyncLogMainForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ElderTagSyncLogMainForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ElderTagSyncLogMainForm from './ElderTagSyncLogMainForm.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>
|
||||
Loading…
Reference in New Issue