| | |
| | | <template> |
| | | <basic-container> |
| | | <div v-if="!isFunction" class="avue-crud"> |
| | | <div v-if="!isFunction && !isView" class="avue-crud"> |
| | | <!--按钮--> |
| | | <el-row> |
| | | <div class="avue-crud__menu"> |
| | |
| | | <div style="padding: 14px;"> |
| | | <span>{{ o.name }}</span> |
| | | <div class="bottom clearfix"> |
| | | <el-button type="text" class="button">预览</el-button> |
| | | <el-button type="text" class="button" @click="handleView(o)">预览</el-button> |
| | | <el-button type="text" class="button" @click="handleDelete(o.id)">删除</el-button> |
| | | <el-button type="text" class="button" @click="handleEdit(o)">编辑</el-button> |
| | | </div> |
| | |
| | | </div> |
| | | <!-- 功能详情--> |
| | | <Function ref="func" v-if="isFunction" :modules="modules" @backModules="backModules"></Function> |
| | | |
| | | <!--功能预览--> |
| | | <ModulesView v-if="isView" ref="modulesView" :modules="modules" @backModules="backModules"></ModulesView> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | import {getList, getDetail, add, update, remove} from "@/api/modules/modules"; |
| | | import {mapGetters} from "vuex"; |
| | | import Function from "@/views/modules/function"; |
| | | import ModulesView from "@/views/modules/modulesView"; |
| | | |
| | | export default { |
| | | components: {Function}, |
| | | components: {ModulesView, Function}, |
| | | data() { |
| | | return { |
| | | // 弹框标题 |
| | |
| | | }], |
| | | }, |
| | | { |
| | | label: "设备编码", |
| | | prop: "equipmentId", |
| | | span:24, |
| | | type: "select", |
| | | dicUrl: `/api/equipment/equipment/all?type=1`, |
| | | props: { |
| | | label: "code", |
| | | value: "id" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择设备', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "宽", |
| | | prop: "width", |
| | | type: "input", |
| | |
| | | // 表单列表 |
| | | data: [], |
| | | isFunction: false, |
| | | isView:false, |
| | | modules: "", |
| | | } |
| | | }, |
| | |
| | | this.fileList = this.form.background |
| | | }); |
| | | }, |
| | | handleView(row) { |
| | | this.title = '查看' |
| | | this.view = true; |
| | | this.box = true; |
| | | getDetail(row.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | }, |
| | | |
| | | handleDelete(id) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | }, |
| | | //返回模块页 |
| | | backModules() { |
| | | this.isFunction = !this.isFunction |
| | | } |
| | | this.isFunction = false |
| | | this.isView = false |
| | | }, |
| | | handleView(data) { |
| | | this.modules = data |
| | | this.isView = !this.isView |
| | | }, |
| | | } |
| | | }; |
| | | </script> |