<!--
|
* @Description: 表单项属性,控件属性面板
|
-->
|
<template>
|
<div class="properties-content">
|
<Form class="properties-body" label-align="left" layout="vertical">
|
<FormItem label="工艺路线编码" name="工艺路线编码">
|
<Input
|
:style="{ width: '100%' }"
|
v-model:value="mesRoute.ROT_CODE"
|
:min="0"
|
:step="1"
|
:readonly="true"
|
/>
|
</FormItem>
|
<FormItem label="节点ID" name="节点ID">
|
<Input
|
:style="{ width: '100%' }"
|
v-model:value="routeConfig.currentAct.NODE_ID"
|
:min="0"
|
:step="1"
|
:readonly="true"
|
/>
|
</FormItem>
|
<FormItem label="行为类型" name="行为类型">
|
<ApiSelect
|
:api="ActTypeStatus"
|
v-model:value="routeConfig.currentAct.ACT_TYPE"
|
resultField="Data"
|
:label-field="actTypeLable"
|
valueField="Value"
|
placeholder="请选择行为类型"
|
/>
|
</FormItem>
|
<FormItem label="自定义方法类型" name="自定义方法类型">
|
<ApiSelect
|
:api="DoTypeStatus"
|
v-model:value="routeConfig.currentAct.DO_TYPE"
|
resultField="Data"
|
:label-field="actTypeLable"
|
valueField="Value"
|
placeholder="请选择行为类型"
|
/>
|
</FormItem>
|
<FormItem label="自定义方法(调用方法的全名)" name="自定义方法">
|
<Input
|
:style="{ width: '100%' }"
|
v-model:value="routeConfig.currentAct.DO_METHOD"
|
:min="0"
|
:step="1"
|
/>
|
</FormItem>
|
<FormItem label="通过时执行(调用方法的全名)" name="通过时执行">
|
<Input
|
:style="{ width: '100%' }"
|
v-model:value="routeConfig.currentAct.DO_IF_PASS"
|
:min="0"
|
:step="1"
|
/>
|
</FormItem>
|
<FormItem label="失败时执行(调用方法的全名)" name="失败时执行">
|
<Input
|
:style="{ width: '100%' }"
|
v-model:value="routeConfig.currentAct.DO_IF_FAIL"
|
:min="0"
|
:step="1"
|
/>
|
</FormItem>
|
<FormItem label="是否启用" name="是否启用">
|
<Select
|
ref="select"
|
v-model:value="routeConfig.currentAct.IS_ACTIVE"
|
style="width: 120px"
|
:options="options1"
|
/>
|
</FormItem>
|
</Form>
|
</div>
|
</template>
|
<script lang="ts" setup>
|
import { Select, Input, Form, FormItem } from 'ant-design-vue';
|
import { useRouteDesignState } from '../hooks/useRouteDesignState';
|
import { SelectTypes } from 'ant-design-vue/es/select';
|
import { ApiSelect } from '/@/components/Form/index';
|
import { ref, unref, watch } from 'vue';
|
import { useLocale } from '/@/locales/useLocale';
|
import { ActTypeStatus, DoTypeStatus } from '/@/api/tigerapi/mes/router';
|
|
const { getLocale } = useLocale();
|
const { routeConfig, mesRoute } = useRouteDesignState();
|
const options1 = ref<SelectTypes['options']>([
|
{
|
value: 'Y',
|
label: '启用',
|
},
|
{
|
value: 'N',
|
label: '不启用',
|
},
|
]);
|
const actTypeLable = unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name';
|
watch(
|
() => routeConfig.currentAct,
|
(newVal, oldVal) => {
|
routeConfig.routeData.acts.forEach((r) => {
|
if (r.ID == routeConfig.currentAct.ID) {
|
r.IS_ACTIVE = newVal.IS_ACTIVE;
|
r.ACT_TYPE = newVal.ACT_TYPE;
|
r.DO_TYPE = newVal.DO_TYPE;
|
r.DO_METHOD = newVal.DO_METHOD;
|
r.DO_IF_PASS = newVal.DO_IF_PASS;
|
r.DO_IF_FAIL = newVal.DO_IF_FAIL;
|
}
|
});
|
},
|
{ deep: true, immediate: true },
|
);
|
</script>
|