|
|
@@ -20,7 +20,10 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-dropdown trigger="click">
|
|
|
+ <el-dropdown
|
|
|
+ trigger="click"
|
|
|
+ v-if="$hasPermission('mian:businessCode:save')"
|
|
|
+ >
|
|
|
<el-button type="primary">
|
|
|
新建<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</el-button>
|
|
|
@@ -39,6 +42,7 @@
|
|
|
type="primary"
|
|
|
@click.native="openEdit('edit')"
|
|
|
:disabled="selection.length != 1"
|
|
|
+ v-if="$hasPermission('mian:businessCode:update')"
|
|
|
>
|
|
|
编辑
|
|
|
</el-button>
|
|
|
@@ -46,6 +50,7 @@
|
|
|
class="ele-action"
|
|
|
title="确定要删除吗?"
|
|
|
@confirm="remove()"
|
|
|
+ v-if="$hasPermission('mian:businessCode:delete')"
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
<el-button type="danger" :disabled="selection.length == 0">
|
|
|
@@ -68,168 +73,168 @@
|
|
|
></codeEdit>
|
|
|
</ele-pro-table>
|
|
|
</template>
|
|
|
-
|
|
|
- <script>
|
|
|
-import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
-import codeEdit from './components/codeEdit.vue';
|
|
|
-import TypeEdit from './components/typeEdit.vue';
|
|
|
|
|
|
-import { listParentId,removeCode } from '@/api/businessCode';
|
|
|
-export default {
|
|
|
- mixins: [tabMixins],
|
|
|
- components: {
|
|
|
- codeEdit,
|
|
|
- TypeEdit
|
|
|
- },
|
|
|
- props: {
|
|
|
- // 上级
|
|
|
- parentData: {
|
|
|
- type: Object,
|
|
|
- default: () => {}
|
|
|
- }
|
|
|
- },
|
|
|
+<script>
|
|
|
+ import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
+ import codeEdit from './components/codeEdit.vue';
|
|
|
+ import TypeEdit from './components/typeEdit.vue';
|
|
|
|
|
|
- data() {
|
|
|
- return {
|
|
|
- selection: [],
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'selection',
|
|
|
- columnKey: 'selection',
|
|
|
- align: 'center'
|
|
|
- // selectable: (row, index) => {
|
|
|
- // return !this.disabledTableList
|
|
|
- // .map((item) => item.id)
|
|
|
- // .includes(row.id);
|
|
|
- // }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '名称',
|
|
|
- prop: 'name',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left',
|
|
|
- slot: 'name'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'remark',
|
|
|
- label: '描述',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
+ import { listParentId, removeCode } from '@/api/businessCode';
|
|
|
+ export default {
|
|
|
+ mixins: [tabMixins],
|
|
|
+ components: {
|
|
|
+ codeEdit,
|
|
|
+ TypeEdit
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ // 上级
|
|
|
+ parentData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {}
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- prop: 'createUserName',
|
|
|
- label: '创建人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'updateUserName',
|
|
|
- label: '修改人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'updateTime',
|
|
|
- label: '修改时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ selection: [],
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center'
|
|
|
+ // selectable: (row, index) => {
|
|
|
+ // return !this.disabledTableList
|
|
|
+ // .map((item) => item.id)
|
|
|
+ // .includes(row.id);
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '名称',
|
|
|
+ prop: 'name',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left',
|
|
|
+ slot: 'name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'remark',
|
|
|
+ label: '描述',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- prop: '',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return this.$util.toDateString(cellValue);
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
- // 是否显示编辑弹窗
|
|
|
- showEditFlag: false,
|
|
|
- pageSize: this.$store.state.tablePageSize,
|
|
|
- cacheKeyUrl: 'ad4181af-codeManagement-businessCode'
|
|
|
- };
|
|
|
- },
|
|
|
- created() {},
|
|
|
+ {
|
|
|
+ prop: 'createUserName',
|
|
|
+ label: '创建人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'updateUserName',
|
|
|
+ label: '修改人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'updateTime',
|
|
|
+ label: '修改时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
|
|
|
- methods: {
|
|
|
- /* 表格数据源 */
|
|
|
- datasource({ page, limit, where, order }) {
|
|
|
- return listParentId({
|
|
|
- ...where,
|
|
|
- pageNum: page,
|
|
|
- size: limit,
|
|
|
- parentId: this.parentData?.id
|
|
|
- });
|
|
|
- },
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.table.reload({ pageNum: 1, where: where });
|
|
|
- });
|
|
|
+ {
|
|
|
+ prop: '',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return this.$util.toDateString(cellValue);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 是否显示编辑弹窗
|
|
|
+ showEditFlag: false,
|
|
|
+ pageSize: this.$store.state.tablePageSize,
|
|
|
+ cacheKeyUrl: 'ad4181af-codeManagement-businessCode'
|
|
|
+ };
|
|
|
},
|
|
|
+ created() {},
|
|
|
|
|
|
- /* 显示编辑 */
|
|
|
- openEdit(type, row = '') {
|
|
|
- if (type == 'edit' && this.selection[0].type == 1) {
|
|
|
- this.openType(type, this.selection[0]);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$refs.codeEditRef.open(type, this.selection[0]);
|
|
|
- },
|
|
|
- openType(type, row = '') {
|
|
|
- this.$refs.typeEditRef.open(type, row);
|
|
|
- },
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where, order }) {
|
|
|
+ return listParentId({
|
|
|
+ ...where,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ parentId: this.parentData?.id
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.table.reload({ pageNum: 1, where: where });
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- // async success(current) {
|
|
|
- // await this.reload();
|
|
|
- // this.current = current;
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs.PowerRef &&
|
|
|
- // this.$refs.PowerRef.setTableList(this.current.userAuthority);
|
|
|
- // });
|
|
|
- // },
|
|
|
+ /* 显示编辑 */
|
|
|
+ openEdit(type, row = '') {
|
|
|
+ if (type == 'edit' && this.selection[0].type == 1) {
|
|
|
+ this.openType(type, this.selection[0]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$refs.codeEditRef.open(type, this.selection[0]);
|
|
|
+ },
|
|
|
+ openType(type, row = '') {
|
|
|
+ this.$refs.typeEditRef.open(type, row);
|
|
|
+ },
|
|
|
|
|
|
- /* 删除 */
|
|
|
- remove(row) {
|
|
|
- removeCode(this.selection.map((item) => item.id))
|
|
|
- .then((msg) => {
|
|
|
- this.$message.success('操作成功');
|
|
|
- this.$emit('done', this.parentData);
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- // this.$message.error(e.message);
|
|
|
- });
|
|
|
- },
|
|
|
- done() {
|
|
|
- this.$emit('done', this.parentData);
|
|
|
- },
|
|
|
- getTableList() {
|
|
|
- return JSON.parse(JSON.stringify(this.selection));
|
|
|
+ // async success(current) {
|
|
|
+ // await this.reload();
|
|
|
+ // this.current = current;
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.PowerRef &&
|
|
|
+ // this.$refs.PowerRef.setTableList(this.current.userAuthority);
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+
|
|
|
+ /* 删除 */
|
|
|
+ remove(row) {
|
|
|
+ removeCode(this.selection.map((item) => item.id))
|
|
|
+ .then((msg) => {
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.$emit('done', this.parentData);
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ // this.$message.error(e.message);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ done() {
|
|
|
+ this.$emit('done', this.parentData);
|
|
|
+ },
|
|
|
+ getTableList() {
|
|
|
+ return JSON.parse(JSON.stringify(this.selection));
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.listName {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- img {
|
|
|
- margin-right: 3px;
|
|
|
+ .listName {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ img {
|
|
|
+ margin-right: 3px;
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
-</style>
|
|
|
+</style>
|