1515 validator: validator,
1616 pagination: paginationReactive,
1717 }"
18+ @notify =" notify"
1819 >
1920 <template #header =" { methods } " >
2021 <div >命名空间</div >
4950 path =" namespaceId"
5051 label =" 命名空间Id"
5152 >
52- <NInput v-model:value =" formData.namespaceId" />
53+ <NInput
54+ v-model:value =" formData.namespaceId"
55+ :disabled =" formData.mode === 'update'"
56+ />
5357 </NFormItem >
5458 </NForm >
5559 </template >
@@ -61,9 +65,12 @@ import { NPopconfirm, NTag, NButton, NForm, NFormItem, NInput, type FormItemRule
6165import apis from ' @/apis/index'
6266import type { INamespace } from ' @/types/namespace'
6367import { useWebResources } from ' @/data/resources'
68+ import { namespaceStore } from ' @/data/namespace'
69+
6470let webResources = useWebResources ()
6571const formRef = ref <FormInst | null >(null )
6672const pageContainer = ref <any >(null )
73+ const columns = ref <any >([])
6774const paginationReactive = reactive ({
6875 page: 1 ,
6976 pageCount: 1 ,
@@ -83,18 +90,18 @@ const paginationReactive = reactive({
8390/**
8491 * 表格表格字段
8592 */
86- const columns = [
87- {
88- title: ' 命名空间名称 ' ,
89- key : ' namespaceName ' ,
90- } ,
91- {
92- title: ' 命名空间ID ' ,
93- key : ' namespaceId ' ,
94- } ,
95- ]
96- const optColumn = [
97- {
93+ const createColumns = () => {
94+ const columns = [
95+ {
96+ title : ' 命名空间名称 ' ,
97+ key: ' namespaceName ' ,
98+ },
99+ {
100+ title : ' 命名空间ID ' ,
101+ key: ' namespaceId ' ,
102+ },
103+ ]
104+ const optColumn = {
98105 title: ' 操作' ,
99106 key: ' type' ,
100107 fixed: ' right' ,
@@ -141,12 +148,23 @@ const optColumn = [
141148 </div >
142149 )
143150 },
144- },
145- ]
146- if (webResources .canUpdateNamespace ) {
147- columns .push (optColumn )
151+ }
152+
153+ if (webResources .canUpdateNamespace ) {
154+ columns .push (optColumn )
155+ }
156+ return columns
157+ }
158+
159+ // 通知更新命名空间
160+ const notify = (mark : string = ' ' ) => {
161+ namespaceStore .refresh ()
148162}
149163
164+ onMounted (() => {
165+ columns .value = createColumns ()
166+ })
167+
150168/**
151169 * 表单校验
152170 */
0 commit comments