jiangping
2025-06-30 e13b3e65beb76c56c8e182083ef6f0e69009b0e2
最新版本541200007
已添加2个文件
已修改4个文件
303 ■■■■■ 文件已修改
admin/src/components/business/OperaCategoryFileWindow.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/business/OperaCompanyDocumentsWindow.vue 133 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/business/categoryFile.vue 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/operation/danger/areaSet.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.company_documents.permissions.sql 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/CompanyDocuments.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/business/OperaCategoryFileWindow.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
<template>
  <GlobalWindow :title="title" :visible.sync="visible" :confirm-working="isWorking" width="600px" @close="close" @confirm="confirm">
    <el-form :model="form" ref="form" :rules="rules">
      <el-form-item label="分类名称" prop="name">
        <el-input v-model="form.name" placeholder="请输入分类名称" v-trim />
      </el-form-item>
      <el-form-item label="排序码(降序)" prop="sortnum">
        <el-input type="number" v-model="form.sortnum" placeholder="请输入排序码" v-trim />
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input type="textarea" v-model="form.remark" placeholder="请输入备注" v-trim />
      </el-form-item>
    </el-form>
  </GlobalWindow>
</template>
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
export default {
  name: 'OperaCategoryFileWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      // è¡¨å•数据
      form: {
        name: '',
        type: 2,
        sortnum: null,
        remark: null
      },
      // éªŒè¯è§„则
      rules: {
        name: [
          { required: true, message: '请输入分类名称', trigger: 'blur' }
        ]
      },
      dataList: []
    }
  },
  created () {
    this.config({
      api: '/business/category',
      'field.id': 'id'
    })
  },
  methods: {
    open (title, target) {
      this.title = title
      this.visible = true
      // æ–°å»ºç»„织
      if (target == null) {
        this.$nextTick(() => {
          this.$refs.form.resetFields()
          this.form[this.configData['field.id']] = null
          this.form.type = 2
        })
        return
      }
      // ç¼–辑
      this.$nextTick(() => {
        for (const key in this.form) {
          this.form[key] = target[key]
        }
      })
    },
  }
}
</script>
admin/src/components/business/OperaCompanyDocumentsWindow.vue
@@ -10,19 +10,32 @@
        <el-input v-model="form.name" placeholder="请输入资料名称" v-trim/>
      </el-form-item>
      <el-form-item label="资料类型" prop="categoryId">
        <el-input v-model="form.categoryId" placeholder="请输入责任部门编码(关联company)" v-trim/>
        <el-select v-model="form.categoryId" clearable filterable placeholder="请选择">
          <el-option v-for="item in cateList" :key="item.id" :label="item.name" :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="责任部门" prop="companyId">
        <el-input v-model="form.companyId" placeholder="请输入责任部门编码(关联company)" v-trim/>
      </el-form-item>
      <el-form-item label="排序码" prop="sortnum">
        <el-input v-model="form.sortnum" placeholder="请输入排序码" v-trim/>
        <treeselect
            v-model="form.companyId"
            placeholder="请选择"
            :options="companyList"
            :normalizer="normalizeOptions"
            :default-expand-level="1"
            noChildrenText="没有子选项"
            noOptionsText="没有可选项"
            noResultsText="没有匹配的结果" />
      </el-form-item>
      <el-form-item label="附件地址" prop="fileurl">
        <el-input v-model="form.fileurl" placeholder="请输入附件地址" v-trim/>
        <UploadFile :uploadData="{ folder: 'company_documents',fileType:'' }" :fileList="fileList" @uploadSuccess="uploadFileBiz" />
<!--        <UploadFile width="100px" height="100px" :list="[]"  folder="company_documents" @success="uploadFileBiz($event, 2)" />-->
      </el-form-item>
      <el-form-item label="附件描述" prop="content">
        <el-input type="textarea" v-model="form.content" placeholder="请输入附件描述" v-trim/>
      </el-form-item>
      <el-form-item label="排序码(降序)" prop="sortnum">
        <el-input v-model="form.sortnum" placeholder="请输入排序码" v-trim/>
      </el-form-item>
    </el-form>
  </GlobalWindow>
@@ -31,33 +44,38 @@
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { fetchList as companyList } from '@/api/business/company'
import UploadFile from '@/components/common/UploadFile'
import { fetchList } from '@/api/business/category'
export default {
  name: 'OperaCompanyDocumentsWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  components: { GlobalWindow, UploadFile },
  data () {
    return {
      // è¡¨å•数据
      form: {
        id: null,
        creator: '',
        createDate: '',
        editor: '',
        editDate: '',
        isdeleted: '',
        name: '',
        remark: '',
        status: '',
        status: '0',
        sortnum: '',
        fileurl: '',
        fileName: '',
        fileSize: '',
        categoryId: '',
        companyId: '',
        content: ''
        categoryId: null,
        companyId: null,
        content: '',
        fileurlFull: ''
      },
      fileList:[],
      cateList: [],
      companyList: [],
      // éªŒè¯è§„则
      rules: {
        name: [{ required: true, message: '请输入资料名称', trigger: 'blur' }],
        companyId: [{ required: true, message: '请选择责任部门' }],
        categoryId: [{ required: true, message: '请选择资料类型' }],
        fileurl: [{ required: true, message: '请上传资料文件' }]
      }
    }
  },
@@ -66,6 +84,87 @@
      api: '/business/companyDocuments',
      'field.id': 'id'
    })
  },
  methods: {
    // è§„范化选项数据的方法
    normalizeOptions (node) {
      // node: åŽŸå§‹çš„é€‰é¡¹æ•°æ®
      // åœ¨è¿™é‡Œæ ¹æ®éœ€è¦è¿›è¡Œé€‰é¡¹æ•°æ®çš„规范化操作,并返回规范化后的选项数据
      // ä¾‹å¦‚,可以将原始的选项数据转换为符合插件要求的结构
      if (node.childList && !node.childList.length) {
        // åŽ»æŽ‰children=[]的children属性
        delete node.childList
      }
      return {
        id: node.id,
        label: node.name,
        children: node.childList
      }
    },
    open (title, target) {
      this.title = title
      this.visible = true
      this.getCate()
      this.getCompany()
      // æ–°å»ºç»„织
      if (target == null) {
        this.$nextTick(() => {
          this.$refs.form.resetFields()
          this.form[this.configData['field.id']] = null
        })
        return
      }
      // ç¼–辑
      this.$nextTick(() => {
        for (const key in this.form) {
          this.form[key] = target[key]
        }
      })
    },
    uploadFileBiz (file) {
      // this.$emit('uploadSuccess', { fileurl: data.imgaddr, fileurlFull: data.url, name: data.originname })
      this.form.fileurl = file.fileurl
      this.form.fileName = file.name
      this.form.fileurlFull = file.fileurlFull
      this.form.fileSize = file.fileSize
    },
    getCate () {
      fetchList({
        model: { type: 2 },
        capacity: 1000,
        page: 1
      }).then(res => {
        if (res && res.records && res.records.length > 0) {
          this.cateList = res.records || []
        }
      })
    },
    getCompany () {
      companyList()
        .then(res => {
          if (res && res.length > 0) {
            this.companyList = this.getDepartmentTree(res)
          }
        })
    },
    getDepartmentTree (tree) {
      if (tree == null) {
        return []
      }
      return tree.map(item => {
        const newItem = { ...item }
        if (newItem) {
          newItem.children = newItem.childList
        }
        if (item.children && item.children.length == 0) {
          this.$delete(newItem, 'children')
        } else {
          newItem.children = this.getDepartmentTree(newItem.children)
        }
        return newItem
      })
    }
  }
}
</script>
admin/src/views/business/categoryFile.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,84 @@
<template>
  <TableLayout :permissions="['business:category:query']">
    <!-- æœç´¢è¡¨å• -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="120px" inline>
      <el-form-item label="分类名称" prop="name">
        <el-input v-model="searchForm.name" clearable placeholder="请输入分类名称" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
    <template v-slot:table-wrap>
      <ul class="toolbar" v-permissions="['business:category:create','business:category:delete']">
        <li><el-button type="primary" @click="$refs.OperaCategoryFileWindow.open('新建资料分类')" icon="el-icon-plus" v-permissions="['business:category:create']">新建</el-button></li>
        <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">批量删除</el-button></li>
      </ul>
      <el-table
          :height="tableHeightNew"
          v-loading="isWorking.search"
          :data="tableData.list"
          stripe
          @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="name" show-overflow-tooltip label="资料分类" min-width="120px"></el-table-column>
        <el-table-column prop="sortnum" label="排序码"  min-width="70px"></el-table-column>
        <el-table-column prop="editDate" label="操作时间" width="160px"></el-table-column>
        <el-table-column
            v-if="containPermissions(['business:category:update', 'business:category:delete' ])"
            label="操作"
            min-width="140"
            fixed="right"
        >
          <template slot-scope="{row}">
            <el-button type="text" icon="el-icon-edit" @click="$refs.OperaCategoryFileWindow.open('编辑资料分类',row)" v-permissions="['business:category:update']">编辑</el-button>
            <el-button  type="text"  icon="el-icon-delete" @click="deleteById(row)" style="color: red" v-permissions="['business:category:delete']">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
          @size-change="handleSizeChange"
          @current-change="handlePageChange"
          :pagination="tableData.pagination"
      >
      </pagination>
    </template>
    <!-- æ–°å»º/修改 -->
    <OperaCategoryFileWindow ref="OperaCategoryFileWindow" @success="handlePageChange"/>
  </TableLayout>
</template>
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaCategoryFileWindow from '@/components/business/OperaCategoryFileWindow'
export default {
  name: 'areaSet',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaCategoryFileWindow },
  data () {
    return {
      // æœç´¢
      searchForm: {
        name: '',
        type: 2
      }
    }
  },
  created () {
    this.config({
      module: '资料分类',
      api: '/business/category',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
  }
}
</script>
admin/src/views/operation/danger/areaSet.vue
@@ -1,5 +1,5 @@
<template>
  <TableLayout :permissions="['business:member:query']">
  <TableLayout :permissions="['business:hiddendangerparam:query']">
    <!-- æœç´¢è¡¨å• -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="120px" inline>
      <el-form-item label="隐患区域" prop="name">
server/db/business.company_documents.permissions.sql
@@ -1,6 +1,7 @@
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:create', '新建隐患区域配置类型信息表', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:delete', '删除隐患区域配置类型信息表', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:update', '修改隐患区域配置类型信息表', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:query', '查询隐患区域配置类型信息表', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:exportExcel', '导出隐患区域配置类型信息表(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:create', '新建资料文件', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:delete', '删除资料文件', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:update', '修改资料文件', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:query', '查询资料文件', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:exportExcel', '导出资料文件(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/CompanyDocuments.java
@@ -18,7 +18,7 @@
 * @date 2025/06/27 16:01
 */
@Data
@ApiModel("隐患区域配置类型信息表")
@ApiModel("资料管理信息表")
@TableName("`company_documents`")
public class CompanyDocuments  extends LoginUserModel {