|
@@ -4,20 +4,32 @@
|
|
<qm-low-form
|
|
<qm-low-form
|
|
:fields="fields"
|
|
:fields="fields"
|
|
:params="params"
|
|
:params="params"
|
|
- :label-width="150"
|
|
|
|
labelAlign="left"
|
|
labelAlign="left"
|
|
|
|
+ ref="form"
|
|
|
|
+ :rules="rules"
|
|
>
|
|
>
|
|
- <template #a>
|
|
|
|
|
|
+ <template #label1></template>
|
|
|
|
+ <template #paperTypeBarcodeContentItem>
|
|
<div class="flex items-center">
|
|
<div class="flex items-center">
|
|
- <a-input style="width: 200px" v-model:value="params.a" />
|
|
|
|
- <qm-button class="m-l-8px" :icon="h(PlusCircleOutlined)"
|
|
|
|
|
|
+ <a-input
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ v-model:value="params.paperTypeBarcodeContentItem"
|
|
|
|
+ />
|
|
|
|
+ <qm-button
|
|
|
|
+ class="m-l-8px"
|
|
|
|
+ :icon="h(PlusCircleOutlined)"
|
|
|
|
+ @click="addTag"
|
|
|
|
+ :disabled="!params.paperTypeBarcodeContentItem"
|
|
>新增</qm-button
|
|
>新增</qm-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
- <div class="p-t-10px p-b-10px">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="p-t-10px p-b-10px"
|
|
|
|
+ v-if="!!params.paperTypeBarcodeContent.length"
|
|
|
|
+ >
|
|
<div
|
|
<div
|
|
class="tag"
|
|
class="tag"
|
|
- v-for="(item, index) in tagList"
|
|
|
|
|
|
+ v-for="(item, index) in params.paperTypeBarcodeContent"
|
|
:key="item"
|
|
:key="item"
|
|
:style="{ color: token.colorPrimary }"
|
|
:style="{ color: token.colorPrimary }"
|
|
>
|
|
>
|
|
@@ -26,92 +38,181 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
- <template #b>
|
|
|
|
|
|
+ <template #label2></template>
|
|
|
|
+ <template #imageCheckRatio>
|
|
<div class="flex items-center">
|
|
<div class="flex items-center">
|
|
- <div class="flex items-center m-r-50px ccbl">
|
|
|
|
- <span>抽查比例:</span>
|
|
|
|
- <a-input-number v-model:value="params.b" :max="100" :min="0" />
|
|
|
|
- <span>%</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="flex items-center jcsx">
|
|
|
|
- <span>检查顺序:</span>
|
|
|
|
- <a-select v-mode:value="params.c" style="width: 200px"></a-select>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <a-input-number
|
|
|
|
+ v-model:value="params.imageCheckRatio"
|
|
|
|
+ :max="100"
|
|
|
|
+ :min="0"
|
|
|
|
+ />
|
|
|
|
+ <span>%</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
- <template #e>
|
|
|
|
|
|
+ <template #scannerAssignedMaxCount>
|
|
<div class="flex items-center">
|
|
<div class="flex items-center">
|
|
- <div class="flex items-center m-r-50px ccbl">
|
|
|
|
- <span>锁屏数量:</span>
|
|
|
|
- <a-input-number v-model:value="params.e" :max="100" :min="0" />
|
|
|
|
- <span>张</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="flex items-center jcsx">
|
|
|
|
- <span>解锁密码:</span>
|
|
|
|
- <a-input-password
|
|
|
|
- v-mode:value="params.f"
|
|
|
|
- style="width: 200px"
|
|
|
|
- ></a-input-password>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <a-input-number
|
|
|
|
+ v-model:value="params.scannerAssignedMaxCount"
|
|
|
|
+ :max="100"
|
|
|
|
+ :min="0"
|
|
|
|
+ />
|
|
|
|
+ <span>张</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</qm-low-form>
|
|
</qm-low-form>
|
|
|
|
|
|
<div class="btns">
|
|
<div class="btns">
|
|
<!-- <qm-button :icon="h(EditOutlined)">编辑</qm-button> -->
|
|
<!-- <qm-button :icon="h(EditOutlined)">编辑</qm-button> -->
|
|
- <qm-button type="primary">保存</qm-button>
|
|
|
|
|
|
+ <qm-button type="primary" @click="save">保存</qm-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script name="ScanParams" lang="ts" setup>
|
|
<script name="ScanParams" lang="ts" setup>
|
|
-import { ref, h } from "vue";
|
|
|
|
|
|
+import { ref, h, onMounted, reactive } from "vue";
|
|
import { PlusCircleOutlined } from "@ant-design/icons-vue";
|
|
import { PlusCircleOutlined } from "@ant-design/icons-vue";
|
|
import useToken from "@/hooks/useToken";
|
|
import useToken from "@/hooks/useToken";
|
|
import { EditOutlined } from "@ant-design/icons-vue";
|
|
import { EditOutlined } from "@ant-design/icons-vue";
|
|
|
|
+import { getBaseDataConfig, saveBaseDataConfig } from "@/ap/baseDataConfig";
|
|
|
|
+import { useUserStore } from "@/store";
|
|
|
|
+
|
|
|
|
+const form = ref();
|
|
|
|
+
|
|
|
|
+const userStore = useUserStore();
|
|
const { token } = useToken();
|
|
const { token } = useToken();
|
|
-//todo 入参名
|
|
|
|
-const params = ref({
|
|
|
|
- a: "",
|
|
|
|
- b: "",
|
|
|
|
- c: "",
|
|
|
|
- d: "1",
|
|
|
|
- e: "",
|
|
|
|
- f: "",
|
|
|
|
|
|
+const getData = () => {
|
|
|
|
+ getBaseDataConfig({ examId: userStore.curExam?.id }).then((res: any) => {
|
|
|
|
+ params.paperTypeBarcodeContent = res.paperTypeBarcodeContent || [];
|
|
|
|
+ params.imageCheckRatio = res.imageCheckRatio;
|
|
|
|
+ params.imageCheckOrder = res.imageCheckOrder;
|
|
|
|
+ params.enableSyncVerify = res.enableSyncVerify;
|
|
|
|
+ params.scannerAssignedMaxCount = res.scannerAssignedMaxCount;
|
|
|
|
+ params.scannerAssignedVerifyPassword = res.scannerAssignedVerifyPassword;
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getData();
|
|
|
|
+});
|
|
|
|
+const params = reactive<any>({
|
|
|
|
+ paperTypeBarcodeContentItem: "",
|
|
|
|
+ paperTypeBarcodeContent: [],
|
|
|
|
+ imageCheckRatio: "",
|
|
|
|
+ imageCheckOrder: "",
|
|
|
|
+ enableSyncVerify: true,
|
|
|
|
+ scannerAssignedMaxCount: "",
|
|
|
|
+ scannerAssignedVerifyPassword: "",
|
|
});
|
|
});
|
|
const fields = ref([
|
|
const fields = ref([
|
|
{
|
|
{
|
|
- cell: "a",
|
|
|
|
|
|
+ cell: "label1",
|
|
label: "卷型条码内容",
|
|
label: "卷型条码内容",
|
|
- colSpan: 24,
|
|
|
|
|
|
+ colSpan: 6,
|
|
|
|
+ labelWidth: 130,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "paperTypeBarcodeContentItem",
|
|
|
|
+ cell: "paperTypeBarcodeContentItem",
|
|
|
|
+ label: "",
|
|
|
|
+ labelWidth: 0,
|
|
|
|
+ colSpan: 18,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- cell: "b",
|
|
|
|
|
|
+ cell: "label2",
|
|
label: "图片检查",
|
|
label: "图片检查",
|
|
- colSpan: 24,
|
|
|
|
|
|
+ colSpan: 6,
|
|
|
|
+ labelWidth: 130,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "imageCheckRatio",
|
|
|
|
+ cell: "imageCheckRatio",
|
|
|
|
+ label: "抽查比例",
|
|
|
|
+ colSpan: 9,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "imageCheckOrder",
|
|
|
|
+ type: "select",
|
|
|
|
+ attrs: {
|
|
|
|
+ options: [
|
|
|
|
+ { value: "DESC", label: "最新扫描批次" },
|
|
|
|
+ { value: "ASC", label: "批次顺序" },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ label: "检查顺序",
|
|
|
|
+ colSpan: 9,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: "d",
|
|
|
|
|
|
+ cell: "label3",
|
|
label: "实时审核",
|
|
label: "实时审核",
|
|
- colSpan: 24,
|
|
|
|
|
|
+ colSpan: 6,
|
|
|
|
+ labelWidth: 130,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "enableSyncVerify",
|
|
|
|
+ label: "",
|
|
|
|
+ colSpan: 18,
|
|
type: "radio",
|
|
type: "radio",
|
|
attrs: {
|
|
attrs: {
|
|
options: [
|
|
options: [
|
|
- { label: "是", value: "1" },
|
|
|
|
- { label: "否", value: "0" },
|
|
|
|
|
|
+ { label: "是", value: true },
|
|
|
|
+ { label: "否", value: false },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- cell: "e",
|
|
|
|
|
|
+ cell: "label3",
|
|
label: "人工绑定锁屏控制",
|
|
label: "人工绑定锁屏控制",
|
|
- colSpan: 24,
|
|
|
|
|
|
+ colSpan: 6,
|
|
|
|
+ labelWidth: 130,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "scannerAssignedMaxCount",
|
|
|
|
+ cell: "scannerAssignedMaxCount",
|
|
|
|
+ label: "锁屏数量",
|
|
|
|
+ colSpan: 9,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "scannerAssignedVerifyPassword",
|
|
|
|
+ type: "password",
|
|
|
|
+ colSpan: 9,
|
|
|
|
+ label: "解锁密码",
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
-const tagList = ref(["666666", "888888", "999999"]);
|
|
|
|
|
|
+
|
|
|
|
+const addTag = () => {
|
|
|
|
+ params.paperTypeBarcodeContent.push(params.paperTypeBarcodeContentItem);
|
|
|
|
+ params.paperTypeBarcodeContentItem = "";
|
|
|
|
+};
|
|
const delTag = (index: number) => {
|
|
const delTag = (index: number) => {
|
|
- tagList.value.splice(index, 1);
|
|
|
|
|
|
+ params.paperTypeBarcodeContent.splice(index, 1);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const rules = {
|
|
|
|
+ paperTypeBarcodeContentItem: [
|
|
|
|
+ {
|
|
|
|
+ validator: async () => {
|
|
|
|
+ if (!params.paperTypeBarcodeContent.length) {
|
|
|
|
+ return Promise.reject("卷型条码内容至少一条");
|
|
|
|
+ } else {
|
|
|
|
+ return Promise.resolve();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ imageCheckRatio: [{ required: true, message: "请输入抽查比例" }],
|
|
|
|
+ scannerAssignedMaxCount: [{ required: true, message: "请输入锁屏数量" }],
|
|
|
|
+ scannerAssignedVerifyPassword: [
|
|
|
|
+ { required: true, message: "请输入解锁密码" },
|
|
|
|
+ ],
|
|
|
|
+};
|
|
|
|
+const save = () => {
|
|
|
|
+ form.value.formRef.validate().then(() => {
|
|
|
|
+ let p: any = { ...params };
|
|
|
|
+ delete p.paperTypeBarcodeContentItem;
|
|
|
|
+ saveBaseDataConfig(p).then((res: any) => {
|
|
|
|
+ console.log("mock 保存基础数据配置", res);
|
|
|
|
+ window.$message.success("保存成功");
|
|
|
|
+ });
|
|
|
|
+ });
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@@ -139,7 +240,7 @@ const delTag = (index: number) => {
|
|
height: 32px;
|
|
height: 32px;
|
|
padding: 0 10px;
|
|
padding: 0 10px;
|
|
border-radius: 16px;
|
|
border-radius: 16px;
|
|
- line-height: 32px;
|
|
|
|
|
|
+ line-height: 30px;
|
|
background: #e8f3ff;
|
|
background: #e8f3ff;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
margin-right: 8px;
|
|
margin-right: 8px;
|