소스 검색

fix: 打包脚本

lvkun 2 년 전
부모
커밋
d581222425
3개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 2
      plugins/build.js
  2. 12 0
      src/pages/Iot/model/components/modelDefine.vue
  3. 2 3
      src/router/index.ts

+ 2 - 2
plugins/build.js

@@ -11,10 +11,10 @@ const rootPath = join(__dirname, '..')
 const file = fs.readFileSync(resolve(rootPath, 'src/router/index.ts'), 'utf8')
 
 const r = file.replace(
-  'const _routes = [iot, rts, schedule, view, lowcode]',
+  'const _routes = [iot, rts, schedule, view, lowcode, user, login]',
   `const _routes = [${args.map((arg, index) => index > 0 ? ` ${arg}` : arg)}]`
 )
-
+console.log(r)
 console.log('修改路由值成功 🌹')
 
 fs.writeFileSync(resolve(rootPath, 'src/router/index.ts'), r, 'utf-8')

+ 12 - 0
src/pages/Iot/model/components/modelDefine.vue

@@ -13,6 +13,7 @@
     :dataSource="state.dataSource"
     :loading="state.loading"
     :pagination="state.queryParams"
+    @change="changeAttrPage"
   >
     <template #bodyCell="{column, record}">
       <template v-if="column.key === 'action'">
@@ -45,6 +46,7 @@
         :dataSource="state.dataSourceCmd"
         :loading="state.loadingCmd"
         :pagination="state.queryParamsCmd"
+        @change="changeCmdPage"
       >
         <template #bodyCell="{column, record}">
           <template v-if="column.key === 'cmdParams'">
@@ -374,6 +376,16 @@ const { resetFields: resetFieldsCmdP, validate: validateCmdP, validateInfos: val
   dataType: [{ require: true, message: '请选择数据类型' }]
 })
 
+const changeAttrPage = ({ current }) => {
+  state.queryParams.page = current
+  getModelAttr()
+}
+
+const changeCmdPage = ({ current }) => {
+  state.queryParamsCmd.page = current
+  getModelCmd()
+}
+
 const delCmdParams = (type: 'request' | 'response', id: string) => {
   const key = type === 'request' ? 'requestData' : 'responseData'
   const index = state.dataCmdParams[key].indexOf(id)

+ 2 - 3
src/router/index.ts

@@ -374,6 +374,7 @@ const login = {
 }
 
 const _routes = [iot, rts, schedule, view, lowcode, user, login] as any
+// const _routes = [iot] as any
 
 if (_routes[0].link) {
   window.open(_routes[0].path)
@@ -388,7 +389,7 @@ const redirectRoutes = {
   redirect: _routes[0].redirect
 }
 
-export const routes: Array<ROUTER.RoutesProps> = [redirectRoutes, ..._routes]
+export const routes: Array<ROUTER.RoutesProps> = [redirectRoutes, ..._routes, login]
 
 const router = createRouter({
   history: createWebHistory(process.env.BASE_URL),
@@ -403,6 +404,4 @@ const router = createRouter({
   })
 })
 
-console.log(router.getRoutes())
-
 export default router