| | |
| | | <template> |
| | | <div class="h-full" :class="prefixCls"> |
| | | <FlowChartToolbar :prefixCls="prefixCls" v-if="toolbar" @view-data="handlePreview" |
| | | <FlowChartToolbar |
| | | :prefixCls="prefixCls" |
| | | v-if="toolbar" |
| | | @view-data="handlePreview" |
| | | @save-data="handleSave" |
| | | @add-data="handleAdd"/> |
| | | <a-layout style="min-height: 100vh"> |
| | | <a-layout-content> |
| | | @add-data="handleAdd" |
| | | /> |
| | | <div ref="lfElRef" class="h-full"></div> |
| | | </a-layout-content> |
| | | <a-layout-sider |
| | | width="450" |
| | | style="background: #fafafa; border-left: 1px solid #d9d9d9; padding: 20px" |
| | | ><BasicForm |
| | | autoFocusFirstItem |
| | | :labelWidth="80" |
| | | :schemas="schemas" |
| | | :actionColOptions="{ span: 24 }" |
| | | :submitButtonOptions="{ text: '确定' }" |
| | | @submit="handleSubmit" |
| | | @reset="handleReset" |
| | | /></a-layout-sider> |
| | | </a-layout> |
| | | <BasicModal @register="register" title="流程数据" width="50%"> |
| | | <JsonPreview :data="graphData" /> |
| | | </BasicModal> |
| | |
| | | import { configDefaultDndPanel } from './config'; |
| | | import '@logicflow/core/dist/style/index.css'; |
| | | import '@logicflow/extension/lib/style/index.css'; |
| | | import { BasicForm, FormSchema } from '/@/components/Form/index'; |
| | | import { getOperAllList } from '/@/api/tigerapi/mes/oper'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import customEdge from './customEdge'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | |
| | | const isRuter = (type: string) => type === '0'; |
| | | const isOper = (type: string) => type === '1'; |
| | | const schemas: FormSchema[] = [ |
| | | // { |
| | | // field: 'divider-basic', |
| | | // component: 'Divider', |
| | | // label: '属性页', |
| | | // }, |
| | | { |
| | | field: 'func_type', |
| | | label: '属性页', |
| | | component: 'RadioButtonGroup', |
| | | defaultValue: '0', |
| | | componentProps: { |
| | | options: [ |
| | | { label: '工艺流程', value: '0' }, |
| | | { label: '工序', value: '1' }, |
| | | ], |
| | | }, |
| | | colProps: { lg: 24, md: 24 }, |
| | | }, |
| | | { |
| | | field: 'OPER_CODE', |
| | | component: 'ApiSelect', |
| | | label: '选择工序', |
| | | componentProps: { |
| | | api: getOperAllList, |
| | | // params: { |
| | | // id: 1, |
| | | // }, |
| | | resultField: 'items', |
| | | labelField: 'OPER_NAME', |
| | | valueField: 'OPER_CODE', |
| | | // not request untill to select |
| | | immediate: false, |
| | | onChange: (e) => { |
| | | console.log('selected:', e); |
| | | }, |
| | | // atfer request callback |
| | | onOptionsChange: (options) => { |
| | | console.log('get options', options.length, options); |
| | | }, |
| | | }, |
| | | ifShow: ({ values }) => isOper(values.func_type), |
| | | }, |
| | | { |
| | | field: 'field2', |
| | | component: 'Input', |
| | | label: '工序类型', |
| | | // componentProps:{}, |
| | | // can func |
| | | componentProps: ({ schema, formModel }) => { |
| | | console.log('form:', schema); |
| | | console.log('formModel:', formModel); |
| | | return { |
| | | placeholder: '测试', |
| | | onChange: (e: any) => { |
| | | console.log(e); |
| | | }, |
| | | }; |
| | | }, |
| | | renderComponentContent: () => { |
| | | return { |
| | | prefix: () => '工序', |
| | | suffix: () => '类型', |
| | | }; |
| | | }, |
| | | }, |
| | | { |
| | | field: 'field3', |
| | | component: 'Select', |
| | | label: '工序行为', |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: '存储过程', |
| | | value: '1', |
| | | key: '1', |
| | | }, |
| | | { |
| | | label: '条码规则', |
| | | value: '2', |
| | | key: '2', |
| | | }, |
| | | { |
| | | label: '行为一', |
| | | value: '3', |
| | | key: '3', |
| | | }, |
| | | { |
| | | label: '行为二', |
| | | value: '4', |
| | | key: '4', |
| | | }, |
| | | { |
| | | label: '行为三', |
| | | value: '5', |
| | | key: '5', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: 'field4', |
| | | component: 'Switch', |
| | | label: '是否计算直通率', |
| | | colProps: { |
| | | span: 16, |
| | | }, |
| | | labelWidth: 200, |
| | | }, |
| | | { |
| | | field: 'field5', |
| | | component: 'Switch', |
| | | label: '是否可跳站', |
| | | colProps: { |
| | | span: 16, |
| | | }, |
| | | labelWidth: 200, |
| | | }, |
| | | ]; |
| | | const { notification } = useMessage(); |
| | | const { t } = useI18n(); |
| | | |
| | | export default defineComponent({ |
| | | name: 'FlowChart', |
| | | components: { BasicModal, FlowChartToolbar, JsonPreview, BasicForm }, |
| | | components: { BasicModal, FlowChartToolbar, JsonPreview }, |
| | | props: { |
| | | flowOptions: { |
| | | type: Object as PropType<Definition>, |
| | |
| | | } |
| | | }); |
| | | } |
| | | lf.on('node:click,edge:click', (data) => { |
| | | console.log(data.data.text.value, data.isSelected); |
| | | notification.success({ |
| | | message: t('点击了节点'), |
| | | description: `${data.data.text.value}: ${data.isSelected}`, |
| | | duration: 3, |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | function handlePreview() { |
| | |
| | | lfElRef, |
| | | handlePreview, |
| | | graphData, |
| | | schemas, |
| | | handleReset: () => {}, |
| | | handleSubmit: (_values: any) => {}, |
| | | handleSave, |
| | | handleAdd, |
| | | }; |
| | |
| | | import { router, setupRouter } from '@/router'; |
| | | import { setupRouterGuard } from '@/router/guard'; |
| | | import { setupStore } from '@/store'; |
| | | // import { buildUUID } from '@/utils/uuid'; |
| | | |
| | | import App from './App.vue'; |
| | | |
| | |
| | | // 注册全局组件 |
| | | registerGlobComp(app); |
| | | |
| | | // app.config.globalProperties.name = buildUUID(); |
| | | // Multilingual configuration |
| | | // 多语言配置 |
| | | // Asynchronous case: language files may be obtained from the server side |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { computed } from 'vue'; |
| | | import { AppLogo } from '/@/components/Application'; |
| | | import { AppLocalePicker } from '/@/components/Application'; |
| | | import { computed, getCurrentInstance } from 'vue'; |
| | | import { AppLogo, AppLocalePicker } from '/@/components/Application'; |
| | | import LoginForm from './LoginForm.vue'; |
| | | import ForgetPasswordForm from './ForgetPasswordForm.vue'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | |
| | | type: Boolean, |
| | | }, |
| | | }); |
| | | |
| | | const { appContext } = getCurrentInstance(); |
| | | const globSetting = useGlobSetting(); |
| | | const { prefixCls } = useDesign('login'); |
| | | const { t } = useI18n(); |
| | | const localeStore = useLocaleStore(); |
| | | const showLocale = localeStore.getShowPicker; |
| | | const title = computed(() => globSetting?.title ?? ''); |
| | | const name = appContext.config.globalProperties.name; |
| | | </script> |
| | | <style lang="less"> |
| | | @prefix-cls: ~'@{namespace}-login'; |
| | |
| | | </Button> |
| | | </FormItem> |
| | | </Form> |
| | | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { reactive, ref, unref, computed, onMounted,h } from 'vue'; |
| | |
| | | import { accountFormSchema } from './loginDept.data'; |
| | | import { getTreeList, optionsListApi } from '/@/api/tigerapi/dept'; |
| | | |
| | | |
| | | //import { onKeyStroke } from '@vueuse/core'; |
| | | |
| | | |
| | | const ACol = Col; |
| | | const ARow = Row; |
| | |
| | | async function handleLogin() { |
| | | const data = await validForm(); |
| | | const orgData = await validate(); |
| | | console.log('data',data) |
| | | console.log('data', data); |
| | | if (!data) return; |
| | | try { |
| | | loading.value = true; |
| | | //const positionInfo = await getUserIpConfig(); |
| | | const Info = { ad_info: {}, ip: '' } //positionInfo.status === 110 ? { ad_info: {}, ip: '' } : positionInfo.result; |
| | | const Info = { ad_info: {}, ip: '' }; //positionInfo.status === 110 ? { ad_info: {}, ip: '' } : positionInfo.result; |
| | | const accountInfo: AccountInfo = { |
| | | useR_CODE: data.account, |
| | | password: data.password, |
| | |
| | | description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realName}`, |
| | | duration: 3, |
| | | }); |
| | | |
| | | |
| | | }else{ |
| | | createErrorModal({ |
| | | title: t('sys.api.errorTip'), |
| | |
| | | <template> |
| | | <PageWrapper title="工艺流程图" content="根据生产工艺设计工艺流程" contentFullHeight fixedHeight> |
| | | <a-layout style="min-height: 100vh"> |
| | | <a-layout-content> |
| | | <FlowChart :data="demoData" /> |
| | | </a-layout-content> |
| | | <a-layout-sider |
| | | width="450" |
| | | style="background: #fafafa; border-left: 1px solid #d9d9d9; padding: 20px" |
| | | ><BasicForm |
| | | autoFocusFirstItem |
| | | :labelWidth="80" |
| | | :schemas="schemas" |
| | | :actionColOptions="{ span: 24 }" |
| | | :submitButtonOptions="{ text: '确定' }" |
| | | @submit="handleSubmit" |
| | | @reset="handleReset" |
| | | /></a-layout-sider> |
| | | </a-layout> |
| | | </PageWrapper> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { FlowChart } from '/@/components/FlowChart'; |
| | | import { PageWrapper } from '/@/components/Page'; |
| | | import { BasicForm, FormSchema } from '/@/components/Form/index'; |
| | | import { getOperAllList } from '/@/api/tigerapi/mes/oper'; |
| | | |
| | | const isRuter = (type: string) => type === '0'; |
| | | const isOper = (type: string) => type === '1'; |
| | | const schemas: FormSchema[] = [ |
| | | // { |
| | | // field: 'divider-basic', |
| | | // component: 'Divider', |
| | | // label: '属性页', |
| | | // }, |
| | | { |
| | | field: 'func_type', |
| | | label: '属性页', |
| | | component: 'RadioButtonGroup', |
| | | defaultValue: '0', |
| | | componentProps: { |
| | | options: [ |
| | | { label: '工艺流程', value: '0' }, |
| | | { label: '工序', value: '1' }, |
| | | ], |
| | | }, |
| | | colProps: { lg: 24, md: 24 }, |
| | | }, |
| | | { |
| | | field: 'OPER_CODE', |
| | | component: 'ApiSelect', |
| | | label: '选择工序', |
| | | componentProps: { |
| | | api: getOperAllList, |
| | | // params: { |
| | | // id: 1, |
| | | // }, |
| | | resultField: 'items', |
| | | labelField: 'OPER_NAME', |
| | | valueField: 'OPER_CODE', |
| | | // not request untill to select |
| | | immediate: false, |
| | | onChange: (e) => { |
| | | console.log('selected:', e); |
| | | }, |
| | | // atfer request callback |
| | | onOptionsChange: (options) => { |
| | | console.log('get options', options.length, options); |
| | | }, |
| | | }, |
| | | ifShow: ({ values }) => isOper(values.func_type), |
| | | }, |
| | | { |
| | | field: 'field2', |
| | | component: 'Input', |
| | | label: '工序类型', |
| | | // componentProps:{}, |
| | | // can func |
| | | componentProps: ({ schema, formModel }) => { |
| | | console.log('form:', schema); |
| | | console.log('formModel:', formModel); |
| | | return { |
| | | placeholder: '测试', |
| | | onChange: (e: any) => { |
| | | console.log(e); |
| | | }, |
| | | }; |
| | | }, |
| | | renderComponentContent: () => { |
| | | return { |
| | | prefix: () => '工序', |
| | | suffix: () => '类型', |
| | | }; |
| | | }, |
| | | }, |
| | | { |
| | | field: 'field3', |
| | | component: 'Select', |
| | | label: '工序行为', |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: '存储过程', |
| | | value: '1', |
| | | key: '1', |
| | | }, |
| | | { |
| | | label: '条码规则', |
| | | value: '2', |
| | | key: '2', |
| | | }, |
| | | { |
| | | label: '行为一', |
| | | value: '3', |
| | | key: '3', |
| | | }, |
| | | { |
| | | label: '行为二', |
| | | value: '4', |
| | | key: '4', |
| | | }, |
| | | { |
| | | label: '行为三', |
| | | value: '5', |
| | | key: '5', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: 'field4', |
| | | component: 'Switch', |
| | | label: '是否计算直通率', |
| | | colProps: { |
| | | span: 16, |
| | | }, |
| | | labelWidth: 200, |
| | | }, |
| | | { |
| | | field: 'field5', |
| | | component: 'Switch', |
| | | label: '是否可跳站', |
| | | colProps: { |
| | | span: 16, |
| | | }, |
| | | labelWidth: 200, |
| | | }, |
| | | ]; |
| | | export default { |
| | | components: { FlowChart, PageWrapper }, |
| | | components: { FlowChart, PageWrapper, BasicForm }, |
| | | setup() { |
| | | let demoData = { |
| | | nodes: [ |
| | |
| | | }; |
| | | return { |
| | | demoData, |
| | | schemas, |
| | | handleReset: () => {}, |
| | | handleSubmit: (_values: any) => {}, |
| | | }; |
| | | }, |
| | | }; |