¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud |
| | | :addBtn="false" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model:search="search" |
| | | v-model:page="mypage" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template #menu-left> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">导åº</el-button> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">导å
¥</el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleEdit(scope.row, scope.index)">ç¼è¾</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleView(scope.row, scope.index)">å é¤</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleView(scope.row, scope.index)">äº§çæºåºåä¼ æºææ </el-button> |
| | | </template> |
| | | |
| | | <template #status="{ row }"> |
| | | <span>{{ row.status=="1"?"å¯ç¨":"ç¦ç¨" }}</span> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog title="ç¼è¾" append-to-body v-model="editBox" width="60%"> |
| | | <avue-form ref="editFormModal" :option="editFormModal" v-model="form" @submit="formSubmit" /> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | var that = this; |
| | | return { |
| | | editBox: false, |
| | | search: { |
| | | keyword: "", |
| | | machineGroupCode: "" |
| | | }, |
| | | loading: true, |
| | | mypage: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | option: { |
| | | index: true, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | labelWidth: 120, |
| | | emptyBtn: false, |
| | | searchSpan: 8, |
| | | column: [ |
| | | { |
| | | label: 'ç¼å·/åç§°', |
| | | type: 'input', |
| | | prop: 'keyword', |
| | | search: true, |
| | | hide: true |
| | | }, |
| | | { |
| | | label: 'æºåºç¼å·', |
| | | prop: 'code' |
| | | }, |
| | | { |
| | | label: 'æºåºåå·', |
| | | prop: 'name', |
| | | }, |
| | | { |
| | | label: 'æºåºç»', |
| | | prop: 'machineGroupName', |
| | | search: true, |
| | | type: 'select', |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | }, |
| | | span: "8" |
| | | }, |
| | | { |
| | | label: 'æºåºç±»å', |
| | | prop: 'machineSpecName', |
| | | }, |
| | | { |
| | | label: 'ç产åå', |
| | | prop: 'manufacturer', |
| | | }, |
| | | { |
| | | label: 'æä½å', |
| | | prop: 'operator', |
| | | }, |
| | | { |
| | | label: 'ç¶æ', |
| | | prop: 'status', |
| | | slot: true, |
| | | }, |
| | | ], |
| | | }, |
| | | editFormModal: { |
| | | labelWidth: 160, |
| | | submitBtn: true, |
| | | submitText: "ä¿å", |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'æºåºç¼å·', |
| | | prop: 'code', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'æºåºåå·', |
| | | prop: '', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'æºåºç±»å', |
| | | prop: '', |
| | | type: 'select', |
| | | span: 12, |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | } |
| | | }, |
| | | { |
| | | label: 'æå±æºåºç»', |
| | | prop: '', |
| | | type: 'select', |
| | | span: 12, |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | } |
| | | }, |
| | | { |
| | | label: 'æä½å', |
| | | prop: '', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'æå±ç»ç»', |
| | | prop: '', |
| | | type: 'select', |
| | | span: 12, |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç产å', |
| | | prop: '', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: '轮询æ¶é´ï¼å°æ¶ï¼', |
| | | prop: '', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'ç³»ç»æ§å¶', |
| | | prop: '', |
| | | type: 'select', |
| | | span: 12, |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_control_system', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç¶æ', |
| | | prop: 'checkbox', |
| | | type: 'checkbox', |
| | | span: 12, |
| | | dicData: [{ |
| | | label: 'å¯ç¨', |
| | | value: 1 |
| | | }] |
| | | }, |
| | | { |
| | | label: 'ç¨åºä¸åç®å½', |
| | | prop: '', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'ç¨åºåä¼ ç®å½', |
| | | prop: '', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: '', |
| | | type: 'textarea', |
| | | span: 24, |
| | | dataType: 'string', |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleEdit() { |
| | | this.editBox = true; |
| | | }, |
| | | formSubmit() { |
| | | |
| | | }, |
| | | handleView() { |
| | | |
| | | }, |
| | | searchReset() { |
| | | //this.onLoad(this.mypage); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.mypage.current = 1; |
| | | this.onLoad(); |
| | | done(); |
| | | }, |
| | | currentChange(current) { |
| | | this.mypage.current = current; |
| | | }, |
| | | sizeChange(size) { |
| | | this.mypage.size = size; |
| | | }, |
| | | refreshChange() { |
| | | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | var obj = { |
| | | keyword: this.search.keyword, |
| | | machineGroupCode: this.search.machineGroupCode, |
| | | current: this.mypage.current, |
| | | size: this.mypage.size, |
| | | } |
| | | axios({ |
| | | url: '/blade-mdm/machine/page', |
| | | method: 'get', |
| | | date: obj, |
| | | }).then( |
| | | res => { |
| | | const data = res.data.data; |
| | | this.mypage.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }, |
| | | error => { |
| | | |
| | | } |
| | | ); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | </style> |