|
@@ -27,59 +27,60 @@
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="图层名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
|
|
|
- <a-input v-model="model.name" placeholder="请输入图层名称" ></a-input>
|
|
|
+ <a-input v-model="model.name" placeholder="请输入图层名称"></a-input>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="图层别名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="alias">
|
|
|
- <a-input v-model="model.alias" placeholder="请输入图层别名" ></a-input>
|
|
|
+ <a-input v-model="model.alias" placeholder="请输入图层别名"></a-input>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="图层服务地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="url">
|
|
|
- <a-input v-model="model.url" placeholder="请输入图层服务地址" ></a-input>
|
|
|
+ <a-input v-model="model.url" placeholder="请输入图层服务地址"></a-input>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="子图层ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sublayerid">
|
|
|
- <a-input-number v-model="model.sublayerid" placeholder="请输入子图层ID" style="width: 100%" />
|
|
|
+ <a-input-number v-model="model.sublayerid" placeholder="请输入子图层ID" style="width: 100%"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="是否显示" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="visible">
|
|
|
- <j-dict-select-tag type="list" v-model="model.visible" dictCode="visible" placeholder="请选择是否显示" />
|
|
|
+ <j-dict-select-tag type="list" v-model="model.visible" dictCode="visible" placeholder="请选择是否显示"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="是否显示标注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="labelsvisible">
|
|
|
- <j-dict-select-tag type="list" v-model="model.labelsvisible" dictCode="visible" placeholder="请选择是否显示标注" />
|
|
|
+ <j-dict-select-tag type="list" v-model="model.labelsvisible" dictCode="visible" placeholder="请选择是否显示标注"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="服务类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="servicetype">
|
|
|
- <j-dict-select-tag type="list" v-model="model.servicetype" dictCode="servicetype" placeholder="请选择服务类型" @change='srvtypeChange' />
|
|
|
+ <j-dict-select-tag type="list" v-model="model.servicetype" dictCode="servicetype" placeholder="请选择服务类型"
|
|
|
+ @change='srvtypeChange'/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="显示层级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zindex">
|
|
|
- <a-input-number v-model="model.zindex" placeholder="请输入显示层级" style="width: 100%" />
|
|
|
+ <a-input-number v-model="model.zindex" placeholder="请输入显示层级" style="width: 100%"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="列表显示顺序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="displayorder">
|
|
|
- <a-input-number v-model="model.displayorder" placeholder="请输入列表显示顺序" style="width: 100%" />
|
|
|
+ <a-input-number v-model="model.displayorder" placeholder="请输入列表显示顺序" style="width: 100%"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
-<!-- <a-col :span="12">-->
|
|
|
-<!-- <a-form-model-item label="数据服务接口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataport">-->
|
|
|
-<!-- <a-input v-model="model.dataport" placeholder="请输入数据服务接口" ></a-input>-->
|
|
|
-<!-- </a-form-model-item>-->
|
|
|
-<!-- </a-col>-->
|
|
|
-<!-- <a-col :span="12">-->
|
|
|
-<!-- <a-form-model-item label="数据关联字段" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="relfield">-->
|
|
|
-<!-- <a-input v-model="model.relfield" placeholder="请输入数据关联字段" ></a-input>-->
|
|
|
-<!-- </a-form-model-item>-->
|
|
|
-<!-- </a-col>-->
|
|
|
+ <!-- <a-col :span="12">-->
|
|
|
+ <!-- <a-form-model-item label="数据服务接口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataport">-->
|
|
|
+ <!-- <a-input v-model="model.dataport" placeholder="请输入数据服务接口" ></a-input>-->
|
|
|
+ <!-- </a-form-model-item>-->
|
|
|
+ <!-- </a-col>-->
|
|
|
+ <!-- <a-col :span="12">-->
|
|
|
+ <!-- <a-form-model-item label="数据关联字段" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="relfield">-->
|
|
|
+ <!-- <a-input v-model="model.relfield" placeholder="请输入数据关联字段" ></a-input>-->
|
|
|
+ <!-- </a-form-model-item>-->
|
|
|
+ <!-- </a-col>-->
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="是否参与分析" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="analyzable">
|
|
|
<j-dict-select-tag type="list" v-model="model.analyzable" dictCode="whether" placeholder="请选择图层是否参与分析"/>
|
|
@@ -137,19 +138,24 @@
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="查询条件字段" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnarea">
|
|
|
- <a-input v-model="model.queryname" placeholder="请输入查询条件字段"/>
|
|
|
+ <a-input v-model="model.queryname" placeholder="请输入查询条件字段"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="查询条件中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnarea">
|
|
|
- <a-input v-model="model.chinesename" placeholder="请输入查询条件中文名称"/>
|
|
|
+ <a-input v-model="model.chinesename" placeholder="请输入查询条件中文名称"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <!-- <a-col :span="12">-->
|
|
|
+ <!-- <a-form-model-item label="图例" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="legend">-->
|
|
|
+ <!-- <j-image-upload v-model="model.legend"></j-image-upload>-->
|
|
|
+ <!-- </a-form-model-item>-->
|
|
|
+ <!-- </a-col>-->
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-model-item label="图层样式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="legend">
|
|
|
+ <a-input v-model="model.style" placeholder="请输入查询条件中文名称"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
-<!-- <a-col :span="12">-->
|
|
|
-<!-- <a-form-model-item label="图例" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="legend">-->
|
|
|
-<!-- <j-image-upload v-model="model.legend"></j-image-upload>-->
|
|
|
-<!-- </a-form-model-item>-->
|
|
|
-<!-- </a-col>-->
|
|
|
</a-row>
|
|
|
</a-form-model>
|
|
|
</a-spin>
|
|
@@ -158,124 +164,122 @@
|
|
|
|
|
|
<script>
|
|
|
|
|
|
- import { httpAction } from '@/api/manage'
|
|
|
- import { validateDuplicateValue } from '@/utils/util'
|
|
|
- export default {
|
|
|
- name: "RescatalogModal",
|
|
|
- components: {
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- title:"操作",
|
|
|
- width:800,
|
|
|
- visible: false,
|
|
|
- model:{
|
|
|
- },
|
|
|
- labelCol: {
|
|
|
- xs: { span: 24 },
|
|
|
- sm: { span: 5 },
|
|
|
- },
|
|
|
- wrapperCol: {
|
|
|
- xs: { span: 24 },
|
|
|
- sm: { span: 16 },
|
|
|
- },
|
|
|
-
|
|
|
- confirmLoading: false,
|
|
|
- validatorRules: {
|
|
|
- },
|
|
|
- url: {
|
|
|
- add: "/resManager.catalog/rescatalog/add",
|
|
|
- edit: "/resManager.catalog/rescatalog/edit",
|
|
|
- },
|
|
|
- expandedRowKeys:[],
|
|
|
- pidField:"pid"
|
|
|
+import {httpAction} from '@/api/manage'
|
|
|
+import {validateDuplicateValue} from '@/utils/util'
|
|
|
|
|
|
- }
|
|
|
- },
|
|
|
- created () {
|
|
|
- //备份model原始值
|
|
|
- this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
- },
|
|
|
- methods: {
|
|
|
- add (obj) {
|
|
|
- this.modelDefault.pid=''
|
|
|
- this.edit(Object.assign(this.modelDefault , obj));
|
|
|
+export default {
|
|
|
+ name: "RescatalogModal",
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ title: "操作",
|
|
|
+ width: 800,
|
|
|
+ visible: false,
|
|
|
+ model: {},
|
|
|
+ labelCol: {
|
|
|
+ xs: {span: 24},
|
|
|
+ sm: {span: 5},
|
|
|
},
|
|
|
- edit (record) {
|
|
|
- this.model = Object.assign({}, record);
|
|
|
- this.visible = true;
|
|
|
+ wrapperCol: {
|
|
|
+ xs: {span: 24},
|
|
|
+ sm: {span: 16},
|
|
|
},
|
|
|
- close () {
|
|
|
- this.$emit('close');
|
|
|
- this.visible = false;
|
|
|
- this.$refs.form.clearValidate()
|
|
|
+
|
|
|
+ confirmLoading: false,
|
|
|
+ validatorRules: {},
|
|
|
+ url: {
|
|
|
+ add: "/resManager.catalog/rescatalog/add",
|
|
|
+ edit: "/resManager.catalog/rescatalog/edit",
|
|
|
},
|
|
|
- handleOk () {
|
|
|
- const that = this;
|
|
|
- // 触发表单验证
|
|
|
- this.$refs.form.validate(valid => {
|
|
|
- if (valid) {
|
|
|
- that.confirmLoading = true;
|
|
|
- let httpurl = '';
|
|
|
- let method = '';
|
|
|
- if(!this.model.id){
|
|
|
- httpurl+=this.url.add;
|
|
|
- method = 'post';
|
|
|
- }else{
|
|
|
- httpurl+=this.url.edit;
|
|
|
- method = 'put';
|
|
|
- }
|
|
|
- if(this.model.id && this.model.id === this.model[this.pidField]){
|
|
|
- that.$message.warning("父级节点不能选择自己");
|
|
|
- that.confirmLoading = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- httpAction(httpurl,this.model,method).then((res)=>{
|
|
|
- if(res.success){
|
|
|
- that.$message.success(res.message);
|
|
|
- this.$emit('ok');
|
|
|
- }else{
|
|
|
- that.$message.warning(res.message);
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- that.confirmLoading = false;
|
|
|
- that.close();
|
|
|
- })
|
|
|
- }else{
|
|
|
- return false
|
|
|
+ expandedRowKeys: [],
|
|
|
+ pidField: "pid"
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //备份model原始值
|
|
|
+ this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ add(obj) {
|
|
|
+ this.modelDefault.pid = ''
|
|
|
+ this.edit(Object.assign(this.modelDefault, obj));
|
|
|
+ },
|
|
|
+ edit(record) {
|
|
|
+ this.model = Object.assign({}, record);
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.$emit('close');
|
|
|
+ this.visible = false;
|
|
|
+ this.$refs.form.clearValidate()
|
|
|
+ },
|
|
|
+ handleOk() {
|
|
|
+ const that = this;
|
|
|
+ // 触发表单验证
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ that.confirmLoading = true;
|
|
|
+ let httpurl = '';
|
|
|
+ let method = '';
|
|
|
+ if (!this.model.id) {
|
|
|
+ httpurl += this.url.add;
|
|
|
+ method = 'post';
|
|
|
+ } else {
|
|
|
+ httpurl += this.url.edit;
|
|
|
+ method = 'put';
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- handleCancel () {
|
|
|
- this.close()
|
|
|
- },
|
|
|
- submitSuccess(formData,flag){
|
|
|
- if(!formData.id){
|
|
|
- let treeData = this.$refs.treeSelect.getCurrTreeData()
|
|
|
- this.expandedRowKeys=[]
|
|
|
- this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
|
|
|
- this.$emit('ok',formData,this.expandedRowKeys.reverse());
|
|
|
- }else{
|
|
|
- this.$emit('ok',formData,flag);
|
|
|
- }
|
|
|
- },
|
|
|
- getExpandKeysByPid(pid,arr,all){
|
|
|
- if(pid && arr && arr.length>0){
|
|
|
- for(let i=0;i<arr.length;i++){
|
|
|
- if(arr[i].key==pid){
|
|
|
- this.expandedRowKeys.push(arr[i].key)
|
|
|
- this.getExpandKeysByPid(arr[i]['parentId'],all,all)
|
|
|
- }else{
|
|
|
- this.getExpandKeysByPid(pid,arr[i].children,all)
|
|
|
- }
|
|
|
+ if (this.model.id && this.model.id === this.model[this.pidField]) {
|
|
|
+ that.$message.warning("父级节点不能选择自己");
|
|
|
+ that.confirmLoading = false;
|
|
|
+ return;
|
|
|
}
|
|
|
+ httpAction(httpurl, this.model, method).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ that.$message.success(res.message);
|
|
|
+ this.$emit('ok');
|
|
|
+ } else {
|
|
|
+ that.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ that.confirmLoading = false;
|
|
|
+ that.close();
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
}
|
|
|
- },
|
|
|
- srvtypeChange(val){
|
|
|
- if(val == 'TileLayer'){
|
|
|
- this.model.sublayerid = '';
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCancel() {
|
|
|
+ this.close()
|
|
|
+ },
|
|
|
+ submitSuccess(formData, flag) {
|
|
|
+ if (!formData.id) {
|
|
|
+ let treeData = this.$refs.treeSelect.getCurrTreeData()
|
|
|
+ this.expandedRowKeys = []
|
|
|
+ this.getExpandKeysByPid(formData[this.pidField], treeData, treeData)
|
|
|
+ this.$emit('ok', formData, this.expandedRowKeys.reverse());
|
|
|
+ } else {
|
|
|
+ this.$emit('ok', formData, flag);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getExpandKeysByPid(pid, arr, all) {
|
|
|
+ if (pid && arr && arr.length > 0) {
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ if (arr[i].key == pid) {
|
|
|
+ this.expandedRowKeys.push(arr[i].key)
|
|
|
+ this.getExpandKeysByPid(arr[i]['parentId'], all, all)
|
|
|
+ } else {
|
|
|
+ this.getExpandKeysByPid(pid, arr[i].children, all)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ srvtypeChange(val) {
|
|
|
+ if (val == 'TileLayer') {
|
|
|
+ this.model.sublayerid = '';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|