Commit 6a3d5283 authored by 赵伟庚's avatar 赵伟庚

[refactor](字典管理): 针对开发语言字典项新增子级字典

parent ab143401
...@@ -71,18 +71,18 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 ...@@ -71,18 +71,18 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
registry_password: # 密码 registry_password: # 密码
from_secret: REGISTRY_PASSWORD_ALIYUN from_secret: REGISTRY_PASSWORD_ALIYUN
- name: deploy-cloud # - name: deploy-cloud
image: registry.cn-qingdao.aliyuncs.com/wod/devops-kubernetes:1.0 # image: registry.cn-qingdao.aliyuncs.com/wod/devops-kubernetes:1.0
settings: # settings:
namespace: apaas-v5 # namespace: apaas-v5
deployment: apaas-manage-ui # deployment: apaas-manage-ui
container: apaas-manage-ui # container: apaas-manage-ui
image: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.9-alpha # image: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.9-alpha
environment: # environment:
KUBERNETES_SERVER: # KUBERNETES_SERVER:
from_secret: KUBERNETES_SERVER # from_secret: KUBERNETES_SERVER
KUBERNETES_TOKEN: # KUBERNETES_TOKEN:
from_secret: KUBERNETES_TOKEN # from_secret: KUBERNETES_TOKEN
- name: docker-arm64 - name: docker-arm64
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0 image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
<bg-filter-group @search="changeSearch" v-model="filter.search" placeholder="请输入关键字"> <bg-filter-group @search="changeSearch" v-model="filter.search" placeholder="请输入关键字">
<template v-slot:left_action v-if="nodeClassifyId != '263758a4-0349-4d49-a816-e8ff8d33a8bb'"> <template v-slot:left_action v-if="nodeClassifyId != '263758a4-0349-4d49-a816-e8ff8d33a8bb'">
<div class="apaas_button"> <div class="apaas_button">
<el-button class="register_btn" type="primary" @click="backDict" v-if="dictLevel != 1">
<!-- <bg-icon style="font-size: 12px; color: #fff; margin-right: 8px" icon="#bg-ic-add"></bg-icon> -->
返回上级
</el-button>
<el-button class="register_btn" type="primary" @click="register"> <el-button class="register_btn" type="primary" @click="register">
<bg-icon style="font-size: 12px; color: #fff; margin-right: 8px" icon="#bg-ic-add"></bg-icon> <bg-icon style="font-size: 12px; color: #fff; margin-right: 8px" icon="#bg-ic-add"></bg-icon>
新增 新增
...@@ -56,7 +60,15 @@ ...@@ -56,7 +60,15 @@
</bg-filter-group> </bg-filter-group>
<div class="table_container"> <div class="table_container">
<div class="table bg-scroll"> <div class="table bg-scroll">
<bg-table ref="bgTable" :headers="headers" :rows="tableRows" :isIndex="true" :stripe="true"> <bg-table ref="bgTable" :headers="isLang && dictLevel == 1 ? langHeaders : headers" :rows="tableRows" :isIndex="true" :stripe="true">
<template v-slot:name="{ row }">
<span class="can_click_text" @click="getChildren(row)" v-if="isLang && dictLevel == 1">
{{ row.name }}
</span>
<span v-else>
{{ row.name }}
</span>
</template>
<template v-slot:updated_time="{ row }"> <template v-slot:updated_time="{ row }">
{{ row.updated_time.split("+")[0].replace("T", " ").replace("Z", " ") }} {{ row.updated_time.split("+")[0].replace("T", " ").replace("Z", " ") }}
</template> </template>
...@@ -204,6 +216,36 @@ const state = reactive({ ...@@ -204,6 +216,36 @@ const state = reactive({
fixed: "right", fixed: "right",
}, },
], // 表格数据表头 ], // 表格数据表头
langHeaders: [
{
label: "名称",
prop: "name",
},
{
label: "版本数",
prop: "total_children",
},
{
label: "描述",
prop: "describe",
minWidth: 360,
},
{
label: "更新时间",
prop: "updated_time",
width: 220,
},
{
label: "是否启用",
prop: "state",
},
{
label: "操作",
prop: "action",
width: 176,
fixed: "right",
},
],
tableRows: [], // 表格数据 tableRows: [], // 表格数据
tableTotal: 0, // 表格数据条数 tableTotal: 0, // 表格数据条数
filter: { filter: {
...@@ -234,6 +276,7 @@ const state = reactive({ ...@@ -234,6 +276,7 @@ const state = reactive({
name: "", name: "",
describe: "", describe: "",
state: 1, state: 1,
p_dict_id: "",
}, },
rules: { rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }], name: [{ required: true, message: "请输入名称", trigger: "blur" }],
...@@ -243,10 +286,30 @@ const state = reactive({ ...@@ -243,10 +286,30 @@ const state = reactive({
], ],
state: [{ required: true, message: "请选择是否启用", trigger: "change" }], state: [{ required: true, message: "请选择是否启用", trigger: "change" }],
}, },
fatherRow: null,
}); });
const isLang = computed(() => {
return state.nodeClassifyId == "59315100-5c2a-4381-83fe-32934605f0a9"
})
const dictLevel = ref(1)
const getChildren = (row) => {
dictLevel.value = 2
state.tableRows = row.children || []
state.tableTotal = row.total_children
state.fatherRow = row
}
const backDict = () => {
dictLevel.value = 1
state.fatherRow = null
changePage(1);
}
const nodeClick = (item) => { const nodeClick = (item) => {
state.nodeId = item.id; state.nodeId = item.id;
dictLevel.value = 1
state.fatherRow = null
state.nodeClassifyId = item.classify_id; state.nodeClassifyId = item.classify_id;
state.filter = { state.filter = {
state: "", state: "",
...@@ -317,8 +380,15 @@ const getTableRows = () => { ...@@ -317,8 +380,15 @@ const getTableRows = () => {
}) })
.then((res) => { .then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
state.tableRows = res.data.data || []; let data = res.data.data || []
state.tableTotal = res.data.total; if (dictLevel.value == 1) {
state.tableRows = data;
state.tableTotal = res.data.total;
}else {
let row = data.filter(e => {return e.dict_id == state.fatherRow.dict_id})
state.tableRows = row[0].children
state.tableTotal = row[0].total_children
}
if (state.tableRows.length > 0) { if (state.tableRows.length > 0) {
state.tableRows.forEach((e) => { state.tableRows.forEach((e) => {
e.canMoveUp = true; e.canMoveUp = true;
...@@ -360,6 +430,7 @@ const register = () => { ...@@ -360,6 +430,7 @@ const register = () => {
name: "", name: "",
describe: "", describe: "",
state: 1, state: 1,
p_dict_id: state.fatherRow ? state.fatherRow.dict_id : "",
}; };
if (state.bgForm) { if (state.bgForm) {
nextTick().then(() => { nextTick().then(() => {
...@@ -384,6 +455,7 @@ const edit_row = (row) => { ...@@ -384,6 +455,7 @@ const edit_row = (row) => {
name: state.actionRow.name, name: state.actionRow.name,
describe: state.actionRow.describe, describe: state.actionRow.describe,
state: state.actionRow.state, state: state.actionRow.state,
p_dict_id: state.actionRow.p_dict_id
}; };
} else { } else {
ElMessage.error(res.data.data); ElMessage.error(res.data.data);
...@@ -518,6 +590,7 @@ const { ...@@ -518,6 +590,7 @@ const {
addDialog, addDialog,
formData, formData,
rules, rules,
langHeaders,
} = toRefs(state); } = toRefs(state);
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment