|
@@ -43,6 +43,17 @@
|
|
<el-button type="warning" icon="icon icon-plus" @click="toAdd"
|
|
<el-button type="warning" icon="icon icon-plus" @click="toAdd"
|
|
>创建题卡</el-button
|
|
>创建题卡</el-button
|
|
>
|
|
>
|
|
|
|
+ <upload-button
|
|
|
|
+ btn-icon="icon icon-upload"
|
|
|
|
+ btn-type="default"
|
|
|
|
+ btn-content="导入题卡"
|
|
|
|
+ :upload-url="uploadUrl"
|
|
|
|
+ :format="['html']"
|
|
|
|
+ :upload-data="uploadData"
|
|
|
|
+ @upload-error="uplaodError"
|
|
|
|
+ @upload-success="uploadSuccess"
|
|
|
|
+ v-if="IS_ADMIN"
|
|
|
|
+ ></upload-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
@@ -83,30 +94,48 @@
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<el-table-column label="操作" align="center" width="120">
|
|
<el-table-column label="操作" align="center" width="120">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button
|
|
|
|
- class="btn-table-icon"
|
|
|
|
- type="text"
|
|
|
|
- icon="icon icon-edit"
|
|
|
|
- @click="toEdit(scope.row)"
|
|
|
|
- title="编辑"
|
|
|
|
- v-if="scope.row.cardStatus === 0"
|
|
|
|
- ></el-button>
|
|
|
|
- <el-button
|
|
|
|
- class="btn-table-icon"
|
|
|
|
- type="text"
|
|
|
|
- icon="icon icon-delete"
|
|
|
|
- @click="toDelete(scope.row)"
|
|
|
|
- title="删除"
|
|
|
|
- v-if="scope.row.cardStatus === 0"
|
|
|
|
- ></el-button>
|
|
|
|
- <el-button
|
|
|
|
- class="btn-table-icon"
|
|
|
|
- type="text"
|
|
|
|
- icon="icon icon-copy"
|
|
|
|
- @click="toCopy(scope.row)"
|
|
|
|
- title="复制"
|
|
|
|
- v-if="scope.row.auditingStatus !== 0"
|
|
|
|
- ></el-button>
|
|
|
|
|
|
+ <div v-if="!scope.row.isImport">
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-table-icon"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="icon icon-edit"
|
|
|
|
+ @click="toEdit(scope.row)"
|
|
|
|
+ title="编辑"
|
|
|
|
+ v-if="scope.row.cardStatus === 0"
|
|
|
|
+ ></el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-table-icon"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="icon icon-delete"
|
|
|
|
+ @click="toDelete(scope.row)"
|
|
|
|
+ title="删除"
|
|
|
|
+ v-if="scope.row.cardStatus === 0"
|
|
|
|
+ ></el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-table-icon"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="icon icon-copy"
|
|
|
|
+ @click="toCopy(scope.row)"
|
|
|
|
+ title="复制"
|
|
|
|
+ v-if="scope.row.auditingStatus !== 0"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-table-icon"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="icon icon-circle-right"
|
|
|
|
+ @click="toPreview(scope.row)"
|
|
|
|
+ title="预览"
|
|
|
|
+ ></el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-table-icon"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="icon icon-copy"
|
|
|
|
+ @click="toCopyCommon(scope.row)"
|
|
|
|
+ title="复制"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -145,11 +174,13 @@ import {
|
|
import { cardConfigInfos, cardTempDetail } from "@/modules/card/api";
|
|
import { cardConfigInfos, cardTempDetail } from "@/modules/card/api";
|
|
import { transformField } from "@/modules/card/enumerate";
|
|
import { transformField } from "@/modules/card/enumerate";
|
|
import CardOptionDialog from "../components/CardOptionDialog";
|
|
import CardOptionDialog from "../components/CardOptionDialog";
|
|
|
|
+import UploadButton from "@/components/UploadButton";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "card-manage",
|
|
name: "card-manage",
|
|
components: {
|
|
components: {
|
|
- CardOptionDialog
|
|
|
|
|
|
+ CardOptionDialog,
|
|
|
|
+ UploadButton
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -163,10 +194,20 @@ export default {
|
|
total: 0,
|
|
total: 0,
|
|
visible: false,
|
|
visible: false,
|
|
AUDITING_STATUS,
|
|
AUDITING_STATUS,
|
|
- cards: []
|
|
|
|
|
|
+ cards: [],
|
|
|
|
+ // import card
|
|
|
|
+ IS_ADMIN: false,
|
|
|
|
+ uploadData: {
|
|
|
|
+ schoolId: this.$ls.get("schoolId"),
|
|
|
|
+ userId: this.$ls.get("user", { id: "" }).id
|
|
|
|
+ },
|
|
|
|
+ uploadUrl: "/api/print/card/card/impHtml"
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
|
|
+ const roleCode = this.$ls.get("user", { roleCode: "" }).roleCode;
|
|
|
|
+ this.IS_ADMIN =
|
|
|
|
+ roleCode.includes("ADMIN") || roleCode.includes("SUPER_ADMIN");
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -257,6 +298,22 @@ export default {
|
|
|
|
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
+ toPreview(row) {
|
|
|
|
+ window.open(
|
|
|
|
+ this.getRouterPath({
|
|
|
|
+ name: "CardPreview",
|
|
|
|
+ params: {
|
|
|
|
+ cardId: row.id,
|
|
|
|
+ viewType: "view"
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ async toCopyCommon(row) {
|
|
|
|
+ await copyCard(row.id);
|
|
|
|
+ this.$message.success("复制成功!");
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
compareCardConfig(sysConfig, curConfig) {
|
|
compareCardConfig(sysConfig, curConfig) {
|
|
let isChange = false;
|
|
let isChange = false;
|
|
Object.keys(sysConfig).forEach(key => {
|
|
Object.keys(sysConfig).forEach(key => {
|
|
@@ -307,6 +364,14 @@ export default {
|
|
this.deletePageLastItem();
|
|
this.deletePageLastItem();
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
|
|
+ },
|
|
|
|
+ // import card
|
|
|
|
+ uplaodError(errorData) {
|
|
|
|
+ this.$notify.error({ title: "错误提示", message: errorData.message });
|
|
|
|
+ },
|
|
|
|
+ uploadSuccess(res) {
|
|
|
|
+ this.$message.success("上传成功!");
|
|
|
|
+ this.getList();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteLeave(to, from, next) {
|
|
beforeRouteLeave(to, from, next) {
|