Kaynağa Gözat

行业管理、form表单组件

l1069030731 2 yıl önce
ebeveyn
işleme
a59a3a8683

+ 45 - 12
src/components/form-test/index.vue

@@ -1,5 +1,15 @@
 <template>
-  <el-form ref="form" :model="insideData" :rules="insideRules" :label-width="labelWidth + 'px'">
+  <!-- <el-form ref="form" :model="insideData" :rules="insideRules" :label-width="labelWidth + 'px'"> -->
+  <el-form
+    v-loading="formConfig.loadingStatus"
+    :element-loading-text="formConfig.loadingText"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.2)"
+    ref="form"
+    :model="insideData"
+    :rules="insideRules"
+    label-width="auto"
+  >
     <el-row>
       <el-col v-for="(value, key, index) in insideConfig" :key="index" :span="24 / value.span">
         <el-form-item v-if="value.if" :label="value.label" :prop="key">
@@ -22,6 +32,7 @@
               :show-password="value.itemType === 'password'"
               :autosize="{ minRows: 4, maxRows: 7 }"
               :style="{ width: value.width || '100%' }"
+              size="small"
             />
 
             <!--
@@ -46,6 +57,7 @@
               :clearable="value.clearable"
               :filterable="value.filterable"
               :style="{ width: value.width || '100%' }"
+              size="small"
             >
               <el-option v-for="item in value.data" :key="item[value.keyName]" :label="item[value.labelName]" :value="item[value.keyName]" />
             </el-select>
@@ -60,7 +72,7 @@
                setData()     获取数据方法
                binding:      执行setData()返回参数的绑定路径
             -->
-            <el-radio-group v-else-if="value.type === 'radio'" v-model="insideData[key]" :disabled="value.disabled">
+            <el-radio-group v-else-if="value.type === 'radio'" size="small" v-model="insideData[key]" :disabled="value.disabled">
               <el-radio v-for="item in value.data" :key="item[value.keyName]" :label="item[value.keyName]">
                 {{ item[value.labelName] }}
               </el-radio>
@@ -75,7 +87,7 @@
              setData()    获取数据方法
              binding:     执行setData()返回参数的绑定路径
            -->
-            <el-checkbox-group v-else-if="value.type === 'checkbox'" v-model="insideData[key]" :disabled="value.disabled">
+            <el-checkbox-group v-else-if="value.type === 'checkbox'" size="small" v-model="insideData[key]" :disabled="value.disabled">
               <el-checkbox v-for="item in value.data" :key="item[value.keyName]" :label="item[value.keyName]">
                 {{ item[value.labelName] }}
               </el-checkbox>
@@ -100,6 +112,7 @@
               :disabled="value.disabled"
               :clearable="value.clearable"
               :style="{ width: value.width || '100%' }"
+              size="small"
             />
 
             <!--
@@ -118,6 +131,7 @@
               :disabled="value.disabled"
               :clearable="value.clearable"
               :style="{ width: value.width || '100%' }"
+              size="small"
             />
             <!-- @change="dateRangeChange(value, key)" -->
 
@@ -163,11 +177,12 @@
          query: 搜索方法
        -->
       <el-col v-if="this.formConfig['operation'] !== undefined" :span="6">
-        <div style="margin-left: 15px">
-          <el-button type="primary" @click="formConfig['operation'].query()">
+        <div style="margin-left: 15px; line-height: 38px">
+          <el-button type="primary" size="small" @click="formConfig['operation'].query()">
             搜索
           </el-button>
           <el-button
+            size="small"
             @click="
               dateRangeData = []
               formConfig['operation'].reset()
@@ -179,9 +194,16 @@
       </el-col>
     </el-row>
 
-    <el-row :gutter="10" style="margin-bottom: 10px" v-if="this.formConfig['otherButton'] && this.formConfig['otherButton'].length > 0">
-      <el-col :span="1.5" v-for="(item, index) in this.formConfig['otherButton']" :key="index">
-        <el-button type="primary" size="small" @click="formConfig['otherButton'][index][item.methodsText]()">{{ item.name }}</el-button>
+    <el-row style="margin-bottom: 10px" v-if="formConfig.otherButton && formConfig.otherButton.list && formConfig.otherButton.list.length > 0">
+      <el-col :span="24" :style="'text-align: ' + formConfig.otherButton.align || 'left'">
+        <el-button
+          v-for="(item, index) in formConfig.otherButton.list"
+          :key="index"
+          :type="item.type"
+          size="small"
+          @click="formConfig.otherButton.list[index][item.methodsText]()"
+          >{{ item.name }}</el-button
+        >
       </el-col>
     </el-row>
   </el-form>
@@ -200,6 +222,13 @@ export default {
       type: Object,
       required: true,
     },
+    // 必填参数校验
+    insideRules: {
+      type: Object,
+      default: () => {
+        return {}
+      },
+    },
     // 全局label宽度
     labelWidth: {
       type: Number,
@@ -225,7 +254,6 @@ export default {
     return {
       insideConfig: {}, // 内部配置
       insideData: {}, // 内部数据
-      insideRules: {}, // 内部必填参数校验
       dateRangeData: [], // 时间段
       fileData: [], // 文件路径数组
     }
@@ -252,7 +280,7 @@ export default {
       this.insideConfig = {}
       for (const key in this.formConfig) {
         // 跳过特殊方法( operation: 搜索、重置, otherButton: 新增等自定义按钮)
-        if (key === 'operation' || key === 'otherButton') {
+        if (key === 'operation' || key === 'otherButton' || key === 'loadingStatus' || key === 'loadingText') {
           continue
         }
         const value = this.formConfig[key]
@@ -355,7 +383,7 @@ export default {
       } else if (value.dict) {
         this.insideConfig[key].keyName = 'dictValue'
         this.insideConfig[key].labelName = 'dictLabel'
-        // this.insideConfig[key].data = await this.getDicts(value.dict)
+        this.insideConfig[key].data = await this.getDicts(value.dict)
         this.$forceUpdate()
       } else {
         const itemData = await value.setData()
@@ -397,5 +425,10 @@ export default {
 }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
+::v-deep {
+  .el-form-item {
+    margin-bottom: 8px;
+  }
+}
 </style>

+ 108 - 71
src/main.js

@@ -1,118 +1,155 @@
-import Vue from "vue";
-import axios from "./router/axios";
-import VueAxios from "vue-axios";
-import App from "./App";
-import router from "./router/router";
-import "./permission"; // 权限
-import "./error"; // 日志
-import "./cache"; //页面缓存
-import store from "./store";
-import { loadStyle } from "./util/util";
-import * as urls from "@/config/env";
-import Element from "element-ui";
-import { iconfontUrl, iconfontVersion } from "@/config/env";
-import i18n from "./lang"; // Internationalization
-import "./styles/common.scss";
-import basicBlock from "./components/basic-block/main";
-import basicContainer from "./components/basic-container/main";
-import thirdRegister from "./components/third-register/main";
-import avueUeditor from "avue-plugin-ueditor";
-import website from "@/config/website";
-import crudCommon from "@/mixins/crud";
-import Example from "./components/example";
-import Pagination from "./components/Pagination";
+import Vue from 'vue'
+import axios from './router/axios'
+import VueAxios from 'vue-axios'
+import App from './App'
+import router from './router/router'
+import './permission' // 权限
+import './error' // 日志
+import './cache' //页面缓存
+import store from './store'
+import { loadStyle } from './util/util'
+import * as urls from '@/config/env'
+import Element from 'element-ui'
+import { iconfontUrl, iconfontVersion } from '@/config/env'
+import i18n from './lang' // Internationalization
+import './styles/common.scss'
+import basicBlock from './components/basic-block/main'
+import basicContainer from './components/basic-container/main'
+import thirdRegister from './components/third-register/main'
+import avueUeditor from 'avue-plugin-ueditor'
+import website from '@/config/website'
+import crudCommon from '@/mixins/crud'
+import Example from './components/example'
+import Pagination from './components/Pagination'
 
 //cdn迁移进src目录
-import "./assets/cdn/element-ui/2.15.1/theme-chalk/index.css";
-import "./assets/cdn/animate/3.5.2/animate.css";
-import "./assets/cdn/iconfont/avue/iconfont.css";
-import "./assets/cdn/iconfont/saber/iconfont.css";
-import "./assets/cdn/avue/2.8.18/index.css";
-import { set } from "nprogress";
+import './assets/cdn/element-ui/2.15.1/theme-chalk/index.css'
+import './assets/cdn/animate/3.5.2/animate.css'
+import './assets/cdn/iconfont/avue/iconfont.css'
+import './assets/cdn/iconfont/saber/iconfont.css'
+import './assets/cdn/avue/2.8.18/index.css'
+import { set } from 'nprogress'
 
 // 注册全局crud驱动
-window.$crudCommon = crudCommon;
+window.$crudCommon = crudCommon
 // 加载Vue拓展
-Vue.use(router);
-Vue.use(VueAxios, axios);
+Vue.use(router)
+Vue.use(VueAxios, axios)
 Vue.use(Element, {
   i18n: (key, value) => i18n.t(key, value),
-});
+})
 Vue.use(window.AVUE, {
-  size: "small",
-  tableSize: "small",
+  size: 'small',
+  tableSize: 'small',
   calcHeight: 65,
   i18n: (key, value) => i18n.t(key, value),
-});
-Vue.use(Example);
-Vue.use(Pagination);
+})
+Vue.use(Example)
+Vue.use(Pagination)
+Vue.use(set)
+
+Element.Select.props.filterable = {
+  type: Boolean,
+  default: true,
+}
+Element.Select.props.clearable = {
+  type: Boolean,
+  default: true,
+}
+Element.TimePicker.props.editable = {
+  type: Boolean,
+  default: false,
+}
+Element.TimeSelect.props.editable = {
+  type: Boolean,
+  default: false,
+}
+Element.DatePicker.props.editable = {
+  type: Boolean,
+  default: false,
+}
+Element.Dialog.props.closeOnClickModal.default = false
+Element.Dialog.props.appendToBody.default = true
 
 // 注册全局容器
-Vue.component("basicContainer", basicContainer);
-Vue.component("basicBlock", basicBlock);
-Vue.component("thirdRegister", thirdRegister);
-Vue.component("avueUeditor", avueUeditor);
-Vue.component("Example", Example);
-Vue.component("Pagination", Pagination);
+Vue.component('basicContainer', basicContainer)
+Vue.component('basicBlock', basicBlock)
+Vue.component('thirdRegister', thirdRegister)
+Vue.component('avueUeditor', avueUeditor)
+Vue.component('Example', Example)
+Vue.component('Pagination', Pagination)
+
+Vue.prototype.msgSuccess = function (msg) {
+  this.$message({ showClose: true, message: msg, type: 'success' })
+}
+
+Vue.prototype.msgError = function (msg) {
+  this.$message({ showClose: true, message: msg, type: 'error' })
+}
+
+Vue.prototype.msgWarning = function (msg) {
+  this.$message({ showClose: true, message: msg, type: 'warning' })
+}
+
+Vue.prototype.msgInfo = function (msg) {
+  this.$message.info(msg)
+}
 
 // 加载相关url地址
 Object.keys(urls).forEach((key) => {
-  Vue.prototype[key] = urls[key];
-});
+  Vue.prototype[key] = urls[key]
+})
 // 加载website
-Vue.prototype.website = website;
+Vue.prototype.website = website
 // 动态加载阿里云字体库
 iconfontVersion.forEach((ele) => {
-  loadStyle(iconfontUrl.replace("$key", ele));
-});
+  loadStyle(iconfontUrl.replace('$key', ele))
+})
 
 //乾坤代码
-Vue.config.productionTip = false;
-let instance = null;
+Vue.config.productionTip = false
+let instance = null
 function render({ props = {} } = {}) {
-  const { container } = props;
+  const { container } = props
   instance = new Vue({
     router,
     store,
     i18n,
 
     render: (h) => h(App),
-  }).$mount(
-    container ? container.querySelector("#fjhxCloudVue") : "#fjhxCloudVue"
-  );
-  console.log(instance);
+  }).$mount(container ? container.querySelector('#fjhxCloudVue') : '#fjhxCloudVue')
+  console.log(instance)
 }
 
 // 独立运行时
-(function () {
-  console.log(window.__POWERED_BY_QIANKUN__);
+;(function () {
+  console.log(window.__POWERED_BY_QIANKUN__)
   if (window.__POWERED_BY_QIANKUN__) {
-    __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
+    __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__
   } else {
-    render();
+    render()
   }
-})();
+})()
 
 export async function bootstrap() {
-  console.log("vue app bootstraped");
+  console.log('vue app bootstraped')
 }
 export async function mount(props) {
-
   props.onGlobalStateChange((state, prev) => {
     // state: 变更后的状态; prev 变更前的状态
-    console.log(state, prev,'子组件监听');
-  });
-  props.setGlobalState({asd:21312312})
+    console.log(state, prev, '子组件监听')
+  })
+  props.setGlobalState({ asd: 21312312 })
   console.log(props)
-  render(props);
+  render(props)
 }
 export async function unmount() {
-  instance.$destroy();
-  instance.$el.innerHTML = "";
-  instance = null;
+  instance.$destroy()
+  instance.$el.innerHTML = ''
+  instance = null
   // router = null;
 }
-Vue.config.productionTip = false;
+Vue.config.productionTip = false
 
 // new Vue({
 //   router,

+ 56 - 54
src/router/page/index.js

@@ -1,11 +1,10 @@
-import Layout from "@/page/index/";
+import Layout from '@/page/index/'
 
 export default [
   {
-    path: "/login",
-    name: "登录页",
-    component: () =>
-      import(/* webpackChunkName: "page" */ "@/page/login/index"),
+    path: '/login',
+    name: '登录页',
+    component: () => import(/* webpackChunkName: "page" */ '@/page/login/index'),
     meta: {
       keepAlive: true,
       isTab: false,
@@ -13,9 +12,9 @@ export default [
     },
   },
   {
-    path: "/lock",
-    name: "锁屏页",
-    component: () => import(/* webpackChunkName: "page" */ "@/page/lock/index"),
+    path: '/lock',
+    name: '锁屏页',
+    component: () => import(/* webpackChunkName: "page" */ '@/page/lock/index'),
     meta: {
       keepAlive: true,
       isTab: false,
@@ -23,10 +22,9 @@ export default [
     },
   },
   {
-    path: "/404",
-    component: () =>
-      import(/* webpackChunkName: "page" */ "@/components/error-page/404"),
-    name: "404",
+    path: '/404',
+    component: () => import(/* webpackChunkName: "page" */ '@/components/error-page/404'),
+    name: '404',
     meta: {
       keepAlive: true,
       isTab: false,
@@ -34,10 +32,9 @@ export default [
     },
   },
   {
-    path: "/403",
-    component: () =>
-      import(/* webpackChunkName: "page" */ "@/components/error-page/403"),
-    name: "403",
+    path: '/403',
+    component: () => import(/* webpackChunkName: "page" */ '@/components/error-page/403'),
+    name: '403',
     meta: {
       keepAlive: true,
       isTab: false,
@@ -45,10 +42,9 @@ export default [
     },
   },
   {
-    path: "/500",
-    component: () =>
-      import(/* webpackChunkName: "page" */ "@/components/error-page/500"),
-    name: "500",
+    path: '/500',
+    component: () => import(/* webpackChunkName: "page" */ '@/components/error-page/500'),
+    name: '500',
     meta: {
       keepAlive: true,
       isTab: false,
@@ -56,55 +52,61 @@ export default [
     },
   },
   {
-    path: "/",
-    name: "主页",
-    redirect: "/wel",
+    path: '/',
+    name: '主页',
+    redirect: '/wel',
   },
   {
-    path: "/myiframe",
+    path: '/myiframe',
     component: Layout,
-    redirect: "/myiframe",
+    redirect: '/myiframe',
     children: [
       {
-        path: ":routerPath",
-        name: "iframe",
-        component: () =>
-          import(/* webpackChunkName: "page" */ "@/components/iframe/main"),
+        path: ':routerPath',
+        name: 'iframe',
+        component: () => import(/* webpackChunkName: "page" */ '@/components/iframe/main'),
         props: true,
       },
     ],
   },
   {
-    path: "*",
-    redirect: "/404",
+    path: '*',
+    redirect: '/404',
   },
   {
-    path: "/warehouse-maintenance",
-    name: "仓库维护",
-    component: () =>
-      import(
-        /* webpackChunkName: "page" */ "@/views/basic-configuration/warehouse-maintenance/index"
-      ),
+    path: '/warehouse-maintenance',
+    name: '仓库维护',
+    component: () => import(/* webpackChunkName: "page" */ '@/views/basic-configuration/warehouse-maintenance/index'),
     meta: {
       keepAlive: true,
       isTab: false,
       isAuth: false,
     },
   },
-  // {
-  //   path: "/basic-configuration/warehouse-maintenance",
-  //   component: Layout,
-  //   redirect: "/basic-configuration/warehouse-maintenance/index",
-  //   children: [
-  //     {
-  //       path: "index",
-  //       name: "数据看板",
-  //       component: () =>
-  //         import(
-  //           /* webpackChunkName: "page" */ "@/views/basic-configuration/warehouse-maintenance/index"
-  //         ),
-  //       props: true,
-  //     },
-  //   ],
-  // },
-];
+  {
+    path: '/Internet-of-things/Industry-management',
+    component: Layout,
+    redirect: '/Internet-of-things/Industry-management/index',
+    children: [
+      {
+        path: 'index',
+        name: '行业管理',
+        component: () => import(/* webpackChunkName: "page" */ '@/views/Internet-of-things/Industry-management/index'),
+        props: true,
+      },
+    ],
+  },
+  {
+    path: '/Internet-of-things/Industry-management',
+    component: Layout,
+    redirect: '/Internet-of-things/Industry-management/details',
+    children: [
+      {
+        path: 'details',
+        name: '行业详情',
+        component: () => import(/* webpackChunkName: "page" */ '@/views/Internet-of-things/Industry-management/details'),
+        props: true,
+      },
+    ],
+  },
+]

+ 1 - 1
src/router/router.js

@@ -17,7 +17,7 @@ Vue.use(VueRouter);
 //创建路由
 export const createRouter = () =>
   new VueRouter({
-    mode: "hash", // 去掉url中的#
+    mode: "history", // 去掉url中的#
     scrollBehavior: () => ({
       y: 0,
     }),

+ 16 - 4
src/styles/element-ui.scss

@@ -25,7 +25,6 @@
   display: none;
 }
 
-
 .el-message__icon,
 .el-message__content {
   display: inline-block;
@@ -49,12 +48,19 @@
   padding: 0 !important;
 }
 
-.el-dropdown-menu__item--divided:before, .el-menu, .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus, .el-menu--horizontal > .el-menu-item:not(.is-disabled):hover, .el-menu--horizontal > .el-submenu .el-submenu__title:hover {
+.el-dropdown-menu__item--divided:before,
+.el-menu,
+.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus,
+.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
+.el-menu--horizontal > .el-submenu .el-submenu__title:hover {
   background-color: transparent;
 }
 
-
-.el-dropdown-menu__item--divided:before, .el-menu, .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus, .el-menu--horizontal > .el-menu-item:not(.is-disabled):hover, .el-menu--horizontal > .el-submenu .el-submenu__title:hover {
+.el-dropdown-menu__item--divided:before,
+.el-menu,
+.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus,
+.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
+.el-menu--horizontal > .el-submenu .el-submenu__title:hover {
   background-color: transparent !important;
 }
 
@@ -69,3 +75,9 @@
 .el-divider--horizontal {
   margin: 12px 0 !important;
 }
+
+.el-table th {
+  background-color: #edf0f5 !important;
+  height: 35px;
+  padding: 0 !important;
+}

+ 78 - 0
src/views/Internet-of-things/Industry-management/details.vue

@@ -0,0 +1,78 @@
+<template>
+  <div>
+    <el-card>
+      <div style="padding-left: 8px; border-left: 3px solid #0084ff">行业信息</div>
+      <el-row style="font-size: 12px; padding-top: 8px">
+        <el-col :span="4">
+          <span>行业名称: {{ transferParams.appName }}</span>
+        </el-col>
+        <el-col :span="20">
+          <span>AppId: {{ transferParams.appId }}</span>
+        </el-col>
+      </el-row>
+      <el-row style="font-size: 12px;">
+        <el-col :span="4">
+          <span>创建人: {{ transferParams.createUserName }}</span>
+        </el-col>
+        <el-col :span="20">
+          <span>创建时间: {{ transferParams.createTime }}</span>
+        </el-col>
+      </el-row>
+    </el-card>
+    <div style="height: 10px"></div>
+    <el-card style="height: calc(100vh - 64px - 50px - 140px)">
+      <div style="padding-left: 8px; border-left: 3px solid #0084ff">资源概览</div>
+      <el-row style="font-size: 12px; padding-top: 16px">
+        <el-col :span="4" style="background-color: #e6f3ff; padding: 8px 16px; display: flex; justify-content: space-between">
+          <div>产品数</div>
+          <div>{{ applicationDetails.productCount }}</div>
+        </el-col>
+      </el-row>
+      <el-row style="font-size: 12px; padding-top: 16px">
+        <el-col :span="4" style="background-color: #e6f3ff; padding: 8px 16px; display: flex; justify-content: space-between">
+          <div>设备数</div>
+          <div>{{ applicationDetails.deviceCount }}</div>
+        </el-col>
+      </el-row>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import * as API from '@/api/Internet-of-things/Industry-management.js'
+
+export default {
+  name: 'Industry-management-details',
+  data() {
+    return {
+      transferParams: {
+        id: '',
+        appName: '',
+        appId: '',
+        createUserName: '',
+        createTime: '',
+      },
+      applicationDetails: {
+        productCount: '',
+        deviceCount: '',
+      },
+    }
+  },
+  created() {
+    this.transferParams = this.$route.query
+  },
+  mounted() {
+    this.getDetails()
+  },
+  methods: {
+    getDetails() {
+      API.tdaApplicationDetails({ id: this.transferParams.id }).then((res) => {
+        this.applicationDetails = res.data.data
+      })
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 130 - 44
src/views/Internet-of-things/Industry-management/index.vue

@@ -1,28 +1,43 @@
 <template>
   <el-card class="box-card">
-    <test v-model="formData" :form-config="formConfig" :labelWidth="60" :clearable="false" :disabled="false" :label-width="100" :span="2">
-      <template v-slot:testSlot>
-        {{ '测试插槽' }}
-      </template>
-    </test>
+    <test v-model="queryParams" :form-config="queryForm"></test>
+
+    <el-table :data="tableList" :cell-style="{ padding: '0' }" :row-style="{ height: '35px' }" v-loading="loading" header-row-class-name="tableHeader">
+      <el-table-column label="行业名称" align="center" prop="appName" />
+      <el-table-column label="AppId" align="center" prop="appId" />
+      <el-table-column label="创建人" align="center" prop="createUserName" />
+      <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
+      <el-table-column label="操作" align="center" width="140">
+        <template slot-scope="scope">
+          <el-button type="text" @click="handleToView(scope.row)">查看</el-button>
+          <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
+
+    <el-dialog title="新建行业" v-if="open" :visible.sync="open" width="30%">
+      <test ref="test" v-model="dialogParams" :form-config="dialogForm" :insideRules="dialogRules"></test>
+    </el-dialog>
   </el-card>
 </template>
 
 <script>
 import * as API from '@/api/Internet-of-things/Industry-management.js'
-import test from '@/components/form-test'
+import test from '@/components/form-test/index.vue'
 
 export default {
   name: 'Industry-management',
   components: { test },
   data() {
     return {
-      formData: {
+      queryParams: {
         pageNum: 1,
         pageSize: 10,
         keyword: '',
       },
-      formConfig: {
+      queryForm: {
         keyword: {
           label: '关键字',
           span: 6,
@@ -30,25 +45,66 @@ export default {
         operation: {
           // 搜索按钮操作
           query: () => {
-            this.formData.pageNum = 1
+            this.queryParams.pageNum = 1
             this.getList()
           },
           // 重置按钮操作
           reset: () => {
-            this.formData = { pageNum: 1, pageSize: 10, keyword: '' }
-            this.formData.pageNum = 1
+            this.queryParams = { pageNum: 1, pageSize: 10, keyword: '' }
+            this.queryParams.pageNum = 1
             this.getList()
           },
         },
-        otherButton: [
-          {
-            name: '新建行业',
-            methodsText: 'add',
-            add: () => {
-              this.handleAdd()
+        otherButton: {
+          list: [
+            {
+              name: '新建行业',
+              methodsText: 'add',
+              type: 'primary',
+              add: () => {
+                this.handleAdd()
+              },
             },
-          },
-        ],
+          ],
+        },
+      },
+      tableList: [],
+      total: 0,
+      loading: false,
+      open: false,
+      title: '',
+      dialogParams: {
+        appName: '',
+      },
+      dialogForm: {
+        loadingStatus: false,
+        loadingText: '数据提交中,请稍后',
+        appName: {
+          label: '行业名称',
+        },
+        otherButton: {
+          align: 'center',
+          list: [
+            {
+              name: '取消',
+              methodsText: 'cancel',
+              cancel: () => {
+                this.open = false
+              },
+            },
+            {
+              name: '确定',
+              methodsText: 'submit',
+              type: 'primary',
+              submit: () => {
+                this.handleSubmit()
+              },
+            },
+          ],
+        },
+      },
+      dialogRules: {
+        appName: [{ required: true, message: '请输入行业名称', trigger: 'blur' }],
       },
     }
   },
@@ -59,9 +115,10 @@ export default {
   methods: {
     getList() {
       this.loading = true
-      API.tdaApplicationPage(this.formData).then(
+      API.tdaApplicationPage(this.queryParams).then(
         (res) => {
-          console.log(res)
+          this.total = res.data.data.total
+          this.tableList = res.data.data.records
           this.loading = false
         },
         (err) => {
@@ -71,37 +128,66 @@ export default {
       )
     },
     handleAdd() {
-      console.log('add')
+      this.dialogParams = {
+        appName: '',
+      }
+      this.open = true
+    },
+    handleSubmit() {
+      this.$refs.test.$refs['form'].validate((valid) => {
+        if (valid) {
+          this.dialogForm.loadingStatus = true
+          API.tdaApplicationAdd(this.dialogParams).then(
+            () => {
+              this.msgSuccess('添加成功')
+              this.open = false
+              this.dialogForm.loadingStatus = false
+              this.getList()
+            },
+            (err) => {
+              console.log('tdaApplicationAdd: ' + err)
+              this.dialogForm.loadingStatus = false
+            },
+          )
+          // } else {
+          //   setTimeout(() => {
+          //     const errorDiv = document.getElementsByClassName('is-error')
+          //     errorDiv[0].scrollIntoView()
+          //   }, 0)
+        }
+      })
+    },
+    handleToView(row) {
+      this.$router.push({
+        path: '/Internet-of-things/Industry-management/details',
+        query: {
+          id: row.id,
+          appName: row.appName,
+          appId: row.appId,
+          createUserName: row.createUserName,
+          createTime: row.createTime,
+        },
+      })
+    },
+    handleDelete(row) {
+      this.$confirm('请问是否删除行业:' + row.appName, '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '确定',
+        type: 'warning',
+      }).then(() => {
+        API.tdaApplicationDelete({ id: row.id }).then(() => {
+          this.msgSuccess('删除成功')
+          this.getList()
+        })
+      })
     },
   },
 }
 </script>
 
 <style lang="scss" scoped>
-* {
-  font-size: 12px;
-}
 .box-card {
   height: calc(100vh - 110px);
   overflow-y: auto;
 }
-.searchBtn {
-  background: #20b2aa;
-  color: #fff;
-  border: 1px solid #20b2aa;
-}
-
-::v-deep {
-  .el-input__inner {
-    border-radius: 1px;
-  }
-  .el-button--mini {
-    border-radius: 1px;
-  }
-  .tableHeader th {
-    background-color: #edf0f5;
-    height: 35px;
-    padding: 0;
-  }
-}
 </style>