|
|
@@ -95,7 +95,10 @@
|
|
|
</a-row>
|
|
|
</a-checkbox-group>
|
|
|
</div>
|
|
|
- <a-pagination size="small" :total="50" :show-total="total => 'Total 50 items'" />
|
|
|
+ <div class="pagination-box">
|
|
|
+ <Pagination size="small" v-model:current="pagination.current" :page-size="50" :total="pagination.total"
|
|
|
+ @change="pageChange" />
|
|
|
+ </div>
|
|
|
</a-card>
|
|
|
</div>
|
|
|
<div class="right-content-middle">
|
|
|
@@ -138,21 +141,31 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script>
|
|
|
|
|
|
+<script>
|
|
|
import { defineComponent, ref, watch, reactive, onMounted } from 'vue';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
+import { message, Pagination } from 'ant-design-vue';
|
|
|
import { getDirectoryTreeList, addTreeNode } from '/@/api/sys/gis';
|
|
|
// import Guid from 'guid'
|
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
|
import { session } from '/@/utils/Memory';
|
|
|
|
|
|
export default defineComponent({
|
|
|
-
|
|
|
+ name: 'resourceCataloging',
|
|
|
+ components: { Pagination },
|
|
|
setup() {
|
|
|
let coordinateChangeValue = ref('')
|
|
|
let typeChangeValue = ref('MR,ER,DR')
|
|
|
let clickTreeNode = ref({})
|
|
|
+ let associatedFlag = ref('')
|
|
|
+ const pagination = reactive({
|
|
|
+ current: 1,
|
|
|
+ total: 100
|
|
|
+ })
|
|
|
+ // 分页重新查
|
|
|
+ const pageChange = (page, pageSize) => {
|
|
|
+ getUsedResource()
|
|
|
+ }
|
|
|
// 生命周期函数
|
|
|
onMounted(() => {
|
|
|
getTreeList()
|
|
|
@@ -286,7 +299,10 @@ export default defineComponent({
|
|
|
checked.value = ['MR', 'DR', 'ER']
|
|
|
typeChangeValue.value = 'MR,ER,DR'
|
|
|
coordinateChangeValue.value = ''
|
|
|
+ associatedFlag.value = ''
|
|
|
+ pagination.current = 1
|
|
|
getUsedResource()
|
|
|
+ getAssociatedData()
|
|
|
}
|
|
|
|
|
|
// 坐标系下拉框处理函数
|
|
|
@@ -294,7 +310,7 @@ export default defineComponent({
|
|
|
pagination.current = 1
|
|
|
coordinateChangeValue.value = value1 || ''
|
|
|
getUsedResource()
|
|
|
- getAssociatedData(clickTreeNode.value.id)
|
|
|
+ getAssociatedData()
|
|
|
}
|
|
|
|
|
|
// 请求可用资源
|
|
|
@@ -305,19 +321,20 @@ export default defineComponent({
|
|
|
directoryFormData.append('interfaceName', 'antu.space.provider.sservicebase.SServicebaseProvider')
|
|
|
directoryFormData.append('methodName', 'pageList')
|
|
|
directoryFormData.append('args[]', gisToken)
|
|
|
- directoryFormData.append('args[]', '1')
|
|
|
- directoryFormData.append('args[]', '100')
|
|
|
+ directoryFormData.append('args[]', pagination.current)
|
|
|
+ directoryFormData.append('args[]', '50')
|
|
|
directoryFormData.append('args[]', inputValue.value)
|
|
|
directoryFormData.append('args[]', typeChangeValue.value)
|
|
|
- directoryFormData.append('args[]', '')
|
|
|
+ directoryFormData.append('args[]', associatedFlag.value)
|
|
|
directoryFormData.append('args[]', coordinateChangeValue.value)
|
|
|
console.log("参数" + JSON.stringify(directoryFormData))
|
|
|
addTreeNode(directoryFormData).then((res) => {
|
|
|
if (res.status == 0) {
|
|
|
usedResourceData.value = []
|
|
|
const data = JSON.parse(res.result)
|
|
|
+ pagination.total = data.totalItems
|
|
|
data.items.forEach((item) => {
|
|
|
- console.log(item.rtype);
|
|
|
+ // console.log(item.rtype);
|
|
|
usedResourceData.value.push({
|
|
|
label: item.servicename,
|
|
|
value: JSON.stringify({
|
|
|
@@ -334,23 +351,29 @@ export default defineComponent({
|
|
|
// 选择可用数据
|
|
|
let useValue = ref([])
|
|
|
const selectUsedData = (value) => {
|
|
|
- console.log("可使用数据")
|
|
|
- console.log(value);
|
|
|
useValue.value = value
|
|
|
}
|
|
|
|
|
|
// 顶部复选框处理函数
|
|
|
const checked = ref(['MR', 'DR', 'ER']) // 复选框
|
|
|
- const plainOptions = ref([{
|
|
|
- label: '地图MR',
|
|
|
- value: 'MR',
|
|
|
- }, {
|
|
|
- label: '场景ER',
|
|
|
- value: 'ER',
|
|
|
- }, {
|
|
|
- label: '文件数据DR',
|
|
|
- value: 'DR',
|
|
|
- }])
|
|
|
+ const plainOptions = ref([
|
|
|
+ {
|
|
|
+ label: '地图MR',
|
|
|
+ value: 'MR',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '场景ER',
|
|
|
+ value: 'ER',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '文件数据DR',
|
|
|
+ value: 'DR',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '未关联',
|
|
|
+ value: 'false',
|
|
|
+ }
|
|
|
+ ])
|
|
|
const selectType = (e) => {
|
|
|
pagination.current = 1
|
|
|
if (e.toString().indexOf('false') > -1) {
|
|
|
@@ -378,13 +401,13 @@ export default defineComponent({
|
|
|
|
|
|
// 得到已经关联的数据
|
|
|
let associatedData = ref([]) //已关联数据
|
|
|
- const getAssociatedData = (value1) => {
|
|
|
+ const getAssociatedData = () => {
|
|
|
const gisToken = session.getItem('tokenV2')
|
|
|
let directoryFormData = new FormData()
|
|
|
directoryFormData.append('interfaceName', 'antu.space.provider.sservicebase.SServicebaseProvider')
|
|
|
directoryFormData.append('methodName', 'getByDids')
|
|
|
directoryFormData.append('args[]', gisToken)
|
|
|
- directoryFormData.append('args[]', value1)
|
|
|
+ directoryFormData.append('args[]', clickTreeNode.value.id)
|
|
|
directoryFormData.append('args[]', coordinateChangeValue.value)
|
|
|
addTreeNode(directoryFormData).then((res) => {
|
|
|
if (res.status == 0) {
|
|
|
@@ -428,7 +451,7 @@ export default defineComponent({
|
|
|
directoryFormData.append('args[]', JSON.stringify(associatedValueArr))
|
|
|
addTreeNode(directoryFormData).then((res) => {
|
|
|
if (res.status == 0) {
|
|
|
- getAssociatedData(clickTreeNode.value.id, coordinateChangeValue.value)
|
|
|
+ getAssociatedData()
|
|
|
useValue.value = []
|
|
|
}
|
|
|
})
|
|
|
@@ -455,13 +478,15 @@ export default defineComponent({
|
|
|
directoryFormData.append('args[]', cancleUseValue.value.toString())
|
|
|
addTreeNode(directoryFormData).then((res) => {
|
|
|
if (res.status == 0) {
|
|
|
- getAssociatedData(clickTreeNode.value.id, coordinateChangeValue.value)
|
|
|
+ getAssociatedData()
|
|
|
cancleUseValue.value = []
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
+ pagination,
|
|
|
+ pageChange,
|
|
|
coordinateChangeValue,
|
|
|
typeChangeValue,
|
|
|
treeData,
|
|
|
@@ -689,6 +714,12 @@ export default defineComponent({
|
|
|
text-overflow: ellipsis;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .pagination-box {
|
|
|
+ margin-top: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|