| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // 该æ©å±æä»¶ç¨äºä»»å¡åå²é¡µé¢çä¸å¡æ©å±ã |
| | | // æ¹æ³ç®çï¼ç»ä¸é¢çå表æ¥è¯¢ãä¿ååååå¼¹çªæå¼æ¶çæ©å±å
¥å£ï¼ä¿æä¸é¡¹ç®å
task 页é¢ä¸è´çæ©å±ç¹ã |
| | | // åæ°å«ä¹ï¼ç±æ¡æ¶æçå½å¨æä¼ å
¥ï¼å
嫿¥è¯¢åæ°ãè¡¨åæ°æ®ãè¡æ°æ®çä¸ä¸æã |
| | | // è¿åå¼è¯´æï¼è¿å true 代表继ç»é»è®¤è¡ä¸ºï¼è¿å false ä»£è¡¨ä¸æé»è®¤è¡ä¸ºã |
| | | // å¼å¸¸å¤ç说æï¼å½åæªå¼å
¥å¤é¨è°ç¨ï¼è¥åç»æ°å¢æ¥å£è°ç¨ï¼é卿¹æ³å
è¡¥å
try-catch å¹¶è®°å½å
³é®ä¸å¡åæ°ã |
| | | |
| | | let extension = { |
| | | components: { |
| | | gridHeader: "", |
| | | gridBody: "", |
| | | gridFooter: "", |
| | | modelHeader: "", |
| | | modelBody: "", |
| | | modelFooter: "", |
| | | }, |
| | | tableAction: "", |
| | | buttons: { view: [], box: [], detail: [] }, |
| | | methods: { |
| | | // æ¹æ³ç®çï¼é¡µé¢åå§åæ¶æ§è¡èªå®ä¹é»è¾ã |
| | | // åæ°ï¼æ ã |
| | | // è¿åå¼ï¼æ ã |
| | | onInit() {}, |
| | | |
| | | // æ¹æ³ç®çï¼é¡µé¢åå§å宿忧è¡èªå®ä¹é»è¾ã |
| | | // åæ°ï¼æ ã |
| | | // è¿åå¼ï¼æ ã |
| | | onInited() {}, |
| | | |
| | | // æ¹æ³ç®çï¼æ¥è¯¢åå¤çæ¥è¯¢æ¡ä»¶ã |
| | | // åæ°ï¼param æ¥è¯¢åæ°å¯¹è±¡ã |
| | | // è¿åå¼ï¼true ç»§ç»æ¥è¯¢ï¼false ç»æ¢æ¥è¯¢ã |
| | | searchBefore(param) { |
| | | return true; |
| | | }, |
| | | |
| | | // æ¹æ³ç®çï¼æ¥è¯¢åå¤çè¿åç»æã |
| | | // åæ°ï¼result å端è¿åæ°æ®ã |
| | | // è¿åå¼ï¼true ç»§ç»æ¸²æï¼false ç»æ¢åç»å¤çã |
| | | searchAfter(result) { |
| | | return true; |
| | | }, |
| | | |
| | | // æ¹æ³ç®çï¼æ°å¢åæ ¡éªæè¡¥å
æäº¤å段ã |
| | | // åæ°ï¼formData 表åæäº¤å¯¹è±¡ã |
| | | // è¿åå¼ï¼true ç»§ç»æäº¤ï¼false ç»æ¢æäº¤ã |
| | | addBefore(formData) { |
| | | return true; |
| | | }, |
| | | |
| | | // æ¹æ³ç®çï¼ç¼è¾åæ ¡éªæè¡¥å
æäº¤å段ã |
| | | // åæ°ï¼formData 表åæäº¤å¯¹è±¡ã |
| | | // è¿åå¼ï¼true ç»§ç»æäº¤ï¼false ç»æ¢æäº¤ã |
| | | updateBefore(formData) { |
| | | return true; |
| | | }, |
| | | |
| | | // æ¹æ³ç®çï¼ç¹å»è¡æ¶æ©å±å¤çã |
| | | // åæ°ï¼row è¡æ°æ®ï¼column åé
ç½®ï¼event åå§äºä»¶ã |
| | | // è¿åå¼ï¼æ ã |
| | | rowClick({ row, column, event }) {}, |
| | | |
| | | // æ¹æ³ç®çï¼ç¼è¾å¼¹çªæå¼åæ§è¡æ©å±é»è¾ã |
| | | // åæ°ï¼row å½åè¡æ°æ®ã |
| | | // è¿åå¼ï¼æ ã |
| | | modelOpenAfter(row) {}, |
| | | }, |
| | | }; |
| | | |
| | | export default extension; |
| | |
| | | path: '/scheduler', |
| | | name: 'scheduler', |
| | | component: () => import('@/views/quartzJob/scheduler.vue') |
| | | },{ |
| | | path: '/robotTask', |
| | | name: 'robotTask', |
| | | component: () => import('@/views/taskinfo/robotTask.vue') |
| | | }, |
| | | { |
| | | path: '/task', |
| | |
| | | }, 0); |
| | | |
| | | const defaultMenus = [ |
| | | { |
| | | id: maxId + 1001, |
| | | name: "ç§æ·ç®¡ç", |
| | | url: "/Sys_Tenant", |
| | | parentId: 0, |
| | | icon: "el-icon-office-building", |
| | | enable: 1, |
| | | tableName: "Sys_Tenant", |
| | | permission: ["Search", "Add", "Update", "Delete"], |
| | | }, |
| | | { |
| | | id: maxId + 1002, |
| | | name: "ä»»å¡åå²", |
| | | url: "/taskHty", |
| | | parentId: 0, |
| | | icon: "el-icon-time", |
| | | enable: 1, |
| | | tableName: "taskHty", |
| | | permission: ["Search", "Export"], |
| | | }, |
| | | // { |
| | | // id: maxId + 1001, |
| | | // name: "ç§æ·ç®¡ç", |
| | | // url: "/Sys_Tenant", |
| | | // parentId: 0, |
| | | // icon: "el-icon-office-building", |
| | | // enable: 1, |
| | | // tableName: "Sys_Tenant", |
| | | // permission: ["Search", "Add", "Update", "Delete"], |
| | | // }, |
| | | // { |
| | | // id: maxId + 1002, |
| | | // name: "ä»»å¡åå²", |
| | | // url: "/taskHty", |
| | | // parentId: 0, |
| | | // icon: "el-icon-time", |
| | | // enable: 1, |
| | | // tableName: "taskHty", |
| | | // permission: ["Search", "Export"], |
| | | // }, |
| | | { |
| | | id: maxId + 1003, |
| | | name: "è°åº¦æ§å¶", |
| | |
| | | field: "deviceCode", |
| | | title: "设å¤ç¼å·", |
| | | type: "string", |
| | | width: 90, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | field: "deviceType", |
| | | title: "设å¤ç±»å", |
| | | type: "string", |
| | | width: 180, |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "deviceType", data: [] }, |
| | | }, |
| | |
| | | field: "name", |
| | | title: "ä»»å¡åç§°", |
| | | type: "string", |
| | | width: 90, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "jobGroup", |
| | | title: "ä»»å¡åç»", |
| | | type: "string", |
| | | width: 180, |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "deviceType", data: [] }, |
| | | }, |
| | |
| | | field: "className", |
| | | title: "任塿å¨ç±»", |
| | | type: "int", |
| | | width: 200, |
| | | width: 220, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "请æ±å°å", field: "url", type: "like" }, |
| | | { title: "ç¨æ·IP", field: "userIP", type: "like" }, |
| | | { title: "æå¡å¨IP", field: "serviceIP", type: "like" }, |
| | | { title: "请æ±åæ°", field: "requestParam", type: "like" }, |
| | | { title: "ååºåæ°", field: "responseParam", type: "like" }, |
| | | ], |
| | | [ |
| | | { title: "å¼å§æ¶é´", field: "beginDate", type: "datetime" }, |
| | | { |
| | | dataKey: "restatus", |
| | | data: [], |
| | | title: "ååºç¶æ", |
| | | field: "success", |
| | | type: "selectList", |
| | | }, |
| | | { |
| | | dataKey: "roles", |
| | | data: [], |
| | | title: "è§è²ID", |
| | | field: "role_Id", |
| | | type: "select", |
| | | }, |
| | | // { |
| | | // dataKey: "restatus", |
| | | // data: [], |
| | | // title: "ååºç¶æ", |
| | | // field: "success", |
| | | // type: "selectList", |
| | | // }, |
| | | // { |
| | | // dataKey: "roles", |
| | | // data: [], |
| | | // title: "è§è²ID", |
| | | // field: "role_Id", |
| | | // type: "select", |
| | | // }, |
| | | ], |
| | | [ |
| | | { |
| | | dataKey: "log", |
| | | data: [], |
| | | title: "æ¥å¿ç±»å", |
| | | field: "logType", |
| | | colSize: 12, |
| | | type: "checkbox", |
| | | }, |
| | | ], |
| | | // [ |
| | | // { |
| | | // dataKey: "log", |
| | | // data: [], |
| | | // title: "æ¥å¿ç±»å", |
| | | // field: "logType", |
| | | // colSize: 12, |
| | | // type: "checkbox", |
| | | // }, |
| | | // ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | |
| | | field: "beginDate", |
| | | title: "å¼å§æ¶é´", |
| | | type: "datetime", |
| | | width: 140, |
| | | width: 120, |
| | | align: "left", |
| | | sortable: true, |
| | | }, |
| | |
| | | field: "userName", |
| | | title: "ç¨æ·åç§°", |
| | | type: "string", |
| | | width: 90, |
| | | width: 60, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "url", |
| | | title: "请æ±å°å", |
| | | type: "string", |
| | | width: 110, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "logType", |
| | | title: "æ¥å¿ç±»å", |
| | | type: "string", |
| | | bind: { key: "log", data: [] }, |
| | | width: 80, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "success", |
| | | title: "ååºç¶æ", |
| | | type: "int", |
| | | bind: { key: "restatus", data: [] }, |
| | | width: 80, |
| | | align: "left", |
| | | }, |
| | | // { |
| | | // field: "logType", |
| | | // title: "æ¥å¿ç±»å", |
| | | // type: "string", |
| | | // bind: { key: "log", data: [] }, |
| | | // width: 80, |
| | | // align: "left", |
| | | // }, |
| | | // { |
| | | // field: "success", |
| | | // title: "ååºç¶æ", |
| | | // type: "int", |
| | | // bind: { key: "restatus", data: [] }, |
| | | // width: 80, |
| | | // align: "left", |
| | | // }, |
| | | { |
| | | field: "elapsedTime", |
| | | title: "æ¶é¿", |
| | | type: "int", |
| | | width: 60, |
| | | width: 50, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "requestParameter", |
| | | field: "requestParam", |
| | | title: "请æ±åæ°", |
| | | type: "string", |
| | | width: 70, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "responseParameter", |
| | | field: "responseParam", |
| | | title: "ååºåæ°", |
| | | type: "string", |
| | | width: 70, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | |
| | | <script> |
| | | import extend from "@/extension/taskinfo/robotTask.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "robotTaskId", // 主é®å段å |
| | | footer: "Foots", |
| | | cnName: "æºå¨äººä»»å¡ä¿¡æ¯", // 䏿åç§° |
| | | name: "robotTask", // 表å |
| | | url: "/robotTask/", // APIè·¯å¾ |
| | | sortName: "createDate", // é»è®¤æåºå段 |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨ååæ®µï¼åå§ä¸ºç©ºï¼æ ¹æ®å®é
ç¼è¾éæ±é
ç½®ï¼ |
| | | const editFormFields = ref({}); |
| | | const editFormOptions = ref([]); |
| | | |
| | | // æç´¢è¡¨ååæ®µ |
| | | const searchFormFields = ref({ |
| | | robotTaskNum: "", |
| | | robotRoadway: "", |
| | | robotTaskType: "", |
| | | robotTaskState: "", |
| | | robotSourceAddress: "", |
| | | robotTargetAddress: "", |
| | | creater: "", |
| | | createDate: "", |
| | | }); |
| | | |
| | | // æç´¢è¡¨åé
ç½® |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "ä»»å¡ç¼å·", field: "robotTaskNum", type: "int" }, |
| | | { title: "å··é", field: "robotRoadway", type: "like" }, |
| | | { |
| | | title: "ä»»å¡ç±»å", |
| | | field: "robotTaskType", |
| | | type: "selectList", |
| | | dataKey: "taskType", |
| | | data: [], |
| | | }, |
| | | { |
| | | title: "ä»»å¡ç¶æ", |
| | | field: "robotTaskState", |
| | | type: "selectList", |
| | | dataKey: "taskState", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "æ¥æºå°å", field: "robotSourceAddress", type: "like" }, |
| | | { title: "ç®æ å°å", field: "robotTargetAddress", type: "like" }, |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | |
| | | // åé
ç½® |
| | | const columns = ref([ |
| | | { |
| | | field: "robotTaskId", |
| | | title: "ä»»å¡ID", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, // éèä¸»é® |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "robotTaskNum", |
| | | title: "ä»»å¡ç¼å·", |
| | | type: "int", |
| | | width: 100, |
| | | align: "left", |
| | | sortable: true, // å¯æåº |
| | | }, |
| | | { |
| | | field: "robotRoadway", |
| | | title: "å··é", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "robotTaskType", |
| | | title: "ä»»å¡ç±»å", |
| | | type: "int", |
| | | width: 100, |
| | | align: "left", |
| | | bind: { key: "taskType", data: [] }, |
| | | }, |
| | | { |
| | | field: "robotTaskState", |
| | | title: "ä»»å¡ç¶æ", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "taskState", data: [] }, |
| | | }, |
| | | { |
| | | field: "robotTaskTotalNum", |
| | | title: "任塿»æ°", |
| | | type: "int", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "robotSourceAddress", |
| | | title: "æ¥æºå°å", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "robotTargetAddress", |
| | | title: "ç®æ å°å", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "robotSourceAddressLineCode", |
| | | title: "æ¥æºçº¿ä»£ç ", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "robotTargetAddressLineCode", |
| | | title: "ç®æ 线代ç ", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "robotSourceAddressPalletCode", |
| | | title: "æ¥æºæç代ç ", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "robotTargetAddressPalletCode", |
| | | title: "ç®æ æç代ç ", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "robotExceptionMessage", |
| | | title: "å¼å¸¸ä¿¡æ¯", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | hidden: true, |
| | | overflow: "ellipsis", |
| | | }, |
| | | { |
| | | field: "robotGrade", |
| | | title: "ä¼å
级", |
| | | type: "int", |
| | | width: 80, |
| | | align: "left", |
| | | bind: { |
| | | key: "robotGrade", |
| | | data: [ |
| | | { id: 1, name: "ä½" }, |
| | | { id: 2, name: "æ®é" }, |
| | | { id: 3, name: "é«" }, |
| | | { id: 4, name: "ç´§æ¥" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "robotDispatchertime", |
| | | title: "è°åº¦æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "robotremark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | sortable: true, |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | |
| | | // 详æ
å¼¹çªé
ç½®ï¼å¦éæ¥ç详æ
åè½ï¼ |
| | | const detail = ref({ |
| | | cnName: "æºå¨äººä»»å¡è¯¦æ
", |
| | | table: "robotTask", |
| | | key: "robotTaskId", |
| | | sortName: "CreateDate", |
| | | columns: columns.value.filter(col => !col.hidden), // 使ç¨ééèåæ®µ |
| | | }); |
| | | |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region RobotTaskTypeEnum |
| | | { |
| | | Type type = typeof(RobotTaskTypeEnum); |
| | | List<int> enums = Enum.GetValues(typeof(RobotTaskTypeEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(RobotTaskTypeEnum).GetField(((RobotTaskTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_ISystemServices; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_Server.Controllers.Task |
| | | { |
| | | [Route("api/robotTask")] |
| | | [ApiController] |
| | | public class RobotTaskController : ApiBaseController<IRobotTaskService, Dt_RobotTask> |
| | | { |
| | | public RobotTaskController(IRobotTaskService service) : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | if (stockInfo != null) |
| | | return response.Error($"å½åæç{dto.TrayNumber}å·²ç»å
¥åºäº"); |
| | | |
| | | // å建åºåæç» |
| | | |
| | | task.TaskType = (int)TaskInboundTypeEnum.Inbound; |
| | | task.TaskStatus = (int)TaskInStatusEnum.InNew; |
| | | task.CurrentAddress = task.SourceAddress; |