This commit is contained in:
Fanzink
2023-02-09 15:06:33 +08:00
parent 41e680b55d
commit 0b5740d41c
6 changed files with 697 additions and 245 deletions

View File

@@ -4,9 +4,8 @@
:title="isDetail ? $t('ws.detail') : !dataForm.id ? $t('add') : $t('edit')"
:visible.sync="visible"
:close-on-click-modal="false"
:destroy-on-close="true"
>
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden;">
:destroy-on-close="true">
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden">
<el-form ref="dataForm" :model="dataForm" :rules="dataFormRules">
<el-row :gutter="20">
<el-col :span="12"
@@ -49,8 +48,7 @@
:table-head-configs="tableProps"
:max-height="calcMaxHeight(8)"
@operate-event="handleOperations"
@refreshDataList="getDataList"
/>
@refreshDataList="getDataList" />
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
@@ -58,16 +56,31 @@
:page-sizes="[5, 10, 15, 20]"
:page-size="limit"
:total="eqTotal"
layout="total, sizes, prev, pager, next, jumper"
/>
layout="total, sizes, prev, pager, next, jumper" />
</div>
<attr-form v-else ref="AttrFrom" :workshop-section-id="dataForm.id" @close-attr-form="showAttrForm = false" @refresh-list="handleRefreshList" />
</section>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClick({ name: 'cancel' })">{{ $t('cancel') }}</el-button>
<el-button type="primary" v-if="dataForm.id" @click="handleClick({ name: 'update' })">{{ $t('update') }}</el-button>
<el-button type="success" v-else @click="handleClick({ name: 'save' })">{{ $t('save') }}</el-button>
<el-button
:style="{
backgroundColor: '#0b58ff',
color: '#fff'
}"
v-if="dataForm.id"
@click="handleClick({ name: 'update' })"
>{{ $t('update') }}</el-button
>
<el-button
:style="{
backgroundColor: '#0b58ff',
color: '#fff'
}"
v-else
@click="handleClick({ name: 'save' })"
>{{ $t('save') }}</el-button
>
</span>
</el-dialog>
</template>
@@ -292,7 +305,7 @@ export default {
}
},
handleCreateOrUpdate() {
this.$refs['dataForm'].validate(valid => {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/monitoring/workshopSection'),