林倩 3 жил өмнө
parent
commit
1d066e0c4d

+ 2 - 2
config/dev.env.js

@@ -33,11 +33,11 @@ module.exports = merge(prodEnv, {
   PROT: '8871',
   PROXY_TABLE: JSON.stringify({
     '/dcucauth': {
-      // target: "http://10.11.1.237:8861"
+      target: "http://10.11.1.237:8861"
       // target: "http://10.254.11.203:8861"
       //  target: "http://192.168.10.2:8871"
       //  target: "http://192.168.6.133:3471"
-      target: 'http://192.168.6.131:3561'
+      // target: 'http://192.168.6.131:3561'
     }
   })
 });

+ 18 - 21
src/pages/auth-object-manage/object-prop-manage/add-dialog.vue

@@ -11,13 +11,13 @@
   <main class="add-dialog">
     <dg-row class="property-wapper">
       <!-- 搜索栏 -->
-      <search-bar :conditionForm="appConditonForm2" @submitSearch="receiveSearch"></search-bar>
+      <search-bar :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
       <!-- 表格 -->
       <new-table
         ref="table"
         :selection="true"
-        :tableHeader="cardAgencylist"
-        :tableUrl="tableUrl"
+        :tableHeader="tableHeader"
+        :tableUrl="tableUrl[attrBelongType]"
         :condition="condition"
         v-if="type !== 'service'"
       >
@@ -32,37 +32,36 @@
 
 <script>
 import { appRestApi } from '@/api/application';
-import { cardAgencylist, cardFunctionList, appConditonForm2 } from '../../auth-subject-manage/DataConfig';
+import { relateSourceTableHeader, relateSourceCondition } from '../../auth-subject-manage/DataConfig';
 import { addRelateApp, getRelateIds } from '@/api/data-auth';
 import searchBar from '@/components/search-bar';
 import { searchOpt } from '@/mixins/page-opt';
 import newTable from '@/components/new-table';
+import { tableUrl as serTableUrl } from '@/api/ser-resource-manage';
 import _ from 'lodash';
 export default {
   name: 'add-dialog', // 组件名称
   props: {
     // 接收父组件的数据
-    type: {
-      type: String,
-      default: 'application'
-    },
+    attrBelongType: String,
     parentNode: Object
   },
   components: { searchBar, newTable }, // 注册局部组件
   mixins: [searchOpt],
   data() {
-    // 组件内部参数
+    const vm = this;
     return {
-      // 参数名称及默认值
-      cardFunctionList,
-      cardAgencylist,
-      tableUrl: appRestApi.table,
+      tableHeader: relateSourceTableHeader[vm.attrBelongType],
+      tableUrl: {
+        APP: appRestApi.table,
+        SER: serTableUrl
+      },
       otherParams: {
         attrBelongType: this.parentNode.attrBelongType,
         attrId: this.parentNode.id,
         attrType: 'OBJ'
       },
-      appConditonForm2
+      conditionForm: relateSourceCondition[vm.attrBelongType]
     };
   },
   computed: {}, // 计算属性
@@ -88,15 +87,13 @@ export default {
       });
     }
   },
-  created() {
-  },
+  created() {},
   mounted() {
-     getRelateIds(this.otherParams).then((res) => {
-       this.$nextTick(() => {
-         this.$refs.table.newChooseArr = res.data.content;
-       })
+    getRelateIds(this.otherParams).then((res) => {
+      this.$nextTick(() => {
+        this.$refs.table.newChooseArr = res.data.content;
+      });
     });
-
   }
 };
 </script>

+ 43 - 22
src/pages/auth-object-manage/object-prop-manage/application-list.vue → src/pages/auth-object-manage/object-prop-manage/app-ser-list.vue

@@ -7,14 +7,22 @@
  * @Description: 
 -->
 <template>
-  <dg-card header="应用列表" shadow="never">
+  <dg-card :header="cardTitle[attrBelongType]" shadow="never">
     <template v-if="operateType == 'detail'">
       <!-- 搜索栏 -->
       <search-bar :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
       <!-- 操作栏 -->
       <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
       <!-- 表格 -->
-      <new-table ref="table" :tableUrl="ObjAppTableUrl" :tableHeader="cardAgencylist" :condition="condition"> </new-table>
+      <new-table
+        ref="table"
+        :tableUrl="tableUrl[attrBelongType]"
+        :tableHeader="tableHeader"
+        :condition="condition"
+        :tableOptList="tableOptList"
+        @submitTableOpt="receviceOpt"
+      >
+      </new-table>
     </template>
     <p v-else>请选择属性值</p>
   </dg-card>
@@ -23,64 +31,74 @@
 <script>
 import newTable from '@/components/new-table';
 import { ObjAppTableUrl } from '@/api/data-auth';
-import { cardAgencylist, appConditionForm3 } from '../../auth-subject-manage/DataConfig';
+import { tableUrl as serTableUrl } from '@/api/ser-resource-manage';
+import { relateSourceTableHeader, relateSourceCondition } from '../../auth-subject-manage/DataConfig';
 import addDialog from './add-dialog';
 import operateBar from '@/components/operate-bar';
 import searchBar from '@/components/search-bar';
-import { searchOpt} from '@/mixins/page-opt';
+import { searchOpt } from '@/mixins/page-opt';
 
 export default {
   name: 'personnelList', // 组件名称
   props: {
     parentNode: Object,
-    operateType: String
+    operateType: String,
+    attrBelongType: String
   },
   components: { newTable, operateBar, searchBar }, // 注册局部组件
-  mixins: [ searchOpt ],
+  mixins: [searchOpt],
   data() {
-    // 组件内部参数
+    const vm = this;
     return {
       // 参数名称及默认值
-      cardAgencylist,
-      ObjAppTableUrl,
+      tableHeader: relateSourceTableHeader[vm.attrBelongType],
+      tableUrl: {
+        APP: ObjAppTableUrl,
+        SER: serTableUrl
+      },
       condition: {
-         attrId: {
-           op: "=",
-           value: this.parentNode.id
-         }
+        attrId: {
+          op: '=',
+          value: this.parentNode.id
+        }
       },
       conditionForm: [
-        ...appConditionForm3,
+        ...relateSourceCondition[vm.attrBelongType],
         {
           name: 'attrId',
           op: '=',
           value: this.parentNode.id
         }
       ],
-      pageOptList: ['新增']
+      pageOptList: ['新增'],
+      tableOptList: ['删除'],
+      cardTitle: {
+        APP: '关联应用资源',
+        SER: '关联服务资源'
+      }
     };
   },
   computed: {}, // 计算属性
   watch: {}, // 侦听器(扩展的计算属性)
   methods: {
     receviceOpt(opt, row) {
-      this.handleAdd();
+      if (opt == '新增') {
+        this.handleAdd();
+      } else if (opt == '删除') {
+        this.handleDelete(row);
+      }
     },
-    /**
-     * @description: 单击表格行
-     */
-    handleRowClick() {},
     /**
      * @description: 添加
      */
     handleAdd() {
       const vm = this;
       const layer = this.$dgLayer({
-        title: '添加应用资源',
+        title: '添加',
         shade: [0.4, '#FFF'],
         content: addDialog,
         props: {
-          type: 'application',
+          attrBelongType: vm.attrBelongType,
           parentNode: vm.parentNode
         },
         on: {
@@ -91,6 +109,9 @@ export default {
         },
         area: ['1000px', '760px']
       });
+    },
+    handleDelete(row) {
+      this.$dgConfirm(`是否确定删除这条数据!`, '提示', {}).then(() => {});
     }
   },
   created() {},

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

@@ -5,7 +5,7 @@
 -->
 <template>
     <div>
-         <dg-card class="box-card" header="数据资源列表">
+         <dg-card class="box-card" header="关联数据资源" shadow="never">
              暂无
          </dg-card>
     </div>

+ 1 - 1
src/pages/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="关联功能资源" shadow="never">
         暂无
         <!-- <el-form ref="form" :model="cardForm" label-suffix=":" inline>
             <el-form-item label="姓名">

+ 11 - 9
src/pages/auth-object-manage/object-prop-manage/index.vue

@@ -14,7 +14,7 @@
                 <tree ref="tree" title="客体属性类" type="OBJ" @submitNodeOperate="getNodeOperate" />
             </dg-col>
             <!-- 属性详情 -->
-            <dg-col :span="6">
+            <dg-col :span="10">
                 <prop-detail
                     :parentNode="parentNode"
                     type="OBJ"
@@ -23,12 +23,13 @@
                     @savePropSuccess="refreshTree"
                 ></prop-detail>
             </dg-col>
-            <dg-col :span="13">
+            <dg-col :span="9">
                 <!-- TODO 根据点击属性类型判断显示什么表格 -->
                 <component
                     :is="componentValue"
                     :parentNode="parentNode"
                     :operateType="operateType"
+                    :attrBelongType="attrBelongType"
                     :key="key"
                 ></component>
             </dg-col>
@@ -40,8 +41,7 @@
 import Tree from "../../auth-subject-manage/subject-prop-manage/prop-tree";
 import propDetail from "../../auth-subject-manage/subject-prop-manage/prop-detail";
 import functionList from "./function-list";
-import serviceList from "./service-list";
-import applicationList from "./application-list";
+import appSerList from "./app-ser-list";
 import dataSourceList from "./data-source-list";
 export default {
     name: "subject-property", // 组件名称
@@ -54,26 +54,28 @@ export default {
             // 参数名称及默认值
             componentType: {
                 FUN: "function-list",
-                SER: "service-list",
-                APP: "application-list",
+                SER: "app-ser-list",
+                APP: "app-ser-list",
                 DATA: "data-source-list"
             },
-            componentValue: "application-list",
+            componentValue: "app-ser-list",
             parentNode: {},
             key: 0,
             // 操作类型,新增属性还是编辑
-            operateType: ""
+            operateType: "",
+            attrBelongType: "APP"
         };
     },
     computed: {}, // 计算属性
     watch: {}, // 侦听器(扩展的计算属性)
-    components: { Tree, functionList, serviceList, applicationList, propDetail, dataSourceList }, // 注册局部组件
+    components: { Tree, functionList, appSerList, propDetail, dataSourceList }, // 注册局部组件
     methods: {
         /**
          * 获取树操作
          */
         getNodeOperate(data) {
             const { attrBelongType, operateType } = data;
+            this.attrBelongType = attrBelongType;
             this.operateType = operateType;
             this.parentNode = data;
             this.componentValue = this.componentType[attrBelongType];

+ 0 - 158
src/pages/auth-object-manage/object-prop-manage/service-list.vue

@@ -1,158 +0,0 @@
-<!--
- * @Author: Liugh
- * @Date: 2021-05-19 15:48:26
- * @LastEditTime: 2021-05-20 11:15:54
- * @LastEditors: Do not edit
- * @FilePath: \auth-web\src\pages\data-auth-module\auth-object-manage\object-prop-manage\service-list.vue
- * @Description: //TODO 暂定
--->
-<template>
-    <dg-card class="box-card" header="服务资源列表">
-        暂无
-        <!-- <el-form ref="form" :model="cardForm" label-suffix=":" inline>
-            <el-form-item label="单位名称">
-                <el-input clearable placeholder="请输入单位名称" v-model="cardForm.name"></el-input>
-            </el-form-item>
-            <el-form-item label="机构代码">
-                <dg-tree-select
-                    v-model="cardForm.institution"
-                    placeholder="请选择机构代码"
-                    :data="options"
-                    clearable
-                    filterable
-                    multiple
-                ></dg-tree-select>
-            </el-form-item>
-            <el-form-item>
-                <dg-button type="primary" icon="el-icon-search" @click="doSearchPersion">查询</dg-button>
-                <dg-button type="primary" icon="el-icon-plus">添加</dg-button>
-            </el-form-item>
-        </el-form>
-        <Table
-            ref="table"
-            :url="tableUrl"
-            :headerData="cardServiceList"
-            :condition="reportForm"
-            :lazyLoad="true"
-            @handleRowClick="handleRowClick"
-        >
-        </Table> -->
-    </dg-card>
-</template>
-
-<script>
-import Table from "@/components/table";
-import * as dynamicManageApi from "@/api/dynamic-manage";
-import addDialog from "./add-dialog";
-import { cardServiceList } from "../../auth-subject-manage/DataConfig";
-const editorArea = ["1200px", "660px"];
-export default {
-    name: "personnelList", // 组件名称
-    props: {
-        // 接收父组件的数据
-    },
-    data() {
-        // 组件内部参数
-        return {
-            // 参数名称及默认值
-            cardServiceList,
-            tableUrl: dynamicManageApi.tableUrl,
-            reportForm: {},
-            cardForm: {},
-            options: [
-                {
-                    id: "fruits",
-                    label: "Fruits",
-                    children: [
-                        {
-                            id: "apple",
-                            label: "Apple",
-                            isNew: true
-                        },
-                        {
-                            id: "grapes",
-                            label: "Grapes",
-                            disabled: true
-                        },
-                        {
-                            id: "pear",
-                            label: "Pear"
-                        },
-                        {
-                            id: "strawberry",
-                            label: "Strawberry 🍓"
-                        },
-                        {
-                            id: "watermelon",
-                            label: "Watermelon 🍉"
-                        }
-                    ]
-                },
-                {
-                    id: "vegetables",
-                    label: "Vegetables",
-                    children: [
-                        {
-                            id: "corn",
-                            label: "Corn 🌽"
-                        },
-                        {
-                            id: "carrot",
-                            label: "Carrot 🥕"
-                        },
-                        {
-                            id: "eggplant",
-                            label: "Eggplant 🍆"
-                        },
-                        {
-                            id: "tomato",
-                            label: "Tomato 🍅"
-                        }
-                    ]
-                }
-            ]
-        };
-    },
-    computed: {}, // 计算属性
-    watch: {}, // 侦听器(扩展的计算属性)
-    components: { Table }, // 注册局部组件
-    methods: {
-        /**
-         * @description: 查询
-         */
-        doSearchPersion() {},
-        /**
-         * @description: 单击表格行
-         */
-        handleRowClick() {},
-        /**
-         * @description: 添加
-         */
-        add() {
-            const layer = this.$dgLayer({
-                title: "添加机构",
-                shade: [0.4, "#FFF"],
-                content: addDialog,
-                props: {
-                    type: "agency"
-                },
-                on: {
-                    success() {
-                        layer.close(layer.dialogIndex);
-                    }
-                },
-                area: editorArea
-            });
-        }
-    }, // 内部方法
-    beforeCreate() {}, // 组件创建前
-    created() {}, // 组件创建完成后
-    beforeMount() {}, // 组件挂载前
-    mounted() {}, // 组件挂载完成后
-    beforeUpdate() {}, // 组件更新前
-    updated() {}, // 组件挂载完成后
-    beforeDestroy() {}, // 组件销毁前
-    destroyed() {} // 组件销毁完成后
-};
-</script>
-<style lang="scss" scoped></style>

+ 82 - 25
src/pages/auth-subject-manage/DataConfig.js

@@ -113,18 +113,6 @@ const appConditionForm = [
   }
 ];
 
-const appConditonForm2 = [
-  {
-    label: '应用系统名称',
-    name: 'applyName',
-    op: '=',
-    value: '',
-    component: 'SelectApp',
-    apiUrl: appRestApi.table,
-    valueName: 'applyName',
-    labelName: 'applyName'
-  }
-];
 
 const appConditionForm3 = [
   {
@@ -247,16 +235,7 @@ const cardFunctionList = [
     prop: ''
   }
 ];
-const cardServiceList = [
-  {
-    label: '服务资源名称',
-    prop: ''
-  },
-  {
-    label: '所属系统',
-    prop: ''
-  }
-];
+
 
 const typeData = {
   10: [
@@ -329,6 +308,83 @@ const orgConditonForm = [
     placeholder: '请选择单位名称'
   }
 ];
+
+
+const relateSourceTableHeader = {
+   APP: [
+    {
+      label: '应用系统名称',
+      prop: 'applyName'
+    },
+    {
+      label: '应用系统编号',
+      prop: 'applyCode'
+    }
+  ],
+  SER: [
+    {
+      label: '服务资源名称',
+      prop: 'serviceName'
+    },
+    {
+      label: '服务资源标识符',
+      prop: 'serviceCode'
+    },
+    {
+      label: '应用系统名称',
+      prop: 'appName'
+    }
+  ]
+}
+
+const relateSourceCondition =  {
+  APP: [
+    {
+      label: '应用系统名称',
+      name: 'applyName',
+      op: '=',
+      value: '',
+      component: 'SelectApp',
+      apiUrl: appRestApi.table,
+      valueName: 'applyName',
+      labelName: 'applyName'
+    },
+    {
+      label: '应用系统编码',
+      name: 'applyCode',
+      op: 'like',
+      value: '',
+      component: 'ElInput'
+    }
+  ],
+  SER: [
+    {
+      label: '服务资源名称',
+      name: 'serviceName',
+      op: 'like',
+      value: '',
+      component: 'ElInput'
+    },
+    {
+      label: '服务资源标识符',
+      name: 'serviceCode',
+      op: 'like',
+      value: '',
+      component: 'ElInput'
+    },
+    {
+      label: '应用系统名称',
+      name: 'appName',
+      op: 'like',
+      value: '',
+      component: 'SelectApp',
+      apiUrl: appRestApi.table,
+      valueName: 'applyName',
+      labelName: 'applyName'
+    }
+  ]
+}
+
 export {
   pageOptList,
   userPropConditionForm,
@@ -336,7 +392,6 @@ export {
   typeData,
   orgDetail,
   appConditionForm,
-  appConditonForm2,
   appConditionForm3,
   appTableHeader,
   applicationField,
@@ -345,6 +400,8 @@ export {
   cardAgencylist,
   cardAddPersonnelList,
   cardFunctionList,
-  cardServiceList,
-  orgConditonForm
+  orgConditonForm,
+  relateSourceTableHeader,
+  relateSourceCondition
+
 };

+ 1 - 1
src/pages/auth-subject-manage/subject-prop-manage/application-list.vue

@@ -7,7 +7,7 @@
  * @Description: 
 -->
 <template>
-    <dg-card class="box-card" header="应用列表">
+    <dg-card class="box-card" header="关联应用资源">
         <el-form ref="form" label-suffix=":" inline>
             <el-form-item label="应用系统名称">
                 <el-input clearable placeholder="请输入应用系统名称" v-model="form.applyName.value"></el-input>

+ 195 - 159
src/pages/auth-subject-manage/subject-prop-manage/prop-detail.vue

@@ -4,178 +4,214 @@
 @Date: 2021-05-25 11:22
 -->
 <template>
-    <div>
-        <dg-card class="box-card" shadow="never" header="属性详情">
-            <div style="height: calc(100vh - 19rem)">
-                <dg-scrollbar>
-                    <el-form
-                        ref="ruleForm"
-                        :rules="rules"
-                        :model="form"
-                        label-width="80px"
-                        :style="{ width: type == 'SUB' ? '40%' : '90%' }"
-                    >
-                        <el-form-item label="属性类别">
-                            <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="请输入属性名称" :disabled="readOnly"></el-input>
-                        </el-form-item>
-                        <el-form-item
-                            v-for="(item, index) in form.child"
-                            :key="index"
-                            :label="index == 0 ? '属性值' : ''"
-                            :prop="'child.' + index + '.name'"
-                            class="prop-value-item"
-                            :rules="{
-                                required: true,
-                                message: '属性值不能为空',
-                                trigger: 'blur'
-                            }"
-                        >
-                            <div class="subject-property__form-item">
-                                <el-input
-                                    v-model="item.name"
-                                    placeholder="请输入属性值"
-                                    :disabled="readOnly"
-                                ></el-input>
-                                <i
-                                    class="el-icon-remove-outline icon"
-                                    @click="handleDeletePropValue(index)"
-                                    v-if="form.child.length > 1 && !readOnly"
-                                ></i>
-                                <!-- <dg-button class="delete-btn" size="mini" icon="el-icon-minus" plain></dg-button> -->
-                            </div>
-                        </el-form-item>
-                        <el-form-item label="">
-                            <dg-button
-                                v-if="!readOnly"
-                                :icon="'添加属性值' | optIcon"
-                                size="mini"
-                                type="primary"
-                                plain
-                                @click="handleAddPropValue"
-                                >添加属性值</dg-button
-                            >
-                        </el-form-item>
-                        <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" :icon="'保存'| optIcon">保存</dg-button></el-form-item
-                        >
-                    </el-form>
-                </dg-scrollbar>
-            </div>
-        </dg-card>
-    </div>
+  <div>
+    <dg-card class="box-card" shadow="never" header="属性详情">
+      <div style="height: calc(100vh - 17rem)">
+        <dg-scrollbar>
+          <el-form
+            ref="ruleForm"
+            :rules="rules"
+            :model="form"
+            label-width="100px"
+            :style="{ width: type == 'SUB' ? '40%' : '90%' }"
+          >
+            <el-form-item label="属性类别">
+              <el-input v-model="rootName" placeholder="请输入属性类别" disabled></el-input>
+            </el-form-item>
+            <el-form-item label="属性类别编码">
+              <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="请输入属性名称" :disabled="readOnly"></el-input>
+            </el-form-item>
+            <el-form-item label="属性编码" prop="code" class="attr-code">
+              <el-input v-model="form.code" placeholder="请输入属性编码" :disabled="readOnly">
+                <template slot="prepend">APP-RA-</template>
+              </el-input>
+              <!-- <dg-row>
+                <dg-col :span="5"><el-input value="APP-RA" :disabled="true"></el-input></dg-col>
+                <dg-col :span="2" style="text-align: center"><i class="el-icon-minus"></i></dg-col>
+                <dg-col :span="17">
+                  <el-input v-model="form.code" placeholder="请输入属性编码" :disabled="readOnly"></el-input>
+                </dg-col>
+              </dg-row> -->
+            </el-form-item>
+            <el-form-item label="是否内置">
+                <el-input :value="form.isDefault" disabled></el-input>
+            </el-form-item>
+            <template v-for="(item, index) in form.child">
+              <dg-row :key="index">
+                <dg-col :span="12">
+                  <el-form-item
+                    :label="index == 0 ? '属性值名称' : ''"
+                    :prop="'child.' + index + '.name'"
+                    class="prop-value-item"
+                    :rules="{
+                      required: true,
+                      message: '属性值名称不能为空',
+                      trigger: 'blur'
+                    }"
+                  >
+                    <el-input v-model="item.name" placeholder="请输入属性值名称" :disabled="readOnly"></el-input>
+                  </el-form-item>
+                </dg-col>
+                <dg-col :span="12">
+                  <el-form-item
+                    :label="index == 0 ? '属性值编码' : ''"
+                    :prop="'child.' + index + '.code'"
+                    class="prop-value-item"
+                    :rules="{
+                      required: true,
+                      message: '属性值编码不能为空',
+                      trigger: 'blur'
+                    }"
+                  >
+                    <div class="subject-property__form-item">
+                      <el-input v-model="item.code" placeholder="请输入属性值编码" :disabled="readOnly"></el-input>
+                      <i
+                        class="el-icon-remove-outline icon"
+                        @click="handleDeletePropValue(index)"
+                        v-if="form.child.length > 1 && !readOnly"
+                      ></i>
+                    </div>
+                  </el-form-item>
+                </dg-col>
+              </dg-row>
+            </template>
+            <el-form-item label="">
+              <dg-button
+                v-if="!readOnly"
+                :icon="'添加属性值' | optIcon"
+                size="mini"
+                type="primary"
+                plain
+                @click="handleAddPropValue"
+                >添加属性值</dg-button
+              >
+            </el-form-item>
+            <!-- <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" :icon="'保存' | optIcon">保存</dg-button></el-form-item
+            >
+          </el-form>
+        </dg-scrollbar>
+      </div>
+    </dg-card>
+  </div>
 </template>
 
 <script>
-import { saveProp } from "@/api/data-auth";
-import _ from "lodash";
+import { saveProp } from '@/api/data-auth';
+import _ from 'lodash';
 export default {
-    props: {
-        parentNode: Object,
-        type: String,
-        operateType: String
+  props: {
+    parentNode: Object,
+    type: String,
+    operateType: String
+  },
+  components: {},
+  data() {
+    return {
+      form: {
+        attrBelongType: this.parentNode.attrBelongType,
+        attrType: this.type,
+        child: [
+          {
+            name: '',
+            code: ''
+          }
+        ],
+        remark: '',
+        name: '',
+        code: '',
+        pid: this.parentNode.id,
+        isDefault: 1
+      },
+      rules: {
+        name: [{ required: true, message: '属性名称不能为空', trigger: 'change' }],
+        code: [{ required: true, message: '属性编码不能为空', trigger: 'change' }]
+      },
+      rootName: '',
+      readOnly: this.parentNode.pid && !this.parentNode.child
+    };
+  },
+  computed: {},
+  methods: {
+    /**
+     * 添加属性值
+     */
+    handleAddPropValue() {
+      this.form.child.push({
+        name: '',
+        code: ''
+      });
     },
-    components: {},
-    data() {
-        return {
-            form: {
-                attrBelongType: this.parentNode.attrBelongType,
-                attrType: this.type,
-                child: [
-                    {
-                        name: ""
-                    }
-                ],
-                remark: "",
-                name: "",
-                pid: this.parentNode.id
-            },
-            rules: {
-                name: [{ required: true, message: "属性名称不能为空", trigger: "change" }]
-            },
-            rootName: "",
-            readOnly: this.parentNode.pid && !this.parentNode.child
-        };
+    /**
+     * 删除属性值
+     */
+    handleDeletePropValue(index) {
+      this.form.child.splice(index, 1);
     },
-    computed: {},
-    methods: {
-        /**
-         * 添加属性值
-         */
-        handleAddPropValue() {
-            this.form.child.push({
-                name: ""
-            });
-        },
-        /**
-         * 删除属性值
-         */
-        handleDeletePropValue(index) {
-            this.form.child.splice(index, 1);
-        },
-        /**
-         * 保存属性
-         */
-        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;
-                    }
+    /**
+     * 保存属性
+     */
+    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) => {
-                        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("-");
-            delete this.parentNode.operateType;
-            this.form = _.cloneDeep(this.parentNode);
-            if (pName.length > 1) {
-                this.form.name = pName[1];
-                this.form.child = [
-                    {
-                        ...this.parentNode
-                    }
-                ];
-                this.rootName = pName[0];
+          saveProp(this.form).then((res) => {
+            const { result, msg } = res.data;
+            if (result == '200') {
+              this.$message.success('保存成功');
+              this.$emit('savePropSuccess');
             } else {
-                this.rootName = pName[0];
+              this.$message.error(msg);
             }
-        } else {
-            this.rootName = this.parentNode.name;
+          });
         }
-    },
-    mounted() {}
+      });
+    }
+  },
+  created() {
+    if (this.parentNode.pname) {
+      const pName = this.parentNode.pname.split('-');
+      delete this.parentNode.operateType;
+      this.form = _.cloneDeep(this.parentNode);
+      if (pName.length > 1) {
+        this.form.name = pName[1];
+        this.form.child = [
+          {
+            ...this.parentNode
+          }
+        ];
+        this.rootName = pName[0];
+      } else {
+        this.rootName = pName[0];
+      }
+    } else {
+      this.rootName = this.parentNode.name;
+    }
+  },
+  mounted() {}
 };
 </script>
 
 <style lang='scss' scoped>
-.delete-btn {
-    width: 50px !important;
+/deep/.el-input-group__prepend {
+  padding: 0 12px;
 }
 </style>

+ 6 - 6
src/pages/auth-subject-manage/subject-prop-manage/prop-tree.vue

@@ -136,12 +136,12 @@ export default {
     i {
       color: #1890ff;
     }
-    .operation-icons {
-      display: none;
-    }
-    &:hover .operation-icons {
-      display: block;
-    }
+    // .operation-icons {
+    //   display: none;
+    // }
+    // &:hover .operation-icons {
+    //   display: block;
+    // }
   }
 }
 /deep/ .el-tree {