服务指令流程配置

This commit is contained in:
1378012178@qq.com 2025-12-08 16:41:00 +08:00
parent fd69696e6a
commit 8dcaadfb03
14 changed files with 3204 additions and 62 deletions

View File

@ -79,7 +79,7 @@ export default defineComponent({
ignoreDisabled: propTypes.bool.def(false),
orgCode: '',//
},
emits: ['options-change', 'change', 'update:value', 'upDictCode'],
emits: ['options-change', 'change', 'update:value', 'upDictCode', 'currentText'],
setup(props, { emit, refs }) {
const dictOptions = ref<any[]>([]);
const attrs = useAttrs();
@ -163,6 +163,11 @@ export default defineComponent({
}
} else {
changeValue = e?.target?.value ?? e;
if (!e) {
emit('currentText', null)
} else {
emit('currentText', dictOptions.value.filter(item => item.value == changeValue)[0].label)
}
}
state.value = changeValue;

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/services/flow/main/list',
save='/services/flow/main/add',
edit='/services/flow/main/edit',
deleteOne = '/services/flow/main/delete',
deleteBatch = '/services/flow/main/deleteBatch',
importExcel = '/services/flow/main/importExcel',
exportXls = '/services/flow/main/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 });
}

View File

@ -0,0 +1,58 @@
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: 'flowName',
},
{
title: '分类标签',
align: 'center',
dataIndex: 'instructionTagId_dictText',
},
{
title: '服务类别',
align: 'center',
dataIndex: 'categoryId_dictText',
},
{
title: '服务类型',
align: 'center',
dataIndex: 'typeId_dictText',
},
{
title: '是否启用',
align: 'center',
dataIndex: 'izEnabled_dictText',
},
];
// 高级查询数据
export const superQuerySchema = {
flowName: { title: '节点名称', order: 0, view: 'text', type: 'string' },
izEnabled: { title: '是否启用', order: 1, view: 'list', type: 'string', dictCode: 'iz_enabled' },
instructionTagId: {
title: '分类标签',
order: 2,
view: 'list',
type: 'string',
dictTable: 'nu_config_service_instruction_tag',
dictCode: 'id',
dictText: 'instruction_name',
},
categoryId: {
title: '服务类别',
order: 3,
view: 'list',
type: 'string',
dictTable: 'nu_config_service_category',
dictCode: 'id',
dictText: 'category_name',
},
typeId: { title: '服务类型', order: 4, view: 'list', type: 'string', dictTable: 'nu_config_service_type', dictCode: 'id', dictText: 'type_name' },
};

View File

@ -0,0 +1,294 @@
<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="flowName">
<template #label><span title="节点名称">流程名称</span></template>
<JInput v-model:value="queryParam.flowName" placeholder="请输入流程名称" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="instructionTagId">
<template #label><span title="分类标签">分类标签</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.instructionTagId" @change="instructionTagChanged"
dictCode="nu_config_service_instruction_tag,instruction_name,id" placeholder="请选择分类标签" allowClear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="categoryId">
<template #label><span title="服务类别">服务类别</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.categoryId"
:dictCode="`nu_config_service_category,category_name,id,instruction_id = '${queryParam.instructionTagId || ''}'`"
placeholder="请选择服务类别" allow-clear @change="categoryChanged" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="typeId">
<template #label><span title="服务类型">服务类型</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.typeId"
:dictCode="`nu_config_service_type,type_name,id,instruction_id = '${queryParam.instructionTagId || ''}' and category_id = '${queryParam.categoryId || ''}' `"
placeholder="请选择服务类型" allow-clear />
<!-- <j-select-multiple placeholder="请选择服务类型" v-model:value="queryParam.typeId"
dictCode="nu_config_service_type,type_name,id" allow-clear /> -->
</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' v-model:value="queryParam.izEnabled" :disabled="queryParam.colDisabled"
dictCode="iz_enabled" 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>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<ServiceFlowMainModal ref="registerModal" @success="handleSuccess"></ServiceFlowMainModal>
</div>
</template>
<script lang="ts" name="flow-serviceFlowMain" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ServiceFlowMain.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './ServiceFlowMain.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ServiceFlowMainModal from './components/ServiceFlowMainModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import { useMessage } from '/@/hooks/web/useMessage';
const { createMessage } = 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: 150,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "服务指令-主流程",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
function handleIzEnabled(record, izEnabled_) {
saveOrUpdate({ id: record.id, izEnabled: izEnabled_ }, true)
.then((res) => {
if (res.success) {
createMessage.success('操作成功');
} else {
createMessage.warning('操作失败');
}
}).finally(() => {
reload()
})
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '节点信息',
onClick: handleEdit.bind(null, record),
},
{
label: '启用',
onClick: handleIzEnabled.bind(null, record, 'Y'),
ifShow: record.izEnabled == 'N'
},
{
label: '停用',
onClick: handleIzEnabled.bind(null, record, 'N'),
ifShow: record.izEnabled == 'Y'
},
// {
// label: '',
// popConfirm: {
// title: '',
// confirm: handleDelete.bind(null, record),
// placement: 'topLeft',
// },
// }
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
function instructionTagChanged(v_) {
queryParam.categoryId = null
queryParam.typeId = null
}
function categoryChanged(v_) {
queryParam.typeId = null
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.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>

View File

@ -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="ServiceFlowMainForm">
<a-row>
<a-col :span="24">
<a-form-item label="流程名称" v-bind="validateInfos.flowName" id="ServiceFlowMainForm-flowName"
name="flowName">
<a-input v-model:value="formData.flowName" placeholder="请输入流程名称" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="分类标签 " v-bind="validateInfos.instructionTagId"
id="ServiceFlowMainForm-instructionTagId" name="instructionTagId">
<j-dict-select-tag v-model:value="formData.instructionTagId"
dictCode="nu_config_service_instruction_tag,instruction_name,id" placeholder="请选择分类标签 " allow-clear
@change="instructionTagChanged" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ServiceFlowMainForm-categoryId"
name="categoryId">
<j-dict-select-tag v-model:value="formData.categoryId"
:dictCode="`nu_config_service_category,category_name,id,instruction_id = '${formData.instructionTagId || ''}'`"
placeholder="请选择服务类别" allow-clear @change="categoryChanged" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ServiceFlowMainForm-typeId" name="typeId">
<j-dict-select-tag v-model:value="formData.typeId"
:dictCode="`nu_config_service_type,type_name,id,instruction_id = '${formData.instructionTagId || ''}' and category_id = '${formData.categoryId || ''}' `"
placeholder="请选择服务类型" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ServiceFlowMainForm-izEnabled"
name="izEnabled">
<j-dict-select-tag type="radio" v-model:value="formData.izEnabled" dictCode="iz_enabled"
placeholder="请选择是否启用" allow-clear />
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ServiceFlowMain.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
flowName: '',
izEnabled: 'Y',
instructionTagId: '',
categoryId: '',
typeId: '',
});
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({
flowName: [{ required: true, message: '请输入节点名称!' },],
izEnabled: [{ required: true, message: '请输入是否启用!' },],
instructionTagId: [{ required: true, message: '请输入分类标签 !' },],
categoryId: [{ required: true, message: '请输入服务类别!' },],
typeId: [{ 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);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
function instructionTagChanged(v_) {
formData.categoryId = null
formData.typeId = null
}
function categoryChanged(v_) {
formData.typeId = null
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,90 @@
<template>
<a-drawer :title="title" :width="opeType == 'add' ? '50vw' : '100vw'" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<ServiceFlowMainForm v-if="opeType == 'add' && visible" ref="registerForm" @ok="submitCallback"
:formDisabled="disableSubmit" :formBpm="false">
</ServiceFlowMainForm>
<ServiceFlowSubList v-if="opeType == 'node' && visible" ref="registerForm" @ok="submitCallback"
:formDisabled="disableSubmit" :formBpm="false">
</ServiceFlowSubList>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button v-if="opeType == 'add'" type="primary" style="margin-right: 8px" @click="handleOk">确定</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ServiceFlowSubList from './ServiceFlowSubList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import ServiceFlowMainForm from './ServiceFlowMainForm.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']);
const opeType = ref('');// add node
/**
* 新增
*/
function add() {
title.value = '新增主流程';
visible.value = true;
opeType.value = 'add'
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '节点信息';
visible.value = true;
opeType.value = 'node'
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>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/services/flow/sub/list',
save='/services/flow/sub/add',
edit='/services/flow/sub/edit',
deleteOne = '/services/flow/sub/delete',
deleteBatch = '/services/flow/sub/deleteBatch',
importExcel = '/services/flow/sub/importExcel',
exportXls = '/services/flow/sub/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 });
}

View File

@ -0,0 +1,67 @@
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: 'name',
},
{
title: '流程编码',
align: 'center',
dataIndex: 'flowCode',
},
{
title: '下一流程节点',
align: 'center',
dataIndex: 'subId_dictText',
},
{
title: '服务指令',
align: 'center',
dataIndex: 'directiveId_dictText',
},
{
title: '是否启用',
align: 'center',
dataIndex: 'izEnabled_dictText',
},
];
// 高级查询数据
export const superQuerySchema = {
name: { title: '名称', order: 0, view: 'text', type: 'string' },
mainId: {
title: '主表ID',
order: 1,
view: 'sel_search',
type: 'string',
dictTable: 'nu_config_service_flow_main',
dictCode: 'id',
dictText: 'flow_name',
},
directiveId: {
title: '服务指令ID',
order: 2,
view: 'sel_search',
type: 'string',
dictTable: 'nu_config_service_directive',
dictCode: 'id',
dictText: 'directive_name',
},
subId: {
title: '下一流程节点ID',
order: 3,
view: 'sel_search',
type: 'string',
dictTable: 'nu_config_service_flow_sub',
dictCode: 'id',
dictText: 'name',
},
flowCode: { title: '流程编码', order: 4, view: 'text', type: 'string' },
izEnabled: { title: '是否启用 Y启用 N未启用', order: 5, view: 'list', type: 'string', dictCode: 'iz_enabled' },
};

View File

@ -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="ServiceFlowSubForm">
<a-row>
<a-col :span="24">
<a-form-item label="主流程" v-bind="validateInfos.mainId" id="ServiceFlowSubForm-mainId" name="mainId">
<j-search-select v-model:value="formData.mainId" dict="nu_config_service_flow_main,flow_name,id"
disabled allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="名称" v-bind="validateInfos.name" id="ServiceFlowSubForm-name" name="name">
<a-input v-model:value="formData.name" placeholder="请输入名称" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="服务指令" v-bind="validateInfos.directiveId" id="ServiceFlowSubForm-directiveId"
name="directiveId">
<j-search-select v-model:value="formData.directiveId" placeholder="请选择服务指令"
:dict="`nu_config_service_directive,directive_name,id,instruction_tag_id = '${baseInfo.instructionTagId || ''}' and category_id = '${baseInfo.categoryId || ''}' and type_id = '${baseInfo.typeId || ''}' `"
allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="下一流程节点" v-bind="validateInfos.subId" id="ServiceFlowSubForm-subId" name="subId">
<j-search-select v-model:value="formData.subId"
:dict="`nu_config_service_flow_sub,name,id,main_id = '${baseInfo.mainId || ''}' `" allow-clear
placeholder="请选择下一流程节点" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="流程编码" v-bind="validateInfos.flowCode" id="ServiceFlowSubForm-flowCode"
name="flowCode">
<a-input v-model:value="formData.flowCode" placeholder="请输入流程编码" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ServiceFlowSubForm-izEnabled"
name="izEnabled">
<j-dict-select-tag type="radio" v-model:value="formData.izEnabled" dictCode="iz_enabled"
placeholder="请选择是否启用" allow-clear />
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from './ServiceFlowSub.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
name: '',
mainId: '',
directiveId: '',
subId: '',
flowCode: '',
izEnabled: 'Y',
});
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 baseInfo = ref({})
//
const validatorRules = reactive({
name: [{ required: true, message: '请输入名称!' },],
directiveId: [{ required: true, message: '请输入服务指令ID!' },],
subId: [{ required: true, message: '请输入下一流程节点ID!' },],
flowCode: [{ required: true, 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(record_) {
baseInfo.value = record_
console.log("🌊 ~ add ~ baseInfo.value:", baseInfo.value)
edit({ mainId: record_.mainId });
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if (record.hasOwnProperty(key)) {
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,437 @@
<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="name">
<template #label><span title="节点名称">节点名称</span></template>
<JInput v-model:value="queryParam.name" placeholder="请输入节点名称" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="flowCode">
<template #label><span title="流程编码">流程编码</span></template>
<JInput v-model:value="queryParam.flowCode" placeholder="请输入流程编码" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="directiveId">
<template #label><span title="服务指令">服务指令</span></template>
<j-search-select placeholder="请选择服务指令" v-model:value="queryParam.directiveId"
:dict="`nu_config_service_directive,directive_name,id,instruction_tag_id = '${formData.instructionTagId || ''}' and category_id = '${formData.categoryId || ''}' and type_id = '${formData.typeId || ''}' `"
allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="subId">
<template #label><span title="下一流程节点">下一流程</span></template>
<j-search-select placeholder="请选择下一流程节点" v-model:value="queryParam.subId"
:dict="`nu_config_service_flow_sub,name,id,main_id = '${formData.mainId || ''}' `" allow-clear />
</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' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
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>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<ServiceFlowSubModal ref="registerModal" @success="handleSuccess"></ServiceFlowSubModal>
<a-drawer :title="title" width="50vw" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<div style="width: 100%;padding: 14px;background-color: white;border-radius: 10px;">
<div v-if="opeType == 'directive'">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="formData" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :span="24">
<a-form-item label="分类标签 " id="ServiceFlowMainForm-instructionTagId" name="instructionTagId">
<j-dict-select-tag v-model:value="formData.instructionTagId" disabled
dictCode="nu_config_service_instruction_tag,instruction_name,id" placeholder="请选择分类标签 "
allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="服务类别" id="ServiceFlowMainForm-categoryId" name="categoryId">
<j-dict-select-tag v-model:value="formData.categoryId" disabled
:dictCode="`nu_config_service_category,category_name,id,instruction_id = '${formData.instructionTagId || ''}'`"
placeholder="请选择服务类别" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="服务类型" id="ServiceFlowMainForm-typeId" name="typeId">
<j-dict-select-tag v-model:value="formData.typeId" disabled
:dictCode="`nu_config_service_type,type_name,id,instruction_id = '${formData.instructionTagId || ''}' and category_id = '${formData.categoryId || ''}' `"
placeholder="请选择服务类型" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="服务指令" name="directiveId">
<j-dict-select-tag v-model:value="formData.directiveId"
:dictCode="`nu_config_service_directive,directive_name,id,instruction_tag_id = '${formData.instructionTagId || ''}' and category_id = '${formData.categoryId || ''}' and type_id = '${formData.typeId || ''}' `"
placeholder="请选择服务指令" allow-clear />
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<div v-if="opeType == 'node'">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="formData" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :span="24">
<a-form-item label="下一流程节点" name="directiveId">
<j-dict-select-tag v-model:value="formData.subId"
:dictCode="`nu_config_service_flow_sub,name,id,main_id = '${formData.mainId || ''}' `"
placeholder="请选择下一流程节点" allow-clear />
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
</div>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" style="margin-right: 8px" @click="handleOk">确定</a-button>
</template>
</a-drawer>
</div>
</template>
<script lang="ts" name="flow-serviceFlowSub" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ServiceFlowSub.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './ServiceFlowSub.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ServiceFlowSubModal from './ServiceFlowSubModal.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 JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import { useMessage } from '/@/hooks/web/useMessage';
const title = ref<string>('');
const visible = ref<boolean>(false);
const opeType = ref('')//directive node
const { createMessage } = useMessage();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
const opeObj = ref({})
const formData = reactive<Record<string, any>>({
id: '',
mainId: '',
instructionTagId: '',
categoryId: '',
typeId: '',
directiveId: '',
});
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '服务指令-子流程,用于指定节点',
api: list,
columns,
canResize: false,
useSearchForm: false,
immediate: false,
actionColumn: {
width: 230,
fixed: 'right',
},
beforeFetch: async (params) => {
queryParam.mainId = formData.mainId
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "服务指令-子流程,用于指定节点",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add(formData);
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
function handleIzEnabled(record, izEnabled_) {
saveOrUpdate({ id: record.id, izEnabled: izEnabled_ }, true)
.then((res) => {
if (res.success) {
createMessage.success('操作成功');
} else {
createMessage.warning('操作失败');
}
}).finally(() => {
reload()
})
}
/**
* 服务指令
*/
function handleDirective(record: Recordable) {
title.value = '服务指令'
formData.directiveId = null
opeType.value = 'directive'
visible.value = true
opeObj.value = record
}
/**
* 下一节点
*/
function handleNode(record: Recordable) {
title.value = '下一节点'
formData.subId = null
opeType.value = 'node'
visible.value = true
opeObj.value = record
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '服务指令',
onClick: handleDirective.bind(null, record),
},
{
label: '下一节点',
onClick: handleNode.bind(null, record),
},
{
label: '启用',
onClick: handleIzEnabled.bind(null, record, 'Y'),
ifShow: record.izEnabled == 'N'
},
{
label: '停用',
onClick: handleIzEnabled.bind(null, record, 'N'),
ifShow: record.izEnabled == 'Y'
},
// {
// label: '',
// popConfirm: {
// title: '',
// confirm: handleDelete.bind(null, record),
// placement: 'topLeft',
// },
// }
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 确定按钮点击事件
*/
function handleOk() {
let params = {
id: opeObj.value.id,
directiveId: null,
subId: null
}
if (opeType.value == 'directive') {
if (!formData.directiveId) {
createMessage.warning('未选择服务指令');
return
} else {
params.directiveId = formData.directiveId
}
}
if (opeType.value == 'node') {
if (!formData.subId) {
createMessage.warning('未选择节点');
return
} else {
params.subId = formData.subId
}
}
saveOrUpdate(params, true)
.then((res) => {
if (res.success) {
createMessage.success('保存成功');
} else {
createMessage.warning('保存失败');
}
}).finally(() => {
visible.value = false
reload()
})
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
function init(record) {
formData.mainId = record.id
formData.instructionTagId = record.instructionTagId
formData.categoryId = record.categoryId
formData.typeId = record.typeId
reload()
}
defineExpose({
init
});
</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>

View File

@ -0,0 +1,84 @@
<template>
<a-drawer :title="title" width="50vw" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<ServiceFlowSubForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false">
</ServiceFlowSubForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" style="margin-right: 8px" @click="handleOk">确定</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ServiceFlowSubForm from './ServiceFlowSubForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add(record_) {
title.value = '新增节点';
visible.value = true;
nextTick(() => {
registerForm.value.add(record_);
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -5,19 +5,19 @@
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="ConfigServiceCategoryForm">
<a-row>
<a-col :span="24">
<!-- <a-col :span="24">
<a-form-item label="分类标签名称" v-bind="validateInfos.instructionName"
id="ConfigServiceCategoryForm-instructionName" name="instructionName">
<a-input v-model:value="formData.instructionName" placeholder="请输入分类标签名称" allow-clear :maxlength="10"
:showCount="true" :disabled="titleDisabled"></a-input>
<a-input v-model:value="formData.instructionName" placeholder="请输入分类标签名称" allow-clear readonly
:disabled="titleDisabled"></a-input>
</a-form-item>
</a-col>
</a-col> -->
<a-col :span="24">
<a-form-item label="分类标签类型" v-bind="validateInfos.instructionType"
id="ConfigServiceCategoryForm-instructionType" name="instructionType">
<a-form-item label="分类标签" v-bind="validateInfos.instructionType"
id="ConfigServiceCategoryForm-instructionType" name="instructionType">
<j-dict-select-tag type='list' v-model:value="formData.instructionType"
dictCode="service_instruction_tag"
placeholder="请选择分类标签类型" allowClear />
:dictCode="`view_directive_can_use_instruction_tag,item_text,item_value`" placeholder="请选择分类标签"
allowClear @currentText="selectedFunc" />
</a-form-item>
</a-col>
<a-col :span="24" hidden>
@ -27,7 +27,7 @@
</a-col>
<a-col :span="24">
<a-form-item label="图标" v-bind="validateInfos.icon" id="ConfigServiceCategoryForm-icon" name="icon">
<IconPicker v-model:value="formData.icon" />
<IconPicker v-model:value="formData.icon" />
</a-form-item>
</a-col>
<a-col :span="24">
@ -53,7 +53,7 @@ import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../InstructionTag.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import { Icon, IconPicker, SvgIcon } from '/@/components/Icon/index';
import { Icon, IconPicker, SvgIcon } from '/@/components/Icon/index';
import { b } from 'node_modules/vite/dist/node/moduleRunnerTransport.d-CXw_Ws6P';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
@ -70,7 +70,7 @@ const formData = reactive<Record<string, any>>({
instructionType: '',
sort: 99,
izEnabled: 'Y',
icon:'',
icon: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
@ -78,7 +78,7 @@ const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
instructionName: [{ required: true, message: '请输入分类标签名称!' },],
// instructionName: [{ required: true, message: '!' },],
instructionType: [{ required: true, message: '请选择分类标签类型!' },],
sort: [{ required: true, message: '请输入排序!' }, { pattern: /^\d+$/, message: '请输入正整数!' },],
icon: [{ required: true, message: '请选择图标!' }],
@ -123,9 +123,9 @@ function edit(record) {
Object.assign(formData, tmpData);
formData.instructionName = record.title;
formData.id = record.key;
if(record.title){
if (record.title) {
titleDisabled.value = true;
}else{
} else {
titleDisabled.value = false;
}
});
@ -179,6 +179,13 @@ async function submitForm() {
});
}
/**
* 类型选择结果
* @param v_
*/
function selectedFunc(v_) {
formData.instructionName = v_
}
defineExpose({
add,

File diff suppressed because it is too large Load Diff

View File

@ -82,9 +82,6 @@
<template v-for="child in item.children">
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0"
@titleClick="handleTreeSelect([], { node: child })">
<!-- <template #icon>
<Icon icon="ant-design:border-verticle-outlined" :size="20" />
</template> -->
<template #title>
<span @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">{{ child?.title
}}
@ -114,9 +111,6 @@
<template v-for="childThree in child.children">
<a-sub-menu :key="childThree.key" v-if="childThree.children && childThree.children.length > 0"
@titleClick="handleTreeSelect([], { node: childThree })">
<!-- <template #icon>
<Icon icon="ant-design:border-bottom-outlined" :size="20" />
</template> -->
<template #title>
<span @mouseenter="childThree.showContent = true"
@mouseleave="childThree.showContent = false">{{ childThree?.title }}
@ -151,8 +145,7 @@
class="auto-wrap">{{ childFour?.title + '(' + childFour?.cycleTypeName + ')' }}
<span v-if="childFour?.izEnabled == 'N' && childFour.level != 5"
style="color:red;">(已停用)</span>
<span v-show="childFour.showContent">
<!-- 下拉菜单 -->
<span v-show="childFour.showContent">
<a-dropdown :open="menuState[childFour?.key]?.open"
@openChange="onMenuOpenChange(childFour.key, $event)">
<template #overlay>
@ -164,8 +157,7 @@
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item>
</a-menu>
</template>
<!-- 图标 -->
</template>
<Icon style="color:#1890FF;" :icon="iconClass(childFour.level)" class="action-icon"
@mouseenter="onNodeIconEnter(childFour, childFour.children)"
@mouseleave="onNodeIconLeave(childFour)" />
@ -176,9 +168,6 @@
</a-sub-menu>
<a-menu-item :key="childThree.key" v-if="!childThree.children || childThree.children.length < 1"
@click="handleTreeSelect([], { node: childThree })">
<!-- <template #icon>
<Icon icon="ant-design:border-bottom-outlined" :size="20" />
</template> -->
<span @mouseenter="childThree.showContent = true" @mouseleave="childThree.showContent = false">{{
childThree?.title }}
<span v-if="childThree?.izEnabled == 'N' && childThree.level != 5"
@ -209,9 +198,6 @@
</a-sub-menu>
<a-menu-item :key="child.key" v-if="!child.children || child.children.length < 1"
@click="handleTreeSelect([], { node: child })">
<!-- <template #icon>
<Icon icon="ant-design:border-verticle-outlined" :size="20" />
</template> -->
<span @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">{{ child?.title
}}
<span v-if="child?.izEnabled == 'N' && child.level != 5" style="color:red;">(已停用)</span>
@ -591,14 +577,14 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 70,
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
params.column = 'createTime'
params.order = 'desc'
let rangerQuery = await setRangeQuery();
return Object.assign(params, rangerQuery);
return Object.assign(params, rangerQuery, filterIzEnabled.value == 'enabled' ? { izEnabled: 'Y' } : {});
},
},
exportConfig: {
@ -727,6 +713,24 @@ function getTableAction(record) {
*/
function getDropDownAction(record) {
return [
{
label: '编辑指令',
onClick: editDirective.bind(null, { key: record.id }),
},
{
label: '编辑资源',
onClick: editMedia.bind(null, { key: record.id }),
},
{
label: '启用指令',
onClick: usingDirective.bind(null, { key: record.id }),
ifShow: record.izEnabled == 'N'
},
{
label: '停用指令',
onClick: stopDirective.bind(null, { key: record.id }),
ifShow: record.izEnabled == 'Y'
},
]
}
@ -1275,27 +1279,27 @@ function menuItems(data) {
}
return items
}
else if (data.level === 4) {
const items = [
{ key: 'editDir', label: '编辑服务指令', icon: 'ant-design:edit-outlined', canAdd: data.canAdd && data.izEnabled == 'Y', action: editDirective },
{ key: 'editMedia', label: '编辑指令资源', icon: 'ant-design:edit-outlined', canAdd: data.canAdd && data.izEnabled == 'Y' && mainOrgCode.value == ownOrgCode.value, action: editMedia },
]
// if (data.canAdd) {
// items.push({ key: 'addDir', label: '', icon: 'ant-design:plus-outlined', canAdd: data.canAdd , action: addDirective })
// }
if (data.izEnabled === 'N') {
items.push({ key: 'usingDir', label: '启用服务指令', icon: 'ant-design:check-circle-outlined', canAdd: data.canAdd, action: usingDirective })
} else if (data.izEnabled === 'Y') {
items.push({ key: 'stopDir', label: '停用服务指令', icon: 'ant-design:stop-outlined', canAdd: data.canAdd, action: stopDirective })
}
if (data?.bodyTagList?.length > 0) {
items.push({ key: 'bodyTagsDetail', label: '查看体型标签', icon: 'ant-design:stop-outlined', canAdd: true, action: bodyTagsDetail })
}
if (data?.emotionTagList?.length > 0) {
items.push({ key: 'emotionTagsDetail', label: '查看情绪标签', icon: 'ant-design:stop-outlined', canAdd: true, action: emotionTagsDetail })
}
return items
}
// else if (data.level === 4) {
// const items = [
// { key: 'editDir', label: '', icon: 'ant-design:edit-outlined', canAdd: data.canAdd && data.izEnabled == 'Y', action: editDirective },
// { key: 'editMedia', label: '', icon: 'ant-design:edit-outlined', canAdd: data.canAdd && data.izEnabled == 'Y' && mainOrgCode.value == ownOrgCode.value, action: editMedia },
// ]
// // if (data.canAdd) {
// // items.push({ key: 'addDir', label: '', icon: 'ant-design:plus-outlined', canAdd: data.canAdd , action: addDirective })
// // }
// if (data.izEnabled === 'N') {
// items.push({ key: 'usingDir', label: '', icon: 'ant-design:check-circle-outlined', canAdd: data.canAdd, action: usingDirective })
// } else if (data.izEnabled === 'Y') {
// items.push({ key: 'stopDir', label: '', icon: 'ant-design:stop-outlined', canAdd: data.canAdd, action: stopDirective })
// }
// if (data?.bodyTagList?.length > 0) {
// items.push({ key: 'bodyTagsDetail', label: '', icon: 'ant-design:stop-outlined', canAdd: true, action: bodyTagsDetail })
// }
// if (data?.emotionTagList?.length > 0) {
// items.push({ key: 'emotionTagsDetail', label: '', icon: 'ant-design:stop-outlined', canAdd: true, action: emotionTagsDetail })
// }
// return items
// }
return []
}
@ -1341,14 +1345,14 @@ function handleTreeSelect(selectedKeys: string[], { node }: any) {
queryParam.categoryId = node.categoryId;
queryParam.typeId = node.typeId;
break;
case 4: //
//
queryParam.instructionTagId = node.instructionId;
queryParam.categoryId = node.categoryId;
queryParam.typeId = node.typeId;
queryParam.directiveName = node.title;
queryParam.id = node.key
break;
// case 4: //
// //
// queryParam.instructionTagId = node.instructionId;
// queryParam.categoryId = node.categoryId;
// queryParam.typeId = node.typeId;
// queryParam.directiveName = node.title;
// queryParam.id = node.key
// break;
}
if (level == 5) return
//