|
@@ -0,0 +1,207 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="main">
|
|
|
+ <div class="main-search"></div>
|
|
|
+ <div class="main-btns"></div>
|
|
|
+ <div class="main-table"></div>
|
|
|
+ <div class="main-footer"></div>
|
|
|
+ </div>
|
|
|
+ <el-container>
|
|
|
+ <el-header>
|
|
|
+ <div class="left-panel">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="add">{{
|
|
|
+ $t("create")
|
|
|
+ }}</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="right-panel">
|
|
|
+ <div class="right-panel-search">
|
|
|
+ <el-input v-model="search.Keyword" clearable :placeholder="$t('pleaseInput')">
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="upsearch">{{
|
|
|
+ $t("query")
|
|
|
+ }}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-header>
|
|
|
+ <el-main class="nopadding">
|
|
|
+ <scTable ref="table" :apiObj="apiObj" :pageSize="10" row-key="ReportTemplateCode"
|
|
|
+ @selection-change="selectionChange" stripe :hideDo="true">
|
|
|
+ <el-table-column :label="$t('reportTemplate.name')" prop="ReportTemplateName"></el-table-column>
|
|
|
+ <el-table-column :label="$t('reportTemplate.usageType')" prop="reportTemplateUsageType">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{
|
|
|
+ $t("reportTemplate.usageType" + scope.row.ThesaurusUsageType)
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('reportTemplate.state')" prop="ReportTemplateStateType">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{
|
|
|
+ $t(
|
|
|
+ "reportTemplate.state" +
|
|
|
+ (scope.row.ReportTemplateUser.length > 0
|
|
|
+ ? "2"
|
|
|
+ : scope.row.ReportTemplateStateType)
|
|
|
+ )
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('reportTemplate.defaultReportTemplate')" prop="IsDefault">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ $t(scope.row.IsDefault ? "yes" : "no") }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('reportTemplate.language')" prop="LanguageCode">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ $t(`${scope.row.LanguageCode || ""}`) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('operate')" fixed="right" align="center" width="210">
|
|
|
+ <template #default="scope">
|
|
|
+ <!-- 编辑 -->
|
|
|
+ <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">{{ $t("edit")
|
|
|
+ }}</el-button>
|
|
|
+ <!-- 删除 -->
|
|
|
+ <el-popconfirm :title="$t('reportTemplate.delTip')" @confirm="table_del(scope.row, scope.$index)">
|
|
|
+ <template #reference>
|
|
|
+ <el-button type="text" size="small" :disabled="scope.row.ReportTemplateUser.length">{{
|
|
|
+ $t("delete")
|
|
|
+ }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ <!-- 更多 -->
|
|
|
+ <el-divider direction="vertical"></el-divider>
|
|
|
+ <el-dropdown @command="handleCommand">
|
|
|
+ <el-button type="text" size="small">{{ $t("more")
|
|
|
+ }}<el-icon class="el-icon--right">
|
|
|
+ <el-icon-arrow-down />
|
|
|
+ </el-icon>
|
|
|
+ </el-button>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item command="table_publish"
|
|
|
+ :disabled="scope.row.ThesaurusStateType != 0"
|
|
|
+ @click="table_publish(scope.row, scope.$index)">{{ $t("reportTemplate.publish") }}
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item command="table_userList" divided
|
|
|
+ @click="table_userList(scope.row, scope.$index)">{{ $t("reportTemplate.userList") }}
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item command="table_Setting1"
|
|
|
+ @click="table_thesaurusItem(scope.row, scope.$index)">{{
|
|
|
+ $t("reportTemplate.reportTemplateItemView")
|
|
|
+ }}</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </scTable>
|
|
|
+ </el-main>
|
|
|
+ </el-container>
|
|
|
+ <save-dialog v-if="dialog.show" ref="saveDialog" @success="refresh" @closed="dialog.show = false"></save-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import saveDialog from "./reportTemplateDetail";
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ saveDialog,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dialog: {
|
|
|
+ show: false,
|
|
|
+ showUserList: false,
|
|
|
+ },
|
|
|
+ apiObj: this.query,
|
|
|
+ search: {
|
|
|
+ Keyword: null,
|
|
|
+ },
|
|
|
+ selection: [],
|
|
|
+ command: true,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async query(params) {
|
|
|
+ return await this.$API.wing.list("FindReportTemplatePagesAsync", params);
|
|
|
+ },
|
|
|
+ //搜索
|
|
|
+ upsearch() {
|
|
|
+ this.$refs.table.upData(this.search);
|
|
|
+ },
|
|
|
+ //刷新当前页
|
|
|
+ refresh() {
|
|
|
+ this.$refs.table.refresh();
|
|
|
+ },
|
|
|
+ //增加
|
|
|
+ add() {
|
|
|
+ this.dialog.show = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.saveDialog.open();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCommand() {
|
|
|
+ this.command = true;
|
|
|
+ },
|
|
|
+ canCommand() {
|
|
|
+ if (!this.command) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.command = false;
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ //编辑
|
|
|
+ table_edit(row) {
|
|
|
+ this.dialog.show = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.saveDialog.open(true).setData(row);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //发布
|
|
|
+ table_publish(row) {
|
|
|
+ if (row.ReportTemplateStateType != 0 || !this.canCommand()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm(
|
|
|
+ this.$t("reportTemplate.publishTip"),
|
|
|
+ this.$t("reportTemplate.publish"),
|
|
|
+ {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: this.$t("dialogBox.confirmButtonText"),
|
|
|
+ cancelButtonText: this.$t("dialogBox.cancelButtonText"),
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ this.$API.wing.post(
|
|
|
+ "PublishReportTemplateAsync",
|
|
|
+ {
|
|
|
+ ReportTemplateCode: row.ReportTemplateCode,
|
|
|
+ },
|
|
|
+ this.refresh
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .catch(() => { })
|
|
|
+ .finally(() => { });
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ async table_del(row) {
|
|
|
+ await this.$API.wing.post(
|
|
|
+ "DeleteReportTemplateAsync",
|
|
|
+ {
|
|
|
+ ReportTemplateCode: row.ReportTemplateCode,
|
|
|
+ },
|
|
|
+ this.refresh
|
|
|
+ );
|
|
|
+ },
|
|
|
+ //表格选择后回调事件
|
|
|
+ selectionChange(selection) {
|
|
|
+ this.selection = selection;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+</style>
|