This commit is contained in:
吴红兵
2026-03-07 01:34:48 +08:00
parent adc511cfdc
commit 94c3473958
1211 changed files with 599405 additions and 322105 deletions

View File

@@ -1,282 +1,292 @@
<template>
<el-dialog :title="title" v-model="visible" width="60%"
:close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="120px" v-loading="loading" :disabled="operType === 'view'">
<el-row :gutter="24">
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.type')" prop="type">
<el-select v-model="form.type" :placeholder="t('flowrule.inputTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_RULE_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-dialog :title="title" v-model="visible" width="60%" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="120px" v-loading="loading" :disabled="operType === 'view'">
<el-row :gutter="24">
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.type')" prop="type">
<el-select v-model="form.type" :placeholder="t('flowrule.inputTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_RULE_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.valType')" prop="type">
<el-select v-model="form.valType" :placeholder="t('flowrule.inputValTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.VAL_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.defFlowId')" prop="defFlowId">
<el-select v-model="form.defFlowId" :placeholder="t('flowrule.inputDefFlowIdTip')" clearable filterable
@change="cascadeChange('defFlowId', ['flowNodeId', 'flowNodeRelId'])">
<el-option v-for="(item, index) in dicData.defFlowId" :key="index" :label="item.flowName" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.flowNodeId')" prop="flowNodeId">
<el-select v-model="form.flowNodeId" :placeholder="t('flowrule.inputFlowNodeIdTip')" clearable filterable>
<el-option v-for="(item, index) in cascadeDic.flowNodeId" :key="index" :label="item.nodeName" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.valType')" prop="type">
<el-select v-model="form.valType" :placeholder="t('flowrule.inputValTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.VAL_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.flowNodeRelId')" prop="flowNodeRelId">
<el-select v-model="form.flowNodeRelId" :placeholder="t('flowrule.inputFlowNodeRelIdTip')" clearable filterable>
<el-option v-for="(item, index) in cascadeDic.flowNodeRelId" :key="index" :label="item.label" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.defFlowId')" prop="defFlowId">
<el-select
v-model="form.defFlowId"
:placeholder="t('flowrule.inputDefFlowIdTip')"
clearable
filterable
@change="cascadeChange('defFlowId', ['flowNodeId', 'flowNodeRelId'])"
>
<el-option v-for="(item, index) in dicData.defFlowId" :key="index" :label="item.flowName" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.flowNodeId')" prop="flowNodeId">
<el-select v-model="form.flowNodeId" :placeholder="t('flowrule.inputFlowNodeIdTip')" clearable filterable>
<el-option v-for="(item, index) in cascadeDic.flowNodeId" :key="index" :label="item.nodeName" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.groupId')" prop="groupId">
<el-input v-model="form.groupId" :placeholder="t('flowrule.inputGroupIdTip')"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.groupsType')" prop="groupsType">
<el-switch
v-model="form.groupsType"
active-value="0"
inactive-value="1"
inactive-text=""
active-text="">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.groupType')" prop="groupType">
<el-switch
v-model="form.groupType"
active-value="0"
inactive-value="1"
inactive-text=""
active-text="">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.varKeyVal')" prop="varKeyVal">
<el-input v-model="form.varKeyVal" :placeholder="t('flowrule.inputVarKeyValTip')"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.flowNodeRelId')" prop="flowNodeRelId">
<el-select v-model="form.flowNodeRelId" :placeholder="t('flowrule.inputFlowNodeRelIdTip')" clearable filterable>
<el-option v-for="(item, index) in cascadeDic.flowNodeRelId" :key="index" :label="item.label" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.operator')" prop="operator">
<el-select v-model="form.operator" :placeholder="t('flowrule.inputOperatorTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.OPERATOR" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.varVal')" prop="varVal">
<el-input v-model="form.varVal" :placeholder="t('flowrule.inputVarValTip')"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.groupId')" prop="groupId">
<el-input v-model="form.groupId" :placeholder="t('flowrule.inputGroupIdTip')" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.groupsType')" prop="groupsType">
<el-switch v-model="form.groupsType" active-value="0" inactive-value="1" inactive-text="或" active-text="且"> </el-switch>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.groupType')" prop="groupType">
<el-switch v-model="form.groupType" active-value="0" inactive-value="1" inactive-text="或" active-text="且"> </el-switch>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.varKeyVal')" prop="varKeyVal">
<el-input v-model="form.varKeyVal" :placeholder="t('flowrule.inputVarKeyValTip')" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.jobType')" prop="jobType">
<el-select v-model="form.jobType" :placeholder="t('flowrule.inputJobTypeTip')" clearable filterable
@change="handleRoleType">
<el-option v-for="(item, index) in DIC_PROP.JOB_USER_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.operator')" prop="operator">
<el-select v-model="form.operator" :placeholder="t('flowrule.inputOperatorTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.OPERATOR" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.varVal')" prop="varVal">
<el-input v-model="form.varVal" :placeholder="t('flowrule.inputVarValTip')" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.roleId')" prop="roleId">
<el-select v-model="form.roleId" :placeholder="t('flowrule.inputRoleIdTip')" clearable filterable>
<el-option v-for="(item, index) in dicData.users" :key="index" :label="item.name" :value="item.userId"
v-if="form.jobType === DIC_PROP.JOB_USER_TYPE[0].value"></el-option>
<el-option v-for="(item, index) in dicData.roles" :key="index" :label="item.roleName" :value="item.roleId"
v-if="form.jobType === DIC_PROP.JOB_USER_TYPE[1].value"></el-option>
<el-option v-for="(item, index) in dicData.posts" :key="index" :label="item.postName" :value="item.postId"
v-if="form.jobType === DIC_PROP.JOB_USER_TYPE[2].value"></el-option>
<el-option v-for="(item, index) in dicData.depts" :key="index" :label="item.name" :value="item.deptId"
v-if="form.jobType === DIC_PROP.JOB_USER_TYPE[3].value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.jobType')" prop="jobType">
<el-select v-model="form.jobType" :placeholder="t('flowrule.inputJobTypeTip')" clearable filterable @change="handleRoleType">
<el-option v-for="(item, index) in DIC_PROP.JOB_USER_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.paramFrom')" prop="paramFrom">
<el-select v-model="form.paramFrom" :placeholder="t('flowrule.inputParamFromTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_FROM" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.paramValType')" prop="paramValType">
<el-select v-model="form.paramValType" :placeholder="t('flowrule.inputParamValTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_VAL_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.targetProp')" prop="targetProp">
<el-input v-model="form.targetProp" :placeholder="t('flowrule.inputTargetPropTip')"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.paramType')" prop="paramType">
<el-select v-model="form.paramType" :placeholder="t('flowrule.inputParamTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_TYPES" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.roleId')" prop="roleId">
<el-select v-model="form.roleId" :placeholder="t('flowrule.inputRoleIdTip')" clearable filterable>
<el-option
v-for="(item, index) in dicData.users"
:key="index"
:label="item.name"
:value="item.userId"
v-if="form.jobType === DIC_PROP.JOB_USER_TYPE[0].value"
></el-option>
<el-option
v-for="(item, index) in dicData.roles"
:key="index"
:label="item.roleName"
:value="item.roleId"
v-if="form.jobType === DIC_PROP.JOB_USER_TYPE[1].value"
></el-option>
<el-option
v-for="(item, index) in dicData.posts"
:key="index"
:label="item.postName"
:value="item.postId"
v-if="form.jobType === DIC_PROP.JOB_USER_TYPE[2].value"
></el-option>
<el-option
v-for="(item, index) in dicData.depts"
:key="index"
:label="item.name"
:value="item.deptId"
v-if="form.jobType === DIC_PROP.JOB_USER_TYPE[3].value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer v-if="operType !== 'view'">
<span class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
<el-button type="primary" @click="onSubmit" :disabled="loading">{{ $t('common.confirmButtonText') }}</el-button>
</span>
</template>
</el-dialog>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.paramFrom')" prop="paramFrom">
<el-select v-model="form.paramFrom" :placeholder="t('flowrule.inputParamFromTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_FROM" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.paramValType')" prop="paramValType">
<el-select v-model="form.paramValType" :placeholder="t('flowrule.inputParamValTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_VAL_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.targetProp')" prop="targetProp">
<el-input v-model="form.targetProp" :placeholder="t('flowrule.inputTargetPropTip')"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('flowrule.paramType')" prop="paramType">
<el-select v-model="form.paramType" :placeholder="t('flowrule.inputParamTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_TYPES" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer v-if="operType !== 'view'">
<span class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
<el-button type="primary" @click="onSubmit" :disabled="loading">{{ $t('common.confirmButtonText') }}</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="FlowRuleDialog">
import { useMessage } from "/@/hooks/message";
import { getObj, addObj, putObj } from '/@/api/jsonflow/flow-rule'
import { useI18n } from "vue-i18n"
import {onCascadeChange, onLoadDicUrl} from "/@/flow/components/convert-name/convert";
import {handleChangeJobType} from "/@/flow";
import { useMessage } from '/@/hooks/message';
import { getObj, addObj, putObj } from '/@/api/jsonflow/flow-rule';
import { useI18n } from 'vue-i18n';
import { onCascadeChange, onLoadDicUrl } from '/@/flow/components/convert-name/convert';
import { handleChangeJobType } from '/@/flow';
const emit = defineEmits(['refresh']);
const { t } = useI18n();
const emit = defineEmits(['refresh']);
const { t } = useI18n();
// 定义变量内容
const dataFormRef = ref();
const visible = ref(false)
const loading = ref(false)
const operType = ref(false);
const title = ref('');
// 提交表单数据
const form = reactive({
id: '',
flowKey: '',
defFlowId: '',
flowNodeId: '',
type: '',
valType: '',
groupId: '',
groupsType: '0',
groupType: '0',
varKeyVal: '',
operator: '',
varVal: '',
createUser: '',
createTime: '',
updateUser: '',
updateTime: '',
});
// 定义变量内容
const dataFormRef = ref();
const visible = ref(false);
const loading = ref(false);
const operType = ref(false);
const title = ref('');
// 提交表单数据
const form = reactive({
id: '',
flowKey: '',
defFlowId: '',
flowNodeId: '',
type: '',
valType: '',
groupId: '',
groupsType: '0',
groupType: '0',
varKeyVal: '',
operator: '',
varVal: '',
createUser: '',
createTime: '',
updateUser: '',
updateTime: '',
});
// 定义校验规则
const dataRules = ref({
defFlowId: [{required: true, message: '流程名称不能为空', trigger: 'blur'}],
type: [{required: true, message: '数据类型不能为空', trigger: 'blur'}],
valType: [{required: true, message: '条件模式不能为空', trigger: 'blur'}],
groupId: [{required: true, message: '同组条件ID不能为空', trigger: 'blur'}],
groupsType: [{required: true, message: '条件组关系不能为空', trigger: 'blur'}],
groupType: [{required: true, message: '组内条件关系不能为空', trigger: 'blur'}],
varKeyVal: [{required: true, message: '表单字段不能为空', trigger: 'blur'}],
operator: [{required: true, message: '运算符不能为空', trigger: 'blur'}],
varVal: [{required: true, message: '校验值不能为空', trigger: 'blur'}],
})
// 定义校验规则
const dataRules = ref({
defFlowId: [{ required: true, message: '流程名称不能为空', trigger: 'blur' }],
type: [{ required: true, message: '数据类型不能为空', trigger: 'blur' }],
valType: [{ required: true, message: '条件模式不能为空', trigger: 'blur' }],
groupId: [{ required: true, message: '同组条件ID不能为空', trigger: 'blur' }],
groupsType: [{ required: true, message: '条件组关系不能为空', trigger: 'blur' }],
groupType: [{ required: true, message: '组内条件关系不能为空', trigger: 'blur' }],
varKeyVal: [{ required: true, message: '表单字段不能为空', trigger: 'blur' }],
operator: [{ required: true, message: '运算符不能为空', trigger: 'blur' }],
varVal: [{ required: true, message: '校验值不能为空', trigger: 'blur' }],
});
// 定义查询字典
const dicData = reactive({});
const cascadeDic = reactive({});
const onLoad = onLoadDicUrl({key: "defFlowId"}, {key: "users"}, {key: "roles"}, {key: "posts"}, {key: "depts"});
const onCascade = onCascadeChange(cascadeDic, {key: "defFlowId", cascades: ["flowNodeId", "flowNodeRelId"]});
onMounted(() => {
onLoad(dicData);
});
// 定义查询字典
const dicData = reactive({});
const cascadeDic = reactive({});
const onLoad = onLoadDicUrl({ key: 'defFlowId' }, { key: 'users' }, { key: 'roles' }, { key: 'posts' }, { key: 'depts' });
const onCascade = onCascadeChange(cascadeDic, { key: 'defFlowId', cascades: ['flowNodeId', 'flowNodeRelId'] });
onMounted(() => {
onLoad(dicData);
});
function cascadeChange(key, cascades){
onCascade(form, {key: key, cascades: cascades});
if (key === 'defFlowId') {
let find = dicData.defFlowId.find(f => f.id === form.defFlowId);
if (find) form.flowKey = find.flowKey
else form.flowKey = null
}
}
function cascadeChange(key, cascades) {
onCascade(form, { key: key, cascades: cascades });
if (key === 'defFlowId') {
let find = dicData.defFlowId.find((f) => f.id === form.defFlowId);
if (find) form.flowKey = find.flowKey;
else form.flowKey = null;
}
}
function handleRoleType() {
handleChangeJobType(dicData, form)
}
function handleRoleType() {
handleChangeJobType(dicData, form);
}
// 打开弹窗
const openDialog = async (type: string, id: string) => {
visible.value = true
operType.value = type;
form.id = ''
// 打开弹窗
const openDialog = async (type: string, id: string) => {
visible.value = true;
operType.value = type;
form.id = '';
if (type === 'add') {
title.value = t('common.addBtn');
} else if (type === 'edit') {
title.value = t('common.editBtn');
} else if (type === 'view') {
title.value = t('common.viewBtn');
}
if (type === 'add') {
title.value = t('common.addBtn');
} else if (type === 'edit') {
title.value = t('common.editBtn');
} else if (type === 'view') {
title.value = t('common.viewBtn');
}
// 重置表单数据
nextTick(async () => {
dataFormRef.value.resetFields()
// 获取FlowRule信息
if (id) {
form.id = id
await getFlowRuleData(id)
await onCascade(form);
}
})
};
// 重置表单数据
nextTick(async () => {
dataFormRef.value.resetFields();
// 获取FlowRule信息
if (id) {
form.id = id;
await getFlowRuleData(id);
await onCascade(form);
}
});
};
// 提交
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => {});
if (!valid) return false;
// 提交
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => {});
if (!valid) return false;
try {
loading.value = true;
form.id ? await putObj(form) : await addObj(form);
useMessage().success(t(form.id ? 'common.editSuccessText' : 'common.addSuccessText'));
visible.value = false;
emit('refresh');
} catch (err: any) {
useMessage().error(err);
} finally {
loading.value = false;
}
}
try {
loading.value = true;
form.id ? await putObj(form) : await addObj(form);
useMessage().success(t(form.id ? 'common.editSuccessText' : 'common.addSuccessText'));
visible.value = false;
emit('refresh');
} catch (err: any) {
useMessage().error(err);
} finally {
loading.value = false;
}
};
// 初始化表单数据
const getFlowRuleData = async (id: string) => {
// 获取数据
loading.value = true
let res = await getObj(id);
Object.assign(form, res.data)
loading.value = false
};
// 初始化表单数据
const getFlowRuleData = async (id: string) => {
// 获取数据
loading.value = true;
let res = await getObj(id);
Object.assign(form, res.data);
loading.value = false;
};
// 暴露变量
defineExpose({
openDialog
});
// 暴露变量
defineExpose({
openDialog,
});
</script>

View File

@@ -1,52 +1,52 @@
export default {
flowrule: {
index: '#',
importFlowRuleTip: ' import FlowRule',
id: 'id',
flowKey: 'flowKey',
defFlowId: 'defFlowId',
flowNodeId: 'flowNodeId',
flowNodeRelId: 'flowNodeRelId',
roleId: 'roleId',
jobType: 'jobType',
type: 'type',
valType: 'valType',
groupId: 'groupId',
groupsType: 'groupsType',
groupType: 'groupType',
varKeyVal: 'varKeyVal',
operator: 'operator',
varVal: 'varVal',
paramFrom: 'paramFrom',
paramValType: 'paramValType',
targetProp: 'targetProp',
paramType: 'paramType',
createUser: 'createUser',
createTime: 'createTime',
updateUser: 'updateUser',
updateTime: 'updateTime',
inputIdTip: 'input id',
inputFlowKeyTip: 'input flowKey',
inputDefFlowIdTip: 'input defFlowId',
inputFlowNodeIdTip: 'input flowNodeId',
inputFlowNodeRelIdTip: 'input flowNodeRelId',
inputRoleIdTip: 'input roleId',
inputJobTypeTip: 'input jobType',
inputTypeTip: 'input type',
inputValTypeTip: 'input valType',
inputGroupIdTip: 'input groupId',
inputGroupsTypeTip: 'input groupsType',
inputGroupTypeTip: 'input groupType',
inputVarKeyValTip: 'input varKeyVal',
inputOperatorTip: 'input operator',
inputVarValTip: 'input varVal',
inputParamFromTip: 'input paramFrom',
inputParamValTypeTip: 'input paramValType',
inputTargetPropTip: 'input targetProp',
inputParamTypeTip: 'input paramType',
inputCreateUserTip: 'input createUser',
inputCreateTimeTip: 'input createTime',
inputUpdateUserTip: 'input updateUser',
inputUpdateTimeTip: 'input updateTime',
}
}
flowrule: {
index: '#',
importFlowRuleTip: ' import FlowRule',
id: 'id',
flowKey: 'flowKey',
defFlowId: 'defFlowId',
flowNodeId: 'flowNodeId',
flowNodeRelId: 'flowNodeRelId',
roleId: 'roleId',
jobType: 'jobType',
type: 'type',
valType: 'valType',
groupId: 'groupId',
groupsType: 'groupsType',
groupType: 'groupType',
varKeyVal: 'varKeyVal',
operator: 'operator',
varVal: 'varVal',
paramFrom: 'paramFrom',
paramValType: 'paramValType',
targetProp: 'targetProp',
paramType: 'paramType',
createUser: 'createUser',
createTime: 'createTime',
updateUser: 'updateUser',
updateTime: 'updateTime',
inputIdTip: 'input id',
inputFlowKeyTip: 'input flowKey',
inputDefFlowIdTip: 'input defFlowId',
inputFlowNodeIdTip: 'input flowNodeId',
inputFlowNodeRelIdTip: 'input flowNodeRelId',
inputRoleIdTip: 'input roleId',
inputJobTypeTip: 'input jobType',
inputTypeTip: 'input type',
inputValTypeTip: 'input valType',
inputGroupIdTip: 'input groupId',
inputGroupsTypeTip: 'input groupsType',
inputGroupTypeTip: 'input groupType',
inputVarKeyValTip: 'input varKeyVal',
inputOperatorTip: 'input operator',
inputVarValTip: 'input varVal',
inputParamFromTip: 'input paramFrom',
inputParamValTypeTip: 'input paramValType',
inputTargetPropTip: 'input targetProp',
inputParamTypeTip: 'input paramType',
inputCreateUserTip: 'input createUser',
inputCreateTimeTip: 'input createTime',
inputUpdateUserTip: 'input updateUser',
inputUpdateTimeTip: 'input updateTime',
},
};

View File

@@ -1,52 +1,52 @@
export default {
flowrule: {
index: '#',
importFlowRuleTip: '导入条件/人员规则',
id: '',
flowKey: '业务KEY',
defFlowId: '流程名称',
flowNodeId: '节点名称',
flowNodeRelId: '连线名称',
roleId: '参与者',
jobType: '参与者类型',
type: '数据类型',
valType: '数据值类型',
groupId: '同组条件ID',
groupsType: '条件组关系',
groupType: '组内条件关系',
varKeyVal: '表单字段',
operator: '运算符',
varVal: '校验值',
paramFrom: '参数来源',
paramValType: '参数值类型',
targetProp: '目标属性',
paramType: '参数类型',
createUser: '创建人',
createTime: '创建时间',
updateUser: '更新人',
updateTime: '更新时间',
inputIdTip: '请输入',
inputFlowKeyTip: '请输入业务KEY',
inputDefFlowIdTip: '请选择流程名称',
inputFlowNodeIdTip: '请先选择流程名称',
inputFlowNodeRelIdTip: '请先选择连线名称',
inputRoleIdTip: '请选择参与者',
inputJobTypeTip: '请输入参与者类型',
inputTypeTip: '请选择数据类型',
inputValTypeTip: '请选择模式',
inputGroupIdTip: '请输入同组条件ID',
inputGroupsTypeTip: '请选择条件组关系',
inputGroupTypeTip: '请选择组内条件关系',
inputVarKeyValTip: '请输入表单字段',
inputOperatorTip: '请选择运算符',
inputVarValTip: '请输入校验值',
inputParamFromTip: '请选择参数来源',
inputParamValTypeTip: '请选择参数值类型',
inputTargetPropTip: '请输入目标属性',
inputParamTypeTip: '请选择参数类型',
inputCreateUserTip: '请输入创建人',
inputCreateTimeTip: '请输入创建时间',
inputUpdateUserTip: '请输入更新人',
inputUpdateTimeTip: '请输入更新时间',
}
}
flowrule: {
index: '#',
importFlowRuleTip: '导入条件/人员规则',
id: '',
flowKey: '业务KEY',
defFlowId: '流程名称',
flowNodeId: '节点名称',
flowNodeRelId: '连线名称',
roleId: '参与者',
jobType: '参与者类型',
type: '数据类型',
valType: '数据值类型',
groupId: '同组条件ID',
groupsType: '条件组关系',
groupType: '组内条件关系',
varKeyVal: '表单字段',
operator: '运算符',
varVal: '校验值',
paramFrom: '参数来源',
paramValType: '参数值类型',
targetProp: '目标属性',
paramType: '参数类型',
createUser: '创建人',
createTime: '创建时间',
updateUser: '更新人',
updateTime: '更新时间',
inputIdTip: '请输入',
inputFlowKeyTip: '请输入业务KEY',
inputDefFlowIdTip: '请选择流程名称',
inputFlowNodeIdTip: '请先选择流程名称',
inputFlowNodeRelIdTip: '请先选择连线名称',
inputRoleIdTip: '请选择参与者',
inputJobTypeTip: '请输入参与者类型',
inputTypeTip: '请选择数据类型',
inputValTypeTip: '请选择模式',
inputGroupIdTip: '请输入同组条件ID',
inputGroupsTypeTip: '请选择条件组关系',
inputGroupTypeTip: '请选择组内条件关系',
inputVarKeyValTip: '请输入表单字段',
inputOperatorTip: '请选择运算符',
inputVarValTip: '请输入校验值',
inputParamFromTip: '请选择参数来源',
inputParamValTypeTip: '请选择参数值类型',
inputTargetPropTip: '请输入目标属性',
inputParamTypeTip: '请选择参数类型',
inputCreateUserTip: '请输入创建人',
inputCreateTimeTip: '请输入创建时间',
inputUpdateUserTip: '请输入更新人',
inputUpdateTimeTip: '请输入更新时间',
},
};

View File

@@ -1,260 +1,269 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="t('flowrule.type')" prop="type">
<el-select v-model="state.queryForm.type" :placeholder="t('flowrule.inputTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_RULE_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('flowrule.valType')" prop="type">
<el-select v-model="state.queryForm.valType" :placeholder="t('flowrule.inputValTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.VAL_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="t('flowrule.type')" prop="type">
<el-select v-model="state.queryForm.type" :placeholder="t('flowrule.inputTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.PARAM_RULE_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('flowrule.valType')" prop="type">
<el-select v-model="state.queryForm.valType" :placeholder="t('flowrule.inputValTypeTip')" clearable filterable>
<el-option v-for="(item, index) in DIC_PROP.VAL_TYPE" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('flowrule.defFlowId')" prop="defFlowId">
<el-select v-model="state.queryForm.defFlowId" :placeholder="t('flowrule.inputDefFlowIdTip')"
clearable filterable @change="cascadeChange('defFlowId', ['flowNodeId', 'flowNodeRelId'])">
<el-option v-for="(item, index) in dicData.defFlowId" :key="index" :label="item.flowName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('flowrule.flowNodeId')" prop="flowNodeId">
<el-select v-model="state.queryForm.flowNodeId" :placeholder="t('flowrule.inputFlowNodeIdTip')" clearable filterable>
<el-option v-for="(item, index) in cascadeDic.flowNodeId" :key="index" :label="item.nodeName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('flowrule.flowNodeRelId')" prop="flowNodeRelId">
<el-select v-model="state.queryForm.flowNodeRelId" :placeholder="t('flowrule.inputFlowNodeRelIdTip')" clearable filterable>
<el-option v-for="(item, index) in cascadeDic.flowNodeRelId" :key="index" :label="item.label" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('flowrule.defFlowId')" prop="defFlowId">
<el-select
v-model="state.queryForm.defFlowId"
:placeholder="t('flowrule.inputDefFlowIdTip')"
clearable
filterable
@change="cascadeChange('defFlowId', ['flowNodeId', 'flowNodeRelId'])"
>
<el-option v-for="(item, index) in dicData.defFlowId" :key="index" :label="item.flowName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('flowrule.flowNodeId')" prop="flowNodeId">
<el-select v-model="state.queryForm.flowNodeId" :placeholder="t('flowrule.inputFlowNodeIdTip')" clearable filterable>
<el-option v-for="(item, index) in cascadeDic.flowNodeId" :key="index" :label="item.nodeName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('flowrule.flowNodeRelId')" prop="flowNodeRelId">
<el-select v-model="state.queryForm.flowNodeRelId" :placeholder="t('flowrule.inputFlowNodeRelIdTip')" clearable filterable>
<el-option v-for="(item, index) in cascadeDic.flowNodeRelId" :key="index" :label="item.label" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
<el-button icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-tooltip placement="top">
<template #content>
{{ $t('common.addBtn') }}
</template>
<el-button icon="Plus" type="primary" class="ml10" @click="formDialogRef.openDialog('add')"
v-auth="'jsonflow_flowrule_add'">
</el-button>
</el-tooltip>
<el-form-item class="ml2">
<el-button icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-tooltip placement="top">
<template #content>
{{ $t('common.addBtn') }}
</template>
<el-button icon="Plus" type="primary" class="ml10" @click="formDialogRef.openDialog('add')" v-auth="'jsonflow_flowrule_add'"> </el-button>
</el-tooltip>
<el-tooltip placement="top">
<template #content>
{{ $t('common.delBtn') }}
</template>
<el-button plain :disabled="multiple" icon="Delete" type="primary" class="ml10"
v-auth="'jsonflow_flowrule_del'" @click="handleDelete(selectObjs)">
</el-button>
</el-tooltip>
<el-tooltip placement="top">
<template #content>
{{ $t('common.delBtn') }}
</template>
<el-button
plain
:disabled="multiple"
icon="Delete"
type="primary"
class="ml10"
v-auth="'jsonflow_flowrule_del'"
@click="handleDelete(selectObjs)"
>
</el-button>
</el-tooltip>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
:export="'jsonflow_flowrule_export'" @exportExcel="exportExcel"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column fixed="left" type="index" :label="t('flowrule.index')" width="40" />
<el-table-column prop="type" :label="t('flowrule.type')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.PARAM_RULE_TYPE" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="valType" :label="t('flowrule.valType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.VAL_TYPE" :value="scope.row.valType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="defFlowId" :label="t('flowrule.defFlowId')" show-overflow-tooltip>
<template #default="scope">
<convert-name :options="dicData.defFlowId" :value="scope.row.defFlowId"
:valueKey="'id'" :showKey="'flowName'"></convert-name>
</template>
</el-table-column>
<el-table-column prop="flowNodeId" :label="t('flowrule.flowNodeId')" show-overflow-tooltip>
<template #default="scope">
<convert-name :options="dicData.flowNodeId" :value="scope.row.flowNodeId"
:valueKey="'id'" :showKey="'nodeName'"></convert-name>
</template>
</el-table-column>
<el-table-column prop="groupId" :label="t('flowrule.groupId')" show-overflow-tooltip/>
<el-table-column prop="groupsType" :label="t('flowrule.groupsType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.OR_OR_AND" :value="scope.row.groupsType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="groupType" :label="t('flowrule.groupType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.OR_OR_AND" :value="scope.row.groupType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="varKeyVal" :label="t('flowrule.varKeyVal')" show-overflow-tooltip/>
<el-table-column prop="operator" :label="t('flowrule.operator')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.OPERATOR" :value="scope.row.operator"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="varVal" :label="t('flowrule.varVal')" show-overflow-tooltip/>
<right-toolbar
v-model:showSearch="showSearch"
class="ml10"
style="float: right; margin-right: 20px"
:export="'jsonflow_flowrule_export'"
@exportExcel="exportExcel"
@queryTable="getDataList"
></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
style="width: 100%"
@selection-change="handleSelectionChange"
@sort-change="sortChangeHandle"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column fixed="left" type="index" :label="t('flowrule.index')" width="40" />
<el-table-column prop="type" :label="t('flowrule.type')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.PARAM_RULE_TYPE" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="valType" :label="t('flowrule.valType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.VAL_TYPE" :value="scope.row.valType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="defFlowId" :label="t('flowrule.defFlowId')" show-overflow-tooltip>
<template #default="scope">
<convert-name :options="dicData.defFlowId" :value="scope.row.defFlowId" :valueKey="'id'" :showKey="'flowName'"></convert-name>
</template>
</el-table-column>
<el-table-column prop="flowNodeId" :label="t('flowrule.flowNodeId')" show-overflow-tooltip>
<template #default="scope">
<convert-name :options="dicData.flowNodeId" :value="scope.row.flowNodeId" :valueKey="'id'" :showKey="'nodeName'"></convert-name>
</template>
</el-table-column>
<el-table-column prop="groupId" :label="t('flowrule.groupId')" show-overflow-tooltip />
<el-table-column prop="groupsType" :label="t('flowrule.groupsType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.OR_OR_AND" :value="scope.row.groupsType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="groupType" :label="t('flowrule.groupType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.OR_OR_AND" :value="scope.row.groupType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="varKeyVal" :label="t('flowrule.varKeyVal')" show-overflow-tooltip />
<el-table-column prop="operator" :label="t('flowrule.operator')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.OPERATOR" :value="scope.row.operator"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="varVal" :label="t('flowrule.varVal')" show-overflow-tooltip />
<el-table-column prop="jobType" :label="t('flowrule.jobType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.JOB_USER_TYPE" :value="scope.row.jobType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="jobType" :label="t('flowrule.jobType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.JOB_USER_TYPE" :value="scope.row.jobType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="roleId" :label="t('flowrule.roleId')">
<template #default="scope">
<convert-role-name :options="{users: dicData.users, roles: dicData.roles, posts: dicData.posts, depts: dicData.depts }"
:value="scope.row"></convert-role-name>
</template>
</el-table-column>
<el-table-column prop="roleId" :label="t('flowrule.roleId')">
<template #default="scope">
<convert-role-name
:options="{ users: dicData.users, roles: dicData.roles, posts: dicData.posts, depts: dicData.depts }"
:value="scope.row"
></convert-role-name>
</template>
</el-table-column>
<el-table-column prop="paramFrom" :label="t('flowrule.paramFrom')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.PARAM_FROM" :value="scope.row.paramFrom"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="paramValType" :label="t('flowrule.paramValType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.PARAM_VAL_TYPE" :value="scope.row.paramValType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="targetProp" :label="t('flowrule.targetProp')" show-overflow-tooltip/>
<el-table-column prop="paramType" :label="t('flowrule.paramType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.PARAM_TYPES" :value="scope.row.paramType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="paramFrom" :label="t('flowrule.paramFrom')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.PARAM_FROM" :value="scope.row.paramFrom"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="paramValType" :label="t('flowrule.paramValType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.PARAM_VAL_TYPE" :value="scope.row.paramValType"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="targetProp" :label="t('flowrule.targetProp')" show-overflow-tooltip />
<el-table-column prop="paramType" :label="t('flowrule.paramType')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="DIC_PROP.PARAM_TYPES" :value="scope.row.paramType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('common.action')" fixed="right" width="100">
<template #default="scope">
<el-tooltip placement="top">
<template #content>
{{ $t('common.viewBtn') }}
</template>
<el-button text type="primary" icon="view" @click="formDialogRef.openDialog('view', scope.row.id)">
</el-button>
</el-tooltip>
<el-tooltip placement="top">
<template #content>
{{ $t('common.editBtn') }}
</template>
<el-button icon="edit-pen" text type="primary" @click="formDialogRef.openDialog('edit', scope.row.id)">
</el-button>
</el-tooltip>
<el-tooltip placement="top">
<template #content>
{{ $t('common.delBtn') }}
</template>
<el-button icon="delete" text type="primary" @click="handleDelete([scope.row.id])">
</el-button>
</el-tooltip>
<el-table-column :label="$t('common.action')" fixed="right" width="100">
<template #default="scope">
<el-tooltip placement="top">
<template #content>
{{ $t('common.viewBtn') }}
</template>
<el-button text type="primary" icon="view" @click="formDialogRef.openDialog('view', scope.row.id)"> </el-button>
</el-tooltip>
<el-tooltip placement="top">
<template #content>
{{ $t('common.editBtn') }}
</template>
<el-button icon="edit-pen" text type="primary" @click="formDialogRef.openDialog('edit', scope.row.id)"> </el-button>
</el-tooltip>
<el-tooltip placement="top">
<template #content>
{{ $t('common.delBtn') }}
</template>
<el-button icon="delete" text type="primary" @click="handleDelete([scope.row.id])"> </el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
</div>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
</div>
</template>
<script setup lang="ts" name="FlowRule">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObjs } from "/@/api/jsonflow/flow-rule";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
import {onCascadeChange, onLoadDicUrl} from "/@/flow/components/convert-name/convert";
import { BasicTableProps, useTable } from '/@/hooks/table';
import { fetchList, delObjs } from '/@/api/jsonflow/flow-rule';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import { onCascadeChange, onLoadDicUrl } from '/@/flow/components/convert-name/convert';
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n()
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
// 定义查询字典
const dicData = reactive({});
const cascadeDic = reactive({});
const onLoad = onLoadDicUrl({key: "defFlowId"}, {key: "flowNodeId"}, {key: "users"}, {key: "roles"}, {key: "posts"}, {key: "depts"});
const onCascade = onCascadeChange(cascadeDic, {key: "defFlowId", cascades: ["flowNodeId", "flowNodeRelId"]});
onMounted(() => {
onLoad(dicData);
});
function cascadeChange(key, cascades){
onCascade(state.queryForm, {key: key, cascades: cascades});
}
// 定义查询字典
const dicData = reactive({});
const cascadeDic = reactive({});
const onLoad = onLoadDicUrl({ key: 'defFlowId' }, { key: 'flowNodeId' }, { key: 'users' }, { key: 'roles' }, { key: 'posts' }, { key: 'depts' });
const onCascade = onCascadeChange(cascadeDic, { key: 'defFlowId', cascades: ['flowNodeId', 'flowNodeRelId'] });
onMounted(() => {
onLoad(dicData);
});
function cascadeChange(key, cascades) {
onCascade(state.queryForm, { key: key, cascades: cascades });
}
// 定义变量内容
const formDialogRef = ref()
// 搜索变量
const queryRef = ref()
const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any
const multiple = ref(true)
// 定义变量内容
const formDialogRef = ref();
// 搜索变量
const queryRef = ref();
const showSearch = ref(true);
// 多选变量
const selectObjs = ref([]) as any;
const multiple = ref(true);
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ["create_time"]
})
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ['create_time'],
});
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile
} = useTable(state)
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile } = useTable(state);
// 清空搜索条件
const resetQuery = () => {
queryRef.value.resetFields()
// 清空多选
selectObjs.value = []
getDataList()
}
// 清空搜索条件
const resetQuery = () => {
queryRef.value.resetFields();
// 清空多选
selectObjs.value = [];
getDataList();
};
// 多选事件
const handleSelectionChange = (objs: any) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length
}
// 多选事件
const handleSelectionChange = (objs: any) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};
// 导出excel
const exportExcel = () => {
downBlobFile('/jsonflow/flow-rule/export', state.queryForm, 'flowrule.xlsx')
}
// 导出excel
const exportExcel = () => {
downBlobFile('/jsonflow/flow-rule/export', state.queryForm, 'flowrule.xlsx');
};
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm(t('common.delConfirmText'));
} catch {
return;
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm(t('common.delConfirmText'));
} catch {
return;
}
try {
await delObjs(ids);
getDataList();
useMessage().success(t('common.delSuccessText'));
} catch (err: any) {
useMessage().error(err);
}
};
try {
await delObjs(ids);
getDataList();
useMessage().success(t('common.delSuccessText'));
} catch (err: any) {
useMessage().error(err);
}
};
</script>