|
@@ -4,198 +4,148 @@
|
|
|
@Date: 2021-03-31 15:30:11
|
|
|
-->
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <!-- 搜索项 -->
|
|
|
- <el-form :inline="true" :model="form" class="search-form">
|
|
|
- <el-form-item label="数据组织一级分类">
|
|
|
- <el-input v-model="form.firName.value" clearable></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数据组织二级分类">
|
|
|
- <el-input v-model="form.secName.value" clearable></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="标签名称">
|
|
|
- <el-input v-model="form.labName.value" clearable></el-input>
|
|
|
- </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-circle-plus-outline" @click="handleAdd">新增</dg-button>
|
|
|
- <dg-button type="primary" icon="el-icon-refresh" @click="handleSynchro">同步</dg-button>
|
|
|
- <!-- <dg-button type="primary" @click="handleImport" icon="el-icon-upload">导入</dg-button> -->
|
|
|
- </dg-row>
|
|
|
- <!-- 列表 -->
|
|
|
- <dg-table ref="table" :url="dataSourceClaTableUrl" :condition="form" border row-key="id">
|
|
|
- <dg-table-column type="index" width="75" label="序号" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="firCode" label="一级代码" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="firName" label="数据组织一级分类" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="secCode" label="二级代码" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="secName" label="数据组织二级分类" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="labClaCode" label="标签分类代码" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="labClaName" label="标签分类" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="labCode" label="标签代码" align="center"></dg-table-column>
|
|
|
- <dg-table-column prop="labName" label="标签名称" align="center"></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.tooltip"
|
|
|
- effect="dark"
|
|
|
- placement="top-end"
|
|
|
- >
|
|
|
- <i :class="item.icon" @click="item.on(scope.row, $event)"></i>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </dg-table-column>
|
|
|
- </dg-table>
|
|
|
- </div>
|
|
|
+ <div>
|
|
|
+ <!-- 搜索栏 -->
|
|
|
+ <search-bar :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
|
|
|
+ <!-- 操作栏 -->
|
|
|
+ <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <new-table
|
|
|
+ ref="table"
|
|
|
+ :tableUrl="dataSourceClaTableUrl"
|
|
|
+ :tableHeader="tableHeader"
|
|
|
+ :condition="condition"
|
|
|
+ :tableOptList="tableOptList"
|
|
|
+ @submitTableOpt="receviceOpt"
|
|
|
+ >
|
|
|
+ </new-table>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import importFile from "@/components/import";
|
|
|
-import sourceSortForm from "./forms/source-sort-form";
|
|
|
-import { dataSourceClaTableUrl, delDataSourceCla } from "@/api/data-auth";
|
|
|
-import { dataSourceSync } from "@/api/sync";
|
|
|
+import sourceSortForm from './forms/source-sort-form';
|
|
|
+import { dataSourceClaTableUrl, delDataSourceCla } from '@/api/data-auth';
|
|
|
+import { dataSourceSyncUrl } from '@/api/sync';
|
|
|
+import searchBar from '@/components/search-bar';
|
|
|
+import operateBar from '@/components/operate-bar';
|
|
|
+import newTable from '@/pages/common/new-table';
|
|
|
+import { sourceSortConfig, pageOptList, tableOptList } from './DataConfig';
|
|
|
+import { searchOpt, importOpt, syncOpt } from '@/mixins/page-opt';
|
|
|
+
|
|
|
export default {
|
|
|
- components: {},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- dataSourceClaTableUrl,
|
|
|
- form: {
|
|
|
- firName: {
|
|
|
- value: "",
|
|
|
- op: "like"
|
|
|
- },
|
|
|
- secName: {
|
|
|
- value: "",
|
|
|
- op: "like"
|
|
|
- },
|
|
|
- labName: {
|
|
|
- value: "",
|
|
|
- op: "like"
|
|
|
- }
|
|
|
- },
|
|
|
- optList: [
|
|
|
- { icon: "el-icon-edit", tooltip: "修改", on: this.handleEdit },
|
|
|
- { icon: "el-icon-document", tooltip: "详情", on: this.handleViewDetail },
|
|
|
- { icon: "el-icon-delete", tooltip: "删除", on: this.handleDelete }
|
|
|
- ]
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {},
|
|
|
- methods: {
|
|
|
- /**
|
|
|
- * @description: 查询
|
|
|
- */
|
|
|
- handleSearch() {
|
|
|
- this.$refs.table.searchForm();
|
|
|
- },
|
|
|
- /**
|
|
|
- * 重置
|
|
|
- */
|
|
|
- handleReset() {
|
|
|
- for (const key in this.form) {
|
|
|
- this.form[key].value = "";
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * 编辑
|
|
|
- */
|
|
|
- handleEdit(row, e) {
|
|
|
- this.handleOpenForm(row.labId, "编辑");
|
|
|
+ components: { searchBar, operateBar, newTable },
|
|
|
+ mixins: [searchOpt, importOpt, syncOpt],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dataSourceClaTableUrl,
|
|
|
+ conditionForm: [
|
|
|
+ {
|
|
|
+ label: '数据组织一级分类',
|
|
|
+ name: 'firName',
|
|
|
+ op: 'like',
|
|
|
+ value: '',
|
|
|
+ component: 'ElInput'
|
|
|
},
|
|
|
- /**
|
|
|
- * 查看详情id
|
|
|
- */
|
|
|
- handleViewDetail(row, e) {
|
|
|
- this.handleOpenForm(row.labId, "详情", true);
|
|
|
+ {
|
|
|
+ label: '数据组织二级分类',
|
|
|
+ name: 'secName',
|
|
|
+ op: 'like',
|
|
|
+ value: '',
|
|
|
+ component: 'ElInput'
|
|
|
},
|
|
|
- /**
|
|
|
- * 删除
|
|
|
- */
|
|
|
- handleDelete(row, e) {
|
|
|
- this.$dgConfirm(`是否确认删除该条数据!`, "提示", {}).then(() => {
|
|
|
- delDataSourceCla(row.labId).then((res) => {
|
|
|
- this.$message.success("删除成功!");
|
|
|
- this.handleSearch();
|
|
|
- });
|
|
|
- });
|
|
|
+ {
|
|
|
+ label: '标签名称',
|
|
|
+ name: 'labName',
|
|
|
+ op: 'like',
|
|
|
+ value: '',
|
|
|
+ component: 'ElInput'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ tableHeader: sourceSortConfig.slice(0, -1),
|
|
|
+ pageOptList,
|
|
|
+ tableOptList,
|
|
|
+ optList: [
|
|
|
+ { icon: 'el-icon-edit', tooltip: '修改', on: this.handleEdit },
|
|
|
+ { icon: 'el-icon-document', tooltip: '详情', on: this.handleViewDetail },
|
|
|
+ { icon: 'el-icon-delete', tooltip: '删除', on: this.handleDelete }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ receviceOpt(opt, row) {
|
|
|
+ if (opt == '新增') {
|
|
|
+ this.handleAdd();
|
|
|
+ } else if (opt == '修改') {
|
|
|
+ this.handleEdit(row);
|
|
|
+ } else if (opt == '详情') {
|
|
|
+ this.handleViewDetail(row);
|
|
|
+ } else if (opt == '删除') {
|
|
|
+ this.handleDelete(row);
|
|
|
+ } else if (opt == '同步') {
|
|
|
+ this.handleSync(dataSourceSyncUrl);
|
|
|
+ } else if (opt == '导入') {
|
|
|
+ // this.handleImport(dataLevelImportUrl, 'dataLevel', '数据资源分类表码导入');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 编辑
|
|
|
+ */
|
|
|
+ handleEdit(row, e) {
|
|
|
+ this.handleOpenForm(row.labId, '编辑');
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 查看详情id
|
|
|
+ */
|
|
|
+ handleViewDetail(row, e) {
|
|
|
+ this.handleOpenForm(row.labId, '详情', true);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+ handleDelete(row, e) {
|
|
|
+ this.$dgConfirm(`是否确认删除该条数据!`, '提示', {}).then(() => {
|
|
|
+ delDataSourceCla(row.labId).then((res) => {
|
|
|
+ this.$message.success('删除成功!');
|
|
|
+ this.handleSearch();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 新增
|
|
|
+ */
|
|
|
+ handleAdd() {
|
|
|
+ this.handleOpenForm(void 0, '新增');
|
|
|
+ },
|
|
|
+ handleOpenForm(id, title, isDetail = false) {
|
|
|
+ const vm = this;
|
|
|
+ const layer = this.$dgLayer({
|
|
|
+ title,
|
|
|
+ content: sourceSortForm,
|
|
|
+ props: {
|
|
|
+ id,
|
|
|
+ isDetail
|
|
|
},
|
|
|
- /**
|
|
|
- * 新增
|
|
|
- */
|
|
|
- handleAdd() {
|
|
|
- this.handleOpenForm(void 0, "新增");
|
|
|
+ btn: ['确定', '取消'],
|
|
|
+ btnAlign: 'r',
|
|
|
+ noneBtnField: isDetail,
|
|
|
+ yes: (index) => {
|
|
|
+ let _layer = layer.$children[0];
|
|
|
+ _layer.saveForm().then((res) => {
|
|
|
+ layer.close(index);
|
|
|
+ vm.handleSearch();
|
|
|
+ });
|
|
|
},
|
|
|
- handleOpenForm(id, title, isDetail = false) {
|
|
|
- const vm = this;
|
|
|
- const layer = this.$dgLayer({
|
|
|
- title,
|
|
|
- content: sourceSortForm,
|
|
|
- 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", "500px"]
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * @description: 导入
|
|
|
- */
|
|
|
- handleImport() {
|
|
|
- const vm = this;
|
|
|
- const layer = this.$dgLayer({
|
|
|
- title: "数据资源分类表码导入",
|
|
|
- content: importFile,
|
|
|
- props: {
|
|
|
- temp: "模板",
|
|
|
- action: "action"
|
|
|
- },
|
|
|
- on: {
|
|
|
- success(params) {
|
|
|
- layer.close(layer.dialogIndex);
|
|
|
- }
|
|
|
- },
|
|
|
- cancel: function (index, layero) {
|
|
|
- // 关闭对应弹窗的ID
|
|
|
- layer.close(index);
|
|
|
- return false;
|
|
|
- },
|
|
|
- area: ["550px", "500px"]
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * @description:同步方法,假同步
|
|
|
- */
|
|
|
- handleSynchro() {
|
|
|
- dataSourceSync().then((res) => {
|
|
|
- this.$message.success("同步中,若数据量大,可能会存在延迟,请稍后自行刷新!");
|
|
|
- this.handleSearch();
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- created() {},
|
|
|
- mounted() {}
|
|
|
+ area: ['900px', '500px']
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ mounted() {}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang='scss'>
|
|
|
-@import url("./index.scss");
|
|
|
+@import url('./index.scss');
|
|
|
</style>
|