Alsmile 2 vuotta sitten
vanhempi
sitoutus
97baa39b0b
3 muutettua tiedostoa jossa 16 lisäystä ja 5 poistoa
  1. 0 1
      src/styles/tdesign.css
  2. 16 3
      src/views/components/PenDatas.vue
  3. 0 1
      vite.config.ts

+ 0 - 1
src/styles/tdesign.css

@@ -385,7 +385,6 @@
 .t-popup__arrow {
   &::before {
     background-color: var(--color-background-popup);
-    box-shadow: none !important;
   }
 }
 

+ 16 - 3
src/views/components/PenDatas.vue

@@ -134,7 +134,10 @@
     :visible="true"
     class="data-link-dialog"
     header="变量绑定"
-    @close="dataBindDialog.show = false"
+    @cancel="
+      dataBindDialog.data.binds = dataBindDialog.bkBinds;
+      dataBindDialog.show = false;
+    "
     @confirm="dataBindDialog.show = false"
     :width="700"
   >
@@ -145,6 +148,7 @@
           v-for="(tag, index) in dataBindDialog.data.binds"
           :key="index"
           :content="tag.id"
+          trigger="click"
         >
           <t-tag class="mr-8 mb-8" closable @close="onRemoveBind(index)">
             {{ tag.label }}
@@ -417,7 +421,8 @@ const onBind = (item: any) => {
   for (const i of item.binds) {
     dataBindDialog.selectedIds.push(i.id);
   }
-
+  dataBindDialog.bkBinds = [];
+  dataBindDialog.bkBinds.push(...item.binds);
   dataBindDialog.show = true;
 
   getDataSet();
@@ -455,7 +460,6 @@ const onChangePagination = (pageInfo: any) => {
 
 const onSelectBindsChange = (value: string[], options: any) => {
   dataBindDialog.selectedIds = value;
-  console.log(options);
 
   if (options.type === 'check') {
     for (const item of options.selectedRowData) {
@@ -486,6 +490,15 @@ const onSelectBindsChange = (value: string[], options: any) => {
     }
   }
 };
+
+const onRemoveBind = (index: number) => {
+  dataBindDialog.data.binds.splice(index, 1);
+
+  dataBindDialog.selectedIds = [];
+  for (const i of dataBindDialog.data.binds) {
+    dataBindDialog.selectedIds.push(i.id);
+  }
+};
 </script>
 <style lang="postcss" scoped>
 .props {

+ 0 - 1
vite.config.ts

@@ -23,7 +23,6 @@ export default defineConfig({
       '/image': 'https://2d.le5le.com/',
       '/file': 'https://2d.le5le.com/',
       '/api': 'https://2d.le5le.com/',
-      '/api/device': 'http://127.0.0.1:777/',
     },
   },
 });