字典配置修改为可查看
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-06-20 11:26:20 +08:00
parent c448f4cda8
commit 3d6cd67493
2 changed files with 78 additions and 204 deletions

View File

@ -5,151 +5,81 @@
</div> </div>
<div> <div>
<!-- 配置 --> <!-- 配置 -->
<el-button <el-button size="mini" type="primary" :disabled="isCompleteConfig" @click="handleAdd"
size="mini" style="margin-right: 10px;">
type="primary"
:disabled="isCompleteConfig"
@click="handleAdd"
style="margin-right: 10px;"
>
{{ $t('dictionary:template:criterionDictionary:button:config') }} {{ $t('dictionary:template:criterionDictionary:button:config') }}
</el-button> </el-button>
</div> </div>
</div> </div>
<el-table <el-table v-loading="loading" style="width: 100%" :data="list" stripe>
v-loading="loading"
style="width: 100%"
:data="list"
stripe
>
<!-- 序号 --> <!-- 序号 -->
<el-table-column <el-table-column prop="" label="" width="50">
prop=""
label=""
width="50"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + 1}} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 字典表名 --> <!-- 字典表名 -->
<el-table-column <el-table-column prop="Code" :label="$t('dictionary:template:criterionDictionary:table:code')"
prop="Code" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:code')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 描述 --> <!-- 描述 -->
<el-table-column <el-table-column prop="Description" :label="$t('dictionary:template:criterionDictionary:table:description')"
prop="Description" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:description')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 子项数量 --> <!-- 子项数量 -->
<el-table-column <el-table-column prop="Count" :label="$t('dictionary:template:criterionDictionary:table:count')"
prop="Count" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:count')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 排序 --> <!-- 排序 -->
<el-table-column <el-table-column prop="ShowOrder" :label="$t('dictionary:template:criterionDictionary:table:showOrder')"
prop="ShowOrder" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:showOrder')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 操作 --> <!-- 操作 -->
<el-table-column <el-table-column prop="Description" :label="$t('common:action:action')" show-overflow-tooltip>
prop="Description"
:label="$t('common:action:action')"
show-overflow-tooltip
>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 配置 --> <!-- 配置 -->
<el-button :disabled="isCompleteConfig" type="text" @click="openChildren(scope.row)"> <el-button type="text" @click="openChildren(scope.row)">
{{ $t('dictionary:template:criterionDictionary:button:config') }} {{ $t('dictionary:template:criterionDictionary:button:config') }}
</el-button> </el-button>
<!-- 删除 --> <!-- 删除 -->
<el-button <el-button type="text" :disabled="isCompleteConfig" @click="handleDelete(scope.row)">
type="text"
:disabled="isCompleteConfig"
@click="handleDelete(scope.row)"
>
{{ $t('common:button:delete') }} {{ $t('common:button:delete') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-drawer <el-drawer :title="drawer_cfg.title" :append-to-body="true" :modal-append-to-body="false"
:title="drawer_cfg.title" :visible.sync="drawer_cfg.drawerChild" direction="rtl" size="80%">
:append-to-body="true" <CriterionDictionaryConfig v-if="drawer_cfg.drawerChild" @getList="getList" :isCompleteConfig="isCompleteConfig"
:modal-append-to-body="false" :criterionId="criterionId" :parentCode="drawer_cfg.title"></CriterionDictionaryConfig>
:visible.sync="drawer_cfg.drawerChild"
direction="rtl"
size="80%"
>
<CriterionDictionaryConfig v-if="drawer_cfg.drawerChild" @getList="getList" :criterionId="criterionId" :parentCode="drawer_cfg.title"></CriterionDictionaryConfig>
</el-drawer> </el-drawer>
<el-drawer <el-drawer :title="drawer_cfg2.title" :append-to-body="true" :modal-append-to-body="false"
:title="drawer_cfg2.title" :visible.sync="drawer_cfg2.drawerChild" direction="rtl" size="80%">
:append-to-body="true"
:modal-append-to-body="false"
:visible.sync="drawer_cfg2.drawerChild"
direction="rtl"
size="80%"
>
<div style="text-align: right;"> <div style="text-align: right;">
<el-button <el-button size="mini" type="primary" @click="handleSave" v-loading="loading">
size="mini" {{ $t('common:button:save') }}
type="primary"
@click="handleSave"
v-loading="loading"
>
{{ $t('common:button:save')}}
</el-button> </el-button>
</div> </div>
<el-table <el-table v-loading="loading" v-adaptive="{ bottomOffset: 0 }" height="100" ref="multipleTable" style="width: 100%"
v-loading="loading" :data="dicList" stripe @selection-change="handleSelectionChange">
v-adaptive="{bottomOffset:0}" <el-table-column type="selection" width="55">
height="100"
ref="multipleTable"
style="width: 100%"
:data="dicList"
stripe
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55">
</el-table-column> </el-table-column>
<el-table-column <el-table-column width="55">
width="55">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + 1}} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 字典表名 --> <!-- 字典表名 -->
<el-table-column <el-table-column prop="Code" :label="$t('dictionary:template:criterionDictionary:table:code')"
prop="Code" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:code')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 描述 --> <!-- 描述 -->
<el-table-column <el-table-column prop="Description" :label="$t('dictionary:template:criterionDictionary:table:description')"
prop="Description" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:description')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 排序 --> <!-- 排序 -->
<el-table-column <el-table-column prop="ShowOrder" :label="$t('dictionary:template:criterionDictionary:table:showOrder')"
prop="ShowOrder" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:showOrder')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-drawer> </el-drawer>
@ -264,7 +194,7 @@ export default {
this.loading = true this.loading = true
// //
this.$confirm(this.$t('template:criterionDictionary:message:msg1')).then(() => { this.$confirm(this.$t('template:criterionDictionary:message:msg1')).then(() => {
deleteSystemCriterionDictionary({Id: row.Id}).then(res => { deleteSystemCriterionDictionary({ Id: row.Id }).then(res => {
this.$message.success(this.$t('common:message:deletedSuccessfully')) this.$message.success(this.$t('common:message:deletedSuccessfully'))
this.loading = false this.loading = false
this.getList() this.getList()
@ -277,7 +207,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-form-item__content{ ::v-deep .el-form-item__content {
width: calc(100% - 110px); width: calc(100% - 110px);
} }
</style> </style>

View File

@ -4,134 +4,74 @@
<div> <div>
</div> </div>
<div> <div>
<el-button <el-button size="mini" type="primary" @click="handleAdd" style="margin-right: 10px;" v-if="!isCompleteConfig">
size="mini"
type="primary"
@click="handleAdd"
style="margin-right: 10px;"
>
{{ $t('dictionary:template:criterionDictionary:button:config') }} {{ $t('dictionary:template:criterionDictionary:button:config') }}
</el-button> </el-button>
</div> </div>
</div> </div>
<el-table <el-table v-loading="loading" v-adaptive="{ bottomOffset: 0 }" height="100" style="width: 100%" :data="list" stripe>
v-loading="loading" <el-table-column prop="" label="" width="50">
v-adaptive="{bottomOffset:0}"
height="100"
style="width: 100%"
:data="list"
stripe
>
<el-table-column
prop=""
label=""
width="50"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + 1}} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 键值 --> <!-- 键值 -->
<el-table-column <el-table-column prop="Code" :label="$t('dictionary:template:criterionDictionary:table:code')"
prop="Code" show-overflow-tooltip />
:label="$t('dictionary:template:criterionDictionary:table:code')"
show-overflow-tooltip
/>
<!-- 中文值 --> <!-- 中文值 -->
<el-table-column <el-table-column prop="ValueCN" :label="$t('dictionary:template:criterionDictionary:table:valueCN')"
prop="ValueCN" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:valueCN')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 英文值 --> <!-- 英文值 -->
<el-table-column <el-table-column prop="Value" :label="$t('dictionary:template:criterionDictionary:table:value')"
prop="Value" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:value')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 描述 --> <!-- 描述 -->
<el-table-column <el-table-column prop="Description" :label="$t('dictionary:template:criterionDictionary:table:description')"
prop="Description" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:description')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 分组 --> <!-- 分组 -->
<el-table-column <el-table-column prop="Description" :label="$t('dictionary:template:criterionDictionary:table:group')"
prop="Description" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:group')"
show-overflow-tooltip
>
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div v-if="!isCompleteConfig">
<el-radio-group v-model="scope.row.CrterionDictionaryGroup" @change="(v) => {crterionDictionaryGroupChange(v, scope.row)}" size="mini"> <el-radio-group v-model="scope.row.CrterionDictionaryGroup"
<el-radio-button v-for="item of $d.CrterionDictionaryGroup" :label="item.value" :key="item.id">{{item.label}}</el-radio-button> @change="(v) => { crterionDictionaryGroupChange(v, scope.row) }" size="mini">
<el-radio-button v-for="item of $d.CrterionDictionaryGroup" :label="item.value" :key="item.id">{{
item.label }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-else>{{ $fd('CrterionDictionaryGroup', scope.row.CrterionDictionaryGroup) }}</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog <el-dialog v-if="config.visible" :visible.sync="config.visible" :close-on-click-modal="false" :title="config.title"
v-if="config.visible" width="90%" append-to-body>
:visible.sync="config.visible"
:close-on-click-modal="false"
:title="config.title"
width="90%"
append-to-body
>
<div> <div>
<div style="text-align: right;"> <div style="text-align: right;">
<el-button <el-button size="mini" type="primary" @click="handleSave" v-loading="loading">
size="mini" {{ $t('common:button:save') }}
type="primary"
@click="handleSave"
v-loading="loading"
>
{{ $t('common:button:save')}}
</el-button> </el-button>
</div> </div>
<el-table <el-table v-loading="loading" v-adaptive="{ bottomOffset: 100 }" height="100" ref="multipleTable"
v-loading="loading" :data="$d[parentCode]" stripe @selection-change="handleSelectionChange">
v-adaptive="{bottomOffset:100}" <el-table-column type="selection" width="55">
height="100"
ref="multipleTable"
:data="$d[parentCode]"
stripe
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55">
</el-table-column> </el-table-column>
<!-- 键值 --> <!-- 键值 -->
<el-table-column <el-table-column prop="raw.Code" :label="$t('dictionary:template:criterionDictionary:table:code')"
prop="raw.Code" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:code')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 中文值 --> <!-- 中文值 -->
<el-table-column <el-table-column prop="raw.ValueCN" :label="$t('dictionary:template:criterionDictionary:table:valueCN')"
prop="raw.ValueCN" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:valueCN')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 英文值 --> <!-- 英文值 -->
<el-table-column <el-table-column prop="raw.Value" :label="$t('dictionary:template:criterionDictionary:table:value')"
prop="raw.Value" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:value')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<!-- 描述 --> <!-- 描述 -->
<el-table-column <el-table-column prop="raw.Description"
prop="raw.Description" :label="$t('dictionary:template:criterionDictionary:table:description')" show-overflow-tooltip>
:label="$t('dictionary:template:criterionDictionary:table:description')"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
@ -150,6 +90,10 @@ export default {
parentCode: { parentCode: {
type: String, type: String,
required: true required: true
},
isCompleteConfig: {
type: Boolean,
default: false
} }
}, },
data() { data() {
@ -178,7 +122,7 @@ export default {
this.loading = false this.loading = false
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
this.getList() this.getList()
}).catch(() => {this.loading = false}) }).catch(() => { this.loading = false })
}, },
toggleSelection(rows) { toggleSelection(rows) {
console.log(this.$refs.multipleTable) console.log(this.$refs.multipleTable)
@ -240,7 +184,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-form-item__content{ ::v-deep .el-form-item__content {
width: calc(100% - 110px); width: calc(100% - 110px);
} }
</style> </style>