shuishen
2024-01-29 2cec09706b01d65def3f945bdcde13e620a71c2e
Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_web
70 files modified
21868 ■■■■ changed files
src/const/tool/model.js 641 ●●●● patch | view | raw | blame | history
src/option/convenienceHotline/convenienceHotline.js 62 ●●●● patch | view | raw | blame | history
src/option/system/dict.js 396 ●●●● patch | view | raw | blame | history
src/option/system/dictCategory.js 395 ●●●● patch | view | raw | blame | history
src/option/system/dictbiz.js 397 ●●●● patch | view | raw | blame | history
src/views/article/article.vue 3 ●●●● patch | view | raw | blame | history
src/views/article/articleComment.vue 1 ●●●● patch | view | raw | blame | history
src/views/article/articleWords.vue 923 ●●●● patch | view | raw | blame | history
src/views/article/components/deitDiscussion.vue 781 ●●●● patch | view | raw | blame | history
src/views/article/components/publicSignUpChild.vue 689 ●●●● patch | view | raw | blame | history
src/views/article/discussionManage.vue 1414 ●●●● patch | view | raw | blame | history
src/views/article/publicSignUp.vue 1328 ●●●● patch | view | raw | blame | history
src/views/article/rotation.vue 3 ●●●● patch | view | raw | blame | history
src/views/authority/apiscope.vue 1199 ●●●● patch | view | raw | blame | history
src/views/authority/datascope.vue 1366 ●●●● patch | view | raw | blame | history
src/views/authority/role.vue 2 ●●●●● patch | view | raw | blame | history
src/views/cGovernance/gridPatrolRecord.vue 3 ●●●● patch | view | raw | blame | history
src/views/cGovernance/gridWorkLog.vue 47 ●●●● patch | view | raw | blame | history
src/views/cGovernance/punchCard.vue 3 ●●●● patch | view | raw | blame | history
src/views/cGovernance/reportForRepairs.vue 3 ●●●● patch | view | raw | blame | history
src/views/cGovernance/taskECall.vue 1 ●●●● patch | view | raw | blame | history
src/views/community/index.vue 675 ●●●● patch | view | raw | blame | history
src/views/district/index.vue 1 ●●●● patch | view | raw | blame | history
src/views/flow/follow.vue 1 ●●●● patch | view | raw | blame | history
src/views/flow/manager.vue 1 ●●●● patch | view | raw | blame | history
src/views/flow/model.vue 1 ●●●● patch | view | raw | blame | history
src/views/grid/gridman.vue 1 ●●●● patch | view | raw | blame | history
src/views/grid/index.vue 1 ●●●● patch | view | raw | blame | history
src/views/gzll/owners.vue 2 ●●● patch | view | raw | blame | history
src/views/monitor/log/api.vue 3 ●●●● patch | view | raw | blame | history
src/views/monitor/log/error.vue 3 ●●●● patch | view | raw | blame | history
src/views/monitor/log/usual.vue 3 ●●●● patch | view | raw | blame | history
src/views/place/index.vue 5 ●●●●● patch | view | raw | blame | history
src/views/property/convenienceHotline.vue 1 ●●●● patch | view | raw | blame | history
src/views/property/inviteTenders.vue 3 ●●●● patch | view | raw | blame | history
src/views/property/oiae.vue 3 ●●●● patch | view | raw | blame | history
src/views/property/ownersCommittee.vue 3 ●●●● patch | view | raw | blame | history
src/views/property/partyOrganization.vue 1 ●●●● patch | view | raw | blame | history
src/views/property/propertyCapitalApply.vue 1 ●●●● patch | view | raw | blame | history
src/views/property/propertyCharge.vue 1 ●●●● patch | view | raw | blame | history
src/views/property/propertyChargeRecord.vue 3 ●●●● patch | view | raw | blame | history
src/views/property/propertyCompany.vue 1097 ●●●● patch | view | raw | blame | history
src/views/property/propertyCompanyDistrict.vue 1 ●●●● patch | view | raw | blame | history
src/views/propertySupervision/houseHoldSupervision.vue 1 ●●●● patch | view | raw | blame | history
src/views/propertySupervision/ownersCommittee.vue 1184 ●●●● patch | view | raw | blame | history
src/views/propertySupervision/propertyCompanyDistrict.vue 726 ●●●● patch | view | raw | blame | history
src/views/propertySupervision/propertyEvaluation.vue 1099 ●●●● patch | view | raw | blame | history
src/views/propertySupervision/residentSupervision.vue 2 ●●● patch | view | raw | blame | history
src/views/publicSecurity/bailReporting.vue 908 ●●●● patch | view | raw | blame | history
src/views/publicSecurity/keynotePlaceManage.vue 1061 ●●●● patch | view | raw | blame | history
src/views/report/reportlist.vue 1 ●●●● patch | view | raw | blame | history
src/views/resource/attach.vue 1 ●●●● patch | view | raw | blame | history
src/views/resource/oss.vue 2 ●●● patch | view | raw | blame | history
src/views/resource/sms.vue 2 ●●● patch | view | raw | blame | history
src/views/system/client.vue 619 ●●●● patch | view | raw | blame | history
src/views/system/dept.vue 2 ●●●●● patch | view | raw | blame | history
src/views/system/menu.vue 842 ●●●● patch | view | raw | blame | history
src/views/system/post.vue 515 ●●●● patch | view | raw | blame | history
src/views/system/tenant.vue 1041 ●●●● patch | view | raw | blame | history
src/views/system/topmenu.vue 592 ●●●● patch | view | raw | blame | history
src/views/system/user.vue 1787 ●●●● patch | view | raw | blame | history
src/views/task/index.vue 1 ●●●● patch | view | raw | blame | history
src/views/task/reportForRepairs.vue 2 ●●● patch | view | raw | blame | history
src/views/tool/code.vue 2 ●●● patch | view | raw | blame | history
src/views/userHouse/hireInfoList.vue 2 ●●● patch | view | raw | blame | history
src/views/userHouse/houseHoldList.vue 2 ●●● patch | view | raw | blame | history
src/views/userHouse/houseList.vue 2 ●●● patch | view | raw | blame | history
src/views/work/claim.vue 2 ●●●●● patch | view | raw | blame | history
src/views/work/send.vue 1 ●●●● patch | view | raw | blame | history
src/views/work/start.vue 1 ●●●● patch | view | raw | blame | history
src/const/tool/model.js
@@ -1,343 +1,344 @@
export const switchDic = [
  {
    label: "",
    value: 0,
  },
  {
    label: "",
    value: 1,
  },
];
    {
        label: "",
        value: 0,
    },
    {
        label: "",
        value: 1,
    },
]
export const entityDic = [
  {
    label: "String",
    value: "java.lang.String",
  },
  {
    label: "Integer",
    value: "java.lang.Integer",
  },
  {
    label: "Long",
    value: "java.lang.Long",
  },
  {
    label: "Double",
    value: "java.lang.Double",
  },
  {
    label: "BigDecimal",
    value: "java.math.BigDecimal",
  },
  {
    label: "Boolean",
    value: "java.lang.Boolean",
  },
  {
    label: "Date",
    value: "java.util.Date",
  },
];
    {
        label: "String",
        value: "java.lang.String",
    },
    {
        label: "Integer",
        value: "java.lang.Integer",
    },
    {
        label: "Long",
        value: "java.lang.Long",
    },
    {
        label: "Double",
        value: "java.lang.Double",
    },
    {
        label: "BigDecimal",
        value: "java.math.BigDecimal",
    },
    {
        label: "Boolean",
        value: "java.lang.Boolean",
    },
    {
        label: "Date",
        value: "java.util.Date",
    },
]
export const componentDic = [
  {
    label: "单行文本",
    value: "input",
  },
  {
    label: "多行文本",
    value: "textarea",
  },
  {
    label: "富文本",
    value: "editor",
  },
  {
    label: "下拉选项",
    value: "select",
  },
  {
    label: "树形下拉选项",
    value: "tree",
  },
  {
    label: "单选框",
    value: "radio",
  },
  {
    label: "多选框",
    value: "checkbox",
  },
  {
    label: "开关框",
    value: "switch",
  },
  {
    label: "日期框",
    value: "date",
  },
];
    {
        label: "单行文本",
        value: "input",
    },
    {
        label: "多行文本",
        value: "textarea",
    },
    {
        label: "富文本",
        value: "editor",
    },
    {
        label: "下拉选项",
        value: "select",
    },
    {
        label: "树形下拉选项",
        value: "tree",
    },
    {
        label: "单选框",
        value: "radio",
    },
    {
        label: "多选框",
        value: "checkbox",
    },
    {
        label: "开关框",
        value: "switch",
    },
    {
        label: "日期框",
        value: "date",
    },
]
export const queryDic = [
  {
    label: "等于",
    value: "equal",
  },
  {
    label: "不等于",
    value: "notequal",
  },
  {
    label: "大于",
    value: "gt",
  },
  {
    label: "大于等于",
    value: "ge",
  },
  {
    label: "小于",
    value: "lt",
  },
  {
    label: "小于等于",
    value: "le",
  },
  {
    label: "区间",
    value: "between",
  },
  {
    label: "模糊",
    value: "like",
  },
  {
    label: "左模糊",
    value: "likeleft",
  },
  {
    label: "右模糊",
    value: "likeright",
  },
];
    {
        label: "等于",
        value: "equal",
    },
    {
        label: "不等于",
        value: "notequal",
    },
    {
        label: "大于",
        value: "gt",
    },
    {
        label: "大于等于",
        value: "ge",
    },
    {
        label: "小于",
        value: "lt",
    },
    {
        label: "小于等于",
        value: "le",
    },
    {
        label: "区间",
        value: "between",
    },
    {
        label: "模糊",
        value: "like",
    },
    {
        label: "左模糊",
        value: "likeleft",
    },
    {
        label: "右模糊",
        value: "likeright",
    },
]
export const templateDic = [
  {
    label: "单表",
    value: "crud",
  },
  {
    label: "主子表",
    value: "sub",
  },
  {
    label: "树表",
    value: "tree",
  },
];
    {
        label: "单表",
        value: "crud",
    },
    {
        label: "主子表",
        value: "sub",
    },
    {
        label: "树表",
        value: "tree",
    },
]
export const option = {
  height: "auto",
  searchShow: true,
  searchMenuSpan: 6,
  tip: false,
  border: true,
  index: true,
  viewBtn: true,
  selection: true,
  menuWidth: 250,
  column: [
    {
      label: "数据源",
      prop: "datasourceId",
      searchSpan: 4,
      search: true,
      span: 24,
      type: "select",
      dicUrl: "/api/blade-develop/datasource/select",
      props: {
        label: "name",
        value: "id",
      },
      rules: [
    height: "auto",
    searchShow: true,
    searchMenuSpan: 6,
    tip: false,
    border: true,
    index: true,
    viewBtn: true,
    selection: true,
    menuWidth: 250,
    column: [
        {
          required: true,
          message: "请选择数据源",
          trigger: "blur",
            label: "数据源",
            prop: "datasourceId",
            searchSpan: 4,
            search: true,
            searchLabelWidth: 60,
            span: 24,
            type: "select",
            dicUrl: "/api/blade-develop/datasource/select",
            props: {
                label: "name",
                value: "id",
            },
            rules: [
                {
                    required: true,
                    message: "请选择数据源",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    {
      label: "物理表名",
      prop: "modelTable",
      type: "tree",
      slot: true,
      dicData: [],
      props: {
        label: "comment",
        value: "name",
      },
      rules: [
        {
          required: true,
          message: "请输入数据库表名",
          trigger: "blur",
            label: "物理表名",
            prop: "modelTable",
            type: "tree",
            slot: true,
            dicData: [],
            props: {
                label: "comment",
                value: "name",
            },
            rules: [
                {
                    required: true,
                    message: "请输入数据库表名",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    {
      label: "模型类名",
      prop: "modelClass",
      rules: [
        {
          required: true,
          message: "请输入模型类名",
          trigger: "blur",
            label: "模型类名",
            prop: "modelClass",
            rules: [
                {
                    required: true,
                    message: "请输入模型类名",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    {
      label: "模型名称",
      prop: "modelName",
      searchSpan: 4,
      search: true,
      rules: [
        {
          required: true,
          message: "请输入模型名称",
          trigger: "blur",
            label: "模型名称",
            prop: "modelName",
            searchSpan: 4,
            search: true,
            rules: [
                {
                    required: true,
                    message: "请输入模型名称",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    {
      label: "模型编号",
      prop: "modelCode",
      searchSpan: 4,
      search: true,
      rules: [
        {
          required: true,
          message: "请输入模型编号",
          trigger: "blur",
            label: "模型编号",
            prop: "modelCode",
            searchSpan: 4,
            search: true,
            rules: [
                {
                    required: true,
                    message: "请输入模型编号",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    {
      label: "模型备注",
      prop: "modelRemark",
      hide: true,
      span: 24,
    },
  ],
};
        {
            label: "模型备注",
            prop: "modelRemark",
            hide: true,
            span: 24,
        },
    ],
}
export const optionModel = {
  border: true,
  index: true,
  addBtn: false,
  editBtn: false,
  addRowBtn: false,
  cellBtn: false,
  cancelBtn: false,
  tip: false,
  menu: false,
  selection: true,
  column: [
    {
      label: "物理列名",
      prop: "jdbcName",
    },
    {
      label: "物理类型",
      prop: "jdbcType",
    },
    {
      label: "实体列名",
      prop: "propertyName",
      cell: true,
    },
    {
      label: "实体类型",
      prop: "propertyEntity",
      type: "select",
      dicData: entityDic,
      cell: true,
    },
    {
      label: "字段说明",
      prop: "jdbcComment",
      cell: true,
    },
    {
      label: "列表显示",
      prop: "isList",
      type: "switch",
      dicData: switchDic,
      align: "center",
      width: 80,
      cell: true,
    },
    {
      label: "表单显示",
      prop: "isForm",
      type: "switch",
      dicData: switchDic,
      align: "center",
      width: 80,
      cell: true,
    },
    {
      label: "独占一行",
      prop: "isRow",
      type: "switch",
      dicData: switchDic,
      align: "center",
      width: 80,
      cell: true,
    },
    {
      label: "必填",
      prop: "isRequired",
      type: "switch",
      dicData: switchDic,
      align: "center",
      width: 80,
      cell: true,
    },
    {
      label: "组件类型",
      prop: "componentType",
      type: "select",
      dicData: componentDic,
      cell: true,
    },
    {
      label: "字典编码",
      prop: "dictCode",
      type: "select",
      dicUrl: "/api/blade-system/dict/select",
      props: {
        label: "dictValue",
        value: "code",
      },
      cell: true,
    },
    {
      label: "查询配置",
      prop: "isQuery",
      type: "switch",
      dicData: switchDic,
      align: "center",
      width: 80,
      cell: true,
    },
    {
      label: "查询类型",
      prop: "queryType",
      type: "select",
      dicData: queryDic,
      cell: true,
    },
  ],
};
    border: true,
    index: true,
    addBtn: false,
    editBtn: false,
    addRowBtn: false,
    cellBtn: false,
    cancelBtn: false,
    tip: false,
    menu: false,
    selection: true,
    column: [
        {
            label: "物理列名",
            prop: "jdbcName",
        },
        {
            label: "物理类型",
            prop: "jdbcType",
        },
        {
            label: "实体列名",
            prop: "propertyName",
            cell: true,
        },
        {
            label: "实体类型",
            prop: "propertyEntity",
            type: "select",
            dicData: entityDic,
            cell: true,
        },
        {
            label: "字段说明",
            prop: "jdbcComment",
            cell: true,
        },
        {
            label: "列表显示",
            prop: "isList",
            type: "switch",
            dicData: switchDic,
            align: "center",
            width: 80,
            cell: true,
        },
        {
            label: "表单显示",
            prop: "isForm",
            type: "switch",
            dicData: switchDic,
            align: "center",
            width: 80,
            cell: true,
        },
        {
            label: "独占一行",
            prop: "isRow",
            type: "switch",
            dicData: switchDic,
            align: "center",
            width: 80,
            cell: true,
        },
        {
            label: "必填",
            prop: "isRequired",
            type: "switch",
            dicData: switchDic,
            align: "center",
            width: 80,
            cell: true,
        },
        {
            label: "组件类型",
            prop: "componentType",
            type: "select",
            dicData: componentDic,
            cell: true,
        },
        {
            label: "字典编码",
            prop: "dictCode",
            type: "select",
            dicUrl: "/api/blade-system/dict/select",
            props: {
                label: "dictValue",
                value: "code",
            },
            cell: true,
        },
        {
            label: "查询配置",
            prop: "isQuery",
            type: "switch",
            dicData: switchDic,
            align: "center",
            width: 80,
            cell: true,
        },
        {
            label: "查询类型",
            prop: "queryType",
            type: "select",
            dicData: queryDic,
            cell: true,
        },
    ],
}
src/option/convenienceHotline/convenienceHotline.js
@@ -1,40 +1,40 @@
export default {
  height: "auto",
  calcHeight: 54,
  dialogWidth: 950,
  tip: false,
  searchShow: true,
  searchMenuSpan: 3,
  menuWidth: 450,
  border: false,
  viewBtn: true,
  selection: true,
  excelBtn: true,
  dialogClickModal: false,
  column: [{
      label: 'ID',
      prop: 'id',
      searchSpan: 4,
      // search: true,
      display: false,
    height: "auto",
    calcHeight: 54,
    dialogWidth: 950,
    tip: false,
    searchShow: true,
    searchMenuSpan: 3,
    menuWidth: 450,
    border: true,
    viewBtn: true,
    selection: true,
    excelBtn: true,
    dialogClickModal: false,
    column: [{
        label: 'ID',
        prop: 'id',
        searchSpan: 4,
        // search: true,
        display: false,
    },
    {
      label: '名称',
      prop: 'name',
      searchSpan: 4,
      search: true,
        label: '名称',
        prop: 'name',
        searchSpan: 4,
        search: true,
    },
    {
      label: '电话',
      prop: 'telephone',
      searchSpan: 4,
      search: true,
        label: '电话',
        prop: 'telephone',
        searchSpan: 4,
        search: true,
    },
    {
      label: '描述',
      prop: 'remark',
      searchSpan: 4,
      // search: true,
        label: '描述',
        prop: 'remark',
        searchSpan: 4,
        // search: true,
    },
  ]
    ]
}
src/option/system/dict.js
@@ -1,210 +1,212 @@
export const optionParent = {
  height: 'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  searchMenuSpan: 10,
  border: true,
  index: true,
  selection: true,
  viewBtn: true,
  menuWidth: 250,
  dialogWidth: 880,
  dialogClickModal: false,
  column: [
    {
      label: "字典编号",
      prop: "code",
      search: true,
      slot: true,
      span: 24,
      rules: [
    height: 'auto',
    calcHeight: 30,
    tip: false,
    searchShow: true,
    searchMenuSpan: 10,
    border: true,
    index: true,
    selection: true,
    viewBtn: true,
    menuWidth: 250,
    dialogWidth: 880,
    dialogClickModal: false,
    column: [
        {
          required: true,
          message: "请输入字典编号",
          trigger: "blur"
        }
      ]
    },
    {
      label: "字典名称",
      prop: "dictValue",
      search: true,
      align: "center",
      rules: [
        {
          required: true,
          message: "请输入字典名称",
          trigger: "blur"
        }
      ]
    },
    {
      label: "字典排序",
      prop: "sort",
      type: "number",
      align: "right",
      width: 100,
      rules: [
        {
          required: true,
          message: "请输入字典排序",
          trigger: "blur"
        }
      ]
    },
    {
      label: "封存",
      prop: "isSealed",
      type: "switch",
      align: "center",
      width: 100,
      dicData: [
        {
          label: "否",
          value: 0
            label: "字典编号",
            prop: "code",
            search: true,
            searchLabelWidth: 76,
            slot: true,
            span: 24,
            rules: [
                {
                    required: true,
                    message: "请输入字典编号",
                    trigger: "blur"
                }
            ]
        },
        {
          label: "是",
          value: 1
        }
      ],
      value: 0,
      slot: true,
      rules: [
            label: "字典名称",
            prop: "dictValue",
            search: true,
            searchLabelWidth: 100,
            align: "center",
            rules: [
                {
                    required: true,
                    message: "请输入字典名称",
                    trigger: "blur"
                }
            ]
        },
        {
          required: true,
          message: "请选择封存",
          trigger: "blur"
            label: "字典排序",
            prop: "sort",
            type: "number",
            align: "right",
            width: 100,
            rules: [
                {
                    required: true,
                    message: "请输入字典排序",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "封存",
            prop: "isSealed",
            type: "switch",
            align: "center",
            width: 100,
            dicData: [
                {
                    label: "否",
                    value: 0
                },
                {
                    label: "是",
                    value: 1
                }
            ],
            value: 0,
            slot: true,
            rules: [
                {
                    required: true,
                    message: "请选择封存",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "字典备注",
            prop: "remark",
            hide: true
        }
      ]
    },
    {
      label: "字典备注",
      prop: "remark",
      hide: true
    }
  ]
};
    ]
}
export const optionChild = {
  height: 'auto',
  calcHeight: 95,
  tip: false,
  searchShow: true,
  searchMenuSpan: 10,
  tree: true,
  border: true,
  index: true,
  selection: true,
  viewBtn: true,
  menuWidth: 300,
  dialogWidth: 880,
  dialogClickModal: false,
  column: [
    {
      label: "字典编号",
      prop: "code",
      addDisabled: true,
      editDisabled: true,
      search: true,
      span: 24,
      rules: [
    height: 'auto',
    calcHeight: 95,
    tip: false,
    searchShow: true,
    searchMenuSpan: 10,
    tree: true,
    border: true,
    index: true,
    selection: true,
    viewBtn: true,
    menuWidth: 300,
    dialogWidth: 880,
    dialogClickModal: false,
    column: [
        {
          required: true,
          message: "请输入字典编号",
          trigger: "blur"
        }
      ]
    },
    {
      label: "字典名称",
      prop: "dictValue",
      search: true,
      align: "center",
      rules: [
        {
          required: true,
          message: "请输入字典名称",
          trigger: "blur"
        }
      ]
    },
    {
      label: "上级字典",
      prop: "parentId",
      type: "tree",
      dicData: [],
      hide: true,
      props: {
        label: "title"
      },
      addDisabled: true,
      editDisabled: true,
      rules: [
        {
          required: false,
          message: "请选择上级字典",
          trigger: "click"
        }
      ]
    },
    {
      label: "字典键值",
      prop: "dictKey",
      width: 80,
      rules: [
        {
          required: true,
          message: "请输入字典键值",
          trigger: "blur"
        }
      ]
    },
    {
      label: "字典排序",
      prop: "sort",
      type: "number",
      align: "right",
      hide: true,
      rules: [
        {
          required: true,
          message: "请输入字典排序",
          trigger: "blur"
        }
      ]
    },
    {
      label: "封存",
      prop: "isSealed",
      type: "switch",
      align: "center",
      width: 80,
      dicData: [
        {
          label: "否",
          value: 0
            label: "字典编号",
            prop: "code",
            addDisabled: true,
            editDisabled: true,
            search: true,
            span: 24,
            rules: [
                {
                    required: true,
                    message: "请输入字典编号",
                    trigger: "blur"
                }
            ]
        },
        {
          label: "是",
          value: 1
        }
      ],
      value: 0,
      slot: true,
      rules: [
            label: "字典名称",
            prop: "dictValue",
            search: true,
            align: "center",
            rules: [
                {
                    required: true,
                    message: "请输入字典名称",
                    trigger: "blur"
                }
            ]
        },
        {
          required: true,
          message: "请选择封存",
          trigger: "blur"
            label: "上级字典",
            prop: "parentId",
            type: "tree",
            dicData: [],
            hide: true,
            props: {
                label: "title"
            },
            addDisabled: true,
            editDisabled: true,
            rules: [
                {
                    required: false,
                    message: "请选择上级字典",
                    trigger: "click"
                }
            ]
        },
        {
            label: "字典键值",
            prop: "dictKey",
            width: 80,
            rules: [
                {
                    required: true,
                    message: "请输入字典键值",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "字典排序",
            prop: "sort",
            type: "number",
            align: "right",
            hide: true,
            rules: [
                {
                    required: true,
                    message: "请输入字典排序",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "封存",
            prop: "isSealed",
            type: "switch",
            align: "center",
            width: 80,
            dicData: [
                {
                    label: "否",
                    value: 0
                },
                {
                    label: "是",
                    value: 1
                }
            ],
            value: 0,
            slot: true,
            rules: [
                {
                    required: true,
                    message: "请选择封存",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "字典备注",
            prop: "remark",
            hide: true
        }
      ]
    },
    {
      label: "字典备注",
      prop: "remark",
      hide: true
    }
  ]
};
    ]
}
src/option/system/dictCategory.js
@@ -1,212 +1,213 @@
export const optionParent = {
  height: "auto",
  calcHeight: 30,
  tip: false,
  searchShow: true,
  searchMenuSpan: 10,
  border: true,
  index: true,
  selection: true,
  viewBtn: true,
  menuWidth: 250,
  dialogWidth: 880,
  dialogClickModal: false,
  column: [
    {
      label: "分类编号",
      prop: "code",
      search: true,
      slot: true,
      span: 24,
      rules: [
    height: "auto",
    calcHeight: 30,
    tip: false,
    searchShow: true,
    searchMenuSpan: 10,
    border: true,
    index: true,
    selection: true,
    viewBtn: true,
    menuWidth: 250,
    dialogWidth: 880,
    dialogClickModal: false,
    column: [
        {
          required: true,
          message: "请输入分类编号",
          trigger: "blur",
        },
      ],
    },
    {
      label: "分类名称",
      prop: "dictValue",
      search: true,
      align: "center",
      rules: [
        {
          required: true,
          message: "请输入分类名称",
          trigger: "blur",
        },
      ],
    },
    {
      label: "分类排序",
      prop: "sort",
      type: "number",
      align: "right",
      width: 100,
      hide: true,
      rules: [
        {
          required: true,
          message: "请输入分类排序",
          trigger: "blur",
        },
      ],
    },
    {
      label: "封存",
      prop: "isSealed",
      type: "switch",
      align: "center",
      width: 100,
      dicData: [
        {
          label: "否",
          value: 0,
            label: "分类编号",
            prop: "code",
            search: true,
            slot: true,
            span: 24,
            rules: [
                {
                    required: true,
                    message: "请输入分类编号",
                    trigger: "blur",
                },
            ],
        },
        {
          label: "是",
          value: 1,
            label: "分类名称",
            prop: "dictValue",
            search: true,
            align: "center",
            rules: [
                {
                    required: true,
                    message: "请输入分类名称",
                    trigger: "blur",
                },
            ],
        },
      ],
      value: 0,
      slot: true,
      rules: [
        {
          required: true,
          message: "请选择封存",
          trigger: "blur",
            label: "分类排序",
            prop: "sort",
            type: "number",
            align: "right",
            width: 100,
            hide: true,
            rules: [
                {
                    required: true,
                    message: "请输入分类排序",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    {
      label: "分类备注",
      prop: "remark",
      hide: true,
    },
  ],
};
        {
            label: "封存",
            prop: "isSealed",
            type: "switch",
            align: "center",
            width: 100,
            dicData: [
                {
                    label: "否",
                    value: 0,
                },
                {
                    label: "是",
                    value: 1,
                },
            ],
            value: 0,
            slot: true,
            rules: [
                {
                    required: true,
                    message: "请选择封存",
                    trigger: "blur",
                },
            ],
        },
        {
            label: "分类备注",
            prop: "remark",
            hide: true,
        },
    ],
}
export const optionChild = {
  height: "auto",
  calcHeight: 95,
  tip: false,
  tree: true,
  border: true,
  index: true,
  selection: true,
  viewBtn: true,
  dialogWidth: 880,
  dialogClickModal: false,
  column: [
    // {
    //   label: "排序",
    //   prop: "sort",
    //   // addDisabled: true,
    //   // editDisabled: true,
    //   // search: true,
    //   span: 24,
    //   // display:false,
    //   rules: [
    //     {
    //       required: true,
    //       message: "请输入分类编号",
    //       trigger: "blur"
    //     }
    //   ]
    // },
    {
      label: "分类名称",
      prop: "dictValue",
      searchSpan: 4,
      search: true,
      align: "center",
      rules: [
    height: "auto",
    calcHeight: 95,
    tip: false,
    tree: true,
    border: true,
    index: true,
    selection: true,
    viewBtn: true,
    dialogWidth: 880,
    dialogClickModal: false,
    column: [
        // {
        //   label: "排序",
        //   prop: "sort",
        //   // addDisabled: true,
        //   // editDisabled: true,
        //   // search: true,
        //   span: 24,
        //   // display:false,
        //   rules: [
        //     {
        //       required: true,
        //       message: "请输入分类编号",
        //       trigger: "blur"
        //     }
        //   ]
        // },
        {
          required: true,
          message: "请输入分类名称",
          trigger: "blur",
            label: "分类名称",
            prop: "dictValue",
            searchSpan: 4,
            search: true,
            searchLabelWidth: 76,
            align: "center",
            rules: [
                {
                    required: true,
                    message: "请输入分类名称",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    // {
    //   label: "上级分类",
    //   prop: "parentId",
    //   type: "tree",
    //   dicData: [],
    //   hide: true,
    //   props: {
    //     label: "title"
    //   },
    //   addDisabled: true,
    //   editDisabled: true,
    //   rules: [
    //     {
    //       required: false,
    //       message: "请选择上级分类",
    //       trigger: "click"
    //     }
    //   ]
    // },
    {
      label: "分类键值",
      prop: "dictKey",
      align: "center",
      // width: 80,
      rules: [
        // {
        //   label: "上级分类",
        //   prop: "parentId",
        //   type: "tree",
        //   dicData: [],
        //   hide: true,
        //   props: {
        //     label: "title"
        //   },
        //   addDisabled: true,
        //   editDisabled: true,
        //   rules: [
        //     {
        //       required: false,
        //       message: "请选择上级分类",
        //       trigger: "click"
        //     }
        //   ]
        // },
        {
          required: true,
          message: "请输入分类键值",
          trigger: "blur",
            label: "分类键值",
            prop: "dictKey",
            align: "center",
            // width: 80,
            rules: [
                {
                    required: true,
                    message: "请输入分类键值",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    {
      label: "分类排序",
      prop: "sort",
      type: "number",
      align: "center",
      // hide: true,
      rules: [
        {
          required: true,
          message: "请输入分类排序",
          trigger: "blur",
            label: "分类排序",
            prop: "sort",
            type: "number",
            align: "center",
            // hide: true,
            rules: [
                {
                    required: true,
                    message: "请输入分类排序",
                    trigger: "blur",
                },
            ],
        },
      ],
    },
    // {
    //   label: "封存",
    //   prop: "isSealed",
    //   type: "switch",
    //   align: "center",
    //   width: 80,
    //   dicData: [
    //     {
    //       label: "否",
    //       value: 0
    //     },
    //     {
    //       label: "是",
    //       value: 1
    //     }
    //   ],
    //   value: 0,
    //   slot: true,
    //   rules: [
    //     {
    //       required: true,
    //       message: "请选择封存",
    //       trigger: "blur"
    //     }
    //   ]
    // },
    {
      label: "分类备注",
      prop: "remark",
      align: "center",
      // hide: true
    },
  ],
};
        // {
        //   label: "封存",
        //   prop: "isSealed",
        //   type: "switch",
        //   align: "center",
        //   width: 80,
        //   dicData: [
        //     {
        //       label: "否",
        //       value: 0
        //     },
        //     {
        //       label: "是",
        //       value: 1
        //     }
        //   ],
        //   value: 0,
        //   slot: true,
        //   rules: [
        //     {
        //       required: true,
        //       message: "请选择封存",
        //       trigger: "blur"
        //     }
        //   ]
        // },
        {
            label: "分类备注",
            prop: "remark",
            align: "center",
            // hide: true
        },
    ],
}
src/option/system/dictbiz.js
@@ -1,211 +1,212 @@
export const optionParent = {
  height: 'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  searchMenuSpan: 10,
  border: true,
  index: true,
  selection: true,
  viewBtn: true,
  menuWidth: 250,
  dialogWidth: 880,
  dialogClickModal: false,
  column: [
    {
      label: "字典编号",
      prop: "code",
      search: true,
      slot: true,
      span: 24,
      rules: [
    height: 'auto',
    calcHeight: 30,
    tip: false,
    searchShow: true,
    searchMenuSpan: 10,
    border: true,
    index: true,
    selection: true,
    viewBtn: true,
    menuWidth: 250,
    dialogWidth: 880,
    dialogClickModal: false,
    column: [
        {
          required: true,
          message: "请输入字典编号",
          trigger: "blur"
        }
      ]
    },
    {
      label: "字典名称",
      prop: "dictValue",
      search: true,
      align: "center",
      rules: [
        {
          required: true,
          message: "请输入字典名称",
          trigger: "blur"
        }
      ]
    },
    {
      label: "字典排序",
      prop: "sort",
      type: "number",
      align: "right",
      width: 100,
      hide: true,
      rules: [
        {
          required: true,
          message: "请输入字典排序",
          trigger: "blur"
        }
      ]
    },
    {
      label: "封存",
      prop: "isSealed",
      type: "switch",
      align: "center",
      width: 100,
      dicData: [
        {
          label: "否",
          value: 0
            label: "字典编号",
            prop: "code",
            search: true,
            searchLabelWidth: 76,
            slot: true,
            span: 24,
            rules: [
                {
                    required: true,
                    message: "请输入字典编号",
                    trigger: "blur"
                }
            ]
        },
        {
          label: "是",
          value: 1
        }
      ],
      value: 0,
      slot: true,
      rules: [
            label: "字典名称",
            prop: "dictValue",
            search: true,
            align: "center",
            rules: [
                {
                    required: true,
                    message: "请输入字典名称",
                    trigger: "blur"
                }
            ]
        },
        {
          required: true,
          message: "请选择封存",
          trigger: "blur"
            label: "字典排序",
            prop: "sort",
            type: "number",
            align: "right",
            width: 100,
            hide: true,
            rules: [
                {
                    required: true,
                    message: "请输入字典排序",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "封存",
            prop: "isSealed",
            type: "switch",
            align: "center",
            width: 100,
            dicData: [
                {
                    label: "否",
                    value: 0
                },
                {
                    label: "是",
                    value: 1
                }
            ],
            value: 0,
            slot: true,
            rules: [
                {
                    required: true,
                    message: "请选择封存",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "字典备注",
            prop: "remark",
            hide: true
        }
      ]
    },
    {
      label: "字典备注",
      prop: "remark",
      hide: true
    }
  ]
};
    ]
}
export const optionChild = {
  height: 'auto',
  calcHeight: 95,
  tip: false,
  searchShow: true,
  searchMenuSpan: 10,
  tree: true,
  border: true,
  index: true,
  selection: true,
  viewBtn: true,
  menuWidth: 300,
  dialogWidth: 880,
  dialogClickModal: false,
  column: [
    {
      label: "字典编号",
      prop: "code",
      addDisabled: true,
      editDisabled: true,
      search: true,
      span: 24,
      rules: [
    height: 'auto',
    calcHeight: 95,
    tip: false,
    searchShow: true,
    searchMenuSpan: 10,
    tree: true,
    border: true,
    index: true,
    selection: true,
    viewBtn: true,
    menuWidth: 300,
    dialogWidth: 880,
    dialogClickModal: false,
    column: [
        {
          required: true,
          message: "请输入字典编号",
          trigger: "blur"
        }
      ]
    },
    {
      label: "字典名称",
      prop: "dictValue",
      search: true,
      align: "center",
      rules: [
        {
          required: true,
          message: "请输入字典名称",
          trigger: "blur"
        }
      ]
    },
    {
      label: "上级字典",
      prop: "parentId",
      type: "tree",
      dicData: [],
      hide: true,
      props: {
        label: "title"
      },
      addDisabled: true,
      editDisabled: true,
      rules: [
        {
          required: false,
          message: "请选择上级字典",
          trigger: "click"
        }
      ]
    },
    {
      label: "字典键值",
      prop: "dictKey",
      width: 80,
      rules: [
        {
          required: true,
          message: "请输入字典键值",
          trigger: "blur"
        }
      ]
    },
    {
      label: "字典排序",
      prop: "sort",
      type: "number",
      align: "right",
      hide: true,
      rules: [
        {
          required: true,
          message: "请输入字典排序",
          trigger: "blur"
        }
      ]
    },
    {
      label: "封存",
      prop: "isSealed",
      type: "switch",
      align: "center",
      width: 80,
      dicData: [
        {
          label: "否",
          value: 0
            label: "字典编号",
            prop: "code",
            addDisabled: true,
            editDisabled: true,
            search: true,
            span: 24,
            rules: [
                {
                    required: true,
                    message: "请输入字典编号",
                    trigger: "blur"
                }
            ]
        },
        {
          label: "是",
          value: 1
        }
      ],
      value: 0,
      slot: true,
      rules: [
            label: "字典名称",
            prop: "dictValue",
            search: true,
            align: "center",
            rules: [
                {
                    required: true,
                    message: "请输入字典名称",
                    trigger: "blur"
                }
            ]
        },
        {
          required: true,
          message: "请选择封存",
          trigger: "blur"
            label: "上级字典",
            prop: "parentId",
            type: "tree",
            dicData: [],
            hide: true,
            props: {
                label: "title"
            },
            addDisabled: true,
            editDisabled: true,
            rules: [
                {
                    required: false,
                    message: "请选择上级字典",
                    trigger: "click"
                }
            ]
        },
        {
            label: "字典键值",
            prop: "dictKey",
            width: 80,
            rules: [
                {
                    required: true,
                    message: "请输入字典键值",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "字典排序",
            prop: "sort",
            type: "number",
            align: "right",
            hide: true,
            rules: [
                {
                    required: true,
                    message: "请输入字典排序",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "封存",
            prop: "isSealed",
            type: "switch",
            align: "center",
            width: 80,
            dicData: [
                {
                    label: "否",
                    value: 0
                },
                {
                    label: "是",
                    value: 1
                }
            ],
            value: 0,
            slot: true,
            rules: [
                {
                    required: true,
                    message: "请选择封存",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "字典备注",
            prop: "remark",
            hide: true
        }
      ]
    },
    {
      label: "字典备注",
      prop: "remark",
      hide: true
    }
  ]
};
    ]
}
src/views/article/article.vue
@@ -133,7 +133,7 @@
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
@@ -149,6 +149,7 @@
                        row: true,
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 76,
                        rules: [{
                            required: true,
                            message: "请输入文章标题",
src/views/article/articleComment.vue
@@ -70,6 +70,7 @@
                        prop: 'phone',
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 46,
                    },
                    {
                        width: 110,
src/views/article/articleWords.vue
@@ -1,497 +1,474 @@
<template>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      ref="crud"
      @row-del="rowDel"
      v-model="form"
      :permission="permissionList"
      @row-update="rowUpdate"
      @row-save="rowSave"
      :before-open="beforeOpen"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot="menuLeft">
        <el-button
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
                    除
                </el-button>
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.article_delete"
          @click="handleDelete"
        >删 除
        </el-button>
            </template>
      </template>
            <template slot-scope="{ row }" slot="iswords">
                <el-tag>{{
                    row.iswords == "1" ? "是" : row.iswords == "0" ? "否" : "是"
                }}
                </el-tag>
            </template>
      <template slot-scope="{ row }" slot="iswords">
        <el-tag
        >{{
          row.iswords == "1" ? "是" : row.iswords == "0" ? "否" : "是"
          }}
        </el-tag>
      </template>
            <template slot-scope="{ row }" slot="iscomment">
                <el-tag>{{
                    row.iscomment == "1" ? "开启" : row.iscomment == "0" ? "关闭" : "关闭"
                }}
                </el-tag>
            </template>
      <template slot-scope="{ row }" slot="iscomment">
        <el-tag
        >{{
          row.iscomment == "1" ? "开启" : row.iscomment == "0" ? "关闭" : "关闭"
          }}
        </el-tag>
      </template>
    </avue-crud>
  </basic-container>
        </avue-crud>
    </basic-container>
</template>
<script>
  import {getListWords, remove, update, add, getNotice, upcomment} from "@/api/article/article";
  import {mapGetters} from "vuex";
import { getListWords, remove, update, add, getNotice, upcomment } from "@/api/article/article"
import { mapGetters } from "vuex"
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 350,
          border: false,
          //stripe:true,
          index: true,
          viewBtn: true,
          selection: true,
          excelBtn: true,
          dialogClickModal: false,
          column: [
            {
              label: "资讯标题",
              prop: "title",
              span: 24,
              row: true,
              searchSpan: 4,
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入资讯标题",
                  trigger: "blur",
                },
              ],
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            {
              label: "资讯封面",
              prop: "url",
              // align:'center',
              width: 80,
              type: "upload",
              listType: "picture-img",
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                url: "link",
              },
              // hide: true,
              span: 24,
            datetime: "",
            selectionList: [],
            option: {
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 350,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
                selection: true,
                excelBtn: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "资讯标题",
                        prop: "title",
                        span: 24,
                        row: true,
                        searchSpan: 4,
                        search: true,
                        rules: [
                            {
                                required: true,
                                message: "请输入资讯标题",
                                trigger: "blur",
                            },
                        ],
                    },
                    {
                        label: "资讯封面",
                        prop: "url",
                        // align:'center',
                        width: 80,
                        type: "upload",
                        listType: "picture-img",
                        action: "/api/blade-resource/oss/endpoint/put-file",
                        propsHttp: {
                            res: "data",
                            url: "link",
                        },
                        // hide: true,
                        span: 24,
                    },
                    {
                        label: "资讯来源",
                        prop: "sourceName",
                        search: true,
                        searchSpan: 4,
                        span: 24,
                        rules: [
                            {
                                required: true,
                                message: "请输入资讯类型",
                                trigger: "blur",
                            },
                        ],
                    },
                    {
                        label: "资讯类型",
                        prop: "articleType",
                        addDisplay: true,
                        editDisplay: true,
                        viewDisplay: true,
                        searchSpan: 3,
                        checkStrictly: true,
                        dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1411214799056932865",
                        props: {
                            label: "dictValue",
                            value: "dictKey",
                        },
                        search: true,
                        type: "tree",
                        rules: [
                            {
                                required: true,
                                message: "请选择资讯类型",
                                trigger: "blur",
                            },
                        ],
                    },
                    {
                        label: "发布时间",
                        prop: "dateTime",
                        type: "datetime",
                        format: "yyyy-MM-dd",
                        valueFormat: "yyyy-MM-dd",
                        searchSpan: 5,
                        searchRange: true,
                        hide: true,
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: false,
                        search: true,
                        rules: [
                            {
                                required: true,
                                message: "请选择发布时间",
                                trigger: "blur",
                            },
                        ],
                    },
                    {
                        label: "发布时间",
                        prop: "createTime",
                        type: "date",
                        format: "yyyy-MM-dd",
                        valueFormat: "yyyy-MM-dd HH:mm:ss",
                    },
                    {
                        label: "敏感词预警",
                        prop: "iswords",
                        searchSpan: 3,
                        width: 80,
                        value: "0",
                        slot: true,
                        type: "select",
                        dicData: [
                            {
                                label: "否",
                                value: "0",
                            },
                            {
                                label: "是",
                                value: "1",
                            }
                        ],
                    },
                    {
                        label: "敏感词提取",
                        prop: "wordsContent",
                    },
                    {
                        label: "预警次数",
                        prop: "iscomment",
                        width: 80,
                    },
                    {
                        label: "视频",
                        prop: "videoUrl",
                        type: "upload",
                        accept: "video/mp4",
                        display: false,
                        hide: true,
                        span: 24,
                        listType: "picture-img",
                        action: "/api/depl/put-depl",
                        propsHttp: {
                            url: "data",
                        },
                    },
                    {
                        label: "资讯内容",
                        prop: "content",
                        component: "AvueUeditor",
                        options: {
                            action: "/api/blade-resource/oss/endpoint/put-file",
                            // customConfig: {
                            //   lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
                            // },//wangEditor编辑的配置
                            props: {
                                res: "data",
                                url: "link",
                            },
                        },
                        hide: true,
                        minRows: 6,
                        span: 24,
                    },
                ],
            },
            {
              label: "资讯来源",
              prop: "sourceName",
              search: true,
              searchSpan: 4,
              span: 24,
              rules: [
                {
                  required: true,
                  message: "请输入资讯类型",
                  trigger: "blur",
                },
              ],
            },
            {
              label: "资讯类型",
              prop: "articleType",
              addDisplay: true,
              editDisplay: true,
              viewDisplay: true,
              searchSpan: 3,
              checkStrictly: true,
              dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1411214799056932865",
              props: {
                label: "dictValue",
                value: "dictKey",
              },
              search: true,
              type: "tree",
              rules: [
                {
                  required: true,
                  message: "请选择资讯类型",
                  trigger: "blur",
                },
              ],
            },
            {
              label: "发布时间",
              prop: "dateTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              searchSpan: 5,
              searchRange: true,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [
                {
                  required: true,
                  message: "请选择发布时间",
                  trigger: "blur",
                },
              ],
            },
            {
              label: "发布时间",
              prop: "createTime",
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
            },
            {
              label: "敏感词预警",
              prop: "iswords",
              searchSpan: 3,
              width: 80,
              value: "0",
              slot: true,
              type: "select",
              dicData: [
                {
                  label: "否",
                  value: "0",
                },
                {
                  label: "是",
                  value: "1",
                }
              ],
            },
            {
              label: "敏感词提取",
              prop: "wordsContent",
            },
            {
              label: "预警次数",
              prop: "iscomment",
              width: 80,
            },
            {
              label: "视频",
              prop: "videoUrl",
              type: "upload",
              accept: "video/mp4",
              display: false,
              hide: true,
              span: 24,
              listType: "picture-img",
              action: "/api/depl/put-depl",
              propsHttp: {
                url: "data",
              },
            },
            {
              label: "资讯内容",
              prop: "content",
              component: "AvueUeditor",
              options: {
                action: "/api/blade-resource/oss/endpoint/put-file",
                // customConfig: {
                //   lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
                // },//wangEditor编辑的配置
                props: {
                  res: "data",
                  url: "link",
                },
              },
              hide: true,
              minRows: 6,
              span: 24,
            },
          ],
        },
        data: [],
      };
            data: [],
        }
    },
    watch: {
      "form.articleType": {
        handler(val) {
          if (val) {
            var videoUrl = this.findObject(this.option.column, "videoUrl");
            var content = this.findObject(this.option.column, "content");
            if (val.indexOf('ksp') != -1) {
              videoUrl.display = true;
              content.display = false;
              videoUrl.rules = [
                {
                  required: false,
                  message: "请选择视频",
                  trigger: "blur",
                },
              ];
            } else {
              videoUrl.display = false;
              content.display = true;
              videoUrl.rules = "";
            }
          }
        },
        immediate: true,
      }
        "form.articleType": {
            handler (val) {
                if (val) {
                    var videoUrl = this.findObject(this.option.column, "videoUrl")
                    var content = this.findObject(this.option.column, "content")
                    if (val.indexOf('ksp') != -1) {
                        videoUrl.display = true
                        content.display = false
                        videoUrl.rules = [
                            {
                                required: false,
                                message: "请选择视频",
                                trigger: "blur",
                            },
                        ]
                    } else {
                        videoUrl.display = false
                        content.display = true
                        videoUrl.rules = ""
                    }
                }
            },
            immediate: true,
        }
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.article_add, true),
          viewBtn: this.vaildData(this.permission.article_view, true),
          delBtn: this.vaildData(this.permission.article_delete, true),
          editBtn: this.vaildData(this.permission.article_edit, true),
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach((ele) => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.article_add, true),
                viewBtn: this.vaildData(this.permission.article_view, true),
                delBtn: this.vaildData(this.permission.article_delete, true),
                editBtn: this.vaildData(this.permission.article_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
    },
    methods: {
      rowSave(row, done, loading) {
        if (row.videoUrl.length == 0) {
          row.videoUrl = "";
        rowSave (row, done, loading) {
            if (row.videoUrl.length == 0) {
                row.videoUrl = ""
            }
            add(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getNotice(this.form.id).then((res) => {
                    this.form = res.data.data
                })
            }
            // con
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const { dateTime } = this.query
            let values = {
                ...params,
            }
            if (dateTime) {
                values = {
                    ...params,
                    startTime: dateTime[0],
                    endTime: dateTime[1],
                    ...this.query,
                }
                values.dateTime = null
            }
            this.loading = true
            getListWords(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        },
        updateFb (row) {
            if (row.publish == "0") {
                row.publish = "1"
            } else {
                row.publish = "0"
            }
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        kqcomment () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据开启评论?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                return upcomment(this.ids, "1")
            })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        gbcomment () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据开启评论?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                return upcomment(this.ids, "0")
            })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        }
        add(row).then(
          () => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            done();
          },
          (error) => {
            window.console.log(error);
            loading();
          }
        );
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(
          () => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            done();
          },
          (error) => {
            window.console.log(error);
            loading();
          }
        );
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
          });
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getNotice(this.form.id).then((res) => {
            this.form = res.data.data;
          });
        }
        // con
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        const {dateTime} = this.query;
        let values = {
          ...params,
        };
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          };
          values.dateTime = null;
        }
        this.loading = true;
        getListWords(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      },
      updateFb(row) {
        if (row.publish == "0") {
          row.publish = "1";
        } else {
          row.publish = "0";
        }
        update(row).then(
          () => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            done();
          },
          (error) => {
            window.console.log(error);
            loading();
          }
        );
      },
      kqcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据开启评论?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }).then(() => {
          return upcomment(this.ids, "1");
        })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            this.$refs.crud.toggleSelection();
          });
      },
      gbcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据开启评论?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }).then(() => {
          return upcomment(this.ids, "0");
        })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            this.$refs.crud.toggleSelection();
          });
      }
    },
  };
}
</script>
<style>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
</style>
src/views/article/components/deitDiscussion.vue
@@ -9,447 +9,448 @@
 * Copyright (c) 2024 by shuishen, All Rights Reserved.
-->
<template>
  <div>
    <el-dialog title="" append-to-body :visible.sync="popupTableShow" width="80%" :before-close="handleClose">
      <span slot="title" class="dialog-footer">
        {{ ontitle }}
      </span>
    <div>
        <el-dialog title="" append-to-body :visible.sync="popupTableShow" width="80%" :before-close="handleClose">
            <span slot="title" class="dialog-footer">
                {{ ontitle }}
            </span>
      <div id="" v-if="editFlag">
        <avue-form @submit="handleSubmit" :option="optionDiscuss" @reset-change="handleReset" v-model="disCussFrom">
        </avue-form>
      </div>
            <div id="" v-if="editFlag">
                <avue-form @submit="handleSubmit" :option="optionDiscuss" @reset-change="handleReset" v-model="disCussFrom">
                </avue-form>
            </div>
      <div id="" v-if="!editFlag">
        <avue-crud :table-loading="loading" :option="optionList" :data="data" v-model="form" ref="crud"
          @row-update="rowUpdate" @row-del="rowDel">
          <template slot="menuLeft" v-if="!editFlag">
            <el-button type="primary" size="small" plain icon="el-icon-circle-plus-outline" @click="add()">添加
            </el-button>
          </template>
          <template #icon="scope">
            <i :class="scope.row.icon" style="font-size:14px"></i>
          </template>
          <template #menu="{ row, size }">
            <el-button v-if="row.level === 1" :size="size" text type="primary" @click="edit(row)">编辑</el-button>
            <el-button v-if="row.level === 1" :size="size" text type="danger" @click="deletes(row)">删除</el-button>
            <el-button v-if="row.level === 2" :size="size" text type="primary" @click="openUser(row, 1)">
              选择此项人数:{{ row.number }} 详情</el-button>
          </template>
        </avue-crud>
      </div>
    </el-dialog>
            <div id="" v-if="!editFlag">
                <avue-crud :table-loading="loading" :option="optionList" :data="data" v-model="form" ref="crud"
                    @row-update="rowUpdate" @row-del="rowDel">
                    <template slot="menuLeft" v-if="!editFlag">
                        <el-button type="primary" size="small" plain icon="el-icon-circle-plus-outline" @click="add()">添加
                        </el-button>
                    </template>
                    <template #icon="scope">
                        <i :class="scope.row.icon" style="font-size:14px"></i>
                    </template>
                    <template #menu="{ row, size }">
                        <el-button v-if="row.level === 1" :size="size" text type="primary" @click="edit(row)">编辑</el-button>
                        <el-button v-if="row.level === 1" :size="size" text type="danger"
                            @click="deletes(row)">删除</el-button>
                        <el-button v-if="row.level === 2" :size="size" text type="primary" @click="openUser(row, 1)">
                            选择此项人数:{{ row.number }} 详情</el-button>
                    </template>
                </avue-crud>
            </div>
        </el-dialog>
    <el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="80%" :before-close="userHandleClose">
      <avue-crud :data="userData" :page="userPage" :option="userOption" @search-change="searchChange"
        @search-reset="searchReset"></avue-crud>
    </el-dialog>
  </div>
        <el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="80%" :before-close="userHandleClose">
            <avue-crud :data="userData" :page="userPage" :option="userOption" @search-change="searchChange"
                @search-reset="searchReset"></avue-crud>
        </el-dialog>
    </div>
</template>
<script>
  import {
import {
    getListPd,
    getDetailPd,
    addPd,
    updatePd,
    removePd
  } from "@/api/discuss/publicDiscuss"
} from "@/api/discuss/publicDiscuss"
  import {
import {
    getPage
  } from "@/api/discuss/userTopics"
} from "@/api/discuss/userTopics"
  import website from '@/config/website'
import website from '@/config/website'
  import {
import {
    getLists,
    getList,
    getDetail,
    add,
    update,
    remove
  } from "@/api/discuss/topics"
} from "@/api/discuss/topics"
  export default {
    data() {
      return {
        popupTableShow: false,
        popupTableUserShow: false,
export default {
    data () {
        return {
            popupTableShow: false,
            popupTableUserShow: false,
        loading: true,
            loading: true,
        ontitle: '编辑议题',
        editFlag: false,
            ontitle: '编辑议题',
            editFlag: false,
        disCussFrom: {
          discussContent: '',
          optionRange: 0,
          sort: 1,
          optionContent: '',
          optionDetail: '',
          number: '',
          createTime: '',
          updateTime: '',
          deleteFlag: '',
          articleId: '',
          parentId: '',
          level: '',
          children: [{
            optionContent: '',
            optionDetail: '',
            number: '',
            createTime: '',
            updateTime: '',
            deleteFlag: '',
            articleId: '',
            parentId: '',
            level: '',
          }]
        },
        optionDiscuss: {
          emptyText: '取消',
          column: [{
              label: '议题',
              prop: 'discussContent',
              type: 'input',
              row: true,
              rules: [{
                required: true,
                message: '请输入议题',
                trigger: 'blur'
              }],
            },
            {
              label: '选项范围',
              prop: 'optionRange',
              type: 'radio',
              value: 0,
              button: true,
              row: true,
              dicData: [{
                label: '多选',
                value: 1
              }, {
                label: '单选',
                value: 0
              }],
              rules: [{
                required: true,
                message: '请选项范围',
                trigger: 'blur'
              }],
            },
            // {
            //   label: '排序',
            //   prop: 'sort',
            //   controlsPosition: '',
            //   type: 'number'
            // },
            {
              label: '选项内容',
              prop: 'children',
              type: 'dynamic',
              span: 24,
              children: {
                column: [{
                  label: '选项标题',
                  prop: 'optionContent',
                  type: 'input',
                  rules: [{
                    required: true,
                    message: '请输入选项标题',
                    trigger: 'blur'
                  }]
                }, {
                  label: '选项说明',
                  prop: 'optionDetail',
                  type: 'input',
            disCussFrom: {
                discussContent: '',
                optionRange: 0,
                sort: 1,
                optionContent: '',
                optionDetail: '',
                number: '',
                createTime: '',
                updateTime: '',
                deleteFlag: '',
                articleId: '',
                parentId: '',
                level: '',
                children: [{
                    optionContent: '',
                    optionDetail: '',
                    number: '',
                    createTime: '',
                    updateTime: '',
                    deleteFlag: '',
                    articleId: '',
                    parentId: '',
                    level: '',
                }]
              }
            },
          ]
        },
        // 表单数据
        form: {},
        data: [],
        optionList: {
          headerAlign: 'center',
          align: 'center',
          border: true,
          addBtn: false,
          editBtn: false,
          delBtn: false,
          defaultExpandAll: true,
          rowKey: 'id',
          rowParentKey: 'parentId',
          column: [{
              label: '标题',
              prop: 'discussContent',
            optionDiscuss: {
                emptyText: '取消',
                column: [{
                    label: '议题',
                    prop: 'discussContent',
                    type: 'input',
                    row: true,
                    rules: [{
                        required: true,
                        message: '请输入议题',
                        trigger: 'blur'
                    }],
                },
                {
                    label: '选项范围',
                    prop: 'optionRange',
                    type: 'radio',
                    value: 0,
                    button: true,
                    row: true,
                    dicData: [{
                        label: '多选',
                        value: 1
                    }, {
                        label: '单选',
                        value: 0
                    }],
                    rules: [{
                        required: true,
                        message: '请选项范围',
                        trigger: 'blur'
                    }],
                },
                // {
                //   label: '排序',
                //   prop: 'sort',
                //   controlsPosition: '',
                //   type: 'number'
                // },
                {
                    label: '选项内容',
                    prop: 'children',
                    type: 'dynamic',
                    span: 24,
                    children: {
                        column: [{
                            label: '选项标题',
                            prop: 'optionContent',
                            type: 'input',
                            rules: [{
                                required: true,
                                message: '请输入选项标题',
                                trigger: 'blur'
                            }]
                        }, {
                            label: '选项说明',
                            prop: 'optionDetail',
                            type: 'input',
                        }]
                    }
                },
                ]
            },
            {
              label: '选项内容',
              prop: 'optionContent',
            }
          ]
        },
        articleId: '',
            // 表单数据
            form: {},
            data: [],
            optionList: {
                headerAlign: 'center',
                align: 'center',
                border: true,
                addBtn: false,
                editBtn: false,
                delBtn: false,
                defaultExpandAll: true,
                rowKey: 'id',
                rowParentKey: 'parentId',
                column: [{
                    label: '标题',
                    prop: 'discussContent',
                },
                {
                    label: '选项内容',
                    prop: 'optionContent',
                }
                ]
            },
        userData: [],
        userOption: {
          labelWidth: 96,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          // menuWidth: 500,
          menu: false,
            articleId: '',
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: false,
          //stripe:true,
          index: true,
          editBtn: false,
          addBtn: false,
          viewBtn: false,
          selection: true,
          delBtn: false,
          excelBtn: true,
          dialogClickModal: false,
          column: [{
            label: '姓名',
            prop: 'name',
            searchSpan: 4,
            search: true,
          }, {
            label: '头像',
            type: 'upload',
            listType: "picture-img",
            prop: 'avatar'
          }, {
            label: '手机',
            prop: 'phone',
            searchSpan: 4,
            search: true,
          }, {
            label: '小区',
            prop: 'aoiName'
          }, {
            label: '地址',
            prop: 'addressName'
          }, {
            label: '签名',
            type: 'upload',
            listType: "picture-img",
            prop: 'signaturePath'
          }, {
            label: '时间',
            prop: 'createTime'
          }]
        },
        // 分页信息
        userPage: {
          pageSize: 10,
          pageSizes: [10, 20, 30, 50, 100],
          currentPage: 1,
          total: 0
        },
        query: {},
      }
            userData: [],
            userOption: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                // menuWidth: 500,
                menu: false,
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: true,
                //stripe:true,
                index: true,
                editBtn: false,
                addBtn: false,
                viewBtn: false,
                selection: true,
                delBtn: false,
                excelBtn: true,
                dialogClickModal: false,
                column: [{
                    label: '姓名',
                    prop: 'name',
                    searchSpan: 4,
                    search: true,
                }, {
                    label: '头像',
                    type: 'upload',
                    listType: "picture-img",
                    prop: 'avatar'
                }, {
                    label: '手机',
                    prop: 'phone',
                    searchSpan: 4,
                    search: true,
                }, {
                    label: '小区',
                    prop: 'aoiName'
                }, {
                    label: '地址',
                    prop: 'addressName'
                }, {
                    label: '签名',
                    type: 'upload',
                    listType: "picture-img",
                    prop: 'signaturePath'
                }, {
                    label: '时间',
                    prop: 'createTime'
                }]
            },
            // 分页信息
            userPage: {
                pageSize: 10,
                pageSizes: [10, 20, 30, 50, 100],
                currentPage: 1,
                total: 0
            },
            query: {},
        }
    },
    watch: {},
    methods: {
      userHandleClose() {
        userHandleClose () {
        this.popupTableUserShow = false
      },
            this.popupTableUserShow = false
        },
      searchReset() {
        this.query = {}
        this.getUserPage(this.userPage)
      },
      searchChange(params, done) {
        this.query = params
        this.userPage.currentPage = 1
        this.getUserPage(this.userPage, params)
        done()
      },
      initData(newData) {
        this.editFlag = false
        this.popupTableShow = true
        this.articleId = newData.id
        this.query.level = 1
        this.query.articleId = this.articleId
        this.onLoad(this.userPage, this.query)
      },
      // initData(newData) {
      //   this.editFlag = false
      //   this.popupTableShow = true
      //   this.articleId = newData.id
      //   this.onLoad()
      // },
      handleClose() {
        this.popupTableShow = false
        this.disCussFrom = {}
      },
      handleSubmit(form, done) {
        done()
        form.articleId = this.articleId
        add(form).then(
          () => {
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            form = {}
            this.editFlag = false
            let params = {
              level: 1,
              articleId: this.articleId
            }
            getLists(1, 100, Object.assign(params, this.query)).then(res => {
              const data = res.data.data
              this.data = data
            })
          },
          (error) => {
            window.console.log(error)
          }
        )
      },
      handleReset() {
        this.editFlag = false
      },
      // 提交修改
      rowUpdate(row, index, done, loading) {
        done()
        if (!row.id) {
          addPd(row).then(() => {
            this.onLoad()
            this.$message({
              type: "success",
              message: "操作成功!"
            })
          })
        } else {
          updatePd(row).then(() => {
            this.onLoad()
            this.$message({
              type: "success",
              message: "操作成功!"
            })
          })
        }
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
        searchReset () {
            this.query = {}
            this.getUserPage(this.userPage)
        },
            this.$message({
              type: "success",
              message: "操作成功!"
        searchChange (params, done) {
            this.query = params
            this.userPage.currentPage = 1
            this.getUserPage(this.userPage, params)
            done()
        },
        initData (newData) {
            this.editFlag = false
            this.popupTableShow = true
            this.articleId = newData.id
            this.query.level = 1
            this.query.articleId = this.articleId
            this.onLoad(this.userPage, this.query)
        },
        // initData(newData) {
        //   this.editFlag = false
        //   this.popupTableShow = true
        //   this.articleId = newData.id
        //   this.onLoad()
        // },
        handleClose () {
            this.popupTableShow = false
            this.disCussFrom = {}
        },
        handleSubmit (form, done) {
            done()
            form.articleId = this.articleId
            add(form).then(
                () => {
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    form = {}
                    this.editFlag = false
                    let params = {
                        level: 1,
                        articleId: this.articleId
                    }
                    getLists(1, 100, Object.assign(params, this.query)).then(res => {
                        const data = res.data.data
                        this.data = data
                    })
                },
                (error) => {
                    window.console.log(error)
                }
            )
        },
        handleReset () {
            this.editFlag = false
        },
        // 提交修改
        rowUpdate (row, index, done, loading) {
            done()
            if (!row.id) {
                addPd(row).then(() => {
                    this.onLoad()
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
            } else {
                updatePd(row).then(() => {
                    this.onLoad()
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
            }
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
          })
      },
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.getUserPage(this.userPage)
      add() {
        this.editFlag = true
      },
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
      edit(row) {
        this.disCussFrom = row
        this.editFlag = true
      },
        add () {
            this.editFlag = true
        },
      deletes(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad()
        edit (row) {
            this.disCussFrom = row
            this.editFlag = true
        },
            this.$message({
              type: "success",
              message: "操作成功!"
        deletes (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
          })
      },
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad()
      openUser(row, type = 0) {
        this.popupTableUserShow = true
        this.query = {}
        if (type == 0) {
          this.userParams = {
            articleId: row.id
          }
        } else {
          this.userParams = {
            topicsId: row.id
          }
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        openUser (row, type = 0) {
            this.popupTableUserShow = true
            this.query = {}
            if (type == 0) {
                this.userParams = {
                    articleId: row.id
                }
            } else {
                this.userParams = {
                    topicsId: row.id
                }
            }
            this.getUserPage(this.userPage, this.userParams)
        },
        getUserPage (page, params = {}) {
            getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.userPage.total = data.total
                this.userData = data.records
                this.userData.forEach(item => {
                    if (item.avatar.length > 0) {
                        item.avatar = website.minioUrl + item.avatar
                    }
                    if (item.signaturePath && item.signaturePath.length > 0) {
                        item.signaturePath = website.minioUrl + item.signaturePath
                        // console.log("=====>", item.signaturePath)
                    }
                })
            })
        },
        onLoad (page, params = {}) {
            this.loading = true
            getLists(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.data = data
                this.loading = false
            })
        }
        this.getUserPage(this.userPage, this.userParams)
      },
      getUserPage(page, params = {}) {
        getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data
          this.userPage.total = data.total
          this.userData = data.records
          this.userData.forEach(item => {
            if (item.avatar.length > 0) {
              item.avatar = website.minioUrl + item.avatar
            }
            if (item.signaturePath && item.signaturePath.length > 0) {
              item.signaturePath = website.minioUrl + item.signaturePath
              // console.log("=====>", item.signaturePath)
            }
          })
        })
      },
      onLoad(page, params = {}) {
        this.loading = true
        getLists(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data
          this.data = data
          this.loading = false
        })
      }
    },
  }
}
</script>
<style lang="scss" scoped></style>
src/views/article/components/publicSignUpChild.vue
@@ -1,382 +1,381 @@
<template>
  <div>
    <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="80%" :before-close="userHandleClose">
      <avue-crud ref="DataUser" :option="userOption" :data="dataUser" v-model="dataUser" :page="pageUser"
        @search-change="searchChange" @search-reset="searchReset"></avue-crud>
    </el-dialog>
  </div>
    <div>
        <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="80%" :before-close="userHandleClose">
            <avue-crud ref="DataUser" :option="userOption" :data="dataUser" v-model="dataUser" :page="pageUser"
                @search-change="searchChange" @search-reset="searchReset"></avue-crud>
        </el-dialog>
    </div>
  <!-- </basicContainer> -->
    <!-- </basicContainer> -->
</template>
<script>
  import {
import {
    getListPd,
    getDetailPd,
    addPd,
    updatePd,
    removePd,
  } from "@/api/discuss/publicDiscuss"
  import {
} from "@/api/discuss/publicDiscuss"
import {
    getPageUser,
  } from "@/api/discuss/userPublicEnroll"
  import option from "@/option/discuss/publicDiscuss"
  import {
} from "@/api/discuss/userPublicEnroll"
import option from "@/option/discuss/publicDiscuss"
import {
    mapGetters
  } from "vuex"
  import {
} from "vuex"
import {
    getDictionary
  } from '@/api/system/dict'
} from '@/api/system/dict'
  import website from '@/config/website'
import website from '@/config/website'
  export default {
    data() {
      return {
        option1: {
          menu: false,
          addBtn: false,
          column: [{
            label: '姓名',
            prop: 'name'
          }, {
            label: '头像',
            prop: 'avatar'
          }, {
            label: '手机',
            prop: 'phone'
          }, {
            width: 220,
            overHidden: true,
            label: '小区名称',
            prop: 'aoiName'
          }, {
            label: '地址',
            prop: 'addressName'
          }, {
            label: '时间',
            prop: 'createTime'
          }]
        },
        discussForm: {
          ontitle: '',
          title: '',
          openFlag: 0,
          numberRestrictions: 0,
          voteRestrictions: 0,
          userRestrictions: 0,
          endTime: '',
          articleId: '',
          createTime: '',
          updateTime: '',
          deleteFlag: '',
          repeatVote: 0,
          voteNumberPublic: 0,
          appointUser: '',
          userIds: '',
          eventType: 1,
        },
        dialogVisibles: false,
        dialogVisiblesUser: false,
        // 弹框标题
        title: '',
        // 是否展示弹框
        box: false,
        // 是否显示查询
        search: true,
        // 加载中
        loading: true,
        // 是否为查看模式
        view: false,
        // 查询信息
        query: {},
        // 分页信息
        page: {
          pageSize: 10,
          pageSizes: [10, 20, 30, 50, 100],
          currentPage: 1,
          total: 0
        },
        // 分页信息
        pageUser: {
          pageSize: 10,
          pageSizes: [10, 20, 30, 50, 100],
          currentPage: 1,
          total: 0
        },
        // 表单数据
        form: {},
        // 选择行
        selectionList: [],
        userOption: {
          labelWidth: 96,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          // menuWidth: 500,
          menu: false,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: false,
          //stripe:true,
          index: true,
          editBtn: false,
          addBtn: false,
          viewBtn: false,
          selection: true,
          delBtn: false,
          excelBtn: true,
          dialogClickModal: false,
          column: [{
              label: '姓名',
              prop: 'name',
              search: true,
            }, {
              label: '头像',
              type: 'upload',
              listType: "picture-img",
              prop: 'avatar'
export default {
    data () {
        return {
            option1: {
                menu: false,
                addBtn: false,
                column: [{
                    label: '姓名',
                    prop: 'name'
                }, {
                    label: '头像',
                    prop: 'avatar'
                }, {
                    label: '手机',
                    prop: 'phone'
                }, {
                    width: 220,
                    overHidden: true,
                    label: '小区名称',
                    prop: 'aoiName'
                }, {
                    label: '地址',
                    prop: 'addressName'
                }, {
                    label: '时间',
                    prop: 'createTime'
                }]
            },
            {
              label: '签名',
              type: 'upload',
              listType: "picture-img",
              prop: 'signaturePath'
            discussForm: {
                ontitle: '',
                title: '',
                openFlag: 0,
                numberRestrictions: 0,
                voteRestrictions: 0,
                userRestrictions: 0,
                endTime: '',
                articleId: '',
                createTime: '',
                updateTime: '',
                deleteFlag: '',
                repeatVote: 0,
                voteNumberPublic: 0,
                appointUser: '',
                userIds: '',
                eventType: 1,
            },
            {
              label: '手机',
              prop: 'phone',
              search: true,
            }, {
              label: '小区',
              prop: 'aoiName'
            }, {
              label: '地址',
              prop: 'addressName'
            }, {
              label: '时间',
              prop: 'createTime'
            }
          ]
        },
        // 表单列表
        data: [],
        dataUser: [],
      }
            dialogVisibles: false,
            dialogVisiblesUser: false,
            // 弹框标题
            title: '',
            // 是否展示弹框
            box: false,
            // 是否显示查询
            search: true,
            // 加载中
            loading: true,
            // 是否为查看模式
            view: false,
            // 查询信息
            query: {},
            // 分页信息
            page: {
                pageSize: 10,
                pageSizes: [10, 20, 30, 50, 100],
                currentPage: 1,
                total: 0
            },
            // 分页信息
            pageUser: {
                pageSize: 10,
                pageSizes: [10, 20, 30, 50, 100],
                currentPage: 1,
                total: 0
            },
            // 表单数据
            form: {},
            // 选择行
            selectionList: [],
            userOption: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                // menuWidth: 500,
                menu: false,
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: true,
                //stripe:true,
                index: true,
                editBtn: false,
                addBtn: false,
                viewBtn: false,
                selection: true,
                delBtn: false,
                excelBtn: true,
                dialogClickModal: false,
                column: [{
                    label: '姓名',
                    prop: 'name',
                    search: true,
                }, {
                    label: '头像',
                    type: 'upload',
                    listType: "picture-img",
                    prop: 'avatar'
                },
                {
                    label: '签名',
                    type: 'upload',
                    listType: "picture-img",
                    prop: 'signaturePath'
                },
                {
                    label: '手机',
                    prop: 'phone',
                    search: true,
                }, {
                    label: '小区',
                    prop: 'aoiName'
                }, {
                    label: '地址',
                    prop: 'addressName'
                }, {
                    label: '时间',
                    prop: 'createTime'
                }
                ]
            },
            // 表单列表
            data: [],
            dataUser: [],
        }
    },
    mounted() {
      // this.init();
      // this.onLoad(this.page);
    mounted () {
        // this.init();
        // this.onLoad(this.page);
    },
    computed: {
      ...mapGetters(["permission"]),
      ids() {
        let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id)
        })
        return ids.join(",")
      }
        ...mapGetters(["permission"]),
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        }
    },
    methods: {
      searchReset() {
        this.query = {}
        this.getUser(this.userPage)
      },
        searchReset () {
            this.query = {}
            this.getUser(this.userPage)
        },
      searchChange(params, done) {
        this.query = params
        this.userPage.currentPage = 1
        this.getUser(this.userPage, params)
        done()
      },
      init(data) {
        this.houseCode = data.houseCode
        this.onLoad(this.page)
      },
      getUser(page, params) {
        getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data
          this.pageUser.total = data.total
          this.dataUser = data.records
          this.dataUser.forEach(item => {
            if (item.avatar.length > 0) {
              item.avatar = website.minioUrl + item.avatar
        searchChange (params, done) {
            this.query = params
            this.userPage.currentPage = 1
            this.getUser(this.userPage, params)
            done()
        },
        init (data) {
            this.houseCode = data.houseCode
            this.onLoad(this.page)
        },
        getUser (page, params) {
            getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.pageUser.total = data.total
                this.dataUser = data.records
                this.dataUser.forEach(item => {
                    if (item.avatar.length > 0) {
                        item.avatar = website.minioUrl + item.avatar
                    }
                    if (item.signaturePath && item.signaturePath.length > 0) {
                        item.signaturePath = website.minioUrl + item.signaturePath
                        console.log("=====>", item.signaturePath)
                    }
                })
                this.loading = false
                // this.selectionClear()
            })
        },
        userHandleClose () {
            this.dialogVisiblesUser = false
            this.dataUser = []
            // this.$refs.DataUser && this.$refs.DataUser.resetForm()
            // console.log(this.$refs, 90999)
        },
        openUser (row) {
            this.dialogVisiblesUser = true
            let params = {
                articleId: row.id
            }
            if (item.signaturePath && item.signaturePath.length > 0) {
              item.signaturePath = website.minioUrl + item.signaturePath
              console.log("=====>", item.signaturePath)
            this.getUser(this.pageUser, params)
        },
        openDilog (row, type) {
            this.dialogVisibles = true
            this.discussForm = row
            let times = new Date(row.endTime).getTime()
            this.discussForm.endTime = times
            console.table(this.discussForm)
            if (type == 0) {
                this.discussForm.ontitle = '公益报名'
            } else {
                this.discussForm.ontitle = '创建议题'
            }
          })
          this.loading = false
          // this.selectionClear()
        })
      },
      userHandleClose() {
        this.dialogVisiblesUser = false
        this.dataUser = []
        // this.$refs.DataUser && this.$refs.DataUser.resetForm()
        // console.log(this.$refs, 90999)
      },
        },
      openUser(row) {
        this.dialogVisiblesUser = true
        let params = {
          articleId: row.id
        }
        this.getUser(this.pageUser, params)
      },
      openDilog(row, type) {
        this.dialogVisibles = true
        this.discussForm = row
        let times = new Date(row.endTime).getTime()
        this.discussForm.endTime = times
        console.table(this.discussForm)
        if (type == 0) {
          this.discussForm.ontitle = '公益报名'
        } else {
          this.discussForm.ontitle = '创建议题'
        }
      },
      searchHide() {
        this.search = !this.search
      },
      searchChange() {
        this.onLoad(this.page)
      },
      searchReset() {
        this.query = {}
        this.page.currentPage = 1
        this.onLoad(this.page)
      },
      handleSubmit(form, done) {
        done()
        if (!this.discussForm.id) {
          addPd(this.discussForm).then(() => {
            this.dialogVisibles = false
        searchHide () {
            this.search = !this.search
        },
        searchChange () {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            })
          })
        } else {
          updatePd(this.discussForm).then(() => {
            this.dialogVisibles = false
        },
        searchReset () {
            this.query = {}
            this.page.currentPage = 1
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
        },
        handleSubmit (form, done) {
            done()
            if (!this.discussForm.id) {
                addPd(this.discussForm).then(() => {
                    this.dialogVisibles = false
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
            } else {
                updatePd(this.discussForm).then(() => {
                    this.dialogVisibles = false
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
            }
        },
        handleAdd () {
            this.title = '新增'
            this.form = {}
            this.box = true
        },
        handleEdit (row) {
            this.title = '编辑'
            this.box = true
            getDetailPd(row.id).then(res => {
                this.form = res.data.data
            })
          })
        },
        handleView (row) {
            this.title = '查看'
            this.view = true
            this.box = true
            getDetailPd(row.id).then(res => {
                this.form = res.data.data
            })
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return removePd(this.ids)
                })
                .then(() => {
                    this.selectionClear()
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        beforeClose (done) {
            done()
            this.form = {}
            this.view = false
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            // this.$refs.table.clearSelection();
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
            this.onLoad(this.page)
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
            this.onLoad(this.page)
        },
        onLoad (page, params = {
            eventType: 0
        }) {
            this.loading = true
            getListPd(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        }
      },
      handleAdd() {
        this.title = '新增'
        this.form = {}
        this.box = true
      },
      handleEdit(row) {
        this.title = '编辑'
        this.box = true
        getDetailPd(row.id).then(res => {
          this.form = res.data.data
        })
      },
      handleView(row) {
        this.title = '查看'
        this.view = true
        this.box = true
        getDetailPd(row.id).then(res => {
          this.form = res.data.data
        })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return removePd(this.ids)
          })
          .then(() => {
            this.selectionClear()
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            })
          })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            })
          })
      },
      beforeClose(done) {
        done()
        this.form = {}
        this.view = false
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        // this.$refs.table.clearSelection();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
        this.onLoad(this.page)
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
        this.onLoad(this.page)
      },
      onLoad(page, params = {
        eventType: 0
      }) {
        this.loading = true
        getListPd(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.loading = false
          this.selectionClear()
        })
      }
    }
  }
}
</script>
<style lang="scss" scoped>
  .el-pagination {
.el-pagination {
    margin-top: 20px;
  }
}
</style>
src/views/article/discussionManage.vue
@@ -1,773 +1,777 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <template slot="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
          除
        </el-button>
      </template>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
                    除
                </el-button>
            </template>
      <template slot-scope="{type,size,row }" slot="menu">
        <el-button icon="el-icon-s-tools" :size="size" :type="type" @click.stop="openDilog(row, 1)">
          设置
        </el-button>
            <template slot-scope="{type,size,row }" slot="menu">
                <el-button icon="el-icon-s-tools" :size="size" :type="type" @click.stop="openDilog(row, 1)">
                    设置
                </el-button>
        <el-button icon="el-icon-edit" :size="size" :type="type" @click.stop="openEditPopup(row, 1)">
          编辑议题
        </el-button>
                <el-button icon="el-icon-edit" :size="size" :type="type" @click.stop="openEditPopup(row, 1)">
                    编辑议题
                </el-button>
        <el-button icon="el-icon-user" :size="size" :type="type" @click.stop="openUserPopup(row, 1)">
          参与用户
        </el-button>
                <el-button icon="el-icon-user" :size="size" :type="type" @click.stop="openUserPopup(row, 1)">
                    参与用户
                </el-button>
        <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
          撤销
        </el-button>
                <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type"
                    @click.stop="updateFb(row)">
                    撤销
                </el-button>
        <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" @click.stop="updateFb(row)">
          发布
        </el-button>
      </template>
                <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type"
                    @click.stop="updateFb(row)">
                    发布
                </el-button>
            </template>
      <template slot-scope="{ row, size }" slot="publish">
        <el-tag :size="size" :type="showStatus(row.publish, 1).type" v-text="showStatus(row.publish, 1).text">
        </el-tag>
      </template>
            <template slot-scope="{ row, size }" slot="publish">
                <el-tag :size="size" :type="showStatus(row.publish, 1).type" v-text="showStatus(row.publish, 1).text">
                </el-tag>
            </template>
      <template slot-scope="{ row, size }" slot="iscomment">
        <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
        </el-tag>
      </template>
    </avue-crud>
            <template slot-scope="{ row, size }" slot="iscomment">
                <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
                </el-tag>
            </template>
        </avue-crud>
    <deitDiscussion ref="DeitDiscussion">
    </deitDiscussion>
        <deitDiscussion ref="DeitDiscussion">
        </deitDiscussion>
    <discussionManageChild ref="discussionManageChild" />
        <discussionManageChild ref="discussionManageChild" />
  </basic-container>
    </basic-container>
</template>
<script>
  import {
import {
    getList,
    remove,
    update,
    add,
    getNotice,
    upcomment
  } from "@/api/article/article"
} from "@/api/article/article"
  import {
import {
    getListPd,
    removePd,
    updatePd,
    addPd,
    getNoticePd,
    upcommentPd
  } from "@/api/discuss/publicDiscuss"
  import website from '@/config/website'
  import {
} from "@/api/discuss/publicDiscuss"
import website from '@/config/website'
import {
    getDistrictTree
  } from "@/api/district/index"
  import {
} from "@/api/district/index"
import {
    mapGetters
  } from "vuex"
  import deitDiscussion from "./components/deitDiscussion"
  import discussionManageChild from "./components/discussionManageChild"
} from "vuex"
import deitDiscussion from "./components/deitDiscussion"
import discussionManageChild from "./components/discussionManageChild"
  export default {
export default {
    components: {
      deitDiscussion,
      discussionManageChild,
        deitDiscussion,
        discussionManageChild,
    },
    data() {
      return {
        discussForm: {
          ontitle: '',
          title: '',
          openFlag: 0,
          numberRestrictions: 0,
          voteRestrictions: 0,
          userRestrictions: 0,
          signatureFlag: 0,
          endTime: '',
          articleId: '',
          createTime: '',
          updateTime: '',
          deleteFlag: '',
          repeatVote: 0,
          voteNumberPublic: 0,
          appointUser: 0,
          userIds: '',
          eventType: 1,
        },
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 96,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 500,
    data () {
        return {
            discussForm: {
                ontitle: '',
                title: '',
                openFlag: 0,
                numberRestrictions: 0,
                voteRestrictions: 0,
                userRestrictions: 0,
                signatureFlag: 0,
                endTime: '',
                articleId: '',
                createTime: '',
                updateTime: '',
                deleteFlag: '',
                repeatVote: 0,
                voteNumberPublic: 0,
                appointUser: 0,
                userIds: '',
                eventType: 1,
            },
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 500,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: false,
          //stripe:true,
          index: true,
          viewBtn: false,
          selection: true,
          excelBtn: true,
          dialogClickModal: false,
          column: [{
              overHidden: true,
              label: "议事标题",
              prop: "title",
              span: 24,
              row: true,
              searchSpan: 4,
              search: true,
              rules: [{
                required: true,
                message: "请输入议事标题",
                trigger: "blur",
              }, ],
            },
            {
              label: "范围",
              prop: "articleList",
              span: 24,
              minRows: 2,
              tags: true,
              type: "cascader",
              multiple: true,
              dicData: [],
              rules: [{
                required: true,
                message: "请选择范围",
                trigger: "blur",
              }, ],
              props: {
                label: "name",
                value: 'id'
              },
              hide: true,
            },
            {
              width: 110,
              label: "封面",
              prop: "url",
              // align:'center',
              type: "upload",
              listType: "picture-img",
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                url: "link",
              },
              // hide: true,
              span: 24,
            },
            {
              width: 110,
              label: "文章类型",
              prop: "articleType",
              addDisplay: true,
              editDisplay: true,
              viewDisplay: true,
              searchSpan: 4,
              checkStrictly: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=investigateType",
              props: {
                label: "dictValue",
                value: "dictKey",
              },
              search: true,
              type: "tree",
              rules: [{
                required: true,
                message: "请选择文章类型",
                trigger: "blur",
              }, ],
            },
            {
              label: "发布时间",
              prop: "dateTime",
              type: "daterange",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              searchSpan: 6,
              searchRange: true,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [{
                required: true,
                message: "请选择发布时间",
                trigger: "blur",
              }, ],
            },
            {
              width: 100,
              label: "发布时间",
              prop: "createTime",
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
            },
            {
              width: 100,
              label: "发布状态",
              prop: "publish",
              searchSpan: 4,
              value: "0",
              slot: true,
              search: true,
              type: "select",
              rules: [{
                required: true,
                message: "请选择发布状态",
                trigger: "blur",
              }, ],
              dicData: [{
                  label: "未发布",
                  value: "0",
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: false,
                selection: true,
                excelBtn: true,
                dialogClickModal: false,
                column: [{
                    overHidden: true,
                    label: "议事标题",
                    prop: "title",
                    span: 24,
                    row: true,
                    searchSpan: 4,
                    search: true,
                    searchLabelWidth: 76,
                    rules: [{
                        required: true,
                        message: "请输入议事标题",
                        trigger: "blur",
                    },],
                },
                {
                  label: "已发布",
                  value: "1",
                }
              ],
            },
            {
              span: 24,
              label: "评论区",
              prop: "iscomment",
              width: 80,
              slot: true,
              type: "switch",
              activeColor: "#13ce66",
              inactiveColor: "#ccc",
              value: '1',
              dicData: [{
                  label: "关闭",
                  value: "0",
                    label: "范围",
                    prop: "articleList",
                    span: 24,
                    minRows: 2,
                    tags: true,
                    type: "cascader",
                    multiple: true,
                    dicData: [],
                    rules: [{
                        required: true,
                        message: "请选择范围",
                        trigger: "blur",
                    },],
                    props: {
                        label: "name",
                        value: 'id'
                    },
                    hide: true,
                },
                {
                  label: "开启",
                  value: "1",
                }
              ],
            },
            {
              label: "视频",
              prop: "videoUrl",
              type: "upload",
              accept: "video/mp4",
              display: false,
              hide: true,
              span: 24,
              listType: "picture-img",
              action: "/api/depl/put-depl",
              propsHttp: {
                url: "data",
              },
            },
            {
              label: "议事内容",
              prop: "content",
              component: "AvueUeditor",
              options: {
                action: "/api/blade-resource/oss/endpoint/put-file",
                // customConfig: {
                //   lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
                // },//wangEditor编辑的配置
                props: {
                  res: "data",
                  url: "link",
                    width: 110,
                    label: "封面",
                    prop: "url",
                    // align:'center',
                    type: "upload",
                    listType: "picture-img",
                    action: "/api/blade-resource/oss/endpoint/put-file",
                    propsHttp: {
                        res: "data",
                        url: "link",
                    },
                    // hide: true,
                    span: 24,
                },
              },
              hide: true,
              minRows: 6,
              span: 24,
                {
                    width: 110,
                    label: "文章类型",
                    prop: "articleType",
                    addDisplay: true,
                    editDisplay: true,
                    viewDisplay: true,
                    searchSpan: 4,
                    checkStrictly: true,
                    dicUrl: "/api/blade-system/dict-biz/dictionary?code=investigateType",
                    props: {
                        label: "dictValue",
                        value: "dictKey",
                    },
                    search: true,
                    type: "tree",
                    rules: [{
                        required: true,
                        message: "请选择文章类型",
                        trigger: "blur",
                    },],
                },
                {
                    label: "发布时间",
                    prop: "dateTime",
                    type: "daterange",
                    format: "yyyy-MM-dd",
                    valueFormat: "yyyy-MM-dd",
                    searchSpan: 6,
                    searchRange: true,
                    hide: true,
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    search: true,
                    rules: [{
                        required: true,
                        message: "请选择发布时间",
                        trigger: "blur",
                    },],
                },
                {
                    width: 100,
                    label: "发布时间",
                    prop: "createTime",
                    type: "date",
                    format: "yyyy-MM-dd",
                    valueFormat: "yyyy-MM-dd HH:mm:ss",
                },
                {
                    width: 100,
                    label: "发布状态",
                    prop: "publish",
                    searchSpan: 4,
                    value: "0",
                    slot: true,
                    search: true,
                    type: "select",
                    rules: [{
                        required: true,
                        message: "请选择发布状态",
                        trigger: "blur",
                    },],
                    dicData: [{
                        label: "未发布",
                        value: "0",
                    },
                    {
                        label: "已发布",
                        value: "1",
                    }
                    ],
                },
                {
                    span: 24,
                    label: "评论区",
                    prop: "iscomment",
                    width: 80,
                    slot: true,
                    type: "switch",
                    activeColor: "#13ce66",
                    inactiveColor: "#ccc",
                    value: '1',
                    dicData: [{
                        label: "关闭",
                        value: "0",
                    },
                    {
                        label: "开启",
                        value: "1",
                    }
                    ],
                },
                {
                    label: "视频",
                    prop: "videoUrl",
                    type: "upload",
                    accept: "video/mp4",
                    display: false,
                    hide: true,
                    span: 24,
                    listType: "picture-img",
                    action: "/api/depl/put-depl",
                    propsHttp: {
                        url: "data",
                    },
                },
                {
                    label: "议事内容",
                    prop: "content",
                    component: "AvueUeditor",
                    options: {
                        action: "/api/blade-resource/oss/endpoint/put-file",
                        // customConfig: {
                        //   lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
                        // },//wangEditor编辑的配置
                        props: {
                            res: "data",
                            url: "link",
                        },
                    },
                    hide: true,
                    minRows: 6,
                    span: 24,
                },
                ],
            },
          ],
        },
        data: [],
        optionDiscuss: {
          column: [{
              label: "",
              type: 'title',
              prop: "title",
              span: 24,
              row: true,
              offset: 2,
              styles: {
                fontSize: '24px'
              }
            }, {
              labelWidth: 100,
              label: '开启投票',
              prop: 'openFlag',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '开启',
                value: 0
              }, {
                label: '不开启',
                value: 1
              }],
              rules: [{
                required: true,
                message: "请选择开启状态",
                trigger: "blur",
              }, ],
            }, {
              labelWidth: 100,
              label: '投票限制',
              prop: 'voteRestrictions',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '一人一票',
                value: 0
              }, {
                label: '一户一票',
                value: 1
              }],
              rules: [{
                required: true,
                message: "请选择投票限制",
                trigger: "blur",
              }, ],
            }, {
              labelWidth: 100,
              label: '签名',
              prop: 'signatureFlag',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '不需要',
                value: 0
              }, {
                label: '需要',
                value: 1
              }],
              rules: [{
                required: true,
                message: "请选择是否签名",
                trigger: "blur",
              }, ],
            }, {
              labelWidth: 100,
              label: '指定用户',
              prop: 'appointUser',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '不限制',
                value: 0
              }, {
                label: '指定用户',
                value: 1
              }],
              rules: [{
                required: true,
                message: "请选择是否指定用户",
                trigger: "blur",
              }, ],
            data: [],
            optionDiscuss: {
                column: [{
                    label: "",
                    type: 'title',
                    prop: "title",
                    span: 24,
                    row: true,
                    offset: 2,
                    styles: {
                        fontSize: '24px'
                    }
                }, {
                    labelWidth: 100,
                    label: '开启投票',
                    prop: 'openFlag',
                    type: 'radio',
                    button: true,
                    row: true,
                    offset: 6,
                    dicData: [{
                        label: '开启',
                        value: 0
                    }, {
                        label: '不开启',
                        value: 1
                    }],
                    rules: [{
                        required: true,
                        message: "请选择开启状态",
                        trigger: "blur",
                    },],
                }, {
                    labelWidth: 100,
                    label: '投票限制',
                    prop: 'voteRestrictions',
                    type: 'radio',
                    button: true,
                    row: true,
                    offset: 6,
                    dicData: [{
                        label: '一人一票',
                        value: 0
                    }, {
                        label: '一户一票',
                        value: 1
                    }],
                    rules: [{
                        required: true,
                        message: "请选择投票限制",
                        trigger: "blur",
                    },],
                }, {
                    labelWidth: 100,
                    label: '签名',
                    prop: 'signatureFlag',
                    type: 'radio',
                    button: true,
                    row: true,
                    offset: 6,
                    dicData: [{
                        label: '不需要',
                        value: 0
                    }, {
                        label: '需要',
                        value: 1
                    }],
                    rules: [{
                        required: true,
                        message: "请选择是否签名",
                        trigger: "blur",
                    },],
                }, {
                    labelWidth: 100,
                    label: '指定用户',
                    prop: 'appointUser',
                    type: 'radio',
                    button: true,
                    row: true,
                    offset: 6,
                    dicData: [{
                        label: '不限制',
                        value: 0
                    }, {
                        label: '指定用户',
                        value: 1
                    }],
                    rules: [{
                        required: true,
                        message: "请选择是否指定用户",
                        trigger: "blur",
                    },],
                },
                {
                    label: "截止时间",
                    row: true,
                    offset: 6,
                    prop: "endTime",
                    type: "datetime",
                    format: "yyyy-MM-dd hh:mm:ss",
                    valueFormat: "timestamp",
                    rules: [{
                        required: true,
                        message: "请选择截止时间",
                        trigger: "blur",
                    },],
                },
                ]
            },
            {
              label: "截止时间",
              row: true,
              offset: 6,
              prop: "endTime",
              type: "datetime",
              format: "yyyy-MM-dd hh:mm:ss",
              valueFormat: "timestamp",
              rules: [{
                required: true,
                message: "请选择截止时间",
                trigger: "blur",
              }, ],
            },
          ]
        },
        districtTree: [],
      }
            districtTree: [],
        }
    },
    watch: {
      "form.articleType": {
        handler(val) {
          if (val) {
            var videoUrl = this.findObject(this.option.column, "videoUrl")
            var content = this.findObject(this.option.column, "content")
            if (val.indexOf('ksp') != -1) {
              videoUrl.display = true
              content.display = false
              videoUrl.rules = [{
                required: false,
                message: "请选择视频",
                trigger: "blur",
              }, ]
            } else {
              videoUrl.display = false
              content.display = true
              videoUrl.rules = ""
            }
          }
        },
        immediate: true,
      }
        "form.articleType": {
            handler (val) {
                if (val) {
                    var videoUrl = this.findObject(this.option.column, "videoUrl")
                    var content = this.findObject(this.option.column, "content")
                    if (val.indexOf('ksp') != -1) {
                        videoUrl.display = true
                        content.display = false
                        videoUrl.rules = [{
                            required: false,
                            message: "请选择视频",
                            trigger: "blur",
                        },]
                    } else {
                        videoUrl.display = false
                        content.display = true
                        videoUrl.rules = ""
                    }
                }
            },
            immediate: true,
        }
    },
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.article_add, true),
          viewBtn: this.vaildData(this.permission.article_view, true),
          delBtn: this.vaildData(this.permission.article_delete, true),
          editBtn: this.vaildData(this.permission.article_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
      showStatus() {
        return (data, type) => {
          if (data == 0) {
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
              text: type == 1 ? '未发布' : '关闭',
              type: 'info'
                addBtn: this.vaildData(this.permission.article_add, true),
                viewBtn: this.vaildData(this.permission.article_view, true),
                delBtn: this.vaildData(this.permission.article_delete, true),
                editBtn: this.vaildData(this.permission.article_edit, true),
            }
          } else if (data == 1) {
            return {
              text: type == 1 ? '已发布' : '开启',
              type: 'success'
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
        showStatus () {
            return (data, type) => {
                if (data == 0) {
                    return {
                        text: type == 1 ? '未发布' : '关闭',
                        type: 'info'
                    }
                } else if (data == 1) {
                    return {
                        text: type == 1 ? '已发布' : '开启',
                        type: 'success'
                    }
                }
            }
          }
        }
      }
    },
    methods: {
      openEditPopup(row) {
        this.$refs.DeitDiscussion.initData(row)
      },
        openEditPopup (row) {
            this.$refs.DeitDiscussion.initData(row)
        },
      openUserPopup(row) {
        this.$refs.DeitDiscussion.openUser(row)
      },
        openUserPopup (row) {
            this.$refs.DeitDiscussion.openUser(row)
        },
      openDilog(row, type) {
        var that = this
        this.$nextTick(() => {
          that.$refs.discussionManageChild.init(row)
        })
      },
      rowSave(row, done, loading) {
        if (row.videoUrl.length == 0) {
          row.videoUrl = ""
        }
        row.userid = this.userInfo.user_id
        row.articleRange = JSON.stringify(row.articleList)
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        // 类型  0:文章 1经营性收支,2:物业招标 3:公益报名 4:选举调查
        row.type = 4
        row.publish = 1
        add(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
        openDilog (row, type) {
            var that = this
            this.$nextTick(() => {
                that.$refs.discussionManageChild.init(row)
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowUpdate(row, index, done, loading) {
        row.articleRange = JSON.stringify(row.articleList)
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        },
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getNotice(this.form.id).then((res) => {
            let data = res.data.data
            // data.forEach(item=>{
            if (data.url.length > 0) {
              var urls = []
              var names = data.url.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              data.url = urls.join(",")
        rowSave (row, done, loading) {
            if (row.videoUrl.length == 0) {
                row.videoUrl = ""
            }
            // })
            this.form = {
              ...data,
              articleList: JSON.parse(data.articleRange)
            row.userid = this.userInfo.user_id
            row.articleRange = JSON.stringify(row.articleList)
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
          })
        }
        // con
        done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {
          dateTime
        } = this.query
        let values = {
          ...params,
        }
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          }
          values.dateTime = null
        }
        values.type = 4
        this.loading = true
        console.log(values)
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.data.forEach(item => {
            if (item.url.length > 0) {
              var urls = []
              var names = item.url.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              item.url = urls.join(",")
            // 类型  0:文章 1经营性收支,2:物业招标 3:公益报名 4:选举调查
            row.type = 4
            row.publish = 1
            add(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            row.articleRange = JSON.stringify(row.articleList)
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
          })
          this.loading = false
          this.selectionClear()
        })
        getDistrictTree(params = {}).then((res) => {
          const data = res.data.data
          this.districtTree = data
          const column = this.findObject(this.option.column, "articleList")
          column.dicData = res.data.data
          this.loading = false
        })
      },
      updateFb(row) {
        if (row.publish == "0") {
          row.publish = "1"
        } else {
          row.publish = "0"
        }
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      kqcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据开启评论?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            return upcomment(this.ids, "1")
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
          })
      },
      gbcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据开启评论?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            return upcomment(this.ids, "0")
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
            this.$refs.crud.toggleSelection()
          })
      }
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getNotice(this.form.id).then((res) => {
                    let data = res.data.data
                    // data.forEach(item=>{
                    if (data.url.length > 0) {
                        var urls = []
                        var names = data.url.split(",")
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        data.url = urls.join(",")
                    }
                    // })
                    this.form = {
                        ...data,
                        articleList: JSON.parse(data.articleRange)
                    }
                })
            }
            // con
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const {
                dateTime
            } = this.query
            let values = {
                ...params,
            }
            if (dateTime) {
                values = {
                    ...params,
                    startTime: dateTime[0],
                    endTime: dateTime[1],
                    ...this.query,
                }
                values.dateTime = null
            }
            values.type = 4
            this.loading = true
            console.log(values)
            getList(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.data.forEach(item => {
                    if (item.url.length > 0) {
                        var urls = []
                        var names = item.url.split(",")
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        item.url = urls.join(",")
                    }
                })
                this.loading = false
                this.selectionClear()
            })
            getDistrictTree(params = {}).then((res) => {
                const data = res.data.data
                this.districtTree = data
                const column = this.findObject(this.option.column, "articleList")
                column.dicData = res.data.data
                this.loading = false
            })
        },
        updateFb (row) {
            if (row.publish == "0") {
                row.publish = "1"
            } else {
                row.publish = "0"
            }
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        kqcomment () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据开启评论?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                return upcomment(this.ids, "1")
            })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        gbcomment () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据开启评论?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                return upcomment(this.ids, "0")
            })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        }
    },
  }
}
</script>
<style>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
</style>
src/views/article/publicSignUp.vue
@@ -1,734 +1,736 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <template slot="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
          除
        </el-button>
      </template>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
                    除
                </el-button>
            </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row)">
          公益报名
        </el-button>
        <el-button icon="el-icon-user" :size="size" :type="type" @click.stop="openUserPopup(row)">
          参与用户
        </el-button>
        <!-- <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
            <template slot-scope="{ type, size, row }" slot="menu">
                <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row)">
                    公益报名
                </el-button>
                <el-button icon="el-icon-user" :size="size" :type="type" @click.stop="openUserPopup(row)">
                    参与用户
                </el-button>
                <!-- <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
          撤销
        </el-button> -->
        <!-- <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" @click.stop="updateFb(row)">
                <!-- <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" @click.stop="updateFb(row)">
          发布
        </el-button> -->
      </template>
            </template>
      <template slot-scope="{ row, size }" slot="publish">
        <el-tag :size="size" :type="showStatus(row.publish, 1).type" v-text="showStatus(row.publish, 1).text">
        </el-tag>
      </template>
            <template slot-scope="{ row, size }" slot="publish">
                <el-tag :size="size" :type="showStatus(row.publish, 1).type" v-text="showStatus(row.publish, 1).text">
                </el-tag>
            </template>
      <template slot-scope="{ row, size }" slot="iscomment">
        <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
        </el-tag>
      </template>
    </avue-crud>
            <template slot-scope="{ row, size }" slot="iscomment">
                <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
                </el-tag>
            </template>
        </avue-crud>
    <publicSignUpChild ref="publicSignUpChild"></publicSignUpChild>
        <publicSignUpChild ref="publicSignUpChild"></publicSignUpChild>
    <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose">
      <span slot="title" class="dialog-footer">
        {{ discussForm.ontitle }}
      </span>
      <avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm"></avue-form>
    </el-dialog>
  </basic-container>
        <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose">
            <span slot="title" class="dialog-footer">
                {{ discussForm.ontitle }}
            </span>
            <avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm"></avue-form>
        </el-dialog>
    </basic-container>
</template>
<script>
  import {
import {
    getList,
    remove,
    update,
    add,
    getNotice,
    upcomment
  } from "@/api/article/article"
} from "@/api/article/article"
  import {
import {
    getListPd,
    removePd,
    updatePd,
    addPd,
    getDetailPd,
    upcommentPd
  } from "@/api/discuss/publicDiscuss"
} from "@/api/discuss/publicDiscuss"
  import website from '@/config/website'
import website from '@/config/website'
  import {
import {
    getDistrictTree
  } from "@/api/district/index"
} from "@/api/district/index"
  import {
import {
    mapGetters
  } from "vuex"
  import publicSignUpChild from "./components/publicSignUpChild"
} from "vuex"
import publicSignUpChild from "./components/publicSignUpChild"
  export default {
export default {
    components: {
      publicSignUpChild
        publicSignUpChild
    },
    data() {
      return {
        discussForm: {
          ontitle: '',
          title: '',
          openFlag: 0,
          numberRestrictions: 0,
          voteRestrictions: 0,
          userRestrictions: 0,
          endTime: '',
          articleId: '',
          createTime: '',
          updateTime: '',
          deleteFlag: '',
          repeatVote: 0,
          voteNumberPublic: 0,
          appointUser: '',
          userIds: '',
          eventType: 0,
        },
        dialogVisibles: false,
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 96,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 500,
    data () {
        return {
            discussForm: {
                ontitle: '',
                title: '',
                openFlag: 0,
                numberRestrictions: 0,
                voteRestrictions: 0,
                userRestrictions: 0,
                endTime: '',
                articleId: '',
                createTime: '',
                updateTime: '',
                deleteFlag: '',
                repeatVote: 0,
                voteNumberPublic: 0,
                appointUser: '',
                userIds: '',
                eventType: 0,
            },
            dialogVisibles: false,
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 500,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: false,
          //stripe:true,
          index: true,
          viewBtn: false,
          selection: true,
          excelBtn: true,
          dialogClickModal: false,
          column: [{
              label: "文章标题",
              prop: "title",
              span: 24,
              row: true,
              searchSpan: 4,
              search: true,
              rules: [{
                required: true,
                message: "请输入文章标题",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              label: "文章封面",
              prop: "url",
              // align:'center',
              type: "upload",
              listType: "picture-img",
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                url: "link",
              },
              // hide: true,
              span: 24,
            },
            {
              label: "文章范围",
              prop: "articleList",
              span: 12,
              minRows: 2,
              type: "cascader",
              multiple: true,
              tags: true,
              dicData: [],
              rules: [{
                required: true,
                message: "请选择文章范围",
                trigger: "blur",
              }, ],
              props: {
                label: "name",
                value: 'id'
              },
              hide: true,
            },
            {
              width: 110,
              label: "文章类型",
              prop: "type",
              searchSpan: 4,
              value: 3,
              slot: true,
              // search: true,
              type: "select",
              rules: [{
                required: true,
                message: "请选择文章类型",
                trigger: "blur",
              }, ],
              dicData: [{
                label: "公益报名",
                value: 3, //  // 类型  0:文章 1经营性收支,2:物业招标 3:公益报名 4:选举调查
              }],
            },
            {
              label: "发布时间",
              prop: "dateTime",
              type: "daterange",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              searchSpan: 6,
              searchRange: true,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [{
                required: true,
                message: "请选择发布时间",
                trigger: "blur",
              }, ],
            },
            {
              width: 100,
              label: "发布时间",
              prop: "createTime",
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
            },
            {
              width: 100,
              label: "发布状态",
              prop: "publish",
              searchSpan: 4,
              value: "1",
              slot: true,
              hide: true,
              // search: true,
              type: "select",
              rules: [{
                required: true,
                message: "请选择发布状态",
                trigger: "blur",
              }, ],
              dicData: [{
                  label: "未发布",
                  value: "0",
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: false,
                selection: true,
                excelBtn: true,
                dialogClickModal: false,
                column: [{
                    label: "文章标题",
                    prop: "title",
                    span: 24,
                    row: true,
                    searchSpan: 4,
                    search: true,
                    searchLabelWidth: 76,
                    rules: [{
                        required: true,
                        message: "请输入文章标题",
                        trigger: "blur",
                    },],
                },
                {
                  label: "已发布",
                  value: "1",
                }
              ],
            },
            {
              width: 80,
              label: "评论区",
              prop: "iscomment",
              slot: true,
              type: "select",
              dicData: [{
                  label: "关闭",
                  value: "0",
                    width: 110,
                    label: "文章封面",
                    prop: "url",
                    // align:'center',
                    type: "upload",
                    listType: "picture-img",
                    action: "/api/blade-resource/oss/endpoint/put-file",
                    propsHttp: {
                        res: "data",
                        url: "link",
                    },
                    // hide: true,
                    span: 24,
                },
                {
                  label: "开启",
                  value: "1",
                }
              ],
            },
            {
              label: "文章内容",
              prop: "content",
              component: "AvueUeditor",
              options: {
                action: "/api/blade-resource/oss/endpoint/put-file",
                props: {
                  res: "data",
                  url: "link",
                    label: "文章范围",
                    prop: "articleList",
                    span: 12,
                    minRows: 2,
                    type: "cascader",
                    multiple: true,
                    tags: true,
                    dicData: [],
                    rules: [{
                        required: true,
                        message: "请选择文章范围",
                        trigger: "blur",
                    },],
                    props: {
                        label: "name",
                        value: 'id'
                    },
                    hide: true,
                },
              },
              hide: true,
              minRows: 6,
              span: 24,
                {
                    width: 110,
                    label: "文章类型",
                    prop: "type",
                    searchSpan: 4,
                    value: 3,
                    slot: true,
                    // search: true,
                    type: "select",
                    rules: [{
                        required: true,
                        message: "请选择文章类型",
                        trigger: "blur",
                    },],
                    dicData: [{
                        label: "公益报名",
                        value: 3, //  // 类型  0:文章 1经营性收支,2:物业招标 3:公益报名 4:选举调查
                    }],
                },
                {
                    label: "发布时间",
                    prop: "dateTime",
                    type: "daterange",
                    format: "yyyy-MM-dd",
                    valueFormat: "yyyy-MM-dd",
                    searchSpan: 6,
                    searchRange: true,
                    hide: true,
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    search: true,
                    rules: [{
                        required: true,
                        message: "请选择发布时间",
                        trigger: "blur",
                    },],
                },
                {
                    width: 100,
                    label: "发布时间",
                    prop: "createTime",
                    type: "date",
                    format: "yyyy-MM-dd",
                    valueFormat: "yyyy-MM-dd HH:mm:ss",
                },
                {
                    width: 100,
                    label: "发布状态",
                    prop: "publish",
                    searchSpan: 4,
                    value: "1",
                    slot: true,
                    hide: true,
                    // search: true,
                    type: "select",
                    rules: [{
                        required: true,
                        message: "请选择发布状态",
                        trigger: "blur",
                    },],
                    dicData: [{
                        label: "未发布",
                        value: "0",
                    },
                    {
                        label: "已发布",
                        value: "1",
                    }
                    ],
                },
                {
                    width: 80,
                    label: "评论区",
                    prop: "iscomment",
                    slot: true,
                    type: "select",
                    dicData: [{
                        label: "关闭",
                        value: "0",
                    },
                    {
                        label: "开启",
                        value: "1",
                    }
                    ],
                },
                {
                    label: "文章内容",
                    prop: "content",
                    component: "AvueUeditor",
                    options: {
                        action: "/api/blade-resource/oss/endpoint/put-file",
                        props: {
                            res: "data",
                            url: "link",
                        },
                    },
                    hide: true,
                    minRows: 6,
                    span: 24,
                },
                ],
            },
          ],
        },
        data: [],
        optionEnroll: {
          column: [
            //   {
            //     label: "",
            //     type: 'title',
            //     prop: "title",
            //     span: 24,
            //     row: true,
            //     offset: 2,
            //     styles: {
            //         fontSize: '24px'
            //     }
            // },
            {
              labelWidth: 100,
              label: '开启',
              prop: 'openFlag',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '开启',
                value: 0
              }, {
                label: '不开启',
                value: 1
              }],
              rules: [{
                required: true,
                message: "请选开启状态",
                trigger: "blur",
              }, ],
            }, {
              labelWidth: 100,
              label: '投票限制',
              prop: 'voteRestrictions',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '一人一票',
                value: 0
              }, {
                label: '一户一票',
                value: 1
              }],
              rules: [{
                required: true,
                message: "请选投票限制",
                trigger: "blur",
              }, ],
            data: [],
            optionEnroll: {
                column: [
                    //   {
                    //     label: "",
                    //     type: 'title',
                    //     prop: "title",
                    //     span: 24,
                    //     row: true,
                    //     offset: 2,
                    //     styles: {
                    //         fontSize: '24px'
                    //     }
                    // },
                    {
                        labelWidth: 100,
                        label: '开启',
                        prop: 'openFlag',
                        type: 'radio',
                        button: true,
                        row: true,
                        offset: 6,
                        dicData: [{
                            label: '开启',
                            value: 0
                        }, {
                            label: '不开启',
                            value: 1
                        }],
                        rules: [{
                            required: true,
                            message: "请选开启状态",
                            trigger: "blur",
                        },],
                    }, {
                        labelWidth: 100,
                        label: '投票限制',
                        prop: 'voteRestrictions',
                        type: 'radio',
                        button: true,
                        row: true,
                        offset: 6,
                        dicData: [{
                            label: '一人一票',
                            value: 0
                        }, {
                            label: '一户一票',
                            value: 1
                        }],
                        rules: [{
                            required: true,
                            message: "请选投票限制",
                            trigger: "blur",
                        },],
                    },
                    {
                        label: "截止时间",
                        row: true,
                        offset: 6,
                        prop: "endTime",
                        type: "datetime",
                        format: "yyyy-MM-dd",
                        valueFormat: "yyyy-MM-dd HH:mm:ss",
                        rules: [{
                            required: true,
                            message: "请选截止时间",
                            trigger: "blur",
                        },],
                    },
                ]
            },
            {
              label: "截止时间",
              row: true,
              offset: 6,
              prop: "endTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
              rules: [{
                required: true,
                message: "请选截止时间",
                trigger: "blur",
              }, ],
            },
          ]
        },
        districtTree: [],
      }
            districtTree: [],
        }
    },
    watch: {
      "form.articleType": {
        handler(val) {
          if (val) {
            var videoUrl = this.findObject(this.option.column, "videoUrl")
            var content = this.findObject(this.option.column, "content")
            if (val.indexOf('ksp') != -1) {
              videoUrl.display = true
              content.display = false
              videoUrl.rules = [{
                required: false,
                message: "请选择视频",
                trigger: "blur",
              }, ]
            } else {
              videoUrl.display = false
              content.display = true
              videoUrl.rules = ""
            }
          }
        },
        immediate: true,
      }
        "form.articleType": {
            handler (val) {
                if (val) {
                    var videoUrl = this.findObject(this.option.column, "videoUrl")
                    var content = this.findObject(this.option.column, "content")
                    if (val.indexOf('ksp') != -1) {
                        videoUrl.display = true
                        content.display = false
                        videoUrl.rules = [{
                            required: false,
                            message: "请选择视频",
                            trigger: "blur",
                        },]
                    } else {
                        videoUrl.display = false
                        content.display = true
                        videoUrl.rules = ""
                    }
                }
            },
            immediate: true,
        }
    },
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.article_add, true),
          viewBtn: this.vaildData(this.permission.article_view, true),
          delBtn: this.vaildData(this.permission.article_delete, true),
          editBtn: this.vaildData(this.permission.article_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.article_add, true),
                viewBtn: this.vaildData(this.permission.article_view, true),
                delBtn: this.vaildData(this.permission.article_delete, true),
                editBtn: this.vaildData(this.permission.article_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
      showStatus() {
        return (data, type) => {
          if (data == 0) {
            return {
              text: type == 1 ? '未发布' : '关闭',
              type: 'info'
        showStatus () {
            return (data, type) => {
                if (data == 0) {
                    return {
                        text: type == 1 ? '未发布' : '关闭',
                        type: 'info'
                    }
                } else if (data == 1) {
                    return {
                        text: type == 1 ? '已发布' : '开启',
                        type: 'success'
                    }
                }
            }
          } else if (data == 1) {
            return {
              text: type == 1 ? '已发布' : '开启',
              type: 'success'
            }
          }
        }
      }
    },
    methods: {
      openUserPopup(row) {
        this.$refs.publicSignUpChild.openUser(row)
      },
        openUserPopup (row) {
            this.$refs.publicSignUpChild.openUser(row)
        },
      openDilog(row, type) {
        this.dialogVisibles = true
        this.discussForm.eventType = type
        this.discussForm.articleId = row.id
        this.discussForm.title = row.title
        this.discussForm.ontitle = '公益报名'
        this.getpunlicDiscussDetail(row)
      },
        openDilog (row, type) {
            this.dialogVisibles = true
            this.discussForm.eventType = type
            this.discussForm.articleId = row.id
            this.discussForm.title = row.title
            this.discussForm.ontitle = '公益报名'
            this.getpunlicDiscussDetail(row)
        },
      getpunlicDiscussDetail(row) {
        getDetailPd({
          articleId: row.id
        }).then((res) => {
          if (res.data.data) {
            let data = res.data.data
            this.discussForm = data
          }
        })
      },
      handleSubmit(form, done) {
        done()
        addPd(form).then(
          () => {
            this.$message({
              type: "success",
              message: "操作成功!",
        getpunlicDiscussDetail (row) {
            getDetailPd({
                articleId: row.id
            }).then((res) => {
                if (res.data.data) {
                    let data = res.data.data
                    this.discussForm = data
                }
            })
            this.dialogVisibles = false
        },
        handleSubmit (form, done) {
            done()
          },
          (error) => {
            window.console.log(error)
            // loading();
          }
        )
      },
            addPd(form).then(
                () => {
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.dialogVisibles = false
                    done()
                },
                (error) => {
                    window.console.log(error)
                    // loading();
                }
            )
        },
      handleClose(done) {
        done()
        // this.$confirm('确认关闭?')
        //   .then(_ => {
        //     done();
        //   })
        //   .catch(_ => {});
      },
      rowSave(row, done, loading) {
        // if (row.videoUrl.length == 0) {
        //   row.videoUrl = "";
        // }
        row.userid = this.userInfo.user_id
        row.articleRange = JSON.stringify(row.articleList)
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        add(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
        handleClose (done) {
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowUpdate(row, index, done, loading) {
        row.articleRange = JSON.stringify(row.articleList)
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getNotice(this.form.id).then((res) => {
            let data = res.data.data
            if (data.url.length > 0) {
              var urls = []
              var names = data.url.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              data.url = urls.join(",")
            // this.$confirm('确认关闭?')
            //   .then(_ => {
            //     done();
            //   })
            //   .catch(_ => {});
        },
        rowSave (row, done, loading) {
            // if (row.videoUrl.length == 0) {
            //   row.videoUrl = "";
            // }
            row.userid = this.userInfo.user_id
            row.articleRange = JSON.stringify(row.articleList)
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
            data.articleList = JSON.parse(data.articleRange)
            this.form = data
          })
        }
        done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {
          dateTime
        } = this.query
        let values = {
          ...params,
        }
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          }
          values.dateTime = null
        }
        values.type = 3
        this.loading = true
        console.log(values)
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.data.forEach(item => {
            if (item.url.length > 0) {
              var urls = []
              var names = item.url.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              item.url = urls.join(",")
            add(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            row.articleRange = JSON.stringify(row.articleList)
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
          })
          this.loading = false
          this.selectionClear()
        })
        getDistrictTree(params = {}).then((res) => {
          const data = res.data.data
          this.districtTree = data
          const column = this.findObject(this.option.column, "articleList")
          column.dicData = res.data.data
          this.loading = false
        })
      },
      updateFb(row) {
        if (row.publish == "0") {
          row.publish = "1"
        } else {
          row.publish = "0"
        }
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      kqcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据开启评论?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            return upcomment(this.ids, "1")
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
          })
      },
      gbcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据开启评论?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            return upcomment(this.ids, "0")
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
            this.$refs.crud.toggleSelection()
          })
      }
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getNotice(this.form.id).then((res) => {
                    let data = res.data.data
                    if (data.url.length > 0) {
                        var urls = []
                        var names = data.url.split(",")
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        data.url = urls.join(",")
                    }
                    data.articleList = JSON.parse(data.articleRange)
                    this.form = data
                })
            }
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const {
                dateTime
            } = this.query
            let values = {
                ...params,
            }
            if (dateTime) {
                values = {
                    ...params,
                    startTime: dateTime[0],
                    endTime: dateTime[1],
                    ...this.query,
                }
                values.dateTime = null
            }
            values.type = 3
            this.loading = true
            console.log(values)
            getList(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.data.forEach(item => {
                    if (item.url.length > 0) {
                        var urls = []
                        var names = item.url.split(",")
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        item.url = urls.join(",")
                    }
                })
                this.loading = false
                this.selectionClear()
            })
            getDistrictTree(params = {}).then((res) => {
                const data = res.data.data
                this.districtTree = data
                const column = this.findObject(this.option.column, "articleList")
                column.dicData = res.data.data
                this.loading = false
            })
        },
        updateFb (row) {
            if (row.publish == "0") {
                row.publish = "1"
            } else {
                row.publish = "0"
            }
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        kqcomment () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据开启评论?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                return upcomment(this.ids, "1")
            })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        gbcomment () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据开启评论?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                return upcomment(this.ids, "0")
            })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        }
    },
  }
}
</script>
<style>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
</style>
src/views/article/rotation.vue
@@ -44,7 +44,7 @@
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
@@ -58,6 +58,7 @@
                        span: 12,
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 46,
                    },
                    {
                        width: 110,
src/views/authority/apiscope.vue
@@ -1,643 +1,610 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :permission="permissionList"
               :before-open="beforeOpen"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               @tree-load="treeLoad">
      <template slot-scope="{row}" slot="menu">
        <el-button type="text"
                   icon="el-icon-setting"
                   size="small"
                   v-if="permission.api_scope_setting"
                   plain
                   style="border: 0;background-color: transparent !important;"
                   @click.stop="handleDataScope(row)">权限配置
        </el-button>
      </template>
      <template slot-scope="{row}" slot="source">
        <div style="text-align:center">
          <i :class="row.source"/>
        </div>
      </template>
    </avue-crud>
    <el-drawer :title="`[${scopeMenuName}] 接口权限配置`" :visible.sync="drawerVisible" :direction="direction"
               append-to-body
               :before-close="handleDrawerClose" size="1000px">
      <basic-container>
        <avue-crud :option="optionScope"
                   :data="dataScope"
                   :page="pageScope"
                   v-model="formScope"
                   :table-loading="scopeLoading"
                   ref="crudScope"
                   @row-del="rowDelScope"
                   @row-update="rowUpdateScope"
                   @row-save="rowSaveScope"
                   :before-open="beforeOpenScope"
                   @search-change="searchChangeScope"
                   @search-reset="searchResetScope"
                   @selection-change="selectionChangeScope"
                   @current-change="currentChangeScope"
                   @size-change="sizeChangeScope"
                   @on-load="onLoadScope">
          <template slot="menuLeft">
            <el-button type="danger"
                       size="small"
                       icon="el-icon-delete"
                       plain
                       @click="handleDeleteScope">删 除
            </el-button>
          </template>
          <template slot-scope="{row}"
                    slot="scopeType">
            <el-tag>{{row.scopeTypeName}}</el-tag>
          </template>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
            :permission="permissionList" :before-open="beforeOpen" @row-del="rowDel" @row-update="rowUpdate"
            @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad">
            <template slot-scope="{row}" slot="menu">
                <el-button type="text" icon="el-icon-setting" size="small" v-if="permission.api_scope_setting" plain
                    style="border: 0;background-color: transparent !important;" @click.stop="handleDataScope(row)">权限配置
                </el-button>
            </template>
            <template slot-scope="{row}" slot="source">
                <div style="text-align:center">
                    <i :class="row.source" />
                </div>
            </template>
        </avue-crud>
      </basic-container>
    </el-drawer>
  </basic-container>
        <el-drawer :title="`[${scopeMenuName}] 接口权限配置`" :visible.sync="drawerVisible" :direction="direction" append-to-body
            :before-close="handleDrawerClose" size="1000px">
            <basic-container>
                <avue-crud :option="optionScope" :data="dataScope" :page="pageScope" v-model="formScope"
                    :table-loading="scopeLoading" ref="crudScope" @row-del="rowDelScope" @row-update="rowUpdateScope"
                    @row-save="rowSaveScope" :before-open="beforeOpenScope" @search-change="searchChangeScope"
                    @search-reset="searchResetScope" @selection-change="selectionChangeScope"
                    @current-change="currentChangeScope" @size-change="sizeChangeScope" @on-load="onLoadScope">
                    <template slot="menuLeft">
                        <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDeleteScope">删 除
                        </el-button>
                    </template>
                    <template slot-scope="{row}" slot="scopeType">
                        <el-tag>{{ row.scopeTypeName }}</el-tag>
                    </template>
                </avue-crud>
            </basic-container>
        </el-drawer>
    </basic-container>
</template>
<script>
  import {
import {
    add,
    remove,
    update,
    getLazyMenuList,
    getMenu
  } from "@/api/system/menu";
  import {
} from "@/api/system/menu"
import {
    addApiScope,
    removeApiScope,
    updateApiScope,
    getListApiScope,
    getMenuApiScope
  } from "@/api/system/scope";
  import {mapGetters} from "vuex";
  import iconList from "@/config/iconList";
} from "@/api/system/scope"
import { mapGetters } from "vuex"
import iconList from "@/config/iconList"
  export default {
    data() {
      return {
        form: {},
        selectionList: [],
        query: {},
        loading: true,
        parentId: 0,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        drawerVisible: false,
        direction: 'rtl',
        scopeLoading: false,
        scopeMenuId: 0,
        scopeMenuName: "菜单",
        menu: true,
        option: {
          lazy: true,
          tip: false,
          simplePage: true,
          searchShow: true,
          searchMenuSpan: 6,
          dialogWidth: "60%",
          tree: true,
          border: true,
          index: true,
          selection: true,
          viewBtn: false,
          editBtn: false,
          addBtn: false,
          delBtn: false,
          menuWidth: 150,
          dialogClickModal: false,
          column: [
            {
              label: "菜单名称",
              prop: "name",
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入菜单名称",
                  trigger: "blur"
                }
              ]
export default {
    data () {
        return {
            form: {},
            selectionList: [],
            query: {},
            loading: true,
            parentId: 0,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            {
              label: "路由地址",
              prop: "path",
              rules: [
                {
                  required: true,
                  message: "请输入路由地址",
                  trigger: "blur"
                }
              ]
            drawerVisible: false,
            direction: 'rtl',
            scopeLoading: false,
            scopeMenuId: 0,
            scopeMenuName: "菜单",
            menu: true,
            option: {
                lazy: true,
                tip: false,
                simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                dialogWidth: "60%",
                tree: true,
                border: true,
                index: true,
                selection: true,
                viewBtn: false,
                editBtn: false,
                addBtn: false,
                delBtn: false,
                menuWidth: 150,
                dialogClickModal: false,
                column: [
                    {
                        label: "菜单名称",
                        prop: "name",
                        search: true,
                        searchLabelWidth: 76,
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单名称",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "路由地址",
                        prop: "path",
                        rules: [
                            {
                                required: true,
                                message: "请输入路由地址",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "上级菜单",
                        prop: "parentId",
                        type: "tree",
                        dicUrl: "/api/blade-system/menu/tree",
                        hide: true,
                        props: {
                            label: "title"
                        },
                        rules: [
                            {
                                required: false,
                                message: "请选择上级菜单",
                                trigger: "click"
                            }
                        ]
                    },
                    {
                        label: "菜单图标",
                        prop: "source",
                        type: "icon",
                        slot: true,
                        width: 80,
                        iconList: iconList,
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单图标",
                                trigger: "click"
                            }
                        ]
                    },
                    {
                        label: "菜单编号",
                        prop: "code",
                        search: true,
                        searchLabelWidth: 100,
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单编号",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "菜单类型",
                        prop: "category",
                        type: "radio",
                        dicData: [
                            {
                                label: "菜单",
                                value: 1
                            },
                            {
                                label: "按钮",
                                value: 2
                            }
                        ],
                        hide: true,
                        rules: [
                            {
                                required: true,
                                message: "请选择菜单类型",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "菜单别名",
                        prop: "alias",
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单别名",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "按钮功能",
                        prop: "action",
                        type: "radio",
                        dicData: [
                            {
                                label: "工具栏",
                                value: 0
                            },
                            {
                                label: "操作栏",
                                value: 1
                            },
                            {
                                label: "工具操作栏",
                                value: 2
                            }
                        ],
                        hide: true,
                        rules: [
                            {
                                required: true,
                                message: "请选择按钮功能",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "菜单排序",
                        prop: "sort",
                        type: "number",
                        width: 80,
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单排序",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "新窗口",
                        prop: "isOpen",
                        type: "radio",
                        dicData: [
                            {
                                label: "否",
                                value: 0
                            },
                            {
                                label: "是",
                                value: 1
                            },
                        ],
                        hide: true
                    },
                    {
                        label: "菜单备注",
                        prop: "remark",
                        type: "textarea",
                        span: 24,
                        minRows: 6,
                        hide: true
                    }
                ]
            },
            {
              label: "上级菜单",
              prop: "parentId",
              type: "tree",
              dicUrl: "/api/blade-system/menu/tree",
              hide: true,
              props: {
                label: "title"
              },
              rules: [
                {
                  required: false,
                  message: "请选择上级菜单",
                  trigger: "click"
                }
              ]
            data: [],
            formScope: {},
            selectionListScope: [],
            pageScope: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            {
              label: "菜单图标",
              prop: "source",
              type: "icon",
              slot: true,
              width: 80,
              iconList: iconList,
              rules: [
                {
                  required: true,
                  message: "请输入菜单图标",
                  trigger: "click"
                }
              ]
            optionScope: {
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                border: true,
                index: true,
                viewBtn: true,
                selection: true,
                menuWidth: 200,
                dialogWidth: 900,
                dialogClickModal: false,
                column: [
                    {
                        label: "权限名称",
                        prop: "scopeName",
                        search: true,
                        rules: [{
                            required: true,
                            message: "请输入权限名称",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "权限编号",
                        prop: "resourceCode",
                        search: true,
                        width: 180,
                        rules: [{
                            required: true,
                            message: "请输入权限编号",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "权限路径",
                        prop: "scopePath",
                        width: 180,
                        rules: [{
                            required: true,
                            message: "请输入权限编号",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "接口类型",
                        type: "select",
                        dicUrl: "/api/blade-system/dict/dictionary?code=api_scope_type",
                        props: {
                            label: "dictValue",
                            value: "dictKey"
                        },
                        dataType: "number",
                        slot: true,
                        width: 100,
                        prop: "scopeType",
                        rules: [{
                            required: true,
                            message: "请输入通知类型",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "备注",
                        prop: "remark",
                        span: 24,
                        hide: true,
                    },
                ]
            },
            {
              label: "菜单编号",
              prop: "code",
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入菜单编号",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单类型",
              prop: "category",
              type: "radio",
              dicData: [
                {
                  label: "菜单",
                  value: 1
                },
                {
                  label: "按钮",
                  value: 2
                }
              ],
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择菜单类型",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单别名",
              prop: "alias",
              rules: [
                {
                  required: true,
                  message: "请输入菜单别名",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "按钮功能",
              prop: "action",
              type: "radio",
              dicData: [
                {
                  label: "工具栏",
                  value: 0
                },
                {
                  label: "操作栏",
                  value: 1
                },
                {
                  label: "工具操作栏",
                  value: 2
                }
              ],
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择按钮功能",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单排序",
              prop: "sort",
              type: "number",
              width: 80,
              rules: [
                {
                  required: true,
                  message: "请输入菜单排序",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "新窗口",
              prop: "isOpen",
              type: "radio",
              dicData: [
                {
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                },
              ],
              hide: true
            },
            {
              label: "菜单备注",
              prop: "remark",
              type: "textarea",
              span: 24,
              minRows: 6,
              hide: true
            }
          ]
        },
        data: [],
        formScope: {},
        selectionListScope: [],
        pageScope: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        optionScope: {
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          menuWidth: 200,
          dialogWidth: 900,
          dialogClickModal: false,
          column: [
            {
              label: "权限名称",
              prop: "scopeName",
              search: true,
              rules: [{
                required: true,
                message: "请输入权限名称",
                trigger: "blur"
              }]
            },
            {
              label: "权限编号",
              prop: "resourceCode",
              search: true,
              width: 180,
              rules: [{
                required: true,
                message: "请输入权限编号",
                trigger: "blur"
              }]
            },
            {
              label: "权限路径",
              prop: "scopePath",
              width: 180,
              rules: [{
                required: true,
                message: "请输入权限编号",
                trigger: "blur"
              }]
            },
            {
              label: "接口类型",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=api_scope_type",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              dataType: "number",
              slot: true,
              width: 100,
              prop: "scopeType",
              rules: [{
                required: true,
                message: "请输入通知类型",
                trigger: "blur"
              }]
            },
            {
              label: "备注",
              prop: "remark",
              span: 24,
              hide: true,
            },
          ]
        },
        dataScope: []
      };
            dataScope: []
        }
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.menu_add, false),
          viewBtn: this.vaildData(this.permission.menu_view, false),
          delBtn: this.vaildData(this.permission.menu_delete, false),
          editBtn: this.vaildData(this.permission.menu_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
      scopeIds() {
        let ids = [];
        this.selectionListScope.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.menu_add, false),
                viewBtn: this.vaildData(this.permission.menu_view, false),
                delBtn: this.vaildData(this.permission.menu_delete, false),
                editBtn: this.vaildData(this.permission.menu_edit, false)
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
        scopeIds () {
            let ids = []
            this.selectionListScope.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        }
    },
    methods: {
      // 菜单管理模块
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.parentId = '';
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenu(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
      },
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
        getLazyMenuList(parentId).then(res => {
          resolve(res.data.data);
        });
      },
      // 数据权限模块
      handleDataScope(row) {
        this.drawerVisible = true;
        this.scopeMenuId = row.id;
        this.scopeMenuName = row.name;
        this.onLoadScope(this.pageScope)
      },
      handleDrawerClose(hide) {
        hide();
      },
      rowSaveScope(row, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
        addApiScope(row).then(() => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdateScope(row, index, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
        updateApiScope(row).then(() => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDelScope(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return removeApiScope(row.id);
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      handleDeleteScope() {
        if (this.selectionListScope.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return removeApiScope(this.scopeIds);
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crudScope.toggleSelection();
          });
      },
      beforeOpenScope(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenuApiScope(this.formScope.id).then(res => {
            this.formScope = res.data.data;
          });
        }
        done();
      },
      searchResetScope() {
        this.onLoadScope(this.pageScope);
      },
      searchChangeScope(params, done) {
        this.onLoadScope(this.pageScope, params);
        done();
      },
      selectionChangeScope(list) {
        this.selectionListScope = list;
      },
      currentChangeScope(currentPage) {
        this.pageScope.currentPage = currentPage;
      },
      sizeChangeScope(pageSize) {
        this.pageScope.pageSize = pageSize;
      },
      onLoadScope(page, params = {}) {
        this.scopeLoading = true;
        const values = {
          ...params,
          menuId: this.scopeMenuId,
        }
        getListApiScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
          const data = res.data.data;
          this.pageScope.total = data.total;
          this.dataScope = data.records;
          this.selectionListScope = [];
          this.scopeLoading = false;
        });
      },
        // 菜单管理模块
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.parentId = 0
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.parentId = ''
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getMenu(this.form.id).then(res => {
                    this.form = res.data.data
                })
            }
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            this.loading = true
            getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
                this.data = res.data.data
                this.loading = false
                this.selectionClear()
            })
        },
        treeLoad (tree, treeNode, resolve) {
            const parentId = tree.id
            getLazyMenuList(parentId).then(res => {
                resolve(res.data.data)
            })
        },
        // 数据权限模块
        handleDataScope (row) {
            this.drawerVisible = true
            this.scopeMenuId = row.id
            this.scopeMenuName = row.name
            this.onLoadScope(this.pageScope)
        },
        handleDrawerClose (hide) {
            hide()
        },
        rowSaveScope (row, done, loading) {
            row = {
                ...row,
                menuId: this.scopeMenuId,
            }
            addApiScope(row).then(() => {
                this.onLoadScope(this.pageScope)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdateScope (row, index, done, loading) {
            row = {
                ...row,
                menuId: this.scopeMenuId,
            }
            updateApiScope(row).then(() => {
                this.onLoadScope(this.pageScope)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDelScope (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return removeApiScope(row.id)
                })
                .then(() => {
                    this.onLoadScope(this.pageScope)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        handleDeleteScope () {
            if (this.selectionListScope.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return removeApiScope(this.scopeIds)
                })
                .then(() => {
                    this.onLoadScope(this.pageScope)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crudScope.toggleSelection()
                })
        },
        beforeOpenScope (done, type) {
            if (["edit", "view"].includes(type)) {
                getMenuApiScope(this.formScope.id).then(res => {
                    this.formScope = res.data.data
                })
            }
            done()
        },
        searchResetScope () {
            this.onLoadScope(this.pageScope)
        },
        searchChangeScope (params, done) {
            this.onLoadScope(this.pageScope, params)
            done()
        },
        selectionChangeScope (list) {
            this.selectionListScope = list
        },
        currentChangeScope (currentPage) {
            this.pageScope.currentPage = currentPage
        },
        sizeChangeScope (pageSize) {
            this.pageScope.pageSize = pageSize
        },
        onLoadScope (page, params = {}) {
            this.scopeLoading = true
            const values = {
                ...params,
                menuId: this.scopeMenuId,
            }
            getListApiScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
                const data = res.data.data
                this.pageScope.total = data.total
                this.dataScope = data.records
                this.selectionListScope = []
                this.scopeLoading = false
            })
        },
    }
  };
}
</script>
src/views/authority/datascope.vue
@@ -1,732 +1,698 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :permission="permissionList"
               :before-open="beforeOpen"
               :before-close="beforeClose"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               @tree-load="treeLoad">
      <template slot-scope="{row}" slot="menu">
        <el-button type="text"
                   icon="el-icon-setting"
                   size="small"
                   v-if="permission.data_scope_setting"
                   plain
                   style="border: 0;background-color: transparent !important;"
                   @click.stop="handleDataScope(row)">权限配置
        </el-button>
      </template>
      <template slot-scope="{row}" slot="source">
        <div style="text-align:center">
          <i :class="row.source"/>
        </div>
      </template>
    </avue-crud>
    <el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction"
               append-to-body
               :before-close="handleDrawerClose" size="1000px">
      <basic-container>
        <avue-crud :option="optionScope"
                   :data="dataScope"
                   :page="pageScope"
                   v-model="formScope"
                   :table-loading="scopeLoading"
                   ref="crudScope"
                   @row-del="rowDelScope"
                   @row-update="rowUpdateScope"
                   @row-save="rowSaveScope"
                   :before-open="beforeOpenScope"
                   @search-change="searchChangeScope"
                   @search-reset="searchResetScope"
                   @selection-change="selectionChangeScope"
                   @current-change="currentChangeScope"
                   @size-change="sizeChangeScope"
                   @on-load="onLoadScope">
          <template slot="menuLeft">
            <el-button type="danger"
                       size="small"
                       icon="el-icon-delete"
                       plain
                       @click="handleDeleteScope">删 除
            </el-button>
          </template>
          <template slot-scope="{row}"
                    slot="scopeType">
            <el-tag>{{row.scopeTypeName}}</el-tag>
          </template>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
            :permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" @row-del="rowDel"
            @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad">
            <template slot-scope="{row}" slot="menu">
                <el-button type="text" icon="el-icon-setting" size="small" v-if="permission.data_scope_setting" plain
                    style="border: 0;background-color: transparent !important;" @click.stop="handleDataScope(row)">权限配置
                </el-button>
            </template>
            <template slot-scope="{row}" slot="source">
                <div style="text-align:center">
                    <i :class="row.source" />
                </div>
            </template>
        </avue-crud>
      </basic-container>
    </el-drawer>
  </basic-container>
        <el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction" append-to-body
            :before-close="handleDrawerClose" size="1000px">
            <basic-container>
                <avue-crud :option="optionScope" :data="dataScope" :page="pageScope" v-model="formScope"
                    :table-loading="scopeLoading" ref="crudScope" @row-del="rowDelScope" @row-update="rowUpdateScope"
                    @row-save="rowSaveScope" :before-open="beforeOpenScope" @search-change="searchChangeScope"
                    @search-reset="searchResetScope" @selection-change="selectionChangeScope"
                    @current-change="currentChangeScope" @size-change="sizeChangeScope" @on-load="onLoadScope">
                    <template slot="menuLeft">
                        <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDeleteScope">删 除
                        </el-button>
                    </template>
                    <template slot-scope="{row}" slot="scopeType">
                        <el-tag>{{ row.scopeTypeName }}</el-tag>
                    </template>
                </avue-crud>
            </basic-container>
        </el-drawer>
    </basic-container>
</template>
<script>
  import {
import {
    add,
    remove,
    update,
    getLazyMenuList,
    getMenu
  } from "@/api/system/menu";
  import {
} from "@/api/system/menu"
import {
    addDataScope,
    removeDataScope,
    updateDataScope,
    getListDataScope,
    getMenuDataScope
  } from "@/api/system/scope";
  import {mapGetters} from "vuex";
  import iconList from "@/config/iconList";
  import func from "@/util/func";
} from "@/api/system/scope"
import { mapGetters } from "vuex"
import iconList from "@/config/iconList"
import func from "@/util/func"
  export default {
    data() {
      return {
        form: {},
        selectionList: [],
        query: {},
        loading: true,
        parentId: 0,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        drawerVisible: false,
        direction: 'rtl',
        scopeMenuId: 0,
        scopeMenuCode: '',
        scopeMenuName: "菜单",
        scopeLoading: false,
        menu: true,
        watchMode: true,
        option: {
          lazy: true,
          tip: false,
          simplePage: true,
          searchShow: true,
          searchMenuSpan: 6,
          dialogWidth: "60%",
          tree: true,
          border: true,
          index: true,
          selection: true,
          viewBtn: false,
          editBtn: false,
          addBtn: false,
          delBtn: false,
          menuWidth: 150,
          dialogClickModal: false,
          column: [
            {
              label: "菜单名称",
              prop: "name",
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入菜单名称",
                  trigger: "blur"
                }
              ]
export default {
    data () {
        return {
            form: {},
            selectionList: [],
            query: {},
            loading: true,
            parentId: 0,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            {
              label: "路由地址",
              prop: "path",
              rules: [
                {
                  required: true,
                  message: "请输入路由地址",
                  trigger: "blur"
                }
              ]
            drawerVisible: false,
            direction: 'rtl',
            scopeMenuId: 0,
            scopeMenuCode: '',
            scopeMenuName: "菜单",
            scopeLoading: false,
            menu: true,
            watchMode: true,
            option: {
                lazy: true,
                tip: false,
                simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                dialogWidth: "60%",
                tree: true,
                border: true,
                index: true,
                selection: true,
                viewBtn: false,
                editBtn: false,
                addBtn: false,
                delBtn: false,
                menuWidth: 150,
                dialogClickModal: false,
                column: [
                    {
                        label: "菜单名称",
                        prop: "name",
                        search: true,
                        searchLabelWidth: 76,
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单名称",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "路由地址",
                        prop: "path",
                        rules: [
                            {
                                required: true,
                                message: "请输入路由地址",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "上级菜单",
                        prop: "parentId",
                        type: "tree",
                        dicUrl: "/api/blade-system/menu/tree",
                        hide: true,
                        props: {
                            label: "title"
                        },
                        rules: [
                            {
                                required: false,
                                message: "请选择上级菜单",
                                trigger: "click"
                            }
                        ]
                    },
                    {
                        label: "菜单图标",
                        prop: "source",
                        type: "icon",
                        slot: true,
                        width: 80,
                        iconList: iconList,
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单图标",
                                trigger: "click"
                            }
                        ]
                    },
                    {
                        label: "菜单编号",
                        prop: "code",
                        search: true,
                        searchLabelWidth: 100,
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单编号",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "菜单类型",
                        prop: "category",
                        type: "radio",
                        dicData: [
                            {
                                label: "菜单",
                                value: 1
                            },
                            {
                                label: "按钮",
                                value: 2
                            }
                        ],
                        hide: true,
                        rules: [
                            {
                                required: true,
                                message: "请选择菜单类型",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "菜单别名",
                        prop: "alias",
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单别名",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "按钮功能",
                        prop: "action",
                        type: "radio",
                        dicData: [
                            {
                                label: "工具栏",
                                value: 0
                            },
                            {
                                label: "操作栏",
                                value: 1
                            },
                            {
                                label: "工具操作栏",
                                value: 2
                            }
                        ],
                        hide: true,
                        rules: [
                            {
                                required: true,
                                message: "请选择按钮功能",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "菜单排序",
                        prop: "sort",
                        type: "number",
                        width: 80,
                        rules: [
                            {
                                required: true,
                                message: "请输入菜单排序",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: "新窗口",
                        prop: "isOpen",
                        type: "radio",
                        dicData: [
                            {
                                label: "否",
                                value: 0
                            },
                            {
                                label: "是",
                                value: 1
                            },
                        ],
                        hide: true
                    },
                    {
                        label: "菜单备注",
                        prop: "remark",
                        type: "textarea",
                        span: 24,
                        minRows: 6,
                        hide: true
                    }
                ]
            },
            {
              label: "上级菜单",
              prop: "parentId",
              type: "tree",
              dicUrl: "/api/blade-system/menu/tree",
              hide: true,
              props: {
                label: "title"
              },
              rules: [
                {
                  required: false,
                  message: "请选择上级菜单",
                  trigger: "click"
                }
              ]
            data: [],
            formScope: {},
            selectionListScope: [],
            pageScope: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            {
              label: "菜单图标",
              prop: "source",
              type: "icon",
              slot: true,
              width: 80,
              iconList: iconList,
              rules: [
                {
                  required: true,
                  message: "请输入菜单图标",
                  trigger: "click"
                }
              ]
            optionScope: {
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                border: true,
                index: true,
                viewBtn: true,
                selection: true,
                menuWidth: 200,
                dialogWidth: 900,
                dialogClickModal: false,
                column: [
                    {
                        label: "权限名称",
                        prop: "scopeName",
                        search: true,
                        value: "",
                        rules: [{
                            required: true,
                            message: "请输入数据权限名称",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "权限编号",
                        prop: "resourceCode",
                        search: true,
                        width: 100,
                        rules: [{
                            required: true,
                            message: "请输入数据权限编号",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "权限字段",
                        prop: "scopeColumn",
                        width: 130,
                        rules: [{
                            required: true,
                            message: "请输入数据权限编号",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "规则类型",
                        type: "select",
                        dicUrl: "/api/blade-system/dict/dictionary?code=data_scope_type",
                        props: {
                            label: "dictValue",
                            value: "dictKey"
                        },
                        dataType: "number",
                        slot: true,
                        width: 140,
                        prop: "scopeType",
                        rules: [{
                            required: true,
                            message: "请输入通知类型",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "可见字段",
                        prop: "scopeField",
                        span: 24,
                        hide: true,
                        value: "*",
                        rules: [{
                            required: true,
                            message: "请输入数据权限可见的字段",
                            trigger: "blur"
                        }],
                    },
                    {
                        label: "权限类名",
                        prop: "scopeClass",
                        span: 24,
                        hide: true,
                        rules: [{
                            required: true,
                            message: "请输入MybatisMapper对应方法的完整类名路径",
                            trigger: "blur"
                        }],
                    },
                    {
                        label: "规则值",
                        prop: "scopeValue",
                        span: 24,
                        minRows: 5,
                        type: "textarea",
                        display: true,
                        hide: true,
                    },
                    {
                        label: "备注",
                        prop: "remark",
                        span: 24,
                        hide: true,
                    },
                ]
            },
            {
              label: "菜单编号",
              prop: "code",
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入菜单编号",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单类型",
              prop: "category",
              type: "radio",
              dicData: [
                {
                  label: "菜单",
                  value: 1
                },
                {
                  label: "按钮",
                  value: 2
                }
              ],
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择菜单类型",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单别名",
              prop: "alias",
              rules: [
                {
                  required: true,
                  message: "请输入菜单别名",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "按钮功能",
              prop: "action",
              type: "radio",
              dicData: [
                {
                  label: "工具栏",
                  value: 0
                },
                {
                  label: "操作栏",
                  value: 1
                },
                {
                  label: "工具操作栏",
                  value: 2
                }
              ],
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择按钮功能",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单排序",
              prop: "sort",
              type: "number",
              width: 80,
              rules: [
                {
                  required: true,
                  message: "请输入菜单排序",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "新窗口",
              prop: "isOpen",
              type: "radio",
              dicData: [
                {
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                },
              ],
              hide: true
            },
            {
              label: "菜单备注",
              prop: "remark",
              type: "textarea",
              span: 24,
              minRows: 6,
              hide: true
            }
          ]
        },
        data: [],
        formScope: {},
        selectionListScope: [],
        pageScope: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        optionScope: {
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          menuWidth: 200,
          dialogWidth: 900,
          dialogClickModal: false,
          column: [
            {
              label: "权限名称",
              prop: "scopeName",
              search: true,
              value: "",
              rules: [{
                required: true,
                message: "请输入数据权限名称",
                trigger: "blur"
              }]
            },
            {
              label: "权限编号",
              prop: "resourceCode",
              search: true,
              width: 100,
              rules: [{
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur"
              }]
            },
            {
              label: "权限字段",
              prop: "scopeColumn",
              width: 130,
              rules: [{
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur"
              }]
            },
            {
              label: "规则类型",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=data_scope_type",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              dataType: "number",
              slot: true,
              width: 140,
              prop: "scopeType",
              rules: [{
                required: true,
                message: "请输入通知类型",
                trigger: "blur"
              }]
            },
            {
              label: "可见字段",
              prop: "scopeField",
              span: 24,
              hide: true,
              value: "*",
              rules: [{
                required: true,
                message: "请输入数据权限可见的字段",
                trigger: "blur"
              }],
            },
            {
              label: "权限类名",
              prop: "scopeClass",
              span: 24,
              hide: true,
              rules: [{
                required: true,
                message: "请输入MybatisMapper对应方法的完整类名路径",
                trigger: "blur"
              }],
            },
            {
              label: "规则值",
              prop: "scopeValue",
              span: 24,
              minRows: 5,
              type: "textarea",
              display: true,
              hide: true,
            },
            {
              label: "备注",
              prop: "remark",
              span: 24,
              hide: true,
            },
          ]
        },
        dataScope: []
      };
            dataScope: []
        }
    },
    watch: {
      'formScope.scopeType'() {
        this.initScope();
      }
        'formScope.scopeType' () {
            this.initScope()
        }
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.menu_add, false),
          viewBtn: this.vaildData(this.permission.menu_view, false),
          delBtn: this.vaildData(this.permission.menu_delete, false),
          editBtn: this.vaildData(this.permission.menu_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
      scopeIds() {
        let ids = [];
        this.selectionListScope.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.menu_add, false),
                viewBtn: this.vaildData(this.permission.menu_view, false),
                delBtn: this.vaildData(this.permission.menu_delete, false),
                editBtn: this.vaildData(this.permission.menu_edit, false)
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
        scopeIds () {
            let ids = []
            this.selectionListScope.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        }
    },
    methods: {
      initScope() {
        const scopeType = func.toInt(this.formScope.scopeType);
        const watchMode = this.watchMode;
        let column = "-", name = "暂无";
        if (scopeType === 1) {
          column = "-";
          name = "全部可见";
        } else if (scopeType === 2) {
          column = "create_user";
          name = "本人可见";
        } else if (scopeType === 3) {
          column = "create_dept";
          name = "所在机构可见";
        } else if (scopeType === 4) {
          column = "create_dept";
          name = "所在机构可见及子级可见";
        } else if (scopeType === 5) {
          column = "";
          name = "自定义";
        }
        this.$refs.crudScope.option.column.filter(item => {
          if (watchMode) {
            if (item.prop === "scopeName") {
              this.formScope.scopeName = `${this.scopeMenuName} [${name}]`;
        initScope () {
            const scopeType = func.toInt(this.formScope.scopeType)
            const watchMode = this.watchMode
            let column = "-", name = "暂无"
            if (scopeType === 1) {
                column = "-"
                name = "全部可见"
            } else if (scopeType === 2) {
                column = "create_user"
                name = "本人可见"
            } else if (scopeType === 3) {
                column = "create_dept"
                name = "所在机构可见"
            } else if (scopeType === 4) {
                column = "create_dept"
                name = "所在机构可见及子级可见"
            } else if (scopeType === 5) {
                column = ""
                name = "自定义"
            }
            if (item.prop === "resourceCode") {
              this.formScope.resourceCode = this.scopeMenuCode;
            this.$refs.crudScope.option.column.filter(item => {
                if (watchMode) {
                    if (item.prop === "scopeName") {
                        this.formScope.scopeName = `${this.scopeMenuName} [${name}]`
                    }
                    if (item.prop === "resourceCode") {
                        this.formScope.resourceCode = this.scopeMenuCode
                    }
                    if (item.prop === "scopeColumn") {
                        this.formScope.scopeColumn = column
                    }
                }
                if (item.prop === "scopeValue") {
                    item.display = scopeType === 5
                }
            })
        },
        // 菜单管理模块
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.parentId = 0
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.parentId = ''
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            if (item.prop === "scopeColumn") {
              this.formScope.scopeColumn = column;
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getMenu(this.form.id).then(res => {
                    this.form = res.data.data
                })
            }
          }
          if (item.prop === "scopeValue") {
            item.display = scopeType === 5;
          }
        });
      },
      // 菜单管理模块
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.parentId = '';
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenu(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      beforeClose(done) {
        this.formScope = {};
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
      },
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
        getLazyMenuList(parentId).then(res => {
          resolve(res.data.data);
        });
      },
      // 数据权限模块
      handleDataScope(row) {
        this.drawerVisible = true;
        this.scopeMenuId = row.id;
        this.scopeMenuCode = row.code;
        this.scopeMenuName = row.name;
        this.onLoadScope(this.pageScope)
      },
      handleDrawerClose(hide) {
        hide();
      },
      rowSaveScope(row, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
        addDataScope(row).then(() => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdateScope(row, index, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
        updateDataScope(row).then(() => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDelScope(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return removeDataScope(row.id);
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      handleDeleteScope() {
        if (this.selectionListScope.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return removeDataScope(this.scopeIds);
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crudScope.toggleSelection();
          });
      },
      beforeOpenScope(done, type) {
        if (["add"].includes(type)) {
          this.watchMode = true;
          this.initScope();
        }
        if (["edit", "view"].includes(type)) {
          this.watchMode = false;
          getMenuDataScope(this.formScope.id).then(res => {
            this.formScope = res.data.data;
          });
        }
        done();
      },
      searchResetScope() {
        this.onLoadScope(this.pageScope);
      },
      searchChangeScope(params, done) {
        this.onLoadScope(this.pageScope, params);
        done();
      },
      selectionChangeScope(list) {
        this.selectionListScope = list;
      },
      currentChangeScope(currentPage) {
        this.pageScope.currentPage = currentPage;
      },
      sizeChangeScope(pageSize) {
        this.pageScope.pageSize = pageSize;
      },
      onLoadScope(page, params = {}) {
        this.scopeLoading = true;
        const values = {
          ...params,
          menuId: this.scopeMenuId,
        }
        getListDataScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
          const data = res.data.data;
          this.pageScope.total = data.total;
          this.dataScope = data.records;
          this.selectionListScope = [];
          this.scopeLoading = false;
        });
      },
            done()
        },
        beforeClose (done) {
            this.formScope = {}
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            this.loading = true
            getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
                this.data = res.data.data
                this.loading = false
                this.selectionClear()
            })
        },
        treeLoad (tree, treeNode, resolve) {
            const parentId = tree.id
            getLazyMenuList(parentId).then(res => {
                resolve(res.data.data)
            })
        },
        // 数据权限模块
        handleDataScope (row) {
            this.drawerVisible = true
            this.scopeMenuId = row.id
            this.scopeMenuCode = row.code
            this.scopeMenuName = row.name
            this.onLoadScope(this.pageScope)
        },
        handleDrawerClose (hide) {
            hide()
        },
        rowSaveScope (row, done, loading) {
            row = {
                ...row,
                menuId: this.scopeMenuId,
            }
            addDataScope(row).then(() => {
                this.onLoadScope(this.pageScope)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdateScope (row, index, done, loading) {
            row = {
                ...row,
                menuId: this.scopeMenuId,
            }
            updateDataScope(row).then(() => {
                this.onLoadScope(this.pageScope)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDelScope (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return removeDataScope(row.id)
                })
                .then(() => {
                    this.onLoadScope(this.pageScope)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        handleDeleteScope () {
            if (this.selectionListScope.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return removeDataScope(this.scopeIds)
                })
                .then(() => {
                    this.onLoadScope(this.pageScope)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crudScope.toggleSelection()
                })
        },
        beforeOpenScope (done, type) {
            if (["add"].includes(type)) {
                this.watchMode = true
                this.initScope()
            }
            if (["edit", "view"].includes(type)) {
                this.watchMode = false
                getMenuDataScope(this.formScope.id).then(res => {
                    this.formScope = res.data.data
                })
            }
            done()
        },
        searchResetScope () {
            this.onLoadScope(this.pageScope)
        },
        searchChangeScope (params, done) {
            this.onLoadScope(this.pageScope, params)
            done()
        },
        selectionChangeScope (list) {
            this.selectionListScope = list
        },
        currentChangeScope (currentPage) {
            this.pageScope.currentPage = currentPage
        },
        sizeChangeScope (pageSize) {
            this.pageScope.pageSize = pageSize
        },
        onLoadScope (page, params = {}) {
            this.scopeLoading = true
            const values = {
                ...params,
                menuId: this.scopeMenuId,
            }
            getListDataScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
                const data = res.data.data
                this.pageScope.total = data.total
                this.dataScope = data.records
                this.selectionListScope = []
                this.scopeLoading = false
            })
        },
    }
  };
}
</script>
src/views/authority/role.vue
@@ -97,6 +97,7 @@
                        prop: "roleName",
                        search: true,
                        span: 24,
                        searchLabelWidth: 76,
                        rules: [
                            {
                                required: true,
@@ -130,6 +131,7 @@
                        label: "角色别名",
                        prop: "roleAlias",
                        search: true,
                        searchLabelWidth: 100,
                        span: 24,
                        rules: [
                            {
src/views/cGovernance/gridPatrolRecord.vue
@@ -56,7 +56,7 @@
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
@@ -71,6 +71,7 @@
                        row: true,
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 76,
                        rules: [
                            {
                                required: true,
src/views/cGovernance/gridWorkLog.vue
@@ -28,7 +28,7 @@
import website from '@/config/website'
export default {
    data() {
    data () {
        return {
            form: {},
            query: {},
@@ -51,7 +51,7 @@
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
@@ -66,6 +66,7 @@
                        span: 12,
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 76,
                        type: "select",
                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=haveType",
                        dataType: "number",
@@ -266,7 +267,7 @@
    watch: {
        "form.householdId": {
            handler(val) {
            handler (val) {
                if (val) {
                    householdDetail(val).then(res => {
@@ -281,7 +282,7 @@
        },
        'form.personType': {
            handler(newData) {
            handler (newData) {
                let householdIdColumn = this.findObject(
                    this.option.column,
                    'householdId'
@@ -296,7 +297,7 @@
        },
        'form.type': {
            handler(newData) {
            handler (newData) {
                let householdIdColumn = this.findObject(
                    this.option.column,
                    'householdId'
@@ -320,7 +321,7 @@
    computed: {
        ...mapGetters(["permission", "userInfo"]),
        permissionList() {
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.gridWorkLog_add, true),
                viewBtn: this.vaildData(this.permission.gridWorkLog_view, true),
@@ -328,7 +329,7 @@
                editBtn: this.vaildData(this.permission.gridWorkLog_edit, true),
            }
        },
        ids() {
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
@@ -336,7 +337,7 @@
            return ids.join(",")
        },
        showNamePhone() {
        showNamePhone () {
            return (data) => {
                if (data.phoneNumber && data.phoneNumber.trim() != '') {
                    return `${data.name}(${data.phoneNumber})`
@@ -347,18 +348,18 @@
        }
    },
    created() {
    created () {
        this.getUserList()
    },
    methods: {
        getUserList(param = '') {
        getUserList (param = '') {
            let dicUrl = `/api/blade-household/household/selectHouseholdList?labelId=${param}&searchKey={{key}}&limit=20`
            const column = this.findObject(this.option.column, "householdId")
            column.dicUrl = dicUrl
        },
        rowSave(row, done, loading) {
        rowSave (row, done, loading) {
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
@@ -383,7 +384,7 @@
                }
            )
        },
        rowUpdate(row, index, done, loading) {
        rowUpdate (row, index, done, loading) {
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
@@ -408,7 +409,7 @@
                }
            )
        },
        rowDel(row) {
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
@@ -425,24 +426,24 @@
                    })
                })
        },
        searchReset() {
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange(params, done) {
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange(list) {
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear() {
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        handleDelete() {
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
@@ -464,7 +465,7 @@
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen(done, type) {
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getGridWorkLog(this.form.id).then((res) => {
                    this.form = res.data.data
@@ -489,16 +490,16 @@
            // con
            done()
        },
        currentChange(currentPage) {
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange(pageSize) {
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange() {
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad(page, params = {}) {
        onLoad (page, params = {}) {
            const { dateTime } = this.query
            let values = {
                ...params,
src/views/cGovernance/punchCard.vue
@@ -53,7 +53,8 @@
                        label: "打卡人员",
                        prop: "name",
                        search: true,
                        searchSpan: 4
                        searchSpan: 4,
                        searchLabelWidth: 76,
                    },
                    {
                        label: "打卡时间",
src/views/cGovernance/reportForRepairs.vue
@@ -67,7 +67,7 @@
                </el-timeline>
            </template>
            <template slot="menu" slot-scope="{row, size, index}" >
            <template slot="menu" slot-scope="{row, size, index}">
                <el-button :size="size" v-if="permission.report_for_repairs_details" type="text"
                    icon="el-icon-document-remove" @click="rowExpansion(row)">
                    详情
@@ -198,6 +198,7 @@
                        searchLabelWidth: 66,
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 46,
                        dataType: "number",
                        type: "select",
                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=reportForRepairsType",
src/views/cGovernance/taskECall.vue
@@ -83,6 +83,7 @@
                    searchSpan: 4,
                    width: 100,
                    search: true,
                    searchLabelWidth: 76,
                    rules: [{
                        required: true,
                        message: "请输入事件名称",
src/views/community/index.vue
@@ -1,363 +1,366 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <template slot="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.community_delete" @click="handleDelete">删 除
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.community_delete"
                    @click="handleDelete">删 除
                </el-button>
            </template>
        </avue-crud>
    </basic-container>
</template>
<script>
  import {
import {
    getList,
    remove,
    update,
    add,
    getCommunity
  } from "@/api/community/index"
  import {
} from "@/api/community/index"
import {
    mapGetters
  } from "vuex"
  import website from '@/config/website'
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 96,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 210,
} from "vuex"
import website from '@/config/website'
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 210,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: true,
          //stripe:true,
          index: true,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          column: [{
              width: 156,
              overHidden: true,
              label: "社区名称",
              prop: "name",
              searchSpan: 4,
              search: true,
              span: 12,
              rules: [{
                required: true,
                message: "请输入社区名称",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              overHidden: true,
              label: "社区编号",
              prop: "code",
              searchSpan: 4,
              search: true,
              span: 12,
              rules: [{
                required: true,
                message: "请输入社区编号",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              label: "所属街道",
              parent: false,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              prop: "townName",
              search: true,
              searchSpan: 4
            },
            {
              label: "所属街道",
              hide: true,
              parent: false,
              prop: "streetCode",
              type: "tree",
              dicUrl: "/api/blade-system/region/getTownTree",
              props: {
                label: "name",
                value: "id"
              },
              rules: [{
                required: true,
                message: "请选择所属街道",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              label: "社区民警",
              prop: "resPoliceUserId",
              type: "tree",
              multiple: true,
              dicUrl: "/api/blade-system/user/getUserListByParam?roleName=民警",
              props: {
                label: "name",
                value: "id"
              },
              rules: [{
                required: true,
                message: "请选择社区民警",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              label: "社区图片",
              prop: "picUrl",
              type: "upload",
              listType: "picture-img",
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                url: "link",
              },
              span: 24,
            },
            {
              overHidden: true,
              label: "地址",
              prop: "address",
              span: 24,
              rules: [{
                required: false,
                message: "请输入地址",
                trigger: "blur",
              }, ],
            },
            {
              label: "社区简介",
              prop: "remark",
              component: "AvueUeditor",
              options: {
                action: "/api/blade-resource/oss/endpoint/put-file",
                props: {
                  res: "data",
                  url: "link",
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
                selection: true,
                dialogClickModal: false,
                column: [{
                    width: 156,
                    overHidden: true,
                    label: "社区名称",
                    prop: "name",
                    searchSpan: 4,
                    search: true,
                    searchLabelWidth: 76,
                    span: 12,
                    rules: [{
                        required: true,
                        message: "请输入社区名称",
                        trigger: "blur",
                    },],
                },
              },
              hide: true,
              minRows: 6,
              span: 24,
            },
                {
                    width: 110,
                    overHidden: true,
                    label: "社区编号",
                    prop: "code",
                    searchSpan: 4,
                    search: true,
                    span: 12,
                    rules: [{
                        required: true,
                        message: "请输入社区编号",
                        trigger: "blur",
                    },],
                },
          ],
        },
        data: [],
      }
                {
                    width: 110,
                    label: "所属街道",
                    parent: false,
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    prop: "townName",
                    search: true,
                    searchSpan: 4
                },
                {
                    label: "所属街道",
                    hide: true,
                    parent: false,
                    prop: "streetCode",
                    type: "tree",
                    dicUrl: "/api/blade-system/region/getTownTree",
                    props: {
                        label: "name",
                        value: "id"
                    },
                    rules: [{
                        required: true,
                        message: "请选择所属街道",
                        trigger: "blur",
                    },],
                },
                {
                    width: 110,
                    label: "社区民警",
                    prop: "resPoliceUserId",
                    type: "tree",
                    multiple: true,
                    dicUrl: "/api/blade-system/user/getUserListByParam?roleName=民警",
                    props: {
                        label: "name",
                        value: "id"
                    },
                    rules: [{
                        required: true,
                        message: "请选择社区民警",
                        trigger: "blur",
                    },],
                },
                {
                    width: 110,
                    label: "社区图片",
                    prop: "picUrl",
                    type: "upload",
                    listType: "picture-img",
                    action: "/api/blade-resource/oss/endpoint/put-file",
                    propsHttp: {
                        res: "data",
                        url: "link",
                    },
                    span: 24,
                },
                {
                    overHidden: true,
                    label: "地址",
                    prop: "address",
                    span: 24,
                    rules: [{
                        required: false,
                        message: "请输入地址",
                        trigger: "blur",
                    },],
                },
                {
                    label: "社区简介",
                    prop: "remark",
                    component: "AvueUeditor",
                    options: {
                        action: "/api/blade-resource/oss/endpoint/put-file",
                        props: {
                            res: "data",
                            url: "link",
                        },
                    },
                    hide: true,
                    minRows: 6,
                    span: 24,
                },
                ],
            },
            data: [],
        }
    },
    watch: {},
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.community_add, true),
          viewBtn: this.vaildData(this.permission.community_view, true),
          delBtn: this.vaildData(this.permission.community_delete, true),
          editBtn: this.vaildData(this.permission.community_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.community_add, true),
                viewBtn: this.vaildData(this.permission.community_view, true),
                delBtn: this.vaildData(this.permission.community_delete, true),
                editBtn: this.vaildData(this.permission.community_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
    },
    methods: {
      rowSave(row, done, loading) {
        if (row.picUrl.length > 0) {
          var urls = []
          var split = row.picUrl.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.picUrl = urls.join(",")
        }
        row.userid = this.userInfo.user_id
        add(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowUpdate(row, index, done, loading) {
        if (row.picUrl.length > 0) {
          var urls = []
          var split = row.picUrl.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.picUrl = urls.join(",")
        }
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getCommunity(this.form.id).then((res) => {
            this.form = res.data.data
            if (this.form.picUrl.length > 0) {
              var urls = []
              var names = this.form.picUrl.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              this.form.picUrl = urls.join(",")
            }
          })
        }
        // con
        done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.data.forEach(item => {
            if (item.picUrl) {
              if (item.picUrl.length > 0) {
        rowSave (row, done, loading) {
            if (row.picUrl.length > 0) {
                var urls = []
                var names = item.picUrl.split(",")
                names.forEach(name => {
                  urls.push(website.minioUrl + name)
                var split = row.picUrl.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                item.picUrl = urls.join(",")
              }
                row.picUrl = urls.join(",")
            }
          })
          this.loading = false
          this.selectionClear()
        })
      }
            row.userid = this.userInfo.user_id
            add(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            if (row.picUrl.length > 0) {
                var urls = []
                var split = row.picUrl.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.picUrl = urls.join(",")
            }
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getCommunity(this.form.id).then((res) => {
                    this.form = res.data.data
                    if (this.form.picUrl.length > 0) {
                        var urls = []
                        var names = this.form.picUrl.split(",")
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        this.form.picUrl = urls.join(",")
                    }
                })
            }
            // con
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            this.loading = true
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.data.forEach(item => {
                    if (item.picUrl) {
                        if (item.picUrl.length > 0) {
                            var urls = []
                            var names = item.picUrl.split(",")
                            names.forEach(name => {
                                urls.push(website.minioUrl + name)
                            })
                            item.picUrl = urls.join(",")
                        }
                    }
                })
                this.loading = false
                this.selectionClear()
            })
        }
    }
  }
}
</script>
<style>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
</style>
src/views/district/index.vue
@@ -56,6 +56,7 @@
                        prop: "name",
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 76,
                        span: 12,
                        rules: [
                            {
src/views/flow/follow.vue
@@ -71,6 +71,7 @@
                        prop: "executionId",
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 60,
                        width: 320,
                    },
                    {
src/views/flow/manager.vue
@@ -129,6 +129,7 @@
                    prop: 'key',
                    searchSpan: 4,
                    search: true,
                    searchLabelWidth: 76,
                },
                {
                    width: 150,
src/views/flow/model.vue
@@ -171,6 +171,7 @@
                        prop: 'modelKey',
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 76,
                        overHidden: true
                    },
                    {
src/views/grid/gridman.vue
@@ -99,6 +99,7 @@
                        prop: "gridmanName",
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 66,
                        rules: [
                            {
                                required: true,
src/views/grid/index.vue
@@ -69,6 +69,7 @@
                        prop: "communityName",
                        search: true,
                        searchSpan: 4,
                        searchLabelWidth: 76,
                        rules: [{
                            required: true,
                            message: "请选择所属社区",
src/views/gzll/owners.vue
@@ -103,7 +103,7 @@
                        label: "业委会名称",
                        prop: "name",
                        search: true,
                        searchLabelWidth: 124,
                        searchLabelWidth: 90,
                        rules: [{
                            required: true,
                            message: "请输入业委会名称",
src/views/monitor/log/api.vue
@@ -47,7 +47,8 @@
                        prop: "serviceId",
                        width: '120',
                        searchSpan: 4,
                        search: true
                        search: true,
                        searchLabelWidth: 60,
                    },
                    {
                        label: "服务host",
src/views/monitor/log/error.vue
@@ -47,7 +47,8 @@
                        prop: "serviceId",
                        searchSpan: 4,
                        search: true,
                        width: '120'
                        width: '120',
                        searchLabelWidth: 60,
                    },
                    {
                        label: "服务host",
src/views/monitor/log/usual.vue
@@ -46,7 +46,8 @@
                        label: "服务id",
                        prop: "serviceId",
                        searchSpan: 4,
                        search: true
                        search: true,
                        searchLabelWidth: 60,
                    },
                    {
                        label: "服务host",
src/views/place/index.vue
@@ -130,6 +130,7 @@
                        prop: "placeName",
                        searchSpan: 5,
                        search: true,
                        searchLabelWidth: 76,
                        rules: [{
                            required: true,
                            message: "请输入场所名称",
@@ -338,7 +339,7 @@
                        label: "九小场所",
                        prop: "isNine",
                        type: "select",
                        row:true,
                        row: true,
                        dicData: [
                            {
                                label: "是",
@@ -416,7 +417,7 @@
                        width: 120,
                        display: false,
                        label: '是否有二维码',
                        searchLabelWidth: 110,
                        searchLabelWidth: 104,
                        prop: 'source',
                        type: "select",
                        search: true,
src/views/property/convenienceHotline.vue
@@ -73,6 +73,7 @@
                    prop: "name",
                    searchSpan: 4,
                    search: true,
                    searchLabelWidth: 46,
                    width: 260,
                    rules: [{
                        required: true,
src/views/property/inviteTenders.vue
@@ -124,7 +124,7 @@
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
@@ -138,6 +138,7 @@
                    row: true,
                    searchSpan: 4,
                    search: true,
                    searchLabelWidth: 76,
                    rules: [{
                        required: true,
                        message: "请输入招标标题",
src/views/property/oiae.vue
@@ -134,7 +134,7 @@
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
@@ -149,6 +149,7 @@
                        row: true,
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 76,
                        rules: [{
                            required: true,
                            message: "请输入收支标题",
src/views/property/ownersCommittee.vue
@@ -105,7 +105,7 @@
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: false,
                border: true,
                //stripe:true,
                index: true,
                viewBtn: true,
@@ -119,6 +119,7 @@
                    row: true,
                    searchSpan: 4,
                    search: true,
                    searchLabelWidth: 46,
                    rules: [{
                        required: true,
                        message: "请输入业主大会标题",
src/views/property/partyOrganization.vue
@@ -74,6 +74,7 @@
                        prop: "areaId",
                        search: true,
                        searchSpan: searchSpan,
                        searchLabelWidth: 76,
                        width: 150,
                        type: "tree",
                        dicUrl: "/api/blade-system/region/tree",
src/views/property/propertyCapitalApply.vue
@@ -84,6 +84,7 @@
                    prop: "districtName",
                    search: true,
                    searchSpan: 4,
                    searchLabelWidth: 76,
                    rules: [{
                        required: true,
                        message: "请输入小区名称",
src/views/property/propertyCharge.vue
@@ -64,6 +64,7 @@
                        },
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 76,
                        disabled: false,
                        type: "select",
                        rules: [{
src/views/property/propertyChargeRecord.vue
@@ -64,6 +64,7 @@
                        },
                        searchSpan,
                        search: true,
                        searchLabelWidth: 76,
                        disabled: false,
                        type: "select",
                        rules: [{
@@ -78,7 +79,7 @@
                        label: "付款人",
                        prop: "payUser",
                        searchSpan: searchSpan,
                        searchLabelWidth: 80,
                        searchLabelWidth: 90,
                        search: true,
                        rules: [{
                            required: true,
src/views/property/propertyCompany.vue
@@ -1,57 +1,58 @@
<!-- 物业公司管理 -->
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <template slot="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
          @click="handleDelete">删 除
        </el-button>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
                    @click="handleDelete">删 除
                </el-button>
      </template>
            </template>
      <template slot-scope="{row, size, index}" slot="menu">
        <el-button :size="size" v-if="permission.payInfo" type="text" icon="el-icon-circle-plus-outline"
          @click="openPayConfig(row)">商户配置
        </el-button>
            <template slot-scope="{row, size, index}" slot="menu">
                <el-button :size="size" v-if="permission.payInfo" type="text" icon="el-icon-circle-plus-outline"
                    @click="openPayConfig(row)">商户配置
                </el-button>
        <el-button :size="size" v-if="permission.property_evaluation" icon="el-icon-circle-plus-outline" type="text"
          @click="addProperty(row)">物业评定
        </el-button>
      </template>
    </avue-crud>
                <el-button :size="size" v-if="permission.property_evaluation" icon="el-icon-circle-plus-outline" type="text"
                    @click="addProperty(row)">物业评定
                </el-button>
            </template>
        </avue-crud>
    <el-dialog title="商户配置" append-to-body :visible.sync="payInfoVisible" top="10vh" width="70%">
      <el-tabs v-model="currentTab">
        <el-tab-pane label="微信商户配置" name="wxInfo">
          <avue-form ref="wxForm" :option="wxPayOption" v-model="wxPayForm" @submit="wxSubmit">
          </avue-form>
        </el-tab-pane>
        <el-tab-pane label="支付宝商户配置" name="second">
          <avue-form ref="aliForm" :option="aliPayOption" v-model="aliPayForm" @submit="aliSubmit">
          </avue-form>
        </el-tab-pane>
        <el-dialog title="商户配置" append-to-body :visible.sync="payInfoVisible" top="10vh" width="70%">
            <el-tabs v-model="currentTab">
                <el-tab-pane label="微信商户配置" name="wxInfo">
                    <avue-form ref="wxForm" :option="wxPayOption" v-model="wxPayForm" @submit="wxSubmit">
                    </avue-form>
                </el-tab-pane>
                <el-tab-pane label="支付宝商户配置" name="second">
                    <avue-form ref="aliForm" :option="aliPayOption" v-model="aliPayForm" @submit="aliSubmit">
                    </avue-form>
                </el-tab-pane>
      </el-tabs>
            </el-tabs>
      <!--      <div slot="footer" class="dialog-footer">-->
      <!--        <el-button @click="payInfoVisible = false">取 消</el-button>-->
      <!--        <el-button type="primary"@click="submit">提 交</el-button>-->
      <!--      </div>-->
            <!--      <div slot="footer" class="dialog-footer">-->
            <!--        <el-button @click="payInfoVisible = false">取 消</el-button>-->
            <!--        <el-button type="primary"@click="submit">提 交</el-button>-->
            <!--      </div>-->
    </el-dialog>
        </el-dialog>
    <propertyEdit ref="propertyEdit"></propertyEdit>
        <propertyEdit ref="propertyEdit"></propertyEdit>
  </basic-container>
    </basic-container>
</template>
<script>
  import {
import {
    getList,
    remove,
    update,
@@ -60,546 +61,546 @@
    getPayConfig,
    saveOrUpdateWx,
    saveOrUpdateAli
  } from "@/api/property/propertyCompany"
  import {
} from "@/api/property/propertyCompany"
import {
    mapGetters
  } from "vuex"
  import website from '@/config/website'
  import func from "@/util/func"
} from "vuex"
import website from '@/config/website'
import func from "@/util/func"
  import propertyEdit from './components/propertyEdit.vue'
import propertyEdit from './components/propertyEdit.vue'
  const labelWidth = 120
  export default {
const labelWidth = 120
export default {
    components: {
      propertyEdit
        propertyEdit
    },
    data() {
      return {
        currentTab: "wxInfo",
        payInfoVisible: false,
        currentRow: {},
    data () {
        return {
            currentTab: "wxInfo",
            payInfoVisible: false,
            currentRow: {},
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 120,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 280,
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 120,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 280,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 1150,
          tip: false,
          border: true,
          //stripe:true,
          index: true,
          // viewBtn: true,
          delBtn: false,
          selection: true,
          dialogClickModal: false,
          column: [{
              overHidden: true,
              label: "物业公司名称",
              prop: "name",
              searchSpan: 5,
              searchLabelWidth: 124,
              search: true,
              span: 18,
              row: true,
              width: 200,
              rules: [{
                required: true,
                message: "请输入物业公司名称",
                trigger: "blur",
              }, ],
            },
            {
              label: '省份',
              prop: 'province',
              type: 'select',
              props: {
                label: 'name',
                value: 'code'
              },
              hide: true,
              span: 6,
              cascader: ['city'],
              dicUrl: `/api/blade-system/region/select?code=100000`,
              rules: [{
                required: true,
                message: '请选择省份',
                trigger: 'blur'
              }]
            },
            {
              label: '城市',
              prop: 'city',
              type: 'select',
              span: 6,
              labelWidth: 60,
              cascader: ['area'],
              props: {
                label: 'name',
                value: 'code'
              },
              hide: true,
              dicUrl: `/api/blade-system/region/select?code={{key}}`,
              rules: [{
                required: true,
                message: '请选择城市',
                trigger: 'blur'
              }]
            },
            {
              label: '地区',
              prop: 'area',
              type: 'select',
              span: 6,
              width: 260,
              props: {
                label: 'name',
                value: 'code'
              },
              hide: true,
              dicUrl: `/api/blade-system/region/select?code={{key}}`,
              rules: [{
                required: true,
                message: '请选择地区',
                trigger: 'blur'
              }]
            },
            {
              overHidden: true,
              label: "地址",
              prop: "address",
              span: 18,
              row: true,
              width: 160,
            },
            {
              label: "社会信用代码",
              prop: "socialCreditCode",
              searchSpan: 5,
              searchLabelWidth: 124,
              search: true,
              span: 18,
              row: true,
              width: 100,
            },
            {
              label: "基础信息分",
              prop: "baseInfoScore",
              display: false,
            },
            {
              label: "经营信息分",
              prop: "operateinfoScore",
              display: false,
            },
            {
              label: "纳税信息分",
              prop: "taxInfoScore",
              display: false,
            },
            {
              label: "党建信息分",
              prop: "partyBuildingInfoScore",
              display: false,
            },
            {
              label: "企业良好信息分",
              prop: "goodCorporateScore",
              display: false,
            },
            {
              label: "项目良好信息分",
              prop: "goodCorporateScore",
              display: false,
            },
            {
              label: "违法违规行为分",
              prop: "goodCorporateScore",
              display: false,
            },
            {
              label: "评价平均分",
              prop: "evaluateScore",
              display: false,
            },
            {
              label: "街道社区分",
              prop: "streetScore",
              display: false,
            },
            {
              label: "总分",
              prop: "allScore",
              display: false,
            },
            {
              label: "简介",
              prop: "remark",
              component: "AvueUeditor",
              options: {
                action: "/api/blade-resource/oss/endpoint/put-file-attach",
                props: {
                  res: "data",
                  url: "link",
                height: "auto",
                calcHeight: 54,
                dialogWidth: 1150,
                tip: false,
                border: true,
                //stripe:true,
                index: true,
                // viewBtn: true,
                delBtn: false,
                selection: true,
                dialogClickModal: false,
                column: [{
                    overHidden: true,
                    label: "物业公司名称",
                    prop: "name",
                    searchSpan: 5,
                    searchLabelWidth: 104,
                    search: true,
                    span: 18,
                    row: true,
                    width: 200,
                    rules: [{
                        required: true,
                        message: "请输入物业公司名称",
                        trigger: "blur",
                    },],
                },
              },
              hide: true,
              minRows: 6,
              span: 24,
            },
          ],
        },
        data: [],
                {
                    label: '省份',
                    prop: 'province',
                    type: 'select',
                    props: {
                        label: 'name',
                        value: 'code'
                    },
                    hide: true,
                    span: 6,
                    cascader: ['city'],
                    dicUrl: `/api/blade-system/region/select?code=100000`,
                    rules: [{
                        required: true,
                        message: '请选择省份',
                        trigger: 'blur'
                    }]
                },
                {
                    label: '城市',
                    prop: 'city',
                    type: 'select',
                    span: 6,
                    labelWidth: 60,
                    cascader: ['area'],
                    props: {
                        label: 'name',
                        value: 'code'
                    },
                    hide: true,
                    dicUrl: `/api/blade-system/region/select?code={{key}}`,
                    rules: [{
                        required: true,
                        message: '请选择城市',
                        trigger: 'blur'
                    }]
                },
                {
                    label: '地区',
                    prop: 'area',
                    type: 'select',
                    span: 6,
                    width: 260,
                    props: {
                        label: 'name',
                        value: 'code'
                    },
                    hide: true,
                    dicUrl: `/api/blade-system/region/select?code={{key}}`,
                    rules: [{
                        required: true,
                        message: '请选择地区',
                        trigger: 'blur'
                    }]
                },
                {
                    overHidden: true,
                    label: "地址",
                    prop: "address",
                    span: 18,
                    row: true,
                    width: 160,
                },
                {
                    label: "社会信用代码",
                    prop: "socialCreditCode",
                    searchSpan: 5,
                    searchLabelWidth: 124,
                    search: true,
                    span: 18,
                    row: true,
                    width: 100,
                },
                {
                    label: "基础信息分",
                    prop: "baseInfoScore",
                    display: false,
                },
                {
                    label: "经营信息分",
                    prop: "operateinfoScore",
                    display: false,
                },
                {
                    label: "纳税信息分",
                    prop: "taxInfoScore",
                    display: false,
                },
                {
                    label: "党建信息分",
                    prop: "partyBuildingInfoScore",
                    display: false,
                },
                {
                    label: "企业良好信息分",
                    prop: "goodCorporateScore",
                    display: false,
                },
                {
                    label: "项目良好信息分",
                    prop: "goodCorporateScore",
                    display: false,
                },
                {
                    label: "违法违规行为分",
                    prop: "goodCorporateScore",
                    display: false,
                },
                {
                    label: "评价平均分",
                    prop: "evaluateScore",
                    display: false,
                },
                {
                    label: "街道社区分",
                    prop: "streetScore",
                    display: false,
                },
                {
                    label: "总分",
                    prop: "allScore",
                    display: false,
                },
        wxPayForm: {},
        wxPayOption: {
          emptyBtn: false,
          height: "auto",
          calcHeight: 180,
          //stripe:true,
          column: [{
              label: "appId",
              labelWidth: labelWidth,
              prop: "appId",
              span: 24,
              rules: [{
                required: true,
                message: "请输入appId",
                trigger: ["blur", "change"]
              }, ],
                {
                    label: "简介",
                    prop: "remark",
                    component: "AvueUeditor",
                    options: {
                        action: "/api/blade-resource/oss/endpoint/put-file-attach",
                        props: {
                            res: "data",
                            url: "link",
                        },
                    },
                    hide: true,
                    minRows: 6,
                    span: 24,
                },
                ],
            },
            {
              label: "mch-id",
              labelWidth: labelWidth,
              prop: "mchId",
              span: 24,
              rules: [{
                required: true,
                message: "请输入mch-id",
                trigger: ["blur", "change"]
              }, ],
            },
            {
              label: "mchKey",
              labelWidth: labelWidth,
              prop: "mchKey",
              rules: [{
                required: true,
                message: "请输入mchKey",
                trigger: ["blur", "change"]
              }, ],
              span: 24,
            },
            {
              label: "appSecret",
              labelWidth: labelWidth,
              prop: "appSecret",
              rules: [{
                required: true,
                message: "请输入appSecret",
                trigger: ["blur", "change"]
              }, ],
              span: 24,
            },
            {
              label: '安全证书',
              labelWidth: labelWidth,
              prop: 'keyPath',
              type: 'upload',
              drag: true,
              limit: 1,
              loadText: '上传中,请稍等',
              span: 24,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: 'name',
                url: "link",
              },
              rules: [{
                required: true,
                message: "请上传安全证书",
                trigger: ["blur", "change"]
              }, ],
            },
          ],
        },
            data: [],
        aliPayForm: {},
        aliPayOption: {
          emptyBtn: false,
          height: "auto",
          calcHeight: 180,
          //stripe:true,
          column: [{
              label: "appId",
              labelWidth: labelWidth,
              prop: "appId",
              span: 24,
              rules: [{
                required: true,
                message: "请输入appId",
                trigger: ["blur", "change"]
              }, ],
            wxPayForm: {},
            wxPayOption: {
                emptyBtn: false,
                height: "auto",
                calcHeight: 180,
                //stripe:true,
                column: [{
                    label: "appId",
                    labelWidth: labelWidth,
                    prop: "appId",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入appId",
                        trigger: ["blur", "change"]
                    },],
                },
                {
                    label: "mch-id",
                    labelWidth: labelWidth,
                    prop: "mchId",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入mch-id",
                        trigger: ["blur", "change"]
                    },],
                },
                {
                    label: "mchKey",
                    labelWidth: labelWidth,
                    prop: "mchKey",
                    rules: [{
                        required: true,
                        message: "请输入mchKey",
                        trigger: ["blur", "change"]
                    },],
                    span: 24,
                },
                {
                    label: "appSecret",
                    labelWidth: labelWidth,
                    prop: "appSecret",
                    rules: [{
                        required: true,
                        message: "请输入appSecret",
                        trigger: ["blur", "change"]
                    },],
                    span: 24,
                },
                {
                    label: '安全证书',
                    labelWidth: labelWidth,
                    prop: 'keyPath',
                    type: 'upload',
                    drag: true,
                    limit: 1,
                    loadText: '上传中,请稍等',
                    span: 24,
                    action: "/api/blade-resource/oss/endpoint/put-file",
                    propsHttp: {
                        res: "data",
                        name: 'name',
                        url: "link",
                    },
                    rules: [{
                        required: true,
                        message: "请上传安全证书",
                        trigger: ["blur", "change"]
                    },],
                },
                ],
            },
            {
              label: "privateKey",
              labelWidth: labelWidth,
              prop: "privateKey",
              span: 24,
              rules: [{
                required: true,
                message: "请输入privateKey",
                trigger: ["blur", "change"]
              }, ],
            },
            {
              label: "publicKey",
              labelWidth: labelWidth,
              prop: "publicKey",
              span: 24,
              rules: [{
                required: true,
                message: "请输入publicKey",
                trigger: ["blur", "change"]
              }, ],
            },
          ],
            aliPayForm: {},
            aliPayOption: {
                emptyBtn: false,
                height: "auto",
                calcHeight: 180,
                //stripe:true,
                column: [{
                    label: "appId",
                    labelWidth: labelWidth,
                    prop: "appId",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入appId",
                        trigger: ["blur", "change"]
                    },],
                },
                {
                    label: "privateKey",
                    labelWidth: labelWidth,
                    prop: "privateKey",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入privateKey",
                        trigger: ["blur", "change"]
                    },],
                },
                {
                    label: "publicKey",
                    labelWidth: labelWidth,
                    prop: "publicKey",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入publicKey",
                        trigger: ["blur", "change"]
                    },],
                },
                ],
            }
        }
      }
    },
    watch: {},
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.propertyCompany_add, true),
          viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
          delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
          editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.propertyCompany_add, true),
                viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
                delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
                editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
    },
    created() {},
    created () { },
    methods: {
      addProperty(row) {
        this.$refs.propertyEdit.init(row);
      },
        addProperty (row) {
            this.$refs.propertyEdit.init(row)
        },
      aliSubmit(form, done) {
        aliSubmit (form, done) {
        console.log("支付宝商户配置", this.aliPayForm)
            console.log("支付宝商户配置", this.aliPayForm)
        this.aliPayForm.propertyCompanyId = this.currentRow.id
        saveOrUpdateAli(this.aliPayForm).then(res => {
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          done()
        })
      },
      wxSubmit(form, done) {
        this.wxPayForm.propertyCompanyId = this.currentRow.id
        this.wxPayForm.keyPath = func.join(this.wxPayForm.keyPath)
        if (this.wxPayForm.keyPath.length > 0) {
          var urls = []
          var split = this.wxPayForm.keyPath.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          this.wxPayForm.keyPath = urls.join(",")
        }
        console.log("微信商户配置", this.wxPayForm)
        saveOrUpdateWx(this.wxPayForm).then(res => {
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          done()
        })
      },
      openPayConfig(row) {
        this.currentRow = row
        //调接口获取商户数据
        getPayConfig(row.id).then(res => {
          let data = res.data.data
          this.wxPayForm = data.wxPayInfo ? data.wxPayInfo : {}
          this.aliPayForm = data.aliPayInfo ? data.aliPayInfo : {}
        })
        this.payInfoVisible = !this.payInfoVisible
      },
      rowSave(row, done, loading) {
        row.userid = this.userInfo.user_id
        add(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            this.aliPayForm.propertyCompanyId = this.currentRow.id
            saveOrUpdateAli(this.aliPayForm).then(res => {
                this.$message({
                    type: "success",
                    message: "操作成功!",
                })
                done()
            })
        },
        wxSubmit (form, done) {
            this.wxPayForm.propertyCompanyId = this.currentRow.id
            this.wxPayForm.keyPath = func.join(this.wxPayForm.keyPath)
            if (this.wxPayForm.keyPath.length > 0) {
                var urls = []
                var split = this.wxPayForm.keyPath.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                this.wxPayForm.keyPath = urls.join(",")
            }
            console.log("微信商户配置", this.wxPayForm)
            saveOrUpdateWx(this.wxPayForm).then(res => {
                this.$message({
                    type: "success",
                    message: "操作成功!",
                })
                done()
            })
        },
        openPayConfig (row) {
            this.currentRow = row
            //调接口获取商户数据
            getPayConfig(row.id).then(res => {
                let data = res.data.data
                this.wxPayForm = data.wxPayInfo ? data.wxPayInfo : {}
                this.aliPayForm = data.aliPayInfo ? data.aliPayInfo : {}
            })
            this.payInfoVisible = !this.payInfoVisible
        },
        rowSave (row, done, loading) {
            row.userid = this.userInfo.user_id
            add(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getPropertyCompany(this.form.id).then((res) => {
            this.form = res.data.data
          })
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getPropertyCompany(this.form.id).then((res) => {
                    this.form = res.data.data
                })
            }
            // con
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const {
                dateTime
            } = this.query
            let values = {
                ...params,
            }
            if (dateTime) {
                values = {
                    ...params,
                    startTime: dateTime[0],
                    endTime: dateTime[1],
                    ...this.query,
                }
                values.dateTime = null
            }
            this.loading = true
            getList(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        }
        // con
        done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {
          dateTime
        } = this.query
        let values = {
          ...params,
        }
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          }
          values.dateTime = null
        }
        this.loading = true
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.loading = false
          this.selectionClear()
        })
      }
    }
  }
}
</script>
<style>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
</style>
src/views/property/propertyCompanyDistrict.vue
@@ -80,6 +80,7 @@
                    prop: "districtName",
                    search: true,
                    searchSpan: 4,
                    searchLabelWidth: 76,
                    rules: [{
                        required: true,
                        message: "请输入小区名称",
src/views/propertySupervision/houseHoldSupervision.vue
@@ -247,6 +247,7 @@
                    parent: false,
                    prop: "houseName",
                    searchSpan: 4,
                    searchLabelWidth: 50,
                    display: false,
                    search: true,
                },
src/views/propertySupervision/ownersCommittee.vue
@@ -1,16 +1,17 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <!-- <template slot="menuLeft">
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <!-- <template slot="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
          除
        </el-button>
      </template> -->
      <!-- <template slot-scope="{type,size,row }" slot="menu">
            <!-- <template slot-scope="{type,size,row }" slot="menu">
        <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
          撤销
        </el-button>
@@ -19,632 +20,633 @@
        </el-button>
      </template> -->
      <template slot-scope="{ row, size }" slot="publish">
        <el-tag :size="size" :type="showStatus(row.publish, 1).type" v-text="showStatus(row.publish, 1).text">
        </el-tag>
      </template>
            <template slot-scope="{ row, size }" slot="publish">
                <el-tag :size="size" :type="showStatus(row.publish, 1).type" v-text="showStatus(row.publish, 1).text">
                </el-tag>
            </template>
      <template slot-scope="{ row, size }" slot="iscomment">
        <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
        </el-tag>
      </template>
    </avue-crud>
            <template slot-scope="{ row, size }" slot="iscomment">
                <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
                </el-tag>
            </template>
        </avue-crud>
  </basic-container>
    </basic-container>
</template>
<script>
  import {
import {
    getList,
    remove,
    update,
    add,
    getNotice,
    upcomment
  } from "@/api/article/article"
} from "@/api/article/article"
  import {
import {
    addPd,
  } from "@/api/discuss/publicDiscuss"
} from "@/api/discuss/publicDiscuss"
  import website from '@/config/website'
import website from '@/config/website'
  import {
import {
    getDistrictTree
  } from "@/api/district/index"
} from "@/api/district/index"
  import {
import {
    mapGetters
  } from "vuex"
} from "vuex"
  export default {
    data() {
      return {
        discussForm: {
          ontitle: '',
          title: '',
          openFlag: 0,
          numberRestrictions: 0,
          voteRestrictions: 0,
          userRestrictions: 0,
          endTime: '',
          articleId: '',
          createTime: '',
          updateTime: '',
          deleteFlag: '',
          repeatVote: 0,
          voteNumberPublic: 0,
          appointUser: '',
          userIds: '',
          eventType: 1,
        },
        dialogVisibles: false,
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 96,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 450,
export default {
    data () {
        return {
            discussForm: {
                ontitle: '',
                title: '',
                openFlag: 0,
                numberRestrictions: 0,
                voteRestrictions: 0,
                userRestrictions: 0,
                endTime: '',
                articleId: '',
                createTime: '',
                updateTime: '',
                deleteFlag: '',
                repeatVote: 0,
                voteNumberPublic: 0,
                appointUser: '',
                userIds: '',
                eventType: 1,
            },
            dialogVisibles: false,
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 450,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: false,
          //stripe:true,
          index: true,
          addBtn: false,
          viewBtn: false,
          delBtn: false,
          editBtn: false,
          selection: false,
          excelBtn: false,
          menu: false,
          dialogClickModal: false,
          column: [{
              label: "标题",
              prop: "title",
              span: 24,
              row: true,
              searchSpan: 4,
              search: true,
              rules: [{
                required: true,
                message: "请输入业主大会标题",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              label: "封面",
              prop: "url",
              // align:'center',
              type: "upload",
              listType: "picture-img",
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                url: "link",
              },
              // hide: true,
              span: 24,
            },
            {
              width: 100,
              label: "业主大会类型",
              prop: "type",
              value: 5,
              slot: true,
              searchSpan: 4,
              // search: true,
              type: "select",
              rules: [{
                required: true,
                message: "请选择招标类型",
                trigger: "blur",
              }, ],
              dicData: [{
                label: "业主大会",
                value: 5,
              }],
            },
            // {
            //   label: "招标来源",
            //   prop: "sourceName",
            //   search: true,
            //   searchSpan: 4,
            //   span: 24,
            //   rules: [{
            //     required: true,
            //     message: "请输入招标类型",
            //     trigger: "blur",
            //   }, ],
            // },
            {
              label: "公示范围",
              prop: "articleList",
              span: 12,
              minRows: 2,
              type: "cascader",
              multiple: true,
              tags: true,
              dicData: [],
              rules: [{
                required: true,
                message: "请选择业主大会范围",
                trigger: "blur",
              }, ],
              props: {
                label: "name",
                value: 'id'
              },
              hide: true,
            },
            {
              label: "发布时间",
              prop: "dateTime",
              type: "daterange",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              searchSpan: 6,
              searchRange: true,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [{
                required: true,
                message: "请选择发布时间",
                trigger: "blur",
              }, ],
            },
            {
              width: 144,
              label: "发布时间",
              prop: "createTime",
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
            },
            // {
            //   width: 100,
            //   label: "发布状态",
            //   prop: "publish",
            //   value: "0",
            //   slot: true,
            //   searchSpan: 4,
            //   search: true,
            //   type: "select",
            //   display: false,
            //   rules: [{
            //     required: true,
            //     message: "请选择发布状态",
            //     trigger: "blur",
            //   }, ],
            //   dicData: [{
            //       label: "未发布",
            //       value: "0",
            //     },
            //     {
            //       label: "已发布",
            //       value: "1",
            //     }
            //   ],
            // },
            // {
            //   width: 100,
            //   label: "评论区",
            //   prop: "iscomment",
            //   slot: true,
            //   type: "select",
            //   dicData: [{
            //       label: "关闭",
            //       value: "0",
            //     },
            //     {
            //       label: "开启",
            //       value: "1",
            //     }
            //   ],
            // },
            {
              label: "内容",
              prop: "content",
              component: "AvueUeditor",
              options: {
                action: "/api/blade-resource/oss/endpoint/put-file",
                // customConfig: {
                //   lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
                // },//wangEditor编辑的配置
                props: {
                  res: "data",
                  url: "link",
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: true,
                //stripe:true,
                index: true,
                addBtn: false,
                viewBtn: false,
                delBtn: false,
                editBtn: false,
                selection: false,
                excelBtn: false,
                menu: false,
                dialogClickModal: false,
                column: [{
                    label: "标题",
                    prop: "title",
                    span: 24,
                    row: true,
                    searchSpan: 4,
                    searchLabelWidth: 50,
                    search: true,
                    rules: [{
                        required: true,
                        message: "请输入业主大会标题",
                        trigger: "blur",
                    },],
                },
              },
              hide: true,
              minRows: 6,
              span: 24,
            },
          ],
        },
        data: [],
                {
                    width: 110,
                    label: "封面",
                    prop: "url",
                    // align:'center',
                    type: "upload",
                    listType: "picture-img",
                    action: "/api/blade-resource/oss/endpoint/put-file",
                    propsHttp: {
                        res: "data",
                        url: "link",
                    },
                    // hide: true,
                    span: 24,
                },
                {
                    width: 100,
                    label: "业主大会类型",
                    prop: "type",
                    value: 5,
                    slot: true,
                    searchSpan: 4,
                    // search: true,
                    type: "select",
                    rules: [{
                        required: true,
                        message: "请选择招标类型",
                        trigger: "blur",
                    },],
                    dicData: [{
                        label: "业主大会",
                        value: 5,
                    }],
                },
                // {
                //   label: "招标来源",
                //   prop: "sourceName",
                //   search: true,
                //   searchSpan: 4,
                //   span: 24,
                //   rules: [{
                //     required: true,
                //     message: "请输入招标类型",
                //     trigger: "blur",
                //   }, ],
                // },
                {
                    label: "公示范围",
                    prop: "articleList",
                    span: 12,
                    minRows: 2,
                    type: "cascader",
                    multiple: true,
                    tags: true,
                    dicData: [],
                    rules: [{
                        required: true,
                        message: "请选择业主大会范围",
                        trigger: "blur",
                    },],
                    props: {
                        label: "name",
                        value: 'id'
                    },
                    hide: true,
                },
                {
                    label: "发布时间",
                    prop: "dateTime",
                    type: "daterange",
                    format: "yyyy-MM-dd",
                    valueFormat: "yyyy-MM-dd",
                    searchSpan: 6,
                    searchRange: true,
                    hide: true,
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    search: true,
                    rules: [{
                        required: true,
                        message: "请选择发布时间",
                        trigger: "blur",
                    },],
                },
                {
                    width: 144,
                    label: "发布时间",
                    prop: "createTime",
                    type: "date",
                    format: "yyyy-MM-dd",
                    valueFormat: "yyyy-MM-dd HH:mm:ss",
                },
        districtTree: [],
      }
                // {
                //   width: 100,
                //   label: "发布状态",
                //   prop: "publish",
                //   value: "0",
                //   slot: true,
                //   searchSpan: 4,
                //   search: true,
                //   type: "select",
                //   display: false,
                //   rules: [{
                //     required: true,
                //     message: "请选择发布状态",
                //     trigger: "blur",
                //   }, ],
                //   dicData: [{
                //       label: "未发布",
                //       value: "0",
                //     },
                //     {
                //       label: "已发布",
                //       value: "1",
                //     }
                //   ],
                // },
                // {
                //   width: 100,
                //   label: "评论区",
                //   prop: "iscomment",
                //   slot: true,
                //   type: "select",
                //   dicData: [{
                //       label: "关闭",
                //       value: "0",
                //     },
                //     {
                //       label: "开启",
                //       value: "1",
                //     }
                //   ],
                // },
                {
                    label: "内容",
                    prop: "content",
                    component: "AvueUeditor",
                    options: {
                        action: "/api/blade-resource/oss/endpoint/put-file",
                        // customConfig: {
                        //   lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
                        // },//wangEditor编辑的配置
                        props: {
                            res: "data",
                            url: "link",
                        },
                    },
                    hide: true,
                    minRows: 6,
                    span: 24,
                },
                ],
            },
            data: [],
            districtTree: [],
        }
    },
    watch: {
      "form.articleType": {
        handler(val) {
          if (val) {
            var videoUrl = this.findObject(this.option.column, "videoUrl")
            var content = this.findObject(this.option.column, "content")
            if (val.indexOf('ksp') != -1) {
              videoUrl.display = true
              content.display = false
              videoUrl.rules = [{
                required: false,
                message: "请选择视频",
                trigger: "blur",
              }, ]
            } else {
              videoUrl.display = false
              content.display = true
              videoUrl.rules = ""
            }
          }
        },
        immediate: true,
      }
        "form.articleType": {
            handler (val) {
                if (val) {
                    var videoUrl = this.findObject(this.option.column, "videoUrl")
                    var content = this.findObject(this.option.column, "content")
                    if (val.indexOf('ksp') != -1) {
                        videoUrl.display = true
                        content.display = false
                        videoUrl.rules = [{
                            required: false,
                            message: "请选择视频",
                            trigger: "blur",
                        },]
                    } else {
                        videoUrl.display = false
                        content.display = true
                        videoUrl.rules = ""
                    }
                }
            },
            immediate: true,
        }
    },
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.article_add, true),
          viewBtn: this.vaildData(this.permission.article_view, true),
          delBtn: this.vaildData(this.permission.article_delete, true),
          editBtn: this.vaildData(this.permission.article_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
      showStatus() {
        return (data, type) => {
          if (data == 0) {
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
              text: type == 1 ? '未发布' : '关闭',
              type: 'info'
                addBtn: this.vaildData(this.permission.article_add, true),
                viewBtn: this.vaildData(this.permission.article_view, true),
                delBtn: this.vaildData(this.permission.article_delete, true),
                editBtn: this.vaildData(this.permission.article_edit, true),
            }
          } else if (data == 1) {
            return {
              text: type == 1 ? '已发布' : '开启',
              type: 'success'
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
        showStatus () {
            return (data, type) => {
                if (data == 0) {
                    return {
                        text: type == 1 ? '未发布' : '关闭',
                        type: 'info'
                    }
                } else if (data == 1) {
                    return {
                        text: type == 1 ? '已发布' : '开启',
                        type: 'success'
                    }
                }
            }
          }
        }
      }
    },
    methods: {
      openDilog(row, type) {
        this.dialogVisibles = true
        this.discussForm.eventType = type
        this.discussForm.articleId = row.id
        this.discussForm.title = row.title
        if (type == 0) {
          this.discussForm.ontitle = '公益报名'
        } else {
          this.discussForm.ontitle = '创建议题'
        }
      },
      handleSubmit(form, done) {
        done()
        addPd(form).then(
          () => {
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            this.dialogVisibles = false
            done()
          },
          (error) => {
            window.console.log(error)
            // loading();
          }
        )
      },
      handleClose(done) {
        done()
        // this.$confirm('确认关闭?')
        //   .then(_ => {
        //     done();
        //   })
        //   .catch(_ => {});
      },
      rowSave(row, done, loading) {
        row['type'] = 5
        row.userid = this.userInfo.user_id
        row.articleRange = JSON.stringify(row.articleList)
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        add(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowUpdate(row, index, done, loading) {
        row.articleRange = JSON.stringify(row.articleList)
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getNotice(this.form.id).then((res) => {
            let data = res.data.data
            // data.forEach(item=>{
            if (data.url.length > 0) {
              var urls = []
              var names = data.url.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              data.url = urls.join(",")
        openDilog (row, type) {
            this.dialogVisibles = true
            this.discussForm.eventType = type
            this.discussForm.articleId = row.id
            this.discussForm.title = row.title
            if (type == 0) {
                this.discussForm.ontitle = '公益报名'
            } else {
                this.discussForm.ontitle = '创建议题'
            }
            data.articleList = JSON.parse(data.articleRange)
            this.form = data
          })
        }
        // con
        done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {
          dateTime
        } = this.query
        let values = {
          ...params,
        }
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          }
          values.dateTime = null
        }
        values.type = 5
        values.publish = 1
        this.loading = true
        console.log(values)
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.data.forEach(item => {
            if (item.url.length > 0) {
              var urls = []
              var names = item.url.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              item.url = urls.join(",")
            }
          })
          this.loading = false
          this.selectionClear()
        })
        getDistrictTree(params = {}).then((res) => {
          const data = res.data.data
          this.districtTree = data
          const column = this.findObject(this.option.column, "articleList")
          column.dicData = res.data.data
          this.loading = false
        })
      },
      updateFb(row) {
        if (row.publish == "0") {
          row.publish = "1"
        } else {
          row.publish = "0"
        }
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
        },
        handleSubmit (form, done) {
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      kqcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据开启评论?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            return upcomment(this.ids, "1")
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            addPd(form).then(
                () => {
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.dialogVisibles = false
                    done()
                },
                (error) => {
                    window.console.log(error)
                    // loading();
                }
            )
        },
        handleClose (done) {
            done()
            // this.$confirm('确认关闭?')
            //   .then(_ => {
            //     done();
            //   })
            //   .catch(_ => {});
        },
        rowSave (row, done, loading) {
            row['type'] = 5
            row.userid = this.userInfo.user_id
            row.articleRange = JSON.stringify(row.articleList)
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
            add(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            row.articleRange = JSON.stringify(row.articleList)
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
            this.$refs.crud.toggleSelection()
          })
      },
      gbcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据开启评论?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            return upcomment(this.ids, "0")
          })
          .then(() => {
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
          })
      }
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getNotice(this.form.id).then((res) => {
                    let data = res.data.data
                    // data.forEach(item=>{
                    if (data.url.length > 0) {
                        var urls = []
                        var names = data.url.split(",")
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        data.url = urls.join(",")
                    }
                    data.articleList = JSON.parse(data.articleRange)
                    this.form = data
                })
            }
            // con
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const {
                dateTime
            } = this.query
            let values = {
                ...params,
            }
            if (dateTime) {
                values = {
                    ...params,
                    startTime: dateTime[0],
                    endTime: dateTime[1],
                    ...this.query,
                }
                values.dateTime = null
            }
            values.type = 5
            values.publish = 1
            this.loading = true
            console.log(values)
            getList(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.data.forEach(item => {
                    if (item.url.length > 0) {
                        var urls = []
                        var names = item.url.split(",")
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        item.url = urls.join(",")
                    }
                })
                this.loading = false
                this.selectionClear()
            })
            getDistrictTree(params = {}).then((res) => {
                const data = res.data.data
                this.districtTree = data
                const column = this.findObject(this.option.column, "articleList")
                column.dicData = res.data.data
                this.loading = false
            })
        },
        updateFb (row) {
            if (row.publish == "0") {
                row.publish = "1"
            } else {
                row.publish = "0"
            }
            if (row.url.length > 0) {
                var urls = []
                var split = row.url.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.url = urls.join(",")
            }
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        kqcomment () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据开启评论?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                return upcomment(this.ids, "1")
            })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        gbcomment () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据开启评论?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                return upcomment(this.ids, "0")
            })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        }
    },
  }
}
</script>
<style>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
</style>
src/views/propertySupervision/propertyCompanyDistrict.vue
@@ -1,398 +1,400 @@
<!-- 物业公司管理 -->
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <template slot="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompanyDistrict_delete"
          @click="handleDelete">删 除
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompanyDistrict_delete"
                    @click="handleDelete">删 除
                </el-button>
            </template>
        </avue-crud>
    </basic-container>
</template>
<script>
  import {
import {
    getList,
    remove,
    update,
    add,
    getPropertyCompanyDistrict
  } from "@/api/property/propertyCompanyDistrict"
  import {
} from "@/api/property/propertyCompanyDistrict"
import {
    mapGetters
  } from "vuex"
  import website from '@/config/website'
  import func from "@/util/func"
  export default {
    data() {
      //手机号格式校验
      let validatorPhone = function(rule, value, callback) {
        if (value) {
          if (!/^1[3456789]\d{9}$/.test(value)) {
            callback(new Error('手机号格式有误!'))
          } else {
} from "vuex"
import website from '@/config/website'
import func from "@/util/func"
export default {
    data () {
        //手机号格式校验
        let validatorPhone = function (rule, value, callback) {
            if (value) {
                if (!/^1[3456789]\d{9}$/.test(value)) {
                    callback(new Error('手机号格式有误!'))
                } else {
                    callback()
                }
            }
            callback()
          }
        }
        callback()
      }
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 120,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 210,
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 120,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 210,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 1150,
          tip: false,
          border: true,
          delBtn: false,
          editBtn: false,
          //stripe:true,
          index: true,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          column: [{
              overHidden: true,
              label: '小区名称',
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              prop: "districtName",
              search: true,
              searchSpan: 4,
              rules: [{
                required: true,
                message: "请输入小区名称",
                trigger: "blur",
              }],
            },
                height: "auto",
                calcHeight: 54,
                dialogWidth: 1150,
                tip: false,
                border: true,
                delBtn: false,
                editBtn: false,
                //stripe:true,
                index: true,
                viewBtn: true,
                selection: true,
                dialogClickModal: false,
                column: [{
                    overHidden: true,
                    label: '小区名称',
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    prop: "districtName",
                    search: true,
                    searchSpan: 4,
                    searchLabelWidth: 76,
                    rules: [{
                        required: true,
                        message: "请输入小区名称",
                        trigger: "blur",
                    }],
                },
            {
              hide: true,
              parent: false,
              label: "小区",
              prop: "districtId",
              search: false,
              type: 'tree',
              dicUrl: `/api/blade-district/district/getDistrictTree`,
              props: {
                label: "name",
                value: "id"
              },
              defaultExpandedKeys: ["361102003"],
              span: 12,
              width: 260,
              rules: [{
                required: true,
                message: "请选择小区",
                trigger: "blur",
              }, ],
            },
                {
                    hide: true,
                    parent: false,
                    label: "小区",
                    prop: "districtId",
                    search: false,
                    type: 'tree',
                    dicUrl: `/api/blade-district/district/getDistrictTree`,
                    props: {
                        label: "name",
                        value: "id"
                    },
                    defaultExpandedKeys: ["361102003"],
                    span: 12,
                    width: 260,
                    rules: [{
                        required: true,
                        message: "请选择小区",
                        trigger: "blur",
                    },],
                },
            {
              overHidden: true,
              label: "物业公司",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              prop: "propertyCompanyName",
              search: true,
              searchSpan: 4,
              rules: [{
                required: true,
                message: "请输入物业公司",
                trigger: "blur",
              }],
            },
                {
                    overHidden: true,
                    label: "物业公司",
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    prop: "propertyCompanyName",
                    search: true,
                    searchSpan: 4,
                    rules: [{
                        required: true,
                        message: "请输入物业公司",
                        trigger: "blur",
                    }],
                },
            {
              hide: true,
              label: '物业公司',
              prop: 'propertyCompanyId',
              type: 'tree',
              span: 12,
              dicUrl: `/api/blade-propertyCompany/propertyCompany/getPropertyCompanyList`,
              cascader: ['userId'],
              props: {
                label: "name",
                value: "id"
              },
              rules: [{
                required: true,
                message: '请选择物业公司',
                trigger: 'blur'
              }]
            },
            {
              width: 110,
              label: '项目经理',
              prop: 'principal',
              span: 12,
              search: true,
              searchSpan: 4,
              rules: [{
                required: true,
                message: "请输入项目经理",
                trigger: "blur",
              }, ],
            },
            {
              width: 120,
              label: '联系方式',
              prop: 'principalPhone',
              span: 12,
              rules: [{
                  required: true,
                  message: "请输入联系方式",
                  trigger: "blur",
                {
                    hide: true,
                    label: '物业公司',
                    prop: 'propertyCompanyId',
                    type: 'tree',
                    span: 12,
                    dicUrl: `/api/blade-propertyCompany/propertyCompany/getPropertyCompanyList`,
                    cascader: ['userId'],
                    props: {
                        label: "name",
                        value: "id"
                    },
                    rules: [{
                        required: true,
                        message: '请选择物业公司',
                        trigger: 'blur'
                    }]
                },
                {
                  validator: validatorPhone,
                  trigger: 'blur'
                }
              ],
                    width: 110,
                    label: '项目经理',
                    prop: 'principal',
                    span: 12,
                    search: true,
                    searchSpan: 4,
                    rules: [{
                        required: true,
                        message: "请输入项目经理",
                        trigger: "blur",
                    },],
                },
                {
                    width: 120,
                    label: '联系方式',
                    prop: 'principalPhone',
                    span: 12,
                    rules: [{
                        required: true,
                        message: "请输入联系方式",
                        trigger: "blur",
                    },
                    {
                        validator: validatorPhone,
                        trigger: 'blur'
                    }
                    ],
                },
                {
                    label: "物业成员",
                    prop: "userId",
                    span: 12,
                    type: "tree",
                    multiple: true,
                    remote: true,
                    props: {
                        label: 'name',
                        value: 'id'
                    },
                    hide: true,
                    dicUrl: `/api/blade-propertyCompany/propertyCompany/getUserByPropertyCompany?id={{propertyCompanyId}}`,
                },
                {
                    width: 100,
                    label: "物业阶段",
                    span: 12,
                    prop: "propertyStage",
                    type: "select",
                    search: true,
                    searchSpan: 4,
                    dataType: "number",
                    dicUrl: "/api/blade-system/dict-biz/dictionary?code=propertyStage",
                    props: {
                        label: "dictValue",
                        value: "dictKey",
                    },
                },
                {
                    width: 100,
                    label: "合同开始时间",
                    prop: "startTime",
                    span: 12,
                    type: "date",
                    format: "yyyy-MM-dd",
                    valueFormat: "yyyy-MM-dd",
                    rules: [{
                        required: true,
                        message: "请选择合同开始时间",
                        trigger: "blur",
                    },],
                },
                {
                    width: 100,
                    label: "合同结束时间",
                    prop: "endTime",
                    span: 12,
                    type: "date",
                    format: "yyyy-MM-dd",
                    valueFormat: "yyyy-MM-dd",
                    rules: [{
                        required: true,
                        message: "请选择合同结束时间",
                        trigger: "blur",
                    },],
                },
                ],
            },
            {
              label: "物业成员",
              prop: "userId",
              span: 12,
              type: "tree",
              multiple: true,
              remote: true,
              props: {
                label: 'name',
                value: 'id'
              },
              hide: true,
              dicUrl: `/api/blade-propertyCompany/propertyCompany/getUserByPropertyCompany?id={{propertyCompanyId}}`,
            },
            {
              width: 100,
              label: "物业阶段",
              span: 12,
              prop: "propertyStage",
              type: "select",
              search: true,
              searchSpan: 4,
              dataType: "number",
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=propertyStage",
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              width: 100,
              label: "合同开始时间",
              prop: "startTime",
              span: 12,
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              rules: [{
                required: true,
                message: "请选择合同开始时间",
                trigger: "blur",
              }, ],
            },
            {
              width: 100,
              label: "合同结束时间",
              prop: "endTime",
              span: 12,
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              rules: [{
                required: true,
                message: "请选择合同结束时间",
                trigger: "blur",
              }, ],
            },
          ],
        },
        data: [],
      }
            data: [],
        }
    },
    watch: {},
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.propertyCompanyDistrict_add, true),
          viewBtn: this.vaildData(this.permission.propertyCompanyDistrict_view, true),
          delBtn: this.vaildData(this.permission.propertyCompanyDistrict_delete, true),
          editBtn: this.vaildData(this.permission.propertyCompanyDistrict_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.propertyCompanyDistrict_add, true),
                viewBtn: this.vaildData(this.permission.propertyCompanyDistrict_view, true),
                delBtn: this.vaildData(this.permission.propertyCompanyDistrict_delete, true),
                editBtn: this.vaildData(this.permission.propertyCompanyDistrict_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
    },
    methods: {
      rowSave(row, done, loading) {
        row.userId = func.join(row.userId)
        add(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
        rowSave (row, done, loading) {
            row.userId = func.join(row.userId)
            add(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            row.userId = func.join(row.userId)
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowUpdate(row, index, done, loading) {
        row.userId = func.join(row.userId)
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getPropertyCompanyDistrict(this.form.id).then((res) => {
            this.form = res.data.data
          })
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getPropertyCompanyDistrict(this.form.id).then((res) => {
                    this.form = res.data.data
                })
            }
            // con
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const {
                dateTime
            } = this.query
            let values = {
                ...params,
            }
            if (dateTime) {
                values = {
                    ...params,
                    startTime: dateTime[0],
                    endTime: dateTime[1],
                    ...this.query,
                }
                values.dateTime = null
            }
            this.loading = true
            getList(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        }
        // con
        done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {
          dateTime
        } = this.query
        let values = {
          ...params,
        }
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          }
          values.dateTime = null
        }
        this.loading = true
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.loading = false
          this.selectionClear()
        })
      }
    }
  }
}
</script>
<style>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
</style>
src/views/propertySupervision/propertyEvaluation.vue
@@ -1,57 +1,58 @@
<!-- 物业公司管理 -->
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <template slot="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
          @click="handleDelete">删 除
        </el-button>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
                    @click="handleDelete">删 除
                </el-button>
      </template>
            </template>
      <template slot-scope="{row, size, index}" slot="menu">
        <el-button :size="size" v-if="permission.payInfo" type="text" icon="el-icon-circle-plus-outline"
          @click="openPayConfig(row)">商户配置
        </el-button>
            <template slot-scope="{row, size, index}" slot="menu">
                <el-button :size="size" v-if="permission.payInfo" type="text" icon="el-icon-circle-plus-outline"
                    @click="openPayConfig(row)">商户配置
                </el-button>
        <el-button :size="size" v-if="permission.property_evaluation" icon="el-icon-circle-plus-outline" type="text"
          @click="addProperty(row)">物业评定
        </el-button>
      </template>
    </avue-crud>
                <el-button :size="size" v-if="permission.property_evaluation" icon="el-icon-circle-plus-outline" type="text"
                    @click="addProperty(row)">物业评定
                </el-button>
            </template>
        </avue-crud>
    <el-dialog title="商户配置" append-to-body :visible.sync="payInfoVisible" top="10vh" width="70%">
      <el-tabs v-model="currentTab">
        <el-tab-pane label="微信商户配置" name="wxInfo">
          <avue-form ref="wxForm" :option="wxPayOption" v-model="wxPayForm" @submit="wxSubmit">
          </avue-form>
        </el-tab-pane>
        <el-tab-pane label="支付宝商户配置" name="second">
          <avue-form ref="aliForm" :option="aliPayOption" v-model="aliPayForm" @submit="aliSubmit">
          </avue-form>
        </el-tab-pane>
        <el-dialog title="商户配置" append-to-body :visible.sync="payInfoVisible" top="10vh" width="70%">
            <el-tabs v-model="currentTab">
                <el-tab-pane label="微信商户配置" name="wxInfo">
                    <avue-form ref="wxForm" :option="wxPayOption" v-model="wxPayForm" @submit="wxSubmit">
                    </avue-form>
                </el-tab-pane>
                <el-tab-pane label="支付宝商户配置" name="second">
                    <avue-form ref="aliForm" :option="aliPayOption" v-model="aliPayForm" @submit="aliSubmit">
                    </avue-form>
                </el-tab-pane>
      </el-tabs>
            </el-tabs>
      <!--      <div slot="footer" class="dialog-footer">-->
      <!--        <el-button @click="payInfoVisible = false">取 消</el-button>-->
      <!--        <el-button type="primary"@click="submit">提 交</el-button>-->
      <!--      </div>-->
            <!--      <div slot="footer" class="dialog-footer">-->
            <!--        <el-button @click="payInfoVisible = false">取 消</el-button>-->
            <!--        <el-button type="primary"@click="submit">提 交</el-button>-->
            <!--      </div>-->
    </el-dialog>
        </el-dialog>
    <!-- <propertyEdit ref="propertyEdit"></propertyEdit> -->
        <!-- <propertyEdit ref="propertyEdit"></propertyEdit> -->
  </basic-container>
    </basic-container>
</template>
<script>
  import {
import {
    getList,
    remove,
    update,
@@ -60,547 +61,547 @@
    getPayConfig,
    saveOrUpdateWx,
    saveOrUpdateAli
  } from "@/api/property/propertyCompany"
  import {
} from "@/api/property/propertyCompany"
import {
    mapGetters
  } from "vuex"
  import website from '@/config/website'
  import func from "@/util/func"
} from "vuex"
import website from '@/config/website'
import func from "@/util/func"
  // import propertyEdit from './components/propertyEdit.vue'
// import propertyEdit from './components/propertyEdit.vue'
  const labelWidth = 120
  export default {
const labelWidth = 120
export default {
    components: {
      // propertyEdit
        // propertyEdit
    },
    data() {
      return {
        currentTab: "wxInfo",
        payInfoVisible: false,
        currentRow: {},
    data () {
        return {
            currentTab: "wxInfo",
            payInfoVisible: false,
            currentRow: {},
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 120,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 280,
          menu: false,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 1150,
          tip: false,
          border: true,
          //stripe:true,
          index: true,
          // viewBtn: true,
          delBtn: false,
          selection: true,
          dialogClickModal: false,
          column: [{
              overHidden: true,
              label: "物业公司名称",
              prop: "name",
              searchSpan: 5,
              searchLabelWidth: 124,
              search: true,
              span: 18,
              row: true,
              width: 200,
              rules: [{
                required: true,
                message: "请输入物业公司名称",
                trigger: "blur",
              }, ],
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            {
              label: '省份',
              prop: 'province',
              type: 'select',
              props: {
                label: 'name',
                value: 'code'
              },
              hide: true,
              span: 6,
              cascader: ['city'],
              dicUrl: `/api/blade-system/region/select`,
              rules: [{
                required: true,
                message: '请选择省份',
                trigger: 'blur'
              }]
            },
            {
              label: '城市',
              prop: 'city',
              type: 'select',
              span: 6,
              labelWidth: 60,
              cascader: ['area'],
              props: {
                label: 'name',
                value: 'code'
              },
              hide: true,
              dicUrl: `/api/blade-system/region/select?code={{key}}`,
              rules: [{
                required: true,
                message: '请选择城市',
                trigger: 'blur'
              }]
            },
            {
              label: '地区',
              prop: 'area',
              type: 'select',
              span: 6,
              width: 260,
              props: {
                label: 'name',
                value: 'code'
              },
              hide: true,
              dicUrl: `/api/blade-system/region/select?code={{key}}`,
              rules: [{
                required: true,
                message: '请选择地区',
                trigger: 'blur'
              }]
            },
            {
              overHidden: true,
              label: "地址",
              prop: "address",
              span: 18,
              row: true,
              width: 160,
            },
            {
              label: "社会信用代码",
              prop: "socialCreditCode",
              searchSpan: 5,
              // searchLabelWidth: 124,
              search: true,
              span: 18,
              row: true,
              width: 100,
            },
            {
              label: "基础信息分",
              prop: "baseInfoScore",
              display: false,
            },
            {
              label: "经营信息分",
              prop: "operateinfoScore",
              display: false,
            },
            {
              label: "纳税信息分",
              prop: "taxInfoScore",
              display: false,
            },
            {
              label: "党建信息分",
              prop: "partyBuildingInfoScore",
              display: false,
            },
            {
              label: "企业良好信息分",
              prop: "goodCorporateScore",
              display: false,
            },
            {
              label: "项目良好信息分",
              prop: "goodCorporateScore",
              display: false,
            },
            {
              label: "违法违规行为分",
              prop: "goodCorporateScore",
              display: false,
            },
            {
              label: "评价平均分",
              prop: "evaluateScore",
              display: false,
            },
            {
              label: "街道社区分",
              prop: "streetScore",
              display: false,
            },
            {
              label: "总分",
              prop: "allScore",
              display: false,
            },
            {
              label: "简介",
              prop: "remark",
              component: "AvueUeditor",
              options: {
                action: "/api/blade-resource/oss/endpoint/put-file-attach",
                props: {
                  res: "data",
                  url: "link",
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 120,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 280,
                menu: false,
                height: "auto",
                calcHeight: 54,
                dialogWidth: 1150,
                tip: false,
                border: true,
                //stripe:true,
                index: true,
                // viewBtn: true,
                delBtn: false,
                selection: true,
                dialogClickModal: false,
                column: [{
                    overHidden: true,
                    label: "物业公司名称",
                    prop: "name",
                    searchSpan: 5,
                    searchLabelWidth: 104,
                    search: true,
                    span: 18,
                    row: true,
                    width: 200,
                    rules: [{
                        required: true,
                        message: "请输入物业公司名称",
                        trigger: "blur",
                    },],
                },
              },
              hide: true,
              minRows: 6,
              span: 24,
            },
          ],
        },
        data: [],
                {
                    label: '省份',
                    prop: 'province',
                    type: 'select',
                    props: {
                        label: 'name',
                        value: 'code'
                    },
                    hide: true,
                    span: 6,
                    cascader: ['city'],
                    dicUrl: `/api/blade-system/region/select`,
                    rules: [{
                        required: true,
                        message: '请选择省份',
                        trigger: 'blur'
                    }]
                },
                {
                    label: '城市',
                    prop: 'city',
                    type: 'select',
                    span: 6,
                    labelWidth: 60,
                    cascader: ['area'],
                    props: {
                        label: 'name',
                        value: 'code'
                    },
                    hide: true,
                    dicUrl: `/api/blade-system/region/select?code={{key}}`,
                    rules: [{
                        required: true,
                        message: '请选择城市',
                        trigger: 'blur'
                    }]
                },
                {
                    label: '地区',
                    prop: 'area',
                    type: 'select',
                    span: 6,
                    width: 260,
                    props: {
                        label: 'name',
                        value: 'code'
                    },
                    hide: true,
                    dicUrl: `/api/blade-system/region/select?code={{key}}`,
                    rules: [{
                        required: true,
                        message: '请选择地区',
                        trigger: 'blur'
                    }]
                },
                {
                    overHidden: true,
                    label: "地址",
                    prop: "address",
                    span: 18,
                    row: true,
                    width: 160,
                },
                {
                    label: "社会信用代码",
                    prop: "socialCreditCode",
                    searchSpan: 5,
                    searchLabelWidth: 124,
                    search: true,
                    span: 18,
                    row: true,
                    width: 100,
        wxPayForm: {},
        wxPayOption: {
          emptyBtn: false,
          height: "auto",
          calcHeight: 180,
          //stripe:true,
          column: [{
              label: "appId",
              labelWidth: labelWidth,
              prop: "appId",
              span: 24,
              rules: [{
                required: true,
                message: "请输入appId",
                trigger: ["blur", "change"]
              }, ],
            },
            {
              label: "mch-id",
              labelWidth: labelWidth,
              prop: "mchId",
              span: 24,
              rules: [{
                required: true,
                message: "请输入mch-id",
                trigger: ["blur", "change"]
              }, ],
            },
            {
              label: "mchKey",
              labelWidth: labelWidth,
              prop: "mchKey",
              rules: [{
                required: true,
                message: "请输入mchKey",
                trigger: ["blur", "change"]
              }, ],
              span: 24,
            },
            {
              label: "appSecret",
              labelWidth: labelWidth,
              prop: "appSecret",
              rules: [{
                required: true,
                message: "请输入appSecret",
                trigger: ["blur", "change"]
              }, ],
              span: 24,
            },
            {
              label: '安全证书',
              labelWidth: labelWidth,
              prop: 'keyPath',
              type: 'upload',
              drag: true,
              limit: 1,
              loadText: '上传中,请稍等',
              span: 24,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: 'name',
                url: "link",
              },
              rules: [{
                required: true,
                message: "请上传安全证书",
                trigger: ["blur", "change"]
              }, ],
            },
          ],
        },
                },
                {
                    label: "基础信息分",
                    prop: "baseInfoScore",
                    display: false,
                },
                {
                    label: "经营信息分",
                    prop: "operateinfoScore",
                    display: false,
                },
                {
                    label: "纳税信息分",
                    prop: "taxInfoScore",
                    display: false,
                },
                {
                    label: "党建信息分",
                    prop: "partyBuildingInfoScore",
                    display: false,
                },
                {
                    label: "企业良好信息分",
                    prop: "goodCorporateScore",
                    display: false,
                },
                {
                    label: "项目良好信息分",
                    prop: "goodCorporateScore",
                    display: false,
                },
                {
                    label: "违法违规行为分",
                    prop: "goodCorporateScore",
                    display: false,
                },
                {
                    label: "评价平均分",
                    prop: "evaluateScore",
                    display: false,
                },
                {
                    label: "街道社区分",
                    prop: "streetScore",
                    display: false,
                },
                {
                    label: "总分",
                    prop: "allScore",
                    display: false,
                },
        aliPayForm: {},
        aliPayOption: {
          emptyBtn: false,
          height: "auto",
          calcHeight: 180,
          //stripe:true,
          column: [{
              label: "appId",
              labelWidth: labelWidth,
              prop: "appId",
              span: 24,
              rules: [{
                required: true,
                message: "请输入appId",
                trigger: ["blur", "change"]
              }, ],
                {
                    label: "简介",
                    prop: "remark",
                    component: "AvueUeditor",
                    options: {
                        action: "/api/blade-resource/oss/endpoint/put-file-attach",
                        props: {
                            res: "data",
                            url: "link",
                        },
                    },
                    hide: true,
                    minRows: 6,
                    span: 24,
                },
                ],
            },
            {
              label: "privateKey",
              labelWidth: labelWidth,
              prop: "privateKey",
              span: 24,
              rules: [{
                required: true,
                message: "请输入privateKey",
                trigger: ["blur", "change"]
              }, ],
            data: [],
            wxPayForm: {},
            wxPayOption: {
                emptyBtn: false,
                height: "auto",
                calcHeight: 180,
                //stripe:true,
                column: [{
                    label: "appId",
                    labelWidth: labelWidth,
                    prop: "appId",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入appId",
                        trigger: ["blur", "change"]
                    },],
                },
                {
                    label: "mch-id",
                    labelWidth: labelWidth,
                    prop: "mchId",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入mch-id",
                        trigger: ["blur", "change"]
                    },],
                },
                {
                    label: "mchKey",
                    labelWidth: labelWidth,
                    prop: "mchKey",
                    rules: [{
                        required: true,
                        message: "请输入mchKey",
                        trigger: ["blur", "change"]
                    },],
                    span: 24,
                },
                {
                    label: "appSecret",
                    labelWidth: labelWidth,
                    prop: "appSecret",
                    rules: [{
                        required: true,
                        message: "请输入appSecret",
                        trigger: ["blur", "change"]
                    },],
                    span: 24,
                },
                {
                    label: '安全证书',
                    labelWidth: labelWidth,
                    prop: 'keyPath',
                    type: 'upload',
                    drag: true,
                    limit: 1,
                    loadText: '上传中,请稍等',
                    span: 24,
                    action: "/api/blade-resource/oss/endpoint/put-file",
                    propsHttp: {
                        res: "data",
                        name: 'name',
                        url: "link",
                    },
                    rules: [{
                        required: true,
                        message: "请上传安全证书",
                        trigger: ["blur", "change"]
                    },],
                },
                ],
            },
            {
              label: "publicKey",
              labelWidth: labelWidth,
              prop: "publicKey",
              span: 24,
              rules: [{
                required: true,
                message: "请输入publicKey",
                trigger: ["blur", "change"]
              }, ],
            },
          ],
            aliPayForm: {},
            aliPayOption: {
                emptyBtn: false,
                height: "auto",
                calcHeight: 180,
                //stripe:true,
                column: [{
                    label: "appId",
                    labelWidth: labelWidth,
                    prop: "appId",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入appId",
                        trigger: ["blur", "change"]
                    },],
                },
                {
                    label: "privateKey",
                    labelWidth: labelWidth,
                    prop: "privateKey",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入privateKey",
                        trigger: ["blur", "change"]
                    },],
                },
                {
                    label: "publicKey",
                    labelWidth: labelWidth,
                    prop: "publicKey",
                    span: 24,
                    rules: [{
                        required: true,
                        message: "请输入publicKey",
                        trigger: ["blur", "change"]
                    },],
                },
                ],
            }
        }
      }
    },
    watch: {},
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.propertyCompany_add, true),
          viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
          delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
          editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.propertyCompany_add, true),
                viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
                delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
                editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
    },
    created() {},
    created () { },
    methods: {
      addProperty(row) {
        this.$refs.propertyEdit.init(row);
      },
        addProperty (row) {
            this.$refs.propertyEdit.init(row)
        },
      aliSubmit(form, done) {
        aliSubmit (form, done) {
        console.log("支付宝商户配置", this.aliPayForm)
            console.log("支付宝商户配置", this.aliPayForm)
        this.aliPayForm.propertyCompanyId = this.currentRow.id
        saveOrUpdateAli(this.aliPayForm).then(res => {
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          done()
        })
      },
      wxSubmit(form, done) {
        this.wxPayForm.propertyCompanyId = this.currentRow.id
        this.wxPayForm.keyPath = func.join(this.wxPayForm.keyPath)
        if (this.wxPayForm.keyPath.length > 0) {
          var urls = []
          var split = this.wxPayForm.keyPath.split(",")
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          this.wxPayForm.keyPath = urls.join(",")
        }
        console.log("微信商户配置", this.wxPayForm)
        saveOrUpdateWx(this.wxPayForm).then(res => {
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          done()
        })
      },
      openPayConfig(row) {
        this.currentRow = row
        //调接口获取商户数据
        getPayConfig(row.id).then(res => {
          let data = res.data.data
          this.wxPayForm = data.wxPayInfo ? data.wxPayInfo : {}
          this.aliPayForm = data.aliPayInfo ? data.aliPayInfo : {}
        })
        this.payInfoVisible = !this.payInfoVisible
      },
      rowSave(row, done, loading) {
        row.userid = this.userInfo.user_id
        add(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            this.aliPayForm.propertyCompanyId = this.currentRow.id
            saveOrUpdateAli(this.aliPayForm).then(res => {
                this.$message({
                    type: "success",
                    message: "操作成功!",
                })
                done()
            })
        },
        wxSubmit (form, done) {
            this.wxPayForm.propertyCompanyId = this.currentRow.id
            this.wxPayForm.keyPath = func.join(this.wxPayForm.keyPath)
            if (this.wxPayForm.keyPath.length > 0) {
                var urls = []
                var split = this.wxPayForm.keyPath.split(",")
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                this.wxPayForm.keyPath = urls.join(",")
            }
            console.log("微信商户配置", this.wxPayForm)
            saveOrUpdateWx(this.wxPayForm).then(res => {
                this.$message({
                    type: "success",
                    message: "操作成功!",
                })
                done()
            })
        },
        openPayConfig (row) {
            this.currentRow = row
            //调接口获取商户数据
            getPayConfig(row.id).then(res => {
                let data = res.data.data
                this.wxPayForm = data.wxPayInfo ? data.wxPayInfo : {}
                this.aliPayForm = data.aliPayInfo ? data.aliPayInfo : {}
            })
            this.payInfoVisible = !this.payInfoVisible
        },
        rowSave (row, done, loading) {
            row.userid = this.userInfo.user_id
            add(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getPropertyCompany(this.form.id).then((res) => {
            this.form = res.data.data
          })
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getPropertyCompany(this.form.id).then((res) => {
                    this.form = res.data.data
                })
            }
            // con
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const {
                dateTime
            } = this.query
            let values = {
                ...params,
            }
            if (dateTime) {
                values = {
                    ...params,
                    startTime: dateTime[0],
                    endTime: dateTime[1],
                    ...this.query,
                }
                values.dateTime = null
            }
            this.loading = true
            getList(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        }
        // con
        done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {
          dateTime
        } = this.query
        let values = {
          ...params,
        }
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          }
          values.dateTime = null
        }
        this.loading = true
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.loading = false
          this.selectionClear()
        })
      }
    }
  }
}
</script>
<style>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
</style>
src/views/propertySupervision/residentSupervision.vue
@@ -223,7 +223,7 @@
                        label: "姓名",
                        prop: "name",
                        searchSpan: 3,
                        searchLabelWidth: 66,
                        searchLabelWidth: 50,
                        search: true,
                        rules: [{
                            required: true,
src/views/publicSecurity/bailReporting.vue
@@ -1,47 +1,50 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
      <template slot-scope="{row, size, index}" slot="menu">
        <el-button :size="size" type="text" icon="el-icon-view"  v-if="permission.bail_view"  plain @click="lookDetail(row, 0)">查 看
        </el-button>
        <el-button :size="size" type="text" icon="el-icon-s-check" v-if="row.status == 1 && permission.bail_check" plain
          @click="lookDetail(row, 1)">审 核
        </el-button>
        <el-button :size="size" type="text" icon="el-icon-delete" v-if="permission.bail_del"   plain @click="rowDel(row)">删 除
        </el-button>
      </template>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot-scope="{row, size, index}" slot="menu">
                <el-button :size="size" type="text" icon="el-icon-view" v-if="permission.bail_view" plain
                    @click="lookDetail(row, 0)">查 看
                </el-button>
                <el-button :size="size" type="text" icon="el-icon-s-check" v-if="row.status == 1 && permission.bail_check"
                    plain @click="lookDetail(row, 1)">审 核
                </el-button>
                <el-button :size="size" type="text" icon="el-icon-delete" v-if="permission.bail_del" plain
                    @click="rowDel(row)">删 除
                </el-button>
            </template>
      <template slot="status" slot-scope="{row, size}">
        <el-tag :size="size" :type="showStatus(row.status).type">
          {{ showStatus(row.status).text }}
        </el-tag>
      </template>
    </avue-crud>
            <template slot="status" slot-scope="{row, size}">
                <el-tag :size="size" :type="showStatus(row.status).type">
                    {{ showStatus(row.status).text }}
                </el-tag>
            </template>
        </avue-crud>
    <el-dialog class="place-info-box audit-info-box" title="" append-to-body :visible.sync="auditBasePopup" width="60%">
      <bailReportingDetail @colseDetail="colseDetail" ref="bailReportingDetail"></bailReportingDetail>
    </el-dialog>
  </basic-container>
        <el-dialog class="place-info-box audit-info-box" title="" append-to-body :visible.sync="auditBasePopup" width="60%">
            <bailReportingDetail @colseDetail="colseDetail" ref="bailReportingDetail"></bailReportingDetail>
        </el-dialog>
    </basic-container>
</template>
<script>
import {
  getBailReportingPage,
  removeTask,
  update,
  add,
    getBailReportingPage,
    removeTask,
    update,
    add,
} from "@/api/task/task"
import {
  update as bailReportingUpdate,
  getList as bailReportingGetList
    update as bailReportingUpdate,
    getList as bailReportingGetList
} from "@/api/task/bailReporting"
import {
  mapGetters
    mapGetters
} from "vuex"
import website from '@/config/website'
@@ -50,450 +53,449 @@
// import baseAllInfo from './components/baseAllInfo'
export default {
  data() {
    data () {
    //手机号格式校验
    let validatorPhone = function (rule, value, callback) {
      if (value) {
        if (!/^1[3456789]\d{9}$/.test(value)) {
          callback(new Error('手机号格式有误!'))
        } else {
          callback()
        }
      }
      callback()
    }
    return {
      curRow: {},
      roleBox: false,
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      datetime: "",
      selectionList: [],
      option: {
        labelWidth: 96,
        searchLabelWidth: 96,
        searchShow: true,
        searchMenuSpan: 3,
        menuWidth: 210,
        height: "auto",
        calcHeight: 54,
        dialogWidth: 950,
        tip: false,
        border: true,
        // menu: false,
        //stripe:true,
        index: true,
        // viewBtn: true,
        delBtn: false,
        editBtn: false,
        selection: true,
        dialogClickModal: false,
        column: [{
          span: 12,
          label: "社区",
          prop: "communityName",
          searchSpan: 4,
          searchLabelWidth: 66,
          search: true,
          hide: true,
        },
        {
          span: 12,
          label: "小区",
          prop: "districtName",
          searchSpan: 4,
          searchLabelWidth: 66,
          search: true,
          hide: true,
        },
        {
          width: 100,
          span: 12,
          label: "姓名",
          prop: "realName",
          searchSpan: 3,
          searchLabelWidth: 66,
          search: true,
        }, {
          width: 120,
          span: 12,
          label: "联系方式",
          prop: "phone",
          searchSpan: 4,
          search: true,
          rules: [{
            validator: validatorPhone,
            trigger: 'blur'
          }],
        }, {
          span: 12,
          label: "外出事由",
          prop: "applyName",
          searchSpan: 4,
          search: true,
        },
        {
          width: 110,
          label: "所属街道",
          // hide: true,
          searchSpan: 4,
          // search: true,
          parent: false,
          prop: "streetCode",
          type: "tree",
          dicUrl: "/api/blade-system/region/getTownTree",
          props: {
            label: "name",
            value: "id"
          },
          rules: [{
            required: true,
            message: "请选择所属街道",
            trigger: "blur",
          },],
        }, {
          width: 156,
          // hide: true,
          parent: false,
          searchSpan: 4,
          label: "所属社区",
          prop: "neiCode",
          // search: true,
          type: "tree",
          dicUrl: "/api/blade-system/region/tree",
          props: {
            label: "name",
            value: "id",
          },
          cascader: ["gridId"],
          rules: [{
            required: true,
            message: "请选择所属社区",
            trigger: "blur",
          },],
        }, {
          width: 220,
          overHidden: true,
          label: "小区",
          prop: "aoiCode",
          searchSpan: 4,
          type: 'tree',
          searchLabelWidth: 66,
          // search: true,
          parent: false,
          dicUrl: `/api/blade-district/district/getDistrictTree`,
          props: {
            label: "name",
            value: "aoiCode"
          },
          // defaultExpandedKeys: ["361102003"],
          span: 12,
          rules: [{
            required: true,
            message: "请选择小区",
            trigger: "blur",
          },],
          // disabled: true
          display: true,
          // hide: true,
        },
        // {
        //   width: 144,
        //   label: "创建时间",
        //   prop: "createTime",
        //   searchSpan: 4,
        // },
        {
          width: 100,
          addDisplay: false,
          editDisplay: false,
          viewDisplay: false,
          label: '审核状态',
          prop: 'status',
          type: 'radio',
          slot: true,
          dicData: [{
            label: '待审核',
            value: 1
          }, {
            label: '已审核',
            value: 2
          }, {
            label: '未通过',
            value: 3
          }]
        },
        ],
      },
      data: [],
      auditBasePopup: false,
    }
  },
  provide() {
    return {
      placeElement: this,
    }
  },
  components: {
    bailReportingDetail,
  },
  watch: {},
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
         console.log("permission===>",this.permission);
      return {
        addBtn: this.vaildData(this.permission.bail_add, false),
        viewBtn: this.vaildData(this.permission.bail_view, true),
        delBtn: this.vaildData(this.permission.bail_del, true),
        // editBtn: this.vaildData(this.permission.place_edit, true),
      }
    },
    ids() {
      let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id)
      })
      return ids.join(",")
    },
    showStatus() {
      return (data) => {
        let tags = {}
        if (data == 1) {
          tags = {
            type: 'warning',
            text: '待审核'
          }
        } else if (data == 2) {
          tags = {
            type: 'success',
            text: '已审核'
          }
        } else if (data == 3) {
          tags = {
            type: 'danger',
            text: '未通过'
          }
        //手机号格式校验
        let validatorPhone = function (rule, value, callback) {
            if (value) {
                if (!/^1[3456789]\d{9}$/.test(value)) {
                    callback(new Error('手机号格式有误!'))
                } else {
                    callback()
                }
            }
            callback()
        }
        return tags
      }
    }
  },
  methods: {
    colseDetail() {
      this.auditBasePopup = false
      this.onLoad(this.page)
    },
    lookDetail(row, applyType) {
      this.auditBasePopup = true
      var that = this
      this.$nextTick(() => {
        that.$refs.bailReportingDetail.init(row, applyType)
      })
    },
    auditCur(row) {
      this.curAuditRow = row
      this.auditBasePopup = true
    },
        return {
            curRow: {},
            roleBox: false,
    roleBoxClose() {
      this.curRow = {}
    },
            form: {},
            query: {},
            loading: true,
    ManageTenants(item) {
      this.curRow = item
      this.roleBox = true
    },
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 210,
    rowSave(row, done, loading) {
      if (row.imageUrls.length > 0) {
        var urls = []
        var split = row.imageUrls.split(",").filter(item => item != '')
        split.forEach(url => {
          var names = url.split("jczz/")
          urls.push(names[1])
        })
        row.imageUrls = urls.join(",")
      }
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                border: true,
                // menu: false,
                //stripe:true,
                index: true,
                // viewBtn: true,
                delBtn: false,
                editBtn: false,
                selection: true,
                dialogClickModal: false,
                column: [{
                    span: 12,
                    label: "社区",
                    prop: "communityName",
                    searchSpan: 4,
                    searchLabelWidth: 46,
                    search: true,
                    hide: true,
                },
                {
                    span: 12,
                    label: "小区",
                    prop: "districtName",
                    searchSpan: 4,
                    searchLabelWidth: 66,
                    search: true,
                    hide: true,
                },
                {
                    width: 100,
                    span: 12,
                    label: "姓名",
                    prop: "realName",
                    searchSpan: 3,
                    searchLabelWidth: 66,
                    search: true,
                }, {
                    width: 120,
                    span: 12,
                    label: "联系方式",
                    prop: "phone",
                    searchSpan: 4,
                    search: true,
                    rules: [{
                        validator: validatorPhone,
                        trigger: 'blur'
                    }],
                }, {
                    span: 12,
                    label: "外出事由",
                    prop: "applyName",
                    searchSpan: 4,
                    search: true,
                },
                {
                    width: 110,
                    label: "所属街道",
                    // hide: true,
                    searchSpan: 4,
                    // search: true,
                    parent: false,
                    prop: "streetCode",
                    type: "tree",
                    dicUrl: "/api/blade-system/region/getTownTree",
                    props: {
                        label: "name",
                        value: "id"
                    },
                    rules: [{
                        required: true,
                        message: "请选择所属街道",
                        trigger: "blur",
                    },],
                }, {
                    width: 156,
                    // hide: true,
                    parent: false,
                    searchSpan: 4,
                    label: "所属社区",
                    prop: "neiCode",
                    // search: true,
                    type: "tree",
                    dicUrl: "/api/blade-system/region/tree",
                    props: {
                        label: "name",
                        value: "id",
                    },
                    cascader: ["gridId"],
                    rules: [{
                        required: true,
                        message: "请选择所属社区",
                        trigger: "blur",
                    },],
                }, {
                    width: 220,
                    overHidden: true,
                    label: "小区",
                    prop: "aoiCode",
                    searchSpan: 4,
                    type: 'tree',
                    searchLabelWidth: 66,
                    // search: true,
                    parent: false,
                    dicUrl: `/api/blade-district/district/getDistrictTree`,
                    props: {
                        label: "name",
                        value: "aoiCode"
                    },
                    // defaultExpandedKeys: ["361102003"],
                    span: 12,
                    rules: [{
                        required: true,
                        message: "请选择小区",
                        trigger: "blur",
                    },],
                    // disabled: true
                    display: true,
                    // hide: true,
                },
                // {
                //   width: 144,
                //   label: "创建时间",
                //   prop: "createTime",
                //   searchSpan: 4,
                // },
                {
                    width: 100,
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    label: '审核状态',
                    prop: 'status',
                    type: 'radio',
                    slot: true,
                    dicData: [{
                        label: '待审核',
                        value: 1
                    }, {
                        label: '已审核',
                        value: 2
                    }, {
                        label: '未通过',
                        value: 3
                    }]
                },
      let label = row.label
      if (row.smallLabel != '') {
        label = label + ',' + row.smallLabel
      }
                ],
            },
            data: [],
      delete row.smallLabel
      add({
        ...row,
        label
      }).then(
        () => {
          this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          done()
        },
        (error) => {
          window.console.log(error)
          loading()
            auditBasePopup: false,
        }
      )
    },
    rowUpdate(row, index, done, loading) {
      bailReportingUpdate({
        ...row
      }).then(
        () => {
          this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          done()
        },
        (error) => {
          window.console.log(error)
          loading()
    provide () {
        return {
            placeElement: this,
        }
      )
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          row.isDeleted = 1
          return removeTask(row)
        })
        .then(() => {
          this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          })
        })
    },
    searchReset() {
      this.query = {}
      this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params
      this.page.currentPage = 1
      this.onLoad(this.page, params)
      done()
    },
    selectionChange(list) {
      this.selectionList = list
    },
    selectionClear() {
      this.selectionList = []
      this.$nextTick(() => {
        this.$refs.crud && this.$refs.crud.toggleSelection()
      })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据")
        return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          this.$refs.crud.toggleSelection()
        })
    components: {
        bailReportingDetail,
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) { } else {
        done()
      }
    },
    watch: {},
    currentChange(currentPage) {
      this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      const {
        dateTime
      } = this.query
      let values = {
        ...params,
      }
      values.reportType = 1
      this.loading = true
      getBailReportingPage(page.currentPage, page.pageSize, values).then((res) => {
        const data = res.data.data
        this.page.total = data.total
        this.data = data.records
        this.data.forEach(item => {
          if (item.imageUrls && item.imageUrls != '' && item.imageUrls != null && item.imageUrls.length) {
            var urls = []
            var names = item.imageUrls.split(",").filter(item => item != '')
            names.forEach(name => {
              urls.push(website.minioUrl + name)
    computed: {
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            console.log("permission===>", this.permission)
            return {
                addBtn: this.vaildData(this.permission.bail_add, false),
                viewBtn: this.vaildData(this.permission.bail_view, true),
                delBtn: this.vaildData(this.permission.bail_del, true),
                // editBtn: this.vaildData(this.permission.place_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            item.imageUrls = urls.join(",")
          }
        })
        this.loading = false
        this.selectionClear()
      })
            return ids.join(",")
        },
        showStatus () {
            return (data) => {
                let tags = {}
                if (data == 1) {
                    tags = {
                        type: 'warning',
                        text: '待审核'
                    }
                } else if (data == 2) {
                    tags = {
                        type: 'success',
                        text: '已审核'
                    }
                } else if (data == 3) {
                    tags = {
                        type: 'danger',
                        text: '未通过'
                    }
                }
                return tags
            }
        }
    },
    methods: {
        colseDetail () {
            this.auditBasePopup = false
            this.onLoad(this.page)
        },
        lookDetail (row, applyType) {
            this.auditBasePopup = true
            var that = this
            this.$nextTick(() => {
                that.$refs.bailReportingDetail.init(row, applyType)
            })
        },
        auditCur (row) {
            this.curAuditRow = row
            this.auditBasePopup = true
        },
        roleBoxClose () {
            this.curRow = {}
        },
        ManageTenants (item) {
            this.curRow = item
            this.roleBox = true
        },
        rowSave (row, done, loading) {
            if (row.imageUrls.length > 0) {
                var urls = []
                var split = row.imageUrls.split(",").filter(item => item != '')
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.imageUrls = urls.join(",")
            }
            let label = row.label
            if (row.smallLabel != '') {
                label = label + ',' + row.smallLabel
            }
            delete row.smallLabel
            add({
                ...row,
                label
            }).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            bailReportingUpdate({
                ...row
            }).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    row.isDeleted = 1
                    return removeTask(row)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$nextTick(() => {
                this.$refs.crud && this.$refs.crud.toggleSelection()
            })
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    // return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) { } else {
                done()
            }
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const {
                dateTime
            } = this.query
            let values = {
                ...params,
            }
            values.reportType = 1
            this.loading = true
            getBailReportingPage(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.data.forEach(item => {
                    if (item.imageUrls && item.imageUrls != '' && item.imageUrls != null && item.imageUrls.length) {
                        var urls = []
                        var names = item.imageUrls.split(",").filter(item => item != '')
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        item.imageUrls = urls.join(",")
                    }
                })
                this.loading = false
                this.selectionClear()
            })
        }
    }
  }
}
</script>
<style>
.avue-upload__icon {
  line-height: 6;
}
</style>
    line-height: 6;
}</style>
src/views/publicSecurity/keynotePlaceManage.vue
@@ -1,574 +1,575 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
      <template slot-scope="{row, size}" slot="menu">
        <el-button type="text" :size="size" icon="el-icon-view" v-if="permission.place_view" plain
          @click="lookDetail(row, 0)">查 看
        </el-button>
        <el-button type="text" :size="size" icon="el-icon-s-check" v-if="permission.place_check && row.status == 1"
          plain @click="lookDetail(row, 1)">审 核
        </el-button>
        <el-button type="text" :size="size" icon="el-icon-delete" v-if="permission.place_del" plain
          @click="rowDel(row)">删 除
        </el-button>
      </template>
            <template slot-scope="{row, size}" slot="menu">
                <el-button type="text" :size="size" icon="el-icon-view" v-if="permission.place_view" plain
                    @click="lookDetail(row, 0)">查 看
                </el-button>
                <el-button type="text" :size="size" icon="el-icon-s-check" v-if="permission.place_check && row.status == 1"
                    plain @click="lookDetail(row, 1)">审 核
                </el-button>
                <el-button type="text" :size="size" icon="el-icon-delete" v-if="permission.place_del" plain
                    @click="rowDel(row)">删 除
                </el-button>
            </template>
      <template slot="status" slot-scope="{row, size}">
        <el-tag :size="size" :type="showStatus(row.status).type">
          {{ showStatus(row.status).text }}
        </el-tag>
      </template>
            <template slot="status" slot-scope="{row, size}">
                <el-tag :size="size" :type="showStatus(row.status).type">
                    {{ showStatus(row.status).text }}
                </el-tag>
            </template>
    </avue-crud>
        </avue-crud>
    <el-dialog title="" append-to-body :visible.sync="auditBasePopup" width="60%">
      <campusReporting @colseDetail="colseDetail" v-if="taskType == 6" ref="campusReporting"></campusReporting>
      <hotelReporting @colseDetail="colseDetail" v-if="taskType == 2" ref="hotelReporting"></hotelReporting>
      <labelReporting @colseDetail="colseDetail" v-if="taskType == 3" ref="labelReporting"></labelReporting>
    </el-dialog>
  </basic-container>
        <el-dialog title="" append-to-body :visible.sync="auditBasePopup" width="60%">
            <campusReporting @colseDetail="colseDetail" v-if="taskType == 6" ref="campusReporting"></campusReporting>
            <hotelReporting @colseDetail="colseDetail" v-if="taskType == 2" ref="hotelReporting"></hotelReporting>
            <labelReporting @colseDetail="colseDetail" v-if="taskType == 3" ref="labelReporting"></labelReporting>
        </el-dialog>
    </basic-container>
</template>
<script>
  import {
import {
    getList,
    removeTask,
    update,
    add,
  } from "@/api/task/task"
} from "@/api/task/task"
  import {
import {
    mapGetters
  } from "vuex"
} from "vuex"
  import website from '@/config/website'
  import campusReporting from './components/campusReporting'
  import hotelReporting from './components/hotelReporting'
  import labelReporting from './components/labelReporting'
import website from '@/config/website'
import campusReporting from './components/campusReporting'
import hotelReporting from './components/hotelReporting'
import labelReporting from './components/labelReporting'
  export default {
    data() {
export default {
    data () {
      //手机号格式校验
      let validatorPhone = function(rule, value, callback) {
        if (value) {
          if (!/^1[3456789]\d{9}$/.test(value)) {
            callback(new Error('手机号格式有误!'))
          } else {
        //手机号格式校验
        let validatorPhone = function (rule, value, callback) {
            if (value) {
                if (!/^1[3456789]\d{9}$/.test(value)) {
                    callback(new Error('手机号格式有误!'))
                } else {
                    callback()
                }
            }
            callback()
          }
        }
        callback()
      }
      return {
        taskType: 0,
        curRow: {},
        roleBox: false,
        return {
            taskType: 0,
            curRow: {},
            roleBox: false,
        form: {},
        query: {},
        loading: true,
            form: {},
            query: {},
            loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 96,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 210,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          // menu: false,
          border: true,
          //stripe:true,
          index: true,
          // viewBtn: true,
          editBtn: false,
          delBtn: false,
          selection: true,
          dialogClickModal: false,
          column: [{
              span: 12,
              label: "社区",
              prop: "communityName",
              searchSpan: 4,
              searchLabelWidth: 66,
              search: true,
              hide: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            {
              width: 110,
              span: 12,
              label: "场所负责人",
              prop: "realName",
              searchSpan: 4,
              searchLabelWidth: 100,
              search: true,
            }, {
              width: 120,
              span: 12,
              label: "联系方式",
              prop: "phone",
              searchSpan: 4,
              search: true,
              rules: [{
                validator: validatorPhone,
                trigger: 'blur'
              }],
            }, {
              overHidee: true,
              span: 12,
              label: "地址",
              prop: "addressName",
              searchSpan: 4,
              // search: true,
              rules: [{
                required: true,
                message: "请输入地址",
                trigger: "blur",
              }, ],
            }, {
              width: 110,
              label: "所属街道",
              // hide: true,
              // search: true,
              parent: false,
              searchSpan: 4,
              prop: "streetCode",
              type: "tree",
              dicUrl: "/api/blade-system/region/getTownTree",
              props: {
                label: "name",
                value: "id"
              },
              rules: [{
                required: true,
                message: "请选择所属街道",
                trigger: "blur",
              }, ],
            }, {
              width: 156,
              // hide: true,
              parent: false,
              searchSpan: 4,
              label: "所属社区",
              prop: "neiCode",
              // search: false,
              type: "tree",
              dicUrl: "/api/blade-system/region/tree",
              props: {
                label: "name",
                value: "id",
              },
              rules: [{
                required: true,
                message: "请选择所属社区",
                trigger: "blur",
              }, ],
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 210,
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                // menu: false,
                border: true,
                //stripe:true,
                index: true,
                // viewBtn: true,
                editBtn: false,
                delBtn: false,
                selection: true,
                dialogClickModal: false,
                column: [{
                    span: 12,
                    label: "社区",
                    prop: "communityName",
                    searchSpan: 4,
                    searchLabelWidth: 46,
                    search: true,
                    hide: true,
                },
                {
                    width: 110,
                    span: 12,
                    label: "场所负责人",
                    prop: "realName",
                    searchSpan: 4,
                    searchLabelWidth: 100,
                    search: true,
                }, {
                    width: 120,
                    span: 12,
                    label: "联系方式",
                    prop: "phone",
                    searchSpan: 4,
                    search: true,
                    rules: [{
                        validator: validatorPhone,
                        trigger: 'blur'
                    }],
                }, {
                    overHidee: true,
                    span: 12,
                    label: "地址",
                    prop: "addressName",
                    searchSpan: 4,
                    // search: true,
                    rules: [{
                        required: true,
                        message: "请输入地址",
                        trigger: "blur",
                    },],
                }, {
                    width: 110,
                    label: "所属街道",
                    // hide: true,
                    // search: true,
                    parent: false,
                    searchSpan: 4,
                    prop: "streetCode",
                    type: "tree",
                    dicUrl: "/api/blade-system/region/getTownTree",
                    props: {
                        label: "name",
                        value: "id"
                    },
                    rules: [{
                        required: true,
                        message: "请选择所属街道",
                        trigger: "blur",
                    },],
                }, {
                    width: 156,
                    // hide: true,
                    parent: false,
                    searchSpan: 4,
                    label: "所属社区",
                    prop: "neiCode",
                    // search: false,
                    type: "tree",
                    dicUrl: "/api/blade-system/region/tree",
                    props: {
                        label: "name",
                        value: "id",
                    },
                    rules: [{
                        required: true,
                        message: "请选择所属社区",
                        trigger: "blur",
                    },],
                },
                //  {
                //   width: 144,
                //   label: "创建时间",
                //   prop: "createTime",
                //   searchSpan: 4,
                // },
                {
                    width: 100,
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    label: '审核状态',
                    prop: 'status',
                    type: 'radio',
                    slot: true,
                    dicData: [{
                        label: '待审核',
                        value: 1
                    }, {
                        label: '已审核',
                        value: 2
                    }, {
                        label: '未通过',
                        value: 3
                    }, {
                        label: '待接收',
                        value: 4
                    }]
                }, {
                    width: 100,
                    addDisplay: false,
                    editDisplay: false,
                    viewDisplay: false,
                    label: '类型',
                    prop: 'reportType',
                    type: 'radio',
                    slot: true,
                    searchSpan: 4,
                    searchLabelWidth: 66,
                    search: true,
                    dicData: [{
                        label: '旅馆安全',
                        value: 2
                    }, {
                        label: '打金店',
                        value: 3
                    }, {
                        label: '二手手机维修',
                        value: 4
                    }, {
                        label: '二手车交易',
                        value: 5
                    }, {
                        label: '校园安全',
                        value: 6
                    }]
                },
                ],
            },
            //  {
            //   width: 144,
            //   label: "创建时间",
            //   prop: "createTime",
            //   searchSpan: 4,
            data: [],
            // },
            {
              width: 100,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              label: '审核状态',
              prop: 'status',
              type: 'radio',
              slot: true,
              dicData: [{
                label: '待审核',
                value: 1
              }, {
                label: '已审核',
                value: 2
              }, {
                label: '未通过',
                value: 3
              }, {
                label: '待接收',
                value: 4
              }]
            }, {
              width: 100,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              label: '类型',
              prop: 'reportType',
              type: 'radio',
              slot: true,
              searchSpan: 4,
              searchLabelWidth: 66,
              search: true,
              dicData: [{
                label: '旅馆安全',
                value: 2
              }, {
                label: '打金店',
                value: 3
              }, {
                label: '二手手机维修',
                value: 4
              }, {
                label: '二手车交易',
                value: 5
              }, {
                label: '校园安全',
                value: 6
              }]
            },
          ],
        },
        data: [],
        auditBasePopup: false,
      }
            auditBasePopup: false,
        }
    },
    provide() {
      return {
        placeElement: this,
      }
    provide () {
        return {
            placeElement: this,
        }
    },
    components: {
      campusReporting,
      hotelReporting,
      labelReporting,
        campusReporting,
        hotelReporting,
        labelReporting,
    },
    watch: {},
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.place_add, false),
          viewBtn: this.vaildData(this.permission.place_view, true),
          delBtn: this.vaildData(this.permission.place_del, true),
          // editBtn: this.vaildData(this.permission.place_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
      showStatus() {
        return (data) => {
          let tags = {}
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.place_add, false),
                viewBtn: this.vaildData(this.permission.place_view, true),
                delBtn: this.vaildData(this.permission.place_del, true),
                // editBtn: this.vaildData(this.permission.place_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
        showStatus () {
            return (data) => {
                let tags = {}
          if (data == 1) {
            tags = {
              type: 'warning',
              text: '待审核'
            }
          } else if (data == 2) {
            tags = {
              type: 'success',
              text: '已审核'
            }
          } else if (data == 3) {
            tags = {
              type: 'danger',
              text: '未通过'
            }
          } else if (data == 4) {
            tags = {
              type: 'warning',
              text: '待接收'
            }
          }
                if (data == 1) {
                    tags = {
                        type: 'warning',
                        text: '待审核'
                    }
                } else if (data == 2) {
                    tags = {
                        type: 'success',
                        text: '已审核'
                    }
                } else if (data == 3) {
                    tags = {
                        type: 'danger',
                        text: '未通过'
                    }
                } else if (data == 4) {
                    tags = {
                        type: 'warning',
                        text: '待接收'
                    }
                }
          return tags
                return tags
            }
        }
      }
    },
    methods: {
      colseDetail() {
        this.auditBasePopup = false
        this.onLoad(this.page)
      },
      lookDetail(row, applyType) {
        this.auditBasePopup = true
        var that = this
        if (row.reportType == 6) {
          this.taskType = 6
          this.$nextTick(() => {
            that.$refs.campusReporting.init(row, applyType)
          })
        }
        if (row.reportType == 2) {
          this.taskType = 2
          this.$nextTick(() => {
            that.$refs.hotelReporting.init(row, applyType)
          })
        }
        if (row.reportType == 3 || row.reportType == 4 || row.reportType == 5) {
          this.taskType = 3
          this.$nextTick(() => {
            that.$refs.labelReporting.init(row, applyType)
          })
        }
      },
      auditCur(row) {
        this.curAuditRow = row
        this.auditBasePopup = true
      },
      roleBoxClose() {
        this.curRow = {}
      },
      ManageTenants(item) {
        this.curRow = item
        this.roleBox = true
      },
      rowSave(row, done, loading) {
        if (row.imageUrls.length > 0) {
          var urls = []
          var split = row.imageUrls.split(",").filter(item => item != '')
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.imageUrls = urls.join(",")
        }
        let label = row.label
        if (row.smallLabel != '') {
          label = label + ',' + row.smallLabel
        }
        delete row.smallLabel
        add({
          ...row,
          label
        }).then(
          () => {
        colseDetail () {
            this.auditBasePopup = false
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
        },
      rowUpdate(row, index, done, loading) {
        if (row.imageUrls.length > 0) {
          var urls = []
          var split = row.imageUrls.split(",").filter(item => item != '')
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.imageUrls = urls.join(",")
        }
        let label = row.label
        if (row.smallLabel != '') {
          label = label + ',' + row.smallLabel
        }
        delete row.smallLabel
        update({
          ...row,
          label
        }).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            row.isDeleted = 1
            return removeTask(row)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$nextTick(() => {
          this.$refs.crud && this.$refs.crud.toggleSelection()
        })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          // getPlace(this.form.id).then((res) => {
          //   this.form = res.data.data
          //   if (this.form.imageUrls.length) {
          //     this.form.imageUrls = this.form.imageUrls.split(",").filter(item => item != '').map(item => website
          //       .minioUrl + item).join(',')
          //   }
          //   if (this.form.placePoiLabelVOList.length) {
          //     let lebelTwo = this.form.placePoiLabelVOList.find(item => {
          //       return item.type == 2
          //     })
          //     if (lebelTwo) this.form.label = String(lebelTwo.poiCode)
          //     let lebelThree = this.form.placePoiLabelVOList.find(item => {
          //       return item.type == 3
          //     })
          //     if (lebelThree) this.form.smallLabel = String(lebelThree.poiCode)
          //   }
          //   done()
          // })
        } else {
          done()
        }
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {
          dateTime
        } = this.query
        let values = {
          ...params,
        }
        // if (dateTime) {
        //   values = {
        //     ...params,
        //     startTime: dateTime[0],
        //     endTime: dateTime[1],
        //     ...this.query,
        //   }
        //   values.dateTime = null
        // }
        values.reportType = 2
        this.loading = true
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.data.forEach(item => {
            if (item.imageUrls && item.imageUrls != '' && item.imageUrls != null && item.imageUrls.length) {
              var urls = []
              var names = item.imageUrls.split(",").filter(item => item != '')
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              item.imageUrls = urls.join(",")
        lookDetail (row, applyType) {
            this.auditBasePopup = true
            var that = this
            if (row.reportType == 6) {
                this.taskType = 6
                this.$nextTick(() => {
                    that.$refs.campusReporting.init(row, applyType)
                })
            }
          })
          this.loading = false
          this.selectionClear()
        })
      }
            if (row.reportType == 2) {
                this.taskType = 2
                this.$nextTick(() => {
                    that.$refs.hotelReporting.init(row, applyType)
                })
            }
            if (row.reportType == 3 || row.reportType == 4 || row.reportType == 5) {
                this.taskType = 3
                this.$nextTick(() => {
                    that.$refs.labelReporting.init(row, applyType)
                })
            }
        },
        auditCur (row) {
            this.curAuditRow = row
            this.auditBasePopup = true
        },
        roleBoxClose () {
            this.curRow = {}
        },
        ManageTenants (item) {
            this.curRow = item
            this.roleBox = true
        },
        rowSave (row, done, loading) {
            if (row.imageUrls.length > 0) {
                var urls = []
                var split = row.imageUrls.split(",").filter(item => item != '')
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.imageUrls = urls.join(",")
            }
            let label = row.label
            if (row.smallLabel != '') {
                label = label + ',' + row.smallLabel
            }
            delete row.smallLabel
            add({
                ...row,
                label
            }).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowUpdate (row, index, done, loading) {
            if (row.imageUrls.length > 0) {
                var urls = []
                var split = row.imageUrls.split(",").filter(item => item != '')
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                row.imageUrls = urls.join(",")
            }
            let label = row.label
            if (row.smallLabel != '') {
                label = label + ',' + row.smallLabel
            }
            delete row.smallLabel
            update({
                ...row,
                label
            }).then(
                () => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    done()
                },
                (error) => {
                    window.console.log(error)
                    loading()
                }
            )
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    row.isDeleted = 1
                    return removeTask(row)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$nextTick(() => {
                this.$refs.crud && this.$refs.crud.toggleSelection()
            })
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                // getPlace(this.form.id).then((res) => {
                //   this.form = res.data.data
                //   if (this.form.imageUrls.length) {
                //     this.form.imageUrls = this.form.imageUrls.split(",").filter(item => item != '').map(item => website
                //       .minioUrl + item).join(',')
                //   }
                //   if (this.form.placePoiLabelVOList.length) {
                //     let lebelTwo = this.form.placePoiLabelVOList.find(item => {
                //       return item.type == 2
                //     })
                //     if (lebelTwo) this.form.label = String(lebelTwo.poiCode)
                //     let lebelThree = this.form.placePoiLabelVOList.find(item => {
                //       return item.type == 3
                //     })
                //     if (lebelThree) this.form.smallLabel = String(lebelThree.poiCode)
                //   }
                //   done()
                // })
            } else {
                done()
            }
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const {
                dateTime
            } = this.query
            let values = {
                ...params,
            }
            // if (dateTime) {
            //   values = {
            //     ...params,
            //     startTime: dateTime[0],
            //     endTime: dateTime[1],
            //     ...this.query,
            //   }
            //   values.dateTime = null
            // }
            values.reportType = 2
            this.loading = true
            getList(page.currentPage, page.pageSize, values).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.data.forEach(item => {
                    if (item.imageUrls && item.imageUrls != '' && item.imageUrls != null && item.imageUrls.length) {
                        var urls = []
                        var names = item.imageUrls.split(",").filter(item => item != '')
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        item.imageUrls = urls.join(",")
                    }
                })
                this.loading = false
                this.selectionClear()
            })
        }
    }
  }
}
</script>
<style lang="scss" scoped>
  .avue-upload__icon {
.avue-upload__icon {
    line-height: 6;
  }
}
  .cur-container-box {
.cur-container-box {
    display: flex;
    flex-direction: column;
    width: 100%;
@@ -576,18 +577,18 @@
    overflow: hidden;
    .content-box {
      margin: 0 4px;
      padding: 0 16px;
      height: 0;
      flex: 1;
      overflow: hidden;
      overflow-y: auto;
        margin: 0 4px;
        padding: 0 16px;
        height: 0;
        flex: 1;
        overflow: hidden;
        overflow-y: auto;
    }
    .footer-btn-box {
      margin-top: 10px;
      display: flex;
      justify-content: center;
        margin-top: 10px;
        display: flex;
        justify-content: center;
    }
  }
}
</style>
src/views/report/reportlist.vue
@@ -61,6 +61,7 @@
                        prop: "name",
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 60,
                        slot: true,
                    },
                    {
src/views/resource/attach.vue
@@ -75,6 +75,7 @@
                        prop: "domainUrl",
                        searchSpan: 4,
                        search: true,
                        searchLabelWidth: 76,
                        rules: [{
                            required: true,
                            message: "请输入附件域名",
src/views/resource/oss.vue
@@ -75,7 +75,7 @@
                        value: 1,
                        span: 24,
                        width: 120,
                        searchLabelWidth: 50,
                        searchLabelWidth: 46,
                        row: true,
                        dicUrl: "/api/blade-system/dict/dictionary?code=oss",
                        props: {
src/views/resource/sms.vue
@@ -73,7 +73,7 @@
                        value: 1,
                        span: 24,
                        width: 100,
                        searchLabelWidth: 66,
                        searchLabelWidth: 46,
                        row: true,
                        dicUrl: "/api/blade-system/dict/dictionary?code=sms",
                        props: {
src/views/system/client.vue
@@ -1,333 +1,316 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               @row-del="rowDel"
               v-model="form"
               ref="crud"
               :permission="permissionList"
               @row-update="rowUpdate"
               @row-save="rowSave"
               :before-open="beforeOpen"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.client_delete"
                   @click="handleDelete">删 除
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" @row-del="rowDel" v-model="form"
            ref="crud" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
            @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
            @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.client_delete"
                    @click="handleDelete">删 除
                </el-button>
            </template>
        </avue-crud>
    </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/system/client";
  import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/system/client"
import { mapGetters } from "vuex"
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        option: {
          height: 'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          column: [
            {
              label: "应用id",
              prop: "clientId",
              search: true,
              rules: [{
                required: true,
                message: "请输入客户端id",
                trigger: "blur"
              }]
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            {
              label: "应用密钥",
              prop: "clientSecret",
              search: true,
              rules: [{
                required: true,
                message: "请输入客户端密钥",
                trigger: "blur"
              }]
            selectionList: [],
            option: {
                height: 'auto',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                border: true,
                index: true,
                viewBtn: true,
                selection: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "应用id",
                        prop: "clientId",
                        search: true,
                        searchLabelWidth: 60,
                        rules: [{
                            required: true,
                            message: "请输入客户端id",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "应用密钥",
                        prop: "clientSecret",
                        search: true,
                        searchLabelWidth: 100,
                        rules: [{
                            required: true,
                            message: "请输入客户端密钥",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "授权类型",
                        prop: "authorizedGrantTypes",
                        type: "checkbox",
                        value: "refresh_token,password,authorization_code",
                        dicData: [
                            {
                                label: "refresh_token",
                                value: "refresh_token"
                            },
                            {
                                label: "password",
                                value: "password"
                            },
                            {
                                label: "authorization_code",
                                value: "authorization_code"
                            },
                            {
                                label: "captcha",
                                value: "captcha"
                            },
                            {
                                label: "social",
                                value: "social"
                            }
                        ],
                        rules: [{
                            required: true,
                            message: "请输入授权类型",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "授权范围",
                        prop: "scope",
                        value: "all",
                        rules: [{
                            required: true,
                            message: "请输入授权范围",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "令牌秒数",
                        prop: "accessTokenValidity",
                        type: "number",
                        value: 3600,
                        rules: [{
                            required: true,
                            message: "请输入令牌过期秒数",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "刷新秒数",
                        prop: "refreshTokenValidity",
                        type: "number",
                        value: 604800,
                        hide: true,
                        rules: [{
                            required: true,
                            message: "请输入刷新令牌过期秒数",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "回调地址",
                        prop: "webServerRedirectUri",
                        hide: true,
                        rules: [{
                            required: true,
                            message: "请输入回调地址",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "资源集合",
                        prop: "resourceIds",
                        hide: true,
                        rules: [{
                            message: "请输入资源集合",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "权限",
                        prop: "authorities",
                        hide: true,
                        rules: [{
                            message: "请输入权限",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "自动授权",
                        prop: "autoapprove",
                        hide: true,
                        rules: [{
                            message: "请输入自动授权",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "附加说明",
                        hide: true,
                        prop: "additionalInformation",
                        span: 24,
                        rules: [{
                            message: "请输入附加说明",
                            trigger: "blur"
                        }]
                    },
                ]
            },
            {
              label: "授权类型",
              prop: "authorizedGrantTypes",
              type: "checkbox",
              value: "refresh_token,password,authorization_code",
              dicData: [
                {
                  label: "refresh_token",
                  value: "refresh_token"
                },
                {
                  label: "password",
                  value: "password"
                },
                {
                  label: "authorization_code",
                  value: "authorization_code"
                },
                {
                  label: "captcha",
                  value: "captcha"
                },
                {
                  label: "social",
                  value: "social"
                }
              ],
              rules: [{
                required: true,
                message: "请输入授权类型",
                trigger: "blur"
              }]
            },
            {
              label: "授权范围",
              prop: "scope",
              value: "all",
              rules: [{
                required: true,
                message: "请输入授权范围",
                trigger: "blur"
              }]
            },
            {
              label: "令牌秒数",
              prop: "accessTokenValidity",
              type: "number",
              value: 3600,
              rules: [{
                required: true,
                message: "请输入令牌过期秒数",
                trigger: "blur"
              }]
            },
            {
              label: "刷新秒数",
              prop: "refreshTokenValidity",
              type: "number",
              value: 604800,
              hide: true,
              rules: [{
                required: true,
                message: "请输入刷新令牌过期秒数",
                trigger: "blur"
              }]
            },
            {
              label: "回调地址",
              prop: "webServerRedirectUri",
              hide: true,
              rules: [{
                required: true,
                message: "请输入回调地址",
                trigger: "blur"
              }]
            },
            {
              label: "资源集合",
              prop: "resourceIds",
              hide: true,
              rules: [{
                message: "请输入资源集合",
                trigger: "blur"
              }]
            },
            {
              label: "权限",
              prop: "authorities",
              hide: true,
              rules: [{
                message: "请输入权限",
                trigger: "blur"
              }]
            },
            {
              label: "自动授权",
              prop: "autoapprove",
              hide: true,
              rules: [{
                message: "请输入自动授权",
                trigger: "blur"
              }]
            },
            {
              label: "附加说明",
              hide: true,
              prop: "additionalInformation",
              span: 24,
              rules: [{
                message: "请输入附加说明",
                trigger: "blur"
              }]
            },
          ]
        },
        data: []
      };
            data: []
        }
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.client_add),
          viewBtn: this.vaildData(this.permission.client_view),
          delBtn: this.vaildData(this.permission.client_delete),
          editBtn: this.vaildData(this.permission.client_edit)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.client_add),
                viewBtn: this.vaildData(this.permission.client_view),
                delBtn: this.vaildData(this.permission.client_delete),
                editBtn: this.vaildData(this.permission.client_edit)
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getDetail(this.form.id).then(res => {
                    this.form = res.data.data
                })
            }
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            this.loading = true
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      }
    }
  };
}
</script>
<style>
</style>
<style></style>
src/views/system/dept.vue
@@ -71,6 +71,7 @@
                        label: "机构名称",
                        prop: "deptName",
                        search: true,
                        searchLabelWidth: 76,
                        rules: [{
                            required: true,
                            message: "请输入机构名称",
@@ -102,6 +103,7 @@
                        label: "机构全称",
                        prop: "fullName",
                        search: true,
                        searchLabelWidth: 100,
                        rules: [{
                            required: true,
                            message: "请输入机构全称",
src/views/system/menu.vue
@@ -1,455 +1,455 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
      :permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" @row-del="rowDel"
      @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
      @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
      @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad">
      <template slot="menuLeft">
        <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.menu_delete" plain
          @click="handleDelete">删 除
        </el-button>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
          @click.stop="handleAdd(scope.row,scope.index)"
          v-if="userInfo.role_name.includes('admin') && scope.row.category === 1">新增子项
        </el-button>
      </template>
      <template slot-scope="{row}" slot="source">
        <div style="text-align:center">
          <i :class="row.source" />
        </div>
      </template>
    </avue-crud>
  </basic-container>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
            :permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" @row-del="rowDel"
            @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad">
            <template slot="menuLeft">
                <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.menu_delete" plain
                    @click="handleDelete">删 除
                </el-button>
            </template>
            <template slot-scope="scope" slot="menu">
                <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
                    @click.stop="handleAdd(scope.row, scope.index)"
                    v-if="userInfo.role_name.includes('admin') && scope.row.category === 1">新增子项
                </el-button>
            </template>
            <template slot-scope="{row}" slot="source">
                <div style="text-align:center">
                    <i :class="row.source" />
                </div>
            </template>
        </avue-crud>
    </basic-container>
</template>
<script>
  import {
import {
    getLazyList,
    remove,
    update,
    add,
    getMenu
  } from "@/api/system/menu";
  import {
} from "@/api/system/menu"
import {
    mapGetters
  } from "vuex";
  import iconList from "@/config/iconList";
  import func from "@/util/func";
  import {
} from "vuex"
import iconList from "@/config/iconList"
import func from "@/util/func"
import {
    getMenuTree
  } from "@/api/system/menu";
} from "@/api/system/menu"
  import {
import {
    getTreeList
  } from "@/api/label/label";
} from "@/api/label/label"
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        selectionList: [],
        parentId: 0,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        option: {
          lazy: true,
          tip: false,
          simplePage: true,
          searchShow: true,
          searchMenuSpan: 6,
          dialogWidth: "60%",
          tree: true,
          border: true,
          index: true,
          selection: true,
          viewBtn: true,
          menuWidth: 300,
          dialogClickModal: false,
          column: [{
              label: "菜单名称",
              prop: "name",
              search: true,
              rules: [{
                required: true,
                message: "请输入菜单名称",
                trigger: "blur"
              }]
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            selectionList: [],
            parentId: 0,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            {
              label: "路由地址",
              prop: "path",
              rules: [{
                required: true,
                message: "请输入路由地址",
                trigger: "blur"
              }]
            },
            {
              label: "上级菜单",
              prop: "parentId",
              type: "tree",
              dicData: [],
              // hide: true,
              addDisabled: false,
              props: {
                label: "title",
                value: 'id'
              },
              rules: [{
                required: false,
                message: "请选择上级菜单",
                trigger: "click"
              }]
            },
            {
              label: "菜单图标",
              prop: "source",
              type: "icon",
              slot: true,
              iconList: iconList,
              rules: [{
                required: true,
                message: "请输入菜单图标",
                trigger: "click"
              }]
            },
            {
              label: "菜单编号",
              prop: "code",
              search: true,
              rules: [{
                required: true,
                message: "请输入菜单编号",
                trigger: "blur"
              }]
            },
            {
              label: "菜单类型",
              prop: "category",
              type: "radio",
              dicData: [{
                  label: "菜单",
                  value: 1
            option: {
                lazy: true,
                tip: false,
                simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                dialogWidth: "60%",
                tree: true,
                border: true,
                index: true,
                selection: true,
                viewBtn: true,
                menuWidth: 300,
                dialogClickModal: false,
                column: [{
                    label: "菜单名称",
                    prop: "name",
                    search: true,
                    searchLabelWidth: 76,
                    rules: [{
                        required: true,
                        message: "请输入菜单名称",
                        trigger: "blur"
                    }]
                },
                {
                  label: "按钮",
                  value: 2
                }
              ],
              hide: true,
              rules: [{
                required: true,
                message: "请选择菜单类型",
                trigger: "blur"
              }]
            },
            {
              label: "菜单别名",
              prop: "alias",
              search: true,
              rules: [{
                required: true,
                message: "请输入菜单别名",
                trigger: "blur"
              }]
            }, {
              label: "菜单",
              prop: "menuType",
              type: "radio",
              rules: [{
                required: true,
                message: "请选择菜单",
                trigger: "blur"
              }],
              dicData: [{
                  label: "PC端",
                  value: 0
                    label: "路由地址",
                    prop: "path",
                    rules: [{
                        required: true,
                        message: "请输入路由地址",
                        trigger: "blur"
                    }]
                },
                {
                  label: "移动端",
                  value: 1
                }
              ],
            },
            {
              label: "新窗口",
              prop: "isOpen",
              type: "radio",
              disabled: false,
              display: false,
              dicData: [{
                  label: "否",
                  value: 1
                    label: "上级菜单",
                    prop: "parentId",
                    type: "tree",
                    dicData: [],
                    // hide: true,
                    addDisabled: false,
                    props: {
                        label: "title",
                        value: 'id'
                    },
                    rules: [{
                        required: false,
                        message: "请选择上级菜单",
                        trigger: "click"
                    }]
                },
                {
                  label: "是",
                  value: 2
                }
              ],
              value: 1,
              rules: [{
                required: true,
                message: "请选择新窗口打开",
                trigger: "blur"
              }]
                    label: "菜单图标",
                    prop: "source",
                    type: "icon",
                    slot: true,
                    iconList: iconList,
                    rules: [{
                        required: true,
                        message: "请输入菜单图标",
                        trigger: "click"
                    }]
                },
                {
                    label: "菜单编号",
                    prop: "code",
                    search: true,
                    rules: [{
                        required: true,
                        message: "请输入菜单编号",
                        trigger: "blur"
                    }]
                },
                {
                    label: "菜单类型",
                    prop: "category",
                    type: "radio",
                    dicData: [{
                        label: "菜单",
                        value: 1
                    },
                    {
                        label: "按钮",
                        value: 2
                    }
                    ],
                    hide: true,
                    rules: [{
                        required: true,
                        message: "请选择菜单类型",
                        trigger: "blur"
                    }]
                },
                {
                    label: "菜单别名",
                    prop: "alias",
                    search: true,
                    rules: [{
                        required: true,
                        message: "请输入菜单别名",
                        trigger: "blur"
                    }]
                }, {
                    label: "菜单",
                    prop: "menuType",
                    type: "radio",
                    rules: [{
                        required: true,
                        message: "请选择菜单",
                        trigger: "blur"
                    }],
                    dicData: [{
                        label: "PC端",
                        value: 0
                    },
                    {
                        label: "移动端",
                        value: 1
                    }
                    ],
                },
                {
                    label: "新窗口",
                    prop: "isOpen",
                    type: "radio",
                    disabled: false,
                    display: false,
                    dicData: [{
                        label: "否",
                        value: 1
                    },
                    {
                        label: "是",
                        value: 2
                    }
                    ],
                    value: 1,
                    rules: [{
                        required: true,
                        message: "请选择新窗口打开",
                        trigger: "blur"
                    }]
                },
                {
                    label: "菜单排序",
                    prop: "sort",
                    type: "number",
                    rules: [{
                        required: true,
                        message: "请输入菜单排序",
                        trigger: "blur"
                    }]
                },
                {
                    label: "背景色",
                    prop: "background",
                    span: 12,
                    minRows: 2,
                    hide: true
                },
                {
                    label: "图片地址",
                    prop: "pictureImg",
                    span: 12,
                    minRows: 2,
                    hide: true
                },
                {
                    label: "标签权限",
                    prop: "labelList",
                    span: 12,
                    minRows: 2,
                    type: "cascader",
                    dicData: [],
                    props: {
                        label: "name",
                        value: 'id'
                    },
                    multiple: true,
                    // hide: true
                },
                {
                    label: "菜单备注",
                    prop: "remark",
                    type: "textarea",
                    span: 24,
                    minRows: 2,
                    hide: true
                },
                ]
            },
            {
              label: "菜单排序",
              prop: "sort",
              type: "number",
              rules: [{
                required: true,
                message: "请输入菜单排序",
                trigger: "blur"
              }]
            },
            {
              label: "背景色",
              prop: "background",
              span: 12,
              minRows: 2,
              hide: true
            },
            {
              label: "图片地址",
              prop: "pictureImg",
              span: 12,
              minRows: 2,
              hide: true
            },
            {
              label: "标签权限",
              prop: "labelList",
              span: 12,
              minRows: 2,
              type: "cascader",
              dicData: [],
              props: {
                label: "name",
                value: 'id'
              },
              multiple: true,
              // hide: true
            },
            {
              label: "菜单备注",
              prop: "remark",
              type: "textarea",
              span: 24,
              minRows: 2,
              hide: true
            },
          ]
        },
        data: [],
        labelList: [],
      };
            data: [],
            labelList: [],
        }
    },
    watch: {
      'form.category'() {
        const category = func.toInt(this.form.category);
        this.$refs.crud.option.column.filter(item => {
          if (item.prop === "path") {
            item.rules[0].required = category === 1;
          }
          if (item.prop === 'isOpen') {
            item.disabled = category === 2;
          }
        });
      },
        'form.category' () {
            const category = func.toInt(this.form.category)
            this.$refs.crud.option.column.filter(item => {
                if (item.prop === "path") {
                    item.rules[0].required = category === 1
                }
                if (item.prop === 'isOpen') {
                    item.disabled = category === 2
                }
            })
        },
    },
    computed: {
      ...mapGetters(["userInfo", "permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.menu_add, false),
          viewBtn: this.vaildData(this.permission.menu_view, false),
          delBtn: this.vaildData(this.permission.menu_delete, false),
          editBtn: this.vaildData(this.permission.menu_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
        ...mapGetters(["userInfo", "permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.menu_add, false),
                viewBtn: this.vaildData(this.permission.menu_view, false),
                delBtn: this.vaildData(this.permission.menu_delete, false),
                editBtn: this.vaildData(this.permission.menu_edit, false)
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        }
    },
    methods: {
      initData() {
        getMenuTree().then(res => {
          const column = this.findObject(this.option.column, "parentId");
          column.dicData = res.data.data;
        });
        initData () {
            getMenuTree().then(res => {
                const column = this.findObject(this.option.column, "parentId")
                column.dicData = res.data.data
            })
        // getTreeList().then(res => {
        // console.log(JSON.stringify(res.data.data))
        const column = this.findObject(this.option.column, "labelList");
        column.dicData = this.labelList;
        // });
      },
      handleAdd(row) {
        this.parentId = row.id;
        const column = this.findObject(this.option.column, "parentId");
        column.value = row.id;
        column.addDisabled = true;
        this.$refs.crud.rowAdd();
      },
      rowSave(row, done, loading) {
        add(row).then((res) => {
          // 获取新增数据的相关字段
          const data = res.data.data;
          row.id = data.id;
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          // 数据回调进行刷新
          done(row);
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          // 数据回调进行刷新
          done(row);
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDel(row, index, done) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            // 数据回调进行刷新
            done(row);
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
            // getTreeList().then(res => {
            // console.log(JSON.stringify(res.data.data))
            const column = this.findObject(this.option.column, "labelList")
            column.dicData = this.labelList
            // });
        },
        handleAdd (row) {
            this.parentId = row.id
            const column = this.findObject(this.option.column, "parentId")
            column.value = row.id
            column.addDisabled = true
            this.$refs.crud.rowAdd()
        },
        rowSave (row, done, loading) {
            add(row).then((res) => {
                // 获取新增数据的相关字段
                const data = res.data.data
                row.id = data.id
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                // 数据回调进行刷新
                done(row)
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                // 数据回调进行刷新
                done(row)
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDel (row, index, done) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    // 数据回调进行刷新
                    done(row)
                })
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    // 刷新表格数据并重载
                    this.data = []
                    this.parentId = 0
                    this.$refs.crud.refreshTable()
                    this.$refs.crud.toggleSelection()
                    // 表格数据重载
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.parentId = 0
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.parentId = ''
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        beforeOpen (done, type) {
            if (["add", "edit"].includes(type)) {
                this.initData()
            }
            if (["edit", "view"].includes(type)) {
                getMenu(this.form.id).then(res => {
                    this.form = res.data.data
                })
            }
            done()
        },
        beforeClose (done) {
            this.parentId = ""
            const column = this.findObject(this.option.column, "parentId")
            column.value = ""
            column.addDisabled = false
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            this.loading = true
            getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
                this.data = res.data.data
                this.loading = false
                this.selectionClear()
            })
            getTreeList().then(res => {
                this.labelList = res.data.data
            })
        },
        treeLoad (tree, treeNode, resolve) {
            const parentId = tree.id
            getLazyList(parentId).then(res => {
                resolve(res.data.data)
            })
            // getTreeList().then(res => {
            // console.log(JSON.stringify(res.data.data))
            const column = this.findObject(this.option.column, "labelList")
            column.dicData = this.labelList
            // });
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            // 刷新表格数据并重载
            this.data = [];
            this.parentId = 0;
            this.$refs.crud.refreshTable();
            this.$refs.crud.toggleSelection();
            // 表格数据重载
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.parentId = '';
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      beforeOpen(done, type) {
        if (["add", "edit"].includes(type)) {
          this.initData();
        }
        if (["edit", "view"].includes(type)) {
          getMenu(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      beforeClose(done) {
        this.parentId = "";
        const column = this.findObject(this.option.column, "parentId");
        column.value = "";
        column.addDisabled = false;
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
        getTreeList().then(res => {
          this.labelList = res.data.data;
        });
      },
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
        getLazyList(parentId).then(res => {
          resolve(res.data.data);
        });
        // getTreeList().then(res => {
        // console.log(JSON.stringify(res.data.data))
        const column = this.findObject(this.option.column, "labelList");
        column.dicData = this.labelList;
        // });
      }
    }
  };
}
</script>
<style>
</style>
<style></style>
src/views/system/post.vue
@@ -1,281 +1,264 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.post_delete"
                   @click="handleDelete">删 除
        </el-button>
      </template>
      <template slot-scope="{row}"
                slot="category">
        <el-tag>{{row.categoryName}}</el-tag>
      </template>
    </avue-crud>
  </basic-container>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
            :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave"
            @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
            @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.post_delete"
                    @click="handleDelete">删 除
                </el-button>
            </template>
            <template slot-scope="{row}" slot="category">
                <el-tag>{{ row.categoryName }}</el-tag>
            </template>
        </avue-crud>
    </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/system/post";
  import {mapGetters} from "vuex";
  import website from "@/config/website";
import { getList, getDetail, add, update, remove } from "@/api/system/post"
import { mapGetters } from "vuex"
import website from "@/config/website"
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        option: {
          height: 'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          column: [
            {
              label: "所属租户",
              prop: "tenantId",
              type: "tree",
              dicUrl: "/api/blade-system/tenant/select",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: website.tenantMode,
              span: 24,
              props: {
                label: "tenantName",
                value: "tenantId"
              },
              hide: !website.tenantMode,
              rules: [{
                required: true,
                message: "请输入所属租户",
                trigger: "click"
              }]
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            {
              label: "岗位类型",
              prop: "category",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=post_category",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              dataType: "number",
              slot: true,
              search: true,
              rules: [{
                required: true,
                message: "请选择岗位类型",
                trigger: "blur"
              }]
            selectionList: [],
            option: {
                height: 'auto',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                border: true,
                index: true,
                viewBtn: true,
                selection: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "所属租户",
                        prop: "tenantId",
                        type: "tree",
                        dicUrl: "/api/blade-system/tenant/select",
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: website.tenantMode,
                        span: 24,
                        props: {
                            label: "tenantName",
                            value: "tenantId"
                        },
                        hide: !website.tenantMode,
                        rules: [{
                            required: true,
                            message: "请输入所属租户",
                            trigger: "click"
                        }]
                    },
                    {
                        label: "岗位类型",
                        prop: "category",
                        type: "select",
                        dicUrl: "/api/blade-system/dict/dictionary?code=post_category",
                        props: {
                            label: "dictValue",
                            value: "dictKey"
                        },
                        dataType: "number",
                        slot: true,
                        search: true,
                        searchLabelWidth: 76,
                        rules: [{
                            required: true,
                            message: "请选择岗位类型",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "岗位编号",
                        prop: "postCode",
                        search: true,
                        searchLabelWidth: 100,
                        rules: [{
                            required: true,
                            message: "请输入岗位编号",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "岗位名称",
                        prop: "postName",
                        search: true,
                        searchLabelWidth: 100,
                        rules: [{
                            required: true,
                            message: "请输入岗位名称",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "岗位排序",
                        prop: "sort",
                        type: "number",
                        rules: [{
                            required: true,
                            message: "请输入岗位排序",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "岗位描述",
                        prop: "remark",
                        type: "textarea",
                        span: 24,
                        minRows: 6,
                        hide: true,
                    },
                ]
            },
            {
              label: "岗位编号",
              prop: "postCode",
              search: true,
              rules: [{
                required: true,
                message: "请输入岗位编号",
                trigger: "blur"
              }]
            },
            {
              label: "岗位名称",
              prop: "postName",
              search: true,
              rules: [{
                required: true,
                message: "请输入岗位名称",
                trigger: "blur"
              }]
            },
            {
              label: "岗位排序",
              prop: "sort",
              type: "number",
              rules: [{
                required: true,
                message: "请输入岗位排序",
                trigger: "blur"
              }]
            },
            {
              label: "岗位描述",
              prop: "remark",
              type: "textarea",
              span: 24,
              minRows: 6,
              hide: true,
            },
          ]
        },
        data: []
      };
            data: []
        }
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.post_add, false),
          viewBtn: this.vaildData(this.permission.post_view, false),
          delBtn: this.vaildData(this.permission.post_delete, false),
          editBtn: this.vaildData(this.permission.post_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.post_add, false),
                viewBtn: this.vaildData(this.permission.post_view, false),
                delBtn: this.vaildData(this.permission.post_delete, false),
                editBtn: this.vaildData(this.permission.post_edit, false)
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getDetail(this.form.id).then(res => {
                    this.form = res.data.data
                })
            }
            done()
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            this.loading = true
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      }
    }
  };
}
</script>
<style>
</style>
<style></style>
src/views/system/tenant.vue
@@ -1,554 +1,511 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :page.sync="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   v-if="permission.tenant_delete"
                   plain
                   @click="handleDelete">删 除
        </el-button>
        <el-tooltip class="item" effect="dark" content="给租户配置账号额度、过期时间等授权信息" placement="top">
          <el-button size="small"
                     plain
                     v-if="userInfo.role_name.includes('administrator')"
                     icon="el-icon-setting"
                     @click="handleSetting">授权配置
          </el-button>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" content="给租户配置独立数据源以实现数据库隔离" placement="top">
          <el-button size="small"
                     plain
                     v-if="userInfo.role_name.includes('administrator')"
                     icon="el-icon-coin"
                     @click="handleDatasource">数据源配置
          </el-button>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" content="将菜单产品包与租户配置绑定" placement="top">
          <el-button size="small"
                     plain
                     v-if="userInfo.role_name.includes('administrator')"
                     icon="el-icon-notebook-1"
                     @click="handlePackage">产品包配置
          </el-button>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" content="将自定义的菜单集合定制为租户绑定的菜单产品包" placement="top">
          <el-button size="small"
                     plain
                     v-if="userInfo.role_name.includes('administrator')"
                     icon="el-icon-notebook-2"
                     @click="handlePackageSetting">产品包管理
          </el-button>
        </el-tooltip>
      </template>
      <template slot-scope="{row}"
                slot="accountNumber">
        <el-tag>{{ row.accountNumber > 0 ? row.accountNumber : '不限制' }}</el-tag>
      </template>
      <template slot-scope="{row}"
                slot="expireTime">
        <el-tag>{{ row.expireTime ? row.expireTime : '不限制' }}</el-tag>
      </template>
    </avue-crud>
    <el-dialog title="租户授权配置"
               append-to-body
               :visible.sync="box"
               width="450px">
      <avue-form :option="settingOption" v-model="settingForm" @submit="handleSubmit"/>
    </el-dialog>
    <el-dialog title="租户数据源配置"
               append-to-body
               :visible.sync="datasourceBox"
               width="450px">
      <avue-form :option="datasourceOption" v-model="datasourceForm" @submit="handleDatasourceSubmit"/>
    </el-dialog>
    <el-dialog title="租户产品包配置"
               append-to-body
               :visible.sync="packageBox"
               width="450px">
      <avue-form ref="formPackage" :option="packageOption" v-model="packageForm" @submit="handlePackageSubmit"/>
    </el-dialog>
    <el-dialog title="租户产品包管理"
               append-to-body
               :visible.sync="packageSettingBox"
               width="1000px">
      <tenant-package></tenant-package>
    </el-dialog>
  </basic-container>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
            :permission="permissionList" :before-open="beforeOpen" @row-del="rowDel" @row-update="rowUpdate"
            @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.tenant_delete" plain
                    @click="handleDelete">删 除
                </el-button>
                <el-tooltip class="item" effect="dark" content="给租户配置账号额度、过期时间等授权信息" placement="top">
                    <el-button size="small" plain v-if="userInfo.role_name.includes('administrator')" icon="el-icon-setting"
                        @click="handleSetting">授权配置
                    </el-button>
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="给租户配置独立数据源以实现数据库隔离" placement="top">
                    <el-button size="small" plain v-if="userInfo.role_name.includes('administrator')" icon="el-icon-coin"
                        @click="handleDatasource">数据源配置
                    </el-button>
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="将菜单产品包与租户配置绑定" placement="top">
                    <el-button size="small" plain v-if="userInfo.role_name.includes('administrator')"
                        icon="el-icon-notebook-1" @click="handlePackage">产品包配置
                    </el-button>
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="将自定义的菜单集合定制为租户绑定的菜单产品包" placement="top">
                    <el-button size="small" plain v-if="userInfo.role_name.includes('administrator')"
                        icon="el-icon-notebook-2" @click="handlePackageSetting">产品包管理
                    </el-button>
                </el-tooltip>
            </template>
            <template slot-scope="{row}" slot="accountNumber">
                <el-tag>{{ row.accountNumber > 0 ? row.accountNumber : '不限制' }}</el-tag>
            </template>
            <template slot-scope="{row}" slot="expireTime">
                <el-tag>{{ row.expireTime ? row.expireTime : '不限制' }}</el-tag>
            </template>
        </avue-crud>
        <el-dialog title="租户授权配置" append-to-body :visible.sync="box" width="450px">
            <avue-form :option="settingOption" v-model="settingForm" @submit="handleSubmit" />
        </el-dialog>
        <el-dialog title="租户数据源配置" append-to-body :visible.sync="datasourceBox" width="450px">
            <avue-form :option="datasourceOption" v-model="datasourceForm" @submit="handleDatasourceSubmit" />
        </el-dialog>
        <el-dialog title="租户产品包配置" append-to-body :visible.sync="packageBox" width="450px">
            <avue-form ref="formPackage" :option="packageOption" v-model="packageForm" @submit="handlePackageSubmit" />
        </el-dialog>
        <el-dialog title="租户产品包管理" append-to-body :visible.sync="packageSettingBox" width="1000px">
            <tenant-package></tenant-package>
        </el-dialog>
    </basic-container>
</template>
<script>
import {getList, getDetail, remove, update, add, setting, datasource, packageInfo, packageSetting} from "@/api/system/tenant";
import {getDetail as packageDetail} from "@/api/system/tenantpackage";
import {mapGetters} from "vuex";
import {getMenuTree} from "@/api/system/menu";
import {validatenull} from "@/util/validate";
import { getList, getDetail, remove, update, add, setting, datasource, packageInfo, packageSetting } from "@/api/system/tenant"
import { getDetail as packageDetail } from "@/api/system/tenantpackage"
import { mapGetters } from "vuex"
import { getMenuTree } from "@/api/system/menu"
import { validatenull } from "@/util/validate"
export default {
  data() {
    return {
      form: {},
      selectionList: [],
      query: {},
      loading: true,
      box: false,
      datasourceBox: false,
      packageBox: false,
      packageSettingBox: false,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      option: {
        height: 'auto',
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: true,
        selection: true,
        viewBtn: true,
        dialogWidth: 900,
        dialogClickModal: false,
        column: [
          {
            label: "租户ID",
            prop: "tenantId",
            width: 100,
            search: true,
            addDisplay: false,
            editDisplay: false,
            span: 24,
            rules: [{
              required: true,
              message: "请输入租户ID",
              trigger: "blur"
            }]
          },
          {
            label: "租户名称",
            prop: "tenantName",
            search: true,
            width: 180,
            span: 24,
            rules: [{
              required: true,
              message: "请输入参数名称",
              trigger: "blur"
            }]
          },
          {
            label: "联系人",
            prop: "linkman",
            width: 100,
            search: true,
            rules: [{
              required: true,
              message: "请输入联系人",
              trigger: "blur"
            }]
          },
          {
            label: "联系电话",
            prop: "contactNumber",
            width: 150,
          },
          {
            label: "联系地址",
            prop: "address",
            span: 24,
            minRows: 2,
            type: "textarea",
            hide: true,
          },
          {
            label: "账号额度",
            prop: "accountNumber",
            width: 90,
            slot: true,
            addDisplay: false,
            editDisplay: false,
          },
          {
            label: "过期时间",
            prop: "expireTime",
            width: 180,
            slot: true,
            addDisplay: false,
            editDisplay: false,
          },
          {
            label: "绑定域名",
            prop: "domainUrl",
            span: 24,
          },
          {
            label: "系统背景",
            prop: "backgroundUrl",
            type: 'upload',
            listType: 'picture-img',
            dataType: 'string',
            action: '/api/blade-resource/oss/endpoint/put-file',
            propsHttp: {
              res: 'data',
              url: 'link',
    data () {
        return {
            form: {},
            selectionList: [],
            query: {},
            loading: true,
            box: false,
            datasourceBox: false,
            packageBox: false,
            packageSettingBox: false,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            hide: true,
            span: 24,
          },
        ]
      },
      data: [],
      settingForm: {},
      settingOption: {
        column: [
          {
            label: "账号额度",
            prop: "accountNumber",
            type: "number",
            span: 24,
          },
          {
            label: "过期时间",
            prop: "expireTime",
            type: "date",
            format: "yyyy-MM-dd hh:mm:ss",
            valueFormat: "yyyy-MM-dd hh:mm:ss",
            span: 24,
          },
        ]
      },
      datasourceForm: {},
      datasourceOption: {
        column: [
          {
            label: "数据源",
            prop: "datasourceId",
            search: true,
            span: 24,
            type: "select",
            dicUrl: "/api/blade-develop/datasource/select",
            props: {
              label: "name",
              value: "id"
            option: {
                height: 'auto',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                border: true,
                index: true,
                selection: true,
                viewBtn: true,
                dialogWidth: 900,
                dialogClickModal: false,
                column: [
                    {
                        label: "租户ID",
                        prop: "tenantId",
                        width: 100,
                        search: true,
                        searchLabelWidth: 60,
                        addDisplay: false,
                        editDisplay: false,
                        span: 24,
                        rules: [{
                            required: true,
                            message: "请输入租户ID",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "租户名称",
                        prop: "tenantName",
                        search: true,
                        width: 180,
                        span: 24,
                        rules: [{
                            required: true,
                            message: "请输入参数名称",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "联系人",
                        prop: "linkman",
                        width: 100,
                        search: true,
                        rules: [{
                            required: true,
                            message: "请输入联系人",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "联系电话",
                        prop: "contactNumber",
                        width: 150,
                    },
                    {
                        label: "联系地址",
                        prop: "address",
                        span: 24,
                        minRows: 2,
                        type: "textarea",
                        hide: true,
                    },
                    {
                        label: "账号额度",
                        prop: "accountNumber",
                        width: 90,
                        slot: true,
                        addDisplay: false,
                        editDisplay: false,
                    },
                    {
                        label: "过期时间",
                        prop: "expireTime",
                        width: 180,
                        slot: true,
                        addDisplay: false,
                        editDisplay: false,
                    },
                    {
                        label: "绑定域名",
                        prop: "domainUrl",
                        span: 24,
                    },
                    {
                        label: "系统背景",
                        prop: "backgroundUrl",
                        type: 'upload',
                        listType: 'picture-img',
                        dataType: 'string',
                        action: '/api/blade-resource/oss/endpoint/put-file',
                        propsHttp: {
                            res: 'data',
                            url: 'link',
                        },
                        hide: true,
                        span: 24,
                    },
                ]
            },
            rules: [{
              required: true,
              message: "请选择数据源",
              trigger: "blur"
            }]
          },
        ]
      },
      packageForm: {},
      packageOption: {
        column: [
          {
            label: "产品包",
            prop: "packageId",
            search: true,
            span: 24,
            type: "select",
            dicUrl: "/api/blade-system/tenant-package/select",
            props: {
              label: "packageName",
              value: "id"
            data: [],
            settingForm: {},
            settingOption: {
                column: [
                    {
                        label: "账号额度",
                        prop: "accountNumber",
                        type: "number",
                        span: 24,
                    },
                    {
                        label: "过期时间",
                        prop: "expireTime",
                        type: "date",
                        format: "yyyy-MM-dd hh:mm:ss",
                        valueFormat: "yyyy-MM-dd hh:mm:ss",
                        span: 24,
                    },
                ]
            },
            datasourceForm: {},
            datasourceOption: {
                column: [
                    {
                        label: "数据源",
                        prop: "datasourceId",
                        search: true,
                        span: 24,
                        type: "select",
                        dicUrl: "/api/blade-develop/datasource/select",
                        props: {
                            label: "name",
                            value: "id"
                        },
                        rules: [{
                            required: true,
                            message: "请选择数据源",
                            trigger: "blur"
                        }]
                    },
                ]
            },
            packageForm: {},
            packageOption: {
                column: [
                    {
                        label: "产品包",
                        prop: "packageId",
                        search: true,
                        span: 24,
                        type: "select",
                        dicUrl: "/api/blade-system/tenant-package/select",
                        props: {
                            label: "packageName",
                            value: "id"
                        }
                    },
                    {
                        label: "菜单预览",
                        prop: "menuId",
                        span: 24,
                        type: "tree",
                        dicData: [],
                        hide: true,
                        multiple: true,
                        props: {
                            label: "title"
                        },
                    },
                ]
            },
        }
    },
    watch: {
        'packageForm.packageId' () {
            if (!validatenull(this.packageForm.packageId)) {
                packageDetail(this.packageForm.packageId).then(res => {
                    this.packageForm.menuId = res.data.data.menuId
                    this.initData()
                })
            }
          },
          {
            label: "菜单预览",
            prop: "menuId",
            span: 24,
            type: "tree",
            dicData: [],
            hide: true,
            multiple: true,
            props: {
              label: "title"
            },
          },
        ]
      },
    };
  },
  watch: {
    'packageForm.packageId'() {
      if (!validatenull(this.packageForm.packageId)) {
        packageDetail(this.packageForm.packageId).then(res => {
          this.packageForm.menuId = res.data.data.menuId;
          this.initData();
        });
      }
        }
    },
    computed: {
        ...mapGetters(["userInfo", "permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.tenant_add, false),
                viewBtn: this.vaildData(this.permission.tenant_view, false),
                delBtn: this.vaildData(this.permission.tenant_delete, false),
                editBtn: this.vaildData(this.permission.tenant_edit, false)
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
        tenantId () {
            return this.selectionList[0].tenantId
        }
    },
    methods: {
        initData () {
            getMenuTree().then(res => {
                const column = this.findObject(this.packageOption.column, "menuId")
                column.dicData = res.data.data
            })
        },
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        beforeOpen (done, type) {
            if (["view"].includes(type)) {
                getDetail(this.form.id).then(res => {
                    const data = res.data.data
                    if (!(data.accountNumber > 0)) {
                        data.accountNumber = "不限制"
                    }
                    if (!data.expireTime) {
                        data.expireTime = "不限制"
                    }
                    this.form = data
                })
            }
            done()
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        handleSetting () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            if (this.selectionList.length === 1) {
                getDetail(this.selectionList[0].id).then(res => {
                    const data = res.data.data
                    this.settingForm.accountNumber = data.accountNumber
                    this.settingForm.expireTime = data.expireTime
                })
            } else {
                this.settingForm.accountNumber = -1
                this.settingForm.expireTime = ''
            }
            this.box = true
        },
        handleDatasource () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            if (this.selectionList.length !== 1) {
                this.$message.warning("只能选择一条数据")
                return
            }
            getDetail(this.selectionList[0].id).then(res => {
                const data = res.data.data
                this.datasourceForm.datasourceId = data.datasourceId
            })
            this.datasourceBox = true
        },
        handlePackage () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            if (this.selectionList.length !== 1) {
                this.$message.warning("只能选择一条数据")
                return
            }
            if (this.selectionList.length === 1) {
                packageInfo(this.selectionList[0].id).then(res => {
                    const data = res.data.data
                    this.packageForm.packageId = data.id
                    this.packageForm.menuId = data.menuId
                })
            } else {
                this.packageForm.menuId = ''
            }
            this.packageBox = true
            //更新字典远程数据
            setTimeout(() => {
                const form = this.$refs.formPackage
                form.updateDic('packageId')
            }, 10)
        },
        handlePackageSetting () {
            this.packageSettingBox = true
        },
        handleSubmit (form, done, loading) {
            setting(this.ids, form).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "配置成功!"
                })
                done()
                this.box = false
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        handleDatasourceSubmit (form, done, loading) {
            datasource(this.tenantId, form.datasourceId).then(() => {
                this.$message({
                    type: "success",
                    message: "配置成功!"
                })
                done()
                this.datasourceBox = false
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        handlePackageSubmit (form, done, loading) {
            packageSetting(this.tenantId, form.packageId).then(() => {
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "配置成功!"
                })
                done()
                this.packageBox = false
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            this.loading = true
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        }
    }
  },
  computed: {
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.tenant_add, false),
        viewBtn: this.vaildData(this.permission.tenant_view, false),
        delBtn: this.vaildData(this.permission.tenant_delete, false),
        editBtn: this.vaildData(this.permission.tenant_edit, false)
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    tenantId() {
      return this.selectionList[0].tenantId;
    }
  },
  methods: {
    initData() {
      getMenuTree().then(res => {
        const column = this.findObject(this.packageOption.column, "menuId");
        column.dicData = res.data.data;
      });
    },
    rowSave(row, done, loading) {
      add(row).then(() => {
        this.onLoad(this.page);
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
      }, error => {
        window.console.log(error);
        loading();
      });
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(() => {
        this.onLoad(this.page);
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
      }, error => {
        window.console.log(error);
        loading();
      });
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        });
    },
    beforeOpen(done, type) {
      if (["view"].includes(type)) {
        getDetail(this.form.id).then(res => {
          const data = res.data.data;
          if (!(data.accountNumber > 0)) {
            data.accountNumber = "不限制";
          }
          if (!data.expireTime) {
            data.expireTime = "不限制";
          }
          this.form = data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
    },
    handleSetting() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      if (this.selectionList.length === 1) {
        getDetail(this.selectionList[0].id).then(res => {
          const data = res.data.data;
          this.settingForm.accountNumber = data.accountNumber;
          this.settingForm.expireTime = data.expireTime;
        });
      } else {
        this.settingForm.accountNumber = -1;
        this.settingForm.expireTime = '';
      }
      this.box = true;
    },
    handleDatasource() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      if (this.selectionList.length !== 1) {
        this.$message.warning("只能选择一条数据");
        return;
      }
      getDetail(this.selectionList[0].id).then(res => {
        const data = res.data.data;
        this.datasourceForm.datasourceId = data.datasourceId;
      });
      this.datasourceBox = true;
    },
    handlePackage() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      if (this.selectionList.length !== 1) {
        this.$message.warning("只能选择一条数据");
        return;
      }
      if (this.selectionList.length === 1) {
        packageInfo(this.selectionList[0].id).then(res => {
          const data = res.data.data;
          this.packageForm.packageId = data.id;
          this.packageForm.menuId = data.menuId;
        });
      } else {
        this.packageForm.menuId = '';
      }
      this.packageBox = true;
      //更新字典远程数据
      setTimeout(() => {
        const form = this.$refs.formPackage;
        form.updateDic('packageId');
      }, 10);
    },
    handlePackageSetting() {
      this.packageSettingBox = true;
    },
    handleSubmit(form, done, loading) {
      setting(this.ids, form).then(() => {
        this.onLoad(this.page);
        this.$message({
          type: "success",
          message: "配置成功!"
        });
        done();
        this.box = false;
      }, error => {
        window.console.log(error);
        loading();
      });
    },
    handleDatasourceSubmit(form, done, loading) {
      datasource(this.tenantId, form.datasourceId).then(() => {
        this.$message({
          type: "success",
          message: "配置成功!"
        });
        done();
        this.datasourceBox = false;
      }, error => {
        window.console.log(error);
        loading();
      });
    },
    handlePackageSubmit(form, done, loading) {
      packageSetting(this.tenantId, form.packageId).then(() => {
        this.onLoad(this.page);
        this.$message({
          type: "success",
          message: "配置成功!"
        });
        done();
        this.packageBox = false;
      }, error => {
        window.console.log(error);
        loading();
      });
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    }
  }
};
}
</script>
<style>
</style>
<style></style>
Diff truncated after the above file
src/views/system/topmenu.vue src/views/system/user.vue src/views/task/index.vue src/views/task/reportForRepairs.vue src/views/tool/code.vue src/views/userHouse/hireInfoList.vue src/views/userHouse/houseHoldList.vue src/views/userHouse/houseList.vue src/views/work/claim.vue src/views/work/send.vue src/views/work/start.vue