单应用项目,可以创建很多独立工具类页面 ,不用登录 初始化的页面
zhangchen
2025-09-16 ef6b957561341b7301ba8d1e19a36b824af5c18f
src/views/mobile/bedsideAuxiliaryScreen/components/SettingDeviceDialog.vue
@@ -6,6 +6,9 @@
      title="设置编号"
      width="80%"
      :show-close="false"
      class="scheduled-task-dialog"
      :destroy-on-close="true"
      :close-on-click-modal="false"
    >
      <template #header>
        <div class="setting-dialog-header">
@@ -20,7 +23,7 @@
      </template>
      <div class="setting-device-dialog-content">
        <div class="content-row1">
          <div class="row1-label">设备编号</div>
          <div class="row1-label" @click="openQrScanner">设备编号<i class="iconfont icon-saoma"></i></div>
          <div class="row1-inp-box">
            <input
              v-model="devcieCode"
@@ -51,9 +54,12 @@
      <template #footer>
        <div class="my-button cancel" @click="handleCancel">取消</div>
        <div class="my-button confirm" @click="handleConfirm">确认</div>
        <div class="my-button refresh" @click="handleRefresh">刷新</div>
        <div class="my-button refresh" @click="handleRefresh">检查更新</div>
      </template>
    </el-dialog>
    <!-- 长识别二维码 -->
    <QrScanner ref="QrScannerRef" @scan="onQrScan" />
  </div>
</template>
@@ -69,8 +75,11 @@
import closeImg from "@/img/close.png";
import uploadImg from "@/img/upload.png";
import { useBedsideAuxiliaryScreenStore } from "@/store/bedsideAuxiliaryScreen";
import QrScanner from "@/components/QrScanner/index.vue";
const bedsideAuxiliaryScreenStore = useBedsideAuxiliaryScreenStore();
const QrScannerRef = ref(null);
const isShow = ref(false);
const isUploading = ref(false);
@@ -134,14 +143,25 @@
const handleConfirm = () => {
  bedsideAuxiliaryScreenStore.setDeviceCode(devcieCode.value + "");
  handleRefresh();
  bedsideAuxiliaryScreenStore.refresh(
    `${import.meta.env.VITE_SSE_BASE_URL}${devcieCode.value}`
  );
  handleCancel();
};
const handleRefresh = () => {
    bedsideAuxiliaryScreenStore.refresh(
    `${import.meta.env.VITE_SSE_BASE_URL}${devcieCode.value}`
  );
  window.location.reload();
  ElMessage.success('已更新至最新版本')
};
const openQrScanner = () => {
  QrScannerRef.value?.open();
};
const onQrScan = ({ success, code}) => {
  if (!success) return;
  devcieCode.value = code;
  ElMessage.success("识别成功");
};
defineExpose({
@@ -223,6 +243,10 @@
        line-height: 16px;
        color: #ffffff;
        font-style: normal;
        .iconfont {
          margin-left: 2px;
          font-size: 9px;
        }
      }
      .row1-inp-box {
        flex: 1;
@@ -236,11 +260,11 @@
          height: 100%;
          border: none;
          outline: none;
          padding: 0 4px;
          padding: 0 4px;
          line-height: 16px;
          font-size: 9px;
          font-family: PingFangSC, PingFang SC;
          vertical-align: middle;
          vertical-align: middle;
          box-sizing: border-box; // 避免padding撑高
          &::placeholder {
@@ -319,4 +343,11 @@
    }
  }
}
</style>
<style>
.scheduled-task-dialog {
  margin: 0 auto;
  top: 50% !important;
  transform: translateY(-50%) !important;
}
</style>