@@ -163,20 +163,21 @@ import {
163163 DxGroup ,
164164 DxTab ,
165165 DxToolbox ,
166+ type DxDiagramTypes ,
166167} from ' devextreme-vue/diagram' ;
167168import { DxPopup } from ' devextreme-vue/popup' ;
168169import DxTextBox from ' devextreme-vue/text-box' ;
169170import DxButton from ' devextreme-vue/button' ;
170171import { ArrayStore } from ' devextreme-vue/common/data' ;
171172import CustomShapeTemplate from ' ./CustomShapeTemplate.vue' ;
172173import CustomShapeToolboxTemplate from ' ./CustomShapeToolboxTemplate.vue' ;
173- import service from ' ./data.ts' ;
174+ import service , { type Employee } from ' ./data.ts' ;
174175
175176let generatedID = 100 ;
176177const dataSource = new ArrayStore ({
177178 key: ' ID' ,
178179 data: service .getEmployees (),
179- onInserting(values ) {
180+ onInserting(values : Employee ) {
180181 values .ID = values .ID || (generatedID += 1 );
181182 values .Full_Name = values .Full_Name || " Employee's Name" ;
182183 values .Title = values .Title || " Employee's Title" ;
@@ -186,14 +187,14 @@ const currentEmployee = ref({} as Record<string, any>);
186187const popupVisible = ref (false );
187188
188189const itemTypeExpr = () => ' employee' ;
189- function itemCustomDataExpr(obj , value ) {
190+ function itemCustomDataExpr(obj : any , value : any ) {
190191 if (value === undefined ) {
191192 return { ... obj };
192193 }
193194 Object .assign (obj , value );
194195 return null ;
195196}
196- function onRequestLayoutUpdate(e ) {
197+ function onRequestLayoutUpdate(e : DxDiagramTypes . RequestLayoutUpdateEvent ) {
197198 for (let i = 0 ; i < e .changes .length ; i += 1 ) {
198199 if (e .changes [i ].type === ' remove' ) {
199200 e .allowed = true ;
@@ -202,21 +203,13 @@ function onRequestLayoutUpdate(e) {
202203 }
203204 }
204205}
205- function editEmployee(employee ) {
206+ function editEmployee(employee : Employee ) {
206207 currentEmployee .value = {
207- Full_Name: ' ' ,
208- Prefix: ' ' ,
209- Title: ' ' ,
210- City: ' ' ,
211- State: ' ' ,
212- Email: ' ' ,
213- Skype: ' ' ,
214- Mobile_Phone: ' ' ,
215208 ... employee ,
216209 };
217210 popupVisible .value = true ;
218211}
219- function deleteEmployee(employee ) {
212+ function deleteEmployee(employee : Employee ) {
220213 dataSource .push ([{ type: ' remove' , key: employee .ID }]);
221214}
222215function updateEmployee() {
0 commit comments