| | |
| | | <template> |
| | | <div class="mod-cryptos-variety"> |
| | | <avue-crud |
| | | ref="crud" |
| | | :page.sync="page" |
| | | :data="dataList" |
| | | :option="tableOption" |
| | | :cell-class-name="addCellClass" |
| | | @search-change="searchChange" |
| | | @selection-change="selectionChange" |
| | | @on-load="getDataList" |
| | | > |
| | | <avue-crud ref="crud" :page.sync="page" :data="dataList" :option="tableOption" :cell-class-name="addCellClass" |
| | | @search-change="searchChange" @selection-change="selectionChange" @on-load="getDataList"> |
| | | <template slot="menuLeft"> |
| | | <!-- <el-button |
| | | type="primary" |
| | |
| | | > --> |
| | | </template> |
| | | <template slot="ndhSearch"> |
| | | <avue-select |
| | | v-model="options.id" |
| | | placeholder="请选择语言" |
| | | :dic="options" |
| | | ></avue-select> |
| | | <avue-select v-model="options.id" placeholder="请选择语言" :dic="options"></avue-select> |
| | | </template> |
| | | <template slot-scope="scope" slot="shezhi"> |
| | | <span |
| | | class="seachButton" |
| | | v-if="isAuth('sys:user:delete')" |
| | | @click.stop="mixmarkHand(scope.row)" |
| | | >设置</span |
| | | > |
| | | <span class="seachButton" v-if="isAuth('sys:user:delete')" @click.stop="mixmarkHand(scope.row)">设置</span> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-edit" |
| | | size="small" |
| | | v-if="isAuth('sys:user:update')" |
| | | @click.stop="addOrUpdateHandle(arr, scope.row)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-edit" |
| | | size="small" |
| | | :loading="dataListLoading" |
| | | v-if="isAuth('sys:user:update')" |
| | | @click.stop="addkinHandle(scope.row.symbol)" |
| | | >初始化K线图</el-button |
| | | > |
| | | <el-button type="primary" icon="el-icon-edit" size="small" v-if="isAuth('sys:user:update')" |
| | | @click.stop="addOrUpdateHandle(arr, scope.row)">编辑</el-button> |
| | | <el-button type="primary" icon="el-icon-edit" size="small" :loading="dataListLoading" |
| | | v-if="isAuth('sys:user:update')" @click.stop="addkinHandle(scope.row.symbol)">初始化K线图</el-button> |
| | | |
| | | <el-button type="primary" icon="el-icon-edit" size="small" :loading="dataListLoading" |
| | | v-if="isAuth('sys:user:update')" @click.stop="setkinHandle(scope.row.symbol)">初始K线图历史</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update |
| | | v-if="addOrUpdateVisible" |
| | | ref="addOrUpdate" |
| | | @refreshDataList="getDataList" |
| | | ></add-or-update> |
| | | <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | } |
| | | }); |
| | | }, |
| | | //初始化k线 |
| | | addkinHandle(symbol) { |
| | | //初始化k线 |
| | | this.dataListLoading = true; |
| | | this.$confirm(`确定初始化K线?`, "提示", { |
| | | confirmButtonText: "确定", |
| | |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | .catch(() => { |
| | | this.dataListLoading = false; |
| | | }); |
| | | }, |
| | | //初始k线历史 |
| | | setkinHandle(symbol) { |
| | | this.dataListLoading = true; |
| | | this.$confirm(`确定初始K线历史?`, "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // |
| | | this.$http({ |
| | | url: this.$http.adornUrl( |
| | | "/normal/adminItemAction!/klineInitBySql" |
| | | ), |
| | | method: "get", |
| | | params: this.$http.adornParams( |
| | | Object.assign({ |
| | | symbol: symbol, |
| | | }), |
| | | false |
| | | ), |
| | | }).then(({ data }) => { |
| | | if (data.code == 0) { |
| | | this.dataListLoading = false; |
| | | this.$message({ |
| | | message: "操作成功", |
| | | type: "success", |
| | | duration: 1500, |
| | | onClose: () => { |
| | | // this.getDataList(this.page); |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | if (done) { |
| | | done(); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | this.dataListLoading = false; |
| | | }); |
| | | }, |
| | | // 条件查询 |
| | | searchChange(params, done) { |
| | |
| | | var ids = id |
| | | ? [id] |
| | | : this.dataListSelections.map((item) => { |
| | | return item.roleId; |
| | | }); |
| | | return item.roleId; |
| | | }); |
| | | this.$confirm(`确定进行[${id ? "删除" : "批量删除"}]操作?`, "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | message: data.msg, |
| | | type: "error", |
| | | duration: 1500, |
| | | onClose: () => {}, |
| | | onClose: () => { }, |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | .catch(() => { }); |
| | | }, |
| | | addCellClass({ row, column }) { |
| | | // console.log("row = " + JSON.stringify(row)) |
| | |
| | | cursor: pointer; |
| | | color: rgb(69, 147, 235); |
| | | } |
| | | |
| | | .seachButton:hover { |
| | | color: rgb(8, 63, 134); |
| | | } |