| | |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | //设置ç¼è¾è¡¨åæ ç¾å®½åº¦ |
| | | this.boxOptions.labelWidth=160; |
| | | //æ¥è¯¢è¡¨åæ ç¾å®½åº¦ |
| | | this.labelWidth=160; |
| | | let enableBtn = this.buttons.find(x => x.value == 'Enable'); |
| | | if (enableBtn) { |
| | | enableBtn.onClick = function () { |
| | | this.$message.success('èªå®ä¹æé®ç¹å»äºä»¶'); |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©å··é!"); |
| | | let keys = rows.map(x => { |
| | | return x[this.table.key]; |
| | | }); |
| | | if (!keys || keys.Length == 0) return this.$error("æªè·åå°å··éä¿¡æ¯!"); |
| | | this.$confirm("æ¯å¦ç¡®è®¤è¦å¯ç¨å··éï¼", "æç¤º", { |
| | | confirmButtonText: "确认",//确认æé®æåæ´æ¢ |
| | | cancelButtonText: "åæ¶",//åæ¶æé®æåæ´æ¢ |
| | | showClose: true,//æ¯å¦æ¾ç¤ºå³ä¸è§å
³éæé® |
| | | type: "warning",//æç¤ºç±»å success:æå/info:ä¿¡æ¯/warning:è¦å/error:æ¥é |
| | | }).then(() => { |
| | | this.http.post("api/RoadwayInfo/RoadwayEnableStatus" , keys, "æ£å¨å¯ç¨å··é....").then(x => { |
| | | if (!x.status) return this.$error(x.message); |
| | | this.$success("å¯ç¨å··éæå!"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | let disableBtn = this.buttons.find(x => x.value == 'Disable'); |
| | | if (disableBtn) { |
| | | disableBtn.onClick = function () { |
| | | this.$message.success('èªå®ä¹æé®ç¹å»äºä»¶'); |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©å··é!"); |
| | | let keys = rows.map(x => { |
| | | return x[this.table.key]; |
| | | }); |
| | | if (!keys || keys.Length == 0) return this.$error("æªè·åå°å··éä¿¡æ¯!"); |
| | | this.$confirm("æ¯å¦ç¡®è®¤è¦ç¦ç¨å··éï¼", "æç¤º", { |
| | | confirmButtonText: "确认",//确认æé®æåæ´æ¢ |
| | | cancelButtonText: "åæ¶",//åæ¶æé®æåæ´æ¢ |
| | | showClose: true,//æ¯å¦æ¾ç¤ºå³ä¸è§å
³éæé® |
| | | type: "warning",//æç¤ºç±»å success:æå/info:ä¿¡æ¯/warning:è¦å/error:æ¥é |
| | | }).then(() => { |
| | | this.http.post("api/RoadwayInfo/RoadwayDisableStatus" , keys, "æ£å¨ç¦ç¨å··é....").then(x => { |
| | | if (!x.status) return this.$error(x.message); |
| | | this.$success("ç¦ç¨å··éæå!"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | }, |