|
|
@ -3,6 +3,13 @@ |
|
|
|
<!--工具栏--> |
|
|
|
<div class="head-container"> |
|
|
|
<crudOperation :permission="permission"> |
|
|
|
<template v-slot:right> |
|
|
|
<!-- 搜索 --> |
|
|
|
<el-input v-model="query.blurry" size="small" clearable placeholder="请输入关键词" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> |
|
|
|
<span> |
|
|
|
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="crud.toQuery" /> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
<template v-slot:rightButtonGroup> |
|
|
|
<div class="crud-opts-right"> |
|
|
|
<el-button size="mini" type="primary">装盒</el-button> |
|
|
@ -19,7 +26,7 @@ |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-form ref="form" :model="form" size="small" label-width="80px"> |
|
|
|
<el-form ref="form" :model="form" rules="rules" size="small" label-width="80px"> |
|
|
|
<!-- <el-form-item label="字典名称" prop="dicName"> |
|
|
|
<el-input v-model="form.dicName" style="width: 370px;" /> |
|
|
|
</el-form-item> |
|
|
@ -50,7 +57,7 @@ |
|
|
|
<el-table ref="table" v-loading="crud.loading || getTableDisplayFieldsLoading" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @row-click="clickRowHandler"> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center" /> |
|
|
|
<!-- :align="field.isDisplayAlign" :width="field.isDisplayWidth" --> |
|
|
|
<!-- :align="field.displayformatType" :width="field.displayformatWidth" --> |
|
|
|
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" show-overflow-tooltip> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row[field.fieldName] }} |
|
|
@ -63,10 +70,11 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { add, edit, getTableDisplayFields } from '@/api/archivesManage/archivesList' |
|
|
|
import { add, edit, getTableDisplayFields, getFormDisplayFields } from '@/api/archivesManage/archivesList' |
|
|
|
import CRUD, { presenter, header, form } from '@crud/crud' |
|
|
|
import crudOperation from '@crud/CRUD.operation' |
|
|
|
import pagination from '@crud/Pagination' |
|
|
|
const defaultForm = {} |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { crudOperation, pagination }, |
|
|
@ -96,7 +104,7 @@ export default { |
|
|
|
// form(function() { |
|
|
|
// return Object.assign({ dicPid: this.dicPid }, defaultForm) |
|
|
|
// }) |
|
|
|
form() |
|
|
|
form(defaultForm) |
|
|
|
], |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -118,11 +126,13 @@ export default { |
|
|
|
deleteVisible: false, |
|
|
|
deleteData: {}, |
|
|
|
tableDisplayFields: [], |
|
|
|
getTableDisplayFieldsLoading: false |
|
|
|
getTableDisplayFieldsLoading: false, |
|
|
|
formPreviewData: [], |
|
|
|
rules: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
beforeCrudRefresh() { |
|
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
|
this.getTableDisplayFieldsLoading = true |
|
|
|
// 请求数据 |
|
|
|
getTableDisplayFields({ categoryId: 'FFAFBB1647D459C82080A' }).then(data => { |
|
|
@ -131,16 +141,30 @@ export default { |
|
|
|
return true |
|
|
|
}) |
|
|
|
}, |
|
|
|
// [CRUD.HOOK.afterDelete]() { |
|
|
|
// this.needRefreshTree = true |
|
|
|
// }, |
|
|
|
[CRUD.HOOK.beforeToCU]() { |
|
|
|
getFormDisplayFields({ categoryId: 'FFAFBB1647D459C82080A' }).then(data => { |
|
|
|
this.formPreviewData = data.showFiled |
|
|
|
this.formPreviewData.map(item => { |
|
|
|
this.rules[item.fieldName] = [ |
|
|
|
{ |
|
|
|
required: item.isRequired === 1, |
|
|
|
message: (item.isInputClass === 'text' ? '请输入' : '请选择') + item.fieldCnName, |
|
|
|
trigger: item.isInputClass === 'text' ? 'blur' : 'change' |
|
|
|
} |
|
|
|
] |
|
|
|
if (item.isDefaultValue) { |
|
|
|
this.crud.defaultForm[item.fieldName] = item.isDefaultValue |
|
|
|
} |
|
|
|
}) |
|
|
|
return true |
|
|
|
}) |
|
|
|
}, |
|
|
|
// // 获取数据前设置默认参数 |
|
|
|
// [CRUD.HOOK.beforeRefresh]() { |
|
|
|
// this.crud.query.id = this.dicPid |
|
|
|
// }, |
|
|
|
// [CRUD.HOOK.afterRefresh](crud) { |
|
|
|
// if (this.needRefreshTree) { |
|
|
|
// this.needRefreshTree = false |
|
|
|
// this.$emit('treeRefresh', crud.data) |
|
|
|
// } |
|
|
|
// }, |
|
|
@ -158,7 +182,6 @@ export default { |
|
|
|
done() |
|
|
|
}, |
|
|
|
clickRowHandler(row) { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
} |
|
|
|
} |
|
|
@ -166,4 +189,7 @@ export default { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
|
::v-deep .filter-item input{ |
|
|
|
margin-left: 10px; |
|
|
|
} |
|
|
|
</style> |