¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | class="card-area" |
| | | > |
| | | <template slot="title"> |
| | | <i |
| | | class="action-jeecg actionsite2" |
| | | style="font-size: 18px;" |
| | | /> |
| | | åå æç» |
| | | </template> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <!-- æç´¢åºå --> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | <a-col |
| | | :md="8" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="æ
éåå ç¼å·"> |
| | | <a-input |
| | | placeholder="请è¾å
¥æ
éåå ç¼å·æ¥è¯¢" |
| | | v-model="queryParam.num" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="8" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="æ
éåå åç§°"> |
| | | <a-input |
| | | placeholder="请è¾å
¥æ
éåå åç§°æ¥è¯¢" |
| | | v-model="queryParam.name" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div |
| | | class="table-operator" |
| | | style="margin-top: 5px" |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | @click="searchReset" |
| | | icon="reload" |
| | | >éç½®</a-button> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | <a-button |
| | | type="primary" |
| | | icon="download" |
| | | @click="handleExportXls('åå ')" |
| | | >导åº</a-button> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-button style="margin-left: 8px"> |
| | | æ¹éæä½ |
| | | <a-icon type="down" /> |
| | | </a-button> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item @click="batchDel"> |
| | | <a-icon type="delete" />å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, getCheckboxProps:getCheckboxProps}" |
| | | @change="handleTableChange" |
| | | :scroll="{ x: true}" |
| | | > |
| | | <template slot="num" slot-scope="text" > |
| | | <a-tooltip placement="top" :title="text" trigger="hover"> |
| | | <div> |
| | | <template slot="title"> </template> |
| | | <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p> |
| | | </div> |
| | | </a-tooltip> |
| | | </template> |
| | | <template slot="name" slot-scope="text" > |
| | | <a-tooltip placement="top" :title="text" trigger="hover"> |
| | | <div> |
| | | <template slot="title"> </template> |
| | | <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p> |
| | | </div> |
| | | </a-tooltip> |
| | | </template> |
| | | <!--ç¶ææ 个æ§å±ç¤º--> |
| | | <!-- <span |
| | | slot="status" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.status==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.status==1" |
| | | class="success" |
| | | >å¯ç¨</span> |
| | | <a-badge |
| | | v-if="record.status==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.status==0" |
| | | class="error" |
| | | >ç¦ç¨</span> |
| | | </span> --> |
| | | |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <!-- class="table-operation" --> |
| | | <a |
| | | href="javascript:;" |
| | | @click="handleDetail(record)" |
| | | >详æ
</a> |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link"> |
| | | æ´å¤ |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | |
| | | <a-menu-item v-if="record.faultCauseDtlList.length==0"> |
| | | <a-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-else> |
| | | <a-popconfirm title="å½åä¿¡æ¯å·²è¢«å¼ç¨ï¼è¯·å
å é¤å
³èä¿¡æ¯ååæ§è¡å 餿ä½"> |
| | | <a class="frozenRowClass">å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | |
| | | <!-- <a-menu-item v-if="record.status==1"> |
| | | <a-popconfirm |
| | | title="ç¡®å®ç¦ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>ç¦ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> --> |
| | | <!-- <a-menu-item v-if="record.status==0"> |
| | | <a-popconfirm |
| | | title="ç¡®å®å¯ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>å¯ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> --> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | <fault-cause-model |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></fault-cause-model> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { requestPut, deleteAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import FaultCauseModel from './FaultCauseModel' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | import JEllipsis from '@/components/jeecg/JEllipsis' |
| | | |
| | | export default { |
| | | name: 'FaultCause2List', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | FaultCauseModel, |
| | | JInput, |
| | | JEllipsis, |
| | | }, |
| | | props: { |
| | | nodeSelected: { |
| | | type: Object, |
| | | default: {} |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | // dataSource: [], |
| | | //é»è®¤æåº |
| | | isorter: { |
| | | column: 'num', |
| | | order: 'asc', |
| | | }, |
| | | |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | width: 50, |
| | | }, |
| | | { |
| | | title: 'æ
éåå ç¼ç ', |
| | | align: "center", |
| | | dataIndex: 'num', |
| | | width: 100, |
| | | scopedSlots: { |
| | | customRender: 'num' |
| | | }, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'æ
éåå åç§°', |
| | | width: 100, |
| | | align: "center", |
| | | dataIndex: 'name', |
| | | scopedSlots: { |
| | | customRender: 'name' |
| | | }, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'æ
éåå åç±»', |
| | | align: "center", |
| | | dataIndex: 'parentName', |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | align: "center", |
| | | dataIndex: 'createBy', |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | align: "center", |
| | | dataIndex: 'createTime', |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹äºº', |
| | | align: "center", |
| | | dataIndex: 'updateBy', |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹æ¶é´', |
| | | align: "center", |
| | | dataIndex: 'updateTime', |
| | | }, |
| | | |
| | | // { |
| | | // title: 'ç¶æ', |
| | | // align: 'center', |
| | | // dataIndex: 'status', |
| | | // scopedSlots: { |
| | | // customRender: 'status', |
| | | // }, |
| | | // sorter: true, |
| | | // width: 100, |
| | | // }, |
| | | { |
| | | title: 'æä½', |
| | | align: "center", |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action', |
| | | }, |
| | | width: 150, |
| | | fixed: 'right', |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/eam/faultCause/list", |
| | | delete: "/eam/faultCause/delete", |
| | | deleteBatch: "/eam/faultCause/deleteBatch", |
| | | active: "/eam/faultCause/active", |
| | | exportXlsUrl: '/eam/faultCause/exportXls', |
| | | // importExcelUrl: 'base/site/importExcel', |
| | | }, |
| | | //æ°å¢ãç¼è¾ãå é¤ãæ¹éå 餿使¹åæ°æ®åå·æ°å
³èçç»ä»¶ççå¬å±æ§ |
| | | alterFlag: "", |
| | | parentNum: "-1", |
| | | parentName: "æ
éåå ", |
| | | }; |
| | | }, |
| | | methods: { |
| | | |
| | | getCheckboxProps(record) { |
| | | return ({ |
| | | props: { |
| | | disabled: !(record.faultCauseDtlList.length == 0), |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //ç¦ç¨ç¶ææ ·å¼ |
| | | tableRowClass(record, index) { |
| | | if (record.status != "1") { |
| | | return "frozenRowClass"; |
| | | } |
| | | return ""; |
| | | }, |
| | | |
| | | handleActive(id) { |
| | | let that = this; |
| | | requestPut(that.url.active, {}, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }); |
| | | }, |
| | | handleAdd: function () { |
| | | this.$refs.modalForm.add({ parentNum: this.parentNum, parentName: this.parentName }); |
| | | this.$refs.modalForm.title = "æ°å¢"; |
| | | this.$refs.modalForm.disableSubmit = false; |
| | | this.$refs.modalForm.parentId = this.nodeSelected.key; |
| | | }, |
| | | handleDelete: function (id) { |
| | | if (!this.url.delete) { |
| | | this.$message.error("请设置url.delete屿§!") |
| | | return |
| | | } |
| | | var that = this; |
| | | deleteAction(that.url.delete, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(1) |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | that.alterFlag = new Date(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | batchDel: function () { |
| | | if (!this.url.deleteBatch) { |
| | | this.$message.error("请设置url.deleteBatch屿§!") |
| | | return |
| | | } |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼'); |
| | | return; |
| | | } else { |
| | | var ids = ""; |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ","; |
| | | } |
| | | var that = this; |
| | | this.$confirm({ |
| | | title: "确认å é¤", |
| | | content: "æ¯å¦å é¤é䏿°æ®?", |
| | | onOk: function () { |
| | | that.loading = true; |
| | | deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | that.onClearSelected(); |
| | | that.alterFlag = new Date(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.queryParam = {}; |
| | | this.queryParam.id = this.nodeSelected.key; |
| | | this.loadData(1); |
| | | }, |
| | | }, |
| | | watch: { |
| | | alterFlag() { |
| | | this.$bus.$emit('queryTreeData'); |
| | | }, |
| | | nodeSelected() { |
| | | this.queryParam = {}; |
| | | this.queryParam.id = this.nodeSelected.key; |
| | | this.parentNum = !this.nodeSelected.rfield1 ? '-1' : this.nodeSelected.rfield1; |
| | | this.parentName = !this.nodeSelected.rfield2 ? 'æ
éåå ' : this.nodeSelected.rfield2; |
| | | this.loadData(1); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.queryParam = {}; |
| | | this.queryParam.id = this.nodeSelected.key; |
| | | this.loadData(1); |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | | <style> |
| | | @import '~@assets/less/common.less'; |
| | | |
| | | .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | .success { |
| | | color: green; |
| | | } |
| | | .error { |
| | | color: red; |
| | | } |
| | | .fontweight { |
| | | font-weight: bold; |
| | | } |
| | | </style> |