123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <template>
- <div>
- <el-button size="mini" icon="el-icon-plus" type="primary" @click="onShow">新 增</el-button>
- <el-dialog
- title="新增模块"
- :visible.sync="dialogVisible"
- width="950px"
- append-to-body
- >
- <el-table
- class="table-style"
- :data="list"
- style="width: 100%" border
- :height="height ? height : list.length <= 4?'260px':list.length <= 20?'calc(100vh - 420px)':'calc(100vh - 420px)'"
- :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}"
- :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
- @selection-change="selectChange">
- <el-table-column
- type="selection"
- width="39">
- </el-table-column>
- <el-table-column
- prop="systemclient"
- label="端口"
- >
- </el-table-column>
- <el-table-column
- prop="systemappid"
- label="id"
- >
- </el-table-column>
- <el-table-column
- prop="systemname"
- label="系统名称"
- >
- </el-table-column>
- <el-table-column
- prop="systemmodulename"
- label="模块名称"
- >
- </el-table-column>
- <el-table-column
- prop="systemappname"
- label="应用名称"
- >
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false" size="small">取 消</el-button>
- <el-button type="primary" @click="onSubmit" size="small">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- export default {
- name: "addVersionModules",
- props:['rowData'],
- data(){
- return {
- dialogVisible:false,
- list:[],
- param:{
- "classname": "webmanage.site.systempartition",
- "method": "list_model",
- "content": {
- "sys_site_systempartitionid": 0,
- "pageNumber": 1,
- "pageSize": 99,
- "where": {
- "condition": ""
- }
- },
- },
- height:'',
- selectData:[],
- rowDataSelect:[]
- }
- },
- methods: {
- onShow(){
- this.dialogVisible = true
- console.log(this.rowData,'rowData')
- this.listData()
- this.rowDataSelect = this.rowData.systemappids
- console.log(this.rowDataSelect,'rowDataSelect')
- },
- async listData(){
- this.param.content.sys_site_systempartitionid = this.rowData.sys_site_systempartitionid
- const res = await this.$api.requested(this.param)
- this.list = res.data
- },
- /*选择模块*/
- selectChange(val){
- val.forEach((item,index)=>{
- this.selectData[index] = item.systemappid
- })
- console.log(this.selectData)
- },
- async onSubmit(){
- this.selectData = [...this.selectData,...this.rowDataSelect]
- const res = await this.$api.requested({
- "classname": "webmanage.site.systempartition",
- "method": "insertOrUpdate",
- "content": {
- "sys_site_systempartitionid": this.rowData.sys_site_systempartitionid,
- "partitionname": this.rowData.partitionname,
- "systemappids": this.selectData
- },
- })
- this.tool.showMessage(res,()=>{
- this.dialogVisible = false
- this.rowDataSelect = []
- this.selectData = []
- this.$emit('addSuccess')
- })
- }
- }
- }
- </script>
- <style scoped>
- </style>
|