From 92cb62d60d38be56312be20cfae8638a5a9aa57a Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 27 十月 2024 11:15:09 +0800 Subject: [PATCH] 计划任务优化 --- src/views/tigerprojects/tsk/tsk_job/job.data.ts | 254 +++++++++++++ src/components/FlowChart/src/SpecPackingNode.ts | 102 +++++ src/views/tigerprojects/tsk/tsk_job/log.data.ts | 76 ++- src/assets/icons/specPacking-48.svg | 1 src/assets/icons/specPacking-128.svg | 1 src/views/tigerprojects/tsk/tsk_job/jobDetail.vue | 22 src/views/tigerprojects/tsk/tsk_job/index.vue | 228 ++++++------ src/assets/icons/specPacking-64.svg | 1 src/store/modules/multipleTab.ts | 15 src/assets/icons/specPacking.svg | 1 src/assets/icons/specPacking-32.svg | 1 src/views/tigerprojects/tsk/tsk_job/trig.data.ts | 32 + src/api/tigerapi/tsk/tsk_job.ts | 65 -- src/components/FlowChart/src/config.ts | 12 src/api/model/baseModel.ts | 1 src/api/tigerapi/system.ts | 40 + src/components/FlowChart/src/FlowChart.vue | 2 src/api/tigerapi/model/tskModel.ts | 36 + src/views/tigerprojects/tsk/tsk_job/jobDrawer.vue | 131 +++--- 19 files changed, 726 insertions(+), 295 deletions(-) diff --git a/src/api/model/baseModel.ts b/src/api/model/baseModel.ts index 114cd41..c5bb963 100644 --- a/src/api/model/baseModel.ts +++ b/src/api/model/baseModel.ts @@ -64,6 +64,7 @@ Message: string; Data: T; LocaleMsg: localeMsg | undefined; + NeedInclude: boolean; } export interface ApiActionJob<T> { ID: string; diff --git a/src/api/tigerapi/model/tskModel.ts b/src/api/tigerapi/model/tskModel.ts index 82a6d08..65d32fa 100644 --- a/src/api/tigerapi/model/tskModel.ts +++ b/src/api/tigerapi/model/tskModel.ts @@ -1,5 +1,6 @@ import { List } from 'echarts'; import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; +import { Dayjs } from 'dayjs'; //浠诲姟绠$悊=銆嬩换鍔″垪琛� export type Tsk_JobParams = { @@ -11,7 +12,7 @@ // 涓婚敭 GUID ID: string; //浠诲姟鍚嶇О - JobName:string; + JobName: string; // 鍒涘缓鏃堕棿 CREATE_TIME: string; // 鍒涘缓鑰� @@ -47,14 +48,14 @@ // 澶囨敞 Remark: string; //鍙傛暟 - Triggers:List<Tsk_TrigListItem>; + Triggers: List<Tsk_TrigListItem>; //鏃ュ織 - Logs:List<Tsk_LogListItem>; + Logs: List<Tsk_LogListItem>; //鏃堕棿 - Period:number; - uPeriod:number; + Period: number; + uPeriod: number; //鐘舵�� - Status:Number; + Status: Number; } //浠诲姟瑙﹀彂鍣� @@ -89,9 +90,9 @@ // 缁撴潫鏃堕棿 EndTime: string; //鏈�鍚庤繍琛屾椂闂� - LastRunTime:string; + LastRunTime: string; //涓嬩竴娆¤繍琛屾椂闂� - NextRunTime:string; + NextRunTime: string; // 瑙﹀彂娆℃暟 NumberOfRuns: number; // 鏈�澶цЕ鍙戞鏁帮紝0: 涓嶉檺鍒讹紝n: N 娆� @@ -101,7 +102,7 @@ // 鏈�澶у嚭閿欐鏁帮紝0:涓嶉檺鍒讹紝n: N 娆� MaxNumberOfErrors: number; //閲嶈瘯娆℃暟 - NumRetries:number; + NumRetries: number; // 閲嶈瘯闂撮殧鏃堕棿锛屾绉掑崟浣� RetryTimeout: string; // 鏄惁绔嬪嵆鍚姩 @@ -176,3 +177,20 @@ export type Tsk_LogPageListGetResultModel = BasicFetchResult<Tsk_LogListItem>; export type Tsk_TrigPageListGetResultModel = BasicFetchResult<Tsk_TrigListItem>; + +export interface TskParameter { + JobName: string; + JobType: string; + AssemblyName: string; + Remark: string; + NonReentrant: string; + ToRunOnceAtDt: Dayjs; + runType: number; + type: number; + NowAddMinutes: number; //涓婇潰鏃堕棿鍔犲灏戝垎閽燂紝琛ㄧず寤惰繜澶氬皯鍒嗛挓杩愯 + ToRunEvery: number; //姣忛殧澶氬皯杩愯涓�鍥� + ToRunOnceIn: number; //鍦ㄥ灏戝悗杩愯涓�娆� + Minutes: number; + Hours: number; + Days: number; +} diff --git a/src/api/tigerapi/system.ts b/src/api/tigerapi/system.ts index e6a9a45..3dababe 100644 --- a/src/api/tigerapi/system.ts +++ b/src/api/tigerapi/system.ts @@ -67,6 +67,7 @@ StopJob = '/Tsk/PauseJob', AddJob = '/Tsk/AddJob', UpdateJob = '/Tsk/UpdateJob', + SaveTskJob = '/Tsk/SaveTskJob', urlQueryEnum = '/Base/QueryEnum', DeleteWareHouse = '/WMS/DelWareHouseModel', AddLocation = '/WMS/AddLoctionModel', @@ -134,7 +135,7 @@ /* * 鐢熸垚Action */ -export function genAction<T>(datatype: string, data: T, option?: object) { +export function genAction<T>(datatype: string, data: T, option?: object, NeedInclude?: boolean) { const time = new Date(); const params: ApiAction<T> = { ID: buildUUID(), @@ -148,6 +149,7 @@ StatusCode: 0, Data: data, LocaleMsg: undefined, + NeedInclude: isNullOrEmpty(NeedInclude) ? false : NeedInclude, }; return params; } @@ -318,18 +320,18 @@ */ export function findParent(tree: any[], nodeId: string): any | undefined { for (const node of tree) { - if (node.children) { - for (const child of node.children) { - if (child.tid === nodeId) { - return node; - } - // 閫掑綊鏌ユ壘瀛愭爲 - const potentialParent = findParent(node.children, nodeId); - if (potentialParent) { - return potentialParent; - } - } + if (node.children) { + for (const child of node.children) { + if (child.tid === nodeId) { + return node; + } + // 閫掑綊鏌ユ壘瀛愭爲 + const potentialParent = findParent(node.children, nodeId); + if (potentialParent) { + return potentialParent; + } } + } } return undefined; // 娌℃湁鎵惧埌瀵瑰簲鐨勭埗浜茶妭鐐� } @@ -753,6 +755,7 @@ }, }, params['option'], + params['NeedInclude'], ); return getListByPageAsync(rParams, params['apiUrl']); //濡傛灉涓嶆兂鐢ㄩ粯璁ょ殑鍩虹鏂规硶鑾峰彇鍒嗛〉鏁版嵁锛屽彲浠ユ崲鍏朵粬鐨刟pi } @@ -790,15 +793,18 @@ Keys[k] != 'option' && Keys[k] != '0' && Keys[k] != 'apiUrl' && + Keys[k] != 'NeedInclude' && !Keys[k].toString().endsWith('PSelect_0') ) { - if (!isNullOrEmpty(params[Keys[k]].length) && isTimeViaRegExp8601(params[Keys[k]][0])) { - sqlcmd += ` And ${Keys[k]} > '${params[Keys[k]][0]}'`; - sqlcmd += ` And ${Keys[k]} < '${params[Keys[k]][1]}'`; + if (!isNullOrEmpty(params[Keys[k]].length) && isArray(params[Keys[k]])) { + if (isTimeViaRegExp8601(params[Keys[k]][0])) { + sqlcmd += ` And ${Keys[k]} > '${params[Keys[k]][0]}'`; + sqlcmd += ` And ${Keys[k]} < '${params[Keys[k]][1]}'`; + } else { + sqlcmd += `And '${params[Keys[k]].join(',')}' like '%'+${Keys[k]}+'%'`; + } } else if (isNumber(params[Keys[k]])) { sqlcmd += `And ${Keys[k]} = ${params[Keys[k]]}`; - } else if (Keys[k] == 'sqlcmd') { - sqlcmd += ` And ${params[Keys[k]]}`; } else { sqlcmd += `And ${Keys[k]} like '%${params[Keys[k]]}%'`; } diff --git a/src/api/tigerapi/tsk/tsk_job.ts b/src/api/tigerapi/tsk/tsk_job.ts index ccd3380..3f25fb4 100644 --- a/src/api/tigerapi/tsk/tsk_job.ts +++ b/src/api/tigerapi/tsk/tsk_job.ts @@ -5,6 +5,7 @@ Tsk_JobPageListGetResultModel, Tsk_JobPageParams, Tsk_TrigListItem, + TskParameter, } from '../model/tskModel'; import { genAction,genActionjob, Api, genActionPage } from '../system'; import { defHttp } from '/@/utils/http/axios'; @@ -20,7 +21,7 @@ let sqlcmdt=''; sqlcmdt += " STATUS = '" + params?.Status + "'";; const _data = await defHttp.post<ApiAction<Tsk_TrigListItem[]>>( - { url: Api.EntityList, params: genAction('TSK_TRIG', sqlcmdt) }, + { url: Api.EntityList, params: genAction('TSK_TRIG', sqlcmdt, undefined, true) }, { isTransformResponse: false, apiUrl: globSetting.taskApiUrl @@ -80,55 +81,19 @@ return model; } -export const SaveTsk_Job = async (params: Tsk_JobListItem, isUpdate: boolean) => { - let data; - if (isUpdate) { - params.uPeriod = params.Period - data = await defHttp.post( - { url: Api.UpdateJob, params: genAction('TSK_JOB',params)}, - { - errorMessageMode: 'none', - isTransformResponse: false, - apiUrl: globSetting.taskApiUrl - }, - ); - } else { - params.ID = buildUUID(); //鐢熸垚GUID - data = await defHttp.post( - { url: Api.AddJob, params: genActionjob(params.JobType, params.AssemblyName,params.JobName,params.Period,params.Remark) }, - { - errorMessageMode: 'none', - isTransformResponse: false, - apiUrl: globSetting.taskApiUrl - }, - ); - // //娣诲姞浠诲姟鏁版嵁鍒版暟鎹簱 - // data.Data.JobName=params.JobName; - // data.Data.Remark=params.Remark; - // data.Data.JobType=params.JobType; - // var job=await defHttp.post( - // { - // url:Api.AddEntity,params:genAction('TSK_JOB',data.Data) - // }, - // { - // errorMessageMode:'none', - // isTransformResponse:false, - // apiUrl: globSetting.taskApiUrl - // }); - // data.Data.Triggers[0].Args=params.Time*60*1000 - // data.Data.Triggers[0].JobId=data.Data.ID - // var trig = defHttp.post( - // { - // url:Api.AddEntity,params:genAction('TSK_TRIG',data.Data.Triggers[0]) - // }, - // { - // errorMessageMode:'none', - // isTransformResponse:false, - // apiUrl: globSetting.taskApiUrl - // }); - } - - return data; +/** + * 淇濆瓨浠诲姟 + */ +export const SaveTskJob = async (params: TskParameter) => { + const usParams = genAction('TSK_JOB', params); + return await defHttp.post( + { url: Api.SaveTskJob, params: usParams }, + { + errorMessageMode: 'none', + isTransformResponse: false, + apiUrl: globSetting.taskApiUrl + }, + ); }; //鍒犻櫎 export const DeleteTsk_Job = async (params: Recordable) => { diff --git a/src/assets/icons/specPacking-128.svg b/src/assets/icons/specPacking-128.svg new file mode 100644 index 0000000..b032250 --- /dev/null +++ b/src/assets/icons/specPacking-128.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729931281638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2152" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M26.88 741.12V261.632c6.4-5.12 12.032-11.264 18.944-15.104 120.576-66.56 241.664-133.12 362.24-199.424 12.544-6.912 24.832-14.336 37.12-21.248h15.104c45.312 25.344 90.624 50.688 135.936 75.776 86.528 47.872 172.8 95.488 259.584 142.848 16.64 9.216 23.808 20.224 23.552 40.448-1.28 83.712-0.512 167.424-0.512 250.88v57.856c22.016 4.608 42.496 2.816 61.184 9.472 33.536 12.288 49.92 40.96 60.672 73.216v239.616c-12.032 43.776-39.936 71.68-83.712 83.712h-239.616c-40.704-13.056-70.656-37.376-80.896-83.2-46.848 28.672-91.392 55.808-135.936 83.2H445.44c-1.792-1.536-3.584-3.328-5.632-4.608-131.328-78.848-262.912-157.44-393.984-236.544-7.168-4.352-12.8-11.52-18.944-17.408zM69.12 306.432c-0.512 4.864-1.28 7.936-1.28 10.752 0 131.84-0.256 263.68 0.512 395.52 0 6.4 6.144 15.104 11.776 18.432 113.152 68.608 226.816 136.704 340.48 204.544 3.328 2.048 7.424 3.072 12.544 5.12 0-136.96 0.256-271.872-0.512-407.04 0-5.888-7.424-14.08-13.312-17.664-111.616-67.584-223.488-134.656-335.36-201.728-4.608-2.304-8.96-4.608-14.848-7.936z m403.968 637.184c38.144-22.784 72.448-44.032 107.264-64 10.752-6.144 14.848-12.8 14.848-25.344-0.768-50.688-0.512-101.376-0.256-152.064 0.256-65.536 42.752-108.032 108.544-108.288 38.656-0.256 77.312 0 115.968 0 6.144 0 12.032-0.512 17.408-0.768V306.688c-30.208 18.176-58.368 35.328-86.784 51.456-9.472 5.376-13.056 11.52-12.8 22.528 0.768 34.304 0.256 68.352 0.256 102.656 0 15.36-5.632 25.6-20.736 32.512-35.072 16.128-69.12 34.56-103.68 51.456-26.368 12.8-38.144 5.376-38.4-23.552v-79.872c-32 19.2-60.672 36.608-89.6 53.248-9.728 5.632-12.544 12.288-12.288 22.784 0.512 34.304 0.256 68.352 0.256 102.656v301.056z m487.168-146.688c0-32.256 0.256-64.768 0-97.024-0.512-40.96-24.576-65.28-64.768-65.536-65.28-0.256-130.56-0.256-195.84 0-38.144 0.256-63.488 25.344-63.488 63.232-0.256 65.792-0.256 131.84 0 197.632 0.256 38.144 24.832 63.232 63.232 63.488 65.792 0.512 131.84 0.512 197.632 0 38.656-0.256 62.976-24.32 63.488-62.976 0-32.768-0.256-65.792-0.256-98.816zM89.344 268.288c120.32 72.96 238.336 144.384 356.352 215.552 3.584 2.048 10.24 2.816 13.824 0.768 32-18.432 63.488-37.632 97.28-57.856-115.456-73.984-228.352-146.432-341.504-218.368-3.584-2.304-11.008-2.048-15.104 0-36.608 19.456-72.704 39.168-110.848 59.904z m589.312 84.736c-2.56-2.816-3.328-4.352-4.864-5.376-109.568-69.632-219.392-139.008-329.216-208.128-4.096-2.56-11.52-4.096-15.36-2.048-26.112 13.568-51.968 28.16-78.592 42.752 2.304 2.816 3.328 4.352 4.608 5.376 110.336 70.912 220.672 141.568 331.264 211.968 3.84 2.56 11.264 3.328 15.104 1.28 25.856-14.336 50.944-29.952 77.056-45.824zM375.808 110.592c114.176 71.936 225.536 142.08 337.152 211.968 3.584 2.304 10.24 3.328 13.568 1.536 29.952-17.152 59.136-35.328 89.088-53.248-2.304-3.072-2.816-4.352-3.584-4.864-116.48-64-233.216-128-349.952-191.744-3.84-2.048-10.496-3.84-13.824-2.048-23.808 11.776-46.848 24.576-72.448 38.4z m320.768 280.576c-26.624 15.872-50.176 29.44-73.216 43.52-3.328 2.048-7.168 6.4-7.168 9.728-0.512 24.32-0.256 48.64-0.256 76.288 26.624-13.312 50.176-24.832 73.472-37.12 3.584-1.792 6.912-7.424 6.912-11.52 0.512-25.6 0.256-51.456 0.256-80.896z" p-id="2153" fill="#dd8520"></path><path d="M391.68 777.216c0 18.944 0.768 38.144-0.256 57.088-1.024 22.016-15.36 29.696-33.536 18.176-38.4-24.576-76.544-49.664-113.664-76.288-7.68-5.632-13.824-18.176-14.336-27.904-1.792-34.048-1.28-68.352-0.256-102.656 1.024-32.512 13.568-39.424 40.448-22.016 36.096 23.296 72.192 47.104 107.264 72.192 7.424 5.376 12.8 16.896 13.824 26.368 2.304 17.92 0.768 36.608 0.512 55.04 0.256 0 0 0 0 0z m-40.448 22.784c0-24.32 0.256-44.544-0.256-64.512-0.256-4.352-2.56-10.24-5.888-12.8-23.552-16.384-47.872-32.256-74.752-50.176 0 24.832-0.256 46.08 0.256 67.328 0 3.584 3.328 8.192 6.4 10.24 23.552 16.128 47.104 31.744 74.24 49.92zM777.472 776.192v-73.216c0-14.592 3.072-27.648 20.992-27.392 16.64 0.256 19.968 12.544 19.968 26.624-0.256 63.232-0.256 126.464 0 189.696 0 14.848-4.864 26.112-20.736 25.856-15.872-0.256-20.48-12.288-20.224-26.624 0.256-24.064 0-47.872 0-74.496-25.088 0-48.896-0.256-72.704 0-14.848 0.256-27.904-2.816-27.648-20.48 0-17.92 13.568-20.48 28.16-20.224 23.04 0.512 46.336 0.256 72.192 0.256z" p-id="2154" fill="#dd8520"></path><path d="M744.96 918.528h-55.808c-7.168 0-12.8-5.888-12.8-12.8v-54.016c0-7.168 5.888-12.8 12.8-12.8H744.96c7.168 0 12.8 5.888 12.8 12.8v54.016c0 7.168-5.632 12.8-12.8 12.8zM905.728 755.2h-54.272c-7.168 0-12.8-5.888-12.8-12.8v-54.272c0-7.168 5.888-12.8 12.8-12.8h54.272c7.168 0 12.8 5.888 12.8 12.8V742.4c0 6.912-5.888 12.8-12.8 12.8zM903.424 817.92h-50.432c-7.424 0-13.568-6.144-13.568-13.568v-13.056c0-7.424 6.144-13.568 13.568-13.568h50.432c7.424 0 13.568 6.144 13.568 13.568v13.056c0 7.424-6.144 13.568-13.568 13.568zM918.528 858.88c0-11.008-8.96-19.968-19.968-19.968s-19.968 8.96-19.968 19.968v22.784h-22.784c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 9.472 7.68 17.152 17.152 17.152h45.824c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-0.512 0-1.024-0.256-1.536 0-0.512 0.256-1.024 0.256-1.536v-36.864zM677.12 734.208c0 11.008 8.96 19.968 19.968 19.968s19.968-8.96 19.968-19.968v-22.784h22.784c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-9.472-7.68-17.152-17.152-17.152h-45.824c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 0.512 0 1.024 0.256 1.536 0 0.512-0.256 1.024-0.256 1.536l0.256 36.864z" p-id="2155" fill="#dd8520"></path></svg> \ No newline at end of file diff --git a/src/assets/icons/specPacking-32.svg b/src/assets/icons/specPacking-32.svg new file mode 100644 index 0000000..58cddd6 --- /dev/null +++ b/src/assets/icons/specPacking-32.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729931281638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2152" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M26.88 741.12V261.632c6.4-5.12 12.032-11.264 18.944-15.104 120.576-66.56 241.664-133.12 362.24-199.424 12.544-6.912 24.832-14.336 37.12-21.248h15.104c45.312 25.344 90.624 50.688 135.936 75.776 86.528 47.872 172.8 95.488 259.584 142.848 16.64 9.216 23.808 20.224 23.552 40.448-1.28 83.712-0.512 167.424-0.512 250.88v57.856c22.016 4.608 42.496 2.816 61.184 9.472 33.536 12.288 49.92 40.96 60.672 73.216v239.616c-12.032 43.776-39.936 71.68-83.712 83.712h-239.616c-40.704-13.056-70.656-37.376-80.896-83.2-46.848 28.672-91.392 55.808-135.936 83.2H445.44c-1.792-1.536-3.584-3.328-5.632-4.608-131.328-78.848-262.912-157.44-393.984-236.544-7.168-4.352-12.8-11.52-18.944-17.408zM69.12 306.432c-0.512 4.864-1.28 7.936-1.28 10.752 0 131.84-0.256 263.68 0.512 395.52 0 6.4 6.144 15.104 11.776 18.432 113.152 68.608 226.816 136.704 340.48 204.544 3.328 2.048 7.424 3.072 12.544 5.12 0-136.96 0.256-271.872-0.512-407.04 0-5.888-7.424-14.08-13.312-17.664-111.616-67.584-223.488-134.656-335.36-201.728-4.608-2.304-8.96-4.608-14.848-7.936z m403.968 637.184c38.144-22.784 72.448-44.032 107.264-64 10.752-6.144 14.848-12.8 14.848-25.344-0.768-50.688-0.512-101.376-0.256-152.064 0.256-65.536 42.752-108.032 108.544-108.288 38.656-0.256 77.312 0 115.968 0 6.144 0 12.032-0.512 17.408-0.768V306.688c-30.208 18.176-58.368 35.328-86.784 51.456-9.472 5.376-13.056 11.52-12.8 22.528 0.768 34.304 0.256 68.352 0.256 102.656 0 15.36-5.632 25.6-20.736 32.512-35.072 16.128-69.12 34.56-103.68 51.456-26.368 12.8-38.144 5.376-38.4-23.552v-79.872c-32 19.2-60.672 36.608-89.6 53.248-9.728 5.632-12.544 12.288-12.288 22.784 0.512 34.304 0.256 68.352 0.256 102.656v301.056z m487.168-146.688c0-32.256 0.256-64.768 0-97.024-0.512-40.96-24.576-65.28-64.768-65.536-65.28-0.256-130.56-0.256-195.84 0-38.144 0.256-63.488 25.344-63.488 63.232-0.256 65.792-0.256 131.84 0 197.632 0.256 38.144 24.832 63.232 63.232 63.488 65.792 0.512 131.84 0.512 197.632 0 38.656-0.256 62.976-24.32 63.488-62.976 0-32.768-0.256-65.792-0.256-98.816zM89.344 268.288c120.32 72.96 238.336 144.384 356.352 215.552 3.584 2.048 10.24 2.816 13.824 0.768 32-18.432 63.488-37.632 97.28-57.856-115.456-73.984-228.352-146.432-341.504-218.368-3.584-2.304-11.008-2.048-15.104 0-36.608 19.456-72.704 39.168-110.848 59.904z m589.312 84.736c-2.56-2.816-3.328-4.352-4.864-5.376-109.568-69.632-219.392-139.008-329.216-208.128-4.096-2.56-11.52-4.096-15.36-2.048-26.112 13.568-51.968 28.16-78.592 42.752 2.304 2.816 3.328 4.352 4.608 5.376 110.336 70.912 220.672 141.568 331.264 211.968 3.84 2.56 11.264 3.328 15.104 1.28 25.856-14.336 50.944-29.952 77.056-45.824zM375.808 110.592c114.176 71.936 225.536 142.08 337.152 211.968 3.584 2.304 10.24 3.328 13.568 1.536 29.952-17.152 59.136-35.328 89.088-53.248-2.304-3.072-2.816-4.352-3.584-4.864-116.48-64-233.216-128-349.952-191.744-3.84-2.048-10.496-3.84-13.824-2.048-23.808 11.776-46.848 24.576-72.448 38.4z m320.768 280.576c-26.624 15.872-50.176 29.44-73.216 43.52-3.328 2.048-7.168 6.4-7.168 9.728-0.512 24.32-0.256 48.64-0.256 76.288 26.624-13.312 50.176-24.832 73.472-37.12 3.584-1.792 6.912-7.424 6.912-11.52 0.512-25.6 0.256-51.456 0.256-80.896z" p-id="2153" fill="#dd8520"></path><path d="M391.68 777.216c0 18.944 0.768 38.144-0.256 57.088-1.024 22.016-15.36 29.696-33.536 18.176-38.4-24.576-76.544-49.664-113.664-76.288-7.68-5.632-13.824-18.176-14.336-27.904-1.792-34.048-1.28-68.352-0.256-102.656 1.024-32.512 13.568-39.424 40.448-22.016 36.096 23.296 72.192 47.104 107.264 72.192 7.424 5.376 12.8 16.896 13.824 26.368 2.304 17.92 0.768 36.608 0.512 55.04 0.256 0 0 0 0 0z m-40.448 22.784c0-24.32 0.256-44.544-0.256-64.512-0.256-4.352-2.56-10.24-5.888-12.8-23.552-16.384-47.872-32.256-74.752-50.176 0 24.832-0.256 46.08 0.256 67.328 0 3.584 3.328 8.192 6.4 10.24 23.552 16.128 47.104 31.744 74.24 49.92zM777.472 776.192v-73.216c0-14.592 3.072-27.648 20.992-27.392 16.64 0.256 19.968 12.544 19.968 26.624-0.256 63.232-0.256 126.464 0 189.696 0 14.848-4.864 26.112-20.736 25.856-15.872-0.256-20.48-12.288-20.224-26.624 0.256-24.064 0-47.872 0-74.496-25.088 0-48.896-0.256-72.704 0-14.848 0.256-27.904-2.816-27.648-20.48 0-17.92 13.568-20.48 28.16-20.224 23.04 0.512 46.336 0.256 72.192 0.256z" p-id="2154" fill="#dd8520"></path><path d="M744.96 918.528h-55.808c-7.168 0-12.8-5.888-12.8-12.8v-54.016c0-7.168 5.888-12.8 12.8-12.8H744.96c7.168 0 12.8 5.888 12.8 12.8v54.016c0 7.168-5.632 12.8-12.8 12.8zM905.728 755.2h-54.272c-7.168 0-12.8-5.888-12.8-12.8v-54.272c0-7.168 5.888-12.8 12.8-12.8h54.272c7.168 0 12.8 5.888 12.8 12.8V742.4c0 6.912-5.888 12.8-12.8 12.8zM903.424 817.92h-50.432c-7.424 0-13.568-6.144-13.568-13.568v-13.056c0-7.424 6.144-13.568 13.568-13.568h50.432c7.424 0 13.568 6.144 13.568 13.568v13.056c0 7.424-6.144 13.568-13.568 13.568zM918.528 858.88c0-11.008-8.96-19.968-19.968-19.968s-19.968 8.96-19.968 19.968v22.784h-22.784c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 9.472 7.68 17.152 17.152 17.152h45.824c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-0.512 0-1.024-0.256-1.536 0-0.512 0.256-1.024 0.256-1.536v-36.864zM677.12 734.208c0 11.008 8.96 19.968 19.968 19.968s19.968-8.96 19.968-19.968v-22.784h22.784c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-9.472-7.68-17.152-17.152-17.152h-45.824c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 0.512 0 1.024 0.256 1.536 0 0.512-0.256 1.024-0.256 1.536l0.256 36.864z" p-id="2155" fill="#dd8520"></path></svg> \ No newline at end of file diff --git a/src/assets/icons/specPacking-48.svg b/src/assets/icons/specPacking-48.svg new file mode 100644 index 0000000..f6f601c --- /dev/null +++ b/src/assets/icons/specPacking-48.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729931281638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2152" width="48" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M26.88 741.12V261.632c6.4-5.12 12.032-11.264 18.944-15.104 120.576-66.56 241.664-133.12 362.24-199.424 12.544-6.912 24.832-14.336 37.12-21.248h15.104c45.312 25.344 90.624 50.688 135.936 75.776 86.528 47.872 172.8 95.488 259.584 142.848 16.64 9.216 23.808 20.224 23.552 40.448-1.28 83.712-0.512 167.424-0.512 250.88v57.856c22.016 4.608 42.496 2.816 61.184 9.472 33.536 12.288 49.92 40.96 60.672 73.216v239.616c-12.032 43.776-39.936 71.68-83.712 83.712h-239.616c-40.704-13.056-70.656-37.376-80.896-83.2-46.848 28.672-91.392 55.808-135.936 83.2H445.44c-1.792-1.536-3.584-3.328-5.632-4.608-131.328-78.848-262.912-157.44-393.984-236.544-7.168-4.352-12.8-11.52-18.944-17.408zM69.12 306.432c-0.512 4.864-1.28 7.936-1.28 10.752 0 131.84-0.256 263.68 0.512 395.52 0 6.4 6.144 15.104 11.776 18.432 113.152 68.608 226.816 136.704 340.48 204.544 3.328 2.048 7.424 3.072 12.544 5.12 0-136.96 0.256-271.872-0.512-407.04 0-5.888-7.424-14.08-13.312-17.664-111.616-67.584-223.488-134.656-335.36-201.728-4.608-2.304-8.96-4.608-14.848-7.936z m403.968 637.184c38.144-22.784 72.448-44.032 107.264-64 10.752-6.144 14.848-12.8 14.848-25.344-0.768-50.688-0.512-101.376-0.256-152.064 0.256-65.536 42.752-108.032 108.544-108.288 38.656-0.256 77.312 0 115.968 0 6.144 0 12.032-0.512 17.408-0.768V306.688c-30.208 18.176-58.368 35.328-86.784 51.456-9.472 5.376-13.056 11.52-12.8 22.528 0.768 34.304 0.256 68.352 0.256 102.656 0 15.36-5.632 25.6-20.736 32.512-35.072 16.128-69.12 34.56-103.68 51.456-26.368 12.8-38.144 5.376-38.4-23.552v-79.872c-32 19.2-60.672 36.608-89.6 53.248-9.728 5.632-12.544 12.288-12.288 22.784 0.512 34.304 0.256 68.352 0.256 102.656v301.056z m487.168-146.688c0-32.256 0.256-64.768 0-97.024-0.512-40.96-24.576-65.28-64.768-65.536-65.28-0.256-130.56-0.256-195.84 0-38.144 0.256-63.488 25.344-63.488 63.232-0.256 65.792-0.256 131.84 0 197.632 0.256 38.144 24.832 63.232 63.232 63.488 65.792 0.512 131.84 0.512 197.632 0 38.656-0.256 62.976-24.32 63.488-62.976 0-32.768-0.256-65.792-0.256-98.816zM89.344 268.288c120.32 72.96 238.336 144.384 356.352 215.552 3.584 2.048 10.24 2.816 13.824 0.768 32-18.432 63.488-37.632 97.28-57.856-115.456-73.984-228.352-146.432-341.504-218.368-3.584-2.304-11.008-2.048-15.104 0-36.608 19.456-72.704 39.168-110.848 59.904z m589.312 84.736c-2.56-2.816-3.328-4.352-4.864-5.376-109.568-69.632-219.392-139.008-329.216-208.128-4.096-2.56-11.52-4.096-15.36-2.048-26.112 13.568-51.968 28.16-78.592 42.752 2.304 2.816 3.328 4.352 4.608 5.376 110.336 70.912 220.672 141.568 331.264 211.968 3.84 2.56 11.264 3.328 15.104 1.28 25.856-14.336 50.944-29.952 77.056-45.824zM375.808 110.592c114.176 71.936 225.536 142.08 337.152 211.968 3.584 2.304 10.24 3.328 13.568 1.536 29.952-17.152 59.136-35.328 89.088-53.248-2.304-3.072-2.816-4.352-3.584-4.864-116.48-64-233.216-128-349.952-191.744-3.84-2.048-10.496-3.84-13.824-2.048-23.808 11.776-46.848 24.576-72.448 38.4z m320.768 280.576c-26.624 15.872-50.176 29.44-73.216 43.52-3.328 2.048-7.168 6.4-7.168 9.728-0.512 24.32-0.256 48.64-0.256 76.288 26.624-13.312 50.176-24.832 73.472-37.12 3.584-1.792 6.912-7.424 6.912-11.52 0.512-25.6 0.256-51.456 0.256-80.896z" p-id="2153" fill="#dd8520"></path><path d="M391.68 777.216c0 18.944 0.768 38.144-0.256 57.088-1.024 22.016-15.36 29.696-33.536 18.176-38.4-24.576-76.544-49.664-113.664-76.288-7.68-5.632-13.824-18.176-14.336-27.904-1.792-34.048-1.28-68.352-0.256-102.656 1.024-32.512 13.568-39.424 40.448-22.016 36.096 23.296 72.192 47.104 107.264 72.192 7.424 5.376 12.8 16.896 13.824 26.368 2.304 17.92 0.768 36.608 0.512 55.04 0.256 0 0 0 0 0z m-40.448 22.784c0-24.32 0.256-44.544-0.256-64.512-0.256-4.352-2.56-10.24-5.888-12.8-23.552-16.384-47.872-32.256-74.752-50.176 0 24.832-0.256 46.08 0.256 67.328 0 3.584 3.328 8.192 6.4 10.24 23.552 16.128 47.104 31.744 74.24 49.92zM777.472 776.192v-73.216c0-14.592 3.072-27.648 20.992-27.392 16.64 0.256 19.968 12.544 19.968 26.624-0.256 63.232-0.256 126.464 0 189.696 0 14.848-4.864 26.112-20.736 25.856-15.872-0.256-20.48-12.288-20.224-26.624 0.256-24.064 0-47.872 0-74.496-25.088 0-48.896-0.256-72.704 0-14.848 0.256-27.904-2.816-27.648-20.48 0-17.92 13.568-20.48 28.16-20.224 23.04 0.512 46.336 0.256 72.192 0.256z" p-id="2154" fill="#dd8520"></path><path d="M744.96 918.528h-55.808c-7.168 0-12.8-5.888-12.8-12.8v-54.016c0-7.168 5.888-12.8 12.8-12.8H744.96c7.168 0 12.8 5.888 12.8 12.8v54.016c0 7.168-5.632 12.8-12.8 12.8zM905.728 755.2h-54.272c-7.168 0-12.8-5.888-12.8-12.8v-54.272c0-7.168 5.888-12.8 12.8-12.8h54.272c7.168 0 12.8 5.888 12.8 12.8V742.4c0 6.912-5.888 12.8-12.8 12.8zM903.424 817.92h-50.432c-7.424 0-13.568-6.144-13.568-13.568v-13.056c0-7.424 6.144-13.568 13.568-13.568h50.432c7.424 0 13.568 6.144 13.568 13.568v13.056c0 7.424-6.144 13.568-13.568 13.568zM918.528 858.88c0-11.008-8.96-19.968-19.968-19.968s-19.968 8.96-19.968 19.968v22.784h-22.784c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 9.472 7.68 17.152 17.152 17.152h45.824c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-0.512 0-1.024-0.256-1.536 0-0.512 0.256-1.024 0.256-1.536v-36.864zM677.12 734.208c0 11.008 8.96 19.968 19.968 19.968s19.968-8.96 19.968-19.968v-22.784h22.784c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-9.472-7.68-17.152-17.152-17.152h-45.824c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 0.512 0 1.024 0.256 1.536 0 0.512-0.256 1.024-0.256 1.536l0.256 36.864z" p-id="2155" fill="#dd8520"></path></svg> \ No newline at end of file diff --git a/src/assets/icons/specPacking-64.svg b/src/assets/icons/specPacking-64.svg new file mode 100644 index 0000000..d297d1b --- /dev/null +++ b/src/assets/icons/specPacking-64.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729931281638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2152" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M26.88 741.12V261.632c6.4-5.12 12.032-11.264 18.944-15.104 120.576-66.56 241.664-133.12 362.24-199.424 12.544-6.912 24.832-14.336 37.12-21.248h15.104c45.312 25.344 90.624 50.688 135.936 75.776 86.528 47.872 172.8 95.488 259.584 142.848 16.64 9.216 23.808 20.224 23.552 40.448-1.28 83.712-0.512 167.424-0.512 250.88v57.856c22.016 4.608 42.496 2.816 61.184 9.472 33.536 12.288 49.92 40.96 60.672 73.216v239.616c-12.032 43.776-39.936 71.68-83.712 83.712h-239.616c-40.704-13.056-70.656-37.376-80.896-83.2-46.848 28.672-91.392 55.808-135.936 83.2H445.44c-1.792-1.536-3.584-3.328-5.632-4.608-131.328-78.848-262.912-157.44-393.984-236.544-7.168-4.352-12.8-11.52-18.944-17.408zM69.12 306.432c-0.512 4.864-1.28 7.936-1.28 10.752 0 131.84-0.256 263.68 0.512 395.52 0 6.4 6.144 15.104 11.776 18.432 113.152 68.608 226.816 136.704 340.48 204.544 3.328 2.048 7.424 3.072 12.544 5.12 0-136.96 0.256-271.872-0.512-407.04 0-5.888-7.424-14.08-13.312-17.664-111.616-67.584-223.488-134.656-335.36-201.728-4.608-2.304-8.96-4.608-14.848-7.936z m403.968 637.184c38.144-22.784 72.448-44.032 107.264-64 10.752-6.144 14.848-12.8 14.848-25.344-0.768-50.688-0.512-101.376-0.256-152.064 0.256-65.536 42.752-108.032 108.544-108.288 38.656-0.256 77.312 0 115.968 0 6.144 0 12.032-0.512 17.408-0.768V306.688c-30.208 18.176-58.368 35.328-86.784 51.456-9.472 5.376-13.056 11.52-12.8 22.528 0.768 34.304 0.256 68.352 0.256 102.656 0 15.36-5.632 25.6-20.736 32.512-35.072 16.128-69.12 34.56-103.68 51.456-26.368 12.8-38.144 5.376-38.4-23.552v-79.872c-32 19.2-60.672 36.608-89.6 53.248-9.728 5.632-12.544 12.288-12.288 22.784 0.512 34.304 0.256 68.352 0.256 102.656v301.056z m487.168-146.688c0-32.256 0.256-64.768 0-97.024-0.512-40.96-24.576-65.28-64.768-65.536-65.28-0.256-130.56-0.256-195.84 0-38.144 0.256-63.488 25.344-63.488 63.232-0.256 65.792-0.256 131.84 0 197.632 0.256 38.144 24.832 63.232 63.232 63.488 65.792 0.512 131.84 0.512 197.632 0 38.656-0.256 62.976-24.32 63.488-62.976 0-32.768-0.256-65.792-0.256-98.816zM89.344 268.288c120.32 72.96 238.336 144.384 356.352 215.552 3.584 2.048 10.24 2.816 13.824 0.768 32-18.432 63.488-37.632 97.28-57.856-115.456-73.984-228.352-146.432-341.504-218.368-3.584-2.304-11.008-2.048-15.104 0-36.608 19.456-72.704 39.168-110.848 59.904z m589.312 84.736c-2.56-2.816-3.328-4.352-4.864-5.376-109.568-69.632-219.392-139.008-329.216-208.128-4.096-2.56-11.52-4.096-15.36-2.048-26.112 13.568-51.968 28.16-78.592 42.752 2.304 2.816 3.328 4.352 4.608 5.376 110.336 70.912 220.672 141.568 331.264 211.968 3.84 2.56 11.264 3.328 15.104 1.28 25.856-14.336 50.944-29.952 77.056-45.824zM375.808 110.592c114.176 71.936 225.536 142.08 337.152 211.968 3.584 2.304 10.24 3.328 13.568 1.536 29.952-17.152 59.136-35.328 89.088-53.248-2.304-3.072-2.816-4.352-3.584-4.864-116.48-64-233.216-128-349.952-191.744-3.84-2.048-10.496-3.84-13.824-2.048-23.808 11.776-46.848 24.576-72.448 38.4z m320.768 280.576c-26.624 15.872-50.176 29.44-73.216 43.52-3.328 2.048-7.168 6.4-7.168 9.728-0.512 24.32-0.256 48.64-0.256 76.288 26.624-13.312 50.176-24.832 73.472-37.12 3.584-1.792 6.912-7.424 6.912-11.52 0.512-25.6 0.256-51.456 0.256-80.896z" p-id="2153" fill="#dd8520"></path><path d="M391.68 777.216c0 18.944 0.768 38.144-0.256 57.088-1.024 22.016-15.36 29.696-33.536 18.176-38.4-24.576-76.544-49.664-113.664-76.288-7.68-5.632-13.824-18.176-14.336-27.904-1.792-34.048-1.28-68.352-0.256-102.656 1.024-32.512 13.568-39.424 40.448-22.016 36.096 23.296 72.192 47.104 107.264 72.192 7.424 5.376 12.8 16.896 13.824 26.368 2.304 17.92 0.768 36.608 0.512 55.04 0.256 0 0 0 0 0z m-40.448 22.784c0-24.32 0.256-44.544-0.256-64.512-0.256-4.352-2.56-10.24-5.888-12.8-23.552-16.384-47.872-32.256-74.752-50.176 0 24.832-0.256 46.08 0.256 67.328 0 3.584 3.328 8.192 6.4 10.24 23.552 16.128 47.104 31.744 74.24 49.92zM777.472 776.192v-73.216c0-14.592 3.072-27.648 20.992-27.392 16.64 0.256 19.968 12.544 19.968 26.624-0.256 63.232-0.256 126.464 0 189.696 0 14.848-4.864 26.112-20.736 25.856-15.872-0.256-20.48-12.288-20.224-26.624 0.256-24.064 0-47.872 0-74.496-25.088 0-48.896-0.256-72.704 0-14.848 0.256-27.904-2.816-27.648-20.48 0-17.92 13.568-20.48 28.16-20.224 23.04 0.512 46.336 0.256 72.192 0.256z" p-id="2154" fill="#dd8520"></path><path d="M744.96 918.528h-55.808c-7.168 0-12.8-5.888-12.8-12.8v-54.016c0-7.168 5.888-12.8 12.8-12.8H744.96c7.168 0 12.8 5.888 12.8 12.8v54.016c0 7.168-5.632 12.8-12.8 12.8zM905.728 755.2h-54.272c-7.168 0-12.8-5.888-12.8-12.8v-54.272c0-7.168 5.888-12.8 12.8-12.8h54.272c7.168 0 12.8 5.888 12.8 12.8V742.4c0 6.912-5.888 12.8-12.8 12.8zM903.424 817.92h-50.432c-7.424 0-13.568-6.144-13.568-13.568v-13.056c0-7.424 6.144-13.568 13.568-13.568h50.432c7.424 0 13.568 6.144 13.568 13.568v13.056c0 7.424-6.144 13.568-13.568 13.568zM918.528 858.88c0-11.008-8.96-19.968-19.968-19.968s-19.968 8.96-19.968 19.968v22.784h-22.784c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 9.472 7.68 17.152 17.152 17.152h45.824c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-0.512 0-1.024-0.256-1.536 0-0.512 0.256-1.024 0.256-1.536v-36.864zM677.12 734.208c0 11.008 8.96 19.968 19.968 19.968s19.968-8.96 19.968-19.968v-22.784h22.784c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-9.472-7.68-17.152-17.152-17.152h-45.824c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 0.512 0 1.024 0.256 1.536 0 0.512-0.256 1.024-0.256 1.536l0.256 36.864z" p-id="2155" fill="#dd8520"></path></svg> \ No newline at end of file diff --git a/src/assets/icons/specPacking.svg b/src/assets/icons/specPacking.svg new file mode 100644 index 0000000..dd1e139 --- /dev/null +++ b/src/assets/icons/specPacking.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729931281638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2152" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M26.88 741.12V261.632c6.4-5.12 12.032-11.264 18.944-15.104 120.576-66.56 241.664-133.12 362.24-199.424 12.544-6.912 24.832-14.336 37.12-21.248h15.104c45.312 25.344 90.624 50.688 135.936 75.776 86.528 47.872 172.8 95.488 259.584 142.848 16.64 9.216 23.808 20.224 23.552 40.448-1.28 83.712-0.512 167.424-0.512 250.88v57.856c22.016 4.608 42.496 2.816 61.184 9.472 33.536 12.288 49.92 40.96 60.672 73.216v239.616c-12.032 43.776-39.936 71.68-83.712 83.712h-239.616c-40.704-13.056-70.656-37.376-80.896-83.2-46.848 28.672-91.392 55.808-135.936 83.2H445.44c-1.792-1.536-3.584-3.328-5.632-4.608-131.328-78.848-262.912-157.44-393.984-236.544-7.168-4.352-12.8-11.52-18.944-17.408zM69.12 306.432c-0.512 4.864-1.28 7.936-1.28 10.752 0 131.84-0.256 263.68 0.512 395.52 0 6.4 6.144 15.104 11.776 18.432 113.152 68.608 226.816 136.704 340.48 204.544 3.328 2.048 7.424 3.072 12.544 5.12 0-136.96 0.256-271.872-0.512-407.04 0-5.888-7.424-14.08-13.312-17.664-111.616-67.584-223.488-134.656-335.36-201.728-4.608-2.304-8.96-4.608-14.848-7.936z m403.968 637.184c38.144-22.784 72.448-44.032 107.264-64 10.752-6.144 14.848-12.8 14.848-25.344-0.768-50.688-0.512-101.376-0.256-152.064 0.256-65.536 42.752-108.032 108.544-108.288 38.656-0.256 77.312 0 115.968 0 6.144 0 12.032-0.512 17.408-0.768V306.688c-30.208 18.176-58.368 35.328-86.784 51.456-9.472 5.376-13.056 11.52-12.8 22.528 0.768 34.304 0.256 68.352 0.256 102.656 0 15.36-5.632 25.6-20.736 32.512-35.072 16.128-69.12 34.56-103.68 51.456-26.368 12.8-38.144 5.376-38.4-23.552v-79.872c-32 19.2-60.672 36.608-89.6 53.248-9.728 5.632-12.544 12.288-12.288 22.784 0.512 34.304 0.256 68.352 0.256 102.656v301.056z m487.168-146.688c0-32.256 0.256-64.768 0-97.024-0.512-40.96-24.576-65.28-64.768-65.536-65.28-0.256-130.56-0.256-195.84 0-38.144 0.256-63.488 25.344-63.488 63.232-0.256 65.792-0.256 131.84 0 197.632 0.256 38.144 24.832 63.232 63.232 63.488 65.792 0.512 131.84 0.512 197.632 0 38.656-0.256 62.976-24.32 63.488-62.976 0-32.768-0.256-65.792-0.256-98.816zM89.344 268.288c120.32 72.96 238.336 144.384 356.352 215.552 3.584 2.048 10.24 2.816 13.824 0.768 32-18.432 63.488-37.632 97.28-57.856-115.456-73.984-228.352-146.432-341.504-218.368-3.584-2.304-11.008-2.048-15.104 0-36.608 19.456-72.704 39.168-110.848 59.904z m589.312 84.736c-2.56-2.816-3.328-4.352-4.864-5.376-109.568-69.632-219.392-139.008-329.216-208.128-4.096-2.56-11.52-4.096-15.36-2.048-26.112 13.568-51.968 28.16-78.592 42.752 2.304 2.816 3.328 4.352 4.608 5.376 110.336 70.912 220.672 141.568 331.264 211.968 3.84 2.56 11.264 3.328 15.104 1.28 25.856-14.336 50.944-29.952 77.056-45.824zM375.808 110.592c114.176 71.936 225.536 142.08 337.152 211.968 3.584 2.304 10.24 3.328 13.568 1.536 29.952-17.152 59.136-35.328 89.088-53.248-2.304-3.072-2.816-4.352-3.584-4.864-116.48-64-233.216-128-349.952-191.744-3.84-2.048-10.496-3.84-13.824-2.048-23.808 11.776-46.848 24.576-72.448 38.4z m320.768 280.576c-26.624 15.872-50.176 29.44-73.216 43.52-3.328 2.048-7.168 6.4-7.168 9.728-0.512 24.32-0.256 48.64-0.256 76.288 26.624-13.312 50.176-24.832 73.472-37.12 3.584-1.792 6.912-7.424 6.912-11.52 0.512-25.6 0.256-51.456 0.256-80.896z" p-id="2153" fill="#dd8520"></path><path d="M391.68 777.216c0 18.944 0.768 38.144-0.256 57.088-1.024 22.016-15.36 29.696-33.536 18.176-38.4-24.576-76.544-49.664-113.664-76.288-7.68-5.632-13.824-18.176-14.336-27.904-1.792-34.048-1.28-68.352-0.256-102.656 1.024-32.512 13.568-39.424 40.448-22.016 36.096 23.296 72.192 47.104 107.264 72.192 7.424 5.376 12.8 16.896 13.824 26.368 2.304 17.92 0.768 36.608 0.512 55.04 0.256 0 0 0 0 0z m-40.448 22.784c0-24.32 0.256-44.544-0.256-64.512-0.256-4.352-2.56-10.24-5.888-12.8-23.552-16.384-47.872-32.256-74.752-50.176 0 24.832-0.256 46.08 0.256 67.328 0 3.584 3.328 8.192 6.4 10.24 23.552 16.128 47.104 31.744 74.24 49.92zM777.472 776.192v-73.216c0-14.592 3.072-27.648 20.992-27.392 16.64 0.256 19.968 12.544 19.968 26.624-0.256 63.232-0.256 126.464 0 189.696 0 14.848-4.864 26.112-20.736 25.856-15.872-0.256-20.48-12.288-20.224-26.624 0.256-24.064 0-47.872 0-74.496-25.088 0-48.896-0.256-72.704 0-14.848 0.256-27.904-2.816-27.648-20.48 0-17.92 13.568-20.48 28.16-20.224 23.04 0.512 46.336 0.256 72.192 0.256z" p-id="2154" fill="#dd8520"></path><path d="M744.96 918.528h-55.808c-7.168 0-12.8-5.888-12.8-12.8v-54.016c0-7.168 5.888-12.8 12.8-12.8H744.96c7.168 0 12.8 5.888 12.8 12.8v54.016c0 7.168-5.632 12.8-12.8 12.8zM905.728 755.2h-54.272c-7.168 0-12.8-5.888-12.8-12.8v-54.272c0-7.168 5.888-12.8 12.8-12.8h54.272c7.168 0 12.8 5.888 12.8 12.8V742.4c0 6.912-5.888 12.8-12.8 12.8zM903.424 817.92h-50.432c-7.424 0-13.568-6.144-13.568-13.568v-13.056c0-7.424 6.144-13.568 13.568-13.568h50.432c7.424 0 13.568 6.144 13.568 13.568v13.056c0 7.424-6.144 13.568-13.568 13.568zM918.528 858.88c0-11.008-8.96-19.968-19.968-19.968s-19.968 8.96-19.968 19.968v22.784h-22.784c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 9.472 7.68 17.152 17.152 17.152h45.824c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-0.512 0-1.024-0.256-1.536 0-0.512 0.256-1.024 0.256-1.536v-36.864zM677.12 734.208c0 11.008 8.96 19.968 19.968 19.968s19.968-8.96 19.968-19.968v-22.784h22.784c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-9.472-7.68-17.152-17.152-17.152h-45.824c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 0.512 0 1.024 0.256 1.536 0 0.512-0.256 1.024-0.256 1.536l0.256 36.864z" p-id="2155" fill="#dd8520"></path></svg> \ No newline at end of file diff --git a/src/components/FlowChart/src/FlowChart.vue b/src/components/FlowChart/src/FlowChart.vue index 0db0f7a..dd5b5ae 100644 --- a/src/components/FlowChart/src/FlowChart.vue +++ b/src/components/FlowChart/src/FlowChart.vue @@ -43,6 +43,7 @@ import AssemblyNode from './AssemblyNode'; import PackingNode from './PackingNode'; import RepairNode from './RepairNode'; +import SpecPackingNode from './SpecPackingNode'; defineOptions({ name: 'FlowChart' }); @@ -167,6 +168,7 @@ lf.register(PackingNode); lf.register(RepairNode); lf.register(customEdge); + lf.register(SpecPackingNode); onRender(); lf?.setPatternItems(props.patternItems || configDefaultDndPanel(lf)); } diff --git a/src/components/FlowChart/src/SpecPackingNode.ts b/src/components/FlowChart/src/SpecPackingNode.ts new file mode 100644 index 0000000..bcbafd6 --- /dev/null +++ b/src/components/FlowChart/src/SpecPackingNode.ts @@ -0,0 +1,102 @@ +import { RectNode, RectNodeModel, h } from '@logicflow/core'; + +class SpecPackingNodeView extends RectNode { + getLabelShape() { + const { model } = this.props; + const { x, y, width, height } = model; + const style = model.getNodeStyle(); + return h( + 'svg', + { + x: x - width / 2 + 5, + y: y - height / 2 + 5, + width: 25, + height: 25, + viewBox: '0 0 1274 1024', + }, + [ + h('path', { + fill: style.stroke, + d: 'M26.88 741.12V261.632c6.4-5.12 12.032-11.264 18.944-15.104 120.576-66.56 241.664-133.12 362.24-199.424 12.544-6.912 24.832-14.336 37.12-21.248h15.104c45.312 25.344 90.624 50.688 135.936 75.776 86.528 47.872 172.8 95.488 259.584 142.848 16.64 9.216 23.808 20.224 23.552 40.448-1.28 83.712-0.512 167.424-0.512 250.88v57.856c22.016 4.608 42.496 2.816 61.184 9.472 33.536 12.288 49.92 40.96 60.672 73.216v239.616c-12.032 43.776-39.936 71.68-83.712 83.712h-239.616c-40.704-13.056-70.656-37.376-80.896-83.2-46.848 28.672-91.392 55.808-135.936 83.2H445.44c-1.792-1.536-3.584-3.328-5.632-4.608-131.328-78.848-262.912-157.44-393.984-236.544-7.168-4.352-12.8-11.52-18.944-17.408zM69.12 306.432c-0.512 4.864-1.28 7.936-1.28 10.752 0 131.84-0.256 263.68 0.512 395.52 0 6.4 6.144 15.104 11.776 18.432 113.152 68.608 226.816 136.704 340.48 204.544 3.328 2.048 7.424 3.072 12.544 5.12 0-136.96 0.256-271.872-0.512-407.04 0-5.888-7.424-14.08-13.312-17.664-111.616-67.584-223.488-134.656-335.36-201.728-4.608-2.304-8.96-4.608-14.848-7.936z m403.968 637.184c38.144-22.784 72.448-44.032 107.264-64 10.752-6.144 14.848-12.8 14.848-25.344-0.768-50.688-0.512-101.376-0.256-152.064 0.256-65.536 42.752-108.032 108.544-108.288 38.656-0.256 77.312 0 115.968 0 6.144 0 12.032-0.512 17.408-0.768V306.688c-30.208 18.176-58.368 35.328-86.784 51.456-9.472 5.376-13.056 11.52-12.8 22.528 0.768 34.304 0.256 68.352 0.256 102.656 0 15.36-5.632 25.6-20.736 32.512-35.072 16.128-69.12 34.56-103.68 51.456-26.368 12.8-38.144 5.376-38.4-23.552v-79.872c-32 19.2-60.672 36.608-89.6 53.248-9.728 5.632-12.544 12.288-12.288 22.784 0.512 34.304 0.256 68.352 0.256 102.656v301.056z m487.168-146.688c0-32.256 0.256-64.768 0-97.024-0.512-40.96-24.576-65.28-64.768-65.536-65.28-0.256-130.56-0.256-195.84 0-38.144 0.256-63.488 25.344-63.488 63.232-0.256 65.792-0.256 131.84 0 197.632 0.256 38.144 24.832 63.232 63.232 63.488 65.792 0.512 131.84 0.512 197.632 0 38.656-0.256 62.976-24.32 63.488-62.976 0-32.768-0.256-65.792-0.256-98.816zM89.344 268.288c120.32 72.96 238.336 144.384 356.352 215.552 3.584 2.048 10.24 2.816 13.824 0.768 32-18.432 63.488-37.632 97.28-57.856-115.456-73.984-228.352-146.432-341.504-218.368-3.584-2.304-11.008-2.048-15.104 0-36.608 19.456-72.704 39.168-110.848 59.904z m589.312 84.736c-2.56-2.816-3.328-4.352-4.864-5.376-109.568-69.632-219.392-139.008-329.216-208.128-4.096-2.56-11.52-4.096-15.36-2.048-26.112 13.568-51.968 28.16-78.592 42.752 2.304 2.816 3.328 4.352 4.608 5.376 110.336 70.912 220.672 141.568 331.264 211.968 3.84 2.56 11.264 3.328 15.104 1.28 25.856-14.336 50.944-29.952 77.056-45.824zM375.808 110.592c114.176 71.936 225.536 142.08 337.152 211.968 3.584 2.304 10.24 3.328 13.568 1.536 29.952-17.152 59.136-35.328 89.088-53.248-2.304-3.072-2.816-4.352-3.584-4.864-116.48-64-233.216-128-349.952-191.744-3.84-2.048-10.496-3.84-13.824-2.048-23.808 11.776-46.848 24.576-72.448 38.4z m320.768 280.576c-26.624 15.872-50.176 29.44-73.216 43.52-3.328 2.048-7.168 6.4-7.168 9.728-0.512 24.32-0.256 48.64-0.256 76.288 26.624-13.312 50.176-24.832 73.472-37.12 3.584-1.792 6.912-7.424 6.912-11.52 0.512-25.6 0.256-51.456 0.256-80.896z', + }), + h('path', { + fill: style.stroke, + d: 'M391.68 777.216c0 18.944 0.768 38.144-0.256 57.088-1.024 22.016-15.36 29.696-33.536 18.176-38.4-24.576-76.544-49.664-113.664-76.288-7.68-5.632-13.824-18.176-14.336-27.904-1.792-34.048-1.28-68.352-0.256-102.656 1.024-32.512 13.568-39.424 40.448-22.016 36.096 23.296 72.192 47.104 107.264 72.192 7.424 5.376 12.8 16.896 13.824 26.368 2.304 17.92 0.768 36.608 0.512 55.04 0.256 0 0 0 0 0z m-40.448 22.784c0-24.32 0.256-44.544-0.256-64.512-0.256-4.352-2.56-10.24-5.888-12.8-23.552-16.384-47.872-32.256-74.752-50.176 0 24.832-0.256 46.08 0.256 67.328 0 3.584 3.328 8.192 6.4 10.24 23.552 16.128 47.104 31.744 74.24 49.92zM777.472 776.192v-73.216c0-14.592 3.072-27.648 20.992-27.392 16.64 0.256 19.968 12.544 19.968 26.624-0.256 63.232-0.256 126.464 0 189.696 0 14.848-4.864 26.112-20.736 25.856-15.872-0.256-20.48-12.288-20.224-26.624 0.256-24.064 0-47.872 0-74.496-25.088 0-48.896-0.256-72.704 0-14.848 0.256-27.904-2.816-27.648-20.48 0-17.92 13.568-20.48 28.16-20.224 23.04 0.512 46.336 0.256 72.192 0.256z', + }), + h('path', { + fill: style.stroke, + d: 'M744.96 918.528h-55.808c-7.168 0-12.8-5.888-12.8-12.8v-54.016c0-7.168 5.888-12.8 12.8-12.8H744.96c7.168 0 12.8 5.888 12.8 12.8v54.016c0 7.168-5.632 12.8-12.8 12.8zM905.728 755.2h-54.272c-7.168 0-12.8-5.888-12.8-12.8v-54.272c0-7.168 5.888-12.8 12.8-12.8h54.272c7.168 0 12.8 5.888 12.8 12.8V742.4c0 6.912-5.888 12.8-12.8 12.8zM903.424 817.92h-50.432c-7.424 0-13.568-6.144-13.568-13.568v-13.056c0-7.424 6.144-13.568 13.568-13.568h50.432c7.424 0 13.568 6.144 13.568 13.568v13.056c0 7.424-6.144 13.568-13.568 13.568zM918.528 858.88c0-11.008-8.96-19.968-19.968-19.968s-19.968 8.96-19.968 19.968v22.784h-22.784c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 9.472 7.68 17.152 17.152 17.152h45.824c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-0.512 0-1.024-0.256-1.536 0-0.512 0.256-1.024 0.256-1.536v-36.864zM677.12 734.208c0 11.008 8.96 19.968 19.968 19.968s19.968-8.96 19.968-19.968v-22.784h22.784c9.472 0 17.152-7.68 17.152-17.152v-2.048c0-9.472-7.68-17.152-17.152-17.152h-45.824c-9.472 0-17.152 7.68-17.152 17.152v2.048c0 0.512 0 1.024 0.256 1.536 0 0.512-0.256 1.024-0.256 1.536l0.256 36.864z', + }), + ], + ); + } + override getShape() { + const { model } = this.props; + const { x, y, width, height, radius, properties } = model; + const style = model.getNodeStyle(); + console.log(properties); + return h('g', {}, [ + h('rect', { + ...style, + x: x - width / 2, + y: y - height / 2, + rx: radius, + ry: radius, + width, + height, + }), + this.getLabelShape(), + ]); + } +} + +class SpecPackingNodeModel extends RectNodeModel { + override setAttributes() { + const size = this.properties.scale || 1; + this.width = 110 * size; + this.height = 80 * size; + } + override getTextStyle() { + const style = super.getTextStyle(); + style.fontSize = 12; + const properties = this.properties; + style.color = properties.disabled ? 'red' : 'rgb(221, 133, 32)'; + return style; + } + override getNodeStyle() { + const style = super.getNodeStyle(); + const properties = this.properties; + if (properties.disabled) { + style.stroke = 'red'; + } else { + style.stroke = 'rgb(221, 133, 32)'; + } + return style; + } + override getAnchorStyle() { + const style = super.getAnchorStyle(); + style.stroke = 'rgb(221, 133, 32)'; + style.r = 3; + style.hover.r = 8; + style.hover.fill = 'rgb(221, 133, 32)'; + style.hover.stroke = 'rgb(221, 133, 32)'; + return style; + } + override getAnchorLineStyle() { + const style = super.getAnchorLineStyle(); + style.stroke = 'rgb(221, 133, 32)'; + return style; + } + // override getOutlineStyle() { + // const style = super.getOutlineStyle(); + // style.stroke = 'red'; + // style.hover.stroke = 'red'; + // return style; + // } +} + +export default { + type: 'SpecPackingNode', + view: SpecPackingNodeView, + model: SpecPackingNodeModel, +}; diff --git a/src/components/FlowChart/src/config.ts b/src/components/FlowChart/src/config.ts index 923468e..202b74c 100644 --- a/src/components/FlowChart/src/config.ts +++ b/src/components/FlowChart/src/config.ts @@ -113,6 +113,18 @@ operCode: 'PackingNode' }, }, + { + type: 'SpecPackingNode', + text: '鐗规畩鍖呰', + label: '鐗规畩鍖呰', + icon: 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yIDAtMTcuMTUyIDcuNjgtMTcuMTUyIDE3LjE1MnYyLjA0OGMwIDAuNTEyIDAgMS4wMjQgMC4yNTYgMS41MzYgMCAwLjUxMi0wLjI1NiAxLjAyNC0wLjI1NiAxLjUzNmwwLjI1NiAzNi44NjR6IiBwLWlkPSIyMTU1IiBmaWxsPSIjZGQ4NTIwIj48L3BhdGg+PC9zdmc+', + cls: 'import_icon', + properties: { + isReturn: false, + operType: 'Packing', + operCode: 'SpecPackingNode' + }, + }, // { // type: 'rect', // text: '鎵撳嵃宸ュ簭', diff --git a/src/store/modules/multipleTab.ts b/src/store/modules/multipleTab.ts index 9885459..69cdd67 100644 --- a/src/store/modules/multipleTab.ts +++ b/src/store/modules/multipleTab.ts @@ -15,6 +15,7 @@ import projectSetting from '@/settings/projectSetting'; import { useUserStore } from '@/store/modules/user'; import { useProdRouteStore } from './prodRoute'; +import { isNullOrUnDef } from '/@/utils/is'; export interface MultipleTabState { cacheTabList: Set<string>; @@ -88,11 +89,15 @@ const name = route.name; const useProdRoute = useProdRouteStore(); useProdRoute.setChangeToCPPage(false); - // 浠巗essionStorage涓鍙栧弬鏁板苟杞崲鍥炲璞� - const savedParams = sessionStorage.getItem(`${JSON.parse(decodeURI(route.params.id[0]))['sName']}_params`); - const objParams = savedParams ? JSON.parse(decodeURI(savedParams)) : {}; - useProdRoute.setCurProdRotTree({ name: objParams['CODE'], treeInfo: [] }); - useProdRoute.setCurSelectedNodes({ name: objParams['CODE'], SelectedNodes: [] }); + if (!isNullOrUnDef(route.params.id)) { + // 浠巗essionStorage涓鍙栧弬鏁板苟杞崲鍥炲璞� + const savedParams = sessionStorage.getItem( + `${JSON.parse(decodeURI(route.params.id[0]))['sName']}_params`, + ); + const objParams = savedParams ? JSON.parse(decodeURI(savedParams)) : {}; + useProdRoute.setCurProdRotTree({ name: objParams['CODE'], treeInfo: [] }); + useProdRoute.setCurSelectedNodes({ name: objParams['CODE'], SelectedNodes: [] }); + } const findTab = this.getCachedTabList.find((item) => item === name); if (findTab) { diff --git a/src/views/tigerprojects/tsk/tsk_job/index.vue b/src/views/tigerprojects/tsk/tsk_job/index.vue index ef29c26..ecaab7e 100644 --- a/src/views/tigerprojects/tsk/tsk_job/index.vue +++ b/src/views/tigerprojects/tsk/tsk_job/index.vue @@ -11,27 +11,27 @@ icon: 'clarity:info-standard-line', tooltip: '鏌ョ湅浠诲姟璇︽儏', onClick: handleView.bind(null, record), - name: undefined + name: undefined, }, { //绔嬪嵆寮�濮� tooltip: '绔嬪嵆寮�濮�', icon: 'start|svg', onClick: handleStart.bind(null, record), - name: undefined + name: undefined, }, { //鍋滄杩愯 tooltip: '鍋滄杩愯', icon: 'stop|svg', onClick: handleStop.bind(null, record), - name: undefined + name: undefined, }, { tooltip: '缂栬緫', icon: 'clarity:note-edit-line', onClick: handleEdit.bind(null, record), - name: undefined + name: undefined, }, { tooltip: '鍒犻櫎', @@ -42,7 +42,7 @@ placement: 'left', confirm: handleDelete.bind(null, record), }, - name: undefined + name: undefined, }, ]" /> @@ -51,114 +51,122 @@ <jobDrawer @register="registerDrawer" @success="handleSuccess" /> </div> </template> -<script lang="ts"> - import { defineComponent } from 'vue'; - - import { BasicTable, useTable, TableAction } from '/@/components/Table'; - - import { useDrawer } from '/@/components/Drawer'; - import jobDrawer from './jobDrawer.vue'; - import { useGo } from '/@/hooks/web/usePage'; +<script lang="ts" setup> import { columns, searchFormSchema } from './job.data'; - //api - import { - StartTsk_Job, - StopTsk_Job, - DeleteTsk_Job, - getTsk_JobListByPage, - } from '/@/api/tigerapi/tsk/tsk_job'; + import jobDrawer from './jobDrawer.vue'; + import { getListByPage } from '/@/api/tigerapi/system'; + import { DeleteTsk_Job, StartTsk_Job, StopTsk_Job } from '/@/api/tigerapi/tsk/tsk_job'; + import { useDrawer } from '/@/components/Drawer'; + import { BasicTable, TableAction, useTable } from '/@/components/Table'; + import { useGo } from '/@/hooks/web/usePage'; - export default defineComponent({ - name: 'WHManagement', - components: { BasicTable, jobDrawer, TableAction }, - setup() { - const go = useGo(); - const [registerDrawer, { openDrawer }] = useDrawer(); + const go = useGo(); + const [registerDrawer, { openDrawer }] = useDrawer(); - const [registerTable, { reload }] = useTable({ - title: '浠诲姟鍒楄〃', - api: getTsk_JobListByPage, - columns, - formConfig: { - labelWidth: 120, - schemas: searchFormSchema, - }, - useSearchForm: true, - showTableSetting: true, - bordered: true, - canResize:true, - showIndexColumn: false, - actionColumn: { - width: 205, - title: '鎿嶄綔', - dataIndex: 'action', - slots: { customRender: 'action' }, - fixed: undefined, - }, - }); - - function handleCreate() { - openDrawer(true, { - isUpdate: false, - }); - } - - function handleEdit(record: Recordable) { - openDrawer(true, { - record, - isUpdate: true, - }); - } - //璇︽儏椤甸潰 - function handleView(record: Recordable) { - console.log(record.ID); - go('/job_detail/' + record.ID + ',' + record.JobName + ''); - } - - function handleStart(record: Recordable) { - //寮�濮嬭繍琛� - const apiAction = StartTsk_Job(record); - apiAction.then((action) => { - if (action.IsSuccessed) { - reload(); - } - }); - } - function handleStop(record: Recordable) { - //绔嬪嵆鍋滄 - const apiAction = StopTsk_Job(record); - apiAction.then((action) => { - if (action.IsSuccessed) { - reload(); - } - }); - } - function handleDelete(record: Recordable) { - handleStop(record); - //鍒犻櫎浠诲姟 - const apiAction = DeleteTsk_Job(record); - apiAction.then((action) => { - if (action.IsSuccessed) { - reload(); - } - }); - } - - function handleSuccess() { - reload(); - } - - return { - registerTable, - registerDrawer, - handleCreate, - handleEdit, - handleView, - handleStart, - handleStop, - handleDelete, - handleSuccess, - }; + const [registerTable, { reload }] = useTable({ + title: '浠诲姟鍒楄〃', + api: getListByPage, + searchInfo: { + TABLE_NAME: 'TSK_JOB', + // option: { + // //鏍规嵁鎹偣鏌ヨ锛屽繀闇�甯﹁繖涓弬鏁� + // UserId: useUserStore().getUserInfo.userId, + // ByOrg: true, + // CurOrg: useUserStore().getUserInfo.orgCode, + // }, + NeedInclude: true, + }, + // afterFetch: afterFetch, + columns, + formConfig: { + labelWidth: 120, + schemas: searchFormSchema, + }, + useSearchForm: true, + showTableSetting: true, + bordered: true, + canResize: true, + showIndexColumn: false, + actionColumn: { + width: 205, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: undefined, }, }); + /** + * 娣诲姞浠诲姟 + */ + function handleCreate() { + openDrawer(true, { + isUpdate: false, + }); + } + + function handleEdit(record: Recordable) { + openDrawer(true, { + record, + isUpdate: true, + }); + } + + /** + * 璇︽儏椤甸潰 + * @param {Recordable} record - 璁板綍 + */ + function handleView(record: Recordable) { + console.log(record.ID); + go('/job_detail/' + record.ID + ',' + record.JobName + ''); + } + /** + * @description: + * @param {*} record + * @return {*} + */ + function handleStart(record: Recordable) { + const apiAction = StartTsk_Job(record); + apiAction.then((action) => { + if (action.IsSuccessed) { + reload(); + } + }); + } + + /** + * @description: 绔嬪嵆鍋滄 + * @param {*} record + * @return {*} + */ + function handleStop(record: Recordable) { + const apiAction = StopTsk_Job(record); + apiAction.then((action) => { + if (action.IsSuccessed) { + reload(); + } + }); + } + + /** + * @description: 鍒犻櫎浠诲姟 + * @param {*} record + * @return {*} + */ + function handleDelete(record: Recordable) { + handleStop(record); + const apiAction = DeleteTsk_Job(record); + apiAction.then((action) => { + if (action.IsSuccessed) { + reload(); + } + }); + } + + /** + * @description: 杩斿洖鎴愬姛 + * @return {*} + */ + function handleSuccess() { + reload(); + } </script> diff --git a/src/views/tigerprojects/tsk/tsk_job/job.data.ts b/src/views/tigerprojects/tsk/tsk_job/job.data.ts index 4542e2d..4194058 100644 --- a/src/views/tigerprojects/tsk/tsk_job/job.data.ts +++ b/src/views/tigerprojects/tsk/tsk_job/job.data.ts @@ -1,7 +1,14 @@ import { BasicColumn, FormSchema } from '/@/components/Table'; import { optionsListApi } from '/@/api/tigerapi/tsk/tsk_job'; -import { h } from 'vue'; +import { h, unref } from 'vue'; import { Tag, Tooltip } from 'ant-design-vue'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { GetEnum } from '/@/api/tigerapi/system'; +import { useLocale } from '/@/locales/useLocale'; + +const { t } = useI18n(); +const { getLocale } = useLocale(); + //鐣岄潰鍒楄〃鏄剧ず export const columns: BasicColumn[] = [ { @@ -19,16 +26,28 @@ dataIndex: 'UPDATE_TIME', width: 180, }, - // { - // title: '宸ュ巶鍚嶇О', - // dataIndex: 'FACTORY_NAME', - // width: 180, - // }, { title: '鐘舵��', dataIndex: 'Status', customRender: ({ record }) => { - return h(Tooltip, { title: record.Status.split(',')[1] }, () => record.Status.split(',')[0]); + const texts = record.Status.split(','); + let color = ''; + switch (texts[0]) { + case 'Running': + color = 'green'; + break; + case 'Ready': + color = '#bfbfbf'; + break; + case 'Stop': + color = 'red'; + break; + default: + break; + } + return h(Tooltip, { title: record.Status.split(',')[1] }, () => + h(Tag, { color: color }, () => texts[1]), + ); }, width: 180, }, @@ -39,6 +58,9 @@ }, ]; +/** + * description + */ export const searchFormSchema: FormSchema[] = [ { field: 'JobName', @@ -70,36 +92,248 @@ }, ]; +const isRunNow = (type: number) => type === 0; +const isRunAt = (type: number) => type === 1; +const isEvery = (type: number) => type === 2; +const isRunIn = (type: number) => type === 3; +let showHour = false; +let showMinute = false; +let showDay = false; export const formSchema: FormSchema[] = [ { field: 'JobName', label: '浠诲姟鍚嶇О', required: true, component: 'Input', + ifShow: false, }, { field: 'JobType', label: '浠诲姟绫诲悕', required: true, component: 'Input', + colProps: { span: 24 }, }, { field: 'AssemblyName', label: '鍛藉悕绌洪棿', required: true, component: 'Input', + colProps: { span: 24 }, }, { field: 'Remark', label: '鎻忚堪', required: true, component: 'Input', + colProps: { span: 24 }, }, { - field: 'Period', - label: '闂撮殧鏃堕棿(m)', + field: 'NonReentrant', + label: '涓嶉噸鏂拌繘鍏�', + component: 'RadioButtonGroup', + defaultValue: 'N', + colProps: { + span: 24, + }, + componentProps: { + options: [ + { label: '鏄�', value: 'Y' }, + { label: '鍚�', value: 'N' }, + ], + }, + }, + { + field: 'runType', + label: '杩愯绫诲瀷', + component: 'RadioButtonGroup', + defaultValue: 0, + componentProps: ({ schema, tableAction, formActionType, formModel }) => { + return { + options: [ + { label: '椹笂杩愯', value: 0 }, + { label: '鍦�(T)杩愯涓�娆�', value: 1 }, + { label: '闅�(T)杩愯', value: 2 }, + { label: '(T)鍚庤繍琛屼竴娆�', value: 3 }, + ], + onChange: (e) => {}, + }; + }, + colProps: { lg: 24, md: 24 }, + }, + { + field: 'type', + label: '鏃堕棿绫诲瀷', + component: 'ApiSelect', + colProps: { span: 12 }, + defaultValue: 0, + componentProps: { + api: GetEnum, + params: { name: 'TrigArgs+EveryType' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + onChange: (e, v) => { + console.log('ApiSelect====>:', e, v); + if (Number(e) < 3) { + showMinute = false; + showHour = false; + } + if (e == 3) { + showMinute = true; + showHour = false; + } + if (Number(e) > 3) { + showMinute = true; + showHour = true; + } + if (Number(e) == 7) { + showDay = true; + } else { + showDay = false; + } + }, + }, + }, + { + field: 'ToRunOnceAtDt', + label: '杩愯鏃堕棿鐐�', required: true, - component: 'InputNumber', + component: 'TimePicker', + colProps: { span: 12 }, + componentProps: ({ formModel }) => { + return { + format: 'HH:mm', + }; + }, + ifShow: ({ values }) => isRunAt(values.runType), + }, + { + field: 'NowAddMinutes', + label: '澧炲姞鍒嗛挓鏁�', + defaultValue: '0', + component: 'Input', + colProps: { span: 12 }, + rules: [ + { + required: true, + // @ts-ignore + validator: async (rule, value) => { + if (isNaN(Number(value))) { + return Promise.reject(t('涓嶆槸鏁板瓧')); + } + return Promise.resolve(); + }, + trigger: 'change', + }, + ], + ifShow: ({ values }) => isRunAt(values.runType), + }, + { + field: 'ToRunEvery', + label: '闅斿灏戞墽琛�', + defaultValue: '0', + component: 'Input', + colProps: { span: 12 }, + rules: [ + { + required: true, + // @ts-ignore + validator: async (rule, value) => { + if (isNaN(Number(value))) { + return Promise.reject(t('涓嶆槸鏁板瓧')); + } + return Promise.resolve(); + }, + trigger: 'change', + }, + ], + ifShow: ({ values }) => + isRunNow(values.runType) || isRunAt(values.runType) || isEvery(values.runType), + }, + { + field: 'ToRunOnceIn', + label: '澶氬皯鍚庢墽琛�', + defaultValue: '0', + component: 'Input', + colProps: { span: 12 }, + rules: [ + { + required: true, + // @ts-ignore + validator: async (rule, value) => { + if (isNaN(Number(value))) { + return Promise.reject(t('涓嶆槸鏁板瓧')); + } + return Promise.resolve(); + }, + trigger: 'change', + }, + ], + ifShow: ({ values }) => isRunIn(values.runType), + }, + { + field: 'Days', + label: '澶╂暟', + defaultValue: '0', + component: 'Input', + colProps: { span: 12 }, + rules: [ + { + required: true, + // @ts-ignore + validator: async (rule, value) => { + if (isNaN(Number(value))) { + return Promise.reject(t('涓嶆槸鏁板瓧')); + } + return Promise.resolve(); + }, + trigger: 'change', + }, + ], + ifShow: () => showDay, + }, + { + field: 'Hours', + label: '灏忔椂鏁�', + defaultValue: '0', + component: 'Input', + colProps: { span: 12 }, + rules: [ + { + required: true, + // @ts-ignore + validator: async (rule, value) => { + if (isNaN(Number(value))) { + return Promise.reject(t('涓嶆槸鏁板瓧')); + } + return Promise.resolve(); + }, + trigger: 'change', + }, + ], + ifShow: () => showHour, + }, + { + field: 'Minutes', + label: '鍒嗛挓鏁�', + defaultValue: '0', + component: 'Input', + colProps: { span: 12 }, + rules: [ + { + required: true, + // @ts-ignore + validator: async (rule, value) => { + if (isNaN(Number(value))) { + return Promise.reject(t('涓嶆槸鏁板瓧')); + } + return Promise.resolve(); + }, + trigger: 'change', + }, + ], + ifShow: () => showMinute, }, { field: 'ID', diff --git a/src/views/tigerprojects/tsk/tsk_job/jobDetail.vue b/src/views/tigerprojects/tsk/tsk_job/jobDetail.vue index 8bae6d2..8edd21a 100644 --- a/src/views/tigerprojects/tsk/tsk_job/jobDetail.vue +++ b/src/views/tigerprojects/tsk/tsk_job/jobDetail.vue @@ -33,9 +33,9 @@ //璇︽儏鍒楄〃 import { BasicTable, useTable } from '/@/components/Table'; import { getTsk_TrigListByPage } from '/@/api/tigerapi/tsk/tsk_trig'; - import { getTsk_LogListByPage } from '/@/api/tigerapi/tsk/tsk_log'; import { columns } from './trig.data'; import { logcolumns, searchFormSchema } from './log.data'; + import { getListByPage } from '/@/api/tigerapi/system'; export default defineComponent({ name: 'JobManagement', @@ -48,18 +48,30 @@ const JobId = ref(route.params?.JobName.split(',')[0]); const [logsTable, { reload1 }] = useTable({ title: '浠诲姟鏃ュ織鍒楄〃', - api: getTsk_LogListByPage, + api: getListByPage, + searchInfo: { + JobId: JobId, + TABLE_NAME: 'TSK_LOG', + // option: { + // //鏍规嵁鎹偣鏌ヨ锛屽繀闇�甯﹁繖涓弬鏁� + // UserId: useUserStore().getUserInfo.userId, + // ByOrg: true, + // CurOrg: useUserStore().getUserInfo.orgCode, + // }, + NeedInclude: true, + // order: 'descend', + // field: 'StartTime' + }, columns: logcolumns, useSearchForm: true, showTableSetting: true, bordered: true, - canResize:true, + canResize: true, showIndexColumn: false, formConfig: { labelWidth: 120, schemas: searchFormSchema, }, - searchInfo: { JobId }, }); const [registerTable, { reload }] = useTable({ title: '浠诲姟璇︽儏', @@ -73,7 +85,7 @@ searchInfo: { JobId }, showTableSetting: false, bordered: true, - canResize:true, + canResize: true, showIndexColumn: false, }); // 姝ゅ鍙互寰楀埌鐢ㄦ埛ID diff --git a/src/views/tigerprojects/tsk/tsk_job/jobDrawer.vue b/src/views/tigerprojects/tsk/tsk_job/jobDrawer.vue index 0785f62..a7523ff 100644 --- a/src/views/tigerprojects/tsk/tsk_job/jobDrawer.vue +++ b/src/views/tigerprojects/tsk/tsk_job/jobDrawer.vue @@ -4,82 +4,89 @@ @register="registerDrawer" showFooter :title="getTitle" - width="500px" + width="600px" @ok="handleSubmit" > <BasicForm @register="registerForm" /> </BasicDrawer> </template> -<script lang="ts"> - import { defineComponent, ref, computed, unref } from 'vue'; +<script lang="ts" setup> + import { ref, computed, unref } from 'vue'; import { BasicForm, useForm } from '/@/components/Form/index'; import { formSchema } from './job.data'; import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; import { useI18n } from '/@/hooks/web/useI18n'; import { useMessage } from '/@/hooks/web/useMessage'; //api - import { SaveTsk_Job } from '/@/api/tigerapi/tsk/tsk_job'; + import { SaveEntity } from '/@/api/tigerapi/system'; + import { SaveTskJob } from '/@/api/tigerapi/tsk/tsk_job'; +import { TskParameter } from '/@/api/tigerapi/model/tskModel'; +import { dateUtil } from '/@/utils/dateUtil'; const { t } = useI18n(); const { notification, createErrorModal } = useMessage(); + const emit = defineEmits(['success']); + const isUpdate = ref(true); - export default defineComponent({ - name: 'WHDrawer', - components: { BasicDrawer, BasicForm }, - emits: ['success', 'register'], - setup(_, { emit }) { - const isUpdate = ref(true); - - const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ - labelWidth: 90, - schemas: formSchema, - showActionButtonGroup: false, - }); - - const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { - resetFields(); - setDrawerProps({ confirmLoading: false }); - isUpdate.value = !!data?.isUpdate; - - if (unref(isUpdate)) { - setFieldsValue({ - ...data.record, - }); - } - }); - - const getTitle = computed(() => (!unref(isUpdate) ? '鏂板浠诲姟' : '缂栬緫浠诲姟')); - - async function handleSubmit() { - try { - const values = await validate(); - setDrawerProps({ confirmLoading: true }); - // TODO custom api - //淇濆瓨浠诲姟 - const apiAction = SaveTsk_Job(values, unref(isUpdate)); - apiAction.then((action) => { - if (action.IsSuccessed) { - closeDrawer(); - emit('success'); - }else{ - createErrorModal({ - title: t('sys.api.errorTip'), - content: action.Message, - getContainer: () => document.body, - }); - } - }); - } finally { - setDrawerProps({ confirmLoading: false }); - } - } - - return { - registerDrawer, - registerForm, - getTitle, - handleSubmit, - }; - }, + const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ + labelWidth: 120, + schemas: formSchema, + showActionButtonGroup: false, }); + + const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { + resetFields(); + setDrawerProps({ confirmLoading: false }); + isUpdate.value = !!data?.isUpdate; + + if (unref(isUpdate)) { + let tskParam = {} as unknown as TskParameter; + const args = JSON.parse(data.record.Triggers[0].Args); + tskParam.JobName = data.record.JobName; + tskParam.JobType = data.record.JobType; + tskParam.AssemblyName = data.record.AssemblyName; + tskParam.Remark = data.record.Remark; + tskParam.Days = args.Days; + tskParam.Hours = args.Hours; + tskParam.Minutes = args.Minutes; + tskParam.NonReentrant = args.NonReentrant; + tskParam.NowAddMinutes = args.NowAddMinutes; + tskParam.ToRunEvery = args.ToRunEvery; + tskParam.ToRunOnceAtDt = dateUtil(args.ToRunOnceAtDt); + tskParam.ToRunOnceIn = args.ToRunOnceIn; + tskParam.runType = args.runType; + tskParam.type = args.Type; + + setFieldsValue({ + ...tskParam, + }); + } + }); + + const getTitle = computed(() => (!unref(isUpdate) ? '鏂板浠诲姟' : '缂栬緫浠诲姟')); + + /** + * 鎻愪氦 + */ + async function handleSubmit() { + try { + const values = await validate(); + setDrawerProps({ confirmLoading: true }); + // TODO custom api + //淇濆瓨浠诲姟 + const apiAction = await SaveTskJob(values); + if (apiAction.IsSuccessed) { + closeDrawer(); + emit('success'); + } else { + createErrorModal({ + title: t('sys.api.errorTip'), + content: apiAction.Message, + getContainer: () => document.body, + }); + } + } finally { + setDrawerProps({ confirmLoading: false }); + } + } </script> diff --git a/src/views/tigerprojects/tsk/tsk_job/log.data.ts b/src/views/tigerprojects/tsk/tsk_job/log.data.ts index de4201e..81af6c4 100644 --- a/src/views/tigerprojects/tsk/tsk_job/log.data.ts +++ b/src/views/tigerprojects/tsk/tsk_job/log.data.ts @@ -1,43 +1,64 @@ -import { ParamParams } from './../../../../api/tigerapi/model/systemModel'; +import { h } from 'vue'; import { BasicColumn, FormSchema } from '/@/components/Table'; -import { useMessage } from '/@/hooks/web/useMessage'; -import { h, ref } from 'vue'; -import { Tag } from 'ant-design-vue'; -import { getTsk_LogListByPage } from '/@/api/tigerapi/tsk/tsk_log'; +import { Tag, Tooltip } from 'ant-design-vue'; //鐣岄潰鍒楄〃鏄剧ず export const logcolumns: BasicColumn[] = [ - // { - // title: '寮�濮嬫椂闂�', - // dataIndex: 'StartTime', - // width: 180, - // }, - // { - // title: '缁撴潫鏃堕棿', - // dataIndex: 'EndTime', - // width: 180, - // }, - { - title: '绫诲悕', - dataIndex: 'TriggerType', - width: 180, + title: '寮�濮嬫椂闂�', + dataIndex: 'StartTime', + sorter: true, + resizable: true, + width: 150, }, + { + title: '缁撴潫鏃堕棿', + dataIndex: 'EndTime', + sorter: true, + resizable: true, + width: 150, + }, + + // { + // title: '绫诲悕', + // dataIndex: 'TriggerType', + // width: 180, + // }, { title: '杩愯鐘舵��', dataIndex: 'Status', - width: 180, + width: 80, + customRender: ({ record }) => { + let text = ''; + let color = ''; + switch (record.Status) { + case 'Successed': + text = '鎴愬姛'; + color = 'green'; + break; + case 'Failed': + text = '澶辫触'; + color = 'red'; + break; + case 'Warnning': + text = '璀﹀憡'; + color = 'orange'; + break; + default:break; + } + return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); + }, }, - { - title: '鎿嶄綔绫诲瀷', - dataIndex: 'Operation', - width: 180, - }, + // { + // title: '鎿嶄綔绫诲瀷', + // dataIndex: 'Operation', + // width: 180, + // }, { title: '鏈鎵ц鑰楁椂(s)', dataIndex: 'ElapsedTime', - width: 180, + width: 90, }, // { // title: '鐘舵��', @@ -53,7 +74,8 @@ { title: '鎻忚堪', dataIndex: 'Remark', - width: 180, + resizable: true, + width: 260, }, ]; diff --git a/src/views/tigerprojects/tsk/tsk_job/trig.data.ts b/src/views/tigerprojects/tsk/tsk_job/trig.data.ts index 13a3afa..6640bf9 100644 --- a/src/views/tigerprojects/tsk/tsk_job/trig.data.ts +++ b/src/views/tigerprojects/tsk/tsk_job/trig.data.ts @@ -1,4 +1,7 @@ + +import { Tag, Tooltip } from 'ant-design-vue'; import { BasicColumn, FormSchema } from '/@/components/Table'; +import { h } from 'vue'; //鐣岄潰鍒楄〃鏄剧ず export const columns: BasicColumn[] = [ { @@ -17,6 +20,16 @@ width: 180, }, { + title: '寮�濮嬫椂闂�', + dataIndex: 'StartTime', + width: 180, + }, + { + title: '鎵ц缁撴灉', + dataIndex: 'Result', + width: 180, + }, + { title: '缁撴潫鏃堕棿', dataIndex: 'EndTime', width: 180, @@ -25,6 +38,25 @@ title: '鐘舵��', dataIndex: 'Status', width: 180, + customRender: ({ record }) => { + let color = '';let text = ''; + switch (record.Status) { + case 2: + text = '姝e湪杩愯'; + color = 'green'; + break; + case 1: + text = '灏辩华'; + color = '#bfbfbf'; + break; + case 13: + text = '鍋滄'; + color = 'red'; + break; + default:break; + } + return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); + }, }, { title: '澶囨敞', -- Gitblit v1.9.3