|
@@ -9,52 +9,19 @@
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<main class="add-dialog">
|
|
<main class="add-dialog">
|
|
- <dg-row class="property-wapper" :gutter="10">
|
|
|
|
- <!-- 机构列表 -->
|
|
|
|
- <!-- <dg-col :span="8" class="property-wapper__left">
|
|
|
|
- <dg-card class="box-card">
|
|
|
|
- <org-tree
|
|
|
|
- ref="tree"
|
|
|
|
- class="u-pm__left"
|
|
|
|
- treeHeight="470px"
|
|
|
|
- :search="true"
|
|
|
|
- paddingRight="15px"
|
|
|
|
- @handleGetNode="handleGetNode"
|
|
|
|
- @submitRootNode="handleGetNode"
|
|
|
|
- ></org-tree>
|
|
|
|
- </dg-card>
|
|
|
|
- </dg-col> -->
|
|
|
|
- <!-- -->
|
|
|
|
- <dg-col :span="24">
|
|
|
|
- <el-form ref="form" label-suffix=":" inline>
|
|
|
|
- <el-form-item label="功能名称" v-if="type == 'function'">
|
|
|
|
- <el-input clearable placeholder="请输入功能名称" v-model="form.applyName.value"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="应用系统名称" v-if="type == 'application'">
|
|
|
|
- <el-input clearable placeholder="请输入应用系统名称" v-model="form.applyName.value"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <dg-button type="primary" icon="el-icon-search" @click="handleSearch">查询</dg-button>
|
|
|
|
- <dg-button :icon="'重置' | optIcon" @click="handleReset">重置</dg-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <dg-table
|
|
|
|
- ref="table"
|
|
|
|
- :url="tableUrl"
|
|
|
|
- :condition="form"
|
|
|
|
- border
|
|
|
|
- row-key="id"
|
|
|
|
- :before-quest="beforeQuest"
|
|
|
|
- @select="handleSelect"
|
|
|
|
- @select-all="handleCheckAll"
|
|
|
|
- v-if="type !== 'service'"
|
|
|
|
- >
|
|
|
|
- <dg-table-column type="selection" reserve-selection width="55" />
|
|
|
|
- <template v-for="(item, indexs) in cardAgencylist">
|
|
|
|
- <dg-table-column :key="indexs" v-bind="item" align="center"> </dg-table-column>
|
|
|
|
- </template>
|
|
|
|
- </dg-table>
|
|
|
|
- </dg-col>
|
|
|
|
|
|
+ <dg-row class="property-wapper">
|
|
|
|
+ <!-- 搜索栏 -->
|
|
|
|
+ <search-bar :conditionForm="appConditonForm2" @submitSearch="receiveSearch"></search-bar>
|
|
|
|
+ <!-- 表格 -->
|
|
|
|
+ <new-table
|
|
|
|
+ ref="table"
|
|
|
|
+ :selection="true"
|
|
|
|
+ :tableHeader="cardAgencylist"
|
|
|
|
+ :tableUrl="tableUrl"
|
|
|
|
+ :condition="condition"
|
|
|
|
+ v-if="type !== 'service'"
|
|
|
|
+ >
|
|
|
|
+ </new-table>
|
|
</dg-row>
|
|
</dg-row>
|
|
<div v-footer>
|
|
<div v-footer>
|
|
<dg-button @click="handleClose">取消</dg-button>
|
|
<dg-button @click="handleClose">取消</dg-button>
|
|
@@ -65,8 +32,11 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { appRestApi } from '@/api/application';
|
|
import { appRestApi } from '@/api/application';
|
|
-import { cardAgencylist, cardFunctionList } from '../../auth-subject-manage/DataConfig';
|
|
|
|
|
|
+import { cardAgencylist, cardFunctionList, appConditonForm2 } from '../../auth-subject-manage/DataConfig';
|
|
import { addRelateApp, getRelateIds } from '@/api/data-auth';
|
|
import { addRelateApp, getRelateIds } from '@/api/data-auth';
|
|
|
|
+import searchBar from '@/components/search-bar';
|
|
|
|
+import { searchOpt } from '@/mixins/page-opt';
|
|
|
|
+import newTable from '@/pages/common/new-table';
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
export default {
|
|
export default {
|
|
name: 'add-dialog', // 组件名称
|
|
name: 'add-dialog', // 组件名称
|
|
@@ -78,116 +48,26 @@ export default {
|
|
},
|
|
},
|
|
parentNode: Object
|
|
parentNode: Object
|
|
},
|
|
},
|
|
|
|
+ components: { searchBar, newTable }, // 注册局部组件
|
|
|
|
+ mixins: [searchOpt],
|
|
data() {
|
|
data() {
|
|
// 组件内部参数
|
|
// 组件内部参数
|
|
return {
|
|
return {
|
|
// 参数名称及默认值
|
|
// 参数名称及默认值
|
|
cardFunctionList,
|
|
cardFunctionList,
|
|
cardAgencylist,
|
|
cardAgencylist,
|
|
- form: {
|
|
|
|
- applyName: {
|
|
|
|
- value: '',
|
|
|
|
- op: 'like'
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
tableUrl: appRestApi.table,
|
|
tableUrl: appRestApi.table,
|
|
otherParams: {
|
|
otherParams: {
|
|
attrBelongType: this.parentNode.attrBelongType,
|
|
attrBelongType: this.parentNode.attrBelongType,
|
|
attrId: this.parentNode.id,
|
|
attrId: this.parentNode.id,
|
|
attrType: 'OBJ'
|
|
attrType: 'OBJ'
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ appConditonForm2
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {}, // 计算属性
|
|
computed: {}, // 计算属性
|
|
watch: {}, // 侦听器(扩展的计算属性)
|
|
watch: {}, // 侦听器(扩展的计算属性)
|
|
- components: {}, // 注册局部组件
|
|
|
|
methods: {
|
|
methods: {
|
|
- /**
|
|
|
|
- * @description: 获取机构节点
|
|
|
|
- * @param {*} node
|
|
|
|
- */
|
|
|
|
- handleGetNode(node) {
|
|
|
|
- this.subId = node.code;
|
|
|
|
- this.key++;
|
|
|
|
- },
|
|
|
|
- /**
|
|
|
|
- * @description:重置
|
|
|
|
- */
|
|
|
|
- handleReset() {
|
|
|
|
- for (const key in this.form) {
|
|
|
|
- this.form[key].value = '';
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- /**
|
|
|
|
- * @description:查询
|
|
|
|
- */
|
|
|
|
- handleSearch() {
|
|
|
|
- this.$refs.table.searchForm();
|
|
|
|
- },
|
|
|
|
- /**
|
|
|
|
- * 进入页面默认选中设置
|
|
|
|
- */
|
|
|
|
- beforeQuest(res) {
|
|
|
|
- const { content, totalElements } = res.data;
|
|
|
|
- this.currentPageContent = content;
|
|
|
|
- if (this.newChooseArr.length > 0) {
|
|
|
|
- let rowKeys = [];
|
|
|
|
- for (let j = 0; j < content.length; j++) {
|
|
|
|
- const cItem = content[j];
|
|
|
|
- const index = this.newChooseArr.findIndex((item) => (item.id || item) == cItem.id);
|
|
|
|
- if (index > -1) {
|
|
|
|
- rowKeys.push(this.newChooseArr[index].id || this.newChooseArr[index]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.$refs.table.setCheck(rowKeys);
|
|
|
|
- }, 500);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- const result = {
|
|
|
|
- data: {
|
|
|
|
- content,
|
|
|
|
- totalElements
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- return result;
|
|
|
|
- },
|
|
|
|
- /**
|
|
|
|
- * 选中某条数据
|
|
|
|
- */
|
|
|
|
- handleSelect(selection, row) {
|
|
|
|
- let copyAttr = _.cloneDeep(this.newChooseArr);
|
|
|
|
- const index = this.newChooseArr.findIndex((item) => (item.id || item) == row.id);
|
|
|
|
- if (index > -1) {
|
|
|
|
- copyAttr.splice(index, 1);
|
|
|
|
- } else {
|
|
|
|
- copyAttr.push(row);
|
|
|
|
- }
|
|
|
|
- this.newChooseArr = copyAttr;
|
|
|
|
- console.log(this.newChooseArr);
|
|
|
|
- },
|
|
|
|
- /**
|
|
|
|
- * 选中/取消选中
|
|
|
|
- */
|
|
|
|
- handleCheckAll(selection) {
|
|
|
|
- const checked = selection.length == 0 ? false : true;
|
|
|
|
- this.currentPageContent.forEach((row) => {
|
|
|
|
- // this.handleSelect([], element);
|
|
|
|
- let copyAttr = _.cloneDeep(this.newChooseArr);
|
|
|
|
- const index = this.newChooseArr.findIndex((item) => (item.id || item) == row.id);
|
|
|
|
- if (checked) {
|
|
|
|
- if (index < 0) {
|
|
|
|
- copyAttr.push(row);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (index > -1) {
|
|
|
|
- copyAttr.splice(index, 1);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.newChooseArr = copyAttr;
|
|
|
|
- });
|
|
|
|
- console.log(this.newChooseArr);
|
|
|
|
- },
|
|
|
|
/**
|
|
/**
|
|
* 关闭
|
|
* 关闭
|
|
*/
|
|
*/
|
|
@@ -200,7 +80,7 @@ export default {
|
|
handleSave() {
|
|
handleSave() {
|
|
const params = {
|
|
const params = {
|
|
...this.otherParams,
|
|
...this.otherParams,
|
|
- relIds: this.newChooseArr.map((item) => item.id || item)
|
|
|
|
|
|
+ relIds: this.$refs.table.newChooseArr.map((item) => item.id || item)
|
|
};
|
|
};
|
|
addRelateApp(params).then((res) => {
|
|
addRelateApp(params).then((res) => {
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
@@ -209,11 +89,15 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- getRelateIds(this.otherParams).then((res) => {
|
|
|
|
- this.newChooseArr = res.data.content;
|
|
|
|
- });
|
|
|
|
},
|
|
},
|
|
- mounted() {}
|
|
|
|
|
|
+ mounted() {
|
|
|
|
+ getRelateIds(this.otherParams).then((res) => {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.table.newChooseArr = res.data.content;
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped></style>
|
|
<style lang="scss" scoped></style>
|