长者标签改版
This commit is contained in:
parent
786b7a5ae1
commit
5c3300d9f8
|
|
@ -0,0 +1,105 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/elder/elderTag/list',
|
||||
save='/elder/elderTag/add',
|
||||
edit='/elder/elderTag/edit',
|
||||
deleteOne = '/elder/elderTag/delete',
|
||||
deleteBatch = '/elder/elderTag/deleteBatch',
|
||||
importExcel = '/elder/elderTag/importExcel',
|
||||
exportXls = '/elder/elderTag/exportXls',
|
||||
listByDS = '/elder/elderTag/listByDS',
|
||||
idListByDS = '/elder/elderTag/idListByDS',
|
||||
syncElderTag = '/elder/elderTag/syncElderTag',
|
||||
compareList = '/elder/elderTag/compareList',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出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
|
||||
*/
|
||||
export const listByDS = (params) => defHttp.get({ url: Api.listByDS, params });
|
||||
|
||||
/**
|
||||
*
|
||||
* @param params 获取对应机构已有长者标签id
|
||||
* @returns
|
||||
*/
|
||||
export const idListByDS = (params) => defHttp.get({ url: Api.idListByDS, params });
|
||||
|
||||
/**
|
||||
* 同步
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const syncElderTag = (dataSourceCode: string, params: any) => {
|
||||
return defHttp.post({ url: `${Api.syncElderTag}?sourceOrgCode=${encodeURIComponent(dataSourceCode)}`, params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 差异数据对比
|
||||
* @param params compareOrgCode
|
||||
* @returns
|
||||
*/
|
||||
export const compareList = (params) => defHttp.get({ url: Api.compareList, params });
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
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_dictText',
|
||||
},
|
||||
{
|
||||
title: '标签名称',
|
||||
align: 'center',
|
||||
dataIndex: 'tagName',
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
align: 'center',
|
||||
dataIndex: 'describ',
|
||||
},
|
||||
{
|
||||
title: '价格(元)',
|
||||
align: 'center',
|
||||
dataIndex: 'price',
|
||||
},
|
||||
{
|
||||
title: '默认图标',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
customRender: ({ text, record }) => {
|
||||
// 如果 text 为空或 null/undefined,使用默认图片
|
||||
const imageUrl = text
|
||||
? opeMediaAddress + text
|
||||
: record.type == 'tx'
|
||||
? opeMediaAddress + import.meta.env.VITE_DEFAULT_ELDER_TAG_BODY_PIC
|
||||
: opeMediaAddress + import.meta.env.VITE_DEFAULT_ELDER_TAG_EMO_PIC;
|
||||
return render.renderImage({ text: imageUrl });
|
||||
},
|
||||
// customRender: render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '焦点图标',
|
||||
align: 'center',
|
||||
dataIndex: 'picFocus',
|
||||
customRender: ({ text, record }) => {
|
||||
// 如果 text 为空或 null/undefined,使用默认图片
|
||||
const imageUrl = text
|
||||
? opeMediaAddress + text
|
||||
: record.type == 'tx'
|
||||
? opeMediaAddress + import.meta.env.VITE_DEFAULT_ELDER_TAG_BODY_PIC
|
||||
: opeMediaAddress + import.meta.env.VITE_DEFAULT_ELDER_TAG_EMO_PIC;
|
||||
return render.renderImage({ text: imageUrl });
|
||||
},
|
||||
// customRender: render.renderImage,
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// align: 'center',
|
||||
// dataIndex: 'sort',
|
||||
// },
|
||||
{
|
||||
title: '是否启用',
|
||||
align: 'center',
|
||||
dataIndex: 'izEnabled_dictText',
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
type: { title: '标签类型', order: 0, view: 'text', type: 'string' },
|
||||
tagName: { title: '标签名称', order: 1, view: 'text', type: 'string' },
|
||||
price: { title: '价格', order: 2, view: 'number', type: 'number' },
|
||||
/* pic: { title: '图标', order: 3, view: 'text', type: 'string' },*/
|
||||
sort: { title: '排序', order: 4, view: 'number', type: 'number' },
|
||||
izEnabled: { title: '是否启用', order: 5, view: 'text', type: 'string' },
|
||||
};
|
||||
|
|
@ -0,0 +1,414 @@
|
|||
<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="type">
|
||||
<template #label><span title="标签类型">标签类型</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.type" dictCode="elder_tag_type" placeholder="请选择标签类型"
|
||||
allowClear :ignoreDisabled="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="tagName">
|
||||
<template #label><span title="标签名称">标签名称</span></template>
|
||||
<JInput v-model:value="queryParam.tagName" placeholder="请输入标签名称" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="izEnabled">
|
||||
<template #label><span title="是否启用">是否启用</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择是否启用" v-model:value="queryParam.izEnabled"
|
||||
dictCode="iz_enabled" 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>
|
||||
<a-button type="primary" v-auth="'eldertag:nu_elder_tag:add'" @click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<!-- <a-button type="primary" @click="handleEditMain" preIcon="ant-design:setting-outlined"> 标签管理</a-button>
|
||||
<a-button type="primary" @click="handleEditRep" preIcon="ant-design:plus-outlined"> 引用</a-button> -->
|
||||
<a-button type="primary" class="btnPrivate" @click="handleDirectiveMainOpen" v-show="isShowETM"
|
||||
preIcon="ant-design:profile-outlined">标准标签库</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:eye-outlined" v-show="ownOrgCode == mainOrgCode"
|
||||
@click="handleCompare">差异比对</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
|
||||
v-show="ownOrgCode == mainOrgCode" @click="handleLookNewDirectives">差异标签</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagModal ref="registerModal" @success="handleSuccess"
|
||||
:isMain="!!mainOrgCode && !!ownOrgCode && mainOrgCode == ownOrgCode"></ElderTagModal>
|
||||
|
||||
<!-- 标签管理 -->
|
||||
<!-- <a-drawer title="标签管理" width="80vw" :open="tagMainManagOpen" @close="onTagMainManagClose"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onTagMainManagClose" style="margin-right: 10px;">关闭</a-button>
|
||||
</template>
|
||||
<ElderTagMainList ref="tagMainManagRef"> </ElderTagMainList>
|
||||
</a-drawer> -->
|
||||
|
||||
<!-- 引用 -->
|
||||
<!-- <a-drawer title="引用" width="80vw" :open="tagMainRepOpen" @close="onTagMainRepClose"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onTagMainRepClose" style="margin-right: 10px;">关闭</a-button>
|
||||
<a-button type="primary" @click="onTagMainRepUse" style="margin-right: 10px;">引用</a-button>
|
||||
</template>
|
||||
<ElderTagMainRes ref="tagMainRepRef"> </ElderTagMainRes>
|
||||
</a-drawer> -->
|
||||
|
||||
<!-- 差异标签 -->
|
||||
<a-drawer v-model:visible="newElderTagVisible" title="差异标签" width="1200" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding: '14px', 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 style="padding:0px 8px;">
|
||||
<CanAddElderTagList ref="canAddElderTagRef" :elderTagMainOrgInfo="elderTagMainOrgInfo" :existETIds="existETIds"
|
||||
@refreshExistIds="refreshDMExistedIds"></CanAddElderTagList>
|
||||
</div>
|
||||
</a-drawer>
|
||||
|
||||
<!-- 差异比对 -->
|
||||
<a-drawer title="差异比对" width="1200" :open="compareListOpen" @close="onCompareListClose"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '0px' }">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onCompareListClose" style="margin-right: 10px;">关闭</a-button>
|
||||
</template>
|
||||
<CompareElderTagList ref="compareListRef" v-if="compareListOpen" :ownOrgCode="ownOrgCode"
|
||||
:ownOrgName="ownOrgName">
|
||||
</CompareElderTagList>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="eldertag-elderTag" setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ElderTag.data';
|
||||
import { list, idListByDS, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ElderTag.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ElderTagModal from './components/ElderTagModal.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 { queryByKey } from '/@/views/admin/sysconfig/SysConfig.api'
|
||||
import { getOrgInfo } from '@/api/common/api'
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import CanAddElderTagList from '/@/views/elder/canaddet/CanAddElderTagList.vue'
|
||||
import CompareElderTagList from './components/CompareElderTagList.vue'
|
||||
import ElderTagMainList from '/@/views/elder/eldertagmain/ElderTagMainList.vue'
|
||||
import ElderTagMainRes from '/@/views/elder/eldertagmain/ElderTagMainRes.vue'
|
||||
|
||||
const tagMainManagOpen = ref(false)
|
||||
const tagMainManagRef = ref()
|
||||
const tagMainRepOpen = ref(false)
|
||||
const tagMainRepRef = ref()
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const isShowETM = ref(false)//是否展示标签库功能
|
||||
const mainOrgCode = ref()//标准标签库编码
|
||||
const canAddElderTagRef = ref()
|
||||
const newElderTagVisible = ref(false)
|
||||
const existETIds = ref([])//指令库已存在指令id
|
||||
const ownOrgCode = ref('') //本机构编码
|
||||
const ownOrgName = ref('') //本机构名称
|
||||
const elderTagMainOrgInfo = ref()
|
||||
const compareListRef = ref()
|
||||
const compareListOpen = ref(false)
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '长者标签',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
// defSort: {
|
||||
// column: 'sort',
|
||||
// order: 'asc',
|
||||
// },
|
||||
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.opeType = 'add';
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.opeType = 'edit';
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.opeType = 'look';
|
||||
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: 'eldertag:nu_elder_tag:edit'
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看指令库
|
||||
*/
|
||||
function handleDirectiveMainOpen() {
|
||||
registerModal.value?.openETM(mainOrgCode.value)
|
||||
}
|
||||
|
||||
async function getElderTagMainOrgCode() {
|
||||
let { orgCode, orgName } = await getOrgInfo()
|
||||
ownOrgCode.value = orgCode
|
||||
ownOrgName.value = orgName
|
||||
let { configValue } = await queryByKey({ key: 'elder_tag_main_org_code' })
|
||||
mainOrgCode.value = configValue
|
||||
if (orgCode != configValue) isShowETM.value = true
|
||||
}
|
||||
|
||||
//刷新已有指令库
|
||||
async function refreshDMExistedIds(dmOrgInfo, izReset = false, izQuery = true) {
|
||||
let res = await idListByDS({ dataSourceCode: 'master' })
|
||||
existETIds.value = res.records
|
||||
if (izReset) {
|
||||
canAddElderTagRef.value?.searchReset()
|
||||
} else {
|
||||
canAddElderTagRef.value?.reload()
|
||||
}
|
||||
}
|
||||
|
||||
async function handleLookNewDirectives() {
|
||||
await refreshDMExistedIds(elderTagMainOrgInfo.value, true)
|
||||
newElderTagVisible.value = true
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭新增指令
|
||||
*/
|
||||
function handleCancelNewElderTag() {
|
||||
newElderTagVisible.value = false
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 差异比对
|
||||
*/
|
||||
function handleCompare() {
|
||||
compareListOpen.value = true
|
||||
}
|
||||
|
||||
function onCompareListClose() {
|
||||
compareListOpen.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签管理关闭
|
||||
*/
|
||||
function onTagMainManagClose() {
|
||||
tagMainManagOpen.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签管理打开
|
||||
*/
|
||||
function handleEditMain() {
|
||||
tagMainManagOpen.value = true
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签管理仓库关闭
|
||||
*/
|
||||
function onTagMainRepClose() {
|
||||
tagMainRepOpen.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 引用
|
||||
*/
|
||||
function onTagMainRepUse() {
|
||||
tagMainRepRef.value.useAll()
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签管理仓库打开
|
||||
*/
|
||||
function handleEditRep() {
|
||||
tagMainRepOpen.value = true
|
||||
}
|
||||
|
||||
// 添加音频结束监听
|
||||
onMounted(() => {
|
||||
getElderTagMainOrgCode()
|
||||
});
|
||||
|
||||
</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,319 @@
|
|||
<template>
|
||||
<div class="compare-table-wrap">
|
||||
<div style="margin-bottom: 14px;width: 100%;">
|
||||
<a-button type="primary" style="float: left;" @click="showTargetOrgListModal"
|
||||
:disabled="loading">目标机构</a-button>
|
||||
</div>
|
||||
|
||||
<a-table :columns="headChildColumns" :data-source="rows" bordered size="middle" :scroll="{ y: 640 }"
|
||||
:pagination="false">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.dataIndex === 'ownOrgName'">
|
||||
{{ ownOrgName }}
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'ownExist'">
|
||||
<div class="org-badge">
|
||||
<svg v-if="text" class="icon check" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M20.285 6.709l-11.39 11.39-5.18-5.18 1.414-1.414 3.766 3.766 9.976-9.976z" />
|
||||
</svg>
|
||||
<svg v-else class="icon cross" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
d="M18.3 5.71L12 12.01 5.7 5.71 4.29 7.12 10.59 13.42 4.29 19.72 5.7 21.13 12 14.83 18.3 21.13 19.71 19.72 13.41 13.42 19.71 7.12z" />
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'own2OrgName'">
|
||||
{{ targetOrgInfo.comName }}
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'targetExist'">
|
||||
<div class="org-badge">
|
||||
<svg v-if="text" class="icon check" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M20.285 6.709l-11.39 11.39-5.18-5.18 1.414-1.414 3.766 3.766 9.976-9.976z" />
|
||||
</svg>
|
||||
<svg v-else class="icon cross" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
d="M18.3 5.71L12 12.01 5.7 5.71 4.29 7.12 10.59 13.42 4.29 19.72 5.7 21.13 12 14.83 18.3 21.13 19.71 19.72 13.41 13.42 19.71 7.12z" />
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
</div>
|
||||
|
||||
<a-drawer v-model:visible="targetOrgListVisible" title="请选择目标机构" width="90vw" @cancel="handleCancelTarget"
|
||||
:bodyStyle="{ padding: '14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
:footer-style="{ textAlign: 'right' }">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelTarget" type="primary" style="margin-right: 10px;">取消</a-button>
|
||||
<a-button @click="handleGetTarget" type="primary">确认</a-button>
|
||||
</template>
|
||||
<OrgListCom class="step-content" ref="targetOrgListComRef" @handleOrgChoose="handleTargetOrgChoose"
|
||||
:showChoose="true" :showDirectiveChoose="true" :pageSize="-1" :excludeOrgCode="ownOrgCode" />
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { compareList } from '../ElderTag.api';
|
||||
import { headChildColumns } from './ElderTag.data';
|
||||
import OrgListCom from '/@/views/orgcom/OrgListCom.vue';
|
||||
|
||||
const props = defineProps({
|
||||
ownOrgCode: '',//本机构编码
|
||||
ownOrgName: '',//本机构名称
|
||||
});
|
||||
const targetOrgInfo = ref('')//目标机构信息
|
||||
|
||||
|
||||
|
||||
type Row = {
|
||||
id?: string;
|
||||
instructionName?: string;
|
||||
categoryName?: string;
|
||||
typeName?: string;
|
||||
directiveName?: string;
|
||||
cycleTypeName?: string;
|
||||
ownExist?: boolean;
|
||||
targetExist?: boolean;
|
||||
};
|
||||
|
||||
const rows = ref<Row[]>([]);
|
||||
const loading = ref(false);
|
||||
const targetOrgListVisible = ref(false);
|
||||
const targetOrgListComRef = ref();
|
||||
|
||||
function rank(it: Row) {
|
||||
if (it.ownExist && it.targetExist) return 'both';
|
||||
if (it.ownExist) return 'own-only';
|
||||
return 'target-only';
|
||||
}
|
||||
|
||||
function handleCancelTarget() {
|
||||
targetOrgListVisible.value = false;
|
||||
targetOrgListComRef.value?.resetSeleted?.([]);
|
||||
}
|
||||
|
||||
function showTargetOrgListModal() {
|
||||
targetOrgListComRef.value?.reload?.()
|
||||
targetOrgListVisible.value = true;
|
||||
}
|
||||
|
||||
function handleGetTarget() {
|
||||
if (!targetOrgInfo.value) {
|
||||
targetOrgListVisible.value = false;
|
||||
return;
|
||||
}
|
||||
initData()
|
||||
handleCancelTarget()
|
||||
}
|
||||
|
||||
function handleTargetOrgChoose(orgInfo_: any) {
|
||||
targetOrgInfo.value = orgInfo_
|
||||
}
|
||||
|
||||
async function initData() {
|
||||
loading.value = true;
|
||||
rows.value = [];
|
||||
try {
|
||||
let res = await compareList({ compareOrgCode: targetOrgInfo.value.orgCode })
|
||||
if (Array.isArray(res)) rows.value = res;
|
||||
else if (res && Array.isArray(res.result)) rows.value = res.result;
|
||||
else if (res && Array.isArray(res.list)) rows.value = res.list;
|
||||
else if (res && Array.isArray(res.data)) rows.value = res.data;
|
||||
else rows.value = res || [];
|
||||
} catch (e) {
|
||||
rows.value = [];
|
||||
console.error('compareList error', e);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.compare-table-wrap {
|
||||
padding: 16px;
|
||||
background: #f6f8fb;
|
||||
font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.table-card {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #e6eef8;
|
||||
box-shadow: 0 6px 18px rgba(2, 6, 23, 0.04);
|
||||
}
|
||||
|
||||
.thead {
|
||||
background: linear-gradient(180deg, #fbfdff, #ffffff);
|
||||
border-bottom: 1px solid #e6eef8;
|
||||
}
|
||||
|
||||
.thead-top,
|
||||
.thead-sub,
|
||||
.tr {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
}
|
||||
|
||||
.thead-top {
|
||||
grid-template-columns: 1fr 1fr 1fr 2fr 1fr 2fr 1fr 2fr 1fr;
|
||||
padding: 12px 14px 0px 14px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.thead-sub {
|
||||
grid-template-columns: 1fr 1fr 1fr 2fr 1fr 2fr 1fr 2fr 1fr;
|
||||
padding: 0px 14px 8px 14px;
|
||||
// border-bottom: 1px solid #e6eef8;
|
||||
color: #374151;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.th {
|
||||
padding: 6px 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tbody {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tr {
|
||||
grid-template-columns: 1fr 1fr 1fr 2fr 1fr 2fr 1fr 2fr 1fr;
|
||||
padding: 12px 14px;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #eef6fb;
|
||||
}
|
||||
|
||||
.tr:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.td {
|
||||
padding: 6px 4px;
|
||||
font-size: 14px;
|
||||
color: #111827;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.td-org-name {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.td-org-exist {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.org-badge {
|
||||
// width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fbfdff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.icon.check {
|
||||
color: #10b981;
|
||||
}
|
||||
|
||||
.icon.cross {
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
.status {
|
||||
padding: 14px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
color: #6b7280;
|
||||
text-align: center;
|
||||
box-shadow: 0 6px 14px rgba(2, 6, 23, 0.03);
|
||||
margin-top: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.body-div {
|
||||
height: 65vh;
|
||||
overflow-y: scroll;
|
||||
// scrollbar-width: none;
|
||||
// -ms-overflow-style: none;
|
||||
}
|
||||
|
||||
// .body-div::-webkit-scrollbar {
|
||||
// width: 0;
|
||||
// height: 0;
|
||||
// background: transparent;
|
||||
// }
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
|
||||
.thead-top,
|
||||
.thead-sub,
|
||||
.tr {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 80px 80px 80px;
|
||||
}
|
||||
|
||||
.td-name,
|
||||
.th.th-name {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.thead {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tr {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.td {
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.center {
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.step-content {
|
||||
// overflow: auto;
|
||||
height: 70vh;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
import { BasicColumn } from '/@/components/Table';
|
||||
import { FormSchema } from '/@/components/Table';
|
||||
import { rules } from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '标签类型',
|
||||
align: 'center',
|
||||
dataIndex: 'type_dictText',
|
||||
},
|
||||
{
|
||||
title: '标签名称',
|
||||
align: 'center',
|
||||
dataIndex: 'tagName',
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
align: 'center',
|
||||
dataIndex: 'describ',
|
||||
},
|
||||
{
|
||||
title: '价格(元)',
|
||||
align: 'center',
|
||||
dataIndex: 'price',
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// align: 'center',
|
||||
// dataIndex: 'sort',
|
||||
// },
|
||||
{
|
||||
title: '是否启用',
|
||||
align: 'center',
|
||||
dataIndex: 'izEnabled_dictText',
|
||||
},
|
||||
];
|
||||
|
||||
//列表数据
|
||||
export const headChildColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '基础信息',
|
||||
children: [
|
||||
{
|
||||
title: '标签类型',
|
||||
align: 'center',
|
||||
dataIndex: 'type',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '标签名称',
|
||||
align: 'center',
|
||||
dataIndex: 'tagName',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
align: 'center',
|
||||
dataIndex: 'describ',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '价格(元)',
|
||||
align: 'center',
|
||||
dataIndex: 'price',
|
||||
ellipsis: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '源机构',
|
||||
children: [
|
||||
{
|
||||
title: '名称',
|
||||
align: 'center',
|
||||
dataIndex: 'ownOrgName',
|
||||
ellipsis: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '是否存在',
|
||||
align: 'center',
|
||||
dataIndex: 'ownExist',
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '目标机构',
|
||||
children: [
|
||||
{
|
||||
title: '名称',
|
||||
align: 'center',
|
||||
dataIndex: 'own2OrgName',
|
||||
ellipsis: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '是否存在',
|
||||
align: 'center',
|
||||
dataIndex: 'targetExist',
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
type: { title: '标签类型', order: 0, view: 'text', type: 'string' },
|
||||
tagName: { title: '标签名称', order: 1, view: 'text', type: 'string' },
|
||||
price: { title: '价格', order: 2, view: 'number', type: 'number' },
|
||||
pic: { title: '图标', order: 3, view: 'text', type: 'string' },
|
||||
sort: { title: '排序', order: 4, view: 'number', type: 'number' },
|
||||
izEnabled: { title: '是否启用', order: 5, view: 'text', type: 'string' },
|
||||
};
|
||||
|
|
@ -0,0 +1,308 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ElderTagForm">
|
||||
<a-row class="card-class">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签类型" v-bind="validateInfos.type" id="ElderTagForm-type" name="type">
|
||||
<j-dict-select-tag v-model:value="formData.type" dictCode="elder_tag_type" placeholder="请选择标签类型"
|
||||
allowClear :disabled="!!formData.id" @change="handleTypeChanged" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签名称" v-bind="validateInfos.tagName" id="ElderTagForm-tagName" name="tagName">
|
||||
<a-input v-model:value="formData.tagName" placeholder="请输入标签名称" allow-clear :disabled="!!formData.id"
|
||||
:maxlength="10" :showCount="true"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="说明" v-bind="validateInfos.describ" id="ElderTagForm-tagName" name="tagName">
|
||||
<a-textarea v-model:value="formData.describ" placeholder="请输入说明" :maxlength="200" :rows="3"
|
||||
:autosize="{ minRows: 3 }" :showCount="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="价格(元)" v-bind="validateInfos.price" id="ElderTagForm-price" name="price">
|
||||
<a-input-number v-model:value="formData.price" placeholder="请输入价格" style="width: 100%" :min="0"
|
||||
:max="99.99" :precision="2" @keydown="onPriceKeydown" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<span style="margin-left:155px;">
|
||||
<a-button v-if="!disabled" @click="handleElderTag">选择图标</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
<a-col :span="12" style="margin-top: 10px;">
|
||||
<a-form-item label="默认图标" v-bind="validateInfos.pic" id="ElderTagForm-pic" name="pic" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<!-- <JImageUploadToOpe :toOpe="true" :bizPath="upBizPrefix + '/zzxx/zzbq'" :fileMax="1"
|
||||
v-model:value="formData.pic" :disabled="true" >
|
||||
</JImageUploadToOpe> -->
|
||||
<img :width="50" :height="50" :src="opeMediaAddress+formData.pic" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" style="margin-top: 10px;">
|
||||
<a-form-item label="焦点图标" v-bind="validateInfos.picFocus" id="ElderTagForm-picFocus" name="picFocus" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<!-- <JImageUploadToOpe :toOpe="true" :bizPath="upBizPrefix + '/zzxx/zzbq'" :fileMax="1"
|
||||
v-model:value="formData.picFocus" :disabled="true" >
|
||||
</JImageUploadToOpe> -->
|
||||
<img :width="50" :height="50" :src="opeMediaAddress+formData.picFocus" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <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 :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"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
<NuResourcesManagementListModal ref="elderTagModal" @ok="handleElderTagOk"></NuResourcesManagementListModal>
|
||||
</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 '../ElderTag.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import JImageUploadToOpe from '/@/components/Form/src/jeecg/components/JImageUploadToOpe.vue';
|
||||
import NuResourcesManagementListModal from '/@/views/admin/resourcesManagement/NuResourcesManagementListModal.vue';
|
||||
import { queryUpBizPrefix } from '/@/api/common/api'
|
||||
|
||||
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 },
|
||||
mediaApiAddress: '',//指令资源请求地址
|
||||
opeType: 'look',
|
||||
isMain: false,//是否主指令库
|
||||
});
|
||||
const dmlookVal = ref('')
|
||||
const elderTagModal = ref();
|
||||
const defaultBodyPic = import.meta.env.VITE_DEFAULT_ELDER_TAG_BODY_PIC
|
||||
const defaultEmoPic = import.meta.env.VITE_DEFAULT_ELDER_TAG_EMO_PIC
|
||||
const upBizPrefix = ref('')
|
||||
const onPriceKeydown = (e: KeyboardEvent) => {
|
||||
const key = e.key;
|
||||
// 放行控制键
|
||||
if (['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab'].includes(key)) return;
|
||||
// 只能输数字和点
|
||||
if (!/[\d.]/.test(key)) {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
const input = e.target as HTMLInputElement;
|
||||
const { value, selectionStart: s, selectionEnd: t } = input;
|
||||
const next = value.slice(0, s!) + key + value.slice(t!);
|
||||
// 整数最多2位,小数最多2位
|
||||
if (!/^\d{0,2}(?:\.\d{0,2})?$/.test(next)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
type: 'tx',
|
||||
tagName: '',
|
||||
price: 0,
|
||||
pic: defaultBodyPic,
|
||||
picFocus: defaultEmoPic,
|
||||
sort: 99,
|
||||
izEnabled: 'Y',
|
||||
describ: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 10 } });
|
||||
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 14 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
type: [{ required: true, message: '请输入标签类型!' },],
|
||||
tagName: [{ required: true, message: '请输入标签名称!' },],
|
||||
price: [{ required: true, message: '请输入价格!' }, { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!' },],
|
||||
izEnabled: [{ required: true, message: '请输入是否启用!' },],
|
||||
});
|
||||
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);
|
||||
// if (props.opeType == 'dmlook') {
|
||||
// if (!!formData.pic) {
|
||||
// dmlookVal.value = props.mediaApiAddress + formData.pic
|
||||
// } else {
|
||||
// if (formData.type == 'qx') {
|
||||
// dmlookVal.value = defaultEmoPic
|
||||
// } else {
|
||||
// dmlookVal.value = defaultBodyPic
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
if (!formData.pic) {
|
||||
if (formData.type == 'qx') {
|
||||
formData.pic = defaultEmoPic
|
||||
formData.picFocus = defaultEmoPic
|
||||
} else {
|
||||
formData.pic = defaultBodyPic
|
||||
formData.picFocus = defaultBodyPic
|
||||
}
|
||||
}
|
||||
// }
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (model.pic == defaultBodyPic || model.pic == defaultEmoPic) {
|
||||
model.pic = null
|
||||
}
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
function handleTypeChanged(v_) {
|
||||
if (!formData.pic || formData.pic == defaultEmoPic || formData.pic == defaultBodyPic) {
|
||||
if (v_ == 'qx') {
|
||||
formData.pic = defaultEmoPic
|
||||
formData.picFocus = defaultEmoPic
|
||||
} else {
|
||||
formData.pic = defaultBodyPic
|
||||
formData.picFocus = defaultBodyPic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//打开选择标签页面
|
||||
function handleElderTag(){
|
||||
elderTagModal.value.disableSubmit = true
|
||||
elderTagModal.value.open();
|
||||
}
|
||||
//选择标签图片回调
|
||||
function handleElderTagOk(record){
|
||||
console.log("🚀 ~ handleElderTagOk ~ record:", record)
|
||||
formData.pic = record.filePath
|
||||
formData.picFocus = record.checkPicPath
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
queryUpBizPrefix().then(res => {
|
||||
upBizPrefix.value = res.result
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
// padding: 14px;
|
||||
}
|
||||
|
||||
.card-class {
|
||||
padding-top: 24px;
|
||||
padding-bottom: 24px;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
// background-color: rgba(255, 255, 255, 0.9);
|
||||
background-color: #fcfdff;
|
||||
border-radius: 10px;
|
||||
// box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px;
|
||||
margin-bottom: 14px;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,288 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ElderTagForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签类型" v-bind="validateInfos.type" id="ElderTagForm-type" name="type">
|
||||
<j-dict-select-tag v-model:value="formData.type" dictCode="elder_tag_type" placeholder="请选择标签类型"
|
||||
allowClear :disabled="!!formData.id" @change="handleTypeChanged" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签名称" v-bind="validateInfos.tagName" id="ElderTagForm-tagName" name="tagName">
|
||||
<a-input v-model:value="formData.tagName" placeholder="请输入标签名称" allow-clear :disabled="!!formData.id"
|
||||
:maxlength="10" :showCount="true"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="说明" v-bind="validateInfos.describ" id="ElderTagForm-tagName" name="tagName">
|
||||
<a-textarea v-model:value="formData.describ" placeholder="请输入说明" :maxlength="200" :rows="3"
|
||||
:autosize="{ minRows: 3 }" :showCount="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="价格(元)" v-bind="validateInfos.price" id="ElderTagForm-price" name="price">
|
||||
<a-input-number v-model:value="formData.price" placeholder="请输入价格" style="width: 100%" :min="0"
|
||||
:max="99.99" :precision="2" @keydown="onPriceKeydown" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="默认图标" v-bind="validateInfos.pic" id="ElderTagForm-pic" name="pic">
|
||||
<!-- <JImageUploadToOpe v-if="opeType == 'dmlook'" :fileMax="1" v-model:value="dmlookVal">
|
||||
</JImageUploadToOpe> -->
|
||||
<JImageUploadToOpe :toOpe="true" :bizPath="upBizPrefix + '/zzxx/zzbq'" :fileMax="1"
|
||||
v-model:value="formData.pic" :disabled="!!formData.id || !isMain">
|
||||
</JImageUploadToOpe>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="焦点图标" v-bind="validateInfos.picFocus" id="ElderTagForm-picFocus" name="picFocus">
|
||||
<!-- <JImageUploadToOpe v-if="opeType == 'dmlook'" :fileMax="1" v-model:value="dmlookVal">
|
||||
</JImageUploadToOpe> -->
|
||||
<JImageUploadToOpe :toOpe="true" :bizPath="upBizPrefix + '/zzxx/zzbq'" :fileMax="1"
|
||||
v-model:value="formData.picFocus" :disabled="!!formData.id || !isMain">
|
||||
</JImageUploadToOpe>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <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 :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"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
</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 '../ElderTag.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import JImageUploadToOpe from '/@/components/Form/src/jeecg/components/JImageUploadToOpe.vue';
|
||||
import { queryUpBizPrefix } from '/@/api/common/api'
|
||||
|
||||
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 },
|
||||
mediaApiAddress: '',//指令资源请求地址
|
||||
opeType: 'look',
|
||||
isMain: false,//是否主指令库
|
||||
});
|
||||
const dmlookVal = ref('')
|
||||
const defaultBodyPic = import.meta.env.VITE_DEFAULT_ELDER_TAG_BODY_PIC
|
||||
const defaultEmoPic = import.meta.env.VITE_DEFAULT_ELDER_TAG_EMO_PIC
|
||||
const upBizPrefix = ref('')
|
||||
const onPriceKeydown = (e: KeyboardEvent) => {
|
||||
const key = e.key;
|
||||
// 放行控制键
|
||||
if (['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab'].includes(key)) return;
|
||||
// 只能输数字和点
|
||||
if (!/[\d.]/.test(key)) {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
const input = e.target as HTMLInputElement;
|
||||
const { value, selectionStart: s, selectionEnd: t } = input;
|
||||
const next = value.slice(0, s!) + key + value.slice(t!);
|
||||
// 整数最多2位,小数最多2位
|
||||
if (!/^\d{0,2}(?:\.\d{0,2})?$/.test(next)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
type: 'tx',
|
||||
tagName: '',
|
||||
price: 0,
|
||||
pic: defaultBodyPic,
|
||||
picFocus: defaultBodyPic,
|
||||
sort: 99,
|
||||
izEnabled: 'Y',
|
||||
describ: '',
|
||||
});
|
||||
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({
|
||||
type: [{ required: true, message: '请输入标签类型!' },],
|
||||
tagName: [{ required: true, message: '请输入标签名称!' },],
|
||||
price: [{ required: true, message: '请输入价格!' }, { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!' },],
|
||||
izEnabled: [{ required: true, message: '请输入是否启用!' },],
|
||||
});
|
||||
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);
|
||||
// if (props.opeType == 'dmlook') {
|
||||
// if (!!formData.pic) {
|
||||
// dmlookVal.value = props.mediaApiAddress + formData.pic
|
||||
// } else {
|
||||
// if (formData.type == 'qx') {
|
||||
// dmlookVal.value = defaultEmoPic
|
||||
// } else {
|
||||
// dmlookVal.value = defaultBodyPic
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
if (!formData.pic) {
|
||||
if (formData.type == 'qx') {
|
||||
formData.pic = defaultEmoPic
|
||||
formData.picFocus = defaultEmoPic
|
||||
} else {
|
||||
formData.pic = defaultBodyPic
|
||||
formData.picFocus = defaultBodyPic
|
||||
}
|
||||
}
|
||||
// }
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (model.pic == defaultBodyPic || model.pic == defaultEmoPic) {
|
||||
model.pic = null
|
||||
}
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
function handleTypeChanged(v_) {
|
||||
if (!formData.pic || formData.pic == defaultEmoPic || formData.pic == defaultBodyPic) {
|
||||
if (v_ == 'qx') {
|
||||
formData.pic = defaultEmoPic
|
||||
formData.picFocus = defaultEmoPic
|
||||
} else {
|
||||
formData.pic = defaultBodyPic
|
||||
formData.picFocus = defaultBodyPic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
queryUpBizPrefix().then(res => {
|
||||
upBizPrefix.value = res.result
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
// padding: 14px;
|
||||
}
|
||||
|
||||
.card-class {
|
||||
padding-top: 24px;
|
||||
padding-bottom: 24px;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
// background-color: rgba(255, 255, 255, 0.9);
|
||||
background-color: #fcfdff;
|
||||
border-radius: 10px;
|
||||
// box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px;
|
||||
margin-bottom: 14px;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
<template>
|
||||
<a-drawer :title="title" width="800" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @cancel="handleCancel">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel" style="margin-right: 8px;">关闭</a-button>
|
||||
<a-button @click="handleOk" v-show="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
<ElderTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"
|
||||
:mediaApiAddress="mediaApiAddress" :opeType="opeType" :isMain="isMain"></ElderTagForm>
|
||||
<!-- <ElderTagFormEdit v-else ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"
|
||||
:mediaApiAddress="mediaApiAddress" :opeType="opeType" :isMain="isMain"></ElderTagFormEdit> -->
|
||||
</a-drawer>
|
||||
<a-drawer :title="'标准标签库'" width="80vw" v-model:visible="etmVisible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancelETM" :maskClosable="true">
|
||||
<a-spin :spinning="loading">
|
||||
<ElderTagRespositoryList ref="etmRef" :mainOrgCode="mainOrgCode"></ElderTagRespositoryList>
|
||||
</a-spin>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelETM" style="margin-right: 8px;">关闭</a-button>
|
||||
<a-button @click="handlePullETM">镜像</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ElderTagForm from './ElderTagForm.vue'
|
||||
import ElderTagFormEdit from './ElderTagFormEdit.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import { clearCache } from '/@/utils/cache/cacheUtil'
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import ElderTagRespositoryList from './ElderTagRespositoryList.vue'
|
||||
import { syncElderTag } from '../ElderTag.api'
|
||||
|
||||
const props = defineProps({
|
||||
mediaApiAddress: '',//指令资源请求地址
|
||||
isMain: false,//是否主指令库
|
||||
});
|
||||
const mainOrgCode = ref('')
|
||||
const etmRef = ref()
|
||||
const title = ref<string>('');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const etmVisible = ref(false)
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const loading = ref(false)
|
||||
const opeType = ref('')
|
||||
|
||||
function handleCancelETM() {
|
||||
etmVisible.value = false
|
||||
clearCache()
|
||||
emit('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;
|
||||
}
|
||||
|
||||
function openETM(orgCode) {
|
||||
etmVisible.value = true
|
||||
mainOrgCode.value = orgCode
|
||||
nextTick(() => {
|
||||
etmRef.value?.init()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function handlePullETM() {
|
||||
let selectedData = etmRef.value?.getSelectedIds()
|
||||
|
||||
if (!selectedData.count) {
|
||||
createMessage.warning('未选择长者标签')
|
||||
return
|
||||
}
|
||||
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '镜像确认',
|
||||
content: '是否确认将<span style="font-weight:500;color:#efac0e;"> ' + selectedData.count + ' </span>条长者标签拉取到本平台?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
syncElderTag(mainOrgCode.value, { syncIds: selectedData.ids, })
|
||||
createMessage.success('从标准标签库开始拉取')
|
||||
// etmRef.value?.init()
|
||||
handleCancelETM()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
openETM,
|
||||
opeType,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -0,0 +1,314 @@
|
|||
<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" style="padding-top: 20px;">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="type">
|
||||
<template #label><span title="标签类型">标签类型</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.type" dictCode="elder_tag_type" placeholder="请选择标签类型"
|
||||
allowClear :ignoreDisabled="true" />
|
||||
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="tagName">
|
||||
<template #label><span title="标签名称">标签名称</span></template>
|
||||
<JInput v-model:value="queryParam.tagName" placeholder="请输入标签名称" allowClear />
|
||||
</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>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽: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>
|
||||
</div>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagModal ref="registerModal" :mediaApiAddress="mediaApiAddress" @success="handleSuccess"
|
||||
:mainOrgCode="mainOrgCode">
|
||||
</ElderTagModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
|
||||
import { ref, reactive, watch, onMounted, computed } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ElderTag.data';
|
||||
import { listByDS, idListByDS } from '../ElderTag.api';
|
||||
import ElderTagModal from './ElderTagModal.vue'
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import { getOrgInfo, getMediaUrlByOrgCode } from '@/api/common/api'
|
||||
|
||||
const props = defineProps({
|
||||
mainOrgCode: '',
|
||||
});
|
||||
const mediaApiAddress = ref()//指令库资源请求地址
|
||||
const orgName = ref('')
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({
|
||||
type: '',
|
||||
tagName: '',
|
||||
izEnabled: 'Y',
|
||||
});
|
||||
|
||||
const registerModal = ref();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '服务指令',
|
||||
api: listByDS,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
showIndexColumn: true,
|
||||
scroll: { y: '58vh' },
|
||||
immediate: false,
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 15,
|
||||
pageSizeOptions: ['15', '50', '70', '100'],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 90,
|
||||
fixed: 'right',
|
||||
},
|
||||
defSort: {
|
||||
column: 'sort',
|
||||
order: 'asc',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
params.dataSourceCode = props.mainOrgCode
|
||||
if (excludeIds.value.length) {
|
||||
params.excludeIds = excludeIds.value.join(',')
|
||||
}
|
||||
params.izEnabled = '0'
|
||||
return Object.assign(params, queryParam)
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 7,
|
||||
xxl: 6
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 19,
|
||||
xl: 17,
|
||||
xxl: 18
|
||||
});
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.opeType = 'dmlook';
|
||||
record.orgCode_ = props.mainOrgCode
|
||||
registerModal.value.edit(record, false, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery(reloadTree = true) {
|
||||
reload()
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields(); // 重置表单字段
|
||||
// 清空 queryParam 中相关字段
|
||||
queryParam.type = '';
|
||||
queryParam.tagName = '';
|
||||
|
||||
// 刷新数据
|
||||
reload()
|
||||
}
|
||||
|
||||
|
||||
const excludeIds = ref('')
|
||||
|
||||
async function init() {
|
||||
//重置
|
||||
{
|
||||
formRef.value.resetFields(); // 重置表单字段
|
||||
// 清空 queryParam 中相关字段
|
||||
queryParam.type = '';
|
||||
queryParam.tagName = '';
|
||||
|
||||
selectedRowKeys.value = [];
|
||||
}
|
||||
|
||||
let { ids } = getSelectedIds();
|
||||
idListByDS({ dataSourceCode: 'master' }).then(res => {
|
||||
// 现有的ID
|
||||
let existingExcludeIds = res.records.map(item => item.id);
|
||||
|
||||
// 如果ids不为空,则拆分并添加到排除列表中
|
||||
if (ids) {
|
||||
const idsToAdd = ids.split(',');
|
||||
existingExcludeIds = [...existingExcludeIds, ...idsToAdd];
|
||||
}
|
||||
|
||||
// 去重并更新excludeIds.value
|
||||
excludeIds.value = [...new Set(existingExcludeIds)];
|
||||
|
||||
reload();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到已选择的所有id
|
||||
*/
|
||||
function getSelectedIds() {
|
||||
const ids = selectedRowKeys.value.join(',');
|
||||
const count = selectedRowKeys.value.length;
|
||||
return { ids, count }; // 返回对象,包含 ID 字符串和数量
|
||||
}
|
||||
|
||||
// 添加音频结束监听
|
||||
onMounted(() => {
|
||||
getOrgInfo().then(res => {
|
||||
orgName.value = res.orgName
|
||||
})
|
||||
getMediaUrlByOrgCode({ orgCode: props.mainOrgCode }).then(res => {
|
||||
mediaApiAddress.value = res.mediaUrl
|
||||
})
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
getSelectedIds,
|
||||
init
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
margin-bottom: 18px;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 0px;
|
||||
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: 18px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
audio::-webkit-media-controls-timeline {
|
||||
display: none;
|
||||
}
|
||||
|
||||
audio::-webkit-media-controls-current-time-display,
|
||||
audio::-webkit-media-controls-time-remaining-display {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.btnPrivate {
|
||||
height: 34px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.node-title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.action-icon {
|
||||
margin-left: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:deep(.centered-dropdown) {
|
||||
position: fixed;
|
||||
left: 50% !important;
|
||||
top: 50% !important;
|
||||
transform: translate(-50%, -50%) !important;
|
||||
max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
|
||||
.ant-dropdown-menu {
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -15,6 +15,9 @@ enum Api {
|
|||
idListByDS = '/elder/elderTag/idListByDS',
|
||||
syncElderTag = '/elder/elderTag/syncElderTag',
|
||||
compareList = '/elder/elderTag/compareList',
|
||||
getSyncCode = '/elder/elderTag/getSyncCode',
|
||||
updateSyncCode = '/elder/elderTag/updateSyncCode',
|
||||
getOrgCodeBySyncCode = '/elder/elderTag/getOrgCodeBySyncCode',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -102,4 +105,25 @@ export const syncElderTag = (dataSourceCode: string, params: any) => {
|
|||
* @param params compareOrgCode
|
||||
* @returns
|
||||
*/
|
||||
export const compareList = (params) => defHttp.get({ url: Api.compareList, params });
|
||||
export const compareList = (params) => defHttp.get({ url: Api.compareList, params });
|
||||
|
||||
/**
|
||||
* 获取镜像码
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const getSyncCode = (params) => defHttp.get({ url: Api.getSyncCode, params }, { isTransformResponse: false });
|
||||
|
||||
/**
|
||||
* 更新镜像码
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const updateSyncCode = (params) => defHttp.get({ url: Api.updateSyncCode, params }, { isTransformResponse: false });
|
||||
|
||||
/**
|
||||
* 根据镜像码获取机构编码
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const getOrgCodeBySyncCode = (params) => defHttp.get({ url: Api.getOrgCodeBySyncCode, params }, { isTransformResponse: false });
|
||||
|
|
@ -43,14 +43,11 @@
|
|||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'eldertag:nu_elder_tag:add'" @click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<!-- <a-button type="primary" @click="handleEditMain" preIcon="ant-design:setting-outlined"> 标签管理</a-button>
|
||||
<a-button type="primary" @click="handleEditRep" preIcon="ant-design:plus-outlined"> 引用</a-button> -->
|
||||
<a-button type="primary" class="btnPrivate" @click="handleDirectiveMainOpen" v-show="isShowETM"
|
||||
preIcon="ant-design:profile-outlined">标准标签库</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:eye-outlined" v-show="ownOrgCode == mainOrgCode"
|
||||
@click="handleCompare">差异比对</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
|
||||
v-show="ownOrgCode == mainOrgCode" @click="handleLookNewDirectives">差异标签</a-button>
|
||||
<a-button type="primary" @click="directiveSyncCodeMangeFunc" v-show="!!ownOrgCode"
|
||||
preIcon="ant-design:setting-outlined">镜像码管理</a-button>
|
||||
<a-button type="primary" @click="handleElderTagMainOpen" preIcon="ant-design:profile-outlined">
|
||||
长者标签库
|
||||
</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
|
|
@ -60,27 +57,7 @@
|
|||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagModal ref="registerModal" @success="handleSuccess"
|
||||
:isMain="!!mainOrgCode && !!ownOrgCode && mainOrgCode == ownOrgCode"></ElderTagModal>
|
||||
|
||||
<!-- 标签管理 -->
|
||||
<!-- <a-drawer title="标签管理" width="80vw" :open="tagMainManagOpen" @close="onTagMainManagClose"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onTagMainManagClose" style="margin-right: 10px;">关闭</a-button>
|
||||
</template>
|
||||
<ElderTagMainList ref="tagMainManagRef"> </ElderTagMainList>
|
||||
</a-drawer> -->
|
||||
|
||||
<!-- 引用 -->
|
||||
<!-- <a-drawer title="引用" width="80vw" :open="tagMainRepOpen" @close="onTagMainRepClose"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onTagMainRepClose" style="margin-right: 10px;">关闭</a-button>
|
||||
<a-button type="primary" @click="onTagMainRepUse" style="margin-right: 10px;">引用</a-button>
|
||||
</template>
|
||||
<ElderTagMainRes ref="tagMainRepRef"> </ElderTagMainRes>
|
||||
</a-drawer> -->
|
||||
<ElderTagModal ref="registerModal" @success="handleSuccess" :isMain="true"></ElderTagModal>
|
||||
|
||||
<!-- 差异标签 -->
|
||||
<a-drawer v-model:visible="newElderTagVisible" title="差异标签" width="1200" :footer-style="{ textAlign: 'right' }"
|
||||
|
|
@ -106,6 +83,41 @@
|
|||
</CompareElderTagList>
|
||||
</a-drawer>
|
||||
</div>
|
||||
|
||||
<!-- 镜像码管理 -->
|
||||
<a-drawer v-model:visible="syncCodeVisible" title="镜像码管理" width="1200px" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
padding: '14px',
|
||||
flexDirection: 'column',
|
||||
overflow: 'auto'
|
||||
}" wrapClassName="org-list-modal" @cancel="syncCodeVisible = false">
|
||||
<template #footer>
|
||||
<a-button @click="syncCodeVisible = false" type="primary">关闭</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="!syncCode" style="display: flex; flex-direction: column; height: 100%;">
|
||||
<div style="padding: 14px; background-color: white; display: flex; align-items: center; flex-shrink: 0;">
|
||||
<a-row style="width: 100%;">
|
||||
<a-col :span="3" style="display: flex; align-items: center;">
|
||||
<span style="font-weight: bold;font-size: 16px;">镜像码:<span style="color: #1890FF;">{{ syncCode
|
||||
}}</span></span>
|
||||
</a-col>
|
||||
<a-col :span="3" style="display: flex; align-items: center; justify-content: flex-end;">
|
||||
<a-button @click="copySyncCodeFunc()" type="primary" style="margin-right: 8px;">复制</a-button>
|
||||
<a-button @click="updateSyncCodeFunc()" type="primary">更新</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<div style="flex: 1; min-height: 0; width: 100%;margin-top: 14px;">
|
||||
<a-row style="width: 100%; height: 100%; margin: 0;">
|
||||
<a-col :span="24" style="width: 100%; height: 100%; padding: 0;">
|
||||
<ElderTagSyncLogMainList :orgCode="ownOrgCode" style="width: 100%; height: 100%;" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-spin>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="eldertag-elderTag" setup>
|
||||
|
|
@ -113,7 +125,7 @@ import { ref, reactive, onMounted } from 'vue';
|
|||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ElderTag.data';
|
||||
import { list, idListByDS, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ElderTag.api';
|
||||
import { list, idListByDS, deleteOne, batchDelete, getImportUrl, getExportUrl, getSyncCode, updateSyncCode } from './ElderTag.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ElderTagModal from './components/ElderTagModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
|
@ -126,7 +138,9 @@ import CanAddElderTagList from '/@/views/elder/canaddet/CanAddElderTagList.vue'
|
|||
import CompareElderTagList from './components/CompareElderTagList.vue'
|
||||
import ElderTagMainList from '/@/views/elder/eldertagmain/ElderTagMainList.vue'
|
||||
import ElderTagMainRes from '/@/views/elder/eldertagmain/ElderTagMainRes.vue'
|
||||
import ElderTagSyncLogMainList from './eldertagsynclog/ElderTagSyncLogMainList.vue'
|
||||
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const tagMainManagOpen = ref(false)
|
||||
const tagMainManagRef = ref()
|
||||
const tagMainRepOpen = ref(false)
|
||||
|
|
@ -146,6 +160,7 @@ const ownOrgName = ref('') //本机构名称
|
|||
const elderTagMainOrgInfo = ref()
|
||||
const compareListRef = ref()
|
||||
const compareListOpen = ref(false)
|
||||
const syncCodeVisible = ref(false)
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
|
|
@ -291,7 +306,7 @@ function searchReset() {
|
|||
/**
|
||||
* 查看指令库
|
||||
*/
|
||||
function handleDirectiveMainOpen() {
|
||||
function handleElderTagMainOpen() {
|
||||
registerModal.value?.openETM(mainOrgCode.value)
|
||||
}
|
||||
|
||||
|
|
@ -374,6 +389,55 @@ function handleEditRep() {
|
|||
tagMainRepOpen.value = true
|
||||
}
|
||||
|
||||
const syncCode = ref('')
|
||||
//打开镜像码管理
|
||||
async function directiveSyncCodeMangeFunc() {
|
||||
syncCode.value = ''
|
||||
syncCodeVisible.value = true
|
||||
if (!syncCode.value) {
|
||||
let res = await getSyncCode({ 'orgCode': ownOrgCode.value })
|
||||
syncCode.value = res.result
|
||||
}
|
||||
}
|
||||
|
||||
async function updateSyncCodeFunc() {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '更新镜像码',
|
||||
content: '更新后旧的镜像码无法继续使用,是否确认更新?',
|
||||
onOk: async () => {
|
||||
syncCode.value = ''
|
||||
let res = await updateSyncCode({ 'orgCode': ownOrgCode.value })
|
||||
syncCode.value = res.result
|
||||
},
|
||||
onCancel() { },
|
||||
});
|
||||
}
|
||||
|
||||
function copySyncCodeFunc() {
|
||||
// 创建临时文本域
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.value = syncCode.value;
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
|
||||
try {
|
||||
// 执行复制命令
|
||||
const successful = document.execCommand('copy');
|
||||
if (successful) {
|
||||
createMessage.success('复制成功');
|
||||
} else {
|
||||
createMessage.error('复制失败');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('复制失败:', err);
|
||||
createMessage.error('复制失败');
|
||||
} finally {
|
||||
// 清理DOM
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加音频结束监听
|
||||
onMounted(() => {
|
||||
getElderTagMainOrgCode()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<a-drawer :title="title" width="800" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @cancel="handleCancel">
|
||||
<a-drawer :title="title" width="800" v-model:visible="visible" :closable="true" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding: '14px' }" @cancel="handleCancel">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel" style="margin-right: 8px;">关闭</a-button>
|
||||
<a-button @click="handleOk" v-show="!disableSubmit">确认</a-button>
|
||||
|
|
@ -10,11 +10,9 @@
|
|||
<!-- <ElderTagFormEdit v-else ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"
|
||||
:mediaApiAddress="mediaApiAddress" :opeType="opeType" :isMain="isMain"></ElderTagFormEdit> -->
|
||||
</a-drawer>
|
||||
<a-drawer :title="'标准标签库'" width="80vw" v-model:visible="etmVisible" :closable="true"
|
||||
<a-drawer :title="'长者标签库'" width="80vw" v-model:visible="etmVisible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancelETM" :maskClosable="true">
|
||||
<a-spin :spinning="loading">
|
||||
<ElderTagRespositoryList ref="etmRef" :mainOrgCode="mainOrgCode"></ElderTagRespositoryList>
|
||||
</a-spin>
|
||||
<ElderTagRespositoryList v-if="etmVisible" ref="etmRef"></ElderTagRespositoryList>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelETM" style="margin-right: 8px;">关闭</a-button>
|
||||
<a-button @click="handlePullETM">镜像</a-button>
|
||||
|
|
@ -100,9 +98,8 @@ function handleCancel() {
|
|||
|
||||
function openETM(orgCode) {
|
||||
etmVisible.value = true
|
||||
mainOrgCode.value = orgCode
|
||||
nextTick(() => {
|
||||
etmRef.value?.init()
|
||||
etmRef.value?.resetChoose()
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -115,6 +112,11 @@ function handlePullETM() {
|
|||
return
|
||||
}
|
||||
|
||||
if (!etmRef.value.targetOrgCode) {
|
||||
createMessage.warning('机构不存在')
|
||||
return
|
||||
}
|
||||
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '镜像确认',
|
||||
|
|
@ -122,8 +124,8 @@ function handlePullETM() {
|
|||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
syncElderTag(mainOrgCode.value, { syncIds: selectedData.ids, })
|
||||
createMessage.success('从标准标签库开始拉取')
|
||||
syncElderTag(etmRef.value.targetOrgCode, { syncIds: selectedData.ids, syncCode: etmRef.value.targetOrgCodeSV })
|
||||
createMessage.success('长者标签拉取中,请1分钟后重新查看')
|
||||
// etmRef.value?.init()
|
||||
handleCancelETM()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,55 +1,89 @@
|
|||
<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" style="padding-top: 20px;">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="type">
|
||||
<template #label><span title="标签类型">标签类型</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.type" dictCode="elder_tag_type" placeholder="请选择标签类型"
|
||||
allowClear :ignoreDisabled="true" />
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol" style="padding-top: 20px;">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="5">
|
||||
<a-form-item name="targetOrgCode">
|
||||
<template #label><span title="镜像码">镜像码</span></template>
|
||||
<JInput v-model:value="targetOrgCodeSV" placeholder="请输入镜像码" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="tagName">
|
||||
<template #label><span title="标签名称">标签名称</span></template>
|
||||
<JInput v-model:value="queryParam.tagName" placeholder="请输入标签名称" allowClear />
|
||||
</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>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽: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>
|
||||
</div>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagModal ref="registerModal" :mediaApiAddress="mediaApiAddress" @success="handleSuccess"
|
||||
:mainOrgCode="mainOrgCode">
|
||||
</ElderTagModal>
|
||||
<a-col :span="2">
|
||||
<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="searchOrgCode">查询</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<a-spin :spinning="!targetOrgCode">
|
||||
<template #indicator>
|
||||
<span>
|
||||
<LockOutlined style="color: #28A1F8; font-weight: bold;font-size: 25px; margin-left: -5px;" />
|
||||
</span>
|
||||
</template>
|
||||
<template #tip>
|
||||
<div>
|
||||
<div style="margin-top: 5px;">
|
||||
<span style="font-size: 18px;color: #28A1F8;font-weight: bold;">请输入镜像码</span>
|
||||
</div>
|
||||
</div>
|
||||
</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" style="padding-top: 20px;">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="type">
|
||||
<template #label><span title="标签类型">标签类型</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.type" dictCode="elder_tag_type" placeholder="请选择标签类型"
|
||||
allowClear :ignoreDisabled="true" />
|
||||
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="tagName">
|
||||
<template #label><span title="标签名称">标签名称</span></template>
|
||||
<JInput v-model:value="queryParam.tagName" placeholder="请输入标签名称" allowClear />
|
||||
</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>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽: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>
|
||||
</div>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagModal ref="registerModal" :mediaApiAddress="mediaApiAddress" @success="handleSuccess">
|
||||
</ElderTagModal>
|
||||
</div>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
|
||||
|
|
@ -57,16 +91,18 @@ import { ref, reactive, watch, onMounted, computed } from 'vue';
|
|||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ElderTag.data';
|
||||
import { listByDS, idListByDS } from '../ElderTag.api';
|
||||
import { listByDS, idListByDS, getOrgCodeBySyncCode } from '../ElderTag.api';
|
||||
import ElderTagModal from './ElderTagModal.vue'
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import { getOrgInfo, getMediaUrlByOrgCode } from '@/api/common/api'
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { LockOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
const props = defineProps({
|
||||
mainOrgCode: '',
|
||||
});
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const targetOrgCode = ref('')//目标机构
|
||||
const targetOrgCodeSV = ref()
|
||||
const mediaApiAddress = ref()//指令库资源请求地址
|
||||
const orgName = ref('')
|
||||
const formRef = ref();
|
||||
|
|
@ -102,7 +138,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
order: 'asc',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
params.dataSourceCode = props.mainOrgCode
|
||||
params.dataSourceCode = targetOrgCode.value
|
||||
if (excludeIds.value.length) {
|
||||
params.excludeIds = excludeIds.value.join(',')
|
||||
}
|
||||
|
|
@ -230,14 +266,33 @@ onMounted(() => {
|
|||
getOrgInfo().then(res => {
|
||||
orgName.value = res.orgName
|
||||
})
|
||||
getMediaUrlByOrgCode({ orgCode: props.mainOrgCode }).then(res => {
|
||||
getMediaUrlByOrgCode({ orgCode: '1' }).then(res => {
|
||||
mediaApiAddress.value = res.mediaUrl
|
||||
})
|
||||
});
|
||||
|
||||
async function searchOrgCode() {
|
||||
let res = await getOrgCodeBySyncCode({ 'syncCode': targetOrgCodeSV.value })
|
||||
if (!res.result || res.result == -1) {
|
||||
createMessage.error('无效镜像码');
|
||||
} else if (res.result == -2) {
|
||||
createMessage.error('无法使用本机构镜像码');
|
||||
} else {
|
||||
targetOrgCode.value = res.result
|
||||
init()
|
||||
}
|
||||
}
|
||||
|
||||
function resetChoose() {
|
||||
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
getSelectedIds,
|
||||
init
|
||||
init,
|
||||
targetOrgCode,
|
||||
targetOrgCodeSV,
|
||||
resetChoose,
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -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,47 @@
|
|||
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: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '镜像码',
|
||||
align: 'center',
|
||||
dataIndex: 'orgTagCode',
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
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',
|
||||
},
|
||||
orgDirectiveCode: { title: '指令镜像码', order: 2, view: 'text', type: 'string' },
|
||||
createTime: { title: '创建日期', order: 3, view: 'datetime', type: 'string' },
|
||||
};
|
||||
|
|
@ -0,0 +1,229 @@
|
|||
<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="opeOrgCode">
|
||||
<template #label><span title="镜像机构">镜像机构</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.opeOrgCode" :dictCode="`view_elder_tag_sync_org,depart_name,org_code,target_org_code = '${props.orgCode}'`" :orgCode="'ope'"
|
||||
placeholder="请选择镜像机构" allowClear />
|
||||
</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 :lg="6">
|
||||
<a-form-item name="orgTagCode">
|
||||
<template #label><span title="镜像码">镜像码</span></template>
|
||||
<JInput placeholder="请输入镜像码" v-model:value="queryParam.orgTagCode" allow-clear></JInput>
|
||||
</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>
|
||||
<span style="font-size: 15px;font-weight: bold;margin-left: 8px;">被镜像日志</span>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagSyncLogInfoModal ref="registerModal" @success="handleSuccess"></ElderTagSyncLogInfoModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="directivesynclog-directiveSyncLogMain" setup>
|
||||
import { ref, reactive, defineProps } 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 ElderTagSyncLogInfoModal from './components/ElderTagSyncLogInfoModal.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 { cloneDeep } from "lodash-es";
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const props = defineProps({
|
||||
orgCode: ''
|
||||
});
|
||||
//注册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, {
|
||||
targetOrgCode: props.orgCode
|
||||
});
|
||||
},
|
||||
},
|
||||
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: 6
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0px;
|
||||
|
||||
.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 = '/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,39 @@
|
|||
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',
|
||||
width:120
|
||||
},
|
||||
{
|
||||
title: '标签名称',
|
||||
align: "center",
|
||||
dataIndex: 'tagName'
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
align: "center",
|
||||
dataIndex: 'describ'
|
||||
},
|
||||
{
|
||||
title: '价格(元)',
|
||||
align: "center",
|
||||
dataIndex: 'price',
|
||||
width:120
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
instructionTagName: {title: '分类标签名称',order: 0,view: 'text', type: 'string',},
|
||||
categoryName: {title: '服务类别名称',order: 1,view: 'text', type: 'string',},
|
||||
typeName: {title: '服务类型名称',order: 2,view: 'text', type: 'string',},
|
||||
directiveName: {title: '服务指令名称',order: 3,view: 'text', type: 'string',},
|
||||
cycleType: {title: '指令类型 1日常护理 2周期护理 3即时护理',order: 6,view: 'text', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="DirectiveSyncLogInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="分类标签名称" v-bind="validateInfos.instructionTagName"
|
||||
id="DirectiveSyncLogInfoForm-instructionTagName" name="instructionTagName">
|
||||
<a-input v-model:value="formData.instructionTagName" placeholder="请输入分类标签名称" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类别名称" v-bind="validateInfos.categoryName" id="DirectiveSyncLogInfoForm-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="DirectiveSyncLogInfoForm-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.directiveName"
|
||||
id="DirectiveSyncLogInfoForm-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="DirectiveSyncLogInfoForm-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="DirectiveSyncLogInfoForm-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="指令类型 1日常护理 2周期护理 3即时护理" v-bind="validateInfos.cycleType"
|
||||
id="DirectiveSyncLogInfoForm-cycleType" name="cycleType">
|
||||
<a-input v-model:value="formData.cycleType" placeholder="请输入指令类型 1日常护理 2周期护理 3即时护理"
|
||||
allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务说明" v-bind="validateInfos.serviceContent"
|
||||
id="DirectiveSyncLogInfoForm-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="DirectiveSyncLogInfoForm-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="语音文件" v-bind="validateInfos.mp3File" id="DirectiveSyncLogInfoForm-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="DirectiveSyncLogInfoForm-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="DirectiveSyncLogInfoForm-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.previewFileSmall"
|
||||
id="DirectiveSyncLogInfoForm-previewFileSmall" name="previewFileSmall">
|
||||
<a-input v-model:value="formData.previewFileSmall" placeholder="请输入服务指令图片小图" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="即时指令图片" v-bind="validateInfos.immediateFile"
|
||||
id="DirectiveSyncLogInfoForm-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.immediateFileFocus"
|
||||
id="DirectiveSyncLogInfoForm-immediateFileFocus" name="immediateFileFocus">
|
||||
<a-input v-model:value="formData.immediateFileFocus" 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 { 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: '',
|
||||
instructionTagName: '',
|
||||
categoryName: '',
|
||||
typeName: '',
|
||||
directiveName: '',
|
||||
tollPrice: undefined,
|
||||
comPrice: undefined,
|
||||
cycleType: '',
|
||||
serviceContent: '',
|
||||
serviceDuration: '',
|
||||
mp3File: '',
|
||||
mp4File: '',
|
||||
previewFile: '',
|
||||
previewFileSmall: '',
|
||||
immediateFile: '',
|
||||
immediateFileFocus: '',
|
||||
});
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
<template>
|
||||
<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>
|
||||
<!-- 表单区域 -->
|
||||
<ElderTagSyncLogInfoModal ref="registerModal" @success="handleSuccess"></ElderTagSyncLogInfoModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="directivesynclog-directiveSyncLogInfo" 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 './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();
|
||||
const mainInfo = ref({ id: '' })
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '服务指令镜像日志详情表',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
showActionColumn: false,
|
||||
immediate: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
queryParam.pkId = mainInfo.value.id
|
||||
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,
|
||||
});
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function init(mainInfo_) {
|
||||
mainInfo.value = mainInfo_;
|
||||
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,83 @@
|
|||
<template>
|
||||
<a-drawer :title="title" width="1000px" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel"
|
||||
:bodyStyle="{ background: 'linear-gradient(135deg, #f1f7ff 0%, #f1f7ff 100%)', padding: '14px' }">
|
||||
<ElderTagSyncLogInfoList v-if="visible" ref="registerForm" @ok="submitCallback" :formBpm="false">
|
||||
</ElderTagSyncLogInfoList>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel" style="margin-right: 8px;">关闭</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>(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.init(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