11<script lang="ts" setup>
22import delIcon from ' @/assets/svg/icon_delete.svg'
3+ import icon_embedded_outlined from ' @/assets/svg/icon-setting.svg'
34import edit from ' @/assets/svg/icon_edit_outlined.svg'
45import { get_supplier } from ' @/entity/supplier'
56import { computed , ref } from ' vue'
@@ -37,16 +38,20 @@ const showErrorMask = (msg?: string) => {
3738 errorMsg .value = ' '
3839 }, 3000 )
3940}
40- const emits = defineEmits ([' edit' , ' del' ])
41+ const emits = defineEmits ([' edit' , ' del' , ' default ' ])
4142
42- const handleEdit = () => {
43- emits (' edit ' )
43+ const handleDefault = () => {
44+ emits (' default ' )
4445}
4546
4647const handleDel = () => {
4748 emits (' del' , { id: props .id , name: props .name , default_model: props .isDefault })
4849}
4950
51+ const handleEdit = () => {
52+ emits (' edit' )
53+ }
54+
5055defineExpose ({ showErrorMask })
5156 </script >
5257
@@ -71,25 +76,32 @@ defineExpose({ showErrorMask })
7176 <span class =" value" > {{ baseModel }}</span >
7277 </div >
7378 <div class =" methods" >
74- <el-tooltip :offset =" 14" effect =" dark" :content =" $t('datasource.edit')" placement =" top" >
75- <el-icon size =" 16" @click =" handleEdit" >
79+ <el-button secondary @click =" handleDefault" >
80+ <el-icon style =" margin-right : 4px " size =" 16" >
81+ <icon _embedded_outlined ></icon _embedded_outlined >
82+ </el-icon >
83+ {{ $t('common.as_default_model') }}
84+ </el-button >
85+ <el-button secondary @click =" handleEdit" >
86+ <el-icon style =" margin-right : 4px " size =" 16" >
7687 <edit ></edit >
7788 </el-icon >
78- </ el-tooltip >
79- <span class = " divide " ></ span >
80- <el-tooltip :offset = " 14 " effect = " dark " :content = " $t('dashboard.delete') " placement = " top " >
81- <el-icon size = " 16 " @click = " handleDel " >
89+ {{ $t('dashboard.edit') }}
90+ </ el-button >
91+ <el-button secondary @click = " handleDel " >
92+ <el-icon style = " margin-right : 4 px " size = " 16 " >
8293 <delIcon ></delIcon >
8394 </el-icon >
84- </el-tooltip >
95+ {{ $t('dashboard.delete') }}
96+ </el-button >
8597 </div >
8698 </div >
8799</template >
88100
89101<style lang="less" scoped>
90102.card {
91103 width : 100% ;
92- height : 160 px ;
104+ height : 176 px ;
93105 border : 1px solid #dee0e3 ;
94106 padding : 16px ;
95107 border-radius : 12px ;
@@ -139,33 +151,8 @@ defineExpose({ showErrorMask })
139151 .methods {
140152 margin-top : 16px ;
141153 align-items : center ;
142- justify-content : flex-end ;
143154 display : none ;
144155
145- .ed-icon {
146- position : relative ;
147- cursor : pointer ;
148-
149- & ::after {
150- content : ' ' ;
151- background-color : #1f23291a ;
152- position : absolute ;
153- border-radius : 6px ;
154- width : 24px ;
155- height : 24px ;
156- transform : translate (-50% , -50% );
157- top : 50% ;
158- left : 50% ;
159- display : none ;
160- }
161-
162- & :hover {
163- & ::after {
164- display : block ;
165- }
166- }
167- }
168-
169156 .divide {
170157 height : 14px ;
171158 width : 1px ;
0 commit comments