|
@@ -1,13 +1,9 @@
|
|
-<template>
|
|
|
|
|
|
+.<template>
|
|
<div class="dict-container">
|
|
<div class="dict-container">
|
|
<!-- 工具栏 -->
|
|
<!-- 工具栏 -->
|
|
<vxe-toolbar>
|
|
<vxe-toolbar>
|
|
<template #buttons>
|
|
<template #buttons>
|
|
- <vxe-input
|
|
|
|
- v-model="dictData.filterName"
|
|
|
|
- :placeholder="$t('message.hssearch')"
|
|
|
|
- @keyup="searchEvent"
|
|
|
|
- ></vxe-input>
|
|
|
|
|
|
+ <vxe-input v-model="filterName" :placeholder="$t('message.hssearch')" @keyup="searchEvent"></vxe-input>
|
|
</template>
|
|
</template>
|
|
<template #tools>
|
|
<template #tools>
|
|
<vxe-button
|
|
<vxe-button
|
|
@@ -34,13 +30,13 @@
|
|
border
|
|
border
|
|
resizable
|
|
resizable
|
|
:tree-config="{children: 'children', iconOpen: 'fa fa-minus-square-o', iconClose: 'fa fa-plus-square-o'}"
|
|
:tree-config="{children: 'children', iconOpen: 'fa fa-minus-square-o', iconClose: 'fa fa-plus-square-o'}"
|
|
- :data="dictData.tableData"
|
|
|
|
|
|
+ :data="tableData"
|
|
@cell-dblclick="cellDBLClickEvent"
|
|
@cell-dblclick="cellDBLClickEvent"
|
|
>
|
|
>
|
|
<vxe-table-column tree-node field="name" title="字典名称"></vxe-table-column>
|
|
<vxe-table-column tree-node field="name" title="字典名称"></vxe-table-column>
|
|
<vxe-table-column title="字典类型">
|
|
<vxe-table-column title="字典类型">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
- <el-tooltip effect="dark" :content="'双击复制:'+row.model" placement="top-end">
|
|
|
|
|
|
+ <el-tooltip effect="dark" :content="'双击复制:'+row.model" placement="right">
|
|
<span class="text-model">{{ row.model }}</span>
|
|
<span class="text-model">{{ row.model }}</span>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</template>
|
|
</template>
|
|
@@ -49,36 +45,43 @@
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<vxe-button type="text" icon="el-icon-edit" @click="onEdit(row)">编辑</vxe-button>
|
|
<vxe-button type="text" icon="el-icon-edit" @click="onEdit(row)">编辑</vxe-button>
|
|
<vxe-button type="text" icon="el-icon-circle-plus-outline" @click="onAddChild(row)">新增子类型</vxe-button>
|
|
<vxe-button type="text" icon="el-icon-circle-plus-outline" @click="onAddChild(row)">新增子类型</vxe-button>
|
|
- <vxe-button v-show="row.model" type="text" icon="el-icon-setting">字典配置</vxe-button>
|
|
|
|
|
|
+ <vxe-button
|
|
|
|
+ v-show="row.model"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-setting"
|
|
|
|
+ @click="onDeploy(row)"
|
|
|
|
+ >字典配置</vxe-button>
|
|
<vxe-button type="text" icon="el-icon-delete" @click="confirmEvent">删除</vxe-button>
|
|
<vxe-button type="text" icon="el-icon-delete" @click="confirmEvent">删除</vxe-button>
|
|
</template>
|
|
</template>
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
</vxe-table>
|
|
</vxe-table>
|
|
|
|
|
|
- <!-- 配置弹框 -->
|
|
|
|
|
|
+ <!-- 修改、添加弹框 -->
|
|
<vxe-modal
|
|
<vxe-modal
|
|
resize
|
|
resize
|
|
width="450"
|
|
width="450"
|
|
- v-model="dictData.showEdit"
|
|
|
|
- :title="dictData.selectRow ? '编辑' : '新增'"
|
|
|
|
- :loading="dictData.submitLoading"
|
|
|
|
|
|
+ v-model="showEdit"
|
|
|
|
+ :title="selectRow ? '编辑' : '新增'"
|
|
|
|
+ :loading="submitLoading"
|
|
@hide="$refs.xForm.reset();"
|
|
@hide="$refs.xForm.reset();"
|
|
>
|
|
>
|
|
<template #default>
|
|
<template #default>
|
|
<vxe-form
|
|
<vxe-form
|
|
ref="xForm"
|
|
ref="xForm"
|
|
- :data="dictData.formData"
|
|
|
|
- :items="dictData.formItems"
|
|
|
|
|
|
+ :data="formData"
|
|
|
|
+ :items="formItems"
|
|
title-align="right"
|
|
title-align="right"
|
|
title-width="100"
|
|
title-width="100"
|
|
- @submit="dictData.submitEvent"
|
|
|
|
|
|
+ @submit="submitEvent"
|
|
></vxe-form>
|
|
></vxe-form>
|
|
</template>
|
|
</template>
|
|
</vxe-modal>
|
|
</vxe-modal>
|
|
|
|
+
|
|
|
|
+ <Config :drawer="drawer" drawTitle="字典列表" @handleClose="handleClose" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
-import { reactive, ref, unref, nextTick } from "vue";
|
|
|
|
|
|
+import { reactive, ref, unref, nextTick, toRefs } from "vue";
|
|
import XEUtils from "xe-utils";
|
|
import XEUtils from "xe-utils";
|
|
import { cloneDeep } from "lodash-es";
|
|
import { cloneDeep } from "lodash-es";
|
|
import { templateRef } from "@vueuse/core";
|
|
import { templateRef } from "@vueuse/core";
|
|
@@ -90,8 +93,12 @@ import {
|
|
VxeTablePropTypes,
|
|
VxeTablePropTypes,
|
|
VxeFormPropTypes
|
|
VxeFormPropTypes
|
|
} from "vxe-table";
|
|
} from "vxe-table";
|
|
|
|
+import Config from "./config.vue";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {
|
|
|
|
+ Config
|
|
|
|
+ },
|
|
setup() {
|
|
setup() {
|
|
const dictData = reactive({
|
|
const dictData = reactive({
|
|
submitLoading: false,
|
|
submitLoading: false,
|
|
@@ -129,7 +136,7 @@ export default {
|
|
span: 24,
|
|
span: 24,
|
|
itemRender: {
|
|
itemRender: {
|
|
name: "$input",
|
|
name: "$input",
|
|
- props: { placeholder: "请输入字典名称", clearable: true }
|
|
|
|
|
|
+ props: { placeholder: "请输入字典名称" }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -141,8 +148,7 @@ export default {
|
|
props: {
|
|
props: {
|
|
placeholder: "请输入字典类型",
|
|
placeholder: "请输入字典类型",
|
|
//这里vxe-table文档并没有提到,可以配置所选组件的所有属性,比如这里可以配置关于vxe-input的所有属性
|
|
//这里vxe-table文档并没有提到,可以配置所选组件的所有属性,比如这里可以配置关于vxe-input的所有属性
|
|
- disabled: true,
|
|
|
|
- clearable: true
|
|
|
|
|
|
+ disabled: true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -270,8 +276,18 @@ export default {
|
|
}, 500);
|
|
}, 500);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ let drawer = ref(false);
|
|
|
|
+
|
|
|
|
+ function onDeploy(row: any) {
|
|
|
|
+ drawer.value = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleClose() {
|
|
|
|
+ drawer.value = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
return {
|
|
return {
|
|
- dictData,
|
|
|
|
|
|
+ ...toRefs(dictData),
|
|
formatDate,
|
|
formatDate,
|
|
searchEvent,
|
|
searchEvent,
|
|
confirmEvent,
|
|
confirmEvent,
|
|
@@ -279,7 +295,10 @@ export default {
|
|
submitEvent,
|
|
submitEvent,
|
|
onEdit,
|
|
onEdit,
|
|
onAddChild,
|
|
onAddChild,
|
|
- onAdd
|
|
|
|
|
|
+ onAdd,
|
|
|
|
+ onDeploy,
|
|
|
|
+ drawer,
|
|
|
|
+ handleClose
|
|
};
|
|
};
|
|
}
|
|
}
|
|
};
|
|
};
|