194 lines
6.6 KiB
HTML
194 lines
6.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
|
|
<title></title>
|
|
<script src="./lib/jquery/dist/jquery.js"></script>
|
|
<script src="./lib/vuejs/vue.js"></script>
|
|
<script src="./lib/vuejs/axios.min.js"></script>
|
|
<script src="./lib/elementui/index.js"></script>
|
|
<!--<script src="./lib/linq.js/Content/Scripts/linq.min.js"></script>-->
|
|
<script src="Scripts/linq.js"></script>
|
|
<link href="./lib/elementui/index.css" rel="stylesheet" />
|
|
|
|
</head>
|
|
<body>
|
|
<div id="app" >
|
|
<el-container>
|
|
<el-header>消费量替换操作集合</el-header>
|
|
<el-main v-loading="loading" v-loading.fullscreen.lock="false" :element-loading-text="showLoadingTip"
|
|
element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.1)">
|
|
|
|
<el-row>
|
|
<el-form :inline="true" class="demo-form-inline" label-width="100px" size="small" style=" box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); padding-top: 20px">
|
|
|
|
<el-form-item>
|
|
<el-input v-model="strSWMC.source" placeholder="请输入原食物名称"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-input v-model="strSWMC.dest" placeholder="请输入新食物名称"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" :loading="btnLoading[0]" round @click="changeSWMC">批量替换</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-row>
|
|
|
|
<el-row>
|
|
<el-input type="textarea"
|
|
:rows="10"
|
|
placeholder="替换操作状态提示"
|
|
v-model="textarea">
|
|
</el-input>
|
|
</el-row>
|
|
</el-main>
|
|
<el-footer>
|
|
|
|
</el-footer>
|
|
</el-container>
|
|
|
|
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|
|
<script>
|
|
///////////////////////////////////////////////////
|
|
//该部分是Vue应用封装
|
|
var app = new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
|
|
//提示内容显示
|
|
textarea: "",
|
|
//等待提示
|
|
loading: false,
|
|
btnLoading: [false, false, false, false, false, false, false, false, false, false, false, false],
|
|
//正在进行实时更新替换, 大约需要30秒钟至几分钟不等, 请等待...
|
|
showLoadingTip: '系统正在操作中,请耐心的等待...',
|
|
strSWMC: {source:'',dest:''}
|
|
|
|
|
|
}
|
|
},
|
|
mounted() {
|
|
var _this = this; //this指向vue
|
|
Vue.prototype.$loading = this.loading
|
|
//_this.loading = true;
|
|
},
|
|
methods: {
|
|
|
|
//显示进度内容
|
|
addNote(str) {
|
|
var aData = new Date().toLocaleString();;
|
|
this.textarea = aData + " " + str + '\r\n' + this.textarea;
|
|
},
|
|
//显示提示信息
|
|
showTip(strmessage) {
|
|
this.$message({
|
|
message: strmessage,
|
|
type: 'warning'
|
|
});
|
|
},
|
|
|
|
//单个替换的操作,dict格式为{"source":"","dest":"","type":""}
|
|
SingleChange(btnid, dict, apiname, desc) {
|
|
var _this = this; //this指向vue
|
|
_this.loading = true;
|
|
_this.btnLoading[btnid] = true;
|
|
_this.addNote("开始进行" + desc + "替换操作,请等待");
|
|
var curUrl = "./strReplace/" + apiname + "?source=" + dict.source + "&dest=" + dict.dest;
|
|
if (dict.type != "") {
|
|
curUrl = curUrl + "&type=" + dict.type
|
|
}
|
|
(async () => {
|
|
await axios({
|
|
url: curUrl
|
|
}).then((res) => {
|
|
console.log(res);
|
|
_this.addNote("此次" + desc + "替换操作完成," + res.data.data + "谢谢使用!");
|
|
_this.loading = false;
|
|
_this.btnLoading[btnid] = false;
|
|
});
|
|
})();
|
|
},
|
|
changeSWMC() {
|
|
//先判断是不是填写了内容
|
|
if (this.strSWMC.source == "" || this.strSWMC.dest == "") {
|
|
this.showTip("请填写需要修改的食物名称!")
|
|
//dLayer.msg('请填写需要修改的食物名称!');
|
|
return;
|
|
}
|
|
var _this = this; //this指向vue
|
|
_this.loading = true;
|
|
_this.btnLoading[0] = true;
|
|
_this.addNote("开始进行" + this.strSWMC.source + "替换操作,请等待");
|
|
var curUrl = '/strreplace/ReplaceXFL_SWMC?source=' + this.strSWMC.source + '&dest=' + this.strSWMC.dest;
|
|
|
|
(async () => {
|
|
await axios({
|
|
url: curUrl
|
|
}).then((res) => {
|
|
console.log(res);
|
|
_this.addNote("此次[食物名称]替换操作完成," + res.data.data + "谢谢使用!");
|
|
_this.loading = false;
|
|
_this.btnLoading[0] = false;
|
|
//增加日志20220921Add
|
|
addlog("SQL查询", "修改数据_替换[项目分类]")
|
|
});
|
|
})();
|
|
|
|
}
|
|
|
|
}
|
|
})
|
|
///////////////////////////////////////////////////
|
|
|
|
|
|
//加上日志20211109
|
|
function addlog(otype, ocontent, ouser) {
|
|
var curUser = "";
|
|
if (sessionStorage['userName'] != null) {
|
|
curUser = sessionStorage['userName']
|
|
} else {
|
|
curUser = ouser
|
|
}
|
|
|
|
$.get(Gaddress + "/operatelog/addlog?ouser=" + curUser + "&otype=" + otype + "&ocontent=" + ocontent.substring(0, 2500), {})
|
|
.then(function (e) { return true })
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
.el-header, .el-footer {
|
|
background-color: #B3C0D1;
|
|
color: #333;
|
|
text-align: center;
|
|
line-height: 60px;
|
|
}
|
|
|
|
|
|
.el-main {
|
|
background-color: #E9EEF3;
|
|
color: #333;
|
|
text-align: center;
|
|
line-height: 56px;
|
|
}
|
|
.el-button{
|
|
min-width:200px;
|
|
}
|
|
|
|
body > .el-container {
|
|
margin-bottom: 40px;
|
|
}
|
|
|
|
</style>
|