|
22 | 22 | :min-width="300"
|
23 | 23 | required>
|
24 | 24 | <template #headAppend>
|
25 |
| - <span |
26 |
| - v-bk-tooltips="t('统一设置:将该列统一设置为相同的值')" |
27 |
| - class="batch-select-button" |
28 |
| - @click="handleShowHeadClusterSelector"> |
29 |
| - <DbIcon type="bulk-edit" /> |
30 |
| - </span> |
| 25 | + <BatchEditColumn |
| 26 | + v-model="showBatchEdit" |
| 27 | + :placeholder="t('请输入集群域名')" |
| 28 | + :title="t('目标集群')" |
| 29 | + type="input" |
| 30 | + @change="handleBatchEditChange"> |
| 31 | + <span |
| 32 | + v-bk-tooltips="t('统一设置:将该列统一设置为相同的值')" |
| 33 | + class="batch-edit-btn" |
| 34 | + @click="handleBatchEditShow"> |
| 35 | + <DbIcon type="bulk-edit" /> |
| 36 | + </span> |
| 37 | + </BatchEditColumn> |
31 | 38 | </template>
|
32 | 39 | <EditableInput
|
33 | 40 | v-model="modelValue.master_domain"
|
|
43 | 50 | </div>
|
44 | 51 | </template>
|
45 | 52 | </EditableInput>
|
46 |
| - <ClusterSelector |
47 |
| - v-model:is-show="isShowHeadClusterSelector" |
48 |
| - :cluster-types="[ClusterTypes.SQLSERVER_HA, ClusterTypes.SQLSERVER_SINGLE]" |
49 |
| - only-one-type |
50 |
| - :selected="headSelected" |
51 |
| - :tab-list-config="clusterSelectorTabConfig" |
52 |
| - @change="handleHeadClusterChange" /> |
53 | 53 | <ClusterSelector
|
54 | 54 | v-model:is-show="isShowCellClusterSelector"
|
55 | 55 | :cluster-types="[ClusterTypes.SQLSERVER_HA, ClusterTypes.SQLSERVER_SINGLE]"
|
|
74 | 74 |
|
75 | 75 | import ClusterSelector from '@components/cluster-selector/Index.vue';
|
76 | 76 |
|
| 77 | + import BatchEditColumn from '@views/db-manage/common/batch-edit-column/Index.vue'; |
| 78 | + |
77 | 79 | interface Props {
|
78 | 80 | srcClusterData: {
|
79 | 81 | bk_cloud_id: 0;
|
|
83 | 85 | };
|
84 | 86 | }
|
85 | 87 |
|
86 |
| - type Emits = (e: 'batch-edit', value: SqlServerHaModel[]) => void; |
| 88 | + type Emits = (e: 'batch-edit', value: string) => void; |
87 | 89 |
|
88 | 90 | const props = defineProps<Props>();
|
89 | 91 | const emits = defineEmits<Emits>();
|
|
102 | 104 |
|
103 | 105 | const { t } = useI18n();
|
104 | 106 |
|
105 |
| - const isShowHeadClusterSelector = ref(false); |
106 | 107 | const isShowCellClusterSelector = ref(false);
|
107 |
| - |
108 |
| - const headSelected: ComponentProps<typeof ClusterSelector>['selected'] = { |
109 |
| - [ClusterTypes.SQLSERVER_HA]: [], |
110 |
| - [ClusterTypes.SQLSERVER_SINGLE]: [], |
111 |
| - }; |
| 108 | + const showBatchEdit = ref(false); |
112 | 109 |
|
113 | 110 | const clusterSelectorTabConfig = {
|
114 | 111 | [ClusterTypes.SQLSERVER_HA]: {
|
|
200 | 197 | },
|
201 | 198 | );
|
202 | 199 |
|
203 |
| - const handleHeadClusterChange = (selected: { [key: string]: Array<SqlServerHaModel> }) => { |
204 |
| - const clusterList = Object.values(selected).flatMap((selectedList) => selectedList); |
205 |
| - emits('batch-edit', clusterList); |
| 200 | + const handleBatchEditChange = (value: string | string[]) => { |
| 201 | + emits('batch-edit', value as string); |
206 | 202 | };
|
207 | 203 |
|
208 |
| - const handleShowHeadClusterSelector = () => { |
209 |
| - isShowHeadClusterSelector.value = true; |
| 204 | + const handleBatchEditShow = () => { |
| 205 | + showBatchEdit.value = true; |
210 | 206 | };
|
211 | 207 |
|
212 | 208 | const handleShowClusterSelector = () => {
|
|
220 | 216 | };
|
221 | 217 | </script>
|
222 | 218 | <style lang="less" scoped>
|
223 |
| - .batch-select-button { |
| 219 | + .batch-edit-btn { |
224 | 220 | font-size: 14px;
|
225 | 221 | color: #3a84ff;
|
226 | 222 | cursor: pointer;
|
|
0 commit comments