服务指令-指令库
This commit is contained in:
parent
c184017f4f
commit
010a37d26b
|
@ -15,10 +15,11 @@ enum Api {
|
||||||
getDictItems = '/sys/dict/getDictItems/',
|
getDictItems = '/sys/dict/getDictItems/',
|
||||||
getTableList = '/sys/user/queryUserComponentData',
|
getTableList = '/sys/user/queryUserComponentData',
|
||||||
getCategoryData = '/sys/category/loadAllData',
|
getCategoryData = '/sys/category/loadAllData',
|
||||||
getOrgInfo = '/api/common/getOrgInfo',//根据机构编码获取机构信息
|
getOrgInfo = '/api/common/getOrgInfo', //根据机构编码获取机构信息
|
||||||
|
changeDirectiveMain = '/sys/sysDepart/changeDirectiveMain', //变更指令库
|
||||||
|
getDirectiveMain = '/sys/sysDepart/getDirectiveMain', //查询当前指令库机构信息
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传父路径
|
* 上传父路径
|
||||||
*/
|
*/
|
||||||
|
@ -165,3 +166,19 @@ export const uploadMyFile = (url, data) => {
|
||||||
export const getOrgInfo = (params) => {
|
export const getOrgInfo = (params) => {
|
||||||
return defHttp.get({ url: Api.getOrgInfo, params });
|
return defHttp.get({ url: Api.getOrgInfo, params });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更指令库
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const changeDirectiveMain = (orgCode) => {
|
||||||
|
return defHttp.post({ url: `${Api.changeDirectiveMain}?orgCode=${encodeURIComponent(orgCode)}` });
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更指令库
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getDirectiveMain = () => {
|
||||||
|
return defHttp.get({ url: Api.getDirectiveMain });
|
||||||
|
};
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -32,7 +32,11 @@
|
||||||
<!-- 业务字段列 -->
|
<!-- 业务字段列 -->
|
||||||
<!-- 业务字段列 -->
|
<!-- 业务字段列 -->
|
||||||
<template v-if="column.dataIndex === 'dataStatus'">
|
<template v-if="column.dataIndex === 'dataStatus'">
|
||||||
<span v-if="record.asyncStatusList?.find(item => item.code === 'data')?.status === '200'"
|
<span v-if="record.asyncStatusList?.find(item => item.code === 'data')?.status === '100'"
|
||||||
|
class="status-loading">
|
||||||
|
<span>同步中</span>
|
||||||
|
</span>
|
||||||
|
<span v-else-if="record.asyncStatusList?.find(item => item.code === 'data')?.status === '200'"
|
||||||
class="status-success">
|
class="status-success">
|
||||||
<strong>成功</strong>
|
<strong>成功</strong>
|
||||||
</span>
|
</span>
|
||||||
|
@ -44,7 +48,11 @@
|
||||||
|
|
||||||
<!-- 指令资源列 -->
|
<!-- 指令资源列 -->
|
||||||
<template v-if="column.dataIndex === 'fileStatus'">
|
<template v-if="column.dataIndex === 'fileStatus'">
|
||||||
<span v-if="record.asyncStatusList?.find(item => item.code === 'file')?.status === '200'"
|
<span v-if="record.asyncStatusList?.find(item => item.code === 'file')?.status === '100'"
|
||||||
|
class="status-loading">
|
||||||
|
<span>同步中</span>
|
||||||
|
</span>
|
||||||
|
<span v-else-if="record.asyncStatusList?.find(item => item.code === 'file')?.status === '200'"
|
||||||
class="status-success">
|
class="status-success">
|
||||||
<strong>成功</strong>
|
<strong>成功</strong>
|
||||||
</span>
|
</span>
|
||||||
|
@ -60,22 +68,22 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="asyncmain-asyncMain" setup>
|
<script lang="ts" name="asyncmain-asyncMain" setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive } from 'vue';
|
||||||
import { BasicTable, useTable } from '/@/components/Table';
|
import { BasicTable, useTable } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { asyncMaincolumns } from './AsyncMain.data';
|
import { asyncMaincolumns } from './AsyncMain.data';
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AsyncMain.api';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AsyncMain.api';
|
||||||
import AsyncMainModal from './components/AsyncMainModal.vue'
|
import AsyncMainModal from './components/AsyncMainModal.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
orgCode: 'orgCode',
|
orgCode: 'orgCode',
|
||||||
type: '',
|
type: '',
|
||||||
});
|
});
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
title: '数据同步主表',
|
title: '数据同步主表',
|
||||||
api: list,
|
api: list,
|
||||||
|
@ -99,45 +107,45 @@
|
||||||
url: getImportUrl,
|
url: getImportUrl,
|
||||||
success: handleSuccess
|
success: handleSuccess
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增事件
|
* 新增事件
|
||||||
*/
|
*/
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
registerModal.value.disableSubmit = false;
|
registerModal.value.disableSubmit = false;
|
||||||
registerModal.value.add();
|
registerModal.value.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除事件
|
* 批量删除事件
|
||||||
*/
|
*/
|
||||||
async function batchHandleDelete() {
|
async function batchHandleDelete() {
|
||||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成功回调
|
* 成功回调
|
||||||
*/
|
*/
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
(selectedRowKeys.value = []) && reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询
|
* 查询
|
||||||
*/
|
*/
|
||||||
function searchQuery() {
|
function searchQuery() {
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
searchQuery
|
searchQuery
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.jeecg-basic-table-form-container {
|
.jeecg-basic-table-form-container {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
.table-page-search-submitButtons {
|
.table-page-search-submitButtons {
|
||||||
|
@ -165,19 +173,19 @@
|
||||||
:deep(.ant-input-number) {
|
:deep(.ant-input-number) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.ant-table-title) {
|
:deep(.ant-table-title) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-success {
|
.status-success {
|
||||||
color: #27ae60; // 现代绿色
|
color: #27ae60;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-error {
|
.status-error {
|
||||||
color: #e74c3c; // 现代红色
|
color: #e74c3c;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -0,0 +1,72 @@
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
list = '/canadddirective/canAddDirective/list',
|
||||||
|
save='/canadddirective/canAddDirective/add',
|
||||||
|
edit='/canadddirective/canAddDirective/edit',
|
||||||
|
deleteOne = '/canadddirective/canAddDirective/delete',
|
||||||
|
deleteBatch = '/canadddirective/canAddDirective/deleteBatch',
|
||||||
|
importExcel = '/canadddirective/canAddDirective/importExcel',
|
||||||
|
exportXls = '/canadddirective/canAddDirective/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,54 @@
|
||||||
|
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: 'instructionTag'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '服务类别',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'category'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '服务类型',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'type'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '服务指令',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'directiveName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '周期类型 1日常护理 2周期护理 3即时护理',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'cycleType'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建日期',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'createTime'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所属部门',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'orgCode_dictText'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 高级查询数据
|
||||||
|
export const superQuerySchema = {
|
||||||
|
instructionTag: {title: '分类标签',order: 0,view: 'text', type: 'string',},
|
||||||
|
category: {title: '服务类别',order: 1,view: 'text', type: 'string',},
|
||||||
|
type: {title: '服务类型',order: 2,view: 'text', type: 'string',},
|
||||||
|
directiveName: {title: '服务指令',order: 3,view: 'text', type: 'string',},
|
||||||
|
cycleType: {title: '周期类型 1日常护理 2周期护理 3即时护理',order: 4,view: 'text', type: 'string',},
|
||||||
|
createTime: {title: '创建日期',order: 5,view: 'datetime', type: 'string',},
|
||||||
|
orgCode: {title: '所属部门',order: 6,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'org_code', dictText: 'depart_name',},
|
||||||
|
};
|
|
@ -0,0 +1,218 @@
|
||||||
|
<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="orgCode">
|
||||||
|
<template #label><span title="所属部门">所属部门</span></template>
|
||||||
|
<j-select-multiple placeholder="请选择所属部门" v-model:value="queryParam.orgCode"
|
||||||
|
dictCode="sys_depart,depart_name,org_code" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||||
|
style="margin-left: 8px">重置</a-button>
|
||||||
|
</a-col>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable">
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<CanAddDirectiveModal ref="registerModal" @success="handleSuccess"></CanAddDirectiveModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="canadddirective-canAddDirective" setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { columns, superQuerySchema } from './CanAddDirective.data';
|
||||||
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CanAddDirective.api';
|
||||||
|
import CanAddDirectiveModal from './components/CanAddDirectiveModal.vue'
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||||
|
import { syncDirective } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.api';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
directiveMainOrgInfo: {},
|
||||||
|
existDirectiveIds: [],
|
||||||
|
})
|
||||||
|
const { createMessage, createConfirm } = useMessage();
|
||||||
|
const formRef = ref();
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
const registerModal = ref();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
|
tableProps: {
|
||||||
|
title: '可新增指令',
|
||||||
|
api: list,
|
||||||
|
columns,
|
||||||
|
canResize: false,
|
||||||
|
useSearchForm: false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 120,
|
||||||
|
fixed: 'right',
|
||||||
|
},
|
||||||
|
beforeFetch: async (params) => {
|
||||||
|
queryParam.existDirectiveIds = props.existDirectiveIds.map(item => item.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 handlePull(record) {
|
||||||
|
createConfirm({
|
||||||
|
iconType: 'warning',
|
||||||
|
title: '镜像确认',
|
||||||
|
content: '是否确认将服务指令【' + record.directiveName + '】同步给平台:' + props.directiveMainOrgInfo.departName,
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
syncDirective(
|
||||||
|
record.orgCode,
|
||||||
|
{
|
||||||
|
syncIds: record.directiveId,
|
||||||
|
upIds: '',
|
||||||
|
syncOrgCodes: props.directiveMainOrgInfo.orgCode,
|
||||||
|
syncOption: 'all',
|
||||||
|
}
|
||||||
|
).then(res => {
|
||||||
|
createMessage.success('已开始自动同步,可在日志中查看同步结果!')
|
||||||
|
}).catch(() => {
|
||||||
|
createMessage.error('镜像失败,请稍后再试')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '镜像',
|
||||||
|
onClick: handlePull.bind(null, record),
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
function searchQuery() {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置
|
||||||
|
*/
|
||||||
|
function searchReset() {
|
||||||
|
formRef.value.resetFields();
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
reload,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
</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,423 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<JFormContainer>
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
|
name="ConfigService2DirectiveForm">
|
||||||
|
<a-row v-show="isAudit">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-config-provider :disabled="false">
|
||||||
|
<a-form-item label="服务指令审核" v-bind="validateInfos.statusVal" id="ConfigServiceDirectiveForm-statusVal"
|
||||||
|
name="statusVal">
|
||||||
|
<a-select v-model:value="formData.statusVal" placeholder="请选择审核状态" style="width: 200px"
|
||||||
|
:disabled="false">
|
||||||
|
<a-select-option value="auditPass">审核通过</a-select-option>
|
||||||
|
<a-select-option value="auditFaild">审核不通过</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-config-provider>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
<JFormContainer :disabled="disabled" style="margin-top: -30px;">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
|
name="ConfigService2DirectiveForm">
|
||||||
|
<a-row v-show="!isEditMedia">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
|
||||||
|
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
||||||
|
<j-dict-select-tag v-model:value="formData.instructionTagId" :orgCode="formData?.sysOrgCode"
|
||||||
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
||||||
|
name="categoryId">
|
||||||
|
<j-dict-select-tag type="list" v-model:value="formData.categoryId" :orgCode="formData?.sysOrgCode"
|
||||||
|
:disabled="!formData.instructionTagId" :dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear
|
||||||
|
@upDictCode="upCategoryDictCode" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
||||||
|
name="typeId">
|
||||||
|
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode" :orgCode="formData?.sysOrgCode"
|
||||||
|
:disabled="!formData.categoryId" placeholder="请选择服务类型" allowClear @upDictCode="upTypeDictCode" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务指令名称" v-bind="validateInfos.directiveName"
|
||||||
|
id="ConfigServiceDirectiveForm-directiveName" name="directiveName">
|
||||||
|
<a-input v-model:value="formData.directiveName" placeholder="请输入服务指令名称" allow-clear></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="收费价格(元)" v-bind="validateInfos.tollPrice" id="ConfigServiceDirectiveForm-tollPrice"
|
||||||
|
name="tollPrice">
|
||||||
|
<a-input-number v-model:value="formData.tollPrice" placeholder="请输入收费价格" style="width: 100%"
|
||||||
|
precision="4" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="提成价格(元)" v-bind="validateInfos.comPrice" id="ConfigServiceDirectiveForm-comPrice"
|
||||||
|
name="comPrice">
|
||||||
|
<a-input-number v-model:value="formData.comPrice" placeholder="请输入提成价格" style="width: 100%"
|
||||||
|
precision="4" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="医保报销" v-bind="validateInfos.izReimbursement"
|
||||||
|
id="ConfigServiceDirectiveForm-izReimbursement" name="izReimbursement">
|
||||||
|
<j-dict-select-tag type='radio' v-model:value="formData.izReimbursement" dictCode="med_ins_reimb"
|
||||||
|
allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="机构优惠" v-bind="validateInfos.izPreferential"
|
||||||
|
id="ConfigServiceDirectiveForm-izPreferential" name="izPreferential">
|
||||||
|
<j-dict-select-tag type='radio' v-model:value="formData.izPreferential"
|
||||||
|
dictCode="institutional_discount" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
|
||||||
|
name="cycleType">
|
||||||
|
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type" :orgCode="formData?.sysOrgCode"
|
||||||
|
placeholder="请选择周期类型" allowClear @upDictCode="upCycleTypeDictCode" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务时长(分钟)" v-bind="validateInfos.serviceDuration"
|
||||||
|
id="ConfigServiceDirectiveForm-serviceDuration" name="serviceDuration">
|
||||||
|
<a-input-number v-model:value="formData.serviceDuration" :min="5" :max="55" :step="5"
|
||||||
|
placeholder="请输入服务时长(分钟)" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row v-show="!isEditMedia">
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
||||||
|
:wrapperCol="wrapperCol2" name="typeId">
|
||||||
|
<JCheckbox v-model:value="formData.bodyTags" :orgCode="formData?.sysOrgCode"
|
||||||
|
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = 0 order by sort asc`" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="情绪标签" :labelCol="labelCol2" :wrapperCol="wrapperCol2" name="emoTags">
|
||||||
|
<JCheckbox v-model:value="formData.emotionTags" :orgCode="formData?.sysOrgCode"
|
||||||
|
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = 0 order by sort asc`" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceDirectiveForm-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-row> -->
|
||||||
|
<!-- <a-col :span="12">
|
||||||
|
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
|
||||||
|
<span v-if="disabled && !formData.previewFile">暂无文件</span>
|
||||||
|
<JImageUpload v-else :fileMax="1" v-model:value="formData.previewFile"
|
||||||
|
:disabled="!canUploadPreviewImage" :bizPath="directiveBizPath">
|
||||||
|
</JImageUpload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务指令描述" v-bind="validateInfos.serviceContent"
|
||||||
|
id="ConfigServiceDirectiveForm-serviceContent" name="serviceContent">
|
||||||
|
<a-textarea v-model:value="formData.serviceContent" :rows="2" placeholder="请输入服务指令描述" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!-- </a-row> -->
|
||||||
|
<!-- <a-row v-show="!disabled">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
||||||
|
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"
|
||||||
|
:disabled="!canUploadPreviewImage" :bizPath="directiveBizPath"></j-upload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
||||||
|
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"
|
||||||
|
:disabled="!canUploadPreviewImage" :bizPath="directiveBizPath"></j-upload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row> -->
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
<!-- <JFormContainer style="margin-top: -40px;">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
|
name="ConfigServiceDirectiveForm">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12" v-if="!!formData.mp3File">
|
||||||
|
<a-form-item label="指令音频预览" id="ConfigServiceDirectiveForm-mp3File">
|
||||||
|
<audio controls disabled="false">
|
||||||
|
<source :src="getFileAccessHttpUrl(formData.mp3File)">
|
||||||
|
</audio>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12" v-if="disabled && !formData.mp3File">
|
||||||
|
<a-form-item label="指令音频预览">
|
||||||
|
<span>暂无文件</span>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12" v-if="!!formData.mp4File" :push="!!formData.mp3File ? 0 : 12">
|
||||||
|
<a-form-item label="指令视频预览" id="ConfigServiceDirectiveForm-mp4File">
|
||||||
|
<video controls>
|
||||||
|
<source :src="getFileAccessHttpUrl(formData.mp4File)">
|
||||||
|
</video>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12" v-if="disabled && !formData.mp3File">
|
||||||
|
<a-form-item label="指令视频预览">
|
||||||
|
<span>暂无文件</span>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
|
||||||
|
<span v-if="disabled && !formData.immediateFile">暂无文件</span>
|
||||||
|
<JImageUpload v-else :fileMax="1" v-model:value="formData.immediateFile"
|
||||||
|
:disabled="!canUploadPreviewImage || disabled" :bizPath="directiveBizPath">
|
||||||
|
</JImageUpload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
</JFormContainer> -->
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, watch } from 'vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
import { JCheckbox } from '/@/components/Form';
|
||||||
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||||
|
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||||
|
import { getValueType } from '/@/utils';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
|
|
||||||
|
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: '',
|
||||||
|
categoryId: '',
|
||||||
|
typeId: '',
|
||||||
|
instructionTagId: '',
|
||||||
|
directiveName: '',
|
||||||
|
tollPrice: 0,
|
||||||
|
comPrice: 0,
|
||||||
|
izReimbursement: '0',
|
||||||
|
izPreferential: '0',
|
||||||
|
chargingFrequency: '',
|
||||||
|
cycleType: '',
|
||||||
|
sort: 99,
|
||||||
|
serviceContent: '',
|
||||||
|
serviceDuration: '5',
|
||||||
|
izEnabled: '0',
|
||||||
|
createBy: '',
|
||||||
|
createTime: '',
|
||||||
|
updateBy: '',
|
||||||
|
updateTime: '',
|
||||||
|
mp3File: '',
|
||||||
|
mp4File: '',
|
||||||
|
previewFile: '',
|
||||||
|
immediateFile: '',
|
||||||
|
status: '',
|
||||||
|
statusVal: undefined,
|
||||||
|
sysOrgCode: undefined,
|
||||||
|
});
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
|
||||||
|
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
const isEditMedia = ref(false)
|
||||||
|
const isAudit = ref(false)
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = reactive({
|
||||||
|
categoryId: [{ required: true, message: '请选择服务类别!' },],
|
||||||
|
typeId: [{ required: true, message: '请选择服务类型!' },],
|
||||||
|
instructionTagId: [{ required: true, message: '请选择分类标签!' },],
|
||||||
|
directiveName: [{ required: true, message: '请输入服务指令名称!' },],
|
||||||
|
tollPrice: [{ required: true, message: '请输入收费价格!' }, { pattern: /^(([0-9]*)|([0]\.\d{0,4}|[1-9][0-9]*\.\d{0,4}))$/, message: '请输入正确的金额!' },],
|
||||||
|
comPrice: [{ required: false }, { pattern: /^(([0-9]*)|([0]\.\d{0,4}|[1-9][0-9]*\.\d{0,4}))$/, message: '请输入正确的金额!' },],
|
||||||
|
izReimbursement: [{ required: true, message: '请选择是否参与医保报销!' },],
|
||||||
|
izPreferential: [{ required: true, message: '请选择是否参与机构优惠!' },],
|
||||||
|
// chargingFrequency: [{ required: true, message: '请选择收费频次!' },],
|
||||||
|
cycleType: [{ required: true, message: '请选择周期类型!' },],
|
||||||
|
// sort: [{ required: true, message: '请输入排序!' }, { pattern: /^\d+$/, message: '请输入正整数!' },],
|
||||||
|
serviceDuration: [
|
||||||
|
{ required: true, message: '请输入服务时长(分钟)!' },
|
||||||
|
{ pattern: /^\d+$/, message: '请输入正整数!' },
|
||||||
|
{
|
||||||
|
validator: (_, value) => {
|
||||||
|
if (value % 5 !== 0) {
|
||||||
|
return Promise.reject('请输入5的倍数!');
|
||||||
|
}
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (_, value) => {
|
||||||
|
if (value < 5 || value > 55) {
|
||||||
|
return Promise.reject('请输入5到55之间的值!');
|
||||||
|
}
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
const categoryDictCode = ref('')
|
||||||
|
const typeDictCode = ref('')
|
||||||
|
// 计算属性:是否可以上传预览图片
|
||||||
|
const canUploadPreviewImage = computed(() => {
|
||||||
|
return formData.instructionTagId &&
|
||||||
|
formData.categoryId &&
|
||||||
|
formData.typeId &&
|
||||||
|
formData.directiveName &&
|
||||||
|
formData.cycleType;
|
||||||
|
});
|
||||||
|
|
||||||
|
//分类标签名称
|
||||||
|
const instructionComDictCode = ref([])
|
||||||
|
function upInstructionDictCode(v_) {
|
||||||
|
instructionComDictCode.value = v_
|
||||||
|
}
|
||||||
|
//服务类别名称
|
||||||
|
const categoryComDictCode = ref([])
|
||||||
|
function upCategoryDictCode(v_) {
|
||||||
|
categoryComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
//服务类型名称
|
||||||
|
const typeComDictCode = ref([])
|
||||||
|
function upTypeDictCode(v_) {
|
||||||
|
typeComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
//周期类型名称
|
||||||
|
const cycleTypeComDictCode = ref([])
|
||||||
|
function upCycleTypeDictCode(v_) {
|
||||||
|
cycleTypeComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
watch([instructionComDictCode, categoryComDictCode, typeComDictCode, cycleTypeComDictCode], () => {
|
||||||
|
// 当这些字典数据变化时,强制重新计算 directiveBizPath
|
||||||
|
}, { deep: true });
|
||||||
|
|
||||||
|
const directiveBizPath = computed(() => {
|
||||||
|
if (!canUploadPreviewImage.value) return '';
|
||||||
|
|
||||||
|
// 获取各个字段的字典值
|
||||||
|
const instructionTagName_ = instructionComDictCode.value.filter(d => d.value == formData.instructionTagId)?.[0]?.label;
|
||||||
|
const categoryName_ = categoryComDictCode.value.filter(d => d.value == formData.categoryId)?.[0]?.label;
|
||||||
|
const typeName_ = typeComDictCode.value.filter(d => d.value == formData.typeId)?.[0]?.label;
|
||||||
|
const cycleTypeName_ = cycleTypeComDictCode.value.filter(d => d.value == formData.cycleType)?.[0]?.label;
|
||||||
|
|
||||||
|
// 构建路径
|
||||||
|
return 'directive/' + `${instructionTagName_}/${categoryName_}/${typeName_}/${formData.directiveName}/${cycleTypeName_}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => formData.instructionTagId,
|
||||||
|
(newInstructionTagId) => {
|
||||||
|
if (!newInstructionTagId) {
|
||||||
|
formData.categoryId = ''
|
||||||
|
formData.typeId = ''
|
||||||
|
categoryDictCode.value = 'nu_config_service_category,category_name,id,1=2';
|
||||||
|
} else {
|
||||||
|
categoryDictCode.value = `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${newInstructionTagId}' order by sort asc`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => formData.categoryId,
|
||||||
|
(newCategoryId) => {
|
||||||
|
if (!newCategoryId) {
|
||||||
|
formData.typeId = ''
|
||||||
|
typeDictCode.value = 'nu_config_service_type,type_name,id,del_flag = 99 order by sort asc';
|
||||||
|
} else {
|
||||||
|
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${newCategoryId}' order by sort asc`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
edit({});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* isEditMedia_是否为编辑指令资源 (隐藏业务字段)
|
||||||
|
* isAudit_是否为服务指令那个审核 (隐藏业务字段)
|
||||||
|
*/
|
||||||
|
function edit(record, isEditMedia_ = false, isAudit_ = false) {
|
||||||
|
console.log("🌊 ~ edit ~ record:", record)
|
||||||
|
isEditMedia.value = isEditMedia_
|
||||||
|
isAudit.value = isAudit_
|
||||||
|
formData.bodyTags = ''
|
||||||
|
formData.emotionTags = ''
|
||||||
|
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>
|
||||||
|
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
|
||||||
|
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
|
||||||
|
:maskClosable="false">
|
||||||
|
<template #footer>
|
||||||
|
<a-button @click="handleCancel">关闭</a-button>
|
||||||
|
</template>
|
||||||
|
<CanAddDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||||
|
:formBpm="false"></CanAddDirectiveForm>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose, defineProps } from 'vue';
|
||||||
|
import CanAddDirectiveForm from './CanAddDirectiveForm.vue'
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
import { queryById } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.api';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
});
|
||||||
|
const title = ref<string>('');
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const auditVisible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const registerForm = ref();
|
||||||
|
const auditListRef = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
const opeType = ref('')//操作类型 add新增 edit编辑 editMedia主列表-指令资源 look详情 audit审核 auditMedia审核列表-指令资源
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
title.value = '详情';
|
||||||
|
visible.value = true;
|
||||||
|
queryById({ dataSourceCode: record.orgCode, id: record.directiveId }).then(res => {
|
||||||
|
registerForm.value.edit(res);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核列表 - 审核
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function audit(record) {
|
||||||
|
title.value = '审核';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.edit(record, false, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开审核列表
|
||||||
|
*/
|
||||||
|
function openAuditList() {
|
||||||
|
auditVisible.value = true;
|
||||||
|
auditListRef.value?.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑指令资源
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function editMedia(record) {
|
||||||
|
title.value = '编辑指令资源';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.edit(record, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
if (opeType.value == 'audit') {
|
||||||
|
registerForm.value.submitAudit();
|
||||||
|
} else {
|
||||||
|
registerForm.value.submitForm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂存
|
||||||
|
*/
|
||||||
|
function handleSave() {
|
||||||
|
registerForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给审核对应的业务平台同步资源
|
||||||
|
*/
|
||||||
|
function handleMediaAsync() {
|
||||||
|
registerForm.value.syncMediaForBizFunc();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给所有业务平台同步资源
|
||||||
|
*/
|
||||||
|
function handleMediaSyncAllPlat() {
|
||||||
|
registerForm.value.syncMediaForAllBizFunc();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核列表-关闭按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleAuditCancel() {
|
||||||
|
auditVisible.value = false;
|
||||||
|
emit('success')
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
edit,
|
||||||
|
editMedia,
|
||||||
|
disableSubmit,
|
||||||
|
audit,
|
||||||
|
openAuditList,
|
||||||
|
opeType,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped></style>
|
|
@ -5,8 +5,10 @@
|
||||||
<a-col v-for="item in orgTableList.records" :key="item.id" :xs="24" :sm="24" :md="props.layout == 'full' ? 12 : 8"
|
<a-col v-for="item in orgTableList.records" :key="item.id" :xs="24" :sm="24" :md="props.layout == 'full' ? 12 : 8"
|
||||||
:lg="props.layout == 'full' ? 12 : 8" :xl="props.layout == 'full' ? 8 : 8" :xxl="props.layout == 'full' ? 6 : 8"
|
:lg="props.layout == 'full' ? 12 : 8" :xl="props.layout == 'full' ? 8 : 8" :xxl="props.layout == 'full' ? 6 : 8"
|
||||||
style="padding: 8px;">
|
style="padding: 8px;">
|
||||||
<a-card :class="{ 'selected-card': selectedOrgs.some(org => org.orgCode === item.orgCode) }"
|
<a-card :class="{
|
||||||
style="width: 100%; border-radius: 8px; " :headStyle="{ height: '60px', padding: '0 24px' }"
|
'selected-card': selectedOrgs.some(org => org.orgCode === item.orgCode),
|
||||||
|
'directive-selected-card': directiveSelectedOrg?.orgCode === item.orgCode
|
||||||
|
}" style="width: 100%; border-radius: 8px; " :headStyle="{ height: '60px', padding: '0 24px' }"
|
||||||
:style="{ cursor: showChoose ? 'pointer' : 'default' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }"
|
:style="{ cursor: showChoose ? 'pointer' : 'default' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }"
|
||||||
@click="handleCardClick(item)">
|
@click="handleCardClick(item)">
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -17,6 +19,8 @@
|
||||||
<!-- 如果是已选择,显示"已选择" -->
|
<!-- 如果是已选择,显示"已选择" -->
|
||||||
<span style="color: green; font-size: 12px; margin-left: 8px;"
|
<span style="color: green; font-size: 12px; margin-left: 8px;"
|
||||||
v-if="selectedOrgs.some(org => org.orgCode === item.orgCode)">已选择</span>
|
v-if="selectedOrgs.some(org => org.orgCode === item.orgCode)">已选择</span>
|
||||||
|
<span style="color: #d48806; font-size: 12px; margin-left: 8px;"
|
||||||
|
v-if="directiveSelectedOrg?.orgCode === item.orgCode">指令库已选择</span>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="props.layout == 'full' ? 2 : 3" style="text-align: center; padding-top: 4px;">
|
<a-col :span="props.layout == 'full' ? 2 : 3" style="text-align: center; padding-top: 4px;">
|
||||||
|
@ -34,6 +38,11 @@
|
||||||
<span class="tbClass"><img src="/@/assets/images/a14.png" style="width:20px;" /></span><br />
|
<span class="tbClass"><img src="/@/assets/images/a14.png" style="width:20px;" /></span><br />
|
||||||
<span class="antTitle">详情</span>
|
<span class="antTitle">详情</span>
|
||||||
</span>
|
</span>
|
||||||
|
<!-- <span v-show="showDirectiveMain" style="display:inline-block;cursor: pointer;margin-left: 10px;"
|
||||||
|
@click.stop="handleDetail(item)">
|
||||||
|
<span class="tbClass"><img src="/@/assets/images/safety.png" style="width:20px;" /></span><br />
|
||||||
|
<span class="antTitle">指令库</span>
|
||||||
|
</span> -->
|
||||||
<!-- 根据 showChoose 判断是否显示选择按钮 -->
|
<!-- 根据 showChoose 判断是否显示选择按钮 -->
|
||||||
<!-- <span v-if="showChoose" style="display:inline-block; cursor: pointer; margin-left: 20px;"
|
<!-- <span v-if="showChoose" style="display:inline-block; cursor: pointer; margin-left: 20px;"
|
||||||
@click.stop="handleCardClick(item)">
|
@click.stop="handleCardClick(item)">
|
||||||
|
@ -72,7 +81,9 @@ const props = defineProps({
|
||||||
title: { type: String, default: '' },
|
title: { type: String, default: '' },
|
||||||
allowMultipleSelection: { type: Boolean, default: false }, // 多选控制
|
allowMultipleSelection: { type: Boolean, default: false }, // 多选控制
|
||||||
layout: { type: String, default: 'full' }, // 控制布局: 'full' 或 'half'
|
layout: { type: String, default: 'full' }, // 控制布局: 'full' 或 'half'
|
||||||
excludeOrgCode: { type: String, default: '' }//排除的机构(不展示)
|
excludeOrgCode: { type: String, default: '' },//排除的机构(不展示)
|
||||||
|
showDirectiveMain: { type: Boolean, default: false },//指令库按钮
|
||||||
|
showDirectiveChoose: { type: Boolean, default: false }, // 新增:是否可以选择指令库
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['handleOrgDetail', 'handleOrgChoose'])
|
const emit = defineEmits(['handleOrgDetail', 'handleOrgChoose'])
|
||||||
|
@ -80,12 +91,17 @@ const emit = defineEmits(['handleOrgDetail', 'handleOrgChoose'])
|
||||||
const orgTableList = ref<any>({ records: [], total: 0 })
|
const orgTableList = ref<any>({ records: [], total: 0 })
|
||||||
const queryParam = reactive<any>({})
|
const queryParam = reactive<any>({})
|
||||||
const pageParams = ref({ pageNo: 1, pageSize: props.pageSize })
|
const pageParams = ref({ pageNo: 1, pageSize: props.pageSize })
|
||||||
|
const directiveSelectedOrg = ref<any>(null)
|
||||||
|
|
||||||
// 当前选中的卡片 ID 数组
|
// 当前选中的卡片 ID 数组
|
||||||
const selectedOrgs = ref<string[]>([])
|
const selectedOrgs = ref<string[]>([])
|
||||||
|
|
||||||
/** 点击卡片选择 */
|
/** 点击卡片选择 */
|
||||||
function handleCardClick(item: any) {
|
function handleCardClick(item: any) {
|
||||||
|
if (props.showDirectiveChoose) {
|
||||||
|
directiveSelectedOrg.value = item
|
||||||
|
emit('handleOrgChoose', item)
|
||||||
|
}
|
||||||
if (props.showChoose) { // 判断是否可以选择
|
if (props.showChoose) { // 判断是否可以选择
|
||||||
if (props.allowMultipleSelection) {
|
if (props.allowMultipleSelection) {
|
||||||
// 多选模式:点击时添加或移除该卡片
|
// 多选模式:点击时添加或移除该卡片
|
||||||
|
@ -120,6 +136,14 @@ function reload() {
|
||||||
getOrgInfo(queryParam).then(res => {
|
getOrgInfo(queryParam).then(res => {
|
||||||
res.records = res.records.filter(o => o.orgCode != props.excludeOrgCode)
|
res.records = res.records.filter(o => o.orgCode != props.excludeOrgCode)
|
||||||
orgTableList.value = res
|
orgTableList.value = res
|
||||||
|
// 在reload函数中添加
|
||||||
|
if (props.showDirectiveChoose) {
|
||||||
|
const defaultSelected = res.records.find(item => item.izDirectiveMain === '0')
|
||||||
|
if (defaultSelected) {
|
||||||
|
directiveSelectedOrg.value = defaultSelected
|
||||||
|
emit('handleOrgChoose', defaultSelected)
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,4 +230,9 @@ defineExpose({
|
||||||
border: 2px solid #1890ff;
|
border: 2px solid #1890ff;
|
||||||
box-shadow: 0 0 8px rgba(24, 144, 255, 0.3);
|
box-shadow: 0 0 8px rgba(24, 144, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.directive-selected-card {
|
||||||
|
border: 2px solid #d48806;
|
||||||
|
box-shadow: 0 0 8px rgba(212, 136, 6, 0.3);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -8,6 +8,7 @@ enum Api {
|
||||||
listByDS = '/services/serviceDirective/listByDS',
|
listByDS = '/services/serviceDirective/listByDS',
|
||||||
queryById = '/services/serviceDirective/queryById',
|
queryById = '/services/serviceDirective/queryById',
|
||||||
syncDirective = '/services/serviceDirective/syncDirective',
|
syncDirective = '/services/serviceDirective/syncDirective',
|
||||||
|
idListByDS = '/services/serviceDirective/idListByDS',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,6 +24,13 @@ export const queryById = (params) => defHttp.get({ url: Api.queryById, params })
|
||||||
*/
|
*/
|
||||||
export const listByDS = (params) => defHttp.get({ url: Api.listByDS, 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
|
* @param params
|
||||||
|
|
|
@ -41,28 +41,28 @@ export const columns: BasicColumn[] = [
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'bodyTagList',
|
dataIndex: 'bodyTagList',
|
||||||
ellipsis: false,
|
ellipsis: false,
|
||||||
defaultHidden: true,
|
defaultHidden: false,
|
||||||
// format(text, record, index) {
|
format(text, record, index) {
|
||||||
// if (!!text) {
|
if (!!text) {
|
||||||
// return text.map((item) => item.tagName).join('、');
|
return text.map((item) => item.tagName).join('、');
|
||||||
// } else {
|
} else {
|
||||||
// return '-';
|
return '-';
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '情绪标签',
|
title: '情绪标签',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'emotionTagList',
|
dataIndex: 'emotionTagList',
|
||||||
ellipsis: false,
|
ellipsis: false,
|
||||||
defaultHidden: true,
|
defaultHidden: false,
|
||||||
// format(text, record, index) {
|
format(text, record, index) {
|
||||||
// if (!!text) {
|
if (!!text) {
|
||||||
// return text.map((item) => item.tagName).join('、');
|
return text.map((item) => item.tagName).join('、');
|
||||||
// } else {
|
} else {
|
||||||
// return '-';
|
return '-';
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '收费价格',
|
title: '收费价格',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭" :maskClosable="false">
|
<j-modal :title="title" width="75vw" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭" :maskClosable="false">
|
||||||
<ConfigServiceDirectiveList ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ConfigServiceDirectiveList>
|
<ConfigServiceDirectiveList ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ConfigServiceDirectiveList>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -21,10 +21,12 @@
|
||||||
style="margin-right: 10px;">镜像</a-button>
|
style="margin-right: 10px;">镜像</a-button>
|
||||||
<a-button type="primary" preIcon="ant-design:file-text-twotone" @click="handleViewLogs"
|
<a-button type="primary" preIcon="ant-design:file-text-twotone" @click="handleViewLogs"
|
||||||
style="margin-right: 10px;">日志</a-button>
|
style="margin-right: 10px;">日志</a-button>
|
||||||
<a-badge :count="609" style="margin-right: 10px;">
|
<a-button type="primary" preIcon="ant-design:safety-certificate-twotone" @click="handleDirectiveMainFunc"
|
||||||
|
style="margin-right: 10px;">指令库</a-button>
|
||||||
|
<!-- <a-badge :count="609" style="margin-right: 10px;"> -->
|
||||||
<a-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
|
<a-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
|
||||||
@click="handleLookNewDirectives">新增指令</a-button>
|
@click="handleLookNewDirectives">新增指令</a-button>
|
||||||
</a-badge>
|
<!-- </a-badge> -->
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
@ -38,16 +40,46 @@
|
||||||
<a-modal v-model:visible="logsVisible" title="日志" width="90vw"
|
<a-modal v-model:visible="logsVisible" title="日志" width="90vw"
|
||||||
:bodyStyle="{ padding: '0', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'hidden' }"
|
:bodyStyle="{ padding: '0', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'hidden' }"
|
||||||
wrapClassName="org-list-modal" @cancel="handleCancelLogs">
|
wrapClassName="org-list-modal" @cancel="handleCancelLogs">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="2" :push="22" style="margin-top: 15px;margin-left: 60px;">
|
||||||
|
<a-button type="primary" @click="handleRefreshLogs" title="刷新">
|
||||||
|
刷新
|
||||||
|
</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<a-button @click="handleCancelLogs" type="primary">关闭</a-button>
|
<a-button @click="handleCancelLogs" type="primary">关闭</a-button>
|
||||||
</template>
|
</template>
|
||||||
<AsyncListComponent></AsyncListComponent>
|
<AsyncListComponent ref="logsRef"></AsyncListComponent>
|
||||||
|
</a-modal>
|
||||||
|
<!-- 指令库 -->
|
||||||
|
<a-modal v-model:visible="directiveMainVisible" title="指令库" width="90vw"
|
||||||
|
:bodyStyle="{ padding: '0', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'hidden' }"
|
||||||
|
wrapClassName="org-list-modal" @cancel="handleCanceldirectiveMain">
|
||||||
|
<template #footer>
|
||||||
|
<a-button @click="handleCanceldirectiveMain" type="primary">关闭</a-button>
|
||||||
|
<a-button @click="handleAsyncdirectiveMain" type="primary">确认</a-button>
|
||||||
|
</template>
|
||||||
|
<OrgListCom ref="directiveMainComRef" :showDirectiveMain=true :showDirectiveChoose="true"
|
||||||
|
@handleOrgDetail="handleDetail" :showDetail=true @handleOrgChoose="directiveMainFunc">
|
||||||
|
</OrgListCom>
|
||||||
|
</a-modal>
|
||||||
|
<!-- 新增指令 -->
|
||||||
|
<a-modal v-model:visible="newDirectiveVisible" title="新增指令" width="90vw"
|
||||||
|
:bodyStyle="{ padding: '0', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'hidden' }"
|
||||||
|
wrapClassName="org-list-modal" @cancel="handleCancelNewDirective">
|
||||||
|
<template #footer>
|
||||||
|
<a-button @click="handleCancelNewDirective" type="primary">关闭</a-button>
|
||||||
|
<!-- <a-button @click="handleAsyncNewDirective" type="primary">同步</a-button> -->
|
||||||
|
</template>
|
||||||
|
<CanAddDirectiveList ref="canAddDirectiveRef" :directiveMainOrgInfo="directiveMainOrgInfo"
|
||||||
|
:existDirectiveIds="existDirectiveIds"></CanAddDirectiveList>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="synchronization-directive2" lang="ts">
|
<script setup name="synchronization-directive2" lang="ts">
|
||||||
import { ref, reactive, computed, onMounted } from 'vue'
|
import { ref, reactive, computed, onMounted, watch } from 'vue'
|
||||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
// 以下为服务指令引用:
|
// 以下为服务指令引用:
|
||||||
import { list, asyncFunc, departList } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
import { list, asyncFunc, departList } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
||||||
|
@ -58,10 +90,19 @@ import SyncStepListModal from '/@/views/synchronization/directive/syncStep/SyncS
|
||||||
import { getOrgInfo } from '/@/views/admin/orgapplyinfo/OrgApplyInfo.api';
|
import { getOrgInfo } from '/@/views/admin/orgapplyinfo/OrgApplyInfo.api';
|
||||||
//机构列表
|
//机构列表
|
||||||
import OrgListCom from '/@/views/synchronization/directive/orgCom/OrgListCom.vue'
|
import OrgListCom from '/@/views/synchronization/directive/orgCom/OrgListCom.vue'
|
||||||
|
//可新增指令
|
||||||
|
import CanAddDirectiveList from '/@/views/synchronization/directive/canadddirective/CanAddDirectiveList.vue'
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import AsyncListComponent from '@/components/dataAsync/AsyncMainList0731.vue'
|
import AsyncListComponent from '@/components/dataAsync/AsyncMainList0731.vue'
|
||||||
|
import { getDirectiveMain, changeDirectiveMain } from '/@/api/common/api'
|
||||||
|
import { idListByDS } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.api';
|
||||||
|
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage()
|
||||||
|
const canAddDirectiveRef = ref()
|
||||||
|
const newDirectiveVisible = ref(false)
|
||||||
|
const directiveMainComRef = ref();
|
||||||
|
const newDirectiveRef = ref()
|
||||||
|
const logsRef = ref()
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const configServiceDirectiveListModal = ref();
|
const configServiceDirectiveListModal = ref();
|
||||||
const syncStepListModal = ref();
|
const syncStepListModal = ref();
|
||||||
|
@ -70,6 +111,10 @@ const queryParam = reactive<any>({});
|
||||||
const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
||||||
const orgListComRef = ref()
|
const orgListComRef = ref()
|
||||||
const logsVisible = ref(false)
|
const logsVisible = ref(false)
|
||||||
|
const directiveMainVisible = ref(false)
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
const existDirectiveIds = ref([])//指令库已存在指令id
|
||||||
|
const directiveMainOrgInfo = ref()
|
||||||
|
|
||||||
const labelCol = reactive({
|
const labelCol = reactive({
|
||||||
xs: 24,
|
xs: 24,
|
||||||
|
@ -126,10 +171,11 @@ function searchReset() {
|
||||||
*/
|
*/
|
||||||
function handleViewLogs() {
|
function handleViewLogs() {
|
||||||
logsVisible.value = true
|
logsVisible.value = true
|
||||||
|
handleRefreshLogs()
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleLookNewDirectives() {
|
function handleLookNewDirectives() {
|
||||||
createMessage.warning('功能开发中')
|
newDirectiveVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
//关闭日志模态框
|
//关闭日志模态框
|
||||||
|
@ -137,9 +183,91 @@ function handleCancelLogs() {
|
||||||
logsVisible.value = false
|
logsVisible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//刷新日志
|
||||||
|
function handleRefreshLogs() {
|
||||||
|
logsRef.value?.searchQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭新增指令
|
||||||
|
*/
|
||||||
|
function handleCancelNewDirective() {
|
||||||
|
newDirectiveVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步新增指令
|
||||||
|
*/
|
||||||
|
function handleAsyncNewDirective() {
|
||||||
|
// newDirectiveRef
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开指令库
|
||||||
|
*/
|
||||||
|
function handleDirectiveMainFunc() {
|
||||||
|
directiveMainVisible.value = true
|
||||||
|
directiveMainComRef.value?.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭指令库
|
||||||
|
*/
|
||||||
|
function handleCanceldirectiveMain() {
|
||||||
|
directiveMainVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(directiveMainOrgInfo, (newValue, oldValue) => {
|
||||||
|
idListByDS({ dataSourceCode: newValue.orgCode }).then(res => {
|
||||||
|
existDirectiveIds.value = res.records
|
||||||
|
canAddDirectiveRef.value?.reload()
|
||||||
|
})
|
||||||
|
}, { deep: true })
|
||||||
|
|
||||||
|
const tempDM = ref()
|
||||||
|
/**
|
||||||
|
* 指令库对应机构信息
|
||||||
|
*/
|
||||||
|
function directiveMainFunc(orgInfo_) {
|
||||||
|
tempDM.value = orgInfo_
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认指令库
|
||||||
|
*/
|
||||||
|
function handleAsyncdirectiveMain() {
|
||||||
|
createConfirm({
|
||||||
|
iconType: 'warning',
|
||||||
|
title: '指令库变更提醒',
|
||||||
|
content: '是否变更指令库为:' + tempDM.value.departName,
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
directiveMainOrgInfo.value = tempDM.value
|
||||||
|
changeDirectiveMain(directiveMainOrgInfo.value.orgCode).then(() => {
|
||||||
|
createMessage.success('指令库已变更')
|
||||||
|
handleCanceldirectiveMain()
|
||||||
|
canAddDirectiveRef.value?.reload()
|
||||||
|
}).catch(() => {
|
||||||
|
createMessage.error('指令库变更失败,请稍后再试')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取指令库机构信息
|
||||||
|
function getDirectiveMainOrgInfo() {
|
||||||
|
getDirectiveMain().then(res => {
|
||||||
|
directiveMainOrgInfo.value = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 自动请求并暴露内部方法
|
// 自动请求并暴露内部方法
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
reload();
|
reload();
|
||||||
|
getDirectiveMainOrgInfo()
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -225,4 +353,11 @@ onMounted(() => {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content-refresh-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 60px;
|
||||||
|
right: 20px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,6 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title" :width="800" v-bind="$attrs" @ok="handleOk" @register="registerModal">
|
<BasicModal :title="title" :width="800" v-bind="$attrs" @ok="handleOk" @register="registerModal">
|
||||||
<BasicForm @register="registerForm">
|
<BasicForm @register="registerForm">
|
||||||
|
<!-- 是否标准指令库 -->
|
||||||
|
<template #izDirectiveMain="{ model, field }">
|
||||||
|
<a-radio-group v-model:value="model[field]" name="radioGroup">
|
||||||
|
<a-radio value="0">是</a-radio>
|
||||||
|
<a-radio value="1">否</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</template>
|
||||||
<!-- 省份 -->
|
<!-- 省份 -->
|
||||||
<template #province="{ model, field }">
|
<template #province="{ model, field }">
|
||||||
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
|
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
|
||||||
|
@ -82,6 +89,10 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
|
||||||
field: 'contextPath',
|
field: 'contextPath',
|
||||||
show: !isChild,
|
show: !isChild,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'izDirectiveMain',
|
||||||
|
show: !isChild,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'orgCategory',
|
field: 'orgCategory',
|
||||||
componentProps: { options: categoryOptions },
|
componentProps: { options: categoryOptions },
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<BasicForm @register="registerForm">
|
<BasicForm @register="registerForm">
|
||||||
|
<!-- 是否标准指令库 -->
|
||||||
|
<template #izDirectiveMain="{ model, field }">
|
||||||
|
<a-radio-group v-model:value="model[field]" name="radioGroup">
|
||||||
|
<a-radio value="0">是</a-radio>
|
||||||
|
<a-radio value="1">否</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</template>
|
||||||
<!-- 省份 -->
|
<!-- 省份 -->
|
||||||
<!-- <template #province="{ model, field }">
|
<!-- <template #province="{ model, field }">
|
||||||
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
|
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
|
||||||
|
|
|
@ -62,6 +62,15 @@ export function useBasicFormSchema() {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
|
// field: 'izDirectiveMain',
|
||||||
|
// label: '是否标准指令库',
|
||||||
|
// component: 'Input',
|
||||||
|
// ifShow: (v_) => {
|
||||||
|
// return !v_.values.parentId;
|
||||||
|
// },
|
||||||
|
// slot: 'izDirectiveMain',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
// field: 'province',
|
// field: 'province',
|
||||||
// label: '省份',
|
// label: '省份',
|
||||||
// component: 'Input',
|
// component: 'Input',
|
||||||
|
|
Loading…
Reference in New Issue