瀏覽代碼

安全检查定义及管理

jiawuxian 2 年之前
父節點
當前提交
442e6b3f17

+ 65 - 0
src/api/safetycheck/rule.js

@@ -0,0 +1,65 @@
+import request from "@/utils/request";
+
+// 查询【请填写功能名称】列表
+export function list(query) {
+  return request({
+    url: "/core/safetycheck/rule/page",
+    method: "get",
+    params: query,
+  });
+}
+
+// 查询【请填写功能名称】详细
+export function get(id) {
+  return request({
+    url: "/core/safetycheck/rule/" + id,
+    method: "get",
+  });
+}
+
+// // 新增【请填写功能名称】
+// export function add(data) {
+//   return request({
+//     url: '/core/safetycheck/rule',
+//     method: 'post',
+//     data: data
+//   })
+// }
+//  /**
+//    * 检查新的规范类型在检查项】检查内容是否需要更新
+//    * @param id
+//    * @param ruleType
+//    * @returns
+//    */
+//  export function checkRuleType(id, ruleType) {
+//     return request(`/appRule/check/${id}/${ruleType}`);
+//   }
+
+// 修改【请填写功能名称】
+export function update(data) {
+  return request({
+    url: "/core/safetycheck/rule/edit",
+    method: "post",
+    data: data,
+    showLoading: true,
+  });
+}
+
+// 删除【请填写功能名称】
+export function remove(id) {
+  return request({
+    url: "/core/safetycheck/rule/" + id,
+    method: "delete",
+  });
+}
+
+/**
+ * 返回登录机构可使用的履职内容库
+ */
+export function ruleListForOrg(query) {
+  return request({
+    url: "/core/safetycheck/rule/ruleListForOrg",
+    method: "get",
+    params: query,
+  });
+}

+ 68 - 0
src/api/safetycheck/ruleManager.js

@@ -0,0 +1,68 @@
+import request from '@/utils/request'
+
+// 查询【请填写功能名称】列表
+export function treeData() {
+  return request({
+    url: '/core/safetycheck/ruleItem/rule/tree',
+    method: 'get'
+  })
+}
+
+// 查询【请填写功能名称】列表
+export function page(query) {
+  return request({
+    url: '/core/safetycheck/ruleItem/page',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询【请填写功能名称】详细
+export function get(id) {
+  return request({
+    url: '/core/safetycheck/ruleItem/' + id,
+    method: 'get'
+  })
+}
+
+// // 新增【请填写功能名称】
+// export function add(data) {
+//   return request({
+//     url: '/core/safetycheck/ruleItem',
+//     method: 'post',
+//     data: data
+//   })
+// }
+
+// 修改【请填写功能名称】
+export function update(data) {
+  return request({
+    url: '/core/safetycheck/ruleItem/edit',
+    method: 'post',
+    data: data,
+    showLoading: true,
+  })
+}
+
+// 删除【请填写功能名称】
+export function del(id) {
+  return request({
+    url: '/core/safetycheck/ruleItem/' + id,
+    method: 'delete'
+  })
+}
+
+
+
+/**
+ * 返回履职内容列表
+ * @param {} query 
+ * @returns 
+ */
+export function pointSelectionPage(query){
+  return request({
+    url: '/core/safetycheck/ruleItem/pointSelectionPage',
+    method: 'get',
+    params: query
+  })
+}

+ 177 - 0
src/views/safetycheck/rule/dialog.edit.vue

@@ -0,0 +1,177 @@
+<template>
+  <div class="rule-type">
+    <el-dialog
+      :title="id ? '编辑检查内容库定义' : '新增检查内容库定义'"
+      :visible.sync="isShow"
+      @close="onHide"
+      width="500px"
+    >
+      <div class="page-body">
+        <el-form
+          :model="formData"
+          :rules="formDataRules"
+          size="small"
+          ref="form"
+          label-position="right"
+          label-width="130px"
+          label-prefix=":"
+        >
+          <el-form-item prop="name" label="检查内容库名称:">
+            <el-input
+              v-model="formData.name"
+              :maxlength="50"
+              placeholder="请输入检查内容库名称"
+              clearable
+            />
+          </el-form-item>
+
+          <el-form-item prop="type" label="检查类型:">
+            <el-select
+              label="检查类型"
+              v-model="formData.type"
+              placeholder="请选择检查类型"
+              clearable
+            >
+              <el-option
+                v-for="item in ruleTypeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+          <el-form-item prop="orgType" label="检查机构类型:">
+            <el-select
+              prop="orgType"
+              label="检查机构类型"
+              v-model="formData.orgType"
+              placeholder="请选择检查机构类型"
+              clearable
+            >
+              <el-option
+                v-for="item in orgTypeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+          <el-form-item prop="status" label="状态:">
+            <el-select
+              prop="status"
+              label="状态"
+              v-model="formData.status"
+              placeholder="请选择状态"
+              clearable
+            >
+              <el-option
+                v-for="item in statusOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="remark" label="备注">
+            <el-input v-model="formData.remark" :maxlength="255" clearable />
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isShow=false">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import * as api from "@/api/resumption/rule";
+
+export default {
+  data() {
+    return {
+      id: null,
+      isShow: false,
+      formData: this.reset(),
+      formDataRules: {
+        name: [{ required: true, message: "请输入检查内容库名称" }],
+        type: [{ required: true, message: "请选择检查类型" }],
+        orgType: [{ required: true, message: "请选择检查机构类型" }],
+        status: [{ required: true, message: "请选择状态" }],
+      },
+    };
+  },
+  props: {
+    orgTypeOptions: {
+      type: Array,
+    },
+    ruleTypeOptions: {
+      type: Array,
+    },
+    statusOptions: {
+      type: Array,
+    },
+  },
+  watch: {},
+  computed: {
+    ...mapState([]),
+  },
+  methods: {
+    ...mapMutations([]),
+    reset() {
+      return {
+        id: null,
+        name: null,
+        type: null,
+        orgType: null,
+        status: null,
+        remark: null,
+      };
+    },
+    async refresh(id, other) {
+      this.formData = id ? (await api.get(id)).data : this.reset(other);
+    },
+    async show(id, other = {}) {
+      this.id = id;
+      await this.refresh(id, other);
+      this.isShow = true;
+    },
+
+    // 事件
+    onHide() {   
+      this.formData=this.reset();
+      this.$refs.form.resetFields(); 
+    },
+    onSubmit() {
+      this.$refs.form.validate(async (isValidate) => {
+        if (!isValidate) return;
+        await api.update(this.formData);
+        this.$emit("success");
+        this.isShow = false;
+      });
+    },
+
+    // 事件
+    //apimark//
+  },
+  mounted() {},
+  components: {},
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 336 - 0
src/views/safetycheck/rule/index.vue

@@ -0,0 +1,336 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <!--机构数据-->
+      <el-col :span="4" :xs="24">
+        <org-tree
+          v-model="queryParams.orgId"
+          @defaultKey="getDefaultKey"
+          @checkChange="checkChange"
+          @click="clickTreeNode"
+          hangsheTree
+        ></org-tree>
+      </el-col>
+
+      <el-col :span="20" :xs="24">
+        <!--    搜索条件    -->
+        <el-form
+          :model="queryParams"
+          ref="search"
+          size="small"
+          :inline="true"
+          v-show="showSearch"
+          label-width="100px"
+        >
+          <el-form-item prop="name" label="检查库名称">
+            <el-input
+              v-model="queryParams.name"
+              :maxlength="50"
+              placeholder="请输入检查库名称"
+              clearable
+            />
+          </el-form-item>
+          <el-form-item prop="type" label="检查类型">
+            <el-select
+              prop="ruleTypeId"
+              label="检查类型"
+              v-model="queryParams.type"
+              placeholder="请选择检查类型"
+              clearable
+            >
+              <el-option
+                v-for="dict in dict.type.rule_type"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item prop="orgType" label="检查机构类型">
+            <el-select
+              prop="orgType"
+              label="检查机构类型"
+              v-model="queryParams.orgType"
+              placeholder="请选择检查机构类型"
+              clearable
+            >
+              <el-option
+                v-for="item in dict.type.sys_org_type"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="mini"
+              @click="refresh"
+              v-hasPermi="['resumption:rule:query']"
+              >搜索</el-button
+            >
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+              >重置</el-button
+            >
+          </el-form-item>
+        </el-form>
+
+        <!--    按纽    -->
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              icon="el-icon-plus"
+              size="mini"
+              @click="handleAdd()"
+              v-hasPermi="['resumption:rule:add']"
+              >新增</el-button
+            >
+          </el-col>
+          <!-- <el-col :span="1.5">
+            <el-button
+              type="success"
+              plain
+              icon="el-icon-edit"
+              size="mini"
+              :disabled="single"
+              @click="handleUpdate"
+              v-hasPermi="['system:user:edit']"
+              >修改</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="danger"
+              plain
+              icon="el-icon-delete"
+              size="mini"
+              :disabled="multiple"
+              @click="handleDelete"
+              v-hasPermi="['system:user:remove']"
+              >删除</el-button
+            > 
+          </el-col>-->
+
+          <right-toolbar
+            :showSearch.sync="showSearch"
+            @queryTable="getList"
+            :columns="columns"
+          ></right-toolbar>
+        </el-row>
+
+        <el-table
+          v-loading="loading"
+          :data="pageData"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column
+            type="index"
+            label="序号"
+            v-if="columns[0].visible"
+          ></el-table-column>
+          <el-table-column
+            prop="name"
+            label="检查库名称"
+            v-if="columns[1].visible"
+          ></el-table-column>
+          <el-table-column
+            prop="typeName"
+            label="检查类型"
+            v-if="columns[2].visible"
+          >
+            <template slot-scope="r"
+              >{{ getLabel(dict.type.rule_type, r.row.type) }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="orgType"
+            label="检查机构类型"
+            v-if="columns[3].visible"
+          >
+            <template slot-scope="r"
+              >{{ getLabel(dict.type.sys_org_type, r.row.orgType) }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="orgName"
+            label="发布机构"
+            v-if="columns[4].visible"
+          ></el-table-column>
+          <el-table-column prop="status" label="状态" v-if="columns[5].visible">
+            <template slot-scope="r">
+              <span>{{ getLabel(dict.type.plan_status, r.row.status) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="remark"
+            label="备注"
+            v-if="columns[6].visible"
+          ></el-table-column>
+          <el-table-column label="操作">
+            <template slot-scope="r">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-edit"
+                @click="onEdit(r.row.id)"
+                v-hasPermi="['resumption:rule:edit']"
+                >修改</el-button
+              >
+              <el-popconfirm
+                title="确定删除检查内容库定义?"
+                @confirm="onDel(r.row.id)"
+              >
+                <el-button type="text" size="small" slot="reference" icon="el-icon-delete" v-hasPermi="['resumption:rule:remove']">删除</el-button>
+              </el-popconfirm>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </el-col>
+    </el-row>
+    <dialog-edit
+      ref="editDialog"
+      @success="getList()"
+      :orgTypeOptions="dict.type.sys_org_type"
+      :ruleTypeOptions="dict.type.rule_type"
+      :statusOptions="dict.type.plan_status"
+    ></dialog-edit>
+  </div>
+</template>
+
+<script>
+import OrgTree from "@/components/orgTree";
+import { mapState, mapMutations } from "vuex";
+import DialogEdit from "./dialog.edit";
+import * as api from "@/api/safetycheck/rule";
+import { getLabel } from "./../../commonOption";
+
+export default {
+  name: "safetycheckruletype",
+  dicts: ["sys_org_type", "rule_type", "plan_status"],
+  components: {
+    DialogEdit,
+    OrgTree,
+  },
+  data() {
+    const { params, query } = this.$route;
+    return {
+      isShow: false,
+      loading: false,
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      total: 0,
+      queryParams: {
+        orgId: null,
+        name: null,
+        type: null,
+        orgType: null,
+        pageNum: 1,
+        pageSize: 10,
+        ...query,
+      },
+      pageData: [],
+      // 列信息
+      columns: [
+        { key: 0, label: `序号`, visible: true },
+        { key: 1, label: `检查库名称`, visible: true },
+        { key: 2, label: `检查库类型`, visible: true },
+        { key: 3, label: `检查机构类型`, visible: true },
+        { key: 4, label: `发布机构`, visible: true },
+        { key: 5, label: `状态`, visible: true },
+        { key: 6, label: `备注`, visible: true },
+      ],
+    };
+  },
+  props: {},
+  watch: {},
+  computed: {
+    ...mapState([]),
+  },
+  methods: {
+    ...mapMutations([]),
+    getLabel,
+    refresh() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    getList() {
+      this.loading = true;
+      console.info(this.dict.type);
+      api
+        .list(this.queryParams)
+        .then((response) => {
+          this.pageData = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    getDefaultKey(key) {
+      this.queryParams.orgId = key;
+      this.getList();
+    },
+    handleAdd(id, other = {}) {
+      this.$refs.editDialog.show(id, other);
+    },
+    onEdit(id, other = {}) {
+      this.$refs.editDialog.show(id, other);
+    },
+    async onDel(id) {
+      await api.remove(id);
+      this.$message.info("删除成功");
+      this.getList();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.userId);
+      this.single = selection.length != 1;
+      this.multiple = !selection.length;
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("search");
+      // this.queryParams.orgId = undefined;
+      // this.$refs.tree.setCurrentKey(null);
+      this.getList();
+    },
+    //单选框状态改变
+    checkChange(state) {
+      this.queryParams.checkSub = state;
+      this.getList();
+    },
+    // 节点单击事件
+    clickTreeNode(data) {
+      this.queryParams.orgId = data.id;
+      this.getList();
+    },
+    //apimark//
+  },
+  mounted() {},
+};
+</script>
+
+<style lang="scss" scoped>
+.brand {
+}
+</style>

+ 154 - 0
src/views/safetycheck/ruleManager/dialog.editItem.vue

@@ -0,0 +1,154 @@
+<template>
+  <div class="rule-type">
+    <el-dialog
+      :title="!formData.id ? '新增检查项' : '编辑检查项'"
+      :visible.sync="dialogVisible"
+      width="50%"
+      :show-close="true"
+      @close="onHide"
+    >
+      <div>
+        <div class="box">
+          <el-form
+            ref="form"
+            :model="formData"
+            :rules="formDataRules"
+            label-width="110px"
+          >
+            <el-form-item prop="name" label="检查项">
+              <el-input
+                v-model="formData.name"
+                :maxlength="50"
+                name="name"
+                placeholder="请输入检查项"
+                clearable
+              />
+            </el-form-item>
+          </el-form>
+        </div>
+        <div class="box">
+          <p>检查内容</p>
+          <div style="margin-bottom: 10px">
+            <el-button type="primary" @click="onEdit(-1)">新增检查内容</el-button>
+          </div>
+          <el-table :data="formData.pointDtoList" border style="width: 100%">
+            <el-table-column prop="name" label="检查内容"> </el-table-column>
+            <el-table-column prop="areaName" label="检查区域">
+            </el-table-column>
+            <el-table-column label="操作" width="140">
+              <template slot-scope="scope">
+                <el-button
+                  type="text"
+                  size="small"
+                  @click="onEdit(scope.$index, scope.row)"
+                  >编辑</el-button
+                >
+                <el-button
+                  type="text"
+                  size="small"
+                  @click="delitem(scope.$index)"
+                  >删除</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="onSubmit()">保 存</el-button>
+      </span>
+    </el-dialog>
+    <EditPoint
+      ref="editDialog"
+      @submit="onPointSubmit"
+      :rule="rule"
+      v-bind="$attrs"
+    ></EditPoint>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import EditPoint from "./dialog.editPoint.vue";
+import { get, update } from "@/api/resumption/ruleManager.js";
+
+export default {
+  data() {
+    return {
+      dialogVisible: false,
+      formData: this.reset(),
+      formDataRules: {
+        name: [{ required: true, message: "请输入检查项" }],
+      },
+    };
+  },
+  props: {
+    rule: {
+      type: Object,
+    },
+  },
+  watch: {},
+  computed: {
+    ...mapState([]),
+  },
+  methods: {
+    ...mapMutations([]),
+    reset() {
+      return {
+        id: null,
+        name: null,
+        ruleId: null,
+        pointDtoList: [],
+      };
+    },
+
+    async show(id) {
+      const data = id ? (await get(id)).data : this.reset();
+      this.formData = data;
+      this.dialogVisible = true;
+    },
+    // 事件
+    onHide() {
+      this.formData = this.reset();
+    },
+    async onSubmit() {
+      this.formData.ruleId = this.rule.id;
+      await update(this.formData).then((v) => {
+        console.log(v);
+        this.formData = this.reset();
+        this.dialogVisible = false;
+        this.$emit("success");
+      });
+    },
+    onclose() {
+      this.dataVisible = false;
+    },
+    onEdit(index, row) {
+      this.$refs.editDialog.show(index, { ...row });
+    },
+    onPointSubmit(index, point) {
+      if (index >= 0) {
+        this.$set(this.formData.pointDtoList, index, point);
+      } else {
+        this.formData.pointDtoList.push(point);
+      }
+    },
+    delitem(val) {
+      this.formData.pointDtoList.splice(val, 1);
+    },
+  },
+  mounted() {},
+  components: { EditPoint },
+};
+</script>
+
+<style lang="scss">
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 185 - 0
src/views/safetycheck/ruleManager/dialog.editPoint.vue

@@ -0,0 +1,185 @@
+<template>
+  <div class="rule-type">
+    <el-dialog
+      width="600px"
+      :title="index >= 0 ? '编辑检查内容' : '新增检查内容'"
+      :visible.sync="dataVisible"
+      :show-close="false"
+      @close="
+        () => {
+          this.$refs.form.resetFields();
+        }
+      "
+      append-to-body
+    >
+      <div>
+        <el-form
+          ref="form"
+          :model="formData"
+          :rules="formDataRules"
+          label-width="110px"
+          class="formbox"
+        >
+          <!-- <el-form-item label="检查要点编号" prop="pointNum">
+            <el-input
+              v-model="formData.pointNum"
+              type="number"
+              laceholder="请输入检查要点编号"
+              @blur="check()"
+              @input="formData.pointNum = Number(formData.pointNum)"
+            ></el-input>
+          </el-form-item> -->
+          <el-form-item label="检查内容" prop="name">
+            <el-input
+              v-model="formData.name"
+              placeholder="请输入检查内容"
+              maxlength="100"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="检查区域" prop="areaId">
+            <el-select
+              v-model="formData.areaId"
+              placeholder="请选择检查区域"
+              @change="onAreaChanged"
+              clearable
+            >
+              <el-option
+                v-for="item in areas"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="数据来源" prop="businessType">
+            <el-select
+              v-model="formData.businessType"
+              placeholder="请选择数据来源"
+              clearable
+            >
+              <el-option
+                v-for="item in pointDataSource"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="备注" prop="remark">
+            <el-input
+              type="textarea"
+              v-model="formData.remark"
+              maxlength="200"
+              :rows="3"
+              clearable
+            ></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dataVisible = false">取 消</el-button>
+        <el-button type="primary" @click="onSubmit()">{{
+          index >= 0 ? "保 存" : "添 加"
+        }}</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import { allAreaByOrgtype } from "@/api/system/area";
+export default {
+  data() {
+    return {
+      index: null,
+      dataVisible: false,
+      formData: this.reset(),
+      formDataRules: {
+        name: [{ required: true, message: "请输入检查内容" }],
+        areaId: [{ required: true, message: "请选择检查区域" }],
+      },
+      currentOrgType: null,
+      areas: [],
+    };
+  },
+  props: {
+    rule: {
+      type: Object,
+    },
+    pointDataSource: {
+      type: Array,
+      default: [],
+    },
+  },
+  watch: {},
+  computed: {
+    ...mapState([]),
+  },
+  methods: {
+    ...mapMutations([]),
+    reset() {
+      return {
+        id: null,
+        name: null,
+        areaId: null,
+        areaName: null,
+        businessType: null,
+        remark: null,
+      };
+    },
+    async show(index, data) {
+      if (index >= 0) {
+        this.index = index;
+        this.formData = data;
+      } else {
+        this.index = -1;
+        this.formData = this.reset();
+      }
+
+      // if (this.currentOrgType != this.rule.orgType) {
+      allAreaByOrgtype(this.rule.orgType).then((d) => {
+        this.currentOrgType = this.rule.orgType;
+        this.areas = d.data;
+      });
+      // }
+
+      this.dataVisible = true;
+    },
+    onSubmit() {
+      this.$refs.form.validate((isValidate) => {
+        if (!isValidate) return;
+        let obj = {};
+        obj = { ...this.formData };
+        if (obj.businessType == "") {
+          obj.businessType = null;
+        }
+
+        this.$emit("submit", this.index, obj);
+        this.dataVisible = false;
+      });
+    },
+    // 事件
+    onHide() {
+      this.isShow = false;
+    },
+    onAreaChanged(val) {
+      let area = this.areas.find((a) => a.id === val);
+      if (area) {
+        this.formData.areaName = area.name;
+      }
+    },
+  },
+  mounted() {},
+  components: {},
+};
+</script>
+
+<style lang="scss">
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 128 - 0
src/views/safetycheck/ruleManager/dialog.select.point.vue

@@ -0,0 +1,128 @@
+<template>
+  <el-dialog
+    title="选择检查要点"
+    :visible.sync="isShow"
+    class="g-dialog-select-safe-check"
+    :close-on-click-modal="false"
+    width="55%"
+    top="10vh"
+    append-to-body
+  >
+    <div class="el-dialog-div">
+      <g-search-table
+        ref="st"
+        url="/core/safetycheck/ruleItem/pointSelectionPage"
+        method="get"
+        :search-data="search"
+        :manual="true"
+        :pageable="true"
+        :select="true"
+        :select-default="selectList"
+        :drag="false"
+        @select="onSelect"
+      >
+        <!-- 搜索 -->
+        <template slot="searchs">
+          <el-form-item prop="ruleId" label="检查内容库">
+            <el-select v-model="search.ruleId">
+              <el-option
+                v-for="item in ruleList"
+                :value="item.id"
+                :key="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="key" label="关键字">
+            <el-input v-model="search.key"></el-input>
+          </el-form-item>
+        </template>
+
+        <!-- 表格 -->
+        <template slot="columns">
+          <el-table-column
+            prop="itemName"
+            label="检查项"
+           min-width="40%"
+          ></el-table-column>
+          <el-table-column label="检查内容" prop="pointName" min-width="40%"> </el-table-column>
+          <el-table-column
+            prop="areaName"
+            label="检查区域"
+            min-width="20%"
+          ></el-table-column>
+          <!--          <el-table-column prop="nfcName"
+                           label="采集点"
+                           width="120"></el-table-column>-->
+        </template>
+      </g-search-table>
+    </div>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="onHide">关闭</el-button>
+      <el-button type="primary" @click="onSubmit">确定</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import GSearchTable from "@/components/table/gx.search.table.vue";
+import { ruleListForOrg } from "@/api/safetycheck/rule.js";
+export default {
+  components: { GSearchTable },
+  data() {
+    return {
+      isShow: false,
+      selectList: [],
+      ruleList: [],
+      search: this.emptySearch(),
+    };
+  },
+  computed: {},
+  watch: {},
+  props: {
+    defaultSelect:{
+      type:Array
+    },
+    orgType:{
+      type:String
+    }
+  },
+  methods: {
+    show() {
+      this.search = this.emptySearch();
+      this.isShow = true;
+      this.selectList =this.defaultSelect; 
+      ruleListForOrg({ orgType: this.orgType }).then((r) => {
+        this.ruleList = r.data;
+        if (r.data && r.data.length > 0) {
+          this.search.ruleId = r.data[0].id;
+          // this.$refs.st.search();
+        }
+      });
+    },
+    onHide() {
+      this.isShow = false;
+    },
+    onSelect(item) {      
+      this.selectList = item;
+    },
+    onSubmit() {
+      let s=this.selectList
+      this.$emit("select", this.selectList);
+      this.onHide();
+    },
+    emptySearch() {
+      return {
+        ruleId: null,
+        itemName: null,
+      };
+    },
+  },
+  mounted() {},
+};
+</script>
+<style lang="scss" scoped>
+.el-dialog-div {
+  overflow: auto;
+}
+</style>

+ 445 - 0
src/views/safetycheck/ruleManager/index.vue

@@ -0,0 +1,445 @@
+<!-- 动环设备管理 -->
+<template>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <el-col :span="4" :xs="24">
+        <el-input placeholder="输入关键字进行过滤" v-model="filterText">
+        </el-input>
+        <el-tree
+          class="filter-tree"
+          :data="treedata"
+          node-key="id"
+          highlight-current
+          :expand-on-click-node="true"
+          :default-expanded-keys="topItemKeys"
+          :filter-node-method="filterNode"
+          accordion
+          @node-click="clicktreenode"
+          ref="tree"
+        >
+          <span class="custom-tree-node" slot-scope="{ node, data }">
+            <span :title="data.label" class="show-ellipsis" v-if="data.isRule==0">{{
+              data.label
+            }}</span>
+            <span v-else style="display: flex;">
+              <i class="el-icon-s-management" style="color:#008CD6;padding-top:3px;"></i>
+              <span :title="data.label" class="show-ellipsis" >{{
+              data.label
+            }}</span>
+            </span>
+          </span>
+        </el-tree>
+      </el-col>
+      <el-col :span="20" :xs="24">
+        <el-form
+          :model="queryParams"
+          ref="search"
+          size="small"
+          :inline="true"
+          v-show="showSearch"
+          label-width="100px"
+        >
+          <el-form-item prop="itemName" label="检查项">
+            <el-input
+              v-model="queryParams.itemName"
+              placeholder="请输入内容"
+              maxlength="50"
+              clearable
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="pointName" label="检查内容">
+            <el-input
+              v-model="queryParams.pointName"
+              placeholder="请输入检查内容"
+              maxlength="50"
+              clearable
+            ></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="mini"
+              @click="refresh"
+              v-hasPermi="['resumption:ruleManager']"
+              >搜索</el-button
+            >
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+              >重置</el-button
+            >
+          </el-form-item>
+        </el-form>
+        <!--    按纽    -->
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              @click="onAddItem()"
+              :disabled="rule ? false : true"
+              v-hasPermi="['resumption:ruleManager:add']"
+              v-if="rule && rule.orgId == orgId"
+              >新 增</el-button
+            >
+            <!-- <el-button
+              type="primary"
+              @click="onSelect()"
+              >选择</el-button
+            > -->
+            <el-button
+              type="warning"
+              @click="dakai"
+              :disabled="rule ? false : true"
+              >{{ expandAll ? "收起所有行" : "展开所有行" }}</el-button
+            >
+          </el-col>
+          <!-- <el-col :span="1.5">
+            <el-button
+              type="success"
+              plain
+              icon="el-icon-edit"
+              size="mini"
+              :disabled="single"
+              @click="handleUpdate"
+              v-hasPermi="['system:user:edit']"
+              >修改</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="danger"
+              plain
+              icon="el-icon-delete"
+              size="mini"
+              :disabled="multiple"
+              @click="handleDelete"
+              v-hasPermi="['system:user:remove']"
+              >删除</el-button
+            > 
+          </el-col>-->
+
+          <right-toolbar
+            :showSearch.sync="showSearch"
+            @queryTable="getList"
+            :columns="columns"
+          ></right-toolbar>
+        </el-row>
+        <el-table
+          :data="tableData"
+          border
+          :default-expand-all="expandAll"
+          v-if="fresh"
+          style="width: 100%"
+        >
+          <el-table-column type="expand">
+            <template slot-scope="props">
+              <el-table
+                :data="props.row.pointDtoList"
+                border
+                style="width: 100%"
+              >
+                <el-table-column
+                  prop="name"
+                  label="检查内容"
+                  v-if="columns[3].visible"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="areaName"
+                  label="检查区域"
+                  v-if="columns[4].visible"
+                >
+                </el-table-column>
+                <!-- <el-table-column prop="dataTypeName" label="数据类型">
+                </el-table-column>
+                <el-table-column prop="degreeRiskName" label="风险等级">
+                </el-table-column> -->
+              </el-table>
+            </template>
+          </el-table-column>
+          <el-table-column
+            type="index"
+            label="序号"
+            width="80"
+            v-if="columns[0].visible"
+          >
+          </el-table-column>
+          <el-table-column prop="name" label="检查项" v-if="columns[1].visible">
+          </el-table-column>
+          <!-- <el-table-column prop="itemDesc" label="标准及要求">
+          </el-table-column> -->
+          <el-table-column
+            prop="pointNums"
+            label="检查内容数量"
+            v-if="columns[2].visible"
+          >
+          </el-table-column>
+          <el-table-column label="操作" width="140">
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                size="small"
+                icon="el-icon-edit"
+                @click="onEditItem(scope.row.id)"
+                v-hasPermi="['resumption:ruleManager:edit']"
+                >编辑</el-button
+              > 
+                    
+              <el-popconfirm
+                title="将删除检查项及其下所有检查内容,确定删除?"
+                @confirm="deldata(scope.row.id)"
+              >
+                <el-button type="text" size="small" slot="reference" icon="el-icon-delete" v-hasPermi="['resumption:ruleManager:remove']">删除</el-button>
+              </el-popconfirm>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </el-col>
+    </el-row>
+    <dialog-edit
+      ref="dialogEdit"
+      :rule="rule"
+      :pointDataSource="dict.type.point_data_source"
+      @success="onSuccess"
+    ></dialog-edit>
+  </div>
+</template>
+
+<script>
+import { mapGetters, mapMutations } from "vuex";
+import { page, treeData, del } from "@/api/safetycheck/ruleManager.js";
+import DialogEdit from "./dialog.editItem.vue";
+
+export default {
+  name: "safetycheckRuleManager",
+  props: [],
+  dicts: ["point_data_source"],
+  data() {
+    return {
+      queryParams: {
+        ruleId: null,
+        itemName: null,
+        pointName: null,
+        pageNum: 1,
+        pageSize: 10,
+      },
+      filterText: null,
+      showSearch: true,
+      rule: null, //选中的内容库
+      // orgOfRule:null,//选中内容库
+      expandAll: false,
+      fresh: true,
+      // checked: false,
+      // item: {
+      //   label: "",
+      //   value: "",
+      // },
+      treedata: [],
+      tableData: [],
+
+      total: 0,
+      topItemKeys: [],
+      // defaultProps: {
+      //   children: "children",
+      //   label: "label",
+      // },
+      columns: [
+        { key: 0, label: `序号`, visible: true },
+        { key: 1, label: `检查项`, visible: true },
+        { key: 2, label: `检查内容数量`, visible: true },
+        { key: 3, label: `检查内容`, visible: true },
+        { key: 4, label: `检查区域`, visible: true },
+      ],
+      currentOrgId:null,
+    };
+  },
+
+  components: { DialogEdit },
+
+  computed: {
+    ...mapGetters(["orgId"])
+    // ...mapState(["org", "loginUser"]),
+  },
+
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+    
+  },
+
+  async created() {
+    // this.OID = this.loginUser.org.id;
+    await this.gettreelist();
+    // await this.getList()
+    // await this.getassetlist();
+  },
+
+  mounted() {
+
+  },
+
+  methods: {
+    ...mapMutations([]),
+    dakai() {
+      this.expandAll = !this.expandAll;
+      this.fresh = false;
+      this.$nextTick(() => {
+        this.fresh = true;
+      });
+    },
+
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    async refresh() {
+      this.currentPage = 1;
+      this.getList();
+    },
+    async getList() {
+      if (!this.rule) {
+        this.$message.warning("请先选择一个检查内容库定义");
+        return;
+      }
+      const data = await page(this.queryParams);
+      this.tableData = data.rows;
+      this.total =Number.parseInt(data.total);
+      this.expandAll = false;
+    },
+    async gettreelist() {
+      await treeData().then((v) => {
+        this.treedata = v.data;
+        this.topItemKeys = v.data.map((d) => d.id);
+      });
+    },
+    handleSizeChange(val) {
+      this.pagesize = val;
+      this.getList();
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getList();
+    },
+    clicktreenode(data,node) {
+      if (!data.isRule) {
+        return;
+      }
+
+      this.expandAll = false;
+      this.fresh = false;
+      this.$nextTick(() => {
+        this.fresh = true;
+      });
+
+      this.queryParams.ruleId = data.id;
+      this.rule = data;
+      this.rule.orgId=node.parent.data.id
+      this.refresh();
+    },
+    async deldata(val) {
+      await del(val);
+      this.$message.info("删除成功");
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("search");
+      // this.queryParams.ruleId = undefined;
+      // this.$refs.tree.setCurrentKey(null);
+      this.getList();
+    },
+    onAddItem() {
+      if (!this.rule) {
+        this.$message.warning("请先选择检查内容库");
+        return;
+      }
+      this.$refs.dialogEdit.show(null);
+    },
+    onEditItem(itemId) {
+      this.$refs.dialogEdit.show(itemId);
+    },
+    onSelect(){
+      this.$refs.DialogSelect.show();
+    },
+    onSuccess(){
+      this.refresh();
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.show-ellipsis {
+  display: block;
+  width: 180px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+.search {
+  display: flex;
+  flex-wrap: wrap;
+  & > div {
+    width: 25%;
+    display: flex;
+    align-items: center;
+    margin-bottom: 12px;
+    & > span:first-child {
+      display: inline-block;
+      min-width: 70px;
+      font-size: 14px;
+      color: #606266;
+    }
+    &:nth-child(2),
+    &:nth-child(3) {
+      margin-left: 15px;
+    }
+    &:nth-child(3) > span {
+      display: inline-block;
+      min-width: 100px;
+      font-size: 14px;
+      color: #606266;
+    }
+    &:nth-child(1) > span {
+      display: inline-block;
+      min-width: 100px;
+      font-size: 14px;
+      color: #606266;
+    }
+    &:nth-child(1) {
+    }
+  }
+}
+.box {
+  border: 1px solid #eee;
+  margin-bottom: 20px;
+  border-radius: 5px;
+  padding: 10px;
+  min-height: 120px;
+  & > p {
+    font-size: 16px;
+    font-weight: bold;
+    margin-bottom: 15px;
+  }
+}
+.item {
+  margin-bottom: 14px;
+}
+::v-deep .el-table__expanded-cell[class*="cell"] {
+  padding: 0;
+  padding-left: 47px;
+}
+::v-deep .formbox {
+  display: flex;
+  flex-wrap: wrap;
+  .el-form-item {
+    width: 50%;
+  }
+}
+</style>