|
@@ -120,7 +120,7 @@
|
|
size="mini"
|
|
size="mini"
|
|
icon="el-icon-menu"
|
|
icon="el-icon-menu"
|
|
v-if="scope.row.btnType == 'BACKUP'"
|
|
v-if="scope.row.btnType == 'BACKUP'"
|
|
- @click="editBackupSetting(scope.row);"
|
|
|
|
|
|
+ @click="openBackupSettingDialog"
|
|
:disabled="!hasPermit"
|
|
:disabled="!hasPermit"
|
|
>备份设置
|
|
>备份设置
|
|
</el-button>
|
|
</el-button>
|
|
@@ -148,6 +148,96 @@
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <!-- 备份设置弹窗 -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="备份设置"
|
|
|
|
+ width="500px"
|
|
|
|
+ :visible.sync="backupSettingDialog"
|
|
|
|
+ @close="closeBackupSettingDialog"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ :model="backupSettingForm"
|
|
|
|
+ ref="backupSettingForm"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ label-position="right"
|
|
|
|
+ label-width="80px"
|
|
|
|
+ >
|
|
|
|
+ <el-tabs v-model="eachPkgTab">
|
|
|
|
+ <el-tab-pane name="first">
|
|
|
|
+ <span slot="label"
|
|
|
|
+ >每袋冗余设置
|
|
|
|
+ <el-switch v-model="backupSettingForm.needEachPkg"></el-switch
|
|
|
|
+ ></span>
|
|
|
|
+ <el-form-item label="比例" prop="eachPkgPercent">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="backupSettingForm.eachPkgPercent"
|
|
|
|
+ :disabled="!backupSettingForm.needEachPkg"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="最大" prop="eachPkgMax">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="backupSettingForm.eachPkgMax"
|
|
|
|
+ :disabled="!backupSettingForm.needEachPkg"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="最小" prop="eachPkgMin">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="backupSettingForm.eachPkgMin"
|
|
|
|
+ :disabled="!backupSettingForm.needEachPkg"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
|
|
+
|
|
|
|
+ <el-tabs v-model="alonePkgTab">
|
|
|
|
+ <el-tab-pane name="first">
|
|
|
|
+ <span slot="label"
|
|
|
|
+ >单独备份袋设置
|
|
|
|
+ <el-switch v-model="backupSettingForm.needAlonePkg"></el-switch
|
|
|
|
+ ></span>
|
|
|
|
+ <el-form-item label="归集参数" prop="groupType">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="backupSettingForm.groupType"
|
|
|
|
+ :disabled="!backupSettingForm.needAlonePkg"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in groupTypeList"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="比例" prop="alonePkgPercent">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="backupSettingForm.alonePkgPercent"
|
|
|
|
+ :disabled="!backupSettingForm.needAlonePkg"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="最大" prop="alonePkgMax">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="backupSettingForm.alonePkgMax"
|
|
|
|
+ :disabled="!backupSettingForm.needAlonePkg"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="最小" prop="alonePkgMin">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="backupSettingForm.alonePkgMin"
|
|
|
|
+ :disabled="!backupSettingForm.needAlonePkg"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div style="text-align: center;">
|
|
|
|
+ <el-button type="primary" @click="editBackupSetting"
|
|
|
|
+ >确 定
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button @click="closeBackupSettingDialog">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
<!-- 其它事项弹窗 -->
|
|
<!-- 其它事项弹窗 -->
|
|
<el-dialog
|
|
<el-dialog
|
|
title="其它事项"
|
|
title="其它事项"
|
|
@@ -181,25 +271,110 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { PRINT_API } from "@/constants/constants";
|
|
import { PRINT_API } from "@/constants/constants";
|
|
-import { userRole } from "../constants/constants.js";
|
|
|
|
|
|
+import { userRole, groupTypeList } from "../constants/constants.js";
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
|
|
+ let validateEachPkgPercent = (rule, value, callback) => {
|
|
|
|
+ if (this.backupSettingForm.needEachPkg) {
|
|
|
|
+ if (this.isEmptyNumber(this.backupSettingForm.eachPkgPercent)) {
|
|
|
|
+ callback(new Error("请输入正确的数值!"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ callback();
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let validateEachPkgMax = (rule, value, callback) => {
|
|
|
|
+ if (this.backupSettingForm.needEachPkg) {
|
|
|
|
+ if (this.isEmptyNumber(this.backupSettingForm.eachPkgMax)) {
|
|
|
|
+ callback(new Error("请输入正确的数值!"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ callback();
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let validateEachPkgMin = (rule, value, callback) => {
|
|
|
|
+ if (this.backupSettingForm.needEachPkg) {
|
|
|
|
+ if (this.isEmptyNumber(this.backupSettingForm.eachPkgMin)) {
|
|
|
|
+ callback(new Error("请输入正确的数值!"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ callback();
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let validateAlonePkgPercent = (rule, value, callback) => {
|
|
|
|
+ if (this.backupSettingForm.needAlonePkg) {
|
|
|
|
+ if (this.isEmptyNumber(this.backupSettingForm.alonePkgPercent)) {
|
|
|
|
+ callback(new Error("请输入正确的数值!"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ callback();
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let validateAlonePkgMax = (rule, value, callback) => {
|
|
|
|
+ if (this.backupSettingForm.needAlonePkg) {
|
|
|
|
+ if (this.isEmptyNumber(this.backupSettingForm.alonePkgMax)) {
|
|
|
|
+ callback(new Error("请输入正确的数值!"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ callback();
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let validateAlonePkgMin = (rule, value, callback) => {
|
|
|
|
+ if (this.backupSettingForm.needAlonePkg) {
|
|
|
|
+ if (this.isEmptyNumber(this.backupSettingForm.alonePkgMin)) {
|
|
|
|
+ callback(new Error("请输入正确的数值!"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ callback();
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let validateGroupType = (rule, value, callback) => {
|
|
|
|
+ if (this.backupSettingForm.needAlonePkg) {
|
|
|
|
+ if (this.isEmptyStr(this.backupSettingForm.groupType)) {
|
|
|
|
+ callback(new Error("请选择归集参数!"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ callback();
|
|
|
|
+ };
|
|
|
|
+
|
|
return {
|
|
return {
|
|
formSearch: {
|
|
formSearch: {
|
|
orgId: "",
|
|
orgId: "",
|
|
examId: ""
|
|
examId: ""
|
|
},
|
|
},
|
|
curUserRole: userRole,
|
|
curUserRole: userRole,
|
|
|
|
+ groupTypeList: groupTypeList,
|
|
hasPermit: false,
|
|
hasPermit: false,
|
|
loading: false,
|
|
loading: false,
|
|
showGoBack: false,
|
|
showGoBack: false,
|
|
tableData: [],
|
|
tableData: [],
|
|
projectId: "",
|
|
projectId: "",
|
|
|
|
+ eachPkgTab: "first",
|
|
|
|
+ alonePkgTab: "first",
|
|
orgList: [],
|
|
orgList: [],
|
|
examList: [],
|
|
examList: [],
|
|
backupSettingDialog: false,
|
|
backupSettingDialog: false,
|
|
|
|
+ backupSettingForm: {
|
|
|
|
+ projectId: "",
|
|
|
|
+ needAlonePkg: true,
|
|
|
|
+ needEachPkg: true,
|
|
|
|
+ eachPkgPercent: "",
|
|
|
|
+ eachPkgMax: "",
|
|
|
|
+ eachPkgMin: "",
|
|
|
|
+ alonePkgPercent: "",
|
|
|
|
+ alonePkgMax: "",
|
|
|
|
+ alonePkgMin: "",
|
|
|
|
+ groupType: ""
|
|
|
|
+ },
|
|
otherSettingDialog: false,
|
|
otherSettingDialog: false,
|
|
otherSettingForm: {
|
|
otherSettingForm: {
|
|
id: "",
|
|
id: "",
|
|
@@ -207,7 +382,60 @@ export default {
|
|
remark: ""
|
|
remark: ""
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- remark: [{ required: true, message: "请输入事项内容", trigger: "blur" }]
|
|
|
|
|
|
+ eachPkgPercent: [
|
|
|
|
+ {
|
|
|
|
+ type: "number",
|
|
|
|
+ required: true,
|
|
|
|
+ validator: validateEachPkgPercent,
|
|
|
|
+ trigger: "blur"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ eachPkgMax: [
|
|
|
|
+ {
|
|
|
|
+ type: "number",
|
|
|
|
+ required: true,
|
|
|
|
+ validator: validateEachPkgMax,
|
|
|
|
+ trigger: "blur"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ eachPkgMin: [
|
|
|
|
+ {
|
|
|
|
+ type: "number",
|
|
|
|
+ required: true,
|
|
|
|
+ validator: validateEachPkgMin,
|
|
|
|
+ trigger: "blur"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ alonePkgPercent: [
|
|
|
|
+ {
|
|
|
|
+ type: "number",
|
|
|
|
+ required: true,
|
|
|
|
+ validator: validateAlonePkgPercent,
|
|
|
|
+ trigger: "blur"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ alonePkgMax: [
|
|
|
|
+ {
|
|
|
|
+ type: "number",
|
|
|
|
+ required: true,
|
|
|
|
+ validator: validateAlonePkgMax,
|
|
|
|
+ trigger: "blur"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ alonePkgMin: [
|
|
|
|
+ {
|
|
|
|
+ type: "number",
|
|
|
|
+ required: true,
|
|
|
|
+ validator: validateAlonePkgMin,
|
|
|
|
+ trigger: "blur"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ groupType: [
|
|
|
|
+ { required: true, validator: validateGroupType, trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ remark: [
|
|
|
|
+ { required: true, message: "请输入事项内容!", trigger: "blur" }
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -296,20 +524,105 @@ export default {
|
|
},
|
|
},
|
|
refreshStatistic() {
|
|
refreshStatistic() {
|
|
/* 刷新当前统计信息 */
|
|
/* 刷新当前统计信息 */
|
|
- console.log(this.projectId);
|
|
|
|
- this.$notify({
|
|
|
|
- message: "Todo...",
|
|
|
|
|
|
+ this.$confirm("刷新当前统计信息?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
type: "warning"
|
|
type: "warning"
|
|
- });
|
|
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ let url =
|
|
|
|
+ PRINT_API +
|
|
|
|
+ "/printing/project/statistic/refresh/" +
|
|
|
|
+ +this.formSearch.orgId +
|
|
|
|
+ "/" +
|
|
|
|
+ this.formSearch.examId;
|
|
|
|
+ this.$http.post(url).then(
|
|
|
|
+ () => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "刷新成功!"
|
|
|
|
+ });
|
|
|
|
+ this.searchRecords();
|
|
|
|
+ },
|
|
|
|
+ () => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "刷新失败!"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ //ignore
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- editBackupSetting(row) {
|
|
|
|
- /* 备份设置 */
|
|
|
|
- console.log(row);
|
|
|
|
- this.$notify({
|
|
|
|
- message: "Todo...",
|
|
|
|
- type: "warning"
|
|
|
|
|
|
+ editBackupSetting() {
|
|
|
|
+ /* 保存备份设置 */
|
|
|
|
+ this.$refs.backupSettingForm.validate(valid => {
|
|
|
|
+ if (!valid) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (
|
|
|
|
+ !this.backupSettingForm.needEachPkg &&
|
|
|
|
+ !this.backupSettingForm.needAlonePkg
|
|
|
|
+ ) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "请至少选择一种备份方式!",
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let url = PRINT_API + "/project/backup/setting/save";
|
|
|
|
+ this.$http.post(url, this.backupSettingForm).then(
|
|
|
|
+ () => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "保存备份设置成功!"
|
|
|
|
+ });
|
|
|
|
+ this.backupSettingDialog = false;
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ console.log(error);
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "保存备份设置失败!",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ );
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ openBackupSettingDialog() {
|
|
|
|
+ /* 打开备份设置弹窗 */
|
|
|
|
+ let url = PRINT_API + "/project/backup/setting/" + this.projectId;
|
|
|
|
+ this.$http.post(url).then(
|
|
|
|
+ response => {
|
|
|
|
+ this.backupSettingForm = response.data;
|
|
|
|
+ this.$refs.backupSettingForm.validate();
|
|
|
|
+ },
|
|
|
|
+ () => {
|
|
|
|
+ this.backupSettingForm = {
|
|
|
|
+ projectId: this.projectId,
|
|
|
|
+ needAlonePkg: true,
|
|
|
|
+ needEachPkg: true,
|
|
|
|
+ eachPkgPercent: "",
|
|
|
|
+ eachPkgMax: "",
|
|
|
|
+ eachPkgMin: "",
|
|
|
|
+ alonePkgPercent: "",
|
|
|
|
+ alonePkgMax: "",
|
|
|
|
+ alonePkgMin: "",
|
|
|
|
+ groupType: ""
|
|
|
|
+ };
|
|
|
|
+ this.$refs.backupSettingForm.validate();
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ this.backupSettingDialog = true;
|
|
|
|
+ },
|
|
|
|
+ closeBackupSettingDialog() {
|
|
|
|
+ /* 关闭备份设置弹窗 */
|
|
|
|
+ this.backupSettingDialog = false;
|
|
|
|
+ },
|
|
loadOtherSetting(projectId) {
|
|
loadOtherSetting(projectId) {
|
|
/* 查询其它事项列表 */
|
|
/* 查询其它事项列表 */
|
|
let url =
|
|
let url =
|
|
@@ -361,28 +674,32 @@ export default {
|
|
},
|
|
},
|
|
removeOtherSetting(row) {
|
|
removeOtherSetting(row) {
|
|
/* 删除某个其它事项 */
|
|
/* 删除某个其它事项 */
|
|
- this.$confirm("确定删除当前事项?", "提示", {
|
|
|
|
|
|
+ this.$confirm("确定删除当前事项吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning"
|
|
type: "warning"
|
|
- }).then(() => {
|
|
|
|
- var url = PRINT_API + "/project/other/setting/delete/" + row.id;
|
|
|
|
- this.$http.post(url).then(
|
|
|
|
- () => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "success",
|
|
|
|
- message: "删除当前事项成功!"
|
|
|
|
- });
|
|
|
|
- this.searchRecords();
|
|
|
|
- },
|
|
|
|
- () => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "error",
|
|
|
|
- message: "删除当前事项失败!"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- });
|
|
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ var url = PRINT_API + "/project/other/setting/delete/" + row.id;
|
|
|
|
+ this.$http.post(url).then(
|
|
|
|
+ () => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "删除当前事项成功!"
|
|
|
|
+ });
|
|
|
|
+ this.searchRecords();
|
|
|
|
+ },
|
|
|
|
+ () => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "删除当前事项失败!"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ //ignore
|
|
|
|
+ });
|
|
},
|
|
},
|
|
openOtherSettingDialog(row) {
|
|
openOtherSettingDialog(row) {
|
|
/* 打开其它事项弹窗 */
|
|
/* 打开其它事项弹窗 */
|