|
|
@@ -0,0 +1,408 @@
|
|
|
+<template>
|
|
|
+ <!-- 申请库弹窗 -->
|
|
|
+ <a-modal :visible="true" :width="width" :maskClosable="false" :destroyOnClose="true" centered :title="title"
|
|
|
+ :footer="null" wrapClassName="modal-wrap" @cancel="onClose">
|
|
|
+ <div class="action-content">
|
|
|
+ <div class="top-search">
|
|
|
+ <div class="left-search-input">
|
|
|
+ <div class="input">
|
|
|
+ <span>关键字</span>
|
|
|
+ <a-input allowClear v-model:value="searchValue" style="width: 200px;"
|
|
|
+ placeholder="请输入资源名称"></a-input>
|
|
|
+ </div>
|
|
|
+ <div class="input">
|
|
|
+ <span>审核状态</span>
|
|
|
+ <a-select allowClear v-model:value="selectValue" style="width: 200px" :options="statusOptions">
|
|
|
+ </a-select>
|
|
|
+ </div>
|
|
|
+ <div class="input">
|
|
|
+ <span>申请时间</span>
|
|
|
+ <a-date-picker v-model:value="searchTime" placeholder="申请时间" style="width: 200px" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="right-btns">
|
|
|
+ <a-button style="margin-right: 15px;" @click="handleReset">重置</a-button>
|
|
|
+ <a-button type="primary" @click="handleSearch">查询</a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="bottom-table">
|
|
|
+ <BasicTable @register="registerTable" class="basic-table">
|
|
|
+ <!-- <template #OPT="{ record }">
|
|
|
+ <span>{{ record.OPT==='login' ? '登录' : '退出' }}</span>
|
|
|
+ </template> -->
|
|
|
+ <template #toolbar>
|
|
|
+ <a-button style="background-color: #fc8b01;color: #fff;" @click="handleAdd"
|
|
|
+ :disabled="hasSelected">提交申请</a-button>
|
|
|
+ </template>
|
|
|
+ <template #action="{ record }">
|
|
|
+ <TableAction :actions="[
|
|
|
+ {
|
|
|
+ label: '移出',
|
|
|
+ tooltip: '移出',
|
|
|
+ // icon: 'ant-design:form-outlined',
|
|
|
+ onClick: handleDelete.bind(null, record),
|
|
|
+ },
|
|
|
+ ]" />
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </a-modal>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { defineComponent, reactive, ref, onMounted, watch, toRefs, computed, createVNode } from 'vue';
|
|
|
+// 导入表格组件,表格事件
|
|
|
+import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
+import { message, Modal } from 'ant-design-vue';
|
|
|
+import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
|
+import { session } from '/@/utils/Memory';
|
|
|
+import moment from 'moment';
|
|
|
+//操作申请库资源
|
|
|
+import { getResInCar, clearResInCar, deleteResInCar } from '/@/api/resource/plat';
|
|
|
+//提交授权申请
|
|
|
+import { queryFlowInfoPage, submitExamine } from '/@/api/resource/examine';
|
|
|
+
|
|
|
+const props = {
|
|
|
+ // resId: {
|
|
|
+ // type: String,
|
|
|
+ // default: ''
|
|
|
+ // }
|
|
|
+}
|
|
|
+export default defineComponent({
|
|
|
+ name: 'modal',
|
|
|
+ components: { BasicTable, TableAction, ExclamationCircleOutlined },
|
|
|
+ props,
|
|
|
+ setup(props, { emit }) {
|
|
|
+ const data = reactive({
|
|
|
+ width: '1440px',
|
|
|
+ title: '申请库',
|
|
|
+ })
|
|
|
+ const searchValue = ref('')
|
|
|
+ const selectValue = ref('')
|
|
|
+ const searchTime = ref(null)
|
|
|
+ const statusOptions = [
|
|
|
+ {
|
|
|
+ label: "未提交",
|
|
|
+ value: "未审核"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核中",
|
|
|
+ value: "审核中"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核通过",
|
|
|
+ value: "审核通过"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核不通过",
|
|
|
+ value: "审核不通过"
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ // 请求所有申请库中的资源
|
|
|
+ const getAllData = () => {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ getResInCar({
|
|
|
+ keyword: searchValue.value,
|
|
|
+ shzt: selectValue.value,
|
|
|
+ sqsj: searchTime.value ? moment(searchTime).format('YYYY-MM-DD') : '',
|
|
|
+ userId: session.getItem('userId'),
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.datas?.length) {
|
|
|
+ let resData = []
|
|
|
+ res.datas.forEach(item => {
|
|
|
+ //筛掉接口服务
|
|
|
+ if (item.applyCarInfo.workflowType === 'MAP' || item.applyCarInfo.workflowType === 'SCENE' || item.applyCarInfo.workflowType === 'FILE') {
|
|
|
+ resData.push({
|
|
|
+ serviceid: item.resInfo.SERVICEID,
|
|
|
+ zylx: item.applyCarInfo.workflowType === 'MAP' ? '地图资源' : item.applyCarInfo.workflowType === 'SCENE' ? '场景资源' : '文件资源',
|
|
|
+ // zymc: item.resInfo.SERVICENAME,
|
|
|
+ zymc: item.applyCarInfo.resName,
|
|
|
+ yyxt: "",
|
|
|
+ // sqdz: "",
|
|
|
+ sqsj: "",
|
|
|
+ sqr: "",
|
|
|
+ shzt: item.shzt,
|
|
|
+ shr: "",
|
|
|
+ shyj: ""
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ resolve(resData)
|
|
|
+ } else {
|
|
|
+ resolve([])
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ resolve([])
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //表格列
|
|
|
+ const columns = [
|
|
|
+ {
|
|
|
+ title: '资源类型',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'zylx',
|
|
|
+ key: 'zylx'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '资源名称',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'zymc',
|
|
|
+ key: 'zymc'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title: '操作IP',
|
|
|
+ // align: 'center',
|
|
|
+ // dataIndex: 'ip',
|
|
|
+ // slots: {
|
|
|
+ // customRender: 'ip',
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title: '应用系统',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'yyxt',
|
|
|
+ key: 'yyxt'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title: '申请单位',
|
|
|
+ // align: 'center',
|
|
|
+ // dataIndex: 'sqdw',
|
|
|
+ // key: 'sqdw'
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title: '申请时间',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'sqsj',
|
|
|
+ key: 'sqsj'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'sqr',
|
|
|
+ key: 'sqr'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '审核状态',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'shzt',
|
|
|
+ key: 'shzt'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '审核人',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'shr',
|
|
|
+ key: 'shr'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '审核意见',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'shyj',
|
|
|
+ key: 'shyj'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ //注册表格
|
|
|
+ const [registerTable, { reload, getRowSelection, getSelectRowKeys, clearSelectedRowKeys }] = useTable({
|
|
|
+ title: '资源列表',
|
|
|
+ api: getAllData, //数据
|
|
|
+ // dataSource: [],
|
|
|
+ columns: columns, //表头配置
|
|
|
+ bordered: false,
|
|
|
+ striped: false,
|
|
|
+ useSearchForm: false, //开启搜索区域
|
|
|
+ // formConfig: formConfig, //搜索字段配置
|
|
|
+ actionColumn: {
|
|
|
+ width: 100,
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'action',
|
|
|
+ slots: { customRender: 'action' },
|
|
|
+ },
|
|
|
+ rowSelection: { type: 'checkbox' },
|
|
|
+ pagination: {
|
|
|
+ // pageSize: 10,
|
|
|
+ hideOnSinglePage: false
|
|
|
+ },
|
|
|
+ rowKey: (record) => record.serviceid,
|
|
|
+ canResize: true,
|
|
|
+ showTableSetting: true, // 显示表格设置
|
|
|
+ tableSetting: {
|
|
|
+ redo: true,
|
|
|
+ size: true,
|
|
|
+ setting: false,
|
|
|
+ fullScreen: false
|
|
|
+ },
|
|
|
+ showIndexColumn: true,
|
|
|
+ indexColumnProps: { fixed: 'left' },
|
|
|
+ });
|
|
|
+ //判断是否选中数据
|
|
|
+ const hasSelected = computed(() => {
|
|
|
+ const rowSelection = getRowSelection();
|
|
|
+ return !(rowSelection.selectedRowKeys?.length === 1);
|
|
|
+ });
|
|
|
+ //重置查询
|
|
|
+ const handleReset = () => {
|
|
|
+ searchValue.value = ''
|
|
|
+ selectValue.value = '未审核'
|
|
|
+ searchTime.value = moment()
|
|
|
+ }
|
|
|
+ //条件查询
|
|
|
+ const handleSearch = () => {
|
|
|
+ reload();
|
|
|
+ }
|
|
|
+ //移除资源
|
|
|
+ const handleDelete = (record) => {
|
|
|
+ // console.log(record)
|
|
|
+ Modal.confirm({
|
|
|
+ title: '移出提示',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '确定移出该资源?',
|
|
|
+ centered: true,
|
|
|
+ okText: '确定',
|
|
|
+ okType: 'danger',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk: (() => {
|
|
|
+ let params = {
|
|
|
+ idList: [record.serviceid]
|
|
|
+ }
|
|
|
+ deleteResInCar(params).then(res => {
|
|
|
+ reload();
|
|
|
+ })
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //添加申请
|
|
|
+ const handleAdd = () => {
|
|
|
+ console.log('开始申请');
|
|
|
+ Modal.confirm({
|
|
|
+ title: '申请提示',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '确定提交申请该资源?',
|
|
|
+ centered: true,
|
|
|
+ okText: '确定',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk: (() => {
|
|
|
+ queryFlowInfoPage({
|
|
|
+ page: 1,
|
|
|
+ rows: 1000000
|
|
|
+ }).then(flowRes => {
|
|
|
+ const rowKeys = getSelectRowKeys();
|
|
|
+ let ids = rowKeys.toString();
|
|
|
+ // console.log(flowRes);
|
|
|
+ let flag = 0
|
|
|
+ flowRes.forEach(item => {
|
|
|
+ if (item.FLOWNAME === judgeType(ids)) {
|
|
|
+ flag = 1
|
|
|
+ let params = {
|
|
|
+ bussInfo: {
|
|
|
+ bussname: judgeType(ids),//业务名称
|
|
|
+ flowid: item.id,//流程id
|
|
|
+ serverids: ids//资源id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ submitExamine(params).then(res => {
|
|
|
+ if(res.resp_code===0 && res.resp_msg==='新增成功'){
|
|
|
+ message.success('申请成功')
|
|
|
+ reload();
|
|
|
+ }else{
|
|
|
+ message.error('申请失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ clearSelectedRowKeys();
|
|
|
+ !flag && message.info('没有对应流程,请联系管理员');
|
|
|
+ })
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+ const judgeType = (id) => {
|
|
|
+ let resType = ''
|
|
|
+ resType = id.indexOf('MR') > -1 ? '地图资源授权' : id.indexOf('ER') > -1 ? '场景资源授权' : '文件资源授权';
|
|
|
+ // console.log(resType);
|
|
|
+ return resType
|
|
|
+ }
|
|
|
+ // 关闭请求弹窗
|
|
|
+ const onClose = (e) => {
|
|
|
+ emit('closeModal')
|
|
|
+ }
|
|
|
+ //初始化请求所需数据
|
|
|
+ onMounted(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ return {
|
|
|
+ // formRef,
|
|
|
+ searchValue,
|
|
|
+ selectValue,
|
|
|
+ searchTime,
|
|
|
+ statusOptions,
|
|
|
+ hasSelected,
|
|
|
+ ...toRefs(data),
|
|
|
+ registerTable,
|
|
|
+ handleReset,
|
|
|
+ handleSearch,
|
|
|
+ handleDelete,
|
|
|
+ handleAdd,
|
|
|
+ onClose
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+.modal-wrap {
|
|
|
+ .action-content {
|
|
|
+ padding: 20px;
|
|
|
+ max-height: 800px;
|
|
|
+ overflow: auto;
|
|
|
+ background-color: #eff0f5;
|
|
|
+
|
|
|
+ .top-search {
|
|
|
+ // padding-left: 20px;
|
|
|
+ width: 100%;
|
|
|
+ height: 74px;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .left-search-input {
|
|
|
+ margin-left: 20px;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .input {
|
|
|
+ margin-right: 30px;
|
|
|
+
|
|
|
+ span {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .right-btns {
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom-table {
|
|
|
+ // height: 825px;
|
|
|
+ margin-top: 20px;
|
|
|
+
|
|
|
+ .basic-table {
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ ::v-deep .ant-table-title {
|
|
|
+ padding: 0 !important;
|
|
|
+
|
|
|
+ .vben-basic-title {
|
|
|
+ font-family: '阿里巴巴普惠体 2.0';
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|