Browse Source

档案门类管理

master
xuhuajiao 2 years ago
parent
commit
a2a370b80c
  1. 9
      src/assets/styles/mixin.scss
  2. 31
      src/assets/styles/yxk-admin.scss
  3. 180
      src/views/system/dict/dictDetail.vue
  4. 2
      src/views/system/dict/index.vue

9
src/assets/styles/mixin.scss

@ -320,6 +320,15 @@
} }
} }
@mixin tab_height_min{
[data-theme="dark"] & {
min-height: calc(100vh - 200px);
}
[data-theme="light"] & {
min-height: calc(100vh - 178px);
}
}
@mixin input_style{ @mixin input_style{
[data-theme="dark"] & { [data-theme="dark"] & {
border: 1px solid $mainColor; border: 1px solid $mainColor;

31
src/assets/styles/yxk-admin.scss

@ -5,6 +5,9 @@
@include box_padding; @include box_padding;
.head-container{ .head-container{
margin-bottom: 20px; margin-bottom: 20px;
.crud-opts{
justify-content: center;
}
} }
.container-left{ .container-left{
@include tree_height_min; @include tree_height_min;
@ -18,6 +21,9 @@
} }
.container-right{ .container-right{
@include table_height_min; @include table_height_min;
&.tab-content{
@include tab_height_min;
}
} }
} }
@ -32,12 +38,24 @@
.elect-cont-right{ .elect-cont-right{
width: calc(100vw - 379px); width: calc(100vw - 379px);
} }
.category-container{
.elect-cont-right{
width: calc(100vw - 482px);
}
}
} }
.openSidebar{ .openSidebar{
// siderbar-展开 256 + 间距 60 + treeLeft 265 // siderbar-展开 256 + 间距 60 + treeLeft 265
.elect-cont-right{ .elect-cont-right{
width: calc(100vw - 581px); width: calc(100vw - 581px);
} }
.category-container{
.elect-cont-right{
width: calc(100vw - 684px);
}
}
} }
.row-container{ .row-container{
@ -52,6 +70,10 @@
.tab-container{ .tab-container{
@include bg_color; @include bg_color;
@include box_padding; @include box_padding;
}
.tab-container,
.category-container{
.tab-content{ .tab-content{
position: relative; position: relative;
@include row_tab_style; @include row_tab_style;
@ -62,6 +84,15 @@
} }
} }
.category-container{
.elect-cont-left{
width: 368px;
}
.elect-cont-right{
margin-top: 0;
}
}
.head-container { .head-container {
.filter-item { .filter-item {
vertical-align: middle; vertical-align: middle;

180
src/views/system/dict/dictDetail.vue

@ -1,180 +0,0 @@
<template>
<div>
<!--工具栏-->
<div class="head-container" style="padding:0 0 20px 0">
<crudOperation :permission="permission">
<template v-slot:left>
<el-button v-permission="permission.add" size="mini" type="primary" icon="el-icon-plus" :disabled="!activeAddBtn" @click="crud.toAdd">新增</el-button>
</template>
<template v-slot:right>
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">删除</el-button>
</template>
</crudOperation>
</div>
<!--表单组件-->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<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>
<el-form-item label="字典代码" prop="dicCode">
<el-input v-model="form.dicCode" style="width: 370px;" />
</el-form-item>
<el-form-item label="内容说明" prop="dicExplain">
<el-input v-model="form.dicExplain" style="width: 370px;" type="textarea" :rows="4" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</div>
</el-dialog>
<el-dialog title="删除字典内容" :visible.sync="deleteVisible" :before-close="handleClose">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<div class="dialog-delt">
<p><span>确定删除当前字典内容吗</span></p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="handleConfirm">确定</el-button>
</div>
</div>
</el-dialog>
<div class="container-right" style="min-height: calc(100vh - 242px);">
<span class="right-top-line" />
<span class="left-bottom-line" />
<!--表格渲染-->
<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 prop="dicName" label="字典名称" />
<el-table-column prop="dicCode" label="字典代码" />
<el-table-column prop="dicExplain" label="内容说明" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudDictDetail from '@/api/archivesConfig/dictDetail'
import CRUD, { presenter, header, form } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
const defaultForm = { id: null, dicName: null, dicCode: null, dicExplain: null, dicType: false }
export default {
components: { crudOperation, pagination },
cruds() {
return [
CRUD({
title: '字典内容', url: 'api/dictrionary/findSubsetById', query: { id: '' },
crudMethod: { ...crudDictDetail },
optShow: {
add: false,
edit: true,
del: false,
reset: false,
download: false,
group: false
},
queryOnPresenterCreated: false,
sort: ['dicSequence,asc']
})
]
},
mixins: [
presenter(),
header(),
form(function() {
return Object.assign({ dicPid: this.dicPid }, defaultForm)
})
],
props: {
activeAddBtn: {
type: Boolean
}
},
data() {
return {
dicPid: null,
needRefreshTree: false,
rules: {
dicName: [
{ required: true, message: '请输入字典名称', trigger: 'blur' }
],
dicCode: [
{ required: true, message: '请输入字典代码', trigger: 'blur' }
]
},
permission: {
add: ['admin', 'dict:add'],
edit: ['admin', 'dict:edit'],
del: ['admin', 'dict:del']
},
deleteVisible: false,
deleteData: {}
}
},
methods: {
[CRUD.HOOK.afterSubmit]() {
this.needRefreshTree = true
},
[CRUD.HOOK.afterDelete]() {
this.needRefreshTree = 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)
}
},
clickRowHandler(row) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row)
},
selectionChangeHandler(val) {
if (val.length > 1) {
// val
const finalVal = val.pop()
//
this.$refs.table.clearSelection()
//
this.$refs.table.toggleRowSelection(finalVal)
this.crud.selectionChangeHandler([finalVal])
} else {
this.crud.selectionChangeHandler(val)
}
},
toDelete(data) {
this.deleteData = data
this.deleteVisible = true
},
handleConfirm() {
this.deleteVisible = false
this.crud.delAllLoading = true
this.crud.doDelete(this.deleteData)
},
handleClose(done) {
this.deleteData = {}
done()
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep thead .el-table-column--selection .cell {
display: none;
}
</style>

2
src/views/system/dict/index.vue

@ -120,7 +120,7 @@ import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
const defaultForm = { id: null, dicName: null, isTop: '1', dicCode: null, sequence: 999, dicExplain: null, dicType: false, dicPid: null } const defaultForm = { id: null, dicName: null, isTop: '1', dicCode: null, sequence: 999, dicExplain: null, dicType: false, dicPid: null }
export default { export default {
name: 'Dict',
name: 'Dicts',
components: { crudOperation, Treeselect }, components: { crudOperation, Treeselect },
cruds() { cruds() {
return [ return [

Loading…
Cancel
Save