|
@@ -4,223 +4,230 @@
|
|
|
@Date: 2021-05-17 15:59
|
|
|
-->
|
|
|
<template>
|
|
|
- <!-- <dg-card header="应用列表"> -->
|
|
|
- <div>
|
|
|
- <!-- 搜索项 -->
|
|
|
- <el-form :inline="true" class="search-form">
|
|
|
- <el-form-item label="应用系统名称">
|
|
|
- <el-input v-model="form.applyName.value" placeholder="请输入应用系统名称" clearable></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="应用系统在用标识">
|
|
|
- <dg-select code="DM_APPLY_STATUS" v-model="form.applyStatus.value" placeholder="请选择应用系统在用标识" clearable></dg-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <dg-button type="primary" @click="handleSearch" icon="el-icon-search">查询</dg-button>
|
|
|
- <dg-button type="primary" @click="handleReset" icon="el-icon-refresh-right">重置</dg-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <!-- 操作 -->
|
|
|
- <dg-row zebra="10px">
|
|
|
- <dg-button type="primary" icon="el-icon-upload2" @click="handleImport">导入</dg-button>
|
|
|
- <dg-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd">新增</dg-button>
|
|
|
- <dg-button type="primary" icon="el-icon-refresh" @click="handleSync">同步</dg-button>
|
|
|
- </dg-row>
|
|
|
- <!-- 表格 -->
|
|
|
- <dg-table
|
|
|
- ref="table"
|
|
|
- :url="tableUrl"
|
|
|
- :condition="form"
|
|
|
- border
|
|
|
- row-key="id"
|
|
|
- >
|
|
|
- <dg-table-column type="index" width="75" label="序号" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="applyCode" label="应用系统编号" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="applyName" label="应用系统名称" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="appEnglishName" label="应用英文名称" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="applyStatus" label="应用系统在用标识" align="center" code="DM_APPLY_STATUS">
|
|
|
- <!-- <template slot-scope="scope">
|
|
|
- {{ scope.row.applyStatus == "0" ? "禁用" : "启用" }}
|
|
|
- </template> -->
|
|
|
- </dg-table-column>
|
|
|
- <dg-table-column label="操作" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="u-table__operation">
|
|
|
- <el-tooltip
|
|
|
- v-for="(item, index) in optList"
|
|
|
- :key="index"
|
|
|
- :content="item.label"
|
|
|
- effect="dark"
|
|
|
- placement="top-end"
|
|
|
- >
|
|
|
- <i :class="item.label | optIcon" @click="item.on(scope.row, $event)"></i>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </dg-table-column>
|
|
|
- </dg-table>
|
|
|
- </div>
|
|
|
- <!-- </dg-card> -->
|
|
|
+ <div>
|
|
|
+ <!-- 搜索栏 -->
|
|
|
+ <search-bar :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
|
|
|
+ <!-- 操作栏 -->
|
|
|
+ <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
|
|
|
+ <!-- 表格 -->
|
|
|
+ <basic-table
|
|
|
+ ref="table"
|
|
|
+ :tableHeader="tableHeader"
|
|
|
+ :tableUrl="tableUrl"
|
|
|
+ :condition="condition"
|
|
|
+ :tableOptList="tableOptList"
|
|
|
+ @submitTableOpt="receviceOpt"
|
|
|
+ >
|
|
|
+ </basic-table>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import importFile from "@/pages/common/import";
|
|
|
-import addAppForm from "./add-app-form";
|
|
|
-import { appRestApi } from "@/api/application";
|
|
|
-import { appSync } from "@/api/sync"
|
|
|
-import addFuncForm from "./add-func-form";
|
|
|
-import { appImportUrl } from "@/api/import";
|
|
|
+import importFile from '@/pages/common/import';
|
|
|
+import addAppForm from './add-app-form';
|
|
|
+import { appRestApi } from '@/api/application';
|
|
|
+import { appSync } from '@/api/sync';
|
|
|
+import addFuncForm from './add-func-form';
|
|
|
+import { appImportUrl } from '@/api/import';
|
|
|
+import operateBar from '@/components/operate-bar';
|
|
|
+import basicTable from '@/pages/common/new-table';
|
|
|
+import searchBar from '@/components/search-bar';
|
|
|
|
|
|
export default {
|
|
|
- components: {},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- form: {
|
|
|
- applyName: {
|
|
|
- value: "",
|
|
|
- op: "like"
|
|
|
- },
|
|
|
- applyStatus: {
|
|
|
- value: "",
|
|
|
- op: "="
|
|
|
- }
|
|
|
- },
|
|
|
- tableUrl: appRestApi.table,
|
|
|
- optList: [
|
|
|
- { label: "修改", on: this.handleEdit },
|
|
|
- { label: "详情", on: this.handleViewDetail },
|
|
|
- { label: "删除", on: this.handleDelete },
|
|
|
- { label: "功能配置", on: this.handleSetFunc }
|
|
|
- ]
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {},
|
|
|
- methods: {
|
|
|
- /**
|
|
|
- * 编辑
|
|
|
- */
|
|
|
- handleEdit(row, e) {
|
|
|
- this.handleOpenForm(row.id, "编辑");
|
|
|
+ components: { operateBar, basicTable, searchBar },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ condition: {},
|
|
|
+ // 搜索栏配置
|
|
|
+ conditionForm: [
|
|
|
+ {
|
|
|
+ label: '应用系统名称',
|
|
|
+ name: 'applyName',
|
|
|
+ op: 'like',
|
|
|
+ value: '',
|
|
|
+ component: 'ElInput',
|
|
|
+ attr: {
|
|
|
+ placeholder: '请输入应用系统名称'
|
|
|
+ }
|
|
|
},
|
|
|
- /**
|
|
|
- * 查看详情
|
|
|
- */
|
|
|
- handleViewDetail(row, e) {
|
|
|
- this.handleOpenForm(row.id, "详情", true);
|
|
|
+ {
|
|
|
+ label: '应用系统在用标识',
|
|
|
+ name: 'applyStatus',
|
|
|
+ op: '=',
|
|
|
+ value: '',
|
|
|
+ component: 'DgSelect',
|
|
|
+ attr: {
|
|
|
+ placeholder: '请选择应用系统在用标识',
|
|
|
+ code: 'DM_APPLY_STATUS'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 表格请求路径
|
|
|
+ tableUrl: appRestApi.table,
|
|
|
+ // 表头
|
|
|
+ tableHeader: [
|
|
|
+ {
|
|
|
+ label: '应用系统编号',
|
|
|
+ prop: 'applyCode'
|
|
|
},
|
|
|
- /**
|
|
|
- * 删除
|
|
|
- */
|
|
|
- handleDelete(row, e) {
|
|
|
- this.$dgConfirm(`是否确认删除该条应用!`, "提示", {}).then(() => {
|
|
|
- appRestApi.del(row.id).then((res) => {
|
|
|
- this.$message.success(res);
|
|
|
- this.handleSearch();
|
|
|
- });
|
|
|
- });
|
|
|
+ {
|
|
|
+ label: '应用系统名称',
|
|
|
+ prop: 'applyName'
|
|
|
},
|
|
|
- /**
|
|
|
- * 功能配置
|
|
|
- */
|
|
|
- handleSetFunc(app, e) {
|
|
|
- const layer = this.$dgLayer({
|
|
|
- title: "功能配置",
|
|
|
- content: addFuncForm,
|
|
|
- props: {
|
|
|
- app
|
|
|
- },
|
|
|
- noneBtnField: true,
|
|
|
- area: ["1200px", "750px"]
|
|
|
- });
|
|
|
+ {
|
|
|
+ label: '应用英文名称',
|
|
|
+ prop: 'appEnglishName'
|
|
|
},
|
|
|
- /**
|
|
|
- * 查询
|
|
|
- */
|
|
|
- handleSearch() {
|
|
|
- this.$refs.table.searchForm();
|
|
|
+ {
|
|
|
+ label: '应用系统在用标识',
|
|
|
+ prop: 'applyStatus',
|
|
|
+ code: 'DM_APPLY_STATUS'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 表头操作
|
|
|
+ tableOptList: ['修改', '详情', '删除', '功能配置'],
|
|
|
+ // 页面操作
|
|
|
+ pageOptList: ['导入', '新增', '同步']
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ /**
|
|
|
+ * 接收操作事件
|
|
|
+ */
|
|
|
+ receviceOpt(type, row) {
|
|
|
+ if (type == '修改') {
|
|
|
+ this.handleEdit(row);
|
|
|
+ } else if (type == '详情') {
|
|
|
+ this.handleViewDetail(row);
|
|
|
+ } else if (type == '删除') {
|
|
|
+ this.handleDelete(row);
|
|
|
+ } else if (type == '功能配置') {
|
|
|
+ this.handleSetFunc(row);
|
|
|
+ } else if (type == '导入') {
|
|
|
+ this.handleImport();
|
|
|
+ } else if (type == '新增') {
|
|
|
+ this.handleAdd();
|
|
|
+ } else if (type == '同步') {
|
|
|
+ this.handleSync();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ */
|
|
|
+ receiveSearch(value) {
|
|
|
+ this.condition = value;
|
|
|
+ this.handleSearch();
|
|
|
+ },
|
|
|
+ handleSearch() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.table.handleSearch();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 编辑
|
|
|
+ */
|
|
|
+ handleEdit(row) {
|
|
|
+ this.handleOpenForm(row.id, '编辑');
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 查看详情
|
|
|
+ */
|
|
|
+ handleViewDetail(row) {
|
|
|
+ this.handleOpenForm(row.id, '详情', true);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+ handleDelete(row) {
|
|
|
+ this.$dgConfirm(`是否确认删除该条应用!`, '提示', {}).then(() => {
|
|
|
+ appRestApi.del(row.id).then((res) => {
|
|
|
+ this.$message.success(res);
|
|
|
+ this.handleSearch();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 功能配置
|
|
|
+ */
|
|
|
+ handleSetFunc(app) {
|
|
|
+ const layer = this.$dgLayer({
|
|
|
+ title: '功能配置',
|
|
|
+ content: addFuncForm,
|
|
|
+ props: {
|
|
|
+ app
|
|
|
},
|
|
|
- /**
|
|
|
- * 重置
|
|
|
- */
|
|
|
- handleReset() {
|
|
|
- for (const key in this.form) {
|
|
|
- this.form[key].value = "";
|
|
|
- }
|
|
|
+ noneBtnField: true,
|
|
|
+ area: ['1200px', '750px']
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 导入
|
|
|
+ */
|
|
|
+ handleImport() {
|
|
|
+ const vm = this;
|
|
|
+ const layer = this.$dgLayer({
|
|
|
+ title: '导入',
|
|
|
+ content: importFile,
|
|
|
+ props: {
|
|
|
+ temp: 'apply',
|
|
|
+ action: appImportUrl
|
|
|
},
|
|
|
- /**
|
|
|
- * 导入
|
|
|
- */
|
|
|
- handleImport() {
|
|
|
- const vm = this;
|
|
|
- const layer = this.$dgLayer({
|
|
|
- title: "导入",
|
|
|
- content: importFile,
|
|
|
- props: {
|
|
|
- temp: "apply",
|
|
|
- action: appImportUrl
|
|
|
- },
|
|
|
- on: {
|
|
|
- success(params) {
|
|
|
- vm.handleSearch();
|
|
|
- layer.close(layer.dialogIndex);
|
|
|
- }
|
|
|
- },
|
|
|
- cancel: function (index, layero) {
|
|
|
- // 关闭对应弹窗的ID
|
|
|
- layer.close(index);
|
|
|
- return false;
|
|
|
- },
|
|
|
- area: ["550px", "500px"]
|
|
|
- });
|
|
|
+ on: {
|
|
|
+ success(params) {
|
|
|
+ vm.handleSearch();
|
|
|
+ layer.close(layer.dialogIndex);
|
|
|
+ }
|
|
|
},
|
|
|
- /**
|
|
|
- * 新增
|
|
|
- */
|
|
|
- handleAdd() {
|
|
|
- this.handleOpenForm(void 0, "新增");
|
|
|
+ cancel: function (index, layero) {
|
|
|
+ // 关闭对应弹窗的ID
|
|
|
+ layer.close(index);
|
|
|
+ return false;
|
|
|
},
|
|
|
- handleOpenForm(id, title, isDetail = false) {
|
|
|
- const vm = this;
|
|
|
- const layer = this.$dgLayer({
|
|
|
- title,
|
|
|
- content: addAppForm,
|
|
|
- props: {
|
|
|
- id,
|
|
|
- isDetail
|
|
|
- },
|
|
|
- btn: ["确定", "取消"],
|
|
|
- btnAlign: "r",
|
|
|
- noneBtnField: isDetail,
|
|
|
- yes: (index) => {
|
|
|
- let _layer = layer.$children[0];
|
|
|
- _layer.saveForm().then((res) => {
|
|
|
- layer.close(index);
|
|
|
- vm.handleSearch();
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- area: ["900px", "600px"]
|
|
|
- });
|
|
|
+ area: ['550px', '500px']
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 新增
|
|
|
+ */
|
|
|
+ handleAdd() {
|
|
|
+ this.handleOpenForm(void 0, '新增');
|
|
|
+ },
|
|
|
+ handleOpenForm(id, title, isDetail = false) {
|
|
|
+ const vm = this;
|
|
|
+ const layer = this.$dgLayer({
|
|
|
+ title,
|
|
|
+ content: addAppForm,
|
|
|
+ props: {
|
|
|
+ id,
|
|
|
+ isDetail
|
|
|
},
|
|
|
- /**
|
|
|
- * 同步
|
|
|
- */
|
|
|
- handleSync() {
|
|
|
- appSync().then(res => {
|
|
|
- this.$message.success("同步中,若数据量大,可能会存在延迟,请稍后自行刷新!");
|
|
|
- // this.handleSearch();
|
|
|
- })
|
|
|
+ btn: ['确定', '取消'],
|
|
|
+ btnAlign: 'r',
|
|
|
+ noneBtnField: isDetail,
|
|
|
+ yes: (index) => {
|
|
|
+ let _layer = layer.$children[0];
|
|
|
+ _layer.saveForm().then((res) => {
|
|
|
+ layer.close(index);
|
|
|
+ vm.handleSearch();
|
|
|
+ });
|
|
|
},
|
|
|
- /**
|
|
|
- * 点击表格某行
|
|
|
- */
|
|
|
- handleRowClick(row, column, event) {
|
|
|
- this.$emit("rowClick", row);
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
+
|
|
|
+ area: ['900px', '600px']
|
|
|
+ });
|
|
|
},
|
|
|
- mounted() {}
|
|
|
+ /**
|
|
|
+ * 同步
|
|
|
+ */
|
|
|
+ handleSync() {
|
|
|
+ appSync().then((res) => {
|
|
|
+ this.$message.success('同步中,若数据量大,可能会存在延迟,请稍后自行刷新!');
|
|
|
+ // this.handleSearch();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ mounted() {}
|
|
|
};
|
|
|
</script>
|
|
|
|