| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridBody from './extend/taskExecuteDetail.vue' |
| | | import gridBody from "./extend/taskExecuteDetail.vue"; |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridHeader: "", |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | gridFooter: "", |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | modelHeader: "", |
| | | modelBody: "", |
| | | modelFooter: "", |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | tableAction: "", //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | |
| | | var recoveryButton = this.buttons.find((x) => x.value == "TaskRecovery"); |
| | | if (recoveryButton) recoveryButton.hidden = true; |
| | | |
| | | let LightB2Btn = this.buttons.find((x) => x.value == "LightB2"); |
| | | if (LightB2Btn) { |
| | | LightB2Btn.onClick = function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | | this.http.post("api/Task/InitLight", "æç§å¢å¯å¨ä¸").then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.refresh(); |
| | | }); |
| | | }; |
| | | } |
| | | |
| | | let TaskCompletedBtn = this.buttons.find( |
| | | (x) => x.value == "TaskCompleted" |
| | | ); |
| | | |
| | | if (TaskCompletedBtn) { |
| | | TaskCompletedBtn.onClick = function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | |
| | | if (rows.length > 1) { |
| | | return this.$error("䏿¬¡åªè½æä½ä¸æ¡æ°æ®!"); |
| | | } |
| | | |
| | | this.$confirm("ç¡®å®è´§ç®±æ¾å¨ç®æ å°åäºåï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | const taskNum = rows[0].taskNum; |
| | | |
| | | // æ¹æ³1ï¼åéJSONæ°æ®ï¼éè¦åç«¯æ¯æ[FromBody]ï¼ |
| | | // this.http.post("api/Task/RecTaskCompleted", { taskNum }, "ä»»å¡å®æä¸") |
| | | |
| | | // ææ¹æ³2ï¼URLåæ°æ¹å¼ |
| | | this.http |
| | | .post( |
| | | `api/Task/RecTaskCompleted?taskNum=${taskNum}`, |
| | | null, |
| | | "ä»»å¡å®æä¸" |
| | | ) |
| | | |
| | | // ææ¹æ³3ï¼è¡¨åæ°æ®æ¹å¼ |
| | | // let formData = new FormData(); |
| | | // formData.append('taskNum', taskNum); |
| | | // this.http.post("api/Task/RecTaskCompleted", formData, "ä»»å¡å®æä¸") |
| | | |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | this.$message({ |
| | | type: "info", |
| | | message: "已忶æä½", |
| | | }); |
| | | }); |
| | | }; |
| | | } |
| | | //æ©å±é¡µé¢åå§åæä½ |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | field: "æä½", |
| | | title: "æä½", |
| | | width: 70, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | fixed: "right", |
| | | align: "center", |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ¥ç</i>' |
| | | ); |
| | | return '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ¥ç</i>'; |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | },); |
| | | |
| | | }, |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | export default extension; |