Explorar el Código

可视化统计路径配置

yuhan hace 2 meses
padre
commit
49fd287099

+ 112 - 0
src/views/module_interLock/dashboardUrlSet/DashboardUrlSetList.vue

@@ -0,0 +1,112 @@
+<template>
+  <div style="height: 100%;">
+    <div class="iotmenu-content-header">
+      <a-icon type="file-text" />
+      <span>可视化配置</span>
+    </div>
+    <a-card :bordered="false" class="iotmenu-content">
+      <div>
+        <a-table
+          ref="table"
+          size="middle"
+          :scroll="{x:true}"
+          rowKey="id"
+          :columns="columns"
+          :dataSource="dataSource"
+          :pagination="ipagination"
+          :loading="loading"
+          class="j-table-force-nowrap"
+          @change="handleTableChange">
+          <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
+
+          <template slot="dashboardUrl" slot-scope="text">
+            <div style="word-wrap: break-word; white-space: pre-wrap;">{{ text }}</div>
+          </template>
+          <span slot="action" slot-scope="text, record">
+            <a-tooltip style="margin-right: 10px;">
+              <template slot="title"> 设置 </template>
+              <span class="edit-btn" @click="handleEdit(record)"></span>
+            </a-tooltip>
+          </span>
+
+        </a-table>
+      </div>
+
+      <dashboard-url-set-model ref="modalForm" @ok="modalFormOk"></dashboard-url-set-model>
+    </a-card>
+  </div>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import { getSystemSubmenu } from '@/api/api'
+  import DashboardUrlSetModel from './modules/DashboardUrlSetModel.vue'
+
+  export default {
+    name: 'DashboardUrlSetList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      DashboardUrlSetModel
+    },
+    data () {
+      return {
+        description: '可视化路径配置表管理页面',
+        // 表头
+        columns: [
+          {
+            title:'可视化统计路径',
+            align:"center",
+            dataIndex: 'dashboardUrl',
+            width: 500,
+            scopedSlots: { customRender: 'dashboardUrl' }
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            // fixed:"right",
+            width: 100,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          // list: "/interlockLoginConfig/interlockLoginConfig/list",
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    },
+    computed: {
+      // importExcelUrl: function(){
+      //   return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      // },
+    },
+    methods: {
+      loadData() {
+        this.loading = true
+        // 联锁管理id写死
+        getSystemSubmenu({parentId:'1793561497875640322'}).then((res) => {
+          if (res.success) {
+            // this.dataSource = res.result.filter(item => item.name === '可视化统计')
+            this.dataSource = res.result.filter(item => item.id === '1798542858253357057')
+            if(this.dataSource.length > 0){
+              this.dataSource[0].dashboardUrl = (this.dataSource[0].url.split(')=('))[1]
+            }
+          }
+        }).finally(()=>{
+          this.loading = false
+        })
+      },
+      initDictConfig(){
+      },
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 99 - 0
src/views/module_interLock/dashboardUrlSet/modules/DashboardUrlSetForm.vue

@@ -0,0 +1,99 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="可视化统计路径" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dashboardUrl">
+              <a-textarea v-model="model.dashboardUrl" :rows="6" allow-clear placeholder="请输入可视化统计路径"></a-textarea>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+  import { editPermission } from '@/api/api'
+
+  export default {
+    name: 'LoginConfigForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+          dashboardUrl: ''
+        },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+          dashboardUrl: [
+            { required: true, message: '请输入可视化统计路径!', },
+          ],
+        },
+        url: {
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      edit (record) {
+        this.model = Object.assign({}, record);
+        // this.model.dashboardUrl = (record.url.split(')=('))[1]
+        this.visible = true;
+      },
+      change(){
+        this.model = { ...this.model }
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            this.model.url = '/interLock/dashboard)=(' + this.model.dashboardUrl
+            editPermission(this.model).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 60 - 0
src/views/module_interLock/dashboardUrlSet/modules/DashboardUrlSetModel.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <dashboard-url-set-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></dashboard-url-set-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import DashboardUrlSetForm from './DashboardUrlSetForm.vue'
+  export default {
+    name: 'LoginConfigModal',
+    components: {
+      DashboardUrlSetForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>