zhuangyunsheng 4 månader sedan
förälder
incheckning
70fec4319e
2 ändrade filer med 12 tillägg och 4 borttagningar
  1. 12 3
      src/views/group/camera.vue
  2. 0 1
      src/views/group/index.vue

+ 12 - 3
src/views/group/camera.vue

@@ -10,6 +10,10 @@
                 <el-button type="primary" link @click="table_snap(row)">
                     <template #icon><sc-iconify icon="mingcute:pic-line"></sc-iconify></template>设备抓拍
                 </el-button>
+
+                <el-button type="primary" link @click="table_edit(row)">
+                    <template #icon><sc-iconify icon="ant-design:edit-outlined"></sc-iconify></template>修改
+                </el-button>
                 <el-button type="primary" link @click="table_del(row)">
                     <template #icon><sc-iconify icon="ant-design:delete-outlined"></sc-iconify></template>删除
                 </el-button>
@@ -53,14 +57,14 @@ const columns = reactive([
     { type: "html", field: "deviceType", title: "设备类型", minWidth: 160, sortable: true },
     { type: "html", field: "CreateTime", title: "创建时间", minWidth: 160, sortable: true, formatter: ({ cellValue, row }) => cellValue || TOOL.dateFormat(row.createTime) },
     { type: "html", field: "UpdateTime", title: "更新时间", minWidth: 160, sortable: true, formatter: ({ cellValue, row }) => cellValue || TOOL.dateFormat(row.updateTime) },
-    { title: "操作", fixed: "right", minWidth: 160, align: "center", slots: { default: "action" } }
+    { title: "操作", fixed: "right", minWidth: 220, align: "center", slots: { default: "action" } }
 ])
 
 // 显示隐藏 筛选表单
 const xGridTable = ref();
-const refreshTable = () => {
+const refreshTable = (mode = "add") => {
     xGridTable.value.reloadColumn(columns);
-    xGridTable.value.searchData();
+    xGridTable.value.searchData(mode);
 }
 
 const deviceRef = ref();
@@ -75,6 +79,11 @@ const table_add = () => {
     nextTick(() => deviceRef.value?.open());
 }
 
+const table_edit = row => {
+    dialog.detail = true;
+    nextTick(() => deviceRef.value?.setData(row));
+}
+
 const table_snap = row => {
     dialog.snap = true;
     nextTick(() => snapRef.value?.open(row));

+ 0 - 1
src/views/group/index.vue

@@ -71,7 +71,6 @@ const columns = reactive([
 // 显示隐藏 筛选表单
 const xGridTable = ref();
 const toggleFormEnabled = () => xGridTable.value.toggleFormEnabled();
-
 const refreshTable = (mode = "add") => {
     xGridTable.value.reloadColumn(columns);
     xGridTable.value.searchData(mode);