| | |
| | | :data="data" |
| | | :option="option" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | @on-load="getList" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @refresh-change="refreshChange" |
| | | @search-reset="searchChange" |
| | | @search-change="searchChange"> |
| | | @search-change="searchChange" |
| | | @row-click="rowClick"> |
| | | <template slot="menuLeft"> |
| | | <el-tooltip class="item" effect="dark" content="查找版本规则使用范围" placement="top"> |
| | | <el-button size="small" |
| | | plain |
| | | type="primary" |
| | | <el-tooltip class="item" content="查找版本规则使用范围" effect="dark" placement="top"> |
| | | <el-button v-if="permissionList.apply" |
| | | icon="el-icon-zoom-in" |
| | | @click="handleSearch">查看使用范围 |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="applyRangeSearch">查看使用范围 |
| | | </el-button> |
| | | </el-tooltip> |
| | | </template>> |
| | | </template> |
| | | <template slot="radio" |
| | | slot-scope="{row}"> |
| | | <el-radio v-model="selectRow" |
| | | :label="row.$index"> |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="查看使用范围" |
| | | append-to-body |
| | | :visible.sync="packageSearchBox" |
| | | width="1200px"> |
| | | <versionpackage></versionpackage> |
| | | </el-dialog> |
| | | <versionpackage ref="applyRange" :rangeData="applyRangeData"></versionpackage> |
| | | </basic-container> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getPage,add,update,remove } from '../../api/omd/revisionRule'; |
| | | import {getPage, add, update, remove, getAppayRange} from '../../api/omd/revisionRule'; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "Version", |
| | | data(){ |
| | | data() { |
| | | return { |
| | | //查看使用范围 |
| | | packageSearchBox:false, |
| | | packageSearchBox: false, |
| | | // 点击数据 |
| | | selectRow: '', |
| | | selectRowData: {}, |
| | | //分页数据 |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 100 |
| | | }, |
| | | data:[ |
| | | ], |
| | | form:{}, |
| | | option:{ |
| | | headerAlign:'center', |
| | | data: [], |
| | | form: {}, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 20, |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | border: true, |
| | | index: true, |
| | | searchMenuSpan:5, |
| | | column:[ |
| | | searchMenuSpan: 5, |
| | | highlightCurrentRow: true, |
| | | stripe: true, |
| | | viewBtn: false, |
| | | columnBtn: false, |
| | | column: [ |
| | | { |
| | | label:'英文名称', |
| | | prop: 'id' |
| | | label: '选择', |
| | | prop: 'radio', |
| | | width: 120, |
| | | display: false |
| | | }, |
| | | { |
| | | label:"中文名称", |
| | | prop:"name", |
| | | search:true, |
| | | label: '英文名称', |
| | | prop: 'id', |
| | | editDisabled: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '英文名称不能为空', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label:"跳跃字符", |
| | | prop: "skipCode" |
| | | label: "中文名称", |
| | | prop: "name", |
| | | search: true, |
| | | required: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '中文名称不能为空', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | // { |
| | | // label:"跳跃字符", |
| | | // prop: "skipCode" |
| | | // }, |
| | | { |
| | | label: "初始值", |
| | | prop:"startCode" |
| | | prop: "startCode", |
| | | type: 'number', |
| | | min: 1, |
| | | max: 99999, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '初始值不能为空', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "步长", |
| | | prop: "serialStep" |
| | | prop: "serialStep", |
| | | type: 'number', |
| | | min: 1, |
| | | max: 99999, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '步长不能为空', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "前缀", |
| | | prop:"prefixCode" |
| | | }, |
| | | { |
| | | label: "后缀", |
| | | prop: "suffixCode" |
| | | }, |
| | | // { |
| | | // label: "前缀", |
| | | // prop:"prefixCode" |
| | | // }, |
| | | // { |
| | | // label: "后缀", |
| | | // prop: "suffixCode" |
| | | // }, |
| | | { |
| | | label: "描述", |
| | | prop:"description", |
| | | type:"textarea" |
| | | prop: "description", |
| | | type: "textarea" |
| | | } |
| | | ] |
| | | }, |
| | | applyRangeData: [] |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.modeling_Version.version_add, false), |
| | | apply: this.vaildData(this.permission.modeling_Version.version_applyopen, false), |
| | | delBtn: this.vaildData(this.permission.modeling_Version.version_delete, false), |
| | | editBtn: this.vaildData(this.permission.modeling_Version.version_edit, false), |
| | | } |
| | | } |
| | | }, |
| | | methods:{ |
| | | handleSearch(){ |
| | | this.packageSearchBox=true |
| | | methods: { |
| | | // 行点击 |
| | | rowClick(row) { |
| | | this.selectRow = row.$index; |
| | | this.selectRowData = row; |
| | | }, |
| | | // 查看应用范围 |
| | | applyRangeSearch() { |
| | | if (this.selectRow === '') { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择属性" |
| | | }) |
| | | return |
| | | } |
| | | getAppayRange(this.selectRowData.id).then(res => { |
| | | this.applyRangeData = res.data.data; |
| | | this.$refs.applyRange.rangeData = this.applyRangeData; |
| | | this.$refs.applyRange.showDialog = true; |
| | | }) |
| | | |
| | | |
| | | // this.packageSearchBox=true |
| | | }, |
| | | getList() { |
| | | this.loading = true; |
| | | getPage(this.page.currentPage,this.page.pageSize,this.params).then(res => { |
| | | getPage(this.page.currentPage, this.page.pageSize, this.params).then(res => { |
| | | const data = res.data.data |
| | | this.loading = false; |
| | | this.page.total = data.total; |
| | |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.$message.success('修改成功') |
| | | done() |
| | | this.getList(); |
| | | }).catch(() => { |
| | | loading() |
| | | }) |
| | | console.log(row); |
| | | const date = new Date(row.ts); |
| | | const formattedDate = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}.${date.getMilliseconds().toString().padStart(3, '0')}`; |
| | | row.ts = formattedDate; |
| | | update(row) |
| | | .then(() => { |
| | | this.$message.success('修改成功'); |
| | | done(); |
| | | this.getList(); |
| | | }) |
| | | .catch(() => { |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | console.log(row); |
| | | return remove({oid : row.oid}) |
| | | return remove({oid: row.oid}) |
| | | }).then(() => { |
| | | this.$message.success('删除成功') |
| | | this.getList(); |
| | | }) |
| | | }, |
| | | searchChange(params, done) { |
| | | if (done) done(); |
| | | this.params = params; |
| | | this.page.currentPage = 1; |
| | | this.getList(); |
| | | this.$message.success('搜索成功') |
| | | var p = {"name_like": params.name} |
| | | getPage(this.page.currentPage, this.page.pageSize, p).then(res => { |
| | | const data = res.data.data |
| | | this.loading = false; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | }); |
| | | if (done) { |
| | | done(); |
| | | } |
| | | }, |
| | | refreshChange() { |
| | | this.getList(); |