XiaXxxxxx 2 rokov pred
rodič
commit
677e4373c3

+ 14 - 6
src/views/authorize/empower/index.vue

@@ -8,7 +8,7 @@
         </div>
         <div class="input">
           <span>资源类型</span>
-          <a-select allowClear @change="handleTypeChange" v-model:value="selectTypeValue" style="width: 200px"
+          <a-select @change="handleTypeChange" v-model:value="selectTypeValue" style="width: 200px"
             :options="typeOptions"></a-select>
         </div>
         <div class="input" v-if="selectTypeValue != 'SR'">
@@ -74,7 +74,7 @@
   </div>
 </template>
 <script>
-import { defineComponent, reactive, ref, onMounted, watch, toRefs, computed, createVNode, nextTick } from 'vue';
+import { defineComponent, reactive, ref, onMounted, watch, toRefs, computed, nextTick } from 'vue';
 import { BasicTable, useTable, TableAction } from '/@/components/Table';
 import AuditModal from './AuditModal.vue';
 import { columns } from './map.data';
@@ -90,20 +90,23 @@ import AssResourceUpload from '/@/views/dataAdmin/assembly/MapSourceModal.vue';
 import { useModal } from '/@/components/Modal';
 import { queryResourceById } from '/@/api/resource/map';
 import { useAppStore } from '/@/store/modules/app';
+import { useRouter } from 'vue-router';
 
 
 export default defineComponent({
+  name:'empower',
+  components:{BasicTable, TableAction, AuditModal, MapResourceUpload, FileResourceUpload, SceneResourceUpload, AssResourceUpload},
   setup() {
-    const [registerModal, { openModal }] = useModal();
+    const [registerModal, { openModal, closeModal }] = useModal();
     const ischect = ref(true)
-  const appStore = useAppStore();
+    const appStore = useAppStore();
     const searchValue = ref('')
-    const selectTypeValue = ref('MR')
     const selectSystemValue = ref('')
     const selectStatusValue = ref('0')
     const searchTime = ref(null)
     const { currentRoute } = useRouter();
     const currRoute = currentRoute.value;
+    const selectTypeValue = ref(currRoute?.query?.type || 'MR')
     //mr是地图资源,dr是文件,er场景,sr组件
     const typeOptions = [
       {
@@ -300,6 +303,10 @@ export default defineComponent({
       });
     }
 
+    const handleSuccess = ()=>{
+      closeModal()
+    }
+
     return {
       ischect,
       handleTypeChange,
@@ -322,7 +329,8 @@ export default defineComponent({
       handleDetail,
       handleAudit,
       onSubmit,
-      onFetchSuccess
+      onFetchSuccess,
+      handleSuccess
     };
   },
 });

+ 223 - 48
src/views/dataAdmin/dataAdmin/version/VersionModal.vue

@@ -1,73 +1,248 @@
 <template>
-    <a-modal 
-        :visible="true" 
-        :width="width" 
-        :maskClosable="false" 
-        :destroyOnClose="true"
-        :title="title"
-        :footer="null"
-        centered
-        :wrapClassName="wrapClassName"
-        @cancel="onClose" 
-    >
-        <slot name="modalContent"></slot>
+    <a-modal :visible="true" :width="width" :maskClosable="false" :destroyOnClose="true" :title="title" :footer="null"
+        centered @cancel="onClose">
+        <div class="sources-body">
+            <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="请输入资源ID"></a-input>
+                    </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>
+            <!-- <a-table :columns="sourcesColumns" :data-source="sourcesTableData" :bordered="true"></a-table> -->
+            <div class="bottom-table">
+                <BasicTable @register="registerTable">
+                    <template #action="{ record }">
+                        <TableAction :actions="[
+                            {
+                                label: '查看',
+                                tooltip: '查看',
+                                onClick: handleDetail.bind(null, record),
+                            }
+                        ]" />
+                    </template>
+                </BasicTable>
+            </div>
+        </div>
     </a-modal>
+    <DetailModal v-if="ifShowDetail" @closeModal="ifShowDetail = false" :resId="resId" />
 </template>
 <script>
-import { defineComponent, reactive, ref, onMounted, watch, toRefs } from 'vue';
+import { defineComponent, reactive, ref, onMounted, watch, toRefs, computed } from 'vue';
 import { message } from 'ant-design-vue';
 import moment from 'moment';
+import { BasicTable, useTable, TableAction } from '/@/components/Table';
+import { session } from '/@/utils/Memory';
+import { delVersionByIds, getVersionDetail } from '/@/api/sys/version';
+import DetailModal from '/@/views/resource/plat/item/child/DetailModal.vue'
 
 const props = {
-    width: {
-        type: String,
-        default: '1000px'
-    },
-    title:{
-        type:String,
-        default:"版本资源"
-    },
-    wrapClassName:{
-        type:String,
-        default:""
-    }
+    versionId: String,
+    default: ''
 }
 export default defineComponent({
     name: 'modal',
-    components: {},
+    components: { BasicTable, TableAction, DetailModal },
+    emits: ['closeModal'],
     props,
     setup(props, { emit }) {
-        const propsData = reactive({
-            width: props.width,
-            title: props.title,
-            wrapClassName:props.wrapClassName
+        const data = reactive({
+            width: '1200px',
+            title: ''
         })
+        const searchValue = ref('')
+        const versionId = ref(props.versionId)
+        //筛选数据,用于表格
+        const filteredInfo = ref({
+            rid: null
+        });
+        const sourcesColumns = computed(() => {
+            const filtered = filteredInfo.value || {};
+            return [
+                {
+                    title: '资源ID',
+                    align: 'center',
+                    dataIndex: 'rid',
+                    key: 'rid',
+                    filteredValue: filtered.rid || null,
+                    onFilter: (value, record) => record.rid.includes(value)
+                },
+                {
+                    title: '版本号',
+                    align: 'center',
+                    dataIndex: 'versionNum',
+                    key: 'versionNum'
+                },
+                {
+                    title: '最新版本',
+                    align: 'center',
+                    dataIndex: 'isNew',
+                    key: 'isNew'
+                },
+                {
+                    title: '发布时间',
+                    align: 'center',
+                    dataIndex: 'insertTime',
+                    key: 'insertTime'
+                },
+                {
+                    title: '修改时间',
+                    align: 'center',
+                    dataIndex: 'updateTime',
+                    key: 'updateTime'
+                },
+            ]
+        })
+        const ifShowDetail = ref(false)
+        const resId = ref('')
         watch(
-            () => props.width,
-            (val) => {
-                propsData.width = val
-            }
-        )
-        watch(
-            () => props.title,
-            (val) => {
-                propsData.title = val
-            }
-        )
-        watch(
-            () => props.wrapClassName,
+            () => props.versionId,
             (val) => {
-                propsData.wrapClassName = val
+                versionId.value = val
             }
         )
-        const onClose = (e) => {
+
+        const getAllData = () => {
+            return new Promise((resolve) => {
+                let param = {
+                    1: session.getItem('tokenV2'),
+                    2: versionId.value,
+                }
+                getVersionDetail(param).then(res => {
+                    if (res.status === "0") {
+                        let resData = JSON.parse(res.result)
+                        if (resData.dataVersionConfs.length) {
+                            data.title = `版本:${resData.name}`
+                            let sourcesData = []
+                            resData.dataVersionConfs.forEach(item => {
+                                sourcesData.push({
+                                    isNew: item.active === 'N' ? '否' : '是',
+                                    key: item.id,
+                                    ...item
+                                })
+                            })
+                            console.log(sourcesData);
+                            resolve(sourcesData)
+                        } else {
+                            data.title = '该版本暂无资源'
+                            resolve([])
+                        }
+                    } else {
+                        data.title = '该版本暂无资源'
+                        resolve([])
+                    }
+                })
+            })
+        }
+        //注册表格
+        const [registerTable, { reload }] = useTable({
+            title: '资源列表',
+            api: getAllData,
+            columns: sourcesColumns,
+            // rowSelection: { type: 'checkbox' },
+            useSearchForm: false,
+            showTableSetting: true,
+            bordered: false,
+            striped: false,
+            canResize: true,
+            showIndexColumn: false,
+            // indexColumnProps: { fixed: 'left' },
+            actionColumn: {
+                width: 100,
+                title: '操作',
+                dataIndex: 'action',
+                slots: { customRender: 'action' },
+                fixed: 'right',
+            },
+            pagination: {
+                hideOnSinglePage: false,
+            },
+            clickToRowSelect: false,
+            tableSetting: {
+                redo: true,
+                size: true,
+                setting: false,
+                fullScreen: false
+            },
+        });
+        //重置
+        const handleReset = () => {
+            searchValue.value = ''
+            filteredInfo.value.rid = null
+            reload()
+        }
+        //查询
+        const handleSearch = () => {
+            filteredInfo.value.rid = [searchValue.value]
+            // reload()
+        }
+        // 查看
+        const handleDetail = (record) => {
+            resId.value = record.rid
+            ifShowDetail.value = true
+        }
+        const onClose = () => {
             emit('closeModal')
         }
         return {
-            ...toRefs(propsData),
+            searchValue,
+            ifShowDetail,
+            resId,
+            ...toRefs(data),
             //func
-            onClose
+            registerTable,
+            onClose,
+            handleReset,
+            handleSearch,
+            handleDetail
         };
     },
 });
-</script>
+</script>
+
+<style lang="less" scoped>
+.sources-body {
+    padding: 20px;
+    // max-height: 800px;
+    height: 800px;
+    overflow: auto;
+    background-color: #eff0f5;
+
+    .top-search {
+        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 {
+        margin-top: 20px;
+    }
+}
+</style>

+ 47 - 48
src/views/dataAdmin/dataAdmin/version/index.vue

@@ -1,10 +1,13 @@
 <template>
     <div class="p-4">
         <div class="version-header">
-            <div class="version-title">版本管理</div>
-            <div class="handle-btns">
+            <!-- <div class="version-title">版本管理</div> -->
+            <div class="search">
                 <span class="label">版本名称:</span>
                 <a-input v-model:value="searchValue" placeholder="输入关键字查询" allow-clear />
+            </div>
+            <div class="handle-btns">
+                <a-button class="btn" @click="resetTable">重置</a-button>
                 <a-button class="btn" type="primary" @click="searchTable">查询</a-button>
             </div>
         </div>
@@ -44,14 +47,7 @@
         <VersionDrawer v-if="ifShowDialog" @closeDialog="ifShowDialog = false" :formData="formData"
             :drawerTitle="drawerTitle" @onSubmit="onSubmit" ref="drawerRef">
         </VersionDrawer>
-        <VersionModal v-if="ifShowModal" @closeModal="ifShowModal = false" :width="modalWidth" :title="sourcesTableTitle">
-            <template #modalContent>
-                <div class="sources-body" style="padding: 20px;">
-                    <div class="sources-title" style="margin-bottom: 20px;font-size: 16px;">资源列表</div>
-                    <a-table :columns="sourcesColumns" :data-source="sourcesTableData" :bordered="true"></a-table>
-                </div>
-            </template>
-        </VersionModal>
+        <VersionModal v-if="ifShowModal" @closeModal="ifShowModal = false" :versionId="versionId" />
     </div>
 </template>
 
@@ -87,7 +83,8 @@ export default defineComponent({
             },
             drawerTitle: "新增版本",
             ifShowDialog: false,
-            ifShowModal: false
+            ifShowModal: false,
+            versionId: ''
         });
         //资源列表数据
         const sourcesData = reactive({
@@ -125,8 +122,6 @@ export default defineComponent({
                 },
             ],
             sourcesTableTitle: "",
-            modalWidth: '1200px',
-            wrapClassName: "sources-body"
         })
         //获取所有标签
         const getVersionData = () => {
@@ -183,6 +178,12 @@ export default defineComponent({
         const searchTable = () => {
             filteredInfo.value.name = [data.searchValue]
         }
+        //重置
+        const resetTable = ()=>{
+            filteredInfo.value.name = null
+            data.searchValue=''
+            reload()
+        }
         //判断是否选中数据
         const hasSelected = computed(() => {
             const rowSelection = getRowSelection();
@@ -266,33 +267,34 @@ export default defineComponent({
                     })
                 })
             });
-
         }
         //打开弹窗展示资源
         const openModal = (id) => {
-            let param = {
-                1: session.getItem('tokenV2'),
-                2: id,
-            }
-            getVersionDetail(param).then(res => {
-                if (res.status === "0") {
-                    let resData = JSON.parse(res.result)
-                    if (resData.dataVersionConfs.length) {
-                        sourcesData.sourcesTableData = []
-                        sourcesData.sourcesTableTitle = `版本:${resData.name}`
-                        resData.dataVersionConfs.forEach(item => {
-                            sourcesData.sourcesTableData.push({
-                                isNew: item.active === 'N' ? '否' : '是',
-                                key: item.id,
-                                ...item
-                            })
-                        })
-                        data.ifShowModal = true
-                    } else {
-                        message.info('该版本暂无资源')
-                    }
-                }
-            })
+            data.versionId = id
+            data.ifShowModal = true
+            // let param = {
+            //     1: session.getItem('tokenV2'),
+            //     2: id,
+            // }
+            // getVersionDetail(param).then(res => {
+            //     if (res.status === "0") {
+            //         let resData = JSON.parse(res.result)
+            //         if (resData.dataVersionConfs.length) {
+            //             sourcesData.sourcesTableData = []
+            //             sourcesData.sourcesTableTitle = `版本:${resData.name}`
+            //             resData.dataVersionConfs.forEach(item => {
+            //                 sourcesData.sourcesTableData.push({
+            //                     isNew: item.active === 'N' ? '否' : '是',
+            //                     key: item.id,
+            //                     ...item
+            //                 })
+            //             })
+            //             data.ifShowModal = true
+            //         } else {
+            //             message.info('该版本暂无资源')
+            //         }
+            //     }
+            // })
         }
         //弹窗确认
         const onSubmit = (e) => {
@@ -344,6 +346,7 @@ export default defineComponent({
             registerTable,
             getVersionData,
             searchTable,
+            resetTable,
             delAllData,
             onDelete,
             openModal,
@@ -359,7 +362,7 @@ export default defineComponent({
     height: 100%;
 
     .version-header {
-        padding: 10px;
+        padding: 20px;
         width: 100%;
         height: 70px;
         background-color: #fff;
@@ -367,22 +370,18 @@ export default defineComponent({
         justify-content: space-between;
         align-items: center;
 
-        .version-title {
-            font-size: 16px;
-            font-weight: 500;
-            margin-left: 20px;
-            user-select: none;
-        }
-
-        .handle-btns {
-            margin-right: 20px;
+        .search {
             display: flex;
             align-items: center;
 
             .label {
-                width: 150px;
+                width: 120px;
             }
+        }
 
+        .handle-btns {
+            display: flex;
+            align-items: center;
             .btn {
                 margin-left: 10px;
             }

+ 1 - 1
src/views/resource/plat/item/child/DetailModal.vue

@@ -275,7 +275,7 @@ export default defineComponent({
             console.log(res);
             baseInfo.value = res.servicebase;
             baseInfo.value.thumbnail = res.metadata.thumbnail
-            baseInfo.value.thumbnail2 = session.getItem('thumbnail2');
+            session.getItem('thumbnail2') && (baseInfo.value.thumbnail2 = session.getItem('thumbnail2'));
             baseInfo.value.updatedate = moment(baseInfo.value.updatedate).format('YYYY-MM-DD HH:mm:ss');
             metaInfo.value = res.metadata
             //所有标签

+ 15 - 11
src/views/tips/index.vue

@@ -100,7 +100,7 @@
                         <div class="name">人员:{{ item.nodeName }}</div>
                         <div class="ispass">审核:{{ item.nodeIsPass }}</div>
                         <div class="time">时间:{{ item.nodeTime }}</div>
-                        
+
                     </div>
                     <div class="check-info">意见:{{ item.nodeInfo || '未填写' }}</div>
                 </div>
@@ -126,10 +126,11 @@ export default defineComponent({
         const tipsDomRef = ref(null)
 
         const sourceTypes = [
-            { SERVICETYPE: 'MR', name: '地图资源上传' },
-            { SERVICETYPE: 'ER', name: '场景资源上传' },
-            { SERVICETYPE: 'DR', name: '文件资源上传' },
-            { SERVICETYPE: 'SR', name: '组件资源上传' },
+            { SERVICETYPE: 'MR', name: '地图' },
+            { SERVICETYPE: 'ER', name: '场景' },
+            { SERVICETYPE: 'DR', name: '文件' },
+            { SERVICETYPE: 'SR', name: '组件' },
+            { SERVICETYPE: 'interface', name: '接口' },
         ]
 
         const navBtns = reactive([
@@ -224,7 +225,7 @@ export default defineComponent({
                             nodeName: lc.CHECKUSERNAEM,
                             nodeTime: lc.CHECKTIME,
                             nodeInfo: lc.CHECKINFO,
-                            nodeIsPass: lc.ISPASS==='0'?'不通过':'通过'
+                            nodeIsPass: lc.ISPASS === '0' ? '不通过' : '通过'
                         })
                     })
                     formItemData.lcxx.pop()
@@ -282,10 +283,11 @@ export default defineComponent({
             let t = new Date().getTime()
             appStore.setRouterPushAuditFlag(true)
             if (path === '/resource/examine') {
-                sourceTypes.forEach(source => {
-                    source.name === item.title && (type = source.SERVICETYPE)
-                })
+
             }
+            sourceTypes.forEach(source => {
+                source.name === item.title.slice(0,2) && (type = source.SERVICETYPE)
+            })
             router.push({ path: path, query: { bussid: item.bussid, type: type, t: t } })
             closeTips()
         }
@@ -634,6 +636,7 @@ export default defineComponent({
         .audit {
             padding: 0 10px;
             border-bottom: 1px solid rgba(182, 173, 173, 0.6);
+
             .check {
                 margin-top: 10px;
                 display: flex;
@@ -649,12 +652,13 @@ export default defineComponent({
                     // flex: 1;
                     // margin-right: 20px;
                 }
-                .time{
+
+                .time {
                     // margin-right: 20px;
                     // flex:1;
                 }
 
-                .ispass{
+                .ispass {
                     // flex:1;
                 }
             }