林倩 %!s(int64=4) %!d(string=hai) anos
pai
achega
bfb8256c8b

+ 25 - 14
src/pages/data-auth-module/auth-object-manage/object-prop-manage/add-dialog.vue

@@ -48,7 +48,7 @@
                     @select-all="handleCheckAll"
                     v-if="type !== 'service'"
                 >
-                    <dg-table-column type="selection" width="55" />
+                    <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>
@@ -124,16 +124,14 @@ export default {
                 let rowKeys = [];
                 for (let j = 0; j < content.length; j++) {
                     const cItem = content[j];
-                    const index = this.newChooseArr.findIndex((item) => item == cItem.id);
+                    const index = this.newChooseArr.findIndex((item) => (item.id || item) == cItem.id);
                     if (index > -1) {
-                        rowKeys.push(this.newChooseArr[index]);
+                        rowKeys.push(this.newChooseArr[index].id || this.newChooseArr[index]);
                     }
                 }
-                this.$nextTick(() => {
-                    setTimeout(() => {
-                        this.$refs.table.setCheck(rowKeys);
-                    }, 200);
-                });
+                setTimeout(() => {
+                    this.$refs.table.setCheck(rowKeys);
+                }, 500);
             }
 
             const result = {
@@ -149,7 +147,7 @@ export default {
          */
         handleSelect(selection, row) {
             let copyAttr = _.cloneDeep(this.newChooseArr);
-            const index = this.newChooseArr.findIndex((item) => item.id == row.id);
+            const index = this.newChooseArr.findIndex((item) => (item.id || item) == row.id);
             if (index > -1) {
                 copyAttr.splice(index, 1);
             } else {
@@ -162,9 +160,23 @@ export default {
          * 选中/取消选中
          */
         handleCheckAll(selection) {
-            this.currentPageContent.forEach((element) => {
-                this.handleSelect([], element);
+            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);
         },
         /**
          * 关闭
@@ -178,10 +190,10 @@ export default {
         handleSave() {
             const params = {
                 ...this.otherParams,
-                relIds: this.newChooseArr.map((item) => item.id)
+                relIds: this.newChooseArr.map((item) => item.id || item)
             };
             addRelateApp(params).then((res) => {
-                this.$message.success("添加成功");
+                this.$message.success("保存成功");
                 this.$emit("success");
             });
         }
@@ -192,7 +204,6 @@ export default {
         });
     },
     mounted() {
-        console.log(this.type);
     }
 };
 </script>

+ 5 - 2
src/pages/data-auth-module/auth-object-manage/object-prop-manage/application-list.vue

@@ -60,7 +60,7 @@ import Table from "@/pages/common/table";
 import { ObjAppTableUrl } from "@/api/data-auth";
 import { cardAgencylist } from "../../property-management/DataConfig";
 import addDialog from "./add-dialog";
-const editorArea = ["1000px", "660px"];
+const editorArea = ["1000px", "760px"];
 export default {
     name: "personnelList", // 组件名称
     props: {
@@ -96,7 +96,9 @@ export default {
         /**
          * @description: 查询
          */
-        handleSearch() {},
+        handleSearch() {
+            this.$refs.table.searchForm();
+        },
         /**
          * @description: 单击表格行
          */
@@ -117,6 +119,7 @@ export default {
                 on: {
                     success() {
                         layer.close(layer.dialogIndex);
+                        vm.handleSearch();
                     }
                 },
                 area: editorArea

+ 1 - 1
src/pages/data-auth-module/auth-object-manage/object-prop-manage/function-list.vue

@@ -7,7 +7,7 @@
  * @Description: 
 -->
 <template>
-    <dg-card class="box-card" header="功能列表">
+    <dg-card class="box-card" header="功能资源列表">
         暂无
         <!-- <el-form ref="form" :model="cardForm" label-suffix=":" inline>
             <el-form-item label="姓名">

+ 2 - 1
src/pages/data-auth-module/auth-object-manage/object-prop-manage/index.vue

@@ -42,6 +42,7 @@ import propDetail from "../../property-management/subject-management/prop-detail
 import functionList from "./function-list";
 import serviceList from "./service-list";
 import applicationList from "./application-list";
+import dataSourceList from "./data-source-list";
 export default {
     name: "subject-property", // 组件名称
     props: {
@@ -66,7 +67,7 @@ export default {
     },
     computed: {}, // 计算属性
     watch: {}, // 侦听器(扩展的计算属性)
-    components: { Tree, functionList, serviceList, applicationList, propDetail }, // 注册局部组件
+    components: { Tree, functionList, serviceList, applicationList, propDetail, dataSourceList }, // 注册局部组件
     methods: {
         /**
          * 获取树操作

+ 1 - 1
src/pages/data-auth-module/auth-object-manage/object-prop-manage/service-list.vue

@@ -7,7 +7,7 @@
  * @Description: //TODO 暂定
 -->
 <template>
-    <dg-card class="box-card" header="服务列表">
+    <dg-card class="box-card" header="服务资源列表">
         暂无
         <!-- <el-form ref="form" :model="cardForm" label-suffix=":" inline>
             <el-form-item label="机构名称">

+ 28 - 16
src/pages/data-auth-module/property-management/subject-management/prop-detail.vue

@@ -17,7 +17,7 @@
                     <el-input v-model="rootName" placeholder="请输入属性类别" disabled></el-input>
                 </el-form-item>
                 <el-form-item label="属性名称" prop="name">
-                    <el-input v-model="form.name" placeholder="请输入属性名称" :readonly="readOnly"></el-input>
+                    <el-input v-model="form.name" placeholder="请输入属性名称" :disabled="readOnly"></el-input>
                 </el-form-item>
                 <el-form-item
                     v-for="(item, index) in form.child"
@@ -32,7 +32,7 @@
                     }"
                 >
                     <div class="subject-property__form-item">
-                        <el-input v-model="item.name" placeholder="请输入属性值" :readonly="readOnly"></el-input>
+                        <el-input v-model="item.name" placeholder="请输入属性值" :disabled="readOnly"></el-input>
                         <i
                             class="el-icon-remove-outline icon"
                             @click="handleDeletePropValue(index)"
@@ -52,14 +52,8 @@
                         >添加属性值</dg-button
                     >
                 </el-form-item>
-                <el-form-item label="说明">
-                    <el-input
-                        v-model="form.mark"
-                        type="textarea"
-                        row="3"
-                        placeholder="请输入说明"
-                        :readonly="readOnly"
-                    ></el-input>
+                <el-form-item label="说明" v-if="!readOnly">
+                    <el-input v-model="form.remark" type="textarea" row="3" placeholder="请输入说明"></el-input>
                 </el-form-item>
                 <el-form-item v-if="!readOnly" label="" style="text-align: center"
                     ><dg-button type="primary" @click="handleSaveProp">保存</dg-button></el-form-item
@@ -89,7 +83,7 @@ export default {
                         name: ""
                     }
                 ],
-                mark: "",
+                remark: "",
                 name: "",
                 pid: this.parentNode.id
             },
@@ -114,7 +108,7 @@ export default {
          * 删除属性值
          */
         handleDeletePropValue(index) {
-            this.form.child.splice(1, index);
+            this.form.child.splice(index, 1);
         },
         /**
          * 保存属性
@@ -122,17 +116,35 @@ export default {
         handleSaveProp() {
             this.$refs.ruleForm.validate((valid) => {
                 if (valid) {
+                    // 属性值不能重复
+                    let flag = false;
+                    this.form.child.sort((a, b) => {
+                        if (a.name == b.name) {
+                            flag = true;
+                            return;
+                        }
+                    });
+                    if (flag) {
+                        this.$message.warning("属性值不能重复");
+                        return;
+                    }
+
                     saveProp(this.form).then((res) => {
-                        this.$message.success("保存成功");
-                        this.$emit("savePropSuccess");
+                        const { result, msg } = res.data;
+                        if (result == "200") {
+                            this.$message.success("保存成功");
+                            this.$emit("savePropSuccess");
+                        } else {
+                            this.$message.error(msg);
+                        }
                     });
                 }
             });
         }
     },
     created() {
-        if (this.parentNode.pName) {
-            const pName = this.parentNode.pName.split("-");
+        if (this.parentNode.pname) {
+            const pName = this.parentNode.pname.split("-");
             delete this.parentNode.operateType;
             this.form = _.cloneDeep(this.parentNode);
             if (pName.length > 1) {

+ 1 - 0
src/pages/data-auth-module/property-management/subject-management/prop-tree.vue

@@ -131,6 +131,7 @@ export default {
 .u-tree {
     height: calc(100vh - 12rem);
     border: 1px solid #eef2fa;
+    border-bottom: none;
     &__title {
         font-size: 14px;
         height: 48px;