¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | |
| | | <!-- <a-tabs v-model="activeKey" @change="handleChangeTabs">--> |
| | | <!--主表åºå --> |
| | | <!-- <a-tab-pane tab="设å¤åå¨" :key="refKeys[0]" :forceRender="true" :class="'jeecg-tabs-top'" :animated="false">--> |
| | | <j-form-container :disabled="formDisabled"> |
| | | <!-- 主表ååºå --> |
| | | <a-form-model |
| | | ref="form" |
| | | :model="model" |
| | | :rules="validatorRules" |
| | | slot="detail" |
| | | > |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="åæ®å·" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="num" |
| | | > |
| | | <a-input |
| | | v-model="model.num" |
| | | placeholder="请è¾å
¥åæ®å·" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col |
| | | :span="12" |
| | | :hidden=true |
| | | > |
| | | <a-form-model-item |
| | | label="å卿¹å¼" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="changeMethod" |
| | | > |
| | | <a-input |
| | | v-model="model.changeMethod" |
| | | placeholder="请è¾å
¥å卿¹å¼" |
| | | defaultValue="seal" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="夿³¨" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="remark" |
| | | > |
| | | <a-textarea |
| | | v-model="model.remark" |
| | | rows="4" |
| | | placeholder="请è¾å
¥å¤æ³¨" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | <!-- </a-tab-pane>--> |
| | | |
| | | <!-- <a-button--> |
| | | <!-- type="primary"--> |
| | | <!-- :style="{ marginRight: '8px',marginBottom:'8px' }"--> |
| | | <!-- :loading="confirmLoading"--> |
| | | <!-- @click="selectEquipmentList()"--> |
| | | <!-- >éæ©è®¾å¤--> |
| | | <!-- </a-button>--> |
| | | |
| | | <!--å表ååºå --> |
| | | <!-- <a-tab-pane tab="è®¾å¤æ¥åºæç»" :key="refKeys[1]" :forceRender="true">--> |
| | | <!-- <j-editable-table--> |
| | | <!-- :ref="refKeys[1]"--> |
| | | <!-- :loading="equipmentScrapDetailTable.loading"--> |
| | | <!-- :columns="equipmentScrapDetailTable.columns"--> |
| | | <!-- :dataSource="equipmentScrapDetailTable.dataSource"--> |
| | | <!-- :maxHeight="800"--> |
| | | <!-- :rowNumber="true"--> |
| | | <!-- :rowSelection="true"--> |
| | | <!-- :actionButton="false">--> |
| | | |
| | | |
| | | <!-- <template v-slot:action="props">--> |
| | | <!-- <a @click="handleDelete(props)">å é¤</a>--> |
| | | <!-- </template>--> |
| | | <!-- </j-editable-table>--> |
| | | <!-- </a-tab-pane>--> |
| | | |
| | | <a-tabs v-model="activeKey" @change="handleChangeTabs"> |
| | | <a-tab-pane tab="è®¾å¤æ¥åºæç»" :key="refKeys[0]" :forceRender="true"> |
| | | <j-vxe-table |
| | | keep-source |
| | | :ref="refKeys[0]" |
| | | :loading="equipmentScrapDetailTable.loading" |
| | | :columns="equipmentScrapDetailTable.columns" |
| | | :dataSource="equipmentScrapDetailTable.dataSource" |
| | | :maxHeight="900" |
| | | :disabled="formDisabled" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :alwaysEdit="true" |
| | | :bordered="true" |
| | | :toolbar="true" |
| | | :toolbarConfig="toolbarConfig" |
| | | > |
| | | <!-- 设å¤å¾çææ§½ --> |
| | | <template v-slot:equipmentPhoto='props'> |
| | | <Tooltip |
| | | placement="top" |
| | | title="é¢è§å¾ç" |
| | | > |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="props.rowId" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </Tooltip> |
| | | </template> |
| | | <template v-slot:action="props"> |
| | | <a-popconfirm title="ç¡®å®å é¤åï¼" @confirm="handleDL(props)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </template> |
| | | |
| | | <template slot="toolbarPrefix"> |
| | | <a-button type="primary" @click="selectEquipmentList" :disabled="formDisabled">éæ©è®¾å¤ |
| | | </a-button> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <equipment-select-modal ref="EquipmentSelectModal"></equipment-select-modal> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | // import { FormTypes, getRefPromise } from '@/utils/JEditableTableUtil' |
| | | import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin' |
| | | import { randomUUID, randomNumber } from '@/utils/util' |
| | | // import JEditableTable from '@/components/jeecg/JEditableTable' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | // import { VALIDATE_NO_PASSED, validateFormModelAndTables } from '@/utils/JEditableTableUtil' |
| | | import pick from 'lodash.pick' |
| | | import { getAction, postAction, requestPut } from '@api/manage' |
| | | import EquipmentSelectModal from './EquipmentSelectModal.vue' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' |
| | | |
| | | import JFormContainer from '@/components/jeecg/JFormContainer' |
| | | export default { |
| | | name: 'EquipmentScrapForm', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | EquipmentSelectModal, |
| | | JFormContainer |
| | | }, |
| | | data() { |
| | | return { |
| | | changeMethod: 'scrap', |
| | | toolbarConfig: { |
| | | // prefix åç¼ï¼suffix åç¼ |
| | | slot: ['prefix', 'suffix'], |
| | | // add æ°å¢æé®ï¼remove å 餿é®ï¼clearSelection æ¸
ç©ºéæ©æé® |
| | | btn: ['remove', 'clearSelection'] |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 3 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | // æ°å¢æ¶å表é»è®¤æ·»å å è¡ç©ºæ°æ® |
| | | addDefaultRowNum: 0, |
| | | model: {}, |
| | | validatorRules: { |
| | | num: [ |
| | | { required: true, message: '请è¾å
¥åæ®å·!' }, |
| | | { validator: (rule, value, callback) => validateDuplicateValue('mom_eam_equipment_change', 'num', value, this.model.id, callback) } |
| | | ], |
| | | remark: [ |
| | | { required: false, message: '请è¾å
¥å¤æ³¨!' } |
| | | ] |
| | | }, |
| | | refKeys: ['equipmentScrapDetail'], |
| | | tableKeys: ['equipmentScrapDetail'], |
| | | activeKey: 'equipmentScrapDetail', |
| | | // è®¾å¤æ¥åºæç» |
| | | equipmentScrapDetailTable: { |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | |
| | | // { |
| | | // title: 'æä½', |
| | | // key: 'action', |
| | | // width: '60px', |
| | | // type: FormTypes.slot, // å®ä¹è¯¥å为 èªå®ä¹æå¼å |
| | | // slotName: 'action' // slot çåç§°ï¼å¯¹åº v-slot åå·åé¢åçå·åé¢çå
容 |
| | | // }, |
| | | { |
| | | title: 'è®¾å¤æ¥åºåæç»id', |
| | | key: 'id', |
| | | type: JVXETypes.hidden, |
| | | width: '100px', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: '设å¤åå¨åid', |
| | | key: 'equipmentChangeId', |
| | | type: JVXETypes.hidden, |
| | | width: '200px', |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: '设å¤ID', |
| | | key: 'equipmentId', |
| | | type: JVXETypes.hidden, |
| | | disabled: true, |
| | | width: '60px', |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: '设å¤ç¼ç ', |
| | | key: 'equipmentNum', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | key: 'equipmentName', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | |
| | | { |
| | | title: '设å¤åå·', |
| | | key: 'model', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: '设å¤è§æ ¼', |
| | | key: 'specification', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: '设å¤ç¶æ', |
| | | key: 'equipmentStatus_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '195px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: 'èµäº§ç¼ç ', |
| | | key: 'assetNumber', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '195px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: 'æ¥åºæ¥æ', |
| | | key: 'scrapDate', |
| | | type: JVXETypes.datetime, |
| | | width: '200px', |
| | | placeholder: 'è¯·éæ©${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | // fixed: 'left', |
| | | // 表åéªè¯è§å |
| | | validateRules: [ |
| | | { |
| | | required: true, // å¿
å¡« |
| | | message: '${title}ä¸è½ä¸ºç©º' // æç¤ºçææ¬ |
| | | }] |
| | | }, |
| | | { |
| | | title: 'æ¥åºåå ', |
| | | key: 'scrapReason', |
| | | type: JVXETypes.input, |
| | | width: '195px', |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | // fixed: 'left', |
| | | // 表åéªè¯è§å |
| | | validateRules: [ |
| | | { |
| | | required: true, // å¿
å¡« |
| | | message: '${title}ä¸è½ä¸ºç©º' // æç¤ºçææ¬ |
| | | }] |
| | | }, |
| | | { |
| | | title: 'ç¹ç§è®¾å¤', |
| | | key: 'specificEquipment', |
| | | type: JVXETypes.hidden, |
| | | align:'center', |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: 'ç¹ç§è®¾å¤', |
| | | key: 'specificEquipment_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | // { |
| | | // title: '设å¤ç¶æ', |
| | | // key: 'equipmentStatus', |
| | | // type: JVXETypes.select, |
| | | // options: [], |
| | | // dictCode: 'equipment_status', |
| | | // disabled: true, |
| | | // width: '200px', |
| | | // // placeholder: '请è¾å
¥${title}', |
| | | // defaultValue: '' |
| | | // }, |
| | | { |
| | | title: 'ææ¯ç¶æ', |
| | | key: 'technologyStatus_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | |
| | | { |
| | | title: '设å¤ä½ç½®', |
| | | key: 'location', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | { |
| | | title: 'éè¦åº¦', |
| | | key: 'equipmentImportanceId_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | // placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | }, |
| | | // { |
| | | // title: 'éè¦åº¦', |
| | | // key: 'equipmentImportanceId', |
| | | // type: JVXETypes.hidden, |
| | | // disabled: true, |
| | | // width: '200px', |
| | | // // placeholder: '请è¾å
¥${title}', |
| | | // defaultValue: '' |
| | | // }, |
| | | // { |
| | | // title: '设å¤å¾ç', |
| | | // key: 'equipmentPhoto', |
| | | // type: JVXETypes.normal, |
| | | // width: '200px', |
| | | // // placeholder: '请è¾å
¥${title}', |
| | | // defaultValue: '' |
| | | // } |
| | | // { |
| | | // title: '设å¤å¾ç', |
| | | // key: 'equipmentPhoto', |
| | | // type: JVXETypes.slot, |
| | | // disabled: true, |
| | | // width: '200px', |
| | | // slotName:'equipmentPhoto', |
| | | // align:'center', |
| | | |
| | | // }, |
| | | // { |
| | | // title: 'æä½', |
| | | // key: 'action', |
| | | // type: JVXETypes.slot, |
| | | // disabled: true, |
| | | // width: '100px', |
| | | // slotName: 'action', |
| | | // }, |
| | | |
| | | ] |
| | | }, |
| | | |
| | | url: { |
| | | add: '/eam/equipmentScrap/add', |
| | | edit: '/eam/equipmentScrap/edit', |
| | | equipmentChange: { |
| | | list: '/eam/equipmentScrap/queryById' |
| | | }, |
| | | equipmentScrapDetail: { |
| | | list: '/eam/equipmentScrap/listEquipmentScrapDetailByMainId' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled() { |
| | | return this.disabled |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | // å¢å éä¸ç设å¤å°åè¡¨ä¸ |
| | | this.addSelectedEquipments(data) |
| | | |
| | | }) |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | |
| | | //éæ©è®¾å¤ |
| | | selectEquipmentList() { |
| | | let ids = [] |
| | | let tableData = this.$refs.equipmentScrapDetail.getTableData() |
| | | let deleteData = this.$refs.equipmentScrapDetail.getDeleteData() |
| | | for (let i = 0; i < tableData.length; i++) { |
| | | ids.push(tableData[i].equipmentId) |
| | | } |
| | | this.$refs.EquipmentSelectModal.showModals(ids) |
| | | this.$refs.EquipmentSelectModal.title = 'éæ©è®¾å¤' |
| | | this.$refs.EquipmentSelectModal.disableSubmit = false |
| | | }, |
| | | addSelectedEquipments(data) { |
| | | let tableData = this.$refs.equipmentScrapDetail.getTableData() |
| | | // const seletedEquipmentIds = tableData. |
| | | var tableStr = JSON.stringify(tableData) |
| | | const addRows = [] |
| | | for (let i = 0; i < data.length; i++) { |
| | | var scrapDetail = {} |
| | | if (tableStr.indexOf(data[i].id)==-1) { |
| | | scrapDetail = { |
| | | equipmentId: data[i].id, |
| | | equipmentNum: data[i].num, |
| | | equipmentName: data[i].name, |
| | | assetNumber: data[i].assetNumber, |
| | | specificEquipment_dictText: data[i].specificEquipment_dictText, |
| | | specificEquipment: data[i].specificEquipment, |
| | | model: data[i].model, |
| | | specification: data[i].specification, |
| | | equipmentStatus_dictText: data[i].equipmentStatus_dictText, |
| | | equipmentStatus: data[i].equipmentStatus, |
| | | technologyStatus_dictText: data[i].technologyStatus_dictText, |
| | | technologyStatus: data[i].technologyStatus, |
| | | equipmentPhoto: data[i].equipmentPhoto, |
| | | location: data[i].location, |
| | | equipmentImportanceId_dictText: data[i].equipmentImportanceId_dictText, |
| | | equipmentImportanceId: data[i].equipmentImportanceId |
| | | } |
| | | } |
| | | addRows.push(scrapDetail) |
| | | } |
| | | |
| | | this.$refs.equipmentScrapDetail.pushRows(addRows) |
| | | }, |
| | | handleDL(props) { |
| | | // è°ç¨å 餿¹æ³ |
| | | props.target.removeRows(props.row) |
| | | }, |
| | | addBefore() { |
| | | this.equipmentScrapDetailTable.dataSource = [] |
| | | }, |
| | | getAllTable() { |
| | | let values = this.tableKeys.map(key => getRefPromise(this, key)) |
| | | return Promise.all(values) |
| | | }, |
| | | /** è°ç¨å®edit()æ¹æ³ä¹åä¼èªå¨è°ç¨æ¤æ¹æ³ */ |
| | | editAfter() { |
| | | this.$nextTick(() => { |
| | | }) |
| | | // å è½½åè¡¨æ°æ® |
| | | if (this.model.id) { |
| | | let params = { equipmentChangeId: this.model.id } |
| | | this.requestSubTableData(this.url.equipmentScrapDetail.list, params, this.equipmentScrapDetailTable) |
| | | } |
| | | }, |
| | | //æ ¡éªææä¸å¯¹ä¸å表表å |
| | | validateSubForm(allValues) { |
| | | return new Promise((resolve, reject) => { |
| | | Promise.all([]).then(() => { |
| | | resolve(allValues) |
| | | }).catch(e => { |
| | | if (e.error === VALIDATE_FAILED) { |
| | | // å¦æææªéè¿è¡¨åéªè¯çå表ï¼å°±èªå¨è·³è½¬å°å®æå¨çtab |
| | | this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] |
| | | } else { |
| | | console.error(e) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | /** æ´çæformData */ |
| | | classifyIntoFormData(allValues) { |
| | | let main = Object.assign(this.model, allValues.formValue) |
| | | return { |
| | | ...main, // å±å¼ |
| | | equipmentScrapDetailList: allValues.tablesValue[0].tableData |
| | | } |
| | | }, |
| | | /** ç¡®å®æé®ç¹å»äºä»¶ */ |
| | | // handleOk() { |
| | | // /** 触å表åéªè¯ */ |
| | | // this.getAllTable().then(tables => { |
| | | // return validateFormModelAndTables(this.$refs.form, this.model, tables) |
| | | // }).then(allValues => { |
| | | // /** 䏿¬¡æ§éªè¯ä¸å¯¹ä¸çææå表 */ |
| | | // return this.validateSubForm(allValues) |
| | | // }).then(allValues => { |
| | | // if (typeof this.classifyIntoFormData !== 'function') { |
| | | // throw this.throwNotFunction('classifyIntoFormData') |
| | | // } |
| | | // console.log('this.classifyIntoFormData', typeof this.classifyIntoFormData) |
| | | // let formData = this.classifyIntoFormData(allValues) |
| | | // |
| | | // // åèµ·è¯·æ± |
| | | // return this.request(formData) |
| | | // }).catch(e => { |
| | | // if (e.error === VALIDATE_NO_PASSED) { |
| | | // // å¦æææªéè¿è¡¨åéªè¯çå表ï¼å°±èªå¨è·³è½¬å°å®æå¨çtab |
| | | // this.activeKey = e.index == null ? this.refKeys[0] : this.refKeys[e.index + 1] |
| | | // } else { |
| | | // console.error(e) |
| | | // } |
| | | // }) |
| | | // }, |
| | | validateError(msg) { |
| | | this.$message.error(msg) |
| | | }, |
| | | close() { |
| | | this.visible = false |
| | | this.$emit('close') |
| | | this.$refs.form.clearValidate() |
| | | }, |
| | | // ******************************************** |
| | | |
| | | /* a æ ç¾çç¹å»äºä»¶ï¼å é¤å½åéä¸çè¡ */ |
| | | handleDelete(props) { |
| | | // åæ°è§£é |
| | | // props.index ï¼å½åè¡ç䏿 |
| | | // props.text ï¼å½åå¼ï¼å¯è½æ¯defaultValueå®ä¹çå¼ï¼ä¹å¯è½æ¯ä»dataSourceä¸ååºçå¼ |
| | | // props.rowId ï¼å½åéä¸è¡çidï¼å¦ææ¯æ°å¢è¡åæ¯ä¸´æ¶id |
| | | // props.column ï¼å½åæä½çå |
| | | // props.getValue ï¼è¿æ¯ä¸ä¸ªfunctionï¼æ§è¡åå¯ä»¥è·åå½åè¡çææå¼ï¼ç¦æ¢å¨templateä¸ä½¿ç¨ï¼ |
| | | // ä¾ï¼const value = props.getValue() |
| | | // props.target ï¼è§¦åå½åäºä»¶çå®ä¾ï¼å¯ç´æ¥è°ç¨è¯¥å®ä¾å
çæ¹æ³ï¼ç¦æ¢å¨templateä¸ä½¿ç¨ï¼ |
| | | // ä¾ï¼target.add() |
| | | |
| | | // 使ç¨å®ä¾ï¼å é¤å½åæä½çè¡ |
| | | let { rowId, target } = props |
| | | target.removeRows(rowId) |
| | | }, |
| | | // éåadd æ¹æ³ é»è®¤ä¸å¢å ä¸è¡ |
| | | add(num = 0, forceScrollToBottom = false) { |
| | | if (num < 1) return |
| | | // let timestamp = new Date().getTime() |
| | | let rows = this.rows |
| | | let row |
| | | for (let i = 0; i < num; i++) { |
| | | rows = this.push({}, false, rows) |
| | | row = rows[rows.length - 1] |
| | | } |
| | | this.rows = rows |
| | | |
| | | this.$nextTick(() => { |
| | | this.updateFormValues() |
| | | }) |
| | | // 触åaddäºä»¶ |
| | | this.$emit('added', { |
| | | row: (() => { |
| | | let r = Object.assign({}, row) |
| | | r.id = this.getCleanId(r.id) |
| | | return r |
| | | })(), |
| | | target: this |
| | | }) |
| | | // 设置æ»å¨æ¡ä½ç½® |
| | | let tbody = this.getElement('tbody') |
| | | let offsetHeight = tbody.offsetHeight |
| | | let realScrollTop = tbody.scrollTop + offsetHeight |
| | | if (forceScrollToBottom) { |
| | | this.$nextTick(() => { |
| | | this.resetScrollTop(this.$refs.scrollView.scrollHeight) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /** tab panel 䏿䏿æ¡/æ¥æ è¿ç±»å¸¦ä¸æææçï¼éè¦å æ¤æ ·å¼ */ |
| | | /deep/ .jeecg-tabs-top { |
| | | overflow: visible; |
| | | } |
| | | </style> |