Merge branch 'master' of http://47.115.223.229:8888/yangjun/hldy_vue
This commit is contained in:
commit
39878b4183
|
|
@ -23,9 +23,6 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8092'
|
|||
# 试验田机构编码
|
||||
VITE_SYTJGBM = '101'
|
||||
|
||||
# 服务指令
|
||||
VITE_DIRECTIVE_UPLOAD_PATH = ''
|
||||
|
||||
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
||||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
||||
# 作为乾坤子应用启动时必填,需与qiankun主应用注册子应用时填写的 entry 保持一致
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@
|
|||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'targetOrgName'">
|
||||
<span>{{ record.asyncStatusList?.[0]?.zorgName || '-' }}</span>
|
||||
|
|
@ -70,12 +74,13 @@
|
|||
|
||||
<script lang="ts" name="asyncmain-asyncMain" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable } from '/@/components/Table';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { asyncMaincolumns, asyncMaincolumnsElderTag } from './AsyncMain.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AsyncMain.api';
|
||||
import AsyncMainModal from './components/AsyncMainModal.vue'
|
||||
|
||||
const emit = defineEmits(['handleDetail'])
|
||||
const props = defineProps({
|
||||
orgCode: 'orgCode',
|
||||
type: '',
|
||||
|
|
@ -91,7 +96,10 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
canResize: false,
|
||||
useSearchForm: false,
|
||||
showTableSetting: false,
|
||||
showActionColumn: false,
|
||||
actionColumn: {
|
||||
width: 50,
|
||||
fixed: 'right',
|
||||
},
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 15,
|
||||
|
|
@ -144,6 +152,26 @@ function searchQuery() {
|
|||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
console.log("🌊 ~ handleDetail ~ record:", record)
|
||||
emit('handleDetail', { orgCode: record.orgCode, queryIds: record.syncIds, sourceOrgName: record.orgName, targetOrgName: record.asyncStatusList?.[0]?.zorgName })
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
searchQuery
|
||||
});
|
||||
|
|
|
|||
|
|
@ -83,10 +83,10 @@ async function bootstrap(props?: MainAppProps) {
|
|||
setupErrorHandle(app);
|
||||
|
||||
// 注册第三方组件
|
||||
// await registerThirdComp(app);
|
||||
await registerThirdComp(app);
|
||||
|
||||
// 当路由准备好时再执行挂载( https://next.router.vuejs.org/api/#isready)
|
||||
// await router.isReady();
|
||||
await router.isReady();
|
||||
|
||||
// 挂载应用
|
||||
app.mount(getMountContainer(props), true);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/services/directiveMedia/list',
|
||||
save='/services/directiveMedia/add',
|
||||
edit='/services/directiveMedia/edit',
|
||||
deleteOne = '/services/directiveMedia/delete',
|
||||
deleteBatch = '/services/directiveMedia/deleteBatch',
|
||||
importExcel = '/services/directiveMedia/importExcel',
|
||||
exportXls = '/services/directiveMedia/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,63 @@
|
|||
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: 'directiveName'
|
||||
},
|
||||
{
|
||||
title: '分类标签',
|
||||
align: "center",
|
||||
dataIndex: 'instructionTagId_dictText'
|
||||
},
|
||||
{
|
||||
title: '服务类别',
|
||||
align: "center",
|
||||
dataIndex: 'categoryId_dictText'
|
||||
},
|
||||
{
|
||||
title: '服务类型',
|
||||
align: "center",
|
||||
dataIndex: 'typeId_dictText'
|
||||
},
|
||||
{
|
||||
title: '周期类型',
|
||||
align: "center",
|
||||
dataIndex: 'cycleType_dictText'
|
||||
},
|
||||
{
|
||||
title: '服务指令图片大图',
|
||||
align: "center",
|
||||
dataIndex: 'previewFile',
|
||||
customRender: render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '服务指令图片小图',
|
||||
align: "center",
|
||||
dataIndex: 'previewFileSmall',
|
||||
customRender: render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '即时指令图标',
|
||||
align: "center",
|
||||
dataIndex: 'immediateFile',
|
||||
customRender: render.renderImage,
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
directiveName: {title: '服务指令名称',order: 0,view: 'text', type: 'string',},
|
||||
instructionTagId: {title: '分类标签id',order: 1,view: 'list', type: 'string',dictCode: '',},
|
||||
categoryId: {title: '服务类别id',order: 2,view: 'list', type: 'string',dictCode: '',},
|
||||
typeId: {title: '服务类型id',order: 3,view: 'list', type: 'string',dictCode: '',},
|
||||
cycleType: {title: '周期类型',order: 4,view: 'list', type: 'string',dictCode: '',},
|
||||
previewFile: {title: '服务指令图片大图',order: 5,view: 'image', type: 'string',},
|
||||
previewFileSmall: {title: '服务指令图片小图',order: 6,view: 'image', type: 'string',},
|
||||
immediateFile: {title: '即时指令图标',order: 7,view: 'image', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,298 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="directiveName">
|
||||
<template #label><span title="服务指令名称">服务指令</span></template>
|
||||
<JInput v-model:value="queryParam.directiveName" placeholder="请输入服务指令名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="instructionTagId">
|
||||
<template #label><span title="分类标签">分类标签</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
|
||||
placeholder="请选择分类标签" :orgCode="sjjdbm" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="categoryId">
|
||||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.categoryId" :dictCode="categoryDictCode"
|
||||
placeholder="请选择服务类别" :orgCode="sjjdbm" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="typeId">
|
||||
<template #label><span title="服务类型">服务类型</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.typeId" :dictCode="typeDictCode" placeholder="请选择服务类型"
|
||||
:orgCode="sjjdbm" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="cycleType">
|
||||
<template #label><span title="周期类型">周期类型</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.cycleType" dictCode="period_type" placeholder="请选择周期类型"
|
||||
:orgCode="sjjdbm" 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>
|
||||
<!--引用表格-->
|
||||
<div style="padding: 14px;background-color: #fff;">
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<!-- !功能不用了!功能不用了!所以把新增注释掉了!功能不用了!功能不用了! -->
|
||||
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
<!-- 表单区域 -->
|
||||
<DirectiveMediaModal ref="registerModal" @success="handleSuccess"></DirectiveMediaModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="directivemedia-directiveMedia" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './DirectiveMedia.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DirectiveMedia.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import DirectiveMediaModal from './components/DirectiveMediaModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
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();
|
||||
const sjjdbm = import.meta.env.VITE_SYTJGBM
|
||||
const categoryDictCode = ref('')
|
||||
const typeDictCode = ref('')
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '服务指令资源管理',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
scroll: { 'y': '55vh' },
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 15,
|
||||
pageSizeOptions: ['15', '50', '70', '100'],
|
||||
},
|
||||
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),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => queryParam.instructionTagId,
|
||||
(newInstructionTagId) => {
|
||||
// if (needWatch.value) {
|
||||
queryParam.categoryId = ''
|
||||
queryParam.typeId = ''
|
||||
// queryParam.cycleType = ''
|
||||
// }
|
||||
if (!newInstructionTagId) {
|
||||
categoryDictCode.value = 'nu_config_service_category,category_name,id,1=2';
|
||||
} else {
|
||||
categoryDictCode.value = `nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 0 and instruction_id = '${newInstructionTagId}' order by sort asc`;
|
||||
}
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => queryParam.categoryId,
|
||||
(newCategoryId) => {
|
||||
// if (needWatch.value) {
|
||||
queryParam.typeId = ''
|
||||
// queryParam.cycleType = ''
|
||||
// }
|
||||
if (!newCategoryId) {
|
||||
typeDictCode.value = 'nu_config_service_type,type_name,id,1=2';
|
||||
} else {
|
||||
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${newCategoryId}' order by sort asc`;
|
||||
}
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => queryParam.typeId,
|
||||
(newTypeId) => {
|
||||
// if (needWatch.value) {
|
||||
// queryParam.cycleType = ''
|
||||
// }
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
margin-bottom: 14px;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 14px;
|
||||
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: 14px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,336 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="DirectiveMediaForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId" id="DirectiveMediaForm-instructionTagId"
|
||||
name="instructionTagId">
|
||||
<j-dict-select-tag v-model:value="formData.instructionTagId" :disabled="!!formData.id"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
|
||||
@upDictCode="upInstructionDictCode" placeholder="请选择分类标签" :orgCode="sjjdbm" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="DirectiveMediaForm-categoryId"
|
||||
name="categoryId">
|
||||
<j-dict-select-tag v-model:value="formData.categoryId" :disabled="!!formData.id"
|
||||
@upDictCode="upCategoryDictCode" :dictCode="categoryDictCode" placeholder="请选择服务类别" :orgCode="sjjdbm"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="DirectiveMediaForm-typeId" name="typeId">
|
||||
<j-dict-select-tag v-model:value="formData.typeId" :disabled="!!formData.id" :dictCode="typeDictCode"
|
||||
@upDictCode="upTypeDictCode" placeholder="请选择服务类型" :orgCode="sjjdbm" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务指令名称" v-bind="validateInfos.directiveName" id="DirectiveMediaForm-directiveName"
|
||||
name="directiveName">
|
||||
<a-input v-model:value="formData.directiveName" :disabled="!!formData.id" placeholder="请输入服务指令名称"
|
||||
:maxlength="20" :showCount="true" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="DirectiveMediaForm-cycleType"
|
||||
name="cycleType">
|
||||
<j-dict-select-tag v-model:value="formData.cycleType" :disabled="!!formData.id" dictCode="period_type"
|
||||
@upDictCode="upCycleTypeDictCode" placeholder="请选择周期类型" :orgCode="sjjdbm" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务指令图片大图" v-bind="validateInfos.previewFile" id="DirectiveMediaForm-previewFile"
|
||||
name="previewFile">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.previewFile"></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务指令图片小图" v-bind="validateInfos.previewFileSmall"
|
||||
id="DirectiveMediaForm-previewFileSmall" name="previewFileSmall">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.previewFileSmall"></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile" id="DirectiveMediaForm-immediateFile"
|
||||
name="immediateFile">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.immediateFile"></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
||||
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"
|
||||
:beforeUpload="checkMp3"></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
||||
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"
|
||||
:beforeUpload="checkMp4"></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务指令描述" v-bind="validateInfos.serviceContent"
|
||||
id="ConfigServiceDirectiveForm-serviceContent" name="serviceContent">
|
||||
<a-textarea v-model:value="formData.serviceContent" placeholder="请输入服务指令描述" :autosize="{ minRows: 3 }"
|
||||
:maxlength="200" :showCount="true" />
|
||||
</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, watch } 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 JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../DirectiveMedia.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||
|
||||
const sjjdbm = import.meta.env.VITE_SYTJGBM
|
||||
const categoryDictCode = ref('')
|
||||
const typeDictCode = ref('')
|
||||
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: '',
|
||||
directiveId: '',
|
||||
directiveName: '',
|
||||
instructionTagId: '',
|
||||
categoryId: '',
|
||||
typeId: '',
|
||||
cycleType: '',
|
||||
previewFile: '',
|
||||
previewFileSmall: '',
|
||||
immediateFile: '',
|
||||
mp3File: '',
|
||||
mp4File: '',
|
||||
serviceContent: '',
|
||||
});
|
||||
const needWatch = ref(false)
|
||||
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({
|
||||
directiveName: [{ required: true, message: '请输入服务指令名称!' },],
|
||||
instructionTagId: [{ required: true, message: '请输入分类标签id!' },],
|
||||
categoryId: [{ required: true, message: '请输入服务类别id!' },],
|
||||
typeId: [{ required: true, message: '请输入服务类型id!' },],
|
||||
cycleType: [{ required: true, message: '请输入周期类型!' },],
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
//分类标签名称
|
||||
const instructionComDictCode = ref([])
|
||||
function upInstructionDictCode(v_) {
|
||||
instructionComDictCode.value = v_
|
||||
}
|
||||
//服务类别名称
|
||||
const categoryComDictCode = ref([])
|
||||
function upCategoryDictCode(v_) {
|
||||
categoryComDictCode.value = v_
|
||||
}
|
||||
//服务类型名称
|
||||
const typeComDictCode = ref([])
|
||||
function upTypeDictCode(v_) {
|
||||
typeComDictCode.value = v_
|
||||
}
|
||||
//周期类型名称
|
||||
const cycleTypeComDictCode = ref([])
|
||||
function upCycleTypeDictCode(v_) {
|
||||
cycleTypeComDictCode.value = v_
|
||||
}
|
||||
watch([instructionComDictCode, categoryComDictCode, typeComDictCode, cycleTypeComDictCode], () => {
|
||||
// 当这些字典数据变化时,强制重新计算 formComputedData
|
||||
}, { deep: true });
|
||||
const formComputedData = computed(() => {
|
||||
// 获取各个字段的字典值
|
||||
const instructionName = instructionComDictCode.value.find(d => d.value == formData.instructionTagId)?.label || '';
|
||||
const categoryName = categoryComDictCode.value.find(d => d.value == formData.categoryId)?.label || '';
|
||||
const typeName = typeComDictCode.value.find(d => d.value == formData.typeId)?.label || '';
|
||||
const cycleTypeName = cycleTypeComDictCode.value.find(d => d.value == formData.cycleType)?.label || '';
|
||||
|
||||
return {
|
||||
mediaFileSavePath: `directive/${instructionName}/${categoryName}/${typeName}/${cycleTypeName}/${formData.directiveName}`,
|
||||
instructionName,
|
||||
categoryName,
|
||||
typeName,
|
||||
cycleTypeName,
|
||||
};
|
||||
});
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(() => {
|
||||
if (props.formBpm === true) {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
watch(
|
||||
() => formData.instructionTagId,
|
||||
(newInstructionTagId) => {
|
||||
if (needWatch.value) {
|
||||
formData.categoryId = ''
|
||||
formData.typeId = ''
|
||||
// formData.cycleType = ''
|
||||
}
|
||||
if (!newInstructionTagId) {
|
||||
categoryDictCode.value = 'nu_config_service_category,category_name,id,1=2';
|
||||
} else {
|
||||
categoryDictCode.value = `nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 0 and instruction_id = '${newInstructionTagId}' order by sort asc`;
|
||||
}
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => formData.categoryId,
|
||||
(newCategoryId) => {
|
||||
if (needWatch.value) {
|
||||
formData.typeId = ''
|
||||
// formData.cycleType = ''
|
||||
}
|
||||
if (!newCategoryId) {
|
||||
typeDictCode.value = 'nu_config_service_type,type_name,id,1=2';
|
||||
} else {
|
||||
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${newCategoryId}' order by sort asc`;
|
||||
}
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => formData.typeId,
|
||||
(newTypeId) => {
|
||||
if (needWatch.value) {
|
||||
// formData.cycleType = ''
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const checkMp3 = (file) => {
|
||||
const isPDF = file.type === 'application/mp3' || file.name.endsWith('.mp3');
|
||||
if (!isPDF) {
|
||||
createMessage.error('只能上传 mp3 文件!');
|
||||
return false; // 阻止上传
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const checkMp4 = (file) => {
|
||||
const isPDF = file.type === 'application/mp4' || file.name.endsWith('.mp4');
|
||||
if (!isPDF) {
|
||||
createMessage.error('只能上传 mp4 文件!');
|
||||
return false; // 阻止上传
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
needWatch.value = false
|
||||
setTimeout(() => {
|
||||
needWatch.value = true
|
||||
}, 1000)
|
||||
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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
model.mediaFileSavePath = formComputedData.value.mediaFileSavePath
|
||||
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,84 @@
|
|||
<template>
|
||||
<a-drawer :title="title" width="50vw" :visible="visible" @ok="handleOk" @cancel="handleCancel" cancelText="关闭"
|
||||
:closable="true" :footer-style="{ textAlign: 'right' }" @close="handleCancel"
|
||||
:bodyStyle="{ padding: '0px', background: 'linear-gradient(135deg, #f1f7ff 0%, #f1f7ff 100%)' }">
|
||||
<DirectiveMediaForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
|
||||
</DirectiveMediaForm>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel" style="margin-right: 8px;">关闭</a-button>
|
||||
<a-button @click="handleOk" style="margin-right: 8px;">确定</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import DirectiveMediaForm from './DirectiveMediaForm.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,81 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/directivebk/directiveBkItem/list',
|
||||
save='/directivebk/directiveBkItem/add',
|
||||
edit='/directivebk/directiveBkItem/edit',
|
||||
deleteOne = '/directivebk/directiveBkItem/delete',
|
||||
deleteBatch = '/directivebk/directiveBkItem/deleteBatch',
|
||||
importExcel = '/directivebk/directiveBkItem/importExcel',
|
||||
exportXls = '/directivebk/directiveBkItem/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 });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const exposBkApi = (params) => {
|
||||
return defHttp.post({ url: Api.exportXls, params });
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
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: 'instructionName',
|
||||
},
|
||||
{
|
||||
title: '服务类别',
|
||||
align: 'center',
|
||||
dataIndex: 'categoryName',
|
||||
},
|
||||
{
|
||||
title: '服务类型',
|
||||
align: 'center',
|
||||
dataIndex: 'typeName',
|
||||
},
|
||||
{
|
||||
title: '周期类型',
|
||||
align: 'center',
|
||||
dataIndex: 'cycleTypeName',
|
||||
},
|
||||
{
|
||||
title: '服务指令',
|
||||
align: 'center',
|
||||
dataIndex: 'directiveName',
|
||||
},
|
||||
{
|
||||
title: '收费价格(元)',
|
||||
align: 'center',
|
||||
dataIndex: 'tollPrice',
|
||||
},
|
||||
{
|
||||
title: '提成价格(元)',
|
||||
align: 'center',
|
||||
dataIndex: 'comPrice',
|
||||
},
|
||||
{
|
||||
title: '服务说明',
|
||||
align: 'center',
|
||||
dataIndex: 'serviceContent',
|
||||
},
|
||||
{
|
||||
title: '服务时长(分钟)',
|
||||
align: 'center',
|
||||
dataIndex: 'serviceDuration',
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
directiveName: { title: '服务指令名称', order: 0, view: 'text', type: 'string' },
|
||||
tollPrice: { title: '收费价格', order: 1, view: 'number', type: 'number' },
|
||||
comPrice: { title: '提成价格', order: 2, view: 'number', type: 'number' },
|
||||
serviceContent: { title: '服务说明', order: 3, view: 'text', type: 'string' },
|
||||
serviceDuration: { title: '服务时长(分钟)', order: 4, view: 'text', type: 'string' },
|
||||
izEnabled: { title: '是否启用 0启用 1未启用', order: 5, view: 'text', type: 'string' },
|
||||
mp3File: { title: '语音文件', order: 6, view: 'text', type: 'string' },
|
||||
mp4File: { title: '视频文件', order: 7, view: 'text', type: 'string' },
|
||||
previewFile: { title: '预览图片', order: 8, view: 'text', type: 'string' },
|
||||
immediateFile: { title: '即时指令图片', order: 9, view: 'text', type: 'string' },
|
||||
instructionName: { title: '分类标签中文名称', order: 10, view: 'text', type: 'string' },
|
||||
categoryName: { title: '服务类别中文名称', order: 11, view: 'text', type: 'string' },
|
||||
typeName: { title: '服务类型中文名称', order: 12, view: 'text', type: 'string' },
|
||||
cycleTypeName: { title: '周期类型中文名称', order: 13, view: 'text', type: 'string' },
|
||||
};
|
||||
|
|
@ -0,0 +1,276 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--查询区域-->
|
||||
<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="5">
|
||||
<a-form-item name="instructionTagId">
|
||||
<template #label><span title="分类标签">分类标签</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId" :orgCode="bkOrgCode"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
|
||||
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" />
|
||||
<!-- <span v-else>请选择源平台</span> -->
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="5">
|
||||
<a-form-item name="categoryId">
|
||||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId" :orgCode="bkOrgCode"
|
||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
|
||||
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="5">
|
||||
<a-form-item name="typeId">
|
||||
<template #label><span title="服务类型">服务类型</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.typeId" :orgCode="bkOrgCode"
|
||||
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
|
||||
placeholder="请选择服务类型" allowClear :ignoreDisabled="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="5">
|
||||
<a-form-item name="directiveName">
|
||||
<template #label><span title="服务指令">服务指令</span></template>
|
||||
<JInput v-model:value="queryParam.directiveName" placeholder="请输入服务指令名称" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="4" :lg="4" :md="4" :sm="4">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||
style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<DirectiveBkItemModal ref="registerModal" @success="handleSuccess"></DirectiveBkItemModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="directivebk-directiveBkItem" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './DirectiveBkItem.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DirectiveBkItem.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import DirectiveBkItemModal from './components/DirectiveBkItemModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const props = defineProps({
|
||||
bkOrgCode: '',
|
||||
pkid: '',
|
||||
});
|
||||
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,
|
||||
scroll: { y: '58vh' },
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 15,
|
||||
pageSizeOptions: ['15', '50', '70', '100'],
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
queryParam.pkid = props.pkid
|
||||
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: 5,
|
||||
xxl: 5
|
||||
});
|
||||
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) {
|
||||
createMessage.warning('功能建设中~')
|
||||
// registerModal.value.disableSubmit = true;
|
||||
// registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
function init() {
|
||||
reload()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
padding-bottom: 14px;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 14px;
|
||||
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: 14px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/directivebk/directiveBkMain/list',
|
||||
save='/directivebk/directiveBkMain/add',
|
||||
edit='/directivebk/directiveBkMain/edit',
|
||||
deleteOne = '/directivebk/directiveBkMain/delete',
|
||||
deleteBatch = '/directivebk/directiveBkMain/deleteBatch',
|
||||
importExcel = '/directivebk/directiveBkMain/importExcel',
|
||||
exportXls = '/directivebk/directiveBkMain/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,33 @@
|
|||
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: 'orgCode'
|
||||
},
|
||||
{
|
||||
title: ' 机构名称',
|
||||
align: "center",
|
||||
dataIndex: 'orgCode_dictText'
|
||||
},
|
||||
{
|
||||
title: '备份时间',
|
||||
align: "center",
|
||||
dataIndex: 'createTime',
|
||||
customRender:({text}) =>{
|
||||
// text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
|
||||
return text;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
orgCode: {title: ' 机构编码',order: 0,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'org_code', dictText: 'depart_name',},
|
||||
createTime: {title: '备份时间',order: 1,view: 'date', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,260 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="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-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)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 详情 -->
|
||||
<a-drawer v-model:visible="bkDetailListOpen" title="详情" width="85vw" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding: '14px', height: '80vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleBkDetailListClose">
|
||||
<template #footer>
|
||||
<a-button @click="handleBkDetailListClose" type="primary">关闭</a-button>
|
||||
</template>
|
||||
<div style="padding:0px 8px;">
|
||||
<DirectiveBkItemList ref="bkDetailListRef" :bkOrgCode="bkOrgCode" :pkid="pkid"></DirectiveBkItemList>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="directivebk-directiveBkMain" setup>
|
||||
import { ref, reactive, nextTick } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './DirectiveBkMain.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl } from './DirectiveBkMain.api';
|
||||
import { getExportUrl } from './DirectiveBkItem.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
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 { cloneDeep } from "lodash-es";
|
||||
import DirectiveBkItemList from './DirectiveBkItemList.vue'
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const bkDetailListOpen = ref(false)
|
||||
const bkDetailListRef = ref()
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const userStore = useUserStore();
|
||||
const bkOrgCode = ref('')
|
||||
const pkid = ref('')
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '指令备份主表',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
scroll: { y: '58vh' },
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 15,
|
||||
pageSizeOptions: ['15', '50', '70', '100'],
|
||||
},
|
||||
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: 4,
|
||||
xl: 5,
|
||||
xxl: 5
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
bkOrgCode.value = record.orgCode
|
||||
pkid.value = record.id
|
||||
bkDetailListOpen.value = true
|
||||
nextTick(() => {
|
||||
bkDetailListRef.value.init()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭详情
|
||||
*/
|
||||
function handleBkDetailListClose() {
|
||||
bkDetailListOpen.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
function exportXls(record) {
|
||||
queryParam.exportPkId = record.id
|
||||
queryParam.createTime_ = record.createTime
|
||||
onExportXls()
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
onClick: exportXls.bind(null, record)
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
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;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
margin-bottom: 14px;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 14px;
|
||||
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: 14px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="DirectiveBkItemForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务指令名称" v-bind="validateInfos.directiveName" id="DirectiveBkItemForm-directiveName" name="directiveName">
|
||||
<a-input v-model:value="formData.directiveName" placeholder="请输入服务指令名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="收费价格" v-bind="validateInfos.tollPrice" id="DirectiveBkItemForm-tollPrice" name="tollPrice">
|
||||
<a-input-number v-model:value="formData.tollPrice" placeholder="请输入收费价格" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="提成价格" v-bind="validateInfos.comPrice" id="DirectiveBkItemForm-comPrice" name="comPrice">
|
||||
<a-input-number v-model:value="formData.comPrice" placeholder="请输入提成价格" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务说明" v-bind="validateInfos.serviceContent" id="DirectiveBkItemForm-serviceContent" name="serviceContent">
|
||||
<a-input v-model:value="formData.serviceContent" placeholder="请输入服务说明" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务时长(分钟)" v-bind="validateInfos.serviceDuration" id="DirectiveBkItemForm-serviceDuration" name="serviceDuration">
|
||||
<a-input v-model:value="formData.serviceDuration" placeholder="请输入服务时长(分钟)" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否启用 0启用 1未启用" v-bind="validateInfos.izEnabled" id="DirectiveBkItemForm-izEnabled" name="izEnabled">
|
||||
<a-input v-model:value="formData.izEnabled" placeholder="请输入是否启用 0启用 1未启用" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="语音文件" v-bind="validateInfos.mp3File" id="DirectiveBkItemForm-mp3File" name="mp3File">
|
||||
<a-input v-model:value="formData.mp3File" placeholder="请输入语音文件" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="视频文件" v-bind="validateInfos.mp4File" id="DirectiveBkItemForm-mp4File" name="mp4File">
|
||||
<a-input v-model:value="formData.mp4File" placeholder="请输入视频文件" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="预览图片" v-bind="validateInfos.previewFile" id="DirectiveBkItemForm-previewFile" name="previewFile">
|
||||
<a-input v-model:value="formData.previewFile" placeholder="请输入预览图片" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="即时指令图片" v-bind="validateInfos.immediateFile" id="DirectiveBkItemForm-immediateFile" name="immediateFile">
|
||||
<a-input v-model:value="formData.immediateFile" placeholder="请输入即时指令图片" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="分类标签中文名称" v-bind="validateInfos.instructionName" id="DirectiveBkItemForm-instructionName" name="instructionName">
|
||||
<a-input v-model:value="formData.instructionName" placeholder="请输入分类标签中文名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类别中文名称" v-bind="validateInfos.categoryName" id="DirectiveBkItemForm-categoryName" name="categoryName">
|
||||
<a-input v-model:value="formData.categoryName" placeholder="请输入服务类别中文名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类型中文名称" v-bind="validateInfos.typeName" id="DirectiveBkItemForm-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.cycleTypeName" id="DirectiveBkItemForm-cycleTypeName" name="cycleTypeName">
|
||||
<a-input v-model:value="formData.cycleTypeName" 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 '../DirectiveBkItem.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: '',
|
||||
directiveName: '',
|
||||
tollPrice: undefined,
|
||||
comPrice: undefined,
|
||||
serviceContent: '',
|
||||
serviceDuration: '',
|
||||
izEnabled: '',
|
||||
mp3File: '',
|
||||
mp4File: '',
|
||||
previewFile: '',
|
||||
immediateFile: '',
|
||||
instructionName: '',
|
||||
categoryName: '',
|
||||
typeName: '',
|
||||
cycleTypeName: '',
|
||||
});
|
||||
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="关闭">
|
||||
<DirectiveBkItemForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DirectiveBkItemForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import DirectiveBkItemForm from './DirectiveBkItemForm.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>
|
||||
|
|
@ -78,9 +78,23 @@
|
|||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" >
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<div v-show="!!sourceOrgName" style="margin-left: 14px;">
|
||||
<span style="font-size:13px;color:#6b7280;">源平台:</span>
|
||||
<span
|
||||
style="padding:4px 8px;border-radius:12px;background:#f8fafc;border:1px solid #e6eef8;font-size:14px;font-weight:500;">
|
||||
{{ sourceOrgName }}
|
||||
</span>
|
||||
<span style="margin:0 6px;color:#9ca3af;">|</span>
|
||||
<span style="font-size:13px;color:#6b7280;">目标平台:</span>
|
||||
<span
|
||||
style="padding:4px 8px;border-radius:12px;background:#f1f5f9;border:1px solid #e6eef8;font-size:14px;font-weight:500;">
|
||||
{{ targetOrgName }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex === 'bodyTagList'">
|
||||
|
|
@ -113,6 +127,8 @@ const queryParam = reactive<any>({});
|
|||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const sourceOrgName = ref()//日志功能进来的-源平台机构名称
|
||||
const targetOrgName = ref()//日志功能进来的-目标平台机构名称
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
|
|
@ -172,7 +188,10 @@ function searchReset() {
|
|||
|
||||
|
||||
function init(record) {
|
||||
queryParam.queryIds = record.queryIds
|
||||
queryParam.dataSourceCode = record.orgCode;
|
||||
sourceOrgName.value = record.sourceOrgName
|
||||
targetOrgName.value = record.targetOrgName
|
||||
reload();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,11 @@
|
|||
style="margin-right: 10px;">日志</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:safety-certificate-twotone" @click="handleDirectiveMainFunc"
|
||||
style="margin-right: 10px;">标准指令库</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:copy-outlined" @click="handleDirectiveBackups"
|
||||
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-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
|
||||
@click="handleLookNewDirectives">新增指令</a-button> -->
|
||||
<!-- </a-badge> -->
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
@ -63,7 +65,7 @@
|
|||
</a-button>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<AsyncListComponent ref="logsRef" :type="'directive'"></AsyncListComponent>
|
||||
<AsyncListComponent ref="logsRef" :type="'directive'" @handleDetail="handleDetail"></AsyncListComponent>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<template #footer>
|
||||
|
|
@ -95,6 +97,17 @@
|
|||
:existDirectiveIds="existDirectiveIds" @refreshExistIds="refreshDMExistedIds"></CanAddDirectiveList>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<!-- 指令备份 -->
|
||||
<a-drawer v-model:visible="directiveBackupsOpen" title="指令备份" width="85vw" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding:'14px', height: '80vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleDirectiveBackupsClose">
|
||||
<template #footer>
|
||||
<a-button @click="handleDirectiveBackupsClose" type="primary">关闭</a-button>
|
||||
</template>
|
||||
<div style="padding:0px 8px;">
|
||||
<DirectiveBkMainList ref="backupsRef"></DirectiveBkMainList>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -117,6 +130,7 @@ import AsyncListComponent from '@/components/dataAsync/AsyncMainList0731.vue'
|
|||
import { getDirectiveMain, changeDirectiveMain } from '/@/api/common/api'
|
||||
import { idListByDS } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.api';
|
||||
import { nextTick } from 'process';
|
||||
import DirectiveBkMainList from '/@/views/services/directivebk/DirectiveBkMainList.vue'
|
||||
|
||||
const { createMessage } = useMessage()
|
||||
const canAddDirectiveRef = ref()
|
||||
|
|
@ -136,6 +150,8 @@ const directiveMainVisible = ref(false)
|
|||
const { createConfirm } = useMessage();
|
||||
const existDirectiveIds = ref([])//指令库已存在指令id
|
||||
const directiveMainOrgInfo = ref()
|
||||
const directiveBackupsOpen = ref(false)
|
||||
const backupsRef = ref()//指令备份
|
||||
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
|
|
@ -251,6 +267,20 @@ function refreshDMExistedIds(dmOrgInfo, izReset = false, izQuery = true) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看指令备份
|
||||
*/
|
||||
function handleDirectiveBackups() {
|
||||
directiveBackupsOpen.value = true
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭指令备份
|
||||
*/
|
||||
function handleDirectiveBackupsClose() {
|
||||
directiveBackupsOpen.value = false
|
||||
}
|
||||
|
||||
watch(directiveMainOrgInfo, (newValue, oldValue) => {
|
||||
refreshDMExistedIds(newValue)
|
||||
}, { deep: true })
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<a-card class="top">
|
||||
<div class="source-platform">
|
||||
<span class="section-title">源平台</span>
|
||||
<a-button type="link" @click="showSourceOrgListModal" size="small">请选择</a-button>
|
||||
<!-- <a-button type="link" @click="showSourceOrgListModal" size="small">请选择</a-button> -->
|
||||
</div>
|
||||
<div class="selected-orgs" v-if="!!orgInfo.length">
|
||||
<a-card :headStyle="{ height: '60px', padding: '0 24px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
<a-radio-button value="multi">批量</a-radio-button>
|
||||
</a-radio-group>
|
||||
<a-divider type="vertical" style="background-color: #CDCDCF" />
|
||||
<a-button type="link" @click="showTargetOrgListModal" size="small">请选择</a-button>
|
||||
<a-button type="link" @click="showTargetOrgListModal" size="small" :disabled="initLoading">请选择</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="selected-orgs" ref="selectedOrgsContainer" style="height: 46vh; overflow: auto;"
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
:showChoose="true" />
|
||||
</a-modal>
|
||||
<a-modal v-model:visible="targetOrgListVisible" title="请选择目标平台(复选)" width="90vw" @cancel="handleCancelTarget"
|
||||
:bodyStyle="{ padding: '14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }">
|
||||
:bodyStyle="{ padding: '14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelTarget" type="primary">取消</a-button>
|
||||
<a-button @click="handleGetTarget" type="primary">确认</a-button>
|
||||
|
|
@ -104,10 +104,14 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, watch } from 'vue';
|
||||
import { ref, nextTick, watch, onMounted } from 'vue';
|
||||
import OrgListCom from '/@/views/synchronization/directive/orgCom/OrgListCom.vue';
|
||||
import DirectiveChooseCom from '/@/views/synchronization/directive/serviceDirective/DirectiveChooseCom.vue'
|
||||
import { getDirectiveMain } from '/@/api/common/api'
|
||||
import { getOrgInfo } from '/@/views/admin/orgapplyinfo/OrgApplyInfo.api'
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const sourceOrgListVisible = ref(false);
|
||||
const targetOrgListVisible = ref(false);
|
||||
const sourceOrgListComRef = ref();
|
||||
|
|
@ -119,6 +123,7 @@ const selectedTargetOrgs = ref([])//已选择目标平台
|
|||
const targetChooseType = ref('one')
|
||||
const selectedOrgsContainer = ref<HTMLElement>();
|
||||
const emit = defineEmits(['changeSyncText']);
|
||||
const initLoading = ref(false)
|
||||
|
||||
// 显示机构列表弹窗
|
||||
function showSourceOrgListModal() {
|
||||
|
|
@ -266,6 +271,19 @@ defineExpose({
|
|||
syncFunc
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
initLoading.value = true
|
||||
orgInfo.value = []
|
||||
let dmInfo_ = await getDirectiveMain()
|
||||
let dmAllInfo_ = await getOrgInfo({ orgCode: dmInfo_.orgCode })
|
||||
if (!dmAllInfo_.records[0]) {
|
||||
createMessage.error('请先设置标准指令库!')
|
||||
} else {
|
||||
orgInfo.value.push(dmAllInfo_.records[0])
|
||||
initLoading.value = false
|
||||
handleSourceOrgChoose(dmAllInfo_.records)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ function init(record: any) {
|
|||
title.value = '镜像';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value?.init(record);
|
||||
// registerForm.value?.init(record);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@ export const columns: BasicColumn[] = [
|
|||
// dataIndex: 'pic',
|
||||
// customRender: render.renderImage,
|
||||
// },
|
||||
{
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
dataIndex: 'sort',
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// align: 'center',
|
||||
// dataIndex: 'sort',
|
||||
// },
|
||||
{
|
||||
title: '是否启用',
|
||||
align: 'center',
|
||||
|
|
@ -54,11 +54,11 @@ export const columnsNoMedia: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'price',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
dataIndex: 'sort',
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// align: 'center',
|
||||
// dataIndex: 'sort',
|
||||
// },
|
||||
{
|
||||
title: '是否启用',
|
||||
align: 'center',
|
||||
|
|
@ -89,11 +89,11 @@ export const sourceColumns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'price',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
dataIndex: 'sort',
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// align: 'center',
|
||||
// dataIndex: 'sort',
|
||||
// },
|
||||
{
|
||||
title: '是否启用',
|
||||
align: 'center',
|
||||
|
|
@ -117,11 +117,11 @@ export const targetSourceColumns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'price',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
dataIndex: 'sort',
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// align: 'center',
|
||||
// dataIndex: 'sort',
|
||||
// },
|
||||
{
|
||||
title: '是否启用',
|
||||
align: 'center',
|
||||
|
|
@ -145,11 +145,11 @@ export const targetColumns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'price',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
dataIndex: 'sort',
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// align: 'center',
|
||||
// dataIndex: 'sort',
|
||||
// },
|
||||
{
|
||||
title: '是否启用',
|
||||
align: 'center',
|
||||
|
|
|
|||
|
|
@ -94,10 +94,10 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
defSort: {
|
||||
column: 'sort',
|
||||
order: 'asc',
|
||||
},
|
||||
// defSort: {
|
||||
// column: 'sort',
|
||||
// order: 'asc',
|
||||
// },
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@
|
|||
<JImageUpload :fileMax="1" v-model:value="formData.pic"></JImageUpload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<!-- <a-col :span="24">
|
||||
<a-form-item label="排序" v-bind="validateInfos.sort" id="ElderTagForm-sort" name="sort">
|
||||
<a-input-number v-model:value="formData.sort" placeholder="请输入排序" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-col> -->
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ElderTagForm-izEnabled" name="izEnabled">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
<a-button type="primary" preIcon="ant-design:safety-certificate-twotone" @click="handleElderTagMainFunc"
|
||||
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-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
|
||||
@click="handleLookNewDirectives">新增标签</a-button> -->
|
||||
<!-- </a-badge> -->
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<a-card class="top">
|
||||
<div class="source-platform">
|
||||
<span class="section-title">源平台</span>
|
||||
<a-button type="link" @click="showSourceOrgListModal" size="small">请选择</a-button>
|
||||
<!-- <a-button type="link" @click="showSourceOrgListModal" size="small">请选择</a-button> -->
|
||||
</div>
|
||||
<div class="selected-orgs" v-if="!!orgInfo.length">
|
||||
<a-card :headStyle="{ height: '60px', padding: '0 24px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
<a-radio-button value="multi">批量</a-radio-button>
|
||||
</a-radio-group>
|
||||
<a-divider type="vertical" style="background-color: #CDCDCF" />
|
||||
<a-button type="link" @click="showTargetOrgListModal" size="small">请选择</a-button>
|
||||
<a-button type="link" @click="showTargetOrgListModal" size="small" :disabled="initLoading">请选择</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="selected-orgs" ref="selectedOrgsContainer" style="height: 46vh; overflow: auto;"
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
:showChoose="true" />
|
||||
</a-modal>
|
||||
<a-modal v-model:visible="targetOrgListVisible" title="请选择目标平台(复选)" width="90vw" @cancel="handleCancelTarget"
|
||||
:bodyStyle="{ padding: '14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }">
|
||||
:bodyStyle="{ padding: '14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelTarget" type="primary">取消</a-button>
|
||||
<a-button @click="handleGetTarget" type="primary">确认</a-button>
|
||||
|
|
@ -104,10 +104,14 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, watch } from 'vue';
|
||||
import { ref, nextTick, watch, onMounted } from 'vue';
|
||||
import OrgListCom from '/@/views/synchronization/eldertag/orgCom/OrgListCom.vue';
|
||||
import ElderTagChooseCom from './ElderTagChooseCom.vue'
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getElderTagMain } from '/@/api/common/api'
|
||||
import { getOrgInfo } from '/@/views/admin/orgapplyinfo/OrgApplyInfo.api'
|
||||
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const sourceOrgListVisible = ref(false);
|
||||
const targetOrgListVisible = ref(false);
|
||||
const sourceOrgListComRef = ref();
|
||||
|
|
@ -119,6 +123,7 @@ const selectedTargetOrgs = ref([])//已选择目标平台
|
|||
const targetChooseType = ref('one')
|
||||
const selectedOrgsContainer = ref<HTMLElement>();
|
||||
const emit = defineEmits(['changeSyncText']);
|
||||
const initLoading = ref(false)
|
||||
|
||||
// 显示机构列表弹窗
|
||||
function showSourceOrgListModal() {
|
||||
|
|
@ -266,6 +271,19 @@ defineExpose({
|
|||
syncFunc
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
initLoading.value = true
|
||||
orgInfo.value = []
|
||||
let etmInfo_ = await getElderTagMain()
|
||||
let etmAllInfo_ = await getOrgInfo({ orgCode: etmInfo_.orgCode })
|
||||
if (!etmAllInfo_.records[0]) {
|
||||
createMessage.error('请先设置标准标签库!')
|
||||
} else {
|
||||
orgInfo.value.push(etmAllInfo_.records[0])
|
||||
initLoading.value = false
|
||||
handleSourceOrgChoose(etmAllInfo_.records)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
|||
Loading…
Reference in New Issue