对比新文件 |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function getEvaluateList() { |
| | | return request({ |
| | | url: '/system/dictData/dictDataList', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | export function addEvaluate(data) { |
| | | return request({ |
| | | url: '/system/dictType/addDictType', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function editEvaluate(params) { |
| | | return request({ |
| | | url: `/system/dictType/editDictType`, |
| | | method: 'put', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | export function getLawDetail(params) { |
| | | return request({ |
| | | url: '/system/law/getLawById', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | export function delEvaluate(data) { |
| | | return request({ |
| | | url: `/system/dictType/remove/` + data.id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
对比新文件 |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function getInsitutionList() { |
| | | return request({ |
| | | url: '/system/agency/agencyList', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function changeInsitutionPublic(data) { |
| | | return request({ |
| | | url: '/system/agency/changePublic', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function getInstitutionDetail(params) { |
| | | return request({ |
| | | url: '/system/agency/getAgencyById', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
对比新文件 |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function getLawList() { |
| | | return request({ |
| | | url: '/system/law/lawList', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function addLaw(data) { |
| | | return request({ |
| | | url: '/system/law/addLaw', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function editLaw(params) { |
| | | return request({ |
| | | url: `/system/law/editLaw`, |
| | | method: 'put', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | export function getLawDetail(params) { |
| | | return request({ |
| | | url: '/system/law/getLawById', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | export function delLaw(data) { |
| | | return request({ |
| | | url: `/system/law/remove/` + data.id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | |
| | | <div class="title">{{state.content.title}}</div> |
| | | <el-divider border-style="dashed"/> |
| | | <div class="time">更新时间:{{state.content.updateTime?state.content.updateTime:state.content.createTime}}</div> |
| | | <div v-html="state.content.content"></div> |
| | | <div v-html="state.content.content" @click="showFile($event)"></div> |
| | | </div> |
| | | <div class="main" v-if="state.firstClass == '法律法规'"> |
| | | <div class="title">{{state.content.title}}</div> |
| | |
| | | import {ElMessage} from "element-plus"; |
| | | import {getLawsDetails, getNoticeDetails, getPublishDetails} from "../../api/home/homePage"; |
| | | import { getDict } from "@/api/login" |
| | | import axios from "axios"; |
| | | import {getToken} from "@/utils/auth"; |
| | | |
| | | const route = useRoute() |
| | | const router = useRouter() |
| | |
| | | } |
| | | } |
| | | |
| | | const showFile = (e) => { |
| | | if(e.target.nodeName === 'A'){ |
| | | console.log("e",e) |
| | | e.preventDefault(); |
| | | const file = { |
| | | fileUrl: e.target.href, |
| | | fileName: e.target.download |
| | | } |
| | | axios.get( file.fileUrl,{ |
| | | headers: |
| | | { |
| | | 'Content-Type': 'application/json', |
| | | 'Authorization':getToken(), |
| | | }, |
| | | responseType: 'blob' |
| | | } |
| | | ).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: res.data.type}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | link.setAttribute("download", file.fileName); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } else { |
| | | this.$message.error('获取文件失败') |
| | | } |
| | | this.handleClose(); |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const back = ()=>{ |
| | | if(state.firstClass == '通知公告'){ |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" width="75%" top="50vh" align-center @close="closeDialog"> |
| | | <el-form ref="registerRef" :model="registerForm" class="register-form" label-position="top"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.name" label="机构名称"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.name" |
| | | size="large" |
| | | placeholder="请输入机构名称" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.creditCode" label="社会信用代码"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.creditCode" |
| | | size="large" |
| | | placeholder="请输入社会信用代码" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.attribute" label="机构属性"> |
| | | <el-radio-group v-model="registerForm.agency.attribute" style="width: 50%" disabled> |
| | | <el-radio :label="0" size="large">疆内</el-radio> |
| | | <el-radio :label="1" size="large">疆外</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="agency.area" label="实际经营地址所属区域"> |
| | | <el-input v-model="registerForm.agency.area" disabled></el-input> |
| | | <!-- <el-cascader--> |
| | | <!-- v-model="registerForm.agency.area"--> |
| | | <!-- :options="state.areaList"--> |
| | | <!-- :props="props"--> |
| | | <!-- style="width: 100%"--> |
| | | <!-- size="large"--> |
| | | <!-- />--> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="agency.address" label="实际经营地址"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.address" |
| | | size="large" |
| | | placeholder="请输入实际经营地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="agency.legalPerson" label="法定代表人"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.legalPerson" |
| | | size="large" |
| | | placeholder="请输入法定代表人" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="agency.legalPhone" label="法人电话"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.legalPhone" |
| | | size="large" |
| | | placeholder="请输入法人电话" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="agency.manager" label="机构负责人"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.manager" |
| | | size="large" |
| | | placeholder="请输入机构负责人" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="agency.managerPhone" label="负责人电话"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.managerPhone" |
| | | size="large" |
| | | placeholder="请输入负责人电话" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.certNumber" label="资质证书编号"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.certNumber" |
| | | size="large" |
| | | placeholder="请输入机构负责人" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.issueDate" label="发证日期"> |
| | | <el-date-picker |
| | | disabled |
| | | v-model="registerForm.agency.issueDate" |
| | | type="date" |
| | | placeholder="请选择发证日期" |
| | | value-format="YYYY-MM-DD 00:00:00" |
| | | size="large" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.validDate" label="有效日期"> |
| | | <el-date-picker |
| | | disabled |
| | | v-model="registerForm.agency.validDate" |
| | | type="date" |
| | | placeholder="请选择有效日期" |
| | | value-format="YYYY-MM-DD 00:00:00" |
| | | size="large" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.assetValue" label="固定资产总值"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.assetValue" |
| | | type="number" |
| | | size="large" |
| | | placeholder="请输入固定资产总值" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.workArea" label="工作场所建筑面积"> |
| | | <el-input |
| | | disabled |
| | | type="number" |
| | | v-model="registerForm.agency.workArea" |
| | | size="large" |
| | | placeholder="请输入工作场所建筑面积" |
| | | ><template #append>㎡</template></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.archiveArea" label="档案室面积"> |
| | | <el-input |
| | | disabled |
| | | type="number" |
| | | v-model="registerForm.agency.archiveArea" |
| | | size="large" |
| | | placeholder="请输入档案室面积" |
| | | ><template #append>㎡</template></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.regAddress" label="注册地址"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.agency.regAddress" |
| | | size="large" |
| | | placeholder="请输入注册地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.business" label="申请的法定安全评价业务范围"> |
| | | <el-select disabled v-model="registerForm.agency.business" placeholder="请选择业务范围" multiple size="large" style="width: 100%"> |
| | | <el-option |
| | | v-for="item in state.busList" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.reportPath" label="加盖公章的《机构信息上报表》"> |
| | | <el-upload disabled :limit='state.imgLimit' :show-file-list="false" list-type="picture-card" > |
| | | <el-image v-if="imageUrl" style="width: 150px;height: 150px" :src="imageUrl" :preview-src-list="srcList"/> |
| | | <!-- <template #tip>--> |
| | | <!-- <div class="el-upload__tip">上传jpg/png图片尺寸小于5M,最多可上传1张</div>--> |
| | | <!-- </template>--> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="username" label="登录用户名(字母+数字,长度在5-16之间)"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.username" |
| | | size="large" |
| | | placeholder="请输入登录用户名" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="phone" label="用户电话"> |
| | | <el-input |
| | | disabled |
| | | v-model="registerForm.phone" |
| | | size="large" |
| | | placeholder="请输入用户电话" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-row :gutter="30">--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item prop="password" label="密码">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="registerForm.password"--> |
| | | <!-- type="password"--> |
| | | <!-- size="large"--> |
| | | <!-- placeholder="请输入密码"--> |
| | | <!-- show-password--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item prop="confirmPassword" label="确认密码">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="registerForm.confirmPassword"--> |
| | | <!-- type="password"--> |
| | | <!-- size="large"--> |
| | | <!-- auto-complete="off"--> |
| | | <!-- placeholder="确认密码"--> |
| | | <!-- show-password--> |
| | | <!-- >--> |
| | | <!-- </el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | </el-form> |
| | | <el-dialog v-model="state.dialogImg"> |
| | | <el-image style="width: 100%; height: 100%" :src="state.dialogImageUrl"/> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, watch, defineExpose, onMounted, reactive} from "vue" |
| | | import { getToken } from "@/utils/auth"; |
| | | import {getInstitutionDetail} from "@/api/backManage/insitution"; |
| | | import {getNoticeDetail} from "@/api/backManage/notice"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {getDict} from "@/api/login"; |
| | | import {getRegionTree} from "@/api/area"; |
| | | const imageUrl = ref(""); |
| | | const srcList = ref([]); |
| | | const registerForm = ref({ |
| | | agency:{ |
| | | name: "", |
| | | creditCode: "", |
| | | attribute: 0, |
| | | area: [], |
| | | province: '', |
| | | city: '', |
| | | district: '', |
| | | address: '', |
| | | legalPerson: '', |
| | | legalPhone: '', |
| | | manager: '', |
| | | managerPhone: '', |
| | | certNumber: '', |
| | | issueDate: '', |
| | | validDate: '', |
| | | assetValue: '', |
| | | workArea: '', |
| | | archiveArea: '', |
| | | regAddress: '', |
| | | business: '', |
| | | reportPath: '', |
| | | }, |
| | | username: '', |
| | | phone: '', |
| | | password: '', |
| | | confirmPassword: '' |
| | | }); |
| | | |
| | | |
| | | const props = { |
| | | expandTrigger: 'hover', |
| | | value: 'name', |
| | | label: 'name' |
| | | } |
| | | const state = reactive({ |
| | | areaList: [], |
| | | busList: [], |
| | | fileList: [], |
| | | imgLimit: 1, |
| | | uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile', |
| | | header: { |
| | | Authorization: 'Bearer ' + getToken() |
| | | }, |
| | | dialogImageUrl: '', |
| | | dialogImg: false |
| | | }) |
| | | |
| | | const loading = ref(false) |
| | | const dialogVisible = ref(false) |
| | | const registerRef = ref(null) |
| | | onMounted(()=>{ |
| | | getBusiness() |
| | | getArea() |
| | | }) |
| | | |
| | | const getBusiness = async ()=>{ |
| | | const res = await getDict({dictType: 'sys_business_scope'}) |
| | | if(res.code == 200){ |
| | | state.busList = res.data |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | const getArea = async ()=>{ |
| | | const type = registerForm.value.agency.attribute |
| | | const res = await getRegionTree({name: '',parentId: null,regionType: type}) |
| | | if(res.code == 200){ |
| | | state.areaList = res.data |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | const openDialog = async (val) => { |
| | | const param = { |
| | | agencyId: val.id |
| | | } |
| | | const res = await getInstitutionDetail(param); |
| | | if(res.code === 200){ |
| | | registerForm.value.agency = res.data |
| | | registerForm.value.agency.area = res.data.province+ " " +res.data.city + " " + res.data.district |
| | | registerForm.value.agency.business = res.data.business.split(",").map(Number) |
| | | imageUrl.value = import.meta.env.VITE_APP_BASE_API + "/" + res.data.reportPath |
| | | srcList.value.push(imageUrl.value) |
| | | // state.fileList.push({ |
| | | // 'url': imgUrl |
| | | // }) |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | dialogVisible.value = true; |
| | | } |
| | | |
| | | |
| | | const closeDialog = ()=>{ |
| | | dialogVisible.value = false; |
| | | state.fileList = [] |
| | | } |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }) |
| | | |
| | | </script> |
| | | <style lang='scss'> |
| | | ::v-deep(.el-overlay-dialog){ |
| | | .el-dialog:not(.is-fullscreen){ |
| | | margin-top: 500px !important; |
| | | } |
| | | } |
| | | </style> |
| | | <style lang='scss' scoped> |
| | | .register-form { |
| | | .el-input { |
| | | height: 40px; |
| | | input { |
| | | height: 40px; |
| | | } |
| | | } |
| | | .input-icon { |
| | | height: 39px; |
| | | width: 14px; |
| | | margin-left: 0px; |
| | | } |
| | | .el-radio-group{ |
| | | width: 200px !important; |
| | | } |
| | | } |
| | | .register-tip { |
| | | font-size: 13px; |
| | | text-align: center; |
| | | color: #bfbfbf; |
| | | } |
| | | .register-code { |
| | | width: 33%; |
| | | height: 40px; |
| | | float: right; |
| | | img { |
| | | cursor: pointer; |
| | | vertical-align: middle; |
| | | } |
| | | } |
| | | .el-register-footer { |
| | | height: 40px; |
| | | line-height: 40px; |
| | | position: fixed; |
| | | bottom: 0; |
| | | width: 100%; |
| | | text-align: center; |
| | | color: #fff; |
| | | font-family: Arial; |
| | | font-size: 12px; |
| | | letter-spacing: 1px; |
| | | } |
| | | .register-code-img { |
| | | height: 40px; |
| | | padding-left: 12px; |
| | | } |
| | | </style> |
| | |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | | <el-table-column label="序号" type="index" align="center" width="80" /> |
| | | <el-table-column label="机构名称" prop="name" align="center" /> |
| | | <el-table-column label="社会信用代码" prop="code" align="center" /> |
| | | <el-table-column label="机构属性" prop="lawSubTitle" align="center" /> |
| | | <el-table-column label="所属区域" prop="area" align="center" /> |
| | | <el-table-column label="资质证书编号" prop="institution" align="center" /> |
| | | <el-table-column label="发证日期" prop="date" align="center" /> |
| | | <el-table-column label="有效期" prop="date" align="center" /> |
| | | <el-table-column label="公示状态" prop="status" align="center" /> |
| | | <el-table-column label="社会信用代码" prop="creditCode" align="center" /> |
| | | <el-table-column label="机构属性" prop="attribute" align="center" > |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.attribute == 0">疆内</span> |
| | | <span v-if="scope.row.attribute == 1">疆外</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="所属区域" prop="province" align="center" > |
| | | <template #default="scope"> |
| | | <span >{{scope.row.province}}<span v-if="scope.row.province">/</span>{{scope.row.city}}<span v-if="scope.row.district">/</span>{{scope.row.district}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="资质证书编号" prop="certNumber" align="center" /> |
| | | <el-table-column label="发证日期" prop="issueDate" align="center" /> |
| | | <el-table-column label="有效期" prop="validDate" align="center" /> |
| | | <el-table-column label="公示状态" prop="status" align="center" > |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.publication ===0">公示</span> |
| | | <span v-if="scope.row.publication ===1">未公示</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDialog('review',scope.row)" >查看</el-button> |
| | | <el-button link type="primary" @click="publicity(scope.row)" >{{publicMsg}}</el-button> |
| | | <el-button link type="primary" @click="openDialog(scope.row)" >查看</el-button> |
| | | <el-button link type="primary" @click="publicity(scope.row)" >{{scope.row.publicMsg}}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <div class="pag-container"> |
| | | <el-pagination |
| | | v-model:current-page="data.queryParams.pageNum" |
| | | v-model:page-size="data.queryParams.pageSize" |
| | | :page-sizes="[10,15,20,25]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <institution-dialog ref="inRef" @getList="getList"></institution-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {getCurrentInstance, reactive, ref, toRefs} from "vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {getCurrentInstance, onMounted, reactive, ref, toRefs} from "vue"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import institutionDialog from "./components/viewInstitution.vue" |
| | | import {changeInsitutionPublic, getInsitutionList} from "@/api/backManage/insitution"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const inRef = ref(); |
| | | const publicMsg = ref("公示"); |
| | | const data = reactive({ |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | | |
| | | const getList = () => { |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | console.log("获取数据") |
| | | const res = await getInsitutionList(data.queryParams); |
| | | if(res.code === 200){ |
| | | dataList.value = res.data.list.map(item => { |
| | | return { |
| | | ...item, |
| | | publicMsg: item.publication ===0 ? '取消公示' : "公示" |
| | | } |
| | | }) |
| | | total.value = res.data.total |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | loading.value = false; |
| | | } |
| | | |
| | | const openDialog = (type, value) => { |
| | | inRef.value.openDialog(type, value); |
| | | const handleSizeChange = (val) => { |
| | | data.queryParams.pageSize = val |
| | | getList() |
| | | } |
| | | const handleCurrentChange = (val) => { |
| | | data.queryParams.pageNum = val |
| | | getList() |
| | | } |
| | | |
| | | const publicity = (val) => { |
| | | const openDialog = (value) => { |
| | | inRef.value.openDialog( value); |
| | | } |
| | | |
| | | const publicity = async (val) => { |
| | | const param = { |
| | | id: val.id, |
| | | publication: val.publication ===0 ? 1: 0 |
| | | } |
| | | const res = await changeInsitutionPublic(param); |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '成功' |
| | | }); |
| | | getList(); |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | const handleDelete = (val) => { |
| | |
| | | } |
| | | |
| | | </script> |
| | | <style lang="scss"> |
| | | .pag-container{ |
| | | float: right; |
| | | margin-top: 10px; |
| | | } |
| | | </style> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="副标题:" prop="subTitle"> |
| | | <el-input v-model.trim="state.form.subTitle" v-if="!isReview" ></el-input> |
| | | <span v-else>{{state.form.title}}</span> |
| | | <span v-else>{{state.form.subTitle}}</span> |
| | | </el-form-item> |
| | | <el-form-item label="类别:" prop="level"> |
| | | <el-radio-group v-model="state.form.level" v-if="!isReview"> |
| | | <el-form-item label="类别:" prop="law"> |
| | | <el-radio-group v-model="law" v-if="!isReview" @change="getLawTypeContent"> |
| | | <el-radio :label="1">法律</el-radio> |
| | | <el-radio :label="2">法规</el-radio> |
| | | <el-radio :label="3">地方性规定</el-radio> |
| | | <el-radio :label="4">其他</el-radio> |
| | | </el-radio-group> |
| | | <span v-else>{{state.form.level === 1 ? '法律' : state.form.level === 2? '法规' :state.form.level === 3?'地方性规定': '其他'}}</span> |
| | | <span v-else>{{state.form.lawType}}</span> |
| | | </el-form-item> |
| | | <el-form-item label="颁布机构:" prop="institution"> |
| | | <el-input v-model.trim="state.form.institution" v-if="!isReview" ></el-input> |
| | | <span v-else>{{state.form.institution}}</span> |
| | | <el-form-item label="颁布机构:" prop="pubAgency"> |
| | | <el-input v-model.trim="state.form.pubAgency" v-if="!isReview" ></el-input> |
| | | <span v-else>{{state.form.pubAgency}}</span> |
| | | </el-form-item> |
| | | <el-form-item label="颁布日期:" prop="publishTime"> |
| | | <el-form-item label="颁布日期:" prop="pubDate"> |
| | | <el-date-picker |
| | | v-if="!isReview" |
| | | v-model="state.form.publishTime" |
| | | type="date" |
| | | v-model="state.form.pubDate" |
| | | type="datetime" |
| | | value-format="YYYY-MM-DD hh:mm:ss" |
| | | placeholder="请选择日期" |
| | | size="default" |
| | | /> |
| | | <span v-else>{{state.form.publishTime}}</span> |
| | | <span v-else>{{state.form.pubDate}}</span> |
| | | </el-form-item> |
| | | <div style="margin: 0 0 15px 30px" v-if="!isReview"> |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | class="upload-demo" |
| | | action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" |
| | | multiple |
| | | :on-preview="handlePreview" |
| | | :on-remove="handleRemove" |
| | | :before-remove="beforeRemove" |
| | | :limit="3" |
| | | > |
| | | <el-button type="primary">附件上传</el-button> |
| | | </el-upload> |
| | | </div> |
| | | <el-form-item v-else label="附件:" > |
| | | <div class="file"> |
| | | <el-link v-for="(item,index) in state.form.fileList" type="primary" :key="index" :underline="false"> |
| | | <i class="el-icon-paperclip" style="margin-right: 5px;color: #1e6abc"></i>{{item.fileName}} |
| | | </el-link> |
| | | </div> |
| | | <el-form-item label="内容:" v-if="showEditor" prop="content"> |
| | | <we-editor ref="myEditor" :propData="state.form.content" @childFn="getEditorData" /> |
| | | </el-form-item> |
| | | <el-form-item v-if="!isReview" style="margin-left: -80px" prop="content"> |
| | | <editor ref="myQuillEditor" v-model="state.form.content" :height="300"></editor> |
| | | </el-form-item> |
| | | <el-form-item label="公告内容:" v-else> |
| | | <div class="ql-container ql-snow" style="height: 300px;width: 100%;margin-top: 10px;" > |
| | | <el-form-item label="内容:" v-else> |
| | | <div class="ql-container ql-snow" style="height: 500px;width: 100%;margin-top: 10px;" > |
| | | <div class="ql-editor"> |
| | | <div v-html="state.form.content"></div> |
| | | <div v-html="state.form.content" @click="showFile($event)"></div> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | <script setup> |
| | | import {reactive, ref, toRefs} from 'vue' |
| | | import Editor from "@/components/Editor/index.vue"; |
| | | import weEditor from "@/components/WeEditor/index.vue"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {addLaw, editLaw, getLawDetail} from "@/api/backManage/law"; |
| | | import axios from "axios"; |
| | | import {getToken} from "@/utils/auth"; |
| | | |
| | | const emit = defineEmits(["getList"]); |
| | | const dialogVisible = ref(false); |
| | | const title = ref(""); |
| | | const lawRef = ref(); |
| | | const fileList = ref([]); |
| | | const myQuillEditor = ref(); |
| | | const myEditor = ref(); |
| | | const isReview = ref(false); |
| | | const showEditor = ref(true); |
| | | const law = ref(1) |
| | | const state = reactive({ |
| | | form: { |
| | | id: '', |
| | | title: '', |
| | | subTitle: '', |
| | | content: '', |
| | | level: 1, |
| | | fileList: [] |
| | | lawType: "法律", |
| | | pubAgency: '', |
| | | pubDate: '' |
| | | |
| | | }, |
| | | formRules:{ |
| | | title: [{ required: true, message: '请填写标题', trigger: 'blur' }], |
| | | institution: [{ required: true, message: '请填写颁布机构', trigger: 'blur' }], |
| | | content: [{ required: true, message: '请输入公告内容', trigger: 'change' }], |
| | | pubAgency: [{ required: true, message: '请填写颁布机构', trigger: 'blur' }], |
| | | content: [{ required: true, message: '请输入内容', trigger: 'change' }], |
| | | pubDate:[{ required: true, message: '请选择颁布日期', trigger: 'blur' }], |
| | | }, |
| | | |
| | | }) |
| | | |
| | | const openDialog = (type, value) => { |
| | | const openDialog = async (type, value) => { |
| | | isReview.value = false; |
| | | showEditor.value = false; |
| | | title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ; |
| | | if(type === 'edit') { |
| | | state.noticeForm = value; |
| | | if(type === 'edit' || type === 'review') { |
| | | const param = { |
| | | lawId: value.id |
| | | } |
| | | const res = await getLawDetail(param); |
| | | if(res.code === 200){ |
| | | state.form = res.data |
| | | if(type === 'edit') { |
| | | law.value = res.data.lawType === '法律' ? 1 : res.data.lawType === '法规' ? 2 :res.data.lawType === '地方性规定'? 3 : 4 |
| | | } |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | |
| | | } |
| | | if(type === 'add'|| type ==='edit'){ |
| | | showEditor.value = true; |
| | | isReview.value = false; |
| | | } |
| | | if(type === 'review') { |
| | | showEditor.value = false; |
| | | isReview.value = true; |
| | | state.noticeForm = value; |
| | | } |
| | | if(type === 'add'){ |
| | | reset() |
| | | } |
| | | dialogVisible.value = true; |
| | | } |
| | | |
| | | const getEditorData = (val) =>{ |
| | | state.form.content = val; |
| | | } |
| | | const getLawTypeContent = (val) => { |
| | | state.form.lawType = val === 1 ? '法律' : val === 2? '法规' :val === 3?'地方性规定': '其他' |
| | | } |
| | | const showFile = (e) => { |
| | | if(e.target.nodeName === 'A'){ |
| | | console.log("e",e) |
| | | e.preventDefault(); |
| | | const file = { |
| | | fileUrl: e.target.href, |
| | | fileName: e.target.download |
| | | } |
| | | axios.get( file.fileUrl,{ |
| | | headers: |
| | | { |
| | | 'Content-Type': 'application/json', |
| | | 'Authorization':getToken(), |
| | | }, |
| | | responseType: 'blob' |
| | | } |
| | | ).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: res.data.type}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | link.setAttribute("download", file.fileName); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } else { |
| | | this.$message.error('获取文件失败') |
| | | } |
| | | this.handleClose(); |
| | | }) |
| | | } |
| | | } |
| | | const onSubmit = async () => { |
| | | myEditor.value.submit(); |
| | | const valid = await lawRef.value.validate(); |
| | | if(valid){ |
| | | if(state.noticeForm.content === "<p><br></p>"){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请输入公告内容' |
| | | }); |
| | | return; |
| | | if(title.value === '新增'){ |
| | | const param = { |
| | | content: state.form.content, |
| | | lawType: state.form.lawType, |
| | | pubAgency: state.form.pubAgency, |
| | | pubDate: state.form.pubDate, |
| | | subTitle: state.form.subTitle, |
| | | title: state.form.title |
| | | } |
| | | const res = await addLaw(param) |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '新增成功' |
| | | }); |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | emit("getList") |
| | | reset(); |
| | | myEditor.value.clear(); |
| | | lawRef.value.clearValidate(); |
| | | dialogVisible.value = false; |
| | | }else if(title.value === '编辑') { |
| | | const res = await editLaw(state.form) |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '编辑成功' |
| | | }); |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | emit("getList") |
| | | reset(); |
| | | myEditor.value.clear(); |
| | | lawRef.value.clearValidate(); |
| | | dialogVisible.value = false; |
| | | } |
| | | console.log('file, fileList',state.noticeForm.content); |
| | | lawRef.value.clearValidate(); |
| | | reset(); |
| | | dialogVisible.value = false; |
| | | |
| | | } |
| | | } |
| | | |
| | | const handleClose = () => { |
| | | lawRef.value.clearValidate(); |
| | | reset(); |
| | | dialogVisible.value = false; |
| | | if(title ==="新增"|| title ==='编辑'){ |
| | | myEditor.value.clear(); |
| | | showEditor.value=false |
| | | |
| | | } |
| | | lawRef.value.clearValidate(); |
| | | dialogVisible.value = false; |
| | | } |
| | | const reset = () => { |
| | | law.value = 1; |
| | | state.form = { |
| | | id: '', |
| | | title: '', |
| | | subTitle: '', |
| | | content: '', |
| | | level: 1, |
| | | fileList: [] |
| | | lawType: "法律", |
| | | pubAgency: '', |
| | | pubDate: '' |
| | | } |
| | | } |
| | | const handleRemove = (file, fileList) => { |
| | | console.log(file, fileList); |
| | | } |
| | | const handlePreview = (uploadFile) => { |
| | | console.log(uploadFile) |
| | | } |
| | | const beforeRemove = (file, fileList) => { |
| | | return this.$confirm(`确定移除 ${ file.name }?`); |
| | | } |
| | | |
| | | |
| | | defineExpose({ |
| | | openDialog |
| | | }); |
| | |
| | | |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | | <el-table-column label="颁布时间" prop="publishTime" align="center" /> |
| | | <el-table-column label="标题" prop="lawTitle" align="center" :show-overflow-tooltip="true" width="400" /> |
| | | <el-table-column label="副标题" prop="lawSubTitle" align="center" :show-overflow-tooltip="true" width="400" /> |
| | | <el-table-column label="类别" prop="level" align="center" /> |
| | | <el-table-column label="颁布机构" prop="institution" align="center" /> |
| | | <el-table-column label="颁布时间" prop="pubDate" align="center" width="180" /> |
| | | <el-table-column label="标题" prop="title" align="center" :show-overflow-tooltip="true" width="400" /> |
| | | <el-table-column label="副标题" prop="subTitle" align="center" :show-overflow-tooltip="true" width="400" /> |
| | | <el-table-column label="类别" prop="lawType" align="center" /> |
| | | <el-table-column label="颁布机构" prop="pubAgency" align="center" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDialog('review',scope.row)" >查看</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)" v-hasPermi="['system:role:edit']">编辑</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']">删除</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)" >编辑</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)" >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <div class="pag-container"> |
| | | <el-pagination |
| | | v-model:current-page="data.queryParams.pageNum" |
| | | v-model:page-size="data.queryParams.pageSize" |
| | | :page-sizes="[10,15,20,25]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <law-dialog ref="lawRef" @getList="getList"></law-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {getCurrentInstance, reactive, ref, toRefs} from "vue"; |
| | | import {getCurrentInstance, onMounted, reactive, ref, toRefs} from "vue"; |
| | | import lawDialog from './components/lawDialog.vue' |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {delLaw, getLawList} from "@/api/backManage/law"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const lawRef = ref(); |
| | |
| | | }, |
| | | total: 0, |
| | | dataList: [] |
| | | |
| | | |
| | | }); |
| | | |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | | |
| | | const getList = () => { |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | console.log("获取数据") |
| | | const res = await getLawList(data.queryParams); |
| | | if(res.code === 200){ |
| | | dataList.value = res.data.list |
| | | total.value = res.data.total |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | loading.value = false; |
| | | } |
| | | const handleSizeChange = (val) => { |
| | | data.queryParams.pageSize = val |
| | | getList() |
| | | } |
| | | const handleCurrentChange = (val) => { |
| | | data.queryParams.pageNum = val |
| | | getList() |
| | | } |
| | | |
| | | const openDialog = (type, value) => { |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | |
| | | const res = await delLaw(val); |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }); |
| | | getList(); |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | </script> |
| | | <style lang="scss"> |
| | | .pag-container{ |
| | | float: right; |
| | | margin-top: 10px; |
| | | } |
| | | </style> |
| | |
| | | isReview.value = false; |
| | | } |
| | | if(type === 'add'){ |
| | | state.noticeForm.noticeContent = " "; |
| | | state.noticeForm.noticeTitle = " "; |
| | | reset() |
| | | } |
| | | dialogVisible.value = true; |
| | | } |
| | |
| | | } |
| | | emit("getList") |
| | | reset(); |
| | | // myEditor.value.clear(); |
| | | myEditor.value.clear(); |
| | | noticeRef.value.clearValidate(); |
| | | dialogVisible.value = false; |
| | | }else if(title.value === '编辑') { |
| | |
| | | } |
| | | emit("getList") |
| | | reset(); |
| | | // myEditor.value.clear(); |
| | | myEditor.value.clear(); |
| | | noticeRef.value.clearValidate(); |
| | | dialogVisible.value = false; |
| | | } |
| | |
| | | if(title ==="新增"|| title ==='编辑'){ |
| | | myEditor.value.clear(); |
| | | showEditor.value=false |
| | | |
| | | } |
| | | |
| | | noticeRef.value.clearValidate(); |