Browse Source

字典管理接口修改

master
z_yu 3 years ago
parent
commit
a84847c369
  1. 4
      src/components/Crud/crud.js
  2. 25
      src/views/archivesConfig/dict/dictDetail.vue
  3. 13
      src/views/archivesConfig/dict/index.vue

4
src/components/Crud/crud.js

@ -138,7 +138,7 @@ function CRUD(options) {
table.store.states.treeData = {} table.store.states.treeData = {}
table.store.states.lazyTreeNodeMap = {} table.store.states.lazyTreeNodeMap = {}
} }
crud.page.total = data.totalElements
crud.page.total = data.totalElements ? data.totalElements : data.length
crud.data = data.content ? data.content : data crud.data = data.content ? data.content : data
crud.resetDataStatus() crud.resetDataStatus()
// time 毫秒后显示表格 // time 毫秒后显示表格
@ -349,7 +349,7 @@ function CRUD(options) {
if (crud.params[item] === null || crud.params[item] === '') crud.params[item] = undefined if (crud.params[item] === null || crud.params[item] === '') crud.params[item] = undefined
}) })
return { return {
page: crud.page.page,
page: crud.page.page - 1,
size: crud.page.size, size: crud.page.size,
sort: crud.sort, sort: crud.sort,
...crud.query, ...crud.query,

25
src/views/archivesConfig/dict/dictDetail.vue

@ -15,14 +15,14 @@
<span class="dialog-left-bottom" /> <span class="dialog-left-bottom" />
<div class="setting-dialog"> <div class="setting-dialog">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="字典名称" prop="dic_name">
<el-input v-model="form.dic_name" style="width: 370px;" />
<el-form-item label="字典名称" prop="dicName">
<el-input v-model="form.dicName" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="字典代码" prop="dic_code">
<el-input v-model="form.dic_code" style="width: 370px;" />
<el-form-item label="字典代码" prop="dicCode">
<el-input v-model="form.dicCode" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="内容说明" prop="dic_explain">
<el-input v-model="form.dic_explain" style="width: 370px;" type="textarea" :rows="4" />
<el-form-item label="内容说明" prop="dicExplain">
<el-input v-model="form.dicExplain" style="width: 370px;" type="textarea" :rows="4" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -34,9 +34,9 @@
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="selectionChangeHandler" @row-click="clickRowHandler"> <el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="selectionChangeHandler" @row-click="clickRowHandler">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="dic_name" label="字典名称" />
<el-table-column prop="dic_code" label="字典代码" />
<el-table-column prop="dic_explain" label="内容说明" />
<el-table-column prop="dicName" label="字典名称" />
<el-table-column prop="dicCode" label="字典代码" />
<el-table-column prop="dicExplain" label="内容说明" />
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />
@ -50,7 +50,7 @@ import CRUD, { presenter, header, form } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
const defaultForm = { id: null, dic_name: null, dic_code: null, dic_explain: null, dic_type: false }
const defaultForm = { id: null, dicName: null, dicCode: null, dicExplain: null, dicType: false }
export default { export default {
components: { crudOperation, pagination }, components: { crudOperation, pagination },
@ -67,7 +67,8 @@ export default {
download: false, download: false,
group: false group: false
}, },
queryOnPresenterCreated: false
queryOnPresenterCreated: false,
sort: ['dic_sequence,asc']
}) })
] ]
}, },
@ -75,7 +76,7 @@ export default {
presenter(), presenter(),
header(), header(),
form(function() { form(function() {
return Object.assign({ dic_pid: this.dicPid }, defaultForm)
return Object.assign({ dicPid: this.dicPid }, defaultForm)
})], })],
props: { props: {
activeAddBtn: { activeAddBtn: {

13
src/views/archivesConfig/dict/index.vue

@ -38,7 +38,7 @@
<el-card class="box-card"> <el-card class="box-card">
<span class="right-top-line" /> <span class="right-top-line" />
<span class="left-bottom-line" /> <span class="left-bottom-line" />
<dictDetail ref="dictDetail" :permission="permission" :active-add-btn="activeAddBtn" @treeRefresh="treeRefresh" />
<dictDetail ref="dictDetail" :permission="permission" :active-add-btn="activeAddBtn" @treeRefresh="updateKeyChildren" />
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
@ -67,7 +67,8 @@ export default {
del: true, del: true,
download: false, download: false,
group: false group: false
}
},
sort: ['dic_sequence,asc']
}) })
] ]
}, },
@ -125,17 +126,19 @@ export default {
// //
form.dictDetails = null form.dictDetails = null
}, },
treeRefresh() {
updateKeyChildren() {
this.crud.refresh() this.crud.refresh()
console.log(this.crud.selections[0])
// this.$refs.tree.updateKeyChildren(this.crud.selections[0])
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card{
.el-card {
min-height: calc(100vh - 210px); min-height: calc(100vh - 210px);
.crud-opts{
.crud-opts {
padding: 20px 0; padding: 20px 0;
} }
} }

Loading…
Cancel
Save