Compare commits

..

No commits in common. "master" and "1.0.4" have entirely different histories.

8 changed files with 101 additions and 181 deletions

View File

@ -6,8 +6,8 @@ on:
- develop
env:
IMAGE_NAME: ${{ gitea.repository_owner }}/maketemplate.web
PUBLISH_PATH: maketemplate.web
IMAGE_NAME: ${{ gitea.repository_owner }}/usercenter.web
PUBLISH_PATH: usercenter.web
PUBLISH_HOST: 10.255.255.44
PUBLISH_PORT: 22
PUBLISH_REPLICAS: 1 #启动副本数量
@ -16,17 +16,21 @@ jobs:
job1:
name: 编译发布
runs-on: linux
container:
image: node:16-bullseye
volumes:
#挂载缓存
- /opt/.runner/node_modules:/cache
steps:
- name: 下载源码
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: 使用缓存
uses: actions/cache@master
with:
mount: |
node_modules
hash_files: |
package.json
- name: 编译项目
run: |

View File

@ -6,8 +6,8 @@ on:
- master
env:
IMAGE_NAME: ${{ gitea.repository_owner }}/maketemplate.web
PUBLISH_PATH: maketemplate.web
IMAGE_NAME: ${{ gitea.repository_owner }}/usercenter.web
PUBLISH_PATH: usercenter.web
PUBLISH_HOST: 10.255.255.74
PUBLISH_PORT: 10022
PUBLISH_REPLICAS: 1 #启动副本数量
@ -21,7 +21,7 @@ jobs:
steps:
- name: 下载源码
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: 发布版本
id: publish_version
@ -33,15 +33,16 @@ jobs:
needs: release
steps:
- name: 下载源码
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: 下载源码
uses: actions/checkout@v3
- name: 使用缓存
uses: actions/cache@master
with:
mount: |
node_modules
hash_files: |
package.json
- name: 编译项目
shell: bash

View File

@ -6,8 +6,8 @@ on:
- staging
env:
IMAGE_NAME: ${{ gitea.repository_owner }}/maketemplate.web
PUBLISH_PATH: maketemplate.web
IMAGE_NAME: ${{ gitea.repository_owner }}/usercenter.web
PUBLISH_PATH: usercenter.web
PUBLISH_HOST: 10.255.255.3
PUBLISH_PORT: 22
PUBLISH_REPLICAS: 1 #启动副本数量
@ -24,15 +24,13 @@ jobs:
steps:
- name: 下载源码
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: 使用缓存
uses: actions/cache@master
with:
mount: |
node_modules
hash_files: |
package.json
- name: 编译项目
shell: bash

View File

@ -6,8 +6,8 @@ on:
- published
env:
IMAGE_NAME: ${{ gitea.repository_owner }}/maketemplate.web
PUBLISH_PATH: maketemplate.web
IMAGE_NAME: ${{ gitea.repository_owner }}/usercenter.web
PUBLISH_PATH: usercenter.web
PUBLISH_HOST: 10.255.255.74
PUBLISH_PORT: 10022
PUBLISH_REPLICAS: 1 #启动副本数量
@ -16,18 +16,21 @@ jobs:
job1:
name: 编译发布
runs-on: linux
container:
image: node:16-bullseye
volumes:
#挂载缓存
- /opt/.runner/node_modules:/cache
steps:
- name: 下载源码
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: 使用缓存
uses: actions/cache@master
with:
mount: |
node_modules
hash_files: |
package.json
- name: 编译项目
shell: bash

View File

@ -2,12 +2,12 @@ version: "3"
services:
usercenter-web:
image: ${REGISTRY:-harbor.w.23544.com:8843}/marking/maketemplate.web:${TAG:-latest}
image: ${REGISTRY:-harbor.w.23544.com:8843}/marking/usercenter.web:${TAG:-latest}
hostname: marking
environment:
TZ: Asia/Shanghai
ports:
- 8898:80
- 4400:80
deploy:
mode: replicated
replicas: ${REPLICAS:-1}

View File

@ -2,37 +2,21 @@
<div>
<span>坐标</span>
<div>
<el-button type="primary" @click="changeFabricPosition(true, 'top')"
>上移</el-button
>
<el-button type="primary" @click="changeFabricPosition(false, 'top')"
>下移</el-button
>
<el-button type="primary" @click="changeFabricPosition(true, 'left')"
>左移</el-button
>
<el-button type="primary" @click="changeFabricPosition(false, 'left')"
>右移</el-button
>
<el-button type="primary" @click="changeFabricPosition(true, 'top')">上移</el-button>
<el-button type="primary" @click="changeFabricPosition(false, 'top')">下移</el-button>
<el-button type="primary" @click="changeFabricPosition(true, 'left')">左移</el-button>
<el-button type="primary" @click="changeFabricPosition(false, 'left')">右移</el-button>
</div>
</div>
<div>
<span>宽度</span>
<el-input-number
v-model="fabricPosition.width"
:min="1"
@change="changeFabricPosition($event, 'width')"
:max="fabricPosition.imgDomWidth"
/>
<el-input-number v-model="fabricPosition.width" :min="1" @change="changeFabricPosition($event, 'width')"
:max="fabricPosition.imgDomWidth" />
</div>
<div>
<span>高度</span>
<el-input-number
v-model="fabricPosition.height"
:min="1"
@change="changeFabricPosition($event, 'height')"
:max="fabricPosition.imgDomHight"
/>
<el-input-number v-model="fabricPosition.height" :min="1" @change="changeFabricPosition($event, 'height')"
:max="fabricPosition.imgDomHight" />
</div>
</template>
<script lang="ts" setup>
@ -44,8 +28,8 @@ const fabricPosition = reactive<any>({
width: 0,
height: 0,
imgDomHight: 1,
imgDomWidth: 1,
});
imgDomWidth: 1
})
const setSize = (data: any, imgDomWidth: number, imgDomHight: number): void => {
fabricPosition.top = data.top;
@ -54,22 +38,23 @@ const setSize = (data: any, imgDomWidth: number, imgDomHight: number): void => {
fabricPosition.height = data.height;
fabricPosition.imgDomWidth = imgDomWidth;
fabricPosition.imgDomHight = imgDomHight;
};
}
const changeFabricPosition = (value: number | boolean, str: string): void => {
if (typeof value === "boolean") {
if (str === "top") {
props.change(value, str);
if (typeof value === 'boolean') {
if (str === 'top') {
props.change(value ? fabricPosition.top-- : fabricPosition.top++, str)
} else {
props.change(value, str);
props.change(value ? fabricPosition.left-- : fabricPosition.left++, str)
}
} else {
props.change(value, str);
props.change(value, str)
}
};
}
defineExpose({
setSize,
});
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped></style>

View File

@ -9,7 +9,7 @@
>
<div>
<div style="font-size: 20px; margin-bottom: 20px; font-weight: bold">
锁定模板后仅可调整位置和大小无法增删题目请确认模板信息后操作
锁定模板后无法修改请确认模板信息后操作
</div>
<div style="height: 70vh; overflow-y: auto">
<el-collapse v-model="activeNames">
@ -17,7 +17,7 @@
<div v-if="item.key !== 'otherPoint'">
<div v-if="item.data.length">
<div v-for="row in item.data">
{{ row.questionBefore }}-{{ row.questionAfter }} 每题{{ row.score }}
{{ row.questionBefore }}-{{ row.questionAfter }} 总分{{ row.score }}
</div>
</div>
<div v-else>

View File

@ -24,12 +24,7 @@
<img src="@/assets/image/icon1.png" alt="" v-if="item.index !== 5" />
</div>
</div>
<div
class="warp-nav-tab-delete"
title="清空全部痕迹"
@click="clearFabricGroup"
v-if="!isLockStatus"
>
<div class="warp-nav-tab-delete" title="清空全部痕迹" @click="clearFabricGroup">
<img src="@/assets/image/icon2.png" alt="" />
<span>清空全部痕迹</span>
</div>
@ -97,7 +92,6 @@
alt=""
id="picture-img"
style="user-select: none"
@load="canvasLoad"
/>
<canvas id="picture"></canvas>
</div>
@ -173,8 +167,8 @@
type="primary"
size="large"
@click="btnClick('lock')"
:disabled="isLockStatus || isLockDisabled"
>{{ isLockStatus ? "已锁定" : "锁 定" }}</el-button
:disabled="isLock"
> </el-button
>
</div>
</div>
@ -242,7 +236,6 @@
<span>考号长度</span>
<div>
<el-input-number
:disabled="isLockStatus"
:min="4"
:max="12"
v-model="drawerForm.examId.examIdLength"
@ -277,9 +270,9 @@
</div>
</div>
<FabricSize
:change="changeFabricPositionNumber"
:change="changeFabricPosition"
ref="FabricSizeRef"
v-if="currentFabric"
v-if="ctx.getActiveObject()"
/>
</div>
<div class="drawer-custom-style-body-footer">
@ -317,10 +310,7 @@
<div>
<span>排列</span>
<div>
<el-radio-group
v-model="drawerForm.objective.range"
:disabled="isLockStatus"
>
<el-radio-group v-model="drawerForm.objective.range">
<el-radio :value="0">横向</el-radio>
<el-radio :value="1">竖向</el-radio>
</el-radio-group>
@ -333,7 +323,7 @@
style="width: 164px"
v-model="drawerForm.objective.optionNumber"
:min="2"
:disabled="drawerForm.objective.questionTypeValue === 2 || isLockStatus"
:disabled="drawerForm.objective.questionTypeValue === 2"
:step-strictly="true"
:max="24"
/>
@ -343,7 +333,6 @@
<span>题量</span>
<div>
<el-input-number
:disabled="isLockStatus"
style="width: 164px"
v-model="drawerForm.objective.questionNumber"
:min="1"
@ -356,7 +345,6 @@
<span>题号</span>
<div>
<el-input-number
:disabled="isLockStatus"
v-model="drawerForm.objective.questionBefore"
:min="1"
:controls="false"
@ -376,7 +364,6 @@
<span>每题分数</span>
<div>
<el-input-number
:disabled="isLockStatus"
style="width: 164px"
v-model="drawerForm.objective.score"
:min="0"
@ -415,9 +402,9 @@
</div>
</div>
<FabricSize
:change="changeFabricPositionNumber"
:change="changeFabricPosition"
ref="FabricSizeRef"
v-if="currentFabric"
v-if="ctx.getActiveObject()"
/>
</div>
<div class="drawer-custom-style-body-footer">
@ -462,7 +449,6 @@
<div>
<el-input-number
v-model="drawerForm.subjective.questionBefore"
:disabled="isLockStatus"
:min="1"
:controls="false"
:step-strictly="true"
@ -475,7 +461,6 @@
<el-input-number
v-model="drawerForm.subjective.questionAfter"
:disabled="isLockStatus"
:min="1"
:controls="false"
:step-strictly="true"
@ -488,7 +473,6 @@
<div>
<el-input-number
v-model="drawerForm.subjective.score"
:disabled="isLockStatus"
style="width: 152px"
:min="0"
:precision="1"
@ -497,9 +481,9 @@
</div>
</div>
<FabricSize
:change="changeFabricPositionNumber"
:change="changeFabricPosition"
ref="FabricSizeRef"
v-if="currentFabric"
v-if="ctx.getActiveObject()"
/>
</div>
<div class="drawer-custom-style-body-footer">
@ -732,8 +716,7 @@ const templateInfo = reactive<any>({
questionList: [],
otherData: [],
});
const isLockStatus = ref<boolean>(false);
const isLockDisabled = ref<boolean>(false);
const isLock = ref<boolean>(false);
const currentNavListIndex = ref<number>(3);
//
const ctx = ref<any>(null);
@ -744,8 +727,7 @@ const currentFabric = ref<any>(null);
onMounted(() => {
GetOcrDetail(router.currentRoute.value.query.mid as string).then((res: any) => {
if (res.code === 200) {
const { mainName, hasPosition, paperType, detail, isLock } = res.data;
isLockStatus.value = isLock;
const { mainName, hasPosition, paperType, detail } = res.data;
templateInfo.name = mainName;
templateInfo.hasPosition = hasPosition;
templateInfo.type = paperType === 1 ? "A3" : "A4";
@ -758,6 +740,18 @@ onMounted(() => {
: (templateInfo.tailsList = JSON.parse(JSON.parse(item.tempData).tempData));
}
});
nextTick(() => {
initCanvas();
navListIndex.value = templateInfo.hasPosition ? 0 : 1; //1
if (!templateInfo.hasPosition) {
//
navList.splice(0, 1);
}
setQuestionList(); //
showFabricData(); //
setStepClick(currentNavListIndex.value, false); //
setNavTitle(); //
});
}
});
});
@ -766,51 +760,34 @@ watch(
() => templateInfo,
(_new, _old) => {
if (!_new.headList[2].point.length && !_new.tailsList[2].point.length) {
isLockDisabled.value = true;
isLock.value = true;
currentNavListIndex.value = 2;
return;
}
if (!_new.headList[1].point.length && !_new.tailsList[1].point.length) {
isLockDisabled.value = true;
isLock.value = true;
currentNavListIndex.value = 1;
return;
}
if (_new.hasPosition) {
if (_new.imgSrc.length === 2) {
if (_new.headList[0].point.length !== 4 || _new.tailsList[0].point.length !== 4) {
isLockDisabled.value = true;
isLock.value = true;
currentNavListIndex.value = 0;
return;
}
} else {
if (_new.headList[0].point.length !== 4) {
isLockDisabled.value = true;
isLock.value = true;
currentNavListIndex.value = 0;
return;
}
}
}
isLockDisabled.value = false;
isLock.value = false;
},
{ deep: true }
);
//
const canvasLoad = (): void => {
if (!ctx.value) {
initCanvas();
navListIndex.value = templateInfo.hasPosition ? 0 : 1; //1
if (!templateInfo.hasPosition) {
//
navList.splice(0, 1);
}
setQuestionList(); //
showFabricData(); //
setStepClick(currentNavListIndex.value, false); //
setNavTitle(); //
}
};
//
const initCanvas = (): void => {
imgDom.value = document.getElementById("picture-img");
@ -819,10 +796,6 @@ const initCanvas = (): void => {
height: imgDom.value.clientHeight,
});
ctx.value.on("mouse:down", (e: any) => {
if (isLockStatus.value && !e.target) {
ElMessage.error("已锁定,无法新增!");
return;
}
const templateInfoItem = getTemplateInfo(true);
if (templateInfoItem[0].point.length === 4) {
if (isMoveOutView()) {
@ -839,9 +812,6 @@ const initCanvas = (): void => {
}
}
}
if (e.target) {
setStepClick(e.target.get("fabricType"));
}
canvasMouseDown(e.e, e.target, e.subTargets);
});
ctx.value.on("mouse:move", (e: any) => {
@ -930,15 +900,9 @@ const canvasMouseDown = (e: MouseEvent, target: any, subTargets: any): void => {
const itemTarget = target
.getObjects()
.find((i: any) => i.fabricId === row.fabricId);
if (itemTarget && row.fabricId === itemTarget.fabricId) {
if (isLockStatus.value && itemTarget.get("text") === "删除") {
row.set({ visible: false });
} else {
itemTarget.set({ visible: true });
}
} else {
row.set({ visible: false });
}
itemTarget && row.fabricId === itemTarget.fabricId
? itemTarget.set({ visible: true })
: row.set({ visible: false });
} else {
row.set({ visible: false });
}
@ -1004,7 +968,7 @@ const canvasMouseUp = async (): Promise<void> => {
hasControls: false,
subTargetCheck: true,
borderColor: "transparent",
selectionBackgroundColor: "red",
selectionBackgroundColor: "transparent",
fabricType: navListIndex.value,
fabricId: cteatedNumber(),
}).on("mousemove", (e: any) => {
@ -1047,13 +1011,9 @@ const canvasMouseUp = async (): Promise<void> => {
}).then((res) => {
if (res.code === 200) {
const rectTitle = ["右上角", "右下角"];
const rectFooterTitle = ["左下角", "右下角"];
if (rectTitle.includes(getCurrentText())) {
res.data.x = res.data.x + res.data.width;
}
if (rectFooterTitle.includes(getCurrentText())) {
res.data.y = res.data.y - res.data.height;
}
addFabric(
"rect",
{ ...obj, title: getTextTitle(), rectPosition: res.data },
@ -1061,9 +1021,7 @@ const canvasMouseUp = async (): Promise<void> => {
left: rectTitle.includes(getCurrentText())
? res.data.x - res.data.width
: res.data.x,
top: rectFooterTitle.includes(getCurrentText())
? res.data.y + res.data.height
: res.data.y,
top: res.data.y,
width: res.data.width,
height: res.data.height,
stroke: "red",
@ -1486,7 +1444,7 @@ const isDisabledDraw = (): boolean => {
fabricItem.forEach((item: any) => {
let row = item.getObjects().filter((obj: any) => obj.get("text") === "缺考");
if (row) {
hasQueKao.push(...row);
hasQueKao.push(row);
}
});
isDisabledDrawStatus = hasQueKao.length === 0;
@ -1647,7 +1605,7 @@ const showFabricData = (): void => {
hasControls: false,
subTargetCheck: true,
borderColor: "transparent",
selectionBackgroundColor: "rgba(255,0,0,0.5)",
selectionBackgroundColor: "transparent",
fabricType: item.fabricType,
left: item.left,
top: item.top,
@ -1714,22 +1672,6 @@ const cteatedNumber = (): string => {
return `${Math.floor(Math.random() * 100000000)}+${+new Date()}`;
};
//
const changeFabricPositionNumber = (value: number | boolean, str: string): void => {
let number = 0;
if (typeof value === "boolean") {
number = JSON.parse(JSON.stringify(currentFabric.value.target.get(str)));
if (value) {
number--;
} else {
number++;
}
} else {
number = value;
}
changeFabricPosition(number, str);
};
//
const changeFabricPosition = (value: number, str: string): void => {
if (value) {
@ -1999,7 +1941,7 @@ const changeFabricInfo = (bool: boolean): void => {
left: fabricItem.get("customFrom").left,
top: fabricItem.get("customFrom").top,
width: fabricItem.get("customFrom").width,
height: fabricItem.get("customFrom").height,
height: fabricItem.get("customFrom").top,
};
if (bool) {
switch (navListIndex.value) {
@ -2297,11 +2239,11 @@ const objectiveNumber = (
): void => {
//
const obj = {
fontSize: 12,
fontSize: 14,
fill: "black",
fontWeight: "normal",
fontWeight: "bold",
fabricId: cteatedNumber(),
backgroundColor: "transparent",
backgroundColor: "rgba(255,255,255,0.7)",
};
if (drawerForm.objective.range) {
//
@ -2534,10 +2476,6 @@ const isQuestionNumerRepeat = (): boolean => {
//
const changeExamType = (type: number): void => {
if (isLockStatus.value) {
ElMessage.error("已锁定,无法修改!");
return;
}
drawerForm.examId.examType = type;
};
@ -2578,10 +2516,6 @@ const changeQuestion = (e?: any): void => {
//
const changeObjectiveQuestionType = (item: { value: number; text: string }): void => {
if (isLockStatus.value) {
ElMessage.error("已锁定,无法修改!");
return;
}
if (navListIndex.value === 3) {
drawerForm.objective.questionTypeValue = item.value;
drawerForm.objective.optionNumber =
@ -2910,7 +2844,7 @@ const changeData = (): any => {
...row.customFrom,
width: row.width,
height: row.height - 36.16,
top: row.top + 17,
top: row.top + 20,
left: row.left,
};
});
@ -2919,7 +2853,7 @@ const changeData = (): any => {
...row.customFrom,
width: row.width,
height: row.height - 36.16,
top: row.top + 17,
top: row.top + 20,
left: row.left,
};
});
@ -2928,7 +2862,7 @@ const changeData = (): any => {
...row.customFrom,
width: row.width,
height: row.height - 36.16,
top: row.top + 17,
top: row.top + 20,
left: row.left,
};
});
@ -2936,8 +2870,8 @@ const changeData = (): any => {
return {
...row.customFrom,
width: row.width,
height: row.height - 36.16 / 2,
top: row.top + 17,
height: row.height,
top: row.top + 20,
left: row.left,
};
});
@ -3204,19 +3138,14 @@ const save = async (isShow: boolean = false): Promise<void> => {
width: 100%;
overflow: auto;
@mixin isPageType($type) {
@mixin isPageType($number, $type) {
width: 100%;
height: 100%;
> #zoom-div {
margin: 0 auto;
@if $type == "A3" {
width: 1570px;
} @else {
width: 1200px;
}
height: auto;
width: calc(210mm * #{$number});
height: 297mm;
flex-shrink: 0;
position: relative;
transform-origin: left top;
@ -3264,11 +3193,11 @@ const save = async (isShow: boolean = false): Promise<void> => {
}
.A4 {
@include isPageType("A4");
@include isPageType(1, "A4");
}
.A3 {
@include isPageType("A3");
@include isPageType(2, "A3");
}
}
}