2个文件已添加
4个文件已修改
36个文件已删除
18 文件已复制
22 文件已重命名
copy from src/cool/modules/device/components/index.ts
copy to src/cool/modules/alarm/components/index.ts
copy from src/cool/modules/device/directives/index.ts
copy to src/cool/modules/alarm/directives/index.ts
copy from src/cool/modules/device/index.ts
copy to src/cool/modules/alarm/index.ts
copy from src/cool/modules/device/pages/index.ts
copy to src/cool/modules/alarm/pages/index.ts
copy from src/cool/modules/douMsg/service/index.ts
copy to src/cool/modules/alarm/service/index.ts
copy from src/cool/modules/device/store/index.ts
copy to src/cool/modules/alarm/store/index.ts
copy from src/cool/modules/device/views/index.ts
copy to src/cool/modules/alarm/views/index.ts
| | |
| | | <template> |
| | | <cl-crud :ref="setRefs('crud')" :on-refresh="onRefresh" @load="onLoad"> |
| | | <el-row type="flex"> |
| | | <cl-refresh-btn /> |
| | | <cl-add-btn /> |
| | | <cl-menu-quick @success="refresh()" v-if="isDev" /> |
| | | </el-row> |
| | | <cl-crud :ref="setRefs('crud')" |
| | | :on-refresh="onRefresh" |
| | | @load="onLoad"> |
| | | <el-row type="flex"> |
| | | <cl-refresh-btn /> |
| | | <cl-add-btn /> |
| | | <cl-menu-quick @success="refresh()" |
| | | v-if="isDev" /> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <cl-table :ref="setRefs('table')" v-bind="table" @row-click="onRowClick"> |
| | | <!-- 名称 --> |
| | | <template #column-name="{ scope }"> |
| | | <span>{{ scope.row.name }}</span> |
| | | <el-tag |
| | | v-if="!scope.row.isShow" |
| | | size="mini" |
| | | effect="dark" |
| | | type="danger" |
| | | style="margin-left: 10px" |
| | | >隐藏</el-tag |
| | | > |
| | | </template> |
| | | <el-row> |
| | | <cl-table :ref="setRefs('table')" |
| | | v-bind="table" |
| | | @row-click="onRowClick"> |
| | | <!-- 名称 --> |
| | | <template #column-name="{ scope }"> |
| | | <span>{{ scope.row.name }}</span> |
| | | <el-tag v-if="!scope.row.isShow" |
| | | size="mini" |
| | | effect="dark" |
| | | type="danger" |
| | | style="margin-left: 10px">隐藏</el-tag> |
| | | </template> |
| | | |
| | | <!-- 图标 --> |
| | | <template #column-icon="{ scope }"> |
| | | <icon-svg :name="scope.row.icon" size="16px" style="margin-top: 5px" /> |
| | | </template> |
| | | <!-- 图标 --> |
| | | <template #column-icon="{ scope }"> |
| | | <icon-svg :name="scope.row.icon" |
| | | size="16px" |
| | | style="margin-top: 5px" /> |
| | | </template> |
| | | |
| | | <!-- 权限 --> |
| | | <template #column-perms="{ scope }"> |
| | | <el-tag |
| | | v-for="(item, index) in scope.row.permList" |
| | | :key="index" |
| | | size="mini" |
| | | effect="dark" |
| | | style="margin: 2px; letter-spacing: 0.5px" |
| | | >{{ item }}</el-tag |
| | | > |
| | | </template> |
| | | <!-- 权限 --> |
| | | <template #column-perms="{ scope }"> |
| | | <el-tag v-for="(item, index) in scope.row.permList" |
| | | :key="index" |
| | | size="mini" |
| | | effect="dark" |
| | | style="margin: 2px; letter-spacing: 0.5px">{{ item }}</el-tag> |
| | | </template> |
| | | |
| | | <!-- 路由 --> |
| | | <template #column-router="{ scope }"> |
| | | <el-link v-if="scope.row.type == 1" type="primary" :href="scope.row.router">{{ |
| | | <!-- 路由 --> |
| | | <template #column-router="{ scope }"> |
| | | <el-link v-if="scope.row.type == 1" |
| | | type="primary" |
| | | :href="scope.row.router">{{ |
| | | scope.row.router |
| | | }}</el-link> |
| | | <span v-else>{{ scope.row.router }}</span> |
| | | </template> |
| | | <span v-else>{{ scope.row.router }}</span> |
| | | </template> |
| | | |
| | | <!-- 路由缓存 --> |
| | | <template #column-keepAlive="{ scope }"> |
| | | <template v-if="scope.row.type == 1"> |
| | | <i v-if="scope.row.keepAlive" class="el-icon-check"></i> |
| | | <i v-else class="el-icon-close"></i> |
| | | </template> |
| | | </template> |
| | | <!-- 路由缓存 --> |
| | | <template #column-keepAlive="{ scope }"> |
| | | <template v-if="scope.row.type == 1"> |
| | | <i v-if="scope.row.keepAlive" |
| | | class="el-icon-check"></i> |
| | | <i v-else |
| | | class="el-icon-close"></i> |
| | | </template> |
| | | </template> |
| | | |
| | | <!-- 行新增 --> |
| | | <template #slot-add="{ scope }"> |
| | | <el-button |
| | | v-if="scope.row.type != 2" |
| | | type="text" |
| | | size="mini" |
| | | @click="upsertAppend(scope.row)" |
| | | >新增</el-button |
| | | > |
| | | </template> |
| | | </cl-table> |
| | | </el-row> |
| | | <!-- 行新增 --> |
| | | <template #slot-add="{ scope }"> |
| | | <el-button v-if="scope.row.type != 2" |
| | | type="text" |
| | | size="mini" |
| | | @click="upsertAppend(scope.row)">新增</el-button> |
| | | </template> |
| | | </cl-table> |
| | | </el-row> |
| | | |
| | | <el-row type="flex"> |
| | | <cl-flex1 /> |
| | | <cl-pagination :props="{ layout: 'total' }" /> |
| | | </el-row> |
| | | <el-row type="flex"> |
| | | <cl-flex1 /> |
| | | <cl-pagination :props="{ layout: 'total' }" /> |
| | | </el-row> |
| | | |
| | | <!-- 编辑 --> |
| | | <cl-upsert v-bind="upsert" /> |
| | | </cl-crud> |
| | | <!-- 编辑 --> |
| | | <cl-upsert v-bind="upsert" /> |
| | | </cl-crud> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | |
| | | // 刷新 |
| | | function refresh() { |
| | | console.log("刷新方法内打印"); |
| | | refs.value.crud.refresh(); |
| | | } |
| | | |
copy from src/cool/modules/cycleTask/service/index.ts
copy to src/cool/modules/basedevice/service/index.ts
| File was renamed from src/cool/modules/deviceGroup/views/deviceGroup.vue |
| | |
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | //是否为必填项,注:接口配置字段时没有设置默认值时,都需要选择必填
|
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "配置人名称",
|
| | | label: "操作人",
|
| | | prop: "configurator",
|
| | | component: {
|
| | | name: "el-input"
|
| | |
| | | align: "center"
|
| | | },
|
| | | {
|
| | | label: "序号",
|
| | | label: "id",
|
| | | prop: "id",
|
| | | sortable: true //是否排序功能
|
| | | },
|
| | |
| | | prop: "logic_id"
|
| | | },
|
| | | {
|
| | | label: "配置人名称",
|
| | | label: "操作人",
|
| | | prop: "configurator"
|
| | | },
|
| | | {
|
| | |
| | | // crud 加载
|
| | | function onLoad({ ctx, app }: CrudLoad) {
|
| | | // 绑定 service
|
| | | ctx.service(service.deviceGroup.deviceGroup).done();
|
| | | ctx.service(service.business.devicegroup).done();
|
| | | app.refresh();
|
| | | }
|
| | |
|
copy from src/cool/modules/device/views/device.vue
copy to src/cool/modules/basedevice/views/basedevice_info.vue
| File was copied from src/cool/modules/device/views/device.vue |
| | |
| | | const upsert = reactive<Upsert>({
|
| | | items: [
|
| | | {
|
| | | label: "名称",
|
| | | prop: "name",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | //是否为必填项,注:接口配置字段时没有设置默认值时,都需要选择必填
|
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "逻辑ID",
|
| | | prop: "logic_id",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | required: true
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "物理ID",
|
| | | prop: "device_id",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | required: true
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "负责人",
|
| | | prop: "operator",
|
| | | label: "设备名称",
|
| | | prop: "name",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | required: true
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "安装位置",
|
| | | prop: "location",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "经度",
|
| | |
| | | }
|
| | | },
|
| | | {
|
| | | label: "安装位置",
|
| | | prop: "location",
|
| | | label: "设备精度",
|
| | | prop: "dimension",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | label: "航向角",
|
| | | prop: "precision",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "旋转角",
|
| | | prop: "heading_angle",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "俯仰角",
|
| | | prop: "petch_angle",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "横滚角",
|
| | | prop: "roll_angle",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "IP地址",
|
| | | prop: "ipaddres",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "端口",
|
| | | prop: "device_port",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "账号",
|
| | | prop: "device_account",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "负责人",
|
| | | prop: "opertator",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | |
| | | {
|
| | | label: "备注",
|
| | | prop: "remark",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | |
| | | sortable: true //是否排序功能
|
| | | },
|
| | | {
|
| | | label: "运行状态",
|
| | | prop: "status",
|
| | | filters: [
|
| | | { text: 0, value: 0 },
|
| | | { text: 1, value: 1 }
|
| | | ]
|
| | | // filters:"[{ text: '家', value: '家' }, { text: '公司', value: '公司' }]"
|
| | | },
|
| | | {
|
| | | label: "名称",
|
| | | prop: "name"
|
| | | },
|
| | | {
|
| | | label: "位置",
|
| | | prop: "location",
|
| | | width: 200
|
| | | },
|
| | | {
|
| | | label: "逻辑ID",
|
| | | prop: "logic_id"
|
| | | },
|
| | | {
|
| | | label: "物理ID",
|
| | | prop: "device_id",
|
| | | width: 100
|
| | | prop: "device_id"
|
| | | },
|
| | | {
|
| | | label: "设备名称",
|
| | | prop: "name"
|
| | | },
|
| | | {
|
| | | label: "安装位置",
|
| | | prop: "location"
|
| | | },
|
| | | {
|
| | | label: "经度",
|
| | | prop: "longitude",
|
| | | width: 150
|
| | | prop: "longitude"
|
| | | },
|
| | | {
|
| | | label: "纬度",
|
| | | prop: "latitude",
|
| | | width: 150
|
| | | prop: "latitude"
|
| | | },
|
| | | {
|
| | | label: "高度",
|
| | | prop: "altitude"
|
| | | },
|
| | | {
|
| | | label: "设备精度",
|
| | | prop: "dimension"
|
| | | },
|
| | | {
|
| | | label: "航向角",
|
| | | prop: "precision"
|
| | | },
|
| | | {
|
| | | label: "旋转角",
|
| | | prop: "heading_angle"
|
| | | },
|
| | | {
|
| | | label: "俯仰角",
|
| | | prop: "petch_angle"
|
| | | },
|
| | | {
|
| | | label: "横滚角",
|
| | | prop: "roll_angle"
|
| | | },
|
| | | {
|
| | | label: "IP地址",
|
| | | prop: "ipaddres"
|
| | | },
|
| | | {
|
| | | label: "端口",
|
| | | prop: "device_port"
|
| | | },
|
| | | {
|
| | | label: "账号",
|
| | | prop: "device_account"
|
| | | },
|
| | | {
|
| | | label: "负责人",
|
| | | prop: "opertator"
|
| | | },
|
| | | {
|
| | | label: "备注",
|
| | | prop: "remark"
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status"
|
| | | },
|
| | | {
|
| | | label: "操作",
|
| | |
| | | // crud 加载
|
| | | function onLoad({ ctx, app }: CrudLoad) {
|
| | | // 绑定 service
|
| | | ctx.service(service.device.device).done();
|
| | | ctx.service(service.business.basedeviceinfo).done();
|
| | | app.refresh();
|
| | | }
|
| | |
|
copy from src/cool/modules/deviceGroup/views/deviceGroup.vue
copy to src/cool/modules/doulunji/views/doulunji_info.vue
| File was copied from src/cool/modules/deviceGroup/views/deviceGroup.vue |
| | |
| | | const upsert = reactive<Upsert>({
|
| | | items: [
|
| | | {
|
| | | label: "逻辑ID",
|
| | | prop: "logic_id",
|
| | | label: "名称",
|
| | | prop: "trubine_name",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | //是否为必填项,注:接口配置字段时没有设置默认值时,都需要选择必填
|
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "配置人名称",
|
| | | prop: "configurator",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "备注",
|
| | | prop: "remark",
|
| | | label: "编号",
|
| | | prop: "trubine_no",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | label: "尺寸",
|
| | | prop: "trubine_size",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "备注",
|
| | | prop: "remark",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | |
| | | align: "center"
|
| | | },
|
| | | {
|
| | | label: "序号",
|
| | | label: "id",
|
| | | prop: "id",
|
| | | sortable: true //是否排序功能
|
| | | },
|
| | | {
|
| | | label: "逻辑ID",
|
| | | prop: "logic_id"
|
| | | label: "名称",
|
| | | prop: "trubine_name"
|
| | | },
|
| | | {
|
| | | label: "配置人名称",
|
| | | prop: "configurator"
|
| | | label: "编号",
|
| | | prop: "trubine_no",
|
| | | width: 200
|
| | | },
|
| | | {
|
| | | label: "尺寸型号",
|
| | | prop: "trubine_size"
|
| | | },
|
| | | {
|
| | | label: "备注",
|
| | | prop: "remark"
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status"
|
| | | },
|
| | | {
|
| | | label: "操作",
|
| | |
| | | // crud 加载
|
| | | function onLoad({ ctx, app }: CrudLoad) {
|
| | | // 绑定 service
|
| | | ctx.service(service.deviceGroup.deviceGroup).done();
|
| | | ctx.service(service.business.doutrubine).done();
|
| | | app.refresh();
|
| | | }
|
| | |
|
| File was renamed from src/cool/modules/device/views/device.vue |
| | |
| | | const upsert = reactive<Upsert>({
|
| | | items: [
|
| | | {
|
| | | label: "名称",
|
| | | prop: "name",
|
| | | label: "逻辑ID",
|
| | | prop: "logic_ids",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | |
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "逻辑ID",
|
| | | prop: "logic_id",
|
| | | label: "任务指令",
|
| | | prop: "task_command",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | required: true
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "物理ID",
|
| | | prop: "device_id",
|
| | | label: "任务内容描述",
|
| | | prop: "task_content",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | required: true
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "负责人",
|
| | | label: "任务参数",
|
| | | prop: "task_params",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "任务类型",
|
| | | prop: "task_type",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "操作人",
|
| | | prop: "operator",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "经度",
|
| | | prop: "longitude",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "纬度",
|
| | | prop: "latitude",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "高度",
|
| | | prop: "altitude",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "安装位置",
|
| | | prop: "location",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | label: "设置时间",
|
| | | prop: "operate_time",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | |
| | | {
|
| | | label: "备注",
|
| | | prop: "remark",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | |
| | | sortable: true //是否排序功能
|
| | | },
|
| | | {
|
| | | label: "运行状态",
|
| | | prop: "status",
|
| | | filters: [
|
| | | { text: 0, value: 0 },
|
| | | { text: 1, value: 1 }
|
| | | ]
|
| | | // filters:"[{ text: '家', value: '家' }, { text: '公司', value: '公司' }]"
|
| | | },
|
| | | {
|
| | | label: "名称",
|
| | | prop: "name"
|
| | | },
|
| | | {
|
| | | label: "位置",
|
| | | prop: "location",
|
| | | width: 200
|
| | | },
|
| | | {
|
| | | label: "逻辑ID",
|
| | | prop: "logic_id"
|
| | | prop: "logic_ids"
|
| | | },
|
| | | {
|
| | | label: "物理ID",
|
| | | prop: "device_id",
|
| | | width: 100
|
| | | label: "任务指令",
|
| | | prop: "task_command"
|
| | | },
|
| | | {
|
| | | label: "经度",
|
| | | prop: "longitude",
|
| | | width: 150
|
| | | label: "任务内容描述",
|
| | | prop: "task_content"
|
| | | },
|
| | | {
|
| | | label: "纬度",
|
| | | prop: "latitude",
|
| | | width: 150
|
| | | label: "任务参数",
|
| | | prop: "task_params"
|
| | | },
|
| | | {
|
| | | label: "高度",
|
| | | prop: "altitude"
|
| | | label: "任务类型",
|
| | | prop: "task_type"
|
| | | },
|
| | | {
|
| | | label: "操作人",
|
| | | prop: "operator"
|
| | | },
|
| | | {
|
| | | label: "设置时间",
|
| | | prop: "operate_time"
|
| | | },
|
| | | {
|
| | | label: "备注",
|
| | | prop: "remark"
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status"
|
| | | },
|
| | | {
|
| | | label: "操作",
|
| | |
| | | // crud 加载
|
| | | function onLoad({ ctx, app }: CrudLoad) {
|
| | | // 绑定 service
|
| | | ctx.service(service.device.device).done();
|
| | | ctx.service(service.business.taskimmediately).done();
|
| | | app.refresh();
|
| | | }
|
| | |
|
copy from src/cool/modules/deviceGroup/views/deviceGroup.vue
copy to src/cool/modules/hntask/views/periodic_task.vue
| File was copied from src/cool/modules/deviceGroup/views/deviceGroup.vue |
| | |
| | | const upsert = reactive<Upsert>({
|
| | | items: [
|
| | | {
|
| | | label: "逻辑ID",
|
| | | prop: "logic_id",
|
| | | label: "周期任务",
|
| | | prop: "crontab_rule",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | //是否为必填项,注:接口配置字段时没有设置默认值时,都需要选择必填
|
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "设备分组ID",
|
| | | prop: "group_id",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "配置人名称",
|
| | | prop: "configurator",
|
| | | label: "设置人",
|
| | | prop: "operator",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | |
| | | align: "center"
|
| | | },
|
| | | {
|
| | | label: "序号",
|
| | | label: "id",
|
| | | prop: "id",
|
| | | sortable: true //是否排序功能
|
| | | },
|
| | | {
|
| | | label: "逻辑ID",
|
| | | prop: "logic_id"
|
| | | label: "周期任务",
|
| | | prop: "crontab_rule"
|
| | | },
|
| | | {
|
| | | label: "配置人名称",
|
| | | prop: "configurator"
|
| | | label: "设备分组ID",
|
| | | prop: "group_id"
|
| | | },
|
| | | {
|
| | | label: "设置人",
|
| | | prop: "operator"
|
| | | },
|
| | | {
|
| | | label: "备注",
|
| | |
| | | // crud 加载
|
| | | function onLoad({ ctx, app }: CrudLoad) {
|
| | | // 绑定 service
|
| | | ctx.service(service.deviceGroup.deviceGroup).done();
|
| | | ctx.service(service.business.periodicsetting).done();
|
| | | app.refresh();
|
| | | }
|
| | |
|
| | |
| | | } |
| | | } |
| | | }, |
| | | "huaneng", |
| | | "device", |
| | | "deviceGroup", |
| | | "taskSetting" |
| | | "doulunji",//斗轮机 |
| | | "hntask",//任务 |
| | | "basedevice",//采集设备 |
| | | "metadata",//元数据 |
| | | 'alarm',//告警 |
| | | ]; |
copy from src/cool/modules/device/components/index.ts
copy to src/cool/modules/metadata/components/index.ts
copy from src/cool/modules/device/directives/index.ts
copy to src/cool/modules/metadata/directives/index.ts
copy from src/cool/modules/device/index.ts
copy to src/cool/modules/metadata/index.ts
copy from src/cool/modules/cycleTask/pages/index.ts
copy to src/cool/modules/metadata/pages/index.ts
copy from src/cool/modules/douMsg/service/index.ts
copy to src/cool/modules/metadata/service/index.ts
copy from src/cool/modules/cycleTask/store/index.ts
copy to src/cool/modules/metadata/store/index.ts
copy from src/cool/modules/cycleTask/views/index.ts
copy to src/cool/modules/metadata/views/index.ts
| New file |
| | |
| | | <template>
|
| | | <cl-crud :ref="setRefs('crud')"
|
| | | @load="onLoad">
|
| | | <el-row type="flex"
|
| | | align="middle">
|
| | | <!-- 刷新按钮 -->
|
| | | <cl-refresh-btn />
|
| | | <!-- 新增按钮 -->
|
| | | <cl-add-btn />
|
| | | <!-- 删除按钮 -->
|
| | | <cl-multi-delete-btn />
|
| | | <cl-flex1 />
|
| | | <!-- 关键字搜索 -->
|
| | | <cl-search-key />
|
| | | </el-row>
|
| | |
|
| | | <el-row>
|
| | | <!-- 数据表格 -->
|
| | | <cl-table :ref="setRefs('table')"
|
| | | v-bind="table" />
|
| | | </el-row>
|
| | |
|
| | | <el-row type="flex">
|
| | | <cl-flex1 />
|
| | | <!-- 分页控件 -->
|
| | | <cl-pagination />
|
| | | </el-row>
|
| | |
|
| | | <!-- 新增、编辑 -->
|
| | | <cl-upsert :ref="setRefs('upsert')"
|
| | | v-bind="upsert" />
|
| | | </cl-crud>
|
| | | </template>
|
| | |
|
| | | <script lang="ts">
|
| | | import { defineComponent, reactive } from "vue";
|
| | | import { CrudLoad, Upsert, Table } from "@cool-vue/crud/types";
|
| | | import { useCool } from "/@/cool";
|
| | |
|
| | | export default defineComponent({
|
| | | setup() {
|
| | | const { refs, setRefs, service } = useCool();
|
| | |
|
| | | // 新增、编辑配置
|
| | | const upsert = reactive<Upsert>({
|
| | | items: [
|
| | | {
|
| | | prop: "is_periodic",
|
| | | value: 1,
|
| | | label: "任务类型",
|
| | | span: 24,
|
| | | component: {
|
| | | name: "el-radio-group",
|
| | | options: [
|
| | | {
|
| | | label: "即时任务",
|
| | | value: 0
|
| | | },
|
| | | {
|
| | | label: "周期任务",
|
| | | value: 1
|
| | | }
|
| | | ]
|
| | | }
|
| | | },
|
| | | {
|
| | | label: "数据内容",
|
| | | prop: "data_content",
|
| | | component: {
|
| | | name: "el-input"
|
| | | },
|
| | | //是否为必填项,注:接口配置字段时没有设置默认值时,都需要选择必填
|
| | | required: true
|
| | | },
|
| | | {
|
| | | label: "备注",
|
| | | prop: "remark",
|
| | | component: {
|
| | | name: "el-input"
|
| | | }
|
| | | },
|
| | | {
|
| | | prop: "status",
|
| | | label: "状态",
|
| | | value: 1,
|
| | | component: {
|
| | | name: "el-radio-group",
|
| | | options: [
|
| | | {
|
| | | label: "启用",
|
| | | value: 1
|
| | | },
|
| | | {
|
| | | label: "关闭",
|
| | | value: 0
|
| | | }
|
| | | ]
|
| | | }
|
| | | }
|
| | | ]
|
| | | });
|
| | |
|
| | | // 表格配置
|
| | | const table = reactive<Table>({
|
| | | columns: [
|
| | | {
|
| | | type: "selection",
|
| | | align: "center"
|
| | | },
|
| | | {
|
| | | label: "id",
|
| | | prop: "id",
|
| | | sortable: true //是否排序功能
|
| | | },
|
| | | {
|
| | | label: "任务ID",
|
| | | prop: "task_id"
|
| | | },
|
| | | {
|
| | | label: "任务类型",
|
| | | prop: "is_periodic",
|
| | | dict: [
|
| | | {
|
| | | label: "周期任务",
|
| | | value: 1,
|
| | | type: "info" //success warning danger info可选
|
| | | },
|
| | | {
|
| | | label: "即时任务",
|
| | | value: 0
|
| | | }
|
| | | ],
|
| | | filters: [
|
| | | {
|
| | | text: "周期任务",
|
| | | value: 1
|
| | | },
|
| | | {
|
| | | text: "即时任务",
|
| | | value: 0
|
| | | }
|
| | | ],
|
| | | width: 100
|
| | | },
|
| | | {
|
| | | label: "监测记录ID",
|
| | | prop: "task_monitor_id",
|
| | | width: 200
|
| | | },
|
| | | {
|
| | | label: "数据内容",
|
| | | prop: "data_content"
|
| | | },
|
| | | {
|
| | | label: "数据存储路径",
|
| | | prop: "data_path",
|
| | | width: 150
|
| | | },
|
| | | {
|
| | | label: "备注",
|
| | | prop: "remark"
|
| | | },
|
| | | {
|
| | | prop: "status",
|
| | | label: "状态",
|
| | | minWidth: 120,
|
| | | dict: [
|
| | | {
|
| | | label: "启用",
|
| | | value: 1,
|
| | | type: "success"
|
| | | },
|
| | | {
|
| | | label: "禁用",
|
| | | value: 0,
|
| | | type: "danger"
|
| | | }
|
| | | ]
|
| | | },
|
| | | {
|
| | | label: "操作",
|
| | | type: "op"
|
| | | }
|
| | | ]
|
| | | });
|
| | |
|
| | | // crud 加载
|
| | | function onLoad({ ctx, app }: CrudLoad) {
|
| | | // 绑定 service
|
| | | console.log(ctx);
|
| | | ctx.service(service.business.colletdata).done();
|
| | |
|
| | | app.refresh();
|
| | | }
|
| | | function filterHandler(value: any, row: any, column: any) {
|
| | | const property = column["property"];
|
| | | return row[property] === value;
|
| | | }
|
| | |
|
| | | return {
|
| | | refs,
|
| | | setRefs,
|
| | | upsert,
|
| | | table,
|
| | | onLoad
|
| | | };
|
| | | }
|
| | | });
|
| | | </script>
|
| | |
| | | <template>
|
| | | <div>
|
| | | 用户管理页面
|
| | | </div>
|
| | | </template> |
| | | <cl-crud :ref="setRefs('crud')"
|
| | | @load="onLoad">
|
| | | <el-row type="flex"
|
| | | align="middle">
|
| | | <!-- 刷新按钮 -->
|
| | | <cl-refresh-btn />
|
| | | <!-- 新增按钮 -->
|
| | | <cl-add-btn />
|
| | | <!-- 删除按钮 -->
|
| | | <cl-multi-delete-btn />
|
| | | <cl-flex1 />
|
| | | <!-- 关键字搜索 -->
|
| | | <cl-search-key />
|
| | | </el-row>
|
| | |
|
| | | <el-row>
|
| | | <!-- 数据表格 -->
|
| | | <cl-table :ref="setRefs('table')"
|
| | | v-bind="table" />
|
| | | </el-row>
|
| | |
|
| | | <el-row type="flex">
|
| | | <cl-flex1 />
|
| | | <!-- 分页控件 -->
|
| | | <cl-pagination />
|
| | | </el-row>
|
| | |
|
| | | <!-- 新增、编辑 -->
|
| | | <cl-upsert :ref="setRefs('upsert')"
|
| | | v-bind="upsert" />
|
| | | </cl-crud>
|
| | | </template>
|
| | |
|
| | | <script lang="ts">
|
| | | import { defineComponent, reactive } from "vue";
|
| | | import { CrudLoad, Upsert, Table } from "@cool-vue/crud/types";
|
| | | import { useCool } from "/@/cool";
|
| | |
|
| | | export default defineComponent({
|
| | | setup() {
|
| | | const { refs, setRefs, service } = useCool();
|
| | |
|
| | | // 新增、编辑配置
|
| | | const upsert = reactive<Upsert>({
|
| | | items: []
|
| | | });
|
| | |
|
| | | // 表格配置
|
| | | const table = reactive<Table>({
|
| | | columns: []
|
| | | });
|
| | |
|
| | | // crud 加载
|
| | | function onLoad({ ctx, app }: CrudLoad) {
|
| | | // 绑定 service
|
| | | ctx.service(service.business.basedeviceinfo).done();
|
| | | app.refresh();
|
| | | }
|
| | |
|
| | | return {
|
| | | refs,
|
| | | setRefs,
|
| | | upsert,
|
| | | table,
|
| | | onLoad
|
| | | };
|
| | | }
|
| | | });
|
| | | </script>
|
| | |
| | | import { |
| | | createRouter, |
| | | createWebHashHistory, |
| | | createWebHistory, |
| | | Router, |
| | | RouteRecordRaw |
| | | createRouter, |
| | | createWebHashHistory, |
| | | createWebHistory, |
| | | Router, |
| | | RouteRecordRaw |
| | | } from "vue-router"; |
| | | import { routerMode } from "/@/config/env"; |
| | | |
| | | declare interface CoolRouter extends Router { |
| | | $plugin?: { |
| | | addViews(list: any[], options?: any): void; |
| | | }; |
| | | $plugin?: { |
| | | addViews(list: any[], options?: any): void; |
| | | }; |
| | | } |
| | | |
| | | const routes: Array<RouteRecordRaw> = [ |
| | | { |
| | | path: "/", |
| | | name: "index", |
| | | component: () => import(`/@/pages/layout/index.vue`), |
| | | children: [ |
| | | { |
| | | path: "/", |
| | | name: "数据统计", |
| | | component: () => import("/@/views/home/index.vue") |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: "/:catchAll(.*)", |
| | | name: "404", |
| | | redirect: "/404" |
| | | } |
| | | { |
| | | path: "/", |
| | | name: "index", |
| | | component: () => import(`/@/pages/layout/index.vue`), |
| | | children: [ |
| | | { |
| | | path: "/", |
| | | name: "数据统计", |
| | | component: () => import("/@/views/home/index.vue") |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | { |
| | | path: "/:catchAll(.*)", |
| | | name: "404", |
| | | redirect: "/404" |
| | | } |
| | | ]; |
| | | |
| | | const router = createRouter({ |
| | | history: routerMode == "history" ? createWebHistory() : createWebHashHistory(), |
| | | routes |
| | | history: routerMode == "history" ? createWebHistory() : createWebHashHistory(), |
| | | routes |
| | | }) as CoolRouter; |
| | | |
| | | export default router; |
| | | |
| | | export const ignore: any = { |
| | | token: ["/login", "/403", "/404", "/500", "/502"] |
| | | token: ["/login", "/403", "/404", "/500", "/502"] |
| | | }; |