|
@@ -0,0 +1,269 @@
|
|
|
+<style>
|
|
|
+ .lang-en .layui-form-item .layui-form-label {
|
|
|
+ width: 300px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .lang-en .layui-form-item .layui-input-block {
|
|
|
+ margin-left: 330px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .lang-cn .layui-form-item .layui-form-label {
|
|
|
+ width: 160px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .lang-cn .layui-form-item .layui-input-block {
|
|
|
+ margin-left: 190px;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<div>
|
|
|
+ <div class="page-title" data-content="PageTitle4CaptureSetting"></div>
|
|
|
+ <div class="page-desc" data-content="PageDesc4CaptureSetting"></div>
|
|
|
+ <div class="layui-form page-form" lay-filter="FormCaptureSetting">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <div class="layui-inline">
|
|
|
+ <input type="checkbox"
|
|
|
+ name="EnableCaptureSetting"
|
|
|
+ id="EnableCaptureSetting"
|
|
|
+ lay-filter="EnableCaptureSetting"
|
|
|
+ lay-skin="switch" />
|
|
|
+ <label class="layui-form-label"
|
|
|
+ style="float: right;"
|
|
|
+ data-content="EnableCaptureSetting"></label>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div id="captureSettingContainer">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label" data-content="SingleFrameImageCaptureSwitch"></label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <select name="SingleFrameImageCaptureSwitch" lay-filter="SingleFrameImageCaptureSwitch">
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label" data-content="VideoCaptureSwitch"></label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <select name="VideoCaptureSwitch" lay-filter="VideoCaptureSwitch"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label" data-content="LeftKeySetting"></label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <select name="LeftKeySetting" lay-filter="LeftKeySetting"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label" data-content="RightKeySetting"></label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <select name="RightKeySetting" lay-filter="RightKeySetting">
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <button class="layui-btn layui-btn-normal"
|
|
|
+ lay-submit
|
|
|
+ lay-filter="BtnSave"
|
|
|
+ data-content="SaveConfig"></button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<script>
|
|
|
+ function Page(app, runtime) {
|
|
|
+ const { $api, $t, $c, $loading } = runtime;
|
|
|
+ const { form, layer } = layui;
|
|
|
+ const formFilter = "FormCaptureSetting";
|
|
|
+ this.onload = async function () {
|
|
|
+ let loadingIndex = $loading();
|
|
|
+ try {
|
|
|
+ let res = await $api("dicom", "GetCaptureSetting");
|
|
|
+ if (!res.IsSuccess) {
|
|
|
+ layer.msg.error($t(res.Code));
|
|
|
+ }
|
|
|
+ $("#EnableCaptureSetting").prop("checked", res.Data.CaptureEnabled);
|
|
|
+ if (!res.Data.CaptureEnabled) {
|
|
|
+ $("#captureSettingContainer").hide();
|
|
|
+ }
|
|
|
+ let options = [];
|
|
|
+ options.push(`<option value="0" data-content="FootSwitchLeftKey">${$t("FootSwitchLeftKey")}</option>`);
|
|
|
+ options.push(`<option value="1" data-content="FootSwitchRightKey">${$t("FootSwitchRightKey")}</option>`);
|
|
|
+ form.find(formFilter, "SingleFrameImageCaptureSwitch").empty().append(options);
|
|
|
+ form.find(formFilter, "VideoCaptureSwitch").empty().append(options);
|
|
|
+ let el = form.find(formFilter, "SingleFrameImageCaptureSwitch");
|
|
|
+ el.val(res.Data.ImageCaptureForFootSwitchKey);
|
|
|
+ el = form.find(formFilter, "VideoCaptureSwitch");
|
|
|
+ el.val(res.Data.VideoCaptureForFootSwitchKey);
|
|
|
+ options = [];
|
|
|
+ options.push(`<option value="0">F1</option>`);
|
|
|
+ options.push(`<option value="1">F2</option>`);
|
|
|
+ options.push(`<option value="2">F3</option>`);
|
|
|
+ options.push(`<option value="3">F4</option>`);
|
|
|
+ options.push(`<option value="4">F5</option>`);
|
|
|
+ options.push(`<option value="5">F6</option>`);
|
|
|
+ options.push(`<option value="6">F7</option>`);
|
|
|
+ options.push(`<option value="7">F8</option>`);
|
|
|
+ options.push(`<option value="8">F9</option>`);
|
|
|
+ options.push(`<option value="9">F10</option>`);
|
|
|
+ options.push(`<option value="10">F11</option>`);
|
|
|
+ options.push(`<option value="11">F12</option>`);
|
|
|
+ try {
|
|
|
+ let index = parseInt(res.Data.VideoCaptureForKeyBoardKey);
|
|
|
+ if (index >= 0 && index <= 11) {
|
|
|
+ options.splice(index, 1);
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ console.log("ParseInt Error");
|
|
|
+ }
|
|
|
+ form.find(formFilter, "LeftKeySetting").empty().append(options);
|
|
|
+ options = [];
|
|
|
+ options.push(`<option value="0">F1</option>`);
|
|
|
+ options.push(`<option value="1">F2</option>`);
|
|
|
+ options.push(`<option value="2">F3</option>`);
|
|
|
+ options.push(`<option value="3">F4</option>`);
|
|
|
+ options.push(`<option value="4">F5</option>`);
|
|
|
+ options.push(`<option value="5">F6</option>`);
|
|
|
+ options.push(`<option value="6">F7</option>`);
|
|
|
+ options.push(`<option value="7">F8</option>`);
|
|
|
+ options.push(`<option value="8">F9</option>`);
|
|
|
+ options.push(`<option value="9">F10</option>`);
|
|
|
+ options.push(`<option value="10">F11</option>`);
|
|
|
+ options.push(`<option value="11">F12</option>`);
|
|
|
+ try {
|
|
|
+ let index = parseInt(res.Data.ImageCaptureForKeyBoardKey);
|
|
|
+ if (index >= 0 && index <= 11) {
|
|
|
+ options.splice(index, 1);
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ console.log("ParseInt Error");
|
|
|
+ }
|
|
|
+ form.find(formFilter, "RightKeySetting").empty().append(options);
|
|
|
+ el = form.find(formFilter, "LeftKeySetting");
|
|
|
+ el.val(res.Data.ImageCaptureForKeyBoardKey);
|
|
|
+ el = form.find(formFilter, "RightKeySetting");
|
|
|
+ el.val(res.Data.VideoCaptureForKeyBoardKey);
|
|
|
+ form.render(null, formFilter);
|
|
|
+ } finally {
|
|
|
+ layer.close(loadingIndex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ form.on("select(SingleFrameImageCaptureSwitch)", function (data) {
|
|
|
+ let value = data.value;
|
|
|
+ if (value === "1") {
|
|
|
+ let el = form.find(formFilter, "VideoCaptureSwitch");
|
|
|
+ el.val("0");
|
|
|
+ }
|
|
|
+ else if (value == "0") {
|
|
|
+ let el = form.find(formFilter, "VideoCaptureSwitch");
|
|
|
+ el.val("1");
|
|
|
+ }
|
|
|
+ form.render("select", formFilter);
|
|
|
+ });
|
|
|
+
|
|
|
+ form.on("select(VideoCaptureSwitch)", function (data) {
|
|
|
+ let value = data.value;
|
|
|
+ if (value === "1") {
|
|
|
+ let el = form.find(formFilter, "SingleFrameImageCaptureSwitch");
|
|
|
+ el.val("0");
|
|
|
+ }
|
|
|
+ else if (value == "0") {
|
|
|
+ let el = form.find(formFilter, "SingleFrameImageCaptureSwitch");
|
|
|
+ el.val("1");
|
|
|
+ }
|
|
|
+ form.render("select", formFilter);
|
|
|
+ });
|
|
|
+
|
|
|
+ form.on("select(LeftKeySetting)", function (data) {
|
|
|
+ let options = [];
|
|
|
+ options.push(`<option value="0">F1</option>`);
|
|
|
+ options.push(`<option value="1">F2</option>`);
|
|
|
+ options.push(`<option value="2">F3</option>`);
|
|
|
+ options.push(`<option value="3">F4</option>`);
|
|
|
+ options.push(`<option value="4">F5</option>`);
|
|
|
+ options.push(`<option value="5">F6</option>`);
|
|
|
+ options.push(`<option value="6">F7</option>`);
|
|
|
+ options.push(`<option value="7">F8</option>`);
|
|
|
+ options.push(`<option value="8">F9</option>`);
|
|
|
+ options.push(`<option value="9">F10</option>`);
|
|
|
+ options.push(`<option value="10">F11</option>`);
|
|
|
+ options.push(`<option value="11">F12</option>`);
|
|
|
+ try {
|
|
|
+ let index = parseInt(data.value);
|
|
|
+ if (index >= 0 && index <= 11) {
|
|
|
+ options.splice(index, 1);
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ console.log("ParseInt Error");
|
|
|
+ }
|
|
|
+ let el = form.find(formFilter, "RightKeySetting");
|
|
|
+ let oldValue = el.val();
|
|
|
+ form.find(formFilter, "RightKeySetting").empty().append(options);
|
|
|
+ el.val(oldValue);
|
|
|
+ form.render("select", formFilter);
|
|
|
+ });
|
|
|
+
|
|
|
+ form.on("select(RightKeySetting)", function (data) {
|
|
|
+ let options = [];
|
|
|
+ options.push(`<option value="0">F1</option>`);
|
|
|
+ options.push(`<option value="1">F2</option>`);
|
|
|
+ options.push(`<option value="2">F3</option>`);
|
|
|
+ options.push(`<option value="3">F4</option>`);
|
|
|
+ options.push(`<option value="4">F5</option>`);
|
|
|
+ options.push(`<option value="5">F6</option>`);
|
|
|
+ options.push(`<option value="6">F7</option>`);
|
|
|
+ options.push(`<option value="7">F8</option>`);
|
|
|
+ options.push(`<option value="8">F9</option>`);
|
|
|
+ options.push(`<option value="9">F10</option>`);
|
|
|
+ options.push(`<option value="10">F11</option>`);
|
|
|
+ options.push(`<option value="11">F12</option>`);
|
|
|
+ try {
|
|
|
+ let index = parseInt(data.value);
|
|
|
+ if (index >= 0 && index <= 11) {
|
|
|
+ options.splice(index, 1);
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ console.log("ParseInt Error");
|
|
|
+ }
|
|
|
+ let el = form.find(formFilter, "LeftKeySetting");
|
|
|
+ let oldValue = el.val();
|
|
|
+ form.find(formFilter, "LeftKeySetting").empty().append(options);
|
|
|
+ el.val(oldValue);
|
|
|
+ form.render("select", formFilter);
|
|
|
+ });
|
|
|
+
|
|
|
+ form.on("switch(EnableCaptureSetting)", async function (data) {
|
|
|
+ let checked = data.elem.checked;
|
|
|
+ if (checked) {
|
|
|
+ $("#captureSettingContainer").show();
|
|
|
+ } else {
|
|
|
+ $("#captureSettingContainer").hide();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ form.on("submit(BtnSave)", async function (data) {
|
|
|
+ await handleSave(this, data.field);
|
|
|
+ });
|
|
|
+
|
|
|
+ async function handleSave(e, data) {
|
|
|
+ let loadingIndex = $loading();
|
|
|
+ try {
|
|
|
+ data.EnableCaptureSetting = data.EnableCaptureSetting === "on";
|
|
|
+ let request = {
|
|
|
+ CaptureEnabled: data.EnableCaptureSetting,
|
|
|
+ ImageCaptureForFootSwitchKey: data.SingleFrameImageCaptureSwitch,
|
|
|
+ VideoCaptureForFootSwitchKey: data.VideoCaptureSwitch,
|
|
|
+ ImageCaptureForKeyBoardKey: data.LeftKeySetting,
|
|
|
+ VideoCaptureForKeyBoardKey: data.RightKeySetting,
|
|
|
+ };
|
|
|
+ let res = await $api("dicom", "SaveCaptureSetting", request);
|
|
|
+ if (!res.IsSuccess) {
|
|
|
+ layer.msg.error($t(res.Code));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ layer.msg.success($t("SaveSuccess"));
|
|
|
+ }
|
|
|
+ } finally {
|
|
|
+ layer.close(loadingIndex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|