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

View File

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